@quicktvui/web-renderer 1.0.0
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/package.json +24 -0
- package/src/adapters/es3-video-player.js +828 -0
- package/src/components/Modal.js +119 -0
- package/src/components/QtAnimationView.js +678 -0
- package/src/components/QtBaseComponent.js +165 -0
- package/src/components/QtFastListView.js +1920 -0
- package/src/components/QtFlexView.js +799 -0
- package/src/components/QtImage.js +203 -0
- package/src/components/QtItemFrame.js +239 -0
- package/src/components/QtItemStoreView.js +93 -0
- package/src/components/QtItemView.js +125 -0
- package/src/components/QtListView.js +331 -0
- package/src/components/QtLoadingView.js +55 -0
- package/src/components/QtPageRootView.js +19 -0
- package/src/components/QtPlayMark.js +168 -0
- package/src/components/QtProgressBar.js +199 -0
- package/src/components/QtQRCode.js +78 -0
- package/src/components/QtReplaceChild.js +149 -0
- package/src/components/QtRippleView.js +166 -0
- package/src/components/QtSeekBar.js +409 -0
- package/src/components/QtText.js +679 -0
- package/src/components/QtTransitionImage.js +170 -0
- package/src/components/QtView.js +706 -0
- package/src/components/QtWebView.js +613 -0
- package/src/components/TabsView.js +420 -0
- package/src/components/ViewPager.js +206 -0
- package/src/components/index.js +24 -0
- package/src/components/plugins/TextV2Component.js +70 -0
- package/src/components/plugins/index.js +7 -0
- package/src/core/SceneBuilder.js +58 -0
- package/src/core/TVFocusManager.js +2014 -0
- package/src/core/asyncLocalStorage.js +175 -0
- package/src/core/autoProxy.js +165 -0
- package/src/core/componentRegistry.js +84 -0
- package/src/core/constants.js +6 -0
- package/src/core/index.js +8 -0
- package/src/core/moduleUtils.js +36 -0
- package/src/core/patches.js +958 -0
- package/src/core/templateBinding.js +666 -0
- package/src/index.js +246 -0
- package/src/modules/AndroidDevelopModule.js +101 -0
- package/src/modules/AndroidDeviceModule.js +341 -0
- package/src/modules/AndroidNetworkModule.js +178 -0
- package/src/modules/AndroidSharedPreferencesModule.js +100 -0
- package/src/modules/ESDeviceInfoModule.js +450 -0
- package/src/modules/ESGroupDataModule.js +195 -0
- package/src/modules/ESIJKAudioPlayerModule.js +477 -0
- package/src/modules/ESLocalStorageModule.js +100 -0
- package/src/modules/ESLogModule.js +65 -0
- package/src/modules/ESModule.js +106 -0
- package/src/modules/ESNetworkSpeedModule.js +117 -0
- package/src/modules/ESToastModule.js +172 -0
- package/src/modules/EsNativeModule.js +117 -0
- package/src/modules/FastListModule.js +101 -0
- package/src/modules/FocusModule.js +145 -0
- package/src/modules/RuntimeDeviceModule.js +176 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextV2Component - 文本组件 V2 适配层
|
|
3
|
+
*
|
|
4
|
+
* 用于适配使用 text-v2 标签的插件组件
|
|
5
|
+
* 基于 QtText 实现,支持自定义字体等扩展功能
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { QtText } from '../QtText'
|
|
9
|
+
|
|
10
|
+
class TextV2Component extends QtText {
|
|
11
|
+
constructor(context, id, parentId) {
|
|
12
|
+
super(context, id, parentId)
|
|
13
|
+
this.tagName = 'text-v2'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 更新属性 - 支持 TextV2 特有属性
|
|
18
|
+
*/
|
|
19
|
+
updateProperty(key, value) {
|
|
20
|
+
switch (key) {
|
|
21
|
+
case 'fontPath':
|
|
22
|
+
// 自定义字体路径 - Web 端暂不支持,但保留接口
|
|
23
|
+
this._fontPath = value
|
|
24
|
+
// 未来可以通过 CSS @font-face 动态加载
|
|
25
|
+
break
|
|
26
|
+
|
|
27
|
+
case 'fontWeight':
|
|
28
|
+
if (this.dom) {
|
|
29
|
+
this.dom.style.fontWeight = value
|
|
30
|
+
}
|
|
31
|
+
break
|
|
32
|
+
|
|
33
|
+
case 'fontStyle':
|
|
34
|
+
if (this.dom) {
|
|
35
|
+
this.dom.style.fontStyle = value
|
|
36
|
+
}
|
|
37
|
+
break
|
|
38
|
+
|
|
39
|
+
case 'letterSpacing':
|
|
40
|
+
if (this.dom) {
|
|
41
|
+
this.dom.style.letterSpacing = typeof value === 'number' ? `${value}px` : value
|
|
42
|
+
}
|
|
43
|
+
break
|
|
44
|
+
|
|
45
|
+
case 'lineHeight':
|
|
46
|
+
if (this.dom) {
|
|
47
|
+
this.dom.style.lineHeight = typeof value === 'number' ? `${value}px` : value
|
|
48
|
+
}
|
|
49
|
+
break
|
|
50
|
+
|
|
51
|
+
case 'textDecoration':
|
|
52
|
+
if (this.dom) {
|
|
53
|
+
this.dom.style.textDecoration = value
|
|
54
|
+
}
|
|
55
|
+
break
|
|
56
|
+
|
|
57
|
+
case 'textShadow':
|
|
58
|
+
if (this.dom) {
|
|
59
|
+
this.dom.style.textShadow = value
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
|
|
63
|
+
default:
|
|
64
|
+
// 其他属性交给基类处理
|
|
65
|
+
super.updateProperty(key, value)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { TextV2Component }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SceneBuilder implementation for web renderer
|
|
2
|
+
// This provides a fake SceneBuilder so es3-vue's Native.callUIFunction works in web
|
|
3
|
+
|
|
4
|
+
export function setupSceneBuilder() {
|
|
5
|
+
if (!global.Hippy) {
|
|
6
|
+
global.Hippy = {}
|
|
7
|
+
}
|
|
8
|
+
if (!global.Hippy.SceneBuilder) {
|
|
9
|
+
const normalizeEventName = (eventName) => {
|
|
10
|
+
if (!eventName || typeof eventName !== 'string') return eventName
|
|
11
|
+
return eventName.startsWith('on')
|
|
12
|
+
? eventName
|
|
13
|
+
: `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`
|
|
14
|
+
}
|
|
15
|
+
global.Hippy.SceneBuilder = function SceneBuilder(rootViewId) {
|
|
16
|
+
this.rootViewId = rootViewId
|
|
17
|
+
this.create = (nodes) => {
|
|
18
|
+
global.Hippy.bridge.callNative('UIManagerModule', 'createNode', this.rootViewId, nodes)
|
|
19
|
+
}
|
|
20
|
+
this.update = (nodes) => {
|
|
21
|
+
global.Hippy.bridge.callNative('UIManagerModule', 'updateNode', this.rootViewId, nodes)
|
|
22
|
+
}
|
|
23
|
+
this.delete = (nodes) => {
|
|
24
|
+
global.Hippy.bridge.callNative('UIManagerModule', 'deleteNode', this.rootViewId, nodes)
|
|
25
|
+
}
|
|
26
|
+
this.move = (nodes) => {
|
|
27
|
+
global.Hippy.bridge.callNative('UIManagerModule', 'moveNode', this.rootViewId, nodes)
|
|
28
|
+
}
|
|
29
|
+
this.build = () => {
|
|
30
|
+
// Nothing to do at web platform
|
|
31
|
+
}
|
|
32
|
+
// CRITICAL: addEventListener is called by es3-vue to register event listeners
|
|
33
|
+
// This is how Vue component events get registered to web-renderer components
|
|
34
|
+
this.addEventListener = (id, eventName, handler) => {
|
|
35
|
+
const normalizedName = normalizeEventName(eventName)
|
|
36
|
+
// Use callNative instead of callNativeWithoutDelete
|
|
37
|
+
// The handler is a callback wrapper that will be stored in component.events
|
|
38
|
+
global.Hippy.bridge.callNative(
|
|
39
|
+
'UIManagerModule',
|
|
40
|
+
'addEventListener',
|
|
41
|
+
id,
|
|
42
|
+
normalizedName,
|
|
43
|
+
handler
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
this.removeEventListener = (id, eventName, handler) => {
|
|
47
|
+
global.Hippy.bridge.callNative(
|
|
48
|
+
'UIManagerModule',
|
|
49
|
+
'removeEventListener',
|
|
50
|
+
id,
|
|
51
|
+
normalizeEventName(eventName),
|
|
52
|
+
handler
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
console.log('[Web Renderer] Installed SceneBuilder with addEventListener support')
|
|
57
|
+
}
|
|
58
|
+
}
|