@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,119 @@
1
+ // Modal component - Native modal container for qt-dialog
2
+ // In web, this renders as a full-screen overlay
3
+ import { QtBaseComponent } from './QtBaseComponent'
4
+ import { registerComponent } from '../core/componentRegistry'
5
+
6
+ export class Modal extends QtBaseComponent {
7
+ constructor(context, id, pId) {
8
+ super(context, id, pId)
9
+ this.tagName = 'Modal'
10
+ this.dom = document.createElement('div')
11
+ this.dom.setAttribute('data-component-name', 'Modal')
12
+
13
+ // Default styles for modal overlay
14
+ this.dom.style.cssText = `
15
+ position: fixed;
16
+ top: 0;
17
+ left: 0;
18
+ width: 100%;
19
+ height: 100%;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ z-index: 9999;
24
+ `
25
+
26
+ // Register by id for findComponentById
27
+ registerComponent(id, this)
28
+
29
+ // Track visibility state
30
+ this._visible = true
31
+ this._transparent = true
32
+ }
33
+
34
+ defaultStyle() {
35
+ return {
36
+ position: 'fixed',
37
+ top: 0,
38
+ left: 0,
39
+ width: '100%',
40
+ height: '100%',
41
+ display: 'flex',
42
+ alignItems: 'center',
43
+ justifyContent: 'center',
44
+ zIndex: 9999,
45
+ }
46
+ }
47
+
48
+ updateProperty(key, value) {
49
+ switch (key) {
50
+ case 'transparent':
51
+ this._transparent = value
52
+ if (value) {
53
+ this.dom.style.backgroundColor = 'transparent'
54
+ } else {
55
+ this.dom.style.backgroundColor = 'rgba(0, 0, 0, 0.5)'
56
+ }
57
+ break
58
+
59
+ case 'immersionStatusBar':
60
+ // In web, this doesn't apply but we store it
61
+ this._immersionStatusBar = value
62
+ break
63
+
64
+ case 'visible':
65
+ case 'visibility':
66
+ this._setVisible(value)
67
+ break
68
+
69
+ default:
70
+ super.updateProperty(key, value)
71
+ }
72
+ }
73
+
74
+ _setVisible(visible) {
75
+ this._visible = visible
76
+ if (visible) {
77
+ this.dom.style.display = 'flex'
78
+ // Dispatch show event
79
+ this.dispatchEvent('show', {})
80
+ } else {
81
+ this.dom.style.display = 'none'
82
+ }
83
+ }
84
+
85
+ // Called when the modal is mounted
86
+ mounted() {
87
+ super.mounted?.()
88
+ // Dispatch show event when mounted
89
+ if (this._visible !== false) {
90
+ // Delay to ensure event listeners are registered
91
+ requestAnimationFrame(() => {
92
+ this.dispatchEvent('show', {})
93
+ })
94
+ }
95
+ }
96
+
97
+ // Handle click outside to close
98
+ _handleClickOutside(e) {
99
+ // Only close if clicking the backdrop (not children)
100
+ if (e.target === this.dom) {
101
+ this.dispatchEvent('requestclose', {})
102
+ }
103
+ }
104
+
105
+ // Show the modal
106
+ show() {
107
+ this._setVisible(true)
108
+ }
109
+
110
+ // Hide the modal
111
+ hide() {
112
+ this._setVisible(false)
113
+ }
114
+
115
+ // Close the modal (dispatches requestClose event)
116
+ close() {
117
+ this.dispatchEvent('requestclose', {})
118
+ }
119
+ }