Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat hummer mode 2.8 #1885

Draft
wants to merge 173 commits into
base: new
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
5440313
fix: fix types
anotherso1a Aug 4, 2021
f038d1c
fix: pull origin master
anotherso1a Aug 4, 2021
e56605e
feat: add tenon mode
anotherso1a Aug 17, 2021
df6d466
fix: fix Resolve Depends
anotherso1a Aug 17, 2021
86902d8
feat: add tenon mode
anotherso1a Sep 8, 2021
6fc6075
feat: add tenon mode
anotherso1a Sep 8, 2021
6278bc3
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Sep 10, 2021
257bbaf
feat: tenon mode
anotherso1a Sep 13, 2021
f793e36
v2.6.92-alpha.0
anotherso1a Sep 13, 2021
478934b
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Sep 13, 2021
4ef1926
v2.6.94-alpha.0
anotherso1a Sep 13, 2021
cfcc0b6
fix: remove undefined varible
anotherso1a Sep 13, 2021
7199415
v2.6.94-alpha.1
anotherso1a Sep 13, 2021
f275cfa
fix: lint fix
anotherso1a Sep 13, 2021
5946716
fix: fix animation api bugs
anotherso1a Sep 13, 2021
4f9d3f2
fix: fix component life times, add builtin mixins
anotherso1a Sep 16, 2021
41ca915
v2.6.94-alpha.2
anotherso1a Sep 16, 2021
056fb43
test: add tenon cli
anotherso1a Sep 16, 2021
85c52ea
v2.6.94-alpha.3
anotherso1a Sep 16, 2021
8856f2c
fix: extract tenon in other mode
anotherso1a Sep 18, 2021
4d22922
v2.6.94-alpha.4
anotherso1a Sep 18, 2021
fe3b629
fix: lint fix
anotherso1a Sep 18, 2021
f278d46
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Jan 20, 2022
0bde8ee
save change
Blackgan3 Jan 21, 2022
7f944d9
save change
Blackgan3 Jan 21, 2022
5104917
save change
Blackgan3 Jan 21, 2022
43db1be
fix: tenon runtime error
AdamCaoQAQ Feb 28, 2022
bdc49fc
Merge pull request #958 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Mar 1, 2022
b7b0de3
feat: 增加 Tenon onLoad onReady生命周期query参数
AdamCaoQAQ Mar 15, 2022
a65bf27
fix: 修复tenon 运行时 getter监听失效的bug
AdamCaoQAQ Mar 15, 2022
502650d
fix(hummer): 修复部分事件的originEvent报错
xikou1314 Mar 15, 2022
1ed8fae
fix(hummer): tenon内置组件的兼容修改
xikou1314 Mar 15, 2022
0a4c09c
Merge pull request #975 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Mar 15, 2022
b515507
style: lint fix
anotherso1a Mar 15, 2022
6043e4d
chore: add changes
anotherso1a Mar 15, 2022
c343d0e
v2.6.114-alpha.1
anotherso1a Mar 15, 2022
5089d6f
chore: release
anotherso1a Mar 15, 2022
9c97ea9
chore: add change to publish
anotherso1a Mar 15, 2022
c57a338
chore: change to release
anotherso1a Mar 15, 2022
9cda308
v2.6.114-alpha.2
anotherso1a Mar 15, 2022
a167a3e
feat: 修复tenon下$on报错
AdamCaoQAQ Mar 21, 2022
88b4aea
Merge branch 'feat_hummer_mode' of https://github.91chi.fun//https://…
AdamCaoQAQ Mar 21, 2022
9ebabc6
feat: 修复proccessModel无法触发的问题
xikou1314 Mar 23, 2022
781f32d
Merge branch 'didi:feat_hummer_mode' into feat_hummer_mode
AdamCaoQAQ Apr 18, 2022
1f2daf6
Merge pull request #1002 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Apr 18, 2022
8163652
style: lint fix
anotherso1a Apr 18, 2022
951dd87
v2.6.114-alpha.3
anotherso1a Apr 18, 2022
9dabe41
fix: fix webConfig undefined
anotherso1a Apr 19, 2022
9e21edc
v2.6.114-alpha.4
anotherso1a Apr 19, 2022
63003cf
fix: solve the problem when cover style to a native tag
anotherso1a May 5, 2022
19cd16b
v2.6.114-alpha.5
anotherso1a May 5, 2022
5db493a
fix: fix tenon mode css code compile
anotherso1a May 18, 2022
648d40a
style: lint fix
anotherso1a May 18, 2022
0009455
v2.6.114-alpha.6
anotherso1a May 18, 2022
37e727c
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Jul 11, 2022
7b3fbe7
fix: tenon support webpack5
anotherso1a Jul 11, 2022
555f00f
fix: lint fix
anotherso1a Jul 11, 2022
7845b79
v2.6.114-alpha.7
anotherso1a Jul 11, 2022
8abd9a4
fix: fix hummer build bugs
anotherso1a Jul 13, 2022
2f0d75b
style: lint fix
anotherso1a Jul 13, 2022
f6a3d03
v2.6.114-alpha.8
anotherso1a Jul 13, 2022
0cf34bf
fix: fix alias pagepath
anotherso1a Aug 31, 2022
0db2ebd
v2.6.114-alpha.9
anotherso1a Aug 31, 2022
4d8c14f
docs: add coma
anotherso1a Oct 19, 2022
c588303
chore: up to version 2.7
anotherso1a Oct 19, 2022
00ed5b8
v2.7.0-alpha
anotherso1a Oct 19, 2022
cd14c17
fix: fix the problem that tenon mode still use require method
anotherso1a Feb 6, 2023
886bbdc
v2.7.0-alpha.1
anotherso1a Feb 6, 2023
6a259d8
fix: fix tenon processJSON
anotherso1a Feb 12, 2023
75746a7
v2.7.0-alpha.2
anotherso1a Feb 12, 2023
1e0b682
feat: 优化tenon端input/textarea value赋值逻辑
AdamCaoQAQ Feb 22, 2023
e4264be
Merge pull request #1179 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Feb 22, 2023
0cae26c
v2.7.0-alpha.3
anotherso1a Feb 22, 2023
b539d7b
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Feb 28, 2023
2f18c6c
fix: sync master changes
anotherso1a Feb 28, 2023
92dac81
fix(hummer): fix textarea code errors
anotherso1a Feb 28, 2023
34b1e70
style: lint fix
anotherso1a Feb 28, 2023
bf4ad5f
chore: add vue dependencies for test
anotherso1a Feb 28, 2023
3a6dff4
v2.8.23-alpha
anotherso1a Feb 28, 2023
c124e66
fix(tenon): fix tenon mode errors
anotherso1a Mar 1, 2023
c7df212
style: lint fix
anotherso1a Mar 1, 2023
7c267ed
v2.8.23-alpha.1
anotherso1a Mar 1, 2023
afc67b8
fix(tenon): fix store plugin import, add update lifetimes
anotherso1a Mar 1, 2023
556f754
v2.8.23-alpha.2
anotherso1a Mar 1, 2023
86cd025
fix(tenon): fix code import
anotherso1a Mar 1, 2023
be98bcf
v2.8.23-alpha.3
anotherso1a Mar 1, 2023
c4c7ad7
fix: fix tenon pageStatusMixins
anotherso1a Mar 8, 2023
eaa049a
v2.8.23-alpha.4
anotherso1a Mar 8, 2023
e2d49f4
Merge branch 'master' of https://github.com/didi/mpx into feat_hummer…
anotherso1a Mar 14, 2023
345dc10
v2.8.25-alpha
anotherso1a Mar 14, 2023
d1971b2
fix: hummer mode support script setup
anotherso1a Apr 14, 2023
0d932ec
v2.8.25-alpha.1
anotherso1a Apr 14, 2023
4bf69cb
fix:修复多个appEntry报错的问题
Blackgan3 Jul 3, 2023
8f3578d
v2.8.25-alpha.2
Blackgan3 Jul 3, 2023
81ccbf5
feat: hummer mode setup support
AdamCaoQAQ Jul 11, 2023
c3f2575
Merge pull request #1241 from AdamCaoQAQ/feat_hummer_mode
Blackgan3 Jul 11, 2023
95208f2
Update getDefaultOptions.js
AdamCaoQAQ Jul 11, 2023
ea678bc
fix: hummer mode lint error
AdamCaoQAQ Jul 11, 2023
85178df
Merge pull request #1242 from AdamCaoQAQ/feat_hummer_mode
Blackgan3 Jul 11, 2023
a4acf4b
v2.8.25-alpha.3
Blackgan3 Jul 11, 2023
d741568
fix: hummer mode setup runtime error
AdamCaoQAQ Aug 2, 2023
9cc2a77
Merge pull request #1249 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Aug 2, 2023
9684484
v2.8.25-alpha.4
anotherso1a Aug 2, 2023
0e44299
feat(hummer): hummer mode support AtMode
AdamCaoQAQ Aug 7, 2023
6257718
Merge pull request #1251 from AdamCaoQAQ/feat_hummer_mode
Blackgan3 Aug 7, 2023
d7f9753
v2.8.25-alpha.5
Blackgan3 Aug 7, 2023
c5d4d87
fix(tenon): runtime set&del error
AdamCaoQAQ Aug 17, 2023
a1e106c
chore: fix lint
AdamCaoQAQ Aug 17, 2023
a3719db
Merge pull request #1253 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Aug 17, 2023
749e76c
v2.8.25-alpha.6
anotherso1a Aug 17, 2023
11bf8bf
bugfix: tenon page lifecycle onBack return
AdamCaoQAQ Sep 4, 2023
05e2ac1
Merge pull request #1261 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Sep 4, 2023
87e767a
v2.8.25-alpha.7
anotherso1a Sep 4, 2023
3a2d4ba
feat(tenon): 修改CREATED执行逻辑
AdamCaoQAQ Sep 21, 2023
f6dae48
chore: fix lint
AdamCaoQAQ Sep 21, 2023
7521552
Merge pull request #1269 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Sep 21, 2023
23186e8
docs: add comments
anotherso1a Sep 21, 2023
8b08f89
v2.8.25-alpha.8
anotherso1a Sep 21, 2023
53c3a4e
feat(tenon): 修改resolve处理逻辑 & 完善route API能力
AdamCaoQAQ Nov 17, 2023
756fc20
Merge pull request #1327 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Nov 17, 2023
d723753
v2.8.25-alpha.9
anotherso1a Nov 17, 2023
4ac6b77
fix: 修复构建 Tenon 过程中,入口文件使用动态json的问题
anotherso1a Nov 28, 2023
8644921
v2.8.25-alpha.10
anotherso1a Nov 28, 2023
1bcc0b9
feat(tenon): 优化resolve处理逻辑
AdamCaoQAQ Dec 11, 2023
7a17a1d
Merge pull request #1359 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Dec 11, 2023
21ed2a7
v2.8.25-alpha.11
anotherso1a Dec 11, 2023
c413319
feat(tenon): 优化reslove逻辑
AdamCaoQAQ Dec 13, 2023
6c8a646
Merge pull request #1362 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Dec 13, 2023
faf3231
v2.8.25-alpha.12
anotherso1a Dec 13, 2023
2a3f397
bugfix: 移除tenon-image部分默认样式,修复图片异常展示问题
AdamCaoQAQ Mar 4, 2024
1193663
Merge pull request #1420 from AdamCaoQAQ/feat_hummer_mode
anotherso1a Mar 4, 2024
4abac47
v2.8.25-alpha.13
anotherso1a Mar 4, 2024
8a0a538
chore: remove prerelease check
anotherso1a Mar 11, 2024
c3c29b8
style: lint fix
anotherso1a Mar 11, 2024
8aed3fa
v2.8.25-alpha.14
anotherso1a Mar 11, 2024
34a555f
fix: 修复input组件和textarea组件运行时错误
Leolijiaming Mar 19, 2024
c02c216
fix: lint
Leolijiaming Mar 19, 2024
409f64b
Merge pull request #1432 from jm19940203/fix-tenon-element
anotherso1a Mar 20, 2024
76f3ab2
v2.8.25-alpha.15
anotherso1a Mar 20, 2024
e72e31d
fix: 更新代驾包包版本peerdep
Leolijiaming Mar 29, 2024
49dafe4
Merge pull request #1439 from jm19940203/fix-tenon-element
anotherso1a Mar 29, 2024
789c7a6
v2.8.25-alpha.16
anotherso1a Mar 29, 2024
d539ab2
fix: 升级peerDependencies包版本号
Leolijiaming Apr 1, 2024
7f3deb0
Merge pull request #1440 from jm19940203/fix-tenon-element
anotherso1a Apr 1, 2024
06ccb55
v2.8.25-alpha.17
anotherso1a Apr 1, 2024
dfbb308
fix: 升级peerDependencies包版本号
Leolijiaming Apr 1, 2024
d9629b5
fix: 升级peerDependencies包版本号
Leolijiaming Apr 1, 2024
6ffe787
fix: 增加tenon api set-navigation-bar & 修复tenon request参数与文档不一致
Leolijiaming Apr 3, 2024
8713328
fix: CI任务不通过
Leolijiaming Apr 3, 2024
bc038d8
Merge pull request #1441 from jm19940203/fix-tenon-element
anotherso1a Apr 3, 2024
14a16b3
v2.8.25-alpha.18
anotherso1a Apr 3, 2024
cf0bde5
fix: request问题修复
Leolijiaming Apr 8, 2024
39a6e3e
feat: tenon request支持promise
Leolijiaming Apr 10, 2024
03b3a5b
fix: 修复tenon Request请求返回值解析
Leolijiaming Apr 15, 2024
796a5c4
fix: 修复IOS端GET请求
Leolijiaming Apr 16, 2024
2ba8386
Merge pull request #1450 from jm19940203/fix-tenon-apiProxy
anotherso1a Apr 16, 2024
fed88f1
v2.8.25-alpha.19
anotherso1a Apr 16, 2024
e9065b1
bugFix: 修复tenon-input初始化value不生效
Luobinf May 11, 2024
e141ba8
Merge pull request #1467 from didi/bugfix-tenon-input
anotherso1a May 11, 2024
3493161
v2.8.25-alpha.20
anotherso1a May 11, 2024
225f136
fix: 修复tenon环境下api-proxy丢失query参数
Leolijiaming Jun 6, 2024
c772a6e
Merge pull request #1501 from jm19940203/fix_tenon_api_proxy_for_route
Blackgan3 Jun 6, 2024
9deeb08
fix: update version
Jun 7, 2024
45ca9f8
Update tenon-scroll-view.vue
xuyuan3 Jul 5, 2024
ac96140
Update tenon-scroll-view.vue
xuyuan3 Jul 5, 2024
2eaf4a9
Merge pull request #1535 from xuyuan3/feat_hummer_mode
Blackgan3 Jul 8, 2024
77cc8fb
feat: 更新e2e项目依赖webpack版本
Blackgan3 Jul 8, 2024
0e2a23c
feat: 更新e2e项目依赖webpack版本
Blackgan3 Jul 8, 2024
50e082d
v2.8.25-alpha.21
Blackgan3 Jul 8, 2024
46dc103
fix:修复hummer navigateTo错误回调
xuyuan3 Sep 14, 2024
aca1275
Merge pull request #1626 from xuyuan3/feat_hummer_mode
Blackgan3 Sep 14, 2024
bb04db5
Merge remote-tracking branch 'origin/feat_hummer_mode' into feat_humm…
Blackgan3 Sep 14, 2024
b27e973
fix: hummer相关依赖使用宿主环境的版本
Leolijiaming Mar 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ module.exports = {
__mpx_mode__: 'readonly',
__mpx_env__: 'readonly',
getRegExp: 'readonly',
getCurrentPages: 'readonly'
getCurrentPages: 'readonly',
// tenon env
Hummer: 'readonly',
View: 'readonly',
Text: 'readonly',
Dialog: 'readonly',
__GLOBAL__: 'readonly',
},
rules: {
'no-cond-assign': 0,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Mpx的核心设计思路为增强,不同于业内大部分小程序框架将we

## 交流

提供 微信群 / QQ群 两种交流方式
提供 微信群 / QQ群 两种交流方式.

#### 添加MPX入群客服等待受邀入群

Expand Down
1 change: 0 additions & 1 deletion docs-vuepress/desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

已安装依赖vuepress,并已经在package.json中新增写作和部署脚本


``` sh
# 写作时
npm run docs:dev
Expand Down
4 changes: 3 additions & 1 deletion legacy/cli/bin/mpx-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ program
* Settings.
*/

let template = 'mpx-template'
// let template = 'mpx-template'
// todo use branch master
let template = 'mpx-template#feat_add_tenon'
const rawName = program.args[0]
const inPlace = !rawName || rawName === '.'
const name = inPlace ? path.relative('../', process.cwd()) : rawName
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"packages": [
"packages/*"
],
"version": "2.8.25"
"version": "2.8.25-alpha.21"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "mpx monorepo",
"private": true,
"scripts": {
"lerna:publish": "lerna publish from-package --yes",
"lerna:publish": "lerna publish from-package --yes --dist-tag alpha",
"lint": "eslint --ext .js packages/",
"fix": "eslint --fix --ext .js packages/",
"test": "jest",
Expand All @@ -14,6 +14,7 @@
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/eslint-parser": "^7.18.9",
"@babel/preset-env": "^7.20.2",
"@docsearch/css": "^3.0.0",
"@docsearch/js": "^3.0.0",
"@testing-library/jest-dom": "^4.2.4",
Expand All @@ -31,6 +32,7 @@
"jest": "^27.2.0",
"lerna": "^3.4.3",
"typescript": "^4.1.3",
"vue": "^2.7.14",
"vuepress": "^1.9.7"
}
}
2 changes: 1 addition & 1 deletion packages/api-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mpxjs/api-proxy",
"version": "2.8.8",
"version": "2.8.25-alpha.21",
"description": "convert miniprogram API at each end",
"module": "src/index.js",
"types": "@types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-proxy/src/common/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const handleSuccess = (opts, getOptions = noop, thisObj) => {

function genFromMap () {
const result = {}
const platforms = ['wx', 'ali', 'swan', 'qq', 'tt', 'web', 'qa', 'jd', 'dd']
const platforms = ['wx', 'ali', 'swan', 'qq', 'tt', 'web', 'tenon', 'qa', 'jd', 'dd']
platforms.forEach((platform) => {
result[`__mpx_src_mode_${platform}__`] = platform
})
Expand Down
42 changes: 42 additions & 0 deletions packages/api-proxy/src/common/stylus/Modal.tenon.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.__mpx_modal_box__
width 80%
max-width 600hm
background #FFFFFF
overflow hidden
text-align center
padding-top 30hm
border-radius 15px
.__mpx_modal_title_view__
padding-left 20hm
padding-right 20hm
.__mpx_modal_title__
font-size 26hm
text-align center
color #000000
.__mpx_modal_content_view__
padding-top 10hm
padding-left 20hm
padding-right 20hm
.__mpx_modal_content__
font-size 24hm
color #808080
text-line-clamp 3
text-align center
line-spacing-multi 1.2
.__mpx_modal_btns__
display flex
height: 80hm
margin-top 25hm
border-top 1px solid rgba(0,0,0,0.2)
.__mpx_modal_cancel__
flex 1
font-size 26hm
text-align center
font-weight bold
.__mpx_modal_confirm__
flex 1
font-size 26hm
text-align center
font-weight bold
.__mpx_modal_hide__
display none
56 changes: 56 additions & 0 deletions packages/api-proxy/src/common/stylus/Toast.tenon.styl

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions packages/api-proxy/src/index.tenon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as allApi from './tenon/api'
import { EventChannel } from './tenon/api/event-channel'
import { genFromMap } from './common/js'

export default function install (target) {
const fromMap = genFromMap()

global.EventChannel = new EventChannel()

Object.keys(allApi).forEach(api => {
target[api] = function (...args) {
if (args.length > 0) {
const from = args.pop()
if (typeof from !== 'string' || !fromMap[from]) {
args.push(from)
}
}

return allApi[api].apply(target, args)
}
})
}
export function getProxy () {
const apiProxy = {}
install(apiProxy)
return apiProxy
}
225 changes: 225 additions & 0 deletions packages/api-proxy/src/tenon/api/animation/animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
import { warn } from '../../../common/js'
class Animation {
constructor (options) {
this._actions = []
this._propMaps = {}
this._options = options
}

// 处理size
_processSize (size) {
if (typeof size === 'number') {
return `${size}hm`
} else {
return size
}
}

_collectData (type, value) {
this._propMaps[type] = {
type: type,
value: value
}
}

// 不支持
right (value) {
warn('不支持right方法')
return this
}

// 不支持
left (value) {
warn('不支持left方法')
return this
}

// 不支持
top (value) {
warn('不支持top方法')
return this
}

// 不支持
bottom (value) {
warn('不支持bottom方法')
return this
}

width (value) {
this._collectData('width', value)
return this
}

height (value) {
this._collectData('height', value)
return this
}

opacity (value) {
this._collectData('opacity', parseFloat(value))
return this
}

backgroundColor (color) {
this._collectData('backgroundColor', color)
return this
}

// 不支持
matrix (...value) {
warn('不支持matrix方法')
return this
}

// 不支持
matrix3d (...value) {
warn('不支持matrix3d方法')
return this
}

// 不支持
rotate (...value) {
warn('不支持rotate方法')
return this
}

// 不支持
rotate3d (...value) {
warn('不支持rotate3d方法')
return this
}

rotateX (value) {
this._collectData('rotationX', `${parseFloat(value)}deg`)
return this
}

rotateY (value) {
this._collectData('rotationY', `${parseFloat(value)}deg`)
return this
}

rotateZ (value) {
this._collectData('rotationZ', `${parseFloat(value)}deg`)
return this
}

scale (...value) {
const [x, y = x] = value
this._collectData('scaleX', x)
this._collectData('scaleY', y)
return this
}

// 不支持
scale3d (...value) {
warn('不支持scale3d方法')
return this
}

scaleX (value) {
this._collectData('scaleX', value)
return this
}

scaleY (value) {
this._collectData('scaleY', value)
return this
}

// 不支持
scaleZ (value) {
warn('不支持scaleZ方法')
return this
}

// 不支持
skew (...value) {
warn('不支持skew方法')
return this
}

// 不支持
skewX (value) {
warn('不支持skewX方法')
return this
}

// 不支持
skewY (value) {
warn('不支持skewY方法')
return this
}

translate (...value) {
const [x = 0, y = 0] = value
this._collectData('position', {
x: `${parseFloat(x)}hm`,
y: `${parseFloat(y)}hm`
})
return this
}

// 不支持
translate3d (...value) {
warn('不支持translate3d方法')
return this
}

translateX (value) {
this._collectData('position', { x: `${parseFloat(value)}hm`, y: 0 })
return this
}

translateY (value) {
this._collectData('position', { x: `${parseFloat(value)}hm`, y: 0 })
return this
}

// 不支持
translateZ (value) {
warn('不支持tranlateZ方法')
return this
}

step (opt) {
const option = {}
const animates = []
if (opt) {
Object.assign(option, this._options, opt)
} else {
Object.assign(option, this._options)
}
Object.keys(this._propMaps).forEach((item) => {
animates.push(this._propMaps[item])
})
// action 
this._actions.push({
animates,
option
})
return this
}

export () {
const actions = this._actions.slice(0)
this._actions.length = 0
// 一个action就是一个step
const steps = actions.map((v) => {
const styles = {}
v.animates.forEach(animate => {
styles[animate.type] = animate.value
})
return {
...v.option,
styles
}
})
return {
steps
}
}
}

export default Animation
Loading