@taole/dev-helper 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-data/t-div.html-data.json +173 -173
- package/dist/open-diandian.umd.js +17 -6
- package/open-diandian/index.js +17 -6
- package/package.json +1 -1
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1.1,
|
|
3
|
-
"tags": [
|
|
4
|
-
{
|
|
5
|
-
"name": "t-div",
|
|
6
|
-
"description": "基于设计稿尺寸的布局容器 Web Component。数值属性会按 viewportWidth(默认 750)换算为 vw;设置 usePx 后按 px 输出。支持背景图、九宫格 border-image、flex 布局与文本省略。需先引入 tdiv.umd.js。",
|
|
7
|
-
"attributes": [
|
|
8
|
-
{
|
|
9
|
-
"name": "class",
|
|
10
|
-
"description": "class属性"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "_class",
|
|
14
|
-
"description": "(兼容)同 class,与 class 合并生效;推荐直接使用 class属性"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "usePx",
|
|
18
|
-
"description": "为 true 时 width/height/top 等数值属性直接输出 px,否则按 viewportWidth 换算为 viewportUnit(默认 vw)。可覆盖全局 setting.usePx。"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "_style",
|
|
22
|
-
"description": "追加到计算后内联 style 末尾的原始 CSS 字符串。"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "src",
|
|
26
|
-
"description": "背景图或九宫格图源。非 http(s) 路径会补全为 dynamics-share CDN;以 -- 开头时作为 CSS 变量(如 --bg1 → var(--bg1))。支持 WebP 自动处理。"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "srcMode",
|
|
30
|
-
"description": "非九宫格时 background-size 模式。",
|
|
31
|
-
"valueSet": "tdiv-srcMode"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "dot9",
|
|
35
|
-
"description": "九宫格 border-image slice,4 个空格分隔数值(上 右 下 左)"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "dot9Border",
|
|
39
|
-
"description": "九宫格 border-width,4 个空格分隔数值;未设置时回退为 dot9 的值。"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"name": "width",
|
|
43
|
-
"description": "宽度,数字或数字字符串"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "height",
|
|
47
|
-
"description": "高度,数字或数字字符串"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "absolute",
|
|
51
|
-
"description": "为 true 时使用 position: absolute,top/left/right/bottom 作为定位偏移。"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "fixed",
|
|
55
|
-
"description": "为 true 时使用 position: fixed(优先于 absolute),top/left/right/bottom 作为定位偏移。"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "top",
|
|
59
|
-
"description": "absolute/fixed 时为 top;否则为 margin-top。"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "left",
|
|
63
|
-
"description": "absolute/fixed 时为 left;否则为 margin-left。"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "right",
|
|
67
|
-
"description": "absolute/fixed 时为 right;否则为 margin-right。"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"name": "bottom",
|
|
71
|
-
"description": "absolute/fixed 时为 bottom;否则为 margin-bottom。"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "zIndex",
|
|
75
|
-
"description": "z-index 层叠顺序。"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"name": "pointer",
|
|
79
|
-
"description": "为 true 时 cursor: pointer。未设置且存在 onClick 时也会显示手型光标。"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "flex",
|
|
83
|
-
"description": "为 true 时 display: flex。"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "column",
|
|
87
|
-
"description": "flex 为 true 时设置 flex-direction: column。"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"name": "center",
|
|
91
|
-
"description": "flex 为 true 时水平垂直居中;否则 text-align: center。"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "text",
|
|
95
|
-
"description": "字号,数值经 calc 换算为 font-size。"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"name": "bold",
|
|
99
|
-
"description": "为 true 时 font-weight: bold。"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "color",
|
|
103
|
-
"description": "文字颜色。以 -- 开头时使用 var(--xxx)。"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"name": "bgColor",
|
|
107
|
-
"description": "背景色。以 -- 开头时使用 var(--xxx)。"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "radius",
|
|
111
|
-
"description": "圆角 border-radius,数值经 calc 换算。"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "border",
|
|
115
|
-
"description": "边框宽度,数值经 calc 换算;与 borderColor 组合为 solid 边框。"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"name": "borderColor",
|
|
119
|
-
"description": "边框颜色,默认 #000;以 -- 开头时使用 var(--xxx)。仅设 borderColor 时只改 border-color。"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "textEllipsis",
|
|
123
|
-
"description": "文本省略:非纯数字时为单行省略;纯数字时为多行省略(-webkit-line-clamp 行数)。"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "textDot",
|
|
127
|
-
"description": "textEllipsis 的别名,行为相同。"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"name": "onClick",
|
|
131
|
-
"description": "点击回调:填写挂载在 window 上的函数名字符串;全局 useButtonEffect 为 true 时会附加 click-effect 样式。不推荐使用onClick属性,推荐使用click事件"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "debug",
|
|
135
|
-
"description": "为 true 时在控制台输出计算后的 layoutStyle。"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "viewportWidth",
|
|
139
|
-
"description": "覆盖本次样式计算的设计稿基准宽度(默认 750)。"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "viewportUnit",
|
|
143
|
-
"description": "覆盖数值换算单位(默认 vw)。"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"references": [
|
|
147
|
-
{
|
|
148
|
-
"name": "Tdiv 源码",
|
|
149
|
-
"url": "https://codeup.aliyun.com/5ec8bb7bd1d1abe63b55cd33/PC_Web/web-libs/blob/master/dev-helper/Tdiv/index.js"
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"valueSets": [
|
|
155
|
-
{
|
|
156
|
-
"name": "tdiv-srcMode",
|
|
157
|
-
"values": [
|
|
158
|
-
{
|
|
159
|
-
"name": "auto",
|
|
160
|
-
"description": "默认,background-size: 100% auto(仅顶部对齐拉伸宽度)。"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "fill",
|
|
164
|
-
"description": "background-size: 100% 100%,铺满容器。"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "cover",
|
|
168
|
-
"description": "background-size: cover,等比覆盖。"
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 1.1,
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "t-div",
|
|
6
|
+
"description": "基于设计稿尺寸的布局容器 Web Component。数值属性会按 viewportWidth(默认 750)换算为 vw;设置 usePx 后按 px 输出。支持背景图、九宫格 border-image、flex 布局与文本省略。需先引入 tdiv.umd.js。",
|
|
7
|
+
"attributes": [
|
|
8
|
+
{
|
|
9
|
+
"name": "class",
|
|
10
|
+
"description": "class属性"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "_class",
|
|
14
|
+
"description": "(兼容)同 class,与 class 合并生效;推荐直接使用 class属性"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "usePx",
|
|
18
|
+
"description": "为 true 时 width/height/top 等数值属性直接输出 px,否则按 viewportWidth 换算为 viewportUnit(默认 vw)。可覆盖全局 setting.usePx。"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "_style",
|
|
22
|
+
"description": "追加到计算后内联 style 末尾的原始 CSS 字符串。"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "src",
|
|
26
|
+
"description": "背景图或九宫格图源。非 http(s) 路径会补全为 dynamics-share CDN;以 -- 开头时作为 CSS 变量(如 --bg1 → var(--bg1))。支持 WebP 自动处理。"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "srcMode",
|
|
30
|
+
"description": "非九宫格时 background-size 模式。",
|
|
31
|
+
"valueSet": "tdiv-srcMode"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "dot9",
|
|
35
|
+
"description": "九宫格 border-image slice,4 个空格分隔数值(上 右 下 左)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "dot9Border",
|
|
39
|
+
"description": "九宫格 border-width,4 个空格分隔数值;未设置时回退为 dot9 的值。"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "width",
|
|
43
|
+
"description": "宽度,数字或数字字符串"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "height",
|
|
47
|
+
"description": "高度,数字或数字字符串"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "absolute",
|
|
51
|
+
"description": "为 true 时使用 position: absolute,top/left/right/bottom 作为定位偏移。"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "fixed",
|
|
55
|
+
"description": "为 true 时使用 position: fixed(优先于 absolute),top/left/right/bottom 作为定位偏移。"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "top",
|
|
59
|
+
"description": "absolute/fixed 时为 top;否则为 margin-top。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "left",
|
|
63
|
+
"description": "absolute/fixed 时为 left;否则为 margin-left。"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "right",
|
|
67
|
+
"description": "absolute/fixed 时为 right;否则为 margin-right。"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "bottom",
|
|
71
|
+
"description": "absolute/fixed 时为 bottom;否则为 margin-bottom。"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "zIndex",
|
|
75
|
+
"description": "z-index 层叠顺序。"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "pointer",
|
|
79
|
+
"description": "为 true 时 cursor: pointer。未设置且存在 onClick 时也会显示手型光标。"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "flex",
|
|
83
|
+
"description": "为 true 时 display: flex。"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "column",
|
|
87
|
+
"description": "flex 为 true 时设置 flex-direction: column。"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "center",
|
|
91
|
+
"description": "flex 为 true 时水平垂直居中;否则 text-align: center。"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "text",
|
|
95
|
+
"description": "字号,数值经 calc 换算为 font-size。"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "bold",
|
|
99
|
+
"description": "为 true 时 font-weight: bold。"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "color",
|
|
103
|
+
"description": "文字颜色。以 -- 开头时使用 var(--xxx)。"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "bgColor",
|
|
107
|
+
"description": "背景色。以 -- 开头时使用 var(--xxx)。"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "radius",
|
|
111
|
+
"description": "圆角 border-radius,数值经 calc 换算。"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "border",
|
|
115
|
+
"description": "边框宽度,数值经 calc 换算;与 borderColor 组合为 solid 边框。"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "borderColor",
|
|
119
|
+
"description": "边框颜色,默认 #000;以 -- 开头时使用 var(--xxx)。仅设 borderColor 时只改 border-color。"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "textEllipsis",
|
|
123
|
+
"description": "文本省略:非纯数字时为单行省略;纯数字时为多行省略(-webkit-line-clamp 行数)。"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "textDot",
|
|
127
|
+
"description": "textEllipsis 的别名,行为相同。"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "onClick",
|
|
131
|
+
"description": "点击回调:填写挂载在 window 上的函数名字符串;全局 useButtonEffect 为 true 时会附加 click-effect 样式。不推荐使用onClick属性,推荐使用click事件"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "debug",
|
|
135
|
+
"description": "为 true 时在控制台输出计算后的 layoutStyle。"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "viewportWidth",
|
|
139
|
+
"description": "覆盖本次样式计算的设计稿基准宽度(默认 750)。"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "viewportUnit",
|
|
143
|
+
"description": "覆盖数值换算单位(默认 vw)。"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"references": [
|
|
147
|
+
{
|
|
148
|
+
"name": "Tdiv 源码",
|
|
149
|
+
"url": "https://codeup.aliyun.com/5ec8bb7bd1d1abe63b55cd33/PC_Web/web-libs/blob/master/dev-helper/Tdiv/index.js"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"valueSets": [
|
|
155
|
+
{
|
|
156
|
+
"name": "tdiv-srcMode",
|
|
157
|
+
"values": [
|
|
158
|
+
{
|
|
159
|
+
"name": "auto",
|
|
160
|
+
"description": "默认,background-size: 100% auto(仅顶部对齐拉伸宽度)。"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "fill",
|
|
164
|
+
"description": "background-size: 100% 100%,铺满容器。"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "cover",
|
|
168
|
+
"description": "background-size: cover,等比覆盖。"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
app_name: '点点开黑',
|
|
11
11
|
link_ios: "com.tuwan.diandian://openPage",
|
|
12
12
|
link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
|
|
13
|
+
link_harmony: "taole://diandain:8888/splash",
|
|
13
14
|
fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
|
|
14
15
|
fallback_link_android: 'https://m.malink.cn/s/3iQziy',
|
|
15
16
|
fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
|
|
@@ -48,10 +49,10 @@
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
let id = 1;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
|
|
53
|
+
|
|
54
|
+
function createOpenDiandianElementClass() {
|
|
55
|
+
return class extends HTMLElement {
|
|
55
56
|
static get observedAttributes() {
|
|
56
57
|
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
57
58
|
}
|
|
@@ -358,6 +359,9 @@
|
|
|
358
359
|
} else {
|
|
359
360
|
this._alink_fallback = this._appInfo.fallback_link_android;
|
|
360
361
|
this._alink_link = this._appInfo.link_android || this._alink_fallback;
|
|
362
|
+
if(this._isHarmony && this._appInfo.link_harmony){
|
|
363
|
+
this._alink_link = this._appInfo.link_harmony;
|
|
364
|
+
}
|
|
361
365
|
this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
|
|
362
366
|
}
|
|
363
367
|
if (this._openAppTag) {
|
|
@@ -367,8 +371,15 @@
|
|
|
367
371
|
this._alink.href = this._alink_link;
|
|
368
372
|
}
|
|
369
373
|
}
|
|
370
|
-
}
|
|
371
|
-
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function defineTag() {
|
|
378
|
+
OPEN_DIANDIAN_TAG_NAMES.forEach((tagName) => {
|
|
379
|
+
if (!customElements.get(tagName)) {
|
|
380
|
+
customElements.define(tagName, createOpenDiandianElementClass());
|
|
381
|
+
}
|
|
382
|
+
});
|
|
372
383
|
}
|
|
373
384
|
|
|
374
385
|
let isRegister = false;
|
package/open-diandian/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const appInfoMap = {
|
|
|
5
5
|
app_name: '点点开黑',
|
|
6
6
|
link_ios: "com.tuwan.diandian://openPage",
|
|
7
7
|
link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
|
|
8
|
+
link_harmony: "taole://diandain:8888/splash",
|
|
8
9
|
fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
|
|
9
10
|
fallback_link_android: 'https://m.malink.cn/s/3iQziy',
|
|
10
11
|
fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
|
|
@@ -43,10 +44,10 @@ function resolveTwKit() {
|
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
let id = 1;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
|
|
48
|
+
|
|
49
|
+
function createOpenDiandianElementClass() {
|
|
50
|
+
return class extends HTMLElement {
|
|
50
51
|
static get observedAttributes() {
|
|
51
52
|
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
52
53
|
}
|
|
@@ -353,6 +354,9 @@ function defineTag() {
|
|
|
353
354
|
} else {
|
|
354
355
|
this._alink_fallback = this._appInfo.fallback_link_android;
|
|
355
356
|
this._alink_link = this._appInfo.link_android || this._alink_fallback;
|
|
357
|
+
if(this._isHarmony && this._appInfo.link_harmony){
|
|
358
|
+
this._alink_link = this._appInfo.link_harmony;
|
|
359
|
+
}
|
|
356
360
|
this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
|
|
357
361
|
}
|
|
358
362
|
if (this._openAppTag) {
|
|
@@ -362,8 +366,15 @@ function defineTag() {
|
|
|
362
366
|
this._alink.href = this._alink_link;
|
|
363
367
|
}
|
|
364
368
|
}
|
|
365
|
-
}
|
|
366
|
-
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function defineTag() {
|
|
373
|
+
OPEN_DIANDIAN_TAG_NAMES.forEach((tagName) => {
|
|
374
|
+
if (!customElements.get(tagName)) {
|
|
375
|
+
customElements.define(tagName, createOpenDiandianElementClass());
|
|
376
|
+
}
|
|
377
|
+
});
|
|
367
378
|
}
|
|
368
379
|
|
|
369
380
|
let isRegister = false;
|