Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小浣熊撸代码
uni-app
提交
72ea5fa3
U
uni-app
项目概览
小浣熊撸代码
/
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,发现更多精彩内容 >>
提交
72ea5fa3
编写于
5月 19, 2021
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(h5): createAnimation
上级
fa5b7b4b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
446 addition
and
41 deletion
+446
-41
packages/uni-api/src/index.ts
packages/uni-api/src/index.ts
+1
-0
packages/uni-api/src/protocols/ui/createAnimation.ts
packages/uni-api/src/protocols/ui/createAnimation.ts
+34
-0
packages/uni-api/src/service/ui/createAnimation.ts
packages/uni-api/src/service/ui/createAnimation.ts
+27
-11
packages/uni-core/src/helpers/animation.ts
packages/uni-core/src/helpers/animation.ts
+130
-0
packages/uni-core/src/view/plugin/index.ts
packages/uni-core/src/view/plugin/index.ts
+2
-0
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+251
-30
packages/uni-h5/src/service/api/index.ts
packages/uni-h5/src/service/api/index.ts
+1
-0
未找到文件。
packages/uni-api/src/index.ts
浏览文件 @
72ea5fa3
...
...
@@ -9,6 +9,7 @@ export * from './service/context/canvas'
export
*
from
'
./service/ui/createIntersectionObserver
'
export
*
from
'
./service/ui/createSelectorQuery
'
export
*
from
'
./service/ui/createAnimation
'
export
*
from
'
./service/ui/tabBar
'
export
*
from
'
./service/keyboard/getSelectedTextRange
'
...
...
packages/uni-api/src/protocols/ui/createAnimation.ts
0 → 100644
浏览文件 @
72ea5fa3
import
{
elemInArray
}
from
'
../../helpers/protocol
'
export
const
API_CREATE_ANIMATION
=
'
createAnimation
'
export
type
API_TYPE_CREATE_ANIMATION
=
typeof
uni
.
createAnimation
export
type
API_TYPE_CREATE_ANIMATION_Timing_Function
=
UniApp
.
CreateAnimationOptions
[
'
timingFunction
'
]
const
timingFunctions
:
API_TYPE_CREATE_ANIMATION_Timing_Function
[]
=
[
'
linear
'
,
'
ease
'
,
'
ease-in
'
,
'
ease-in-out
'
,
'
ease-out
'
,
'
step-start
'
,
'
step-end
'
,
]
export
const
CreateAnimationOptions
:
ApiOptions
<
API_TYPE_CREATE_ANIMATION
>
=
{
// 目前参数校验不支持此api校验
formatArgs
:
{
/* duration: 400,
timingFunction(timingFunction, params) {
params.timingFunction = elemInArray(timingFunction, timingFunctions)
},
delay: 0,
transformOrigin: '50% 50% 0', */
},
}
export
const
CreateAnimationProtocol
:
ApiProtocol
<
API_TYPE_CREATE_ANIMATION
>
=
{
duration
:
Number
,
timingFunction
:
String
as
any
,
delay
:
Number
,
transformOrigin
:
String
,
}
packages/uni-api/src/service/ui/createAnimation.ts
浏览文件 @
72ea5fa3
import
{
API_CREATE_ANIMATION
,
API_TYPE_CREATE_ANIMATION
,
CreateAnimationProtocol
,
CreateAnimationOptions
,
}
from
'
../../protocols/ui/createAnimation
'
import
{
defineSyncApi
}
from
'
../../helpers/api
'
const
defaultOption
:
Option
=
{
duration
:
400
,
timingFunction
:
'
linear
'
,
...
...
@@ -7,18 +15,19 @@ const defaultOption: Option = {
type
Option
=
UniApp
.
CreateAnimationOptions
type
AnimatesArgs
=
string
[]
type
Action
=
{
animates
:
string
[]
export
type
CurrentStepAnimates
=
Array
<
{
type
:
string
;
args
:
AnimatesArgs
}
>
export
type
AnimationAction
=
{
animates
:
CurrentStepAnimates
option
:
ReturnType
<
MPAnimation
[
'
_getOption
'
]
>
}
class
MPAnimation
implements
UniApp
.
Animation
{
actions
:
Array
<
Action
>
export
class
MPAnimation
implements
UniApp
.
Animation
{
actions
:
Array
<
A
nimationA
ction
>
currentTransform
:
Data
currentStepAnimates
:
Array
<
{
type
:
string
;
args
:
AnimatesArgs
}
>
currentStepAnimates
:
CurrentStepAnimates
option
:
Option
constructor
(
option
:
Option
)
{
constructor
(
option
?
:
Option
)
{
this
.
actions
=
[]
this
.
currentTransform
=
{}
this
.
currentStepAnimates
=
[]
...
...
@@ -72,7 +81,9 @@ class MPAnimation implements UniApp.Animation {
}
})
this
.
actions
.
push
({
animates
:
Object
.
values
(
this
.
currentTransform
)
as
Action
[
'
animates
'
],
animates
:
Object
.
values
(
this
.
currentTransform
)
as
AnimationAction
[
'
animates
'
],
option
:
this
.
_getOption
(
option
),
})
this
.
currentStepAnimates
=
[]
...
...
@@ -144,10 +155,15 @@ animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
}
else
{
_this
.
_pushAnimates
(
type
,
args
)
}
return
this
return
_
this
}
})
export
function
createAnimation
(
option
:
Option
)
{
return
new
MPAnimation
(
option
)
}
export
const
createAnimation
=
defineSyncApi
<
API_TYPE_CREATE_ANIMATION
>
(
API_CREATE_ANIMATION
,
(
option
)
=>
{
return
new
MPAnimation
(
option
)
},
CreateAnimationProtocol
,
CreateAnimationOptions
)
packages/uni-core/src/helpers/animation.ts
0 → 100644
浏览文件 @
72ea5fa3
import
{
ComponentOptionsMixin
}
from
'
vue
'
import
{
AnimationAction
,
MPAnimation
}
from
'
@dcloudio/uni-api
'
function
converPx
(
value
:
string
)
{
if
(
/^-
?\d
+
[
ur
]
px$/i
.
test
(
value
))
{
return
value
.
replace
(
/
(
^-
?\d
+
)[
ur
]
px$/i
,
(
text
,
num
)
=>
{
return
`
${
uni
.
upx2px
(
parseFloat
(
num
))}
px`
})
// eslint-disable-next-line no-useless-escape
}
else
if
(
/^-
?[\d\.]
+$/
.
test
(
value
))
{
return
`
${
value
}
px`
}
return
value
||
''
}
function
converType
(
type
:
string
)
{
return
type
.
replace
(
/
[
A-Z
]
/g
,
(
text
)
=>
{
return
`-
${
text
.
toLowerCase
()}
`
})
.
replace
(
'
webkit
'
,
'
-webkit
'
)
}
function
getStyle
(
action
:
AnimationAction
)
{
const
animateTypes1
=
[
'
matrix
'
,
'
matrix3d
'
,
'
scale
'
,
'
scale3d
'
,
'
rotate3d
'
,
'
skew
'
,
'
translate
'
,
'
translate3d
'
,
]
const
animateTypes2
=
[
'
scaleX
'
,
'
scaleY
'
,
'
scaleZ
'
,
'
rotate
'
,
'
rotateX
'
,
'
rotateY
'
,
'
rotateZ
'
,
'
skewX
'
,
'
skewY
'
,
'
translateX
'
,
'
translateY
'
,
'
translateZ
'
,
]
const
animateTypes3
=
[
'
opacity
'
,
'
background-color
'
]
const
animateTypes4
=
[
'
width
'
,
'
height
'
,
'
left
'
,
'
right
'
,
'
top
'
,
'
bottom
'
]
const
animates
=
action
.
animates
const
option
=
action
.
option
const
transition
=
option
.
transition
const
style
:
Partial
<
CSSStyleDeclaration
>
=
{}
const
transform
:
string
[]
=
[]
animates
.
forEach
((
animate
)
=>
{
let
type
=
animate
.
type
let
args
=
[...
animate
.
args
]
if
(
animateTypes1
.
concat
(
animateTypes2
).
includes
(
type
))
{
if
(
type
.
startsWith
(
'
rotate
'
)
||
type
.
startsWith
(
'
skew
'
))
{
args
=
args
.
map
((
value
)
=>
parseFloat
(
value
)
+
'
deg
'
)
}
else
if
(
type
.
startsWith
(
'
translate
'
))
{
args
=
args
.
map
(
converPx
)
}
if
(
animateTypes2
.
indexOf
(
type
)
>=
0
)
{
args
.
length
=
1
}
transform
.
push
(
`
${
type
}
(
${
args
.
join
(
'
,
'
)}
)`
)
}
else
if
(
animateTypes3
.
concat
(
animateTypes4
).
includes
(
args
[
0
]))
{
type
=
args
[
0
]
const
value
=
args
[
1
]
;(
style
as
any
)[
type
]
=
animateTypes4
.
includes
(
type
)
?
converPx
(
value
)
:
value
}
})
style
.
transform
=
style
.
webkitTransform
=
transform
.
join
(
'
'
)
style
.
transition
=
style
.
webkitTransition
=
Object
.
keys
(
style
)
.
map
(
(
type
)
=>
`
${
converType
(
type
)}
${
transition
.
duration
}
ms
${
transition
.
timingFunction
}
${
transition
.
delay
}
ms`
)
.
join
(
'
,
'
)
style
.
transformOrigin
=
style
.
webkitTransformOrigin
=
option
.
transformOrigin
return
style
}
function
startAnimation
(
context
:
ComponentOptionsMixin
)
{
const
animation
=
context
.
animation
as
MPAnimation
if
(
!
animation
||
!
animation
.
actions
||
!
animation
.
actions
.
length
)
{
return
}
let
index
=
0
const
actions
=
animation
.
actions
const
length
=
animation
.
actions
.
length
function
animate
()
{
const
action
=
actions
[
index
]
const
transition
=
action
.
option
.
transition
const
style
=
getStyle
(
action
)
Object
.
keys
(
style
).
forEach
((
key
)
=>
{
context
.
$el
.
style
[
key
]
=
(
style
as
any
)[
key
]
})
index
+=
1
if
(
index
<
length
)
{
setTimeout
(
animate
,
transition
.
duration
!
+
transition
.
delay
!
)
}
}
setTimeout
(()
=>
{
animate
()
},
0
)
}
export
default
{
props
:
[
'
animation
'
],
watch
:
{
animation
:
{
deep
:
true
,
handler
()
{
startAnimation
(
this
)
},
},
},
mounted
()
{
startAnimation
(
this
)
},
}
packages/uni-core/src/view/plugin/index.ts
浏览文件 @
72ea5fa3
import
{
App
}
from
'
vue
'
import
animation
from
'
../../helpers/animation
'
import
{
initLongPress
}
from
'
./longPress
'
import
{
initAppConfig
}
from
'
./appConfig
'
import
{
initCostomDataset
}
from
'
@dcloudio/uni-shared
'
...
...
@@ -13,6 +14,7 @@ export function initView(app: App) {
initLongPress
()
}
initAppConfig
(
app
.
_context
.
config
)
app
.
mixin
(
animation
)
// TODO wxs,behaviors
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
72ea5fa3
...
...
@@ -250,6 +250,115 @@ function initBridge(namespace) {
});
}
const ViewJSBridge = /* @__PURE__ */ initBridge("view");
function converPx(value) {
if (/^-?\d+[ur]px$/i.test(value)) {
return value.replace(/(^-?\d+)[ur]px$/i, (text2, num) => {
return `${uni.upx2px(parseFloat(num))}px`;
});
} else if (/^-?[\d\.]+$/.test(value)) {
return `${value}px`;
}
return value || "";
}
function converType(type) {
return type.replace(/[A-Z]/g, (text2) => {
return `-${text2.toLowerCase()}`;
}).replace("webkit", "-webkit");
}
function getStyle(action) {
const animateTypes12 = [
"matrix",
"matrix3d",
"scale",
"scale3d",
"rotate3d",
"skew",
"translate",
"translate3d"
];
const animateTypes22 = [
"scaleX",
"scaleY",
"scaleZ",
"rotate",
"rotateX",
"rotateY",
"rotateZ",
"skewX",
"skewY",
"translateX",
"translateY",
"translateZ"
];
const animateTypes32 = ["opacity", "background-color"];
const animateTypes4 = ["width", "height", "left", "right", "top", "bottom"];
const animates = action.animates;
const option = action.option;
const transition = option.transition;
const style = {};
const transform = [];
animates.forEach((animate) => {
let type = animate.type;
let args = [...animate.args];
if (animateTypes12.concat(animateTypes22).includes(type)) {
if (type.startsWith("rotate") || type.startsWith("skew")) {
args = args.map((value) => parseFloat(value) + "deg");
} else if (type.startsWith("translate")) {
args = args.map(converPx);
}
if (animateTypes22.indexOf(type) >= 0) {
args.length = 1;
}
transform.push(`${type}(${args.join(",")})`);
} else if (animateTypes32.concat(animateTypes4).includes(args[0])) {
type = args[0];
const value = args[1];
style[type] = animateTypes4.includes(type) ? converPx(value) : value;
}
});
style.transform = style.webkitTransform = transform.join(" ");
style.transition = style.webkitTransition = Object.keys(style).map((type) => `${converType(type)} ${transition.duration}ms ${transition.timingFunction} ${transition.delay}ms`).join(",");
style.transformOrigin = style.webkitTransformOrigin = option.transformOrigin;
return style;
}
function startAnimation(context) {
const animation2 = context.animation;
if (!animation2 || !animation2.actions || !animation2.actions.length) {
return;
}
let index2 = 0;
const actions = animation2.actions;
const length = animation2.actions.length;
function animate() {
const action = actions[index2];
const transition = action.option.transition;
const style = getStyle(action);
Object.keys(style).forEach((key) => {
context.$el.style[key] = style[key];
});
index2 += 1;
if (index2 < length) {
setTimeout(animate, transition.duration + transition.delay);
}
}
setTimeout(() => {
animate();
}, 0);
}
var animation = {
props: ["animation"],
watch: {
animation: {
deep: true,
handler() {
startAnimation(this);
}
}
},
mounted() {
startAnimation(this);
}
};
const LONGPRESS_TIMEOUT = 350;
const LONGPRESS_THRESHOLD = 10;
const passiveOptions$2 = passive(true);
...
...
@@ -485,7 +594,7 @@ var safeAreaInsets = {
onChange,
offChange
};
var out = safeAreaInsets;
var
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out = safeAreaInsets;
const onEventPrevent = /* @__PURE__ */ withModifiers(() => {
}, ["prevent"]);
const onEventStop = /* @__PURE__ */ withModifiers(() => {
...
...
@@ -497,10 +606,10 @@ function getWindowOffset() {
const left = parseInt(style.getPropertyValue("--window-left"));
const right = parseInt(style.getPropertyValue("--window-right"));
return {
top: top ? top + out.top : 0,
bottom: bottom ? bottom + out.bottom : 0,
left: left ? left + out.left : 0,
right: right ? right + out.right : 0
top: top ? top +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top : 0,
bottom: bottom ? bottom +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom : 0,
left: left ? left +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left : 0,
right: right ? right +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right : 0
};
}
function updateCssVar(cssVars) {
...
...
@@ -965,6 +1074,7 @@ function initView(app) {
initLongPress();
}
initAppConfig$1(app._context.config);
app.mixin(animation);
}
const ServiceJSBridge = /* @__PURE__ */ extend(initBridge("service"), {
invokeOnCallback(name, res) {
...
...
@@ -1182,7 +1292,7 @@ function normalizePageMeta(pageMeta) {
let offset = rpx2px(refreshOptions.offset);
const {type} = navigationBar;
if (type !== "transparent" && type !== "none") {
offset += NAVBAR_HEIGHT + out.top;
offset += NAVBAR_HEIGHT +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top;
}
refreshOptions.offset = offset;
refreshOptions.height = rpx2px(refreshOptions.height);
...
...
@@ -6585,18 +6695,18 @@ class Scroll {
return e2;
}
}
function createAnimation(scroll, onScroll, onEnd) {
function createAnimation
$1
(scroll, onScroll, onEnd) {
const state2 = {
id: 0,
cancelled: false
};
function startAnimation(state22, scroll2, onScroll2, onEnd2) {
function startAnimation
2
(state22, scroll2, onScroll2, onEnd2) {
if (!state22 || !state22.cancelled) {
onScroll2(scroll2);
const isDone = scroll2.done();
if (!isDone) {
if (!state22.cancelled) {
state22.id = requestAnimationFrame(startAnimation.bind(null, state22, scroll2, onScroll2, onEnd2));
state22.id = requestAnimationFrame(startAnimation
2
.bind(null, state22, scroll2, onScroll2, onEnd2));
}
}
if (isDone && onEnd2) {
...
...
@@ -6612,7 +6722,7 @@ function createAnimation(scroll, onScroll, onEnd) {
state22.cancelled = true;
}
}
startAnimation(state2, scroll, onScroll, onEnd);
startAnimation
2
(state2, scroll, onScroll, onEnd);
return {
cancel: cancel.bind(null, state2),
model: scroll
...
...
@@ -6702,7 +6812,7 @@ class Scroller {
this._scrolling = true;
this._lastChangePos = this._position;
this._lastIdx = Math.floor(Math.abs(this._position / this._itemSize));
this._animation = createAnimation(this._scroll, () => {
this._animation = createAnimation
$1
(this._scroll, () => {
const e2 = Date.now();
const i = (e2 - this._scroll._startTime) / 1e3;
const r = this._scroll.x(i);
...
...
@@ -11084,6 +11194,116 @@ const createSelectorQuery = /* @__PURE__ */ defineSyncApi("createSelectorQuery",
}
return new SelectorQuery(context || getCurrentPageVm());
});
const API_CREATE_ANIMATION = "createAnimation";
const CreateAnimationOptions = {
formatArgs: {}
};
const CreateAnimationProtocol = {
duration: Number,
timingFunction: String,
delay: Number,
transformOrigin: String
};
const defaultOption = {
duration: 400,
timingFunction: "linear",
delay: 0,
transformOrigin: "50% 50% 0"
};
class MPAnimation {
constructor(option) {
this.actions = [];
this.currentTransform = {};
this.currentStepAnimates = [];
this.option = Object.assign({}, defaultOption, option);
}
_getOption(option) {
const _option = {
transition: Object.assign({}, this.option, option),
transformOrigin: ""
};
_option.transformOrigin = _option.transition.transformOrigin;
delete _option.transition.transformOrigin;
return _option;
}
_pushAnimates(type, args) {
this.currentStepAnimates.push({
type,
args
});
}
_converType(type) {
return type.replace(/[A-Z]/g, (text2) => {
return `-${text2.toLowerCase()}`;
});
}
_getValue(value) {
return typeof value === "number" ? `${value}px` : value;
}
export() {
const actions = this.actions;
this.actions = [];
return {
actions
};
}
step(option) {
this.currentStepAnimates.forEach((animate) => {
if (animate.type !== "style") {
this.currentTransform[animate.type] = animate;
} else {
this.currentTransform[`${animate.type}.${animate.args[0]}`] = animate;
}
});
this.actions.push({
animates: Object.values(this.currentTransform),
option: this._getOption(option)
});
this.currentStepAnimates = [];
return this;
}
}
const animateTypes1 = [
"matrix",
"matrix3d",
"rotate",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"scale",
"scale3d",
"scaleX",
"scaleY",
"scaleZ",
"skew",
"skewX",
"skewY",
"translate",
"translate3d",
"translateX",
"translateY",
"translateZ"
];
const animateTypes2 = ["opacity", "backgroundColor"];
const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
MPAnimation.prototype[type] = function(...args) {
let _this = this;
if (animateTypes2.concat(animateTypes3).includes(type)) {
_this._pushAnimates("style", [
_this._converType(type),
animateTypes3.includes(type) ? _this._getValue(args[0]) : args[0]
]);
} else {
_this._pushAnimates(type, args);
}
return _this;
};
});
const createAnimation = /* @__PURE__ */ defineSyncApi(API_CREATE_ANIMATION, (option) => {
return new MPAnimation(option);
}, CreateAnimationProtocol, CreateAnimationOptions);
const API_ON_TAB_BAR_MID_BUTTON_TAP = "onTabBarMidButtonTap";
const onTabBarMidButtonTap = /* @__PURE__ */ defineOnApi(API_ON_TAB_BAR_MID_BUTTON_TAP, () => {
});
...
...
@@ -11716,13 +11936,13 @@ const FRONT_COLORS = ["#ffffff", "#000000"];
const API_SET_NAVIGATION_BAR_COLOR = "setNavigationBarColor";
const SetNavigationBarColorOptions = {
formatArgs: {
animation(animation, params) {
if (!animation) {
animation = {duration: 0, timingFunc: "linear"};
animation(animation
2
, params) {
if (!animation
2
) {
animation
2
= {duration: 0, timingFunc: "linear"};
}
params.animation = {
duration: animation.duration || 0,
timingFunc: animation.timingFunc || "linear"
duration: animation
2
.duration || 0,
timingFunc: animation
2
.timingFunc || "linear"
};
}
}
...
...
@@ -14650,7 +14870,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const windowWidth = getWindowWidth(screenWidth);
let windowHeight = window.innerHeight;
const language = navigator.language;
const statusBarHeight = out.top;
const statusBarHeight =
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top;
let osname;
let osversion;
let model;
...
...
@@ -14763,12 +14983,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const system = `${osname} ${osversion}`;
const platform = osname.toLocaleLowerCase();
const safeArea = {
left: out.left,
right: windowWidth - out.right,
top: out.top,
bottom: windowHeight - out.bottom,
width: windowWidth -
out.left -
out.right,
height: windowHeight -
out.top -
out.bottom
left:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left,
right: windowWidth -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
top:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top,
bottom: windowHeight -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom,
width: windowWidth -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
height: windowHeight -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom
};
const {top: windowTop, bottom: windowBottom} = getWindowOffset();
windowHeight -= windowTop;
...
...
@@ -14788,10 +15008,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
model,
safeArea,
safeAreaInsets: {
top: out.top,
right: out.right,
bottom: out.bottom,
left: out.left
top:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top,
right:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
bottom:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom,
left:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left
}
};
});
...
...
@@ -17264,8 +17484,8 @@ function setNavigationBar(pageMeta, type, args, resolve, reject) {
const {navigationBar} = pageMeta;
switch (type) {
case API_SET_NAVIGATION_BAR_COLOR:
const {frontColor, backgroundColor, animation} = args;
const {duration, timingFunc} = animation;
const {frontColor, backgroundColor, animation
: animation2
} = args;
const {duration, timingFunc} = animation
2
;
if (frontColor) {
navigationBar.titleColor = frontColor === "#000000" ? "#000" : "#fff";
}
...
...
@@ -17422,6 +17642,7 @@ var api = /* @__PURE__ */ Object.freeze({
createSelectorQuery,
createVideoContext,
createMapContext,
createAnimation,
onTabBarMidButtonTap,
createCanvasContext,
canvasGetImageData,
...
...
@@ -19868,4 +20089,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
return openBlock(), createBlock("div", clazz, [loadingVNode]);
}
});
export {$emit, $off, $on, $once, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, _sfc_main$8 as Audio, index$n as Button, _sfc_main$7 as Canvas, index$k as Checkbox, index$m as CheckboxGroup, _sfc_main$2 as CoverImage, _sfc_main$3 as CoverView, index$j as Editor, index$o as Form, Friction, index$i as Icon, index$h as Image, Input, index$l as Label, LayoutComponent, Map$1 as Map, MovableArea, MovableView, _sfc_main$6 as Navigator, index$2 as PageComponent, _sfc_main$1 as Picker, PickerView, PickerViewColumn, index$g as Progress, index$e as Radio, index$f as RadioGroup, ResizeSensor, _sfc_main$5 as RichText, _sfc_main$4 as ScrollView, Scroller, index$d as Slider, Spring, Swiper, SwiperItem, index$c as Switch, index$b as Text, index$a as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$5 as Video, index$9 as View, index$4 as WebView, addInterceptor, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createMapContext, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, defineBuiltInComponent, defineSystemComponent, disableScrollBounce, downloadFile, getApp$1 as getApp, getContextInfo, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLocation, getNetworkType, getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getVideoInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, hideTabBarRedDot, hideToast, initScrollBounce, loadFontFace, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, onAccelerometerChange, onCompassChange, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, openDocument, openLocation, pageScrollTo, index$6 as plugin, previewImage, promiseInterceptor, reLaunch, redirectTo, removeInterceptor, removeStorage, removeStorageSync, removeTabBarBadge, request, sendSocketMessage, setNavigationBarColor, setNavigationBarTitle, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setupApp, setupPage, showActionSheet, showLoading, showModal, showNavigationBarLoading, showTabBar, showTabBarRedDot, showToast, startAccelerometer, startCompass, startPullDownRefresh, stopAccelerometer, stopCompass, stopPullDownRefresh, switchTab, uni$1 as uni, uniFormKey, uploadFile, upx2px, useAttrs, useBooleanAttr, useContextInfo, useCustomEvent, useNativeEvent, useOn, useScroller, useSubscribe, useTouchtrack, useUserAction, vibrateLong, vibrateShort, withWebEvent};
export {$emit, $off, $on, $once, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, _sfc_main$8 as Audio, index$n as Button, _sfc_main$7 as Canvas, index$k as Checkbox, index$m as CheckboxGroup, _sfc_main$2 as CoverImage, _sfc_main$3 as CoverView, index$j as Editor, index$o as Form, Friction, index$i as Icon, index$h as Image, Input, index$l as Label, LayoutComponent, Map$1 as Map, MovableArea, MovableView, _sfc_main$6 as Navigator, index$2 as PageComponent, _sfc_main$1 as Picker, PickerView, PickerViewColumn, index$g as Progress, index$e as Radio, index$f as RadioGroup, ResizeSensor, _sfc_main$5 as RichText, _sfc_main$4 as ScrollView, Scroller, index$d as Slider, Spring, Swiper, SwiperItem, index$c as Switch, index$b as Text, index$a as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$5 as Video, index$9 as View, index$4 as WebView, addInterceptor, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, create
Animation, create
CanvasContext, createInnerAudioContext, createIntersectionObserver, createMapContext, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, defineBuiltInComponent, defineSystemComponent, disableScrollBounce, downloadFile, getApp$1 as getApp, getContextInfo, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLocation, getNetworkType, getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getVideoInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, hideTabBarRedDot, hideToast, initScrollBounce, loadFontFace, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, onAccelerometerChange, onCompassChange, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, openDocument, openLocation, pageScrollTo, index$6 as plugin, previewImage, promiseInterceptor, reLaunch, redirectTo, removeInterceptor, removeStorage, removeStorageSync, removeTabBarBadge, request, sendSocketMessage, setNavigationBarColor, setNavigationBarTitle, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setupApp, setupPage, showActionSheet, showLoading, showModal, showNavigationBarLoading, showTabBar, showTabBarRedDot, showToast, startAccelerometer, startCompass, startPullDownRefresh, stopAccelerometer, stopCompass, stopPullDownRefresh, switchTab, uni$1 as uni, uniFormKey, uploadFile, upx2px, useAttrs, useBooleanAttr, useContextInfo, useCustomEvent, useNativeEvent, useOn, useScroller, useSubscribe, useTouchtrack, useUserAction, vibrateLong, vibrateShort, withWebEvent};
packages/uni-h5/src/service/api/index.ts
浏览文件 @
72ea5fa3
...
...
@@ -70,6 +70,7 @@ export {
createSelectorQuery
,
createVideoContext
,
createMapContext
,
createAnimation
,
onTabBarMidButtonTap
,
createCanvasContext
,
canvasGetImageData
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录