Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
eb5eef87
U
uni-app
项目概览
wzj-java
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
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,发现更多精彩内容 >>
提交
eb5eef87
编写于
9月 06, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
aa6f77c3
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
356 addition
and
355 deletion
+356
-355
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
...ound/uts/uni_modules/test-uniplugin/app-android/index.uts
+2
-0
packages/playground/uts/uni_modules/test-uniplugin/package.json
...es/playground/uts/uni_modules/test-uniplugin/package.json
+1
-26
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt
.../dist/app/uni_modules/test-uniplugin/app-android/index.kt
+3
-1
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt.map
...t/app/uni_modules/test-uniplugin/app-android/index.kt.map
+1
-1
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+90
-88
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+8
-12
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+249
-227
packages/uni-mp-kuaishou/dist/uni.compiler.js
packages/uni-mp-kuaishou/dist/uni.compiler.js
+2
-0
packages/uts-darwin-arm64/uts.darwin-arm64.node
packages/uts-darwin-arm64/uts.darwin-arm64.node
+0
-0
packages/uts-darwin-x64/uts.darwin-x64.node
packages/uts-darwin-x64/uts.darwin-x64.node
+0
-0
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
+0
-0
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
+0
-0
未找到文件。
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
浏览文件 @
eb5eef87
import Log from 'android.util.Log'
import FrameLayout from 'android.widget.FrameLayout'
import View from 'android.view.View'
import { IUser } from './interface.uts'
import { login } from './login.uts'
import logo from '../static/logo.png'
...
...
@@ -15,6 +16,7 @@ export class User implements IUser {
register(name: string, callback: () => void) {
Log.info(logo as FrameLayout)
}
test(view: View) {}
}
function login(name: string, callback: () => void) {}
export function register(name: string, callback: () => void) {}
packages/playground/uts/uni_modules/test-uniplugin/package.json
浏览文件 @
eb5eef87
...
...
@@ -3,30 +3,5 @@
"id"
:
"DCloud-UTSPlugin"
,
"version"
:
"0.0.1"
,
"description"
:
"UTS示例插件"
,
"main"
:
"interface.uts"
,
"_dp_type"
:
"nativeplugin"
,
"_dp_nativeplugin"
:{
"android"
:
{
"plugins"
:
[
{
"type"
:
"module"
,
"name"
:
"DCloud-UTSPlugin"
,
"class"
:
"io.dcloud.uniplugin.TestModule"
},
{
"type"
:
"component"
,
"name"
:
"uts-richtext"
,
"class"
:
"io.dcloud.uniplugin.TestComponent"
}
],
"integrateType"
:
"uts"
,
"dependencies"
:[
{
"id"
:
"com.zzhoujay.richtext:richtext"
,
"source"
:
"implementation 'com.zzhoujay.richtext:richtext:3.0.7'"
}
],
"minSdkVersion"
:
21
}
}
"main"
:
"interface.uts"
}
\ No newline at end of file
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt
浏览文件 @
eb5eef87
...
...
@@ -4,6 +4,7 @@ import io.dcloud.uts.runtime.*;
import
io.dcloud.uts.android.getResourcePath;
import
android.util.Log;
import
android.widget.FrameLayout;
import
android.view.View;
interface
IUser
{
fun
register
(
name
:
String
):
Unit
;
}
...
...
@@ -18,7 +19,7 @@ val __default = getResourcePath("uni_modules/test-uniplugin/static/logo.png");
open
class
User
:
IUser
{
open
suspend
fun
login
(
name
:
String
,
pwd
:
String
)
=
CoroutineScope
(
Dispatchers
.
Default
).
async
{
setTimeout
(
fun
(){
console
.
log
(
"timeout"
,
" at uni_modules/test-uniplugin/app-android/index.uts:
9
"
);
console
.
log
(
"timeout"
,
" at uni_modules/test-uniplugin/app-android/index.uts:
10
"
);
}
,
1000
);
login
(
name
,
pwd
);
...
...
@@ -28,6 +29,7 @@ open class User : IUser {
override
fun
register
(
name
:
String
,
callback
:
UTSCallback
)
{
Log
.
info
(
__default
as
FrameLayout
);
}
open
fun
test
(
view
:
View
)
{}
}
fun
login
(
name
:
String
,
callback
:
()
->
Unit
)
{}
fun
register
(
name
:
String
,
callback
:
UTSCallback
)
{}
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt.map
浏览文件 @
eb5eef87
{"version":3,"sources":["/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/static/logo.png","/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/interface.uts","/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import { getResourcePath } from 'io.dcloud.uts.android'\nexport default getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport { IUser } from './interface.uts'\nimport { login } from './login.uts'\nimport logo from '../static/logo.png'\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n Log.info('123')\n Log.info(logo)\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n}\nfunction login(name: string, callback: () => void) {}\nexport function register(name: string, callback: () => void) {}\n","export interface IUser {\n register(name: string): void\n}\n","export function login(name: string, pwd: string) {\n console.log('login')\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;UCDnC,KAAK;QACpB,QAAQ,CAAC,IAAY,EAAN,MAAM,GAAG,IAAI;;ACDvB,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,2DAAC;IACpB,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;AACtB;gBHFe,eAAe,CAAC,4CAA4C,CAAC;ACIrE,WAAM,IAAI,GAAY,KAAK;qBAC1B,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,UAAU,CAAC,KAAM;YACf,OAAO,CAAC,GAAG,CAAC,SAAS,2DAAC;QACxB;QAAC,EAAE,IAAI,CAAC;QACR,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;QACf,GAAG,CAAC,IAAI,WAAM;IAChB;iBACA,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE;QAC3C,GAAG,CAAC,IAAI,cAAS,WAAW,CAAC;IAC/B;CACD;AACD,UAAe,IAAY,EAAN,MAAM,EAAE,QAAoB,QAAJ,IAAI,EAAE,CAAC,CAAC;AAC9C,IAAS,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE,CAAC,CAAC"}
\ No newline at end of file
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/static/logo.png","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/interface.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import { getResourcePath } from 'io.dcloud.uts.android'\nexport default getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { IUser } from './interface.uts'\nimport { login } from './login.uts'\nimport logo from '../static/logo.png'\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n Log.info('123')\n Log.info(logo)\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {}\n}\nfunction login(name: string, callback: () => void) {}\nexport function register(name: string, callback: () => void) {}\n","export interface IUser {\n register(name: string): void\n}\n","export function login(name: string, pwd: string) {\n console.log('login')\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;UCFnB,KAAK;QACpB,QAAQ,CAAC,IAAY,EAAN,MAAM,GAAG,IAAI;;ACDvB,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,2DAAC;IACpB,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;AACtB;gBHFe,eAAe,CAAC,4CAA4C,CAAC;ACKrE,WAAM,IAAI,GAAY,KAAK;qBAC1B,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,UAAU,CAAC,KAAM;YACf,OAAO,CAAC,GAAG,CAAC,SAAS,4DAAC;QACxB;QAAC,EAAE,IAAI,CAAC;QACR,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;QACf,GAAG,CAAC,IAAI,WAAM;IAChB;iBACA,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE;QAC3C,GAAG,CAAC,IAAI,cAAS,WAAW,CAAC;IAC/B;aACA,IAAI,CAAC,IAAU,EAAJ,IAAI,EAAE,CAAC;CACnB;AACD,UAAe,IAAY,EAAN,MAAM,EAAE,QAAoB,QAAJ,IAAI,EAAE,CAAC,CAAC;AAC9C,IAAS,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE,CAAC,CAAC"}
\ No newline at end of file
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
eb5eef87
import { isArray, hasOwn as hasOwn$1, isString, isPlainObject, isObject as isObject$1, toRawType, capitalize, makeMap, isFunction, isPromise, extend, remove, toTypeString } from '@vue/shared';
import { LINEFEED, parseNVueDataset, once, I18N_JSON_DELIMITERS, Emitter, addLeadingSlash, resolveComponentInstance, invokeArrayFns, removeLeadingSlash, 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_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen, formatLog
, TABBAR_HEIGHT, NAVBAR_HEIGHT, sortObject, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, 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, ON_BACK_PRESS, 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, onCreateVueApp, ON_TAB_ITEM_TAP, ON_LAUNCH, ACTION_TYPE_EVENT, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE } from '@dcloudio/uni-shared';
import { ref,
injectHook, createVNode, render
, queuePostFlushCb, getCurrentInstance, onMounted, nextTick, onBeforeUnmount } from 'vue';
import { LINEFEED, parseNVueDataset, once, I18N_JSON_DELIMITERS, Emitter, addLeadingSlash, resolveComponentInstance, invokeArrayFns, removeLeadingSlash, 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,
formatLog, parseQuery, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen
, TABBAR_HEIGHT, NAVBAR_HEIGHT, sortObject, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, 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, ON_BACK_PRESS, 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, onCreateVueApp, ON_TAB_ITEM_TAP, ON_LAUNCH, ACTION_TYPE_EVENT, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE } from '@dcloudio/uni-shared';
import { ref,
createVNode, render, injectHook
, queuePostFlushCb, getCurrentInstance, onMounted, nextTick, onBeforeUnmount } from 'vue';
/*
* base64-arraybuffer
...
...
@@ -2070,6 +2070,90 @@ function normalizeCallback(method, callbacks) {
};
}
let vueApp;
function getVueApp() {
return vueApp;
}
function initVueApp(appVm) {
const appContext = appVm.$.appContext;
vueApp = extend(appContext.app, {
mountPage(pageComponent, pageProps, pageContainer) {
const vnode = createVNode(pageComponent, pageProps);
// store app context on the root VNode.
// this will be set on the root instance on initial mount.
vnode.appContext = appContext;
vnode.__page_container__ = pageContainer;
render(vnode, pageContainer);
const publicThis = vnode.component.proxy;
publicThis.__page_container__ = pageContainer;
return publicThis;
},
unmountPage: (pageInstance) => {
const { __page_container__ } = pageInstance;
if (__page_container__) {
__page_container__.isUnmounted = true;
render(null, __page_container__);
}
},
});
}
const pages = [];
function addCurrentPage(page) {
const $page = page.$page;
if (!$page.meta.isNVue) {
return pages.push(page);
}
// 开发阶段热刷新需要移除旧的相同 id 的 page
const index = pages.findIndex((p) => p.$page.id === page.$page.id);
if (index > -1) {
pages.splice(index, 1, page);
}
else {
pages.push(page);
}
}
function getPageById(id) {
return pages.find((page) => page.$page.id === id);
}
function getAllPages() {
return pages;
}
function getCurrentPages$1() {
const curPages = [];
pages.forEach((page) => {
if (page.$.__isTabBar) {
if (page.$.__isActive) {
curPages.push(page);
}
}
else {
curPages.push(page);
}
});
return curPages;
}
function removeCurrentPage() {
const page = getCurrentPage();
if (!page) {
return;
}
removePage(page);
}
function removePage(curPage) {
const index = pages.findIndex((page) => page === curPage);
if (index === -1) {
return;
}
if (!curPage.$page.meta.isNVue) {
getVueApp().unmountPage(curPage);
}
pages.splice(index, 1);
if ((process.env.NODE_ENV !== 'production')) {
console.log(formatLog('removePage', curPage.$page));
}
}
const METHODS$1 = {
play(ctx) {
return invokeVmMethodWithoutArgs(ctx, 'play');
...
...
@@ -2103,7 +2187,7 @@ const METHODS$1 = {
},
};
function operateVideoPlayer(videoId, pageId, type, data) {
const page = get
CurrentPages().find((page) => page.$page.id ===
pageId);
const page = get
PageById(
pageId);
if (page === null || page === void 0 ? void 0 : page.$page.meta.isNVue) {
const pageVm = page.$vm;
return METHODS$1[type](findElmById(videoId, pageVm), data);
...
...
@@ -2169,7 +2253,7 @@ const METHODS = {
},
};
function operateMap(id, pageId, type, data, operateMapCallback) {
const page = get
CurrentPages().find((page) => page.$page.id ===
pageId);
const page = get
PageById(
pageId);
if (page === null || page === void 0 ? void 0 : page.$page.meta.isNVue) {
const pageVm = page.$vm;
return METHODS[type](findElmById(id, pageVm), data);
...
...
@@ -12364,7 +12448,9 @@ const ShowModalOptions = {
formatArgs: {
title: '',
content: '',
placeholderText: '',
showCancel: true,
editable: false,
cancelText(_value, params) {
if (!hasOwn$1(params, 'cancelText')) {
const { t } = useI18n();
...
...
@@ -17406,90 +17492,6 @@ const VIEW_WEBVIEW_PATH = '_www/__uniappview.html';
const WEBVIEW_ID_PREFIX = 'webviewId';
const SDK_UNI_MP_NATIVE_EVENT = 'uniMPNativeEvent';
let vueApp;
function getVueApp() {
return vueApp;
}
function initVueApp(appVm) {
const appContext = appVm.$.appContext;
vueApp = extend(appContext.app, {
mountPage(pageComponent, pageProps, pageContainer) {
const vnode = createVNode(pageComponent, pageProps);
// store app context on the root VNode.
// this will be set on the root instance on initial mount.
vnode.appContext = appContext;
vnode.__page_container__ = pageContainer;
render(vnode, pageContainer);
const publicThis = vnode.component.proxy;
publicThis.__page_container__ = pageContainer;
return publicThis;
},
unmountPage: (pageInstance) => {
const { __page_container__ } = pageInstance;
if (__page_container__) {
__page_container__.isUnmounted = true;
render(null, __page_container__);
}
},
});
}
const pages = [];
function addCurrentPage(page) {
const $page = page.$page;
if (!$page.meta.isNVue) {
return pages.push(page);
}
// 开发阶段热刷新需要移除旧的相同 id 的 page
const index = pages.findIndex((p) => p.$page.id === page.$page.id);
if (index > -1) {
pages.splice(index, 1, page);
}
else {
pages.push(page);
}
}
function getPageById(id) {
return pages.find((page) => page.$page.id === id);
}
function getAllPages() {
return pages;
}
function getCurrentPages$1() {
const curPages = [];
pages.forEach((page) => {
if (page.$.__isTabBar) {
if (page.$.__isActive) {
curPages.push(page);
}
}
else {
curPages.push(page);
}
});
return curPages;
}
function removeCurrentPage() {
const page = getCurrentPage();
if (!page) {
return;
}
removePage(page);
}
function removePage(curPage) {
const index = pages.findIndex((page) => page === curPage);
if (index === -1) {
return;
}
if (!curPage.$page.meta.isNVue) {
getVueApp().unmountPage(curPage);
}
pages.splice(index, 1);
if ((process.env.NODE_ENV !== 'production')) {
console.log(formatLog('removePage', curPage.$page));
}
}
function initNVue(webviewStyle, routeMeta, path) {
if (path && routeMeta.isNVue) {
webviewStyle.uniNView = {
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
eb5eef87
...
...
@@ -8646,27 +8646,27 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
control
.
remove
();
}
}
onMapReady
((
map
,
maps
,
trigger
)
=>
{
onMapReady
((
_
,
__
,
trigger
)
=>
{
function
updateControl
(
option
)
{
removeControl
();
addControl
(
option
);
}
function
addControl
(
option
)
{
const
position
=
option
.
position
||
{};
control
=
document
.
createElement
(
"
div
"
);
const
img
=
new
Image
();
control
.
appendChild
(
img
);
const
style
=
control
.
style
;
style
.
position
=
"
absolute
"
;
style
.
width
=
"
0
"
;
style
.
height
=
"
0
"
;
style
.
top
=
"
0
"
;
style
.
left
=
"
0
"
;
const
img
=
new
Image
();
img
.
src
=
getRealPath
(
option
.
iconPath
);
img
.
onload
=
()
=>
{
if
(
option
.
position
.
width
)
{
const
position
=
option
.
position
||
{};
if
(
position
.
width
)
{
img
.
width
=
option
.
position
.
width
;
}
if
(
option
.
position
.
height
)
{
if
(
position
.
height
)
{
img
.
height
=
option
.
position
.
height
;
}
const
style2
=
img
.
style
;
...
...
@@ -8674,8 +8674,9 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
style2
.
left
=
(
position
.
left
||
0
)
+
"
px
"
;
style2
.
top
=
(
position
.
top
||
0
)
+
"
px
"
;
style2
.
maxWidth
=
"
initial
"
;
control
.
appendChild
(
img
);
props2
.
rootRef
.
value
&&
props2
.
rootRef
.
value
.
appendChild
(
control
);
};
img
.
src
=
getRealPath
(
option
.
iconPath
);
img
.
onclick
=
function
(
$event
)
{
if
(
option
.
clickable
)
{
trigger
(
"
controltap
"
,
$event
,
{
...
...
@@ -8683,11 +8684,6 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
});
}
};
if
(
getIsAMap
())
{
props2
.
rootRef
.
value
&&
props2
.
rootRef
.
value
.
appendChild
(
control
);
}
else
{
map
.
controls
[
maps
.
ControlPosition
.
TOP_LEFT
].
push
(
control
);
}
}
addControl
(
props2
);
vue
.
watch
(
props2
,
updateControl
);
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
eb5eef87
...
...
@@ -5442,7 +5442,9 @@ const ShowModalOptions = {
formatArgs: {
title: "",
content: "",
placeholderText: "",
showCancel: true,
editable: false,
cancelText(_value, params) {
if (!hasOwn(params, "cancelText")) {
const { t: t2 } = useI18n();
...
...
@@ -16352,27 +16354,27 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
control.remove();
}
}
onMapReady((
map, maps2
, trigger) => {
onMapReady((
_, __
, trigger) => {
function updateControl(option) {
removeControl();
addControl(option);
}
function addControl(option) {
const position = option.position || {};
control = document.createElement("div");
const img = new Image();
control.appendChild(img);
const style = control.style;
style.position = "absolute";
style.width = "0";
style.height = "0";
style.top = "0";
style.left = "0";
const img = new Image();
img.src = getRealPath(option.iconPath);
img.onload = () => {
if (option.position.width) {
const position = option.position || {};
if (position.width) {
img.width = option.position.width;
}
if (
option.
position.height) {
if (position.height) {
img.height = option.position.height;
}
const style2 = img.style;
...
...
@@ -16380,8 +16382,9 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
style2.left = (position.left || 0) + "px";
style2.top = (position.top || 0) + "px";
style2.maxWidth = "initial";
control.appendChild(img);
props2.rootRef.value && props2.rootRef.value.appendChild(control);
};
img.src = getRealPath(option.iconPath);
img.onclick = function($event) {
if (option.clickable) {
trigger("controltap", $event, {
...
...
@@ -16389,11 +16392,6 @@ var MapControl = /* @__PURE__ */ defineSystemComponent({
});
}
};
if (getIsAMap()) {
props2.rootRef.value && props2.rootRef.value.appendChild(control);
} else {
map.controls[maps2.ControlPosition.TOP_LEFT].push(control);
}
}
addControl(props2);
watch(props2, updateControl);
...
...
@@ -16999,204 +16997,6 @@ const vibrateLong = /* @__PURE__ */ defineAsyncApi(API_VIBRATE_LONG, (args, { re
reject("vibrateLong:fail");
}
});
const KEY_MAPS = {
esc: ["Esc", "Escape"],
enter: ["Enter"]
};
const KEYS = Object.keys(KEY_MAPS);
function useKeyboard() {
const key = ref("");
const disable = ref(false);
const onKeyup = (evt) => {
if (disable.value) {
return;
}
const res = KEYS.find((key2) => KEY_MAPS[key2].indexOf(evt.key) !== -1);
if (res) {
key.value = res;
}
nextTick(() => key.value = "");
};
onMounted(() => {
document.addEventListener("keyup", onKeyup);
});
onBeforeUnmount(() => {
document.removeEventListener("keyup", onKeyup);
});
return {
key,
disable
};
}
const VNODE_MASK = /* @__PURE__ */ createVNode("div", { class: "uni-mask" }, null, -1);
function createRootApp(component, rootState, callback) {
rootState.onClose = (...args) => (rootState.visible = false, callback.apply(null, args));
return createApp(defineComponent({
setup() {
return () => (openBlock(), createBlock(component, rootState, null, 16));
}
}));
}
function ensureRoot(id2) {
let rootEl = document.getElementById(id2);
if (!rootEl) {
rootEl = document.createElement("div");
rootEl.id = id2;
document.body.append(rootEl);
}
return rootEl;
}
function usePopup(props2, {
onEsc,
onEnter
}) {
const visible = ref(props2.visible);
const { key, disable } = useKeyboard();
watch(() => props2.visible, (value) => visible.value = value);
watch(() => visible.value, (value) => disable.value = !value);
watchEffect(() => {
const { value } = key;
if (value === "esc") {
onEsc && onEsc();
} else if (value === "enter") {
onEnter && onEnter();
}
});
return visible;
}
const props$a = {
title: {
type: String,
default: ""
},
content: {
type: String,
default: ""
},
showCancel: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: "Cancel"
},
cancelColor: {
type: String,
default: "#000000"
},
confirmText: {
type: String,
default: "OK"
},
confirmColor: {
type: String,
default: "#007aff"
},
visible: {
type: Boolean
},
editable: {
type: Boolean,
default: false
},
placeholderText: {
type: String,
default: ""
}
};
var modal = /* @__PURE__ */ defineComponent({
props: props$a,
setup(props2, {
emit: emit2
}) {
const editContent = ref("");
const close = () => visible.value = false;
const cancel = () => (close(), emit2("close", "cancel"));
const confirm = () => (close(), emit2("close", "confirm", editContent.value));
const visible = usePopup(props2, {
onEsc: cancel,
onEnter: () => {
!props2.editable && confirm();
}
});
return () => {
const {
title,
content,
showCancel,
confirmText,
confirmColor,
editable,
placeholderText
} = props2;
editContent.value = content;
return createVNode(Transition, {
"name": "uni-fade"
}, {
default: () => [withDirectives(createVNode("uni-modal", {
"onTouchmove": onEventPrevent
}, [VNODE_MASK, createVNode("div", {
"class": "uni-modal"
}, [title && createVNode("div", {
"class": "uni-modal__hd"
}, [createVNode("strong", {
"class": "uni-modal__title",
"textContent": title
}, null, 8, ["textContent"])]), editable ? createVNode("textarea", {
"class": "uni-modal__textarea",
"rows": "1",
"placeholder": placeholderText,
"value": content,
"onInput": (e2) => editContent.value = e2.target.value
}, null, 40, ["placeholder", "value", "onInput"]) : createVNode("div", {
"class": "uni-modal__bd",
"onTouchmovePassive": onEventStop,
"textContent": content
}, null, 40, ["onTouchmovePassive", "textContent"]), createVNode("div", {
"class": "uni-modal__ft"
}, [showCancel && createVNode("div", {
"style": {
color: props2.cancelColor
},
"class": "uni-modal__btn uni-modal__btn_default",
"onClick": cancel
}, [props2.cancelText], 12, ["onClick"]), createVNode("div", {
"style": {
color: confirmColor
},
"class": "uni-modal__btn uni-modal__btn_primary",
"onClick": confirm
}, [confirmText], 12, ["onClick"])])])], 40, ["onTouchmove"]), [[vShow, visible.value]])]
});
};
}
});
let showModalState;
const onHidePopupOnce$1 = /* @__PURE__ */ once(() => {
UniServiceJSBridge.on("onHidePopup", () => showModalState.visible = false);
});
let currentShowModalResolve;
function onModalClose(type, content) {
const isConfirm = type === "confirm";
const res = {
confirm: isConfirm,
cancel: type === "cancel"
};
isConfirm && showModalState.editable && (res.content = content);
currentShowModalResolve && currentShowModalResolve(res);
}
const showModal = /* @__PURE__ */ defineAsyncApi(API_SHOW_MODAL, (args, { resolve }) => {
onHidePopupOnce$1();
currentShowModalResolve = resolve;
if (!showModalState) {
showModalState = reactive(args);
nextTick(() => (createRootApp(modal, showModalState, onModalClose).mount(ensureRoot("u-a-m")), nextTick(() => showModalState.visible = true)));
} else {
extend(showModalState, args);
showModalState.visible = true;
}
}, ShowModalProtocol, ShowModalOptions);
const getClipboardData = /* @__PURE__ */ defineAsyncApi(API_GET_CLIPBOARD_DATA, async (_, { resolve, reject }) => {
initI18nGetClipboardDataMsgsOnce();
const { t: t2 } = useI18n();
...
...
@@ -17204,24 +17004,48 @@ const getClipboardData = /* @__PURE__ */ defineAsyncApi(API_GET_CLIPBOARD_DATA,
const data = await navigator.clipboard.readText();
resolve({ data });
} catch (error) {
reject(`${error} ${t2("uni.getClipboardData.fail")}`);
_getClipboardData(resolve, () => {
reject(`${error} ${t2("uni.getClipboardData.fail")}`);
});
}
});
const setClipboardData = /* @__PURE__ */ defineAsyncApi(API_SET_CLIPBOARD_DATA, async ({ data }, { resolve, reject }) => {
initI18nSetClipboardDataMsgsOnce();
const { t: t2 } = useI18n();
try {
await navigator.clipboard.writeText(data);
resolve();
} catch (error) {
reject();
showModal({
title: t2("uni.setClipboardData.fail"),
content: data,
editable: true
});
_setClipboardData(data, resolve, reject);
}
}, SetClipboardDataProtocol, SetClipboardDataOptions);
function _getClipboardData(resolve, reject) {
const pasteText = document.getElementById("#clipboard");
const data = pasteText ? pasteText.value : void 0;
if (data) {
resolve({ data });
} else {
reject();
}
}
function _setClipboardData(data, resolve, reject) {
const pasteText = document.getElementById("#clipboard");
pasteText && pasteText.remove();
const textarea = document.createElement("textarea");
textarea.id = "#clipboard";
textarea.style.position = "fixed";
textarea.style.top = "-9999px";
textarea.style.zIndex = "-9999";
document.body.appendChild(textarea);
textarea.value = data;
textarea.select();
textarea.setSelectionRange(0, textarea.value.length);
const result = document.execCommand("Copy", false);
textarea.blur();
if (result) {
resolve();
} else {
reject();
}
}
const STORAGE_KEYS = "uni-storage-keys";
function parseValue(value) {
const types = ["object", "string", "number", "boolean", "undefined"];
...
...
@@ -17594,6 +17418,71 @@ const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({
console.warn(t2("uni.chooseFile.notUserActivation"));
}
}, ChooseImageProtocol, ChooseImageOptions);
const KEY_MAPS = {
esc: ["Esc", "Escape"],
enter: ["Enter"]
};
const KEYS = Object.keys(KEY_MAPS);
function useKeyboard() {
const key = ref("");
const disable = ref(false);
const onKeyup = (evt) => {
if (disable.value) {
return;
}
const res = KEYS.find((key2) => KEY_MAPS[key2].indexOf(evt.key) !== -1);
if (res) {
key.value = res;
}
nextTick(() => key.value = "");
};
onMounted(() => {
document.addEventListener("keyup", onKeyup);
});
onBeforeUnmount(() => {
document.removeEventListener("keyup", onKeyup);
});
return {
key,
disable
};
}
const VNODE_MASK = /* @__PURE__ */ createVNode("div", { class: "uni-mask" }, null, -1);
function createRootApp(component, rootState, callback) {
rootState.onClose = (...args) => (rootState.visible = false, callback.apply(null, args));
return createApp(defineComponent({
setup() {
return () => (openBlock(), createBlock(component, rootState, null, 16));
}
}));
}
function ensureRoot(id2) {
let rootEl = document.getElementById(id2);
if (!rootEl) {
rootEl = document.createElement("div");
rootEl.id = id2;
document.body.append(rootEl);
}
return rootEl;
}
function usePopup(props2, {
onEsc,
onEnter
}) {
const visible = ref(props2.visible);
const { key, disable } = useKeyboard();
watch(() => props2.visible, (value) => visible.value = value);
watch(() => visible.value, (value) => disable.value = !value);
watchEffect(() => {
const { value } = key;
if (value === "esc") {
onEsc && onEsc();
} else if (value === "enter") {
onEnter && onEnter();
}
});
return visible;
}
let index$d = 0;
let overflow = "";
function preventScroll(prevent) {
...
...
@@ -17614,7 +17503,7 @@ function usePreventScroll() {
onMounted(() => preventScroll(true));
onUnmounted(() => preventScroll(false));
}
const props$
9
= {
const props$
a
= {
src: {
type: String,
default: ""
...
...
@@ -17622,7 +17511,7 @@ const props$9 = {
};
var ImageView = /* @__PURE__ */ defineSystemComponent({
name: "ImageView",
props: props$
9
,
props: props$
a
,
setup(props2) {
const state2 = reactive({
direction: "none"
...
...
@@ -17712,7 +17601,7 @@ var ImageView = /* @__PURE__ */ defineSystemComponent({
function _isSlot$2(s) {
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
}
const props$
8
= {
const props$
9
= {
urls: {
type: Array,
default() {
...
...
@@ -17731,7 +17620,7 @@ function getIndex(props2) {
}
var ImagePreview = /* @__PURE__ */ defineSystemComponent({
name: "ImagePreview",
props: props$
8
,
props: props$
9
,
emits: ["close"],
setup(props2, {
emit: emit2
...
...
@@ -18504,7 +18393,7 @@ const getLocation = /* @__PURE__ */ defineAsyncApi(API_GET_LOCATION, ({ type, al
});
}, GetLocationProtocol, GetLocationOptions);
const ICON_PATH_NAV = "M28 17c-6.49396875 0-12.13721875 2.57040625-15 6.34840625V5.4105l6.29859375 6.29859375c0.387875 0.387875 1.02259375 0.387875 1.4105 0 0.387875-0.387875 0.387875-1.02259375 0-1.4105L12.77853125 2.36803125a0.9978125 0.9978125 0 0 0-0.0694375-0.077125c-0.1944375-0.1944375-0.45090625-0.291375-0.70721875-0.290875l-0.00184375-0.0000625-0.00184375 0.0000625c-0.2563125-0.0005-0.51278125 0.09640625-0.70721875 0.290875a0.9978125 0.9978125 0 0 0-0.0694375 0.077125l-7.930625 7.9305625c-0.387875 0.387875-0.387875 1.02259375 0 1.4105 0.387875 0.387875 1.02259375 0.387875 1.4105 0L11 5.4105V29c0 0.55 0.45 1 1 1s1-0.45 1-1c0-5.52284375 6.71571875-10 15-10 0.55228125 0 1-0.44771875 1-1 0-0.55228125-0.44771875-1-1-1z";
const props$
7
= {
const props$
8
= {
latitude: {
type: Number
},
...
...
@@ -18561,7 +18450,7 @@ function useState$2(props2) {
}
var LocationView = /* @__PURE__ */ defineSystemComponent({
name: "LocationView",
props: props$
7
,
props: props$
8
,
emits: ["close"],
setup(props2, {
emit: emit2
...
...
@@ -18674,7 +18563,7 @@ const openLocation = /* @__PURE__ */ defineAsyncApi(API_OPEN_LOCATION, (args, {
function _isSlot$1(s) {
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
}
const props$
6
= {
const props$
7
= {
latitude: {
type: Number
},
...
...
@@ -18840,7 +18729,7 @@ function useList(state2) {
}
var LoctaionPicker = /* @__PURE__ */ defineSystemComponent({
name: "LoctaionPicker",
props: props$
6
,
props: props$
7
,
emits: ["close"],
setup(props2, {
emit: emit2
...
...
@@ -19124,6 +19013,139 @@ const preloadPage = /* @__PURE__ */ defineAsyncApi(API_PRELOAD_PAGE, ({ url }, {
reject(`${url} ${String(err)}`);
});
}, PreloadPageProtocol);
const props$6 = {
title: {
type: String,
default: ""
},
content: {
type: String,
default: ""
},
showCancel: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: "Cancel"
},
cancelColor: {
type: String,
default: "#000000"
},
confirmText: {
type: String,
default: "OK"
},
confirmColor: {
type: String,
default: "#007aff"
},
visible: {
type: Boolean
},
editable: {
type: Boolean,
default: false
},
placeholderText: {
type: String,
default: ""
}
};
var modal = /* @__PURE__ */ defineComponent({
props: props$6,
setup(props2, {
emit: emit2
}) {
const editContent = ref("");
const close = () => visible.value = false;
const cancel = () => (close(), emit2("close", "cancel"));
const confirm = () => (close(), emit2("close", "confirm", editContent.value));
const visible = usePopup(props2, {
onEsc: cancel,
onEnter: () => {
!props2.editable && confirm();
}
});
return () => {
const {
title,
content,
showCancel,
confirmText,
confirmColor,
editable,
placeholderText
} = props2;
editContent.value = content;
return createVNode(Transition, {
"name": "uni-fade"
}, {
default: () => [withDirectives(createVNode("uni-modal", {
"onTouchmove": onEventPrevent
}, [VNODE_MASK, createVNode("div", {
"class": "uni-modal"
}, [title && createVNode("div", {
"class": "uni-modal__hd"
}, [createVNode("strong", {
"class": "uni-modal__title",
"textContent": title
}, null, 8, ["textContent"])]), editable ? createVNode("textarea", {
"class": "uni-modal__textarea",
"rows": "1",
"placeholder": placeholderText,
"value": content,
"onInput": (e2) => editContent.value = e2.target.value
}, null, 40, ["placeholder", "value", "onInput"]) : createVNode("div", {
"class": "uni-modal__bd",
"onTouchmovePassive": onEventStop,
"textContent": content
}, null, 40, ["onTouchmovePassive", "textContent"]), createVNode("div", {
"class": "uni-modal__ft"
}, [showCancel && createVNode("div", {
"style": {
color: props2.cancelColor
},
"class": "uni-modal__btn uni-modal__btn_default",
"onClick": cancel
}, [props2.cancelText], 12, ["onClick"]), createVNode("div", {
"style": {
color: confirmColor
},
"class": "uni-modal__btn uni-modal__btn_primary",
"onClick": confirm
}, [confirmText], 12, ["onClick"])])])], 40, ["onTouchmove"]), [[vShow, visible.value]])]
});
};
}
});
let showModalState;
const onHidePopupOnce$1 = /* @__PURE__ */ once(() => {
UniServiceJSBridge.on("onHidePopup", () => showModalState.visible = false);
});
let currentShowModalResolve;
function onModalClose(type, content) {
const isConfirm = type === "confirm";
const res = {
confirm: isConfirm,
cancel: type === "cancel"
};
isConfirm && showModalState.editable && (res.content = content);
currentShowModalResolve && currentShowModalResolve(res);
}
const showModal = /* @__PURE__ */ defineAsyncApi(API_SHOW_MODAL, (args, { resolve }) => {
onHidePopupOnce$1();
currentShowModalResolve = resolve;
if (!showModalState) {
showModalState = reactive(args);
nextTick(() => (createRootApp(modal, showModalState, onModalClose).mount(ensureRoot("u-a-m")), nextTick(() => showModalState.visible = true)));
} else {
extend(showModalState, args);
showModalState.visible = true;
}
}, ShowModalProtocol, ShowModalOptions);
const props$5 = {
title: {
type: String,
...
...
packages/uni-mp-kuaishou/dist/uni.compiler.js
浏览文件 @
eb5eef87
...
...
@@ -109,6 +109,8 @@ var source = {
*/
const
transformOn
=
uniCliShared
.
createTransformOn
(
uniMpCompiler
.
transformOn
,
{
match
:
(
name
,
node
,
context
)
=>
{
if
(
name
===
'
getphonenumber
'
)
return
true
;
if
(
name
===
'
input
'
&&
(
node
.
tag
===
'
input
'
||
node
.
tag
===
'
textarea
'
))
{
return
true
;
}
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
eb5eef87
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
eb5eef87
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
eb5eef87
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
eb5eef87
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录