@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.
Files changed (56) hide show
  1. package/package.json +24 -0
  2. package/src/adapters/es3-video-player.js +828 -0
  3. package/src/components/Modal.js +119 -0
  4. package/src/components/QtAnimationView.js +678 -0
  5. package/src/components/QtBaseComponent.js +165 -0
  6. package/src/components/QtFastListView.js +1920 -0
  7. package/src/components/QtFlexView.js +799 -0
  8. package/src/components/QtImage.js +203 -0
  9. package/src/components/QtItemFrame.js +239 -0
  10. package/src/components/QtItemStoreView.js +93 -0
  11. package/src/components/QtItemView.js +125 -0
  12. package/src/components/QtListView.js +331 -0
  13. package/src/components/QtLoadingView.js +55 -0
  14. package/src/components/QtPageRootView.js +19 -0
  15. package/src/components/QtPlayMark.js +168 -0
  16. package/src/components/QtProgressBar.js +199 -0
  17. package/src/components/QtQRCode.js +78 -0
  18. package/src/components/QtReplaceChild.js +149 -0
  19. package/src/components/QtRippleView.js +166 -0
  20. package/src/components/QtSeekBar.js +409 -0
  21. package/src/components/QtText.js +679 -0
  22. package/src/components/QtTransitionImage.js +170 -0
  23. package/src/components/QtView.js +706 -0
  24. package/src/components/QtWebView.js +613 -0
  25. package/src/components/TabsView.js +420 -0
  26. package/src/components/ViewPager.js +206 -0
  27. package/src/components/index.js +24 -0
  28. package/src/components/plugins/TextV2Component.js +70 -0
  29. package/src/components/plugins/index.js +7 -0
  30. package/src/core/SceneBuilder.js +58 -0
  31. package/src/core/TVFocusManager.js +2014 -0
  32. package/src/core/asyncLocalStorage.js +175 -0
  33. package/src/core/autoProxy.js +165 -0
  34. package/src/core/componentRegistry.js +84 -0
  35. package/src/core/constants.js +6 -0
  36. package/src/core/index.js +8 -0
  37. package/src/core/moduleUtils.js +36 -0
  38. package/src/core/patches.js +958 -0
  39. package/src/core/templateBinding.js +666 -0
  40. package/src/index.js +246 -0
  41. package/src/modules/AndroidDevelopModule.js +101 -0
  42. package/src/modules/AndroidDeviceModule.js +341 -0
  43. package/src/modules/AndroidNetworkModule.js +178 -0
  44. package/src/modules/AndroidSharedPreferencesModule.js +100 -0
  45. package/src/modules/ESDeviceInfoModule.js +450 -0
  46. package/src/modules/ESGroupDataModule.js +195 -0
  47. package/src/modules/ESIJKAudioPlayerModule.js +477 -0
  48. package/src/modules/ESLocalStorageModule.js +100 -0
  49. package/src/modules/ESLogModule.js +65 -0
  50. package/src/modules/ESModule.js +106 -0
  51. package/src/modules/ESNetworkSpeedModule.js +117 -0
  52. package/src/modules/ESToastModule.js +172 -0
  53. package/src/modules/EsNativeModule.js +117 -0
  54. package/src/modules/FastListModule.js +101 -0
  55. package/src/modules/FocusModule.js +145 -0
  56. 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,7 @@
1
+ /**
2
+ * Plugin Components Index
3
+ *
4
+ * 插件组件适配层,用于适配第三方插件提供的组件
5
+ */
6
+
7
+ export { TextV2Component } from './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
+ }