@polyvharmony/live-scenes-foundation 1.3.0 → 1.3.2-rc.1

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 (60) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/ResourceTable.txt +17 -17
  3. package/oh-package.json5 +1 -1
  4. package/package.json +1 -1
  5. package/src/main/ets/common/PLVBasicDataSource.d.ets +19 -19
  6. package/src/main/ets/common/PLVBasicDataSource.js +75 -75
  7. package/src/main/ets/common/PLVCallback.d.ets +20 -19
  8. package/src/main/ets/common/PLVCallback.js +78 -78
  9. package/src/main/ets/common/PLVCommonEnums.js +16 -16
  10. package/src/main/ets/common/PLVDeviceUtils.d.ets +4 -4
  11. package/src/main/ets/common/PLVDeviceUtils.js +9 -9
  12. package/src/main/ets/common/PLVHashMap.d.ets +2 -2
  13. package/src/main/ets/common/PLVHashMap.js +2 -2
  14. package/src/main/ets/common/PLVJSONUtils.d.ets +13 -13
  15. package/src/main/ets/common/PLVJSONUtils.js +46 -46
  16. package/src/main/ets/common/PLVNetUtils.d.ets +4 -4
  17. package/src/main/ets/common/PLVNetUtils.js +24 -24
  18. package/src/main/ets/common/PLVPreferencesUtils.d.ets +9 -9
  19. package/src/main/ets/common/PLVPreferencesUtils.js +16 -16
  20. package/src/main/ets/common/PLVScheduledTask.d.ets +1 -1
  21. package/src/main/ets/common/PLVScheduledTask.js +9 -9
  22. package/src/main/ets/common/PLVSimpleBuffer.d.ets +3 -3
  23. package/src/main/ets/common/PLVSimpleBuffer.js +8 -8
  24. package/src/main/ets/common/PLVSparseArray.d.ets +6 -6
  25. package/src/main/ets/common/PLVSparseArray.js +21 -21
  26. package/src/main/ets/common/PLVTextUtils.d.ets +8 -8
  27. package/src/main/ets/common/PLVTextUtils.js +44 -44
  28. package/src/main/ets/common/PLVTimeUtils.d.ets +1 -1
  29. package/src/main/ets/common/PLVTimeUtils.js +8 -8
  30. package/src/main/ets/common/PLVToastUtils.d.ets +4 -4
  31. package/src/main/ets/common/PLVToastUtils.js +7 -7
  32. package/src/main/ets/common/PLVUACreator.d.ets +1 -1
  33. package/src/main/ets/common/PLVUACreator.js +6 -6
  34. package/src/main/ets/common/PLVUtils.d.ets +25 -24
  35. package/src/main/ets/common/PLVUtils.js +141 -141
  36. package/src/main/ets/common/PLVWebUtils.d.ets +4 -4
  37. package/src/main/ets/common/PLVWebUtils.js +46 -47
  38. package/src/main/ets/common/ui/PLVNodeController.d.ets +11 -9
  39. package/src/main/ets/common/ui/PLVNodeController.js +48 -47
  40. package/src/main/ets/modules/log/PLVLogger.d.ets +11 -11
  41. package/src/main/ets/modules/log/PLVLogger.js +36 -36
  42. package/src/main/ets/modules/log/PLVXLogFilePrinter.d.ets +2 -2
  43. package/src/main/ets/modules/log/PLVXLogFilePrinter.js +14 -12
  44. package/src/main/ets/modules/net/PLVHttpData.d.ets +1 -1
  45. package/src/main/ets/modules/net/PLVHttpData.js +3 -3
  46. package/src/main/ets/modules/net/PLVHttpError.d.ets +2 -2
  47. package/src/main/ets/modules/net/PLVHttpError.js +5 -5
  48. package/src/main/ets/modules/net/PLVHttpRequest.d.ets +10 -9
  49. package/src/main/ets/modules/net/PLVHttpRequest.js +89 -88
  50. package/src/main/ets/modules/net/PLVRequestSetting.d.ets +3 -3
  51. package/src/main/ets/modules/net/PLVRequestSetting.js +14 -14
  52. package/src/main/ets/modules/socket/PLVSocketIO.d.ets +20 -20
  53. package/src/main/ets/modules/socket/PLVSocketIO.js +61 -61
  54. package/src/main/ets/modules/web/PLVFailureLayout.js +17 -18
  55. package/src/main/ets/modules/web/PLVLoadingLayout.js +12 -13
  56. package/src/main/ets/modules/web/PLVNewWindowLayout.js +17 -18
  57. package/src/main/ets/modules/web/PLVSimpleWeb.js +75 -79
  58. package/src/main/ets/modules/web/PLVWebController.d.ets +39 -39
  59. package/src/main/ets/modules/web/PLVWebController.js +106 -106
  60. package/src/main/module.json +1 -1
@@ -12,230 +12,230 @@ const TAG = '[PLVUtils]';
12
12
  export default class PLVUtils {
13
13
  constructor() {
14
14
  }
15
- static init(context, windowStage) {
16
- AppUtil.init(context, windowStage);
15
+ static init(f11, g11) {
16
+ AppUtil.init(f11, g11);
17
17
  }
18
- static getClassTag(tag, d6 = true) {
19
- let key = d6 ? '[Anonymous]' : undefined;
20
- if (typeof tag == 'string') {
21
- key = tag;
18
+ static getClassTag(c11, d11 = true) {
19
+ let e11 = d11 ? '[Anonymous]' : undefined;
20
+ if (typeof c11 == 'string') {
21
+ e11 = c11;
22
22
  }
23
23
  else {
24
- if (tag && tag.constructor) {
25
- key = `[${tag.constructor.name}]`;
24
+ if (c11 && c11.constructor) {
25
+ e11 = `[${c11.constructor.name}]`;
26
26
  }
27
27
  }
28
- return key;
28
+ return e11;
29
29
  }
30
- static retryWhen(when, retry) {
30
+ static retryWhen(y10, z10) {
31
31
  try {
32
- return Promise.resolve(when());
32
+ return Promise.resolve(y10());
33
33
  }
34
- catch (err) {
35
- PLVLogger.printWarn(TAG, 'retryWhen catch error', err);
34
+ catch (a11) {
35
+ PLVLogger.printWarn(TAG, 'retryWhen catch error', a11);
36
36
  try {
37
- return Promise.resolve(retry());
37
+ return Promise.resolve(z10());
38
38
  }
39
- catch (err) {
40
- PLVLogger.printWarn(TAG, 'retryWhen catch error while retry', err);
41
- return Promise.reject(err);
39
+ catch (b11) {
40
+ PLVLogger.printWarn(TAG, 'retryWhen catch error while retry', b11);
41
+ return Promise.reject(b11);
42
42
  }
43
43
  }
44
44
  }
45
- static async disposablePromise(promise, c6) {
45
+ static async disposablePromise(v10, w10) {
46
46
  try {
47
- await promise;
47
+ await v10;
48
48
  }
49
- catch (error) {
50
- return Promise.reject(error);
49
+ catch (x10) {
50
+ return Promise.reject(x10);
51
51
  }
52
- if (c6?.isDispose()) {
52
+ if (w10?.isDispose()) {
53
53
  return Promise.reject(new Error('error'));
54
54
  }
55
- return promise;
55
+ return v10;
56
56
  }
57
- static safePromise(callback, a6) {
58
- const promise = new Promise(async (b6, reject) => {
57
+ static safePromise(p10, q10) {
58
+ const r10 = new Promise(async (s10, t10) => {
59
59
  try {
60
- await callback(b6, reject);
60
+ await p10(s10, t10);
61
61
  }
62
- catch (err) {
63
- PLVLogger.printWarn(TAG, 'safePromise catch error', err);
64
- reject(err);
62
+ catch (u10) {
63
+ PLVLogger.printWarn(TAG, 'safePromise catch error', u10);
64
+ t10(u10);
65
65
  }
66
66
  });
67
- return PLVUtils.disposablePromise(promise, a6);
67
+ return PLVUtils.disposablePromise(r10, q10);
68
68
  }
69
- static async retryPromise(w5, x5, promise, y5) {
70
- let z5 = 0;
71
- let error = new Error('error');
72
- while (z5 <= w5) {
69
+ static async retryPromise(h10, i10, j10, k10) {
70
+ let l10 = 0;
71
+ let m10 = new Error('error');
72
+ while (l10 <= h10) {
73
73
  try {
74
- const result = await promise;
75
- if (!y5?.isDispose()) {
76
- return result;
74
+ const o10 = await j10;
75
+ if (!k10?.isDispose()) {
76
+ return o10;
77
77
  }
78
78
  }
79
- catch (err) {
80
- error = err;
81
- PLVLogger.printWarn(TAG, `retryPromise retryCount=${z5} catch error`, err);
79
+ catch (n10) {
80
+ m10 = n10;
81
+ PLVLogger.printWarn(TAG, `retryPromise retryCount=${l10} catch error`, n10);
82
82
  }
83
- if (++z5 > w5) {
83
+ if (++l10 > h10) {
84
84
  break;
85
85
  }
86
- if (y5?.isDispose()) {
87
- return Promise.reject(error);
86
+ if (k10?.isDispose()) {
87
+ return Promise.reject(m10);
88
88
  }
89
- await PLVUtils.delay(x5);
89
+ await PLVUtils.delay(i10);
90
90
  }
91
- return Promise.reject(error);
91
+ return Promise.reject(m10);
92
92
  }
93
- static async delay(delay) {
94
- return PLVUtils.safePromise((v5) => {
95
- setTimeout(v5, delay);
93
+ static async delay(f10) {
94
+ return PLVUtils.safePromise((g10) => {
95
+ setTimeout(g10, f10);
96
96
  });
97
97
  }
98
- static validCallback(callback) {
99
- return '/' != callback;
98
+ static validCallback(e10) {
99
+ return '/' != e10;
100
100
  }
101
101
  static getPid() {
102
- const current = Date.now();
103
- const random = Math.floor(Math.random() * 1000000) + 1000000;
104
- return current + "X" + random;
102
+ const c10 = Date.now();
103
+ const d10 = Math.floor(Math.random() * 1000000) + 1000000;
104
+ return c10 + "X" + d10;
105
105
  }
106
106
  static getDeviceId() {
107
107
  return DeviceUtil.getDeviceId();
108
108
  }
109
- static undefinedToValue(data, callback, delay) {
109
+ static undefinedToValue(z9, a10, b10) {
110
110
  setTimeout(() => {
111
- callback(data);
112
- }, delay ? delay : PLVCommonConstants.DELAY_TIME_S);
111
+ a10(z9);
112
+ }, b10 ? b10 : PLVCommonConstants.DELAY_TIME_S);
113
113
  return undefined;
114
114
  }
115
- static copyText(text) {
116
- return PasteboardUtil.setDataText(text);
115
+ static copyText(y9) {
116
+ return PasteboardUtil.setDataText(y9);
117
117
  }
118
- static listenerOrientation(callback) {
119
- const listener = mediaquery.matchMediaSync('(orientation: landscape)');
120
- listener.on('change', callback);
121
- return new PLVMediaQueryListener(listener, callback);
118
+ static listenerOrientation(w9) {
119
+ const x9 = mediaquery.matchMediaSync('(orientation: landscape)');
120
+ x9.on('change', w9);
121
+ return new PLVMediaQueryListener(x9, w9);
122
122
  }
123
- static listenerAvoidAreaChange(callback) {
124
- const t5 = AppUtil.getMainWindow();
123
+ static listenerAvoidAreaChange(t9) {
124
+ const u9 = AppUtil.getMainWindow();
125
125
  try {
126
- t5.on('avoidAreaChange', callback);
126
+ u9.on('avoidAreaChange', t9);
127
127
  }
128
- catch (u5) {
129
- PLVLogger.error(TAG, `Failed to enable the listener for system avoid area changes. Cause code: ${u5.code}, message: ${u5.message}`);
128
+ catch (v9) {
129
+ PLVLogger.error(TAG, `Failed to enable the listener for system avoid area changes. Cause code: ${v9.code}, message: ${v9.message}`);
130
130
  }
131
- return new PLVAvoidAreaChangeListener(t5, callback);
131
+ return new PLVAvoidAreaChangeListener(u9, t9);
132
132
  }
133
- static changeOrientation(o5, component, p5) {
134
- let context = getContext(component);
135
- let q5 = (s5) => {
136
- s5.setPreferredOrientation(o5 ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);
133
+ static changeOrientation(m9, n9, o9) {
134
+ let p9 = getContext(n9);
135
+ let q9 = (s9) => {
136
+ s9.setPreferredOrientation(m9 ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);
137
137
  };
138
- p5 ? q5(p5) :
139
- window.getLastWindow(context).then((r5) => {
140
- q5(r5);
138
+ o9 ? q9(o9) :
139
+ window.getLastWindow(p9).then((r9) => {
140
+ q9(r9);
141
141
  });
142
142
  }
143
- static isLandscape(component) {
144
- let context = getContext(component);
145
- return context.config.direction === ConfigurationConstant.Direction.DIRECTION_HORIZONTAL;
146
- }
147
- static setWindowFullScreen(isLayoutFullScreen = false, isFullScreen = false, component, h5) {
148
- return new Promise((i5) => {
149
- let context = getContext(component);
150
- let j5 = (l5) => {
151
- let m5 = l5.getWindowProperties().isLayoutFullScreen;
152
- let n5 = l5.getWindowProperties().isFullScreen;
153
- l5.setWindowLayoutFullScreen(isLayoutFullScreen);
143
+ static isLandscape(k9) {
144
+ let l9 = getContext(k9);
145
+ return l9.config.direction === ConfigurationConstant.Direction.DIRECTION_HORIZONTAL;
146
+ }
147
+ static setWindowFullScreen(z8 = false, a9 = false, b9, c9) {
148
+ return new Promise((d9) => {
149
+ let e9 = getContext(b9);
150
+ let f9 = (h9) => {
151
+ let i9 = h9.getWindowProperties().isLayoutFullScreen;
152
+ let j9 = h9.getWindowProperties().isFullScreen;
153
+ h9.setWindowLayoutFullScreen(z8);
154
154
  if (canIUse("SystemCapability.Window.SessionManager")) {
155
- l5.setSpecificSystemBarEnabled('status', !isFullScreen);
156
- i5([m5, n5]);
155
+ h9.setSpecificSystemBarEnabled('status', !a9);
156
+ d9([i9, j9]);
157
157
  }
158
158
  };
159
- h5 ? j5(h5) :
160
- window.getLastWindow(context).then((k5) => {
161
- j5(k5);
159
+ c9 ? f9(c9) :
160
+ window.getLastWindow(e9).then((g9) => {
161
+ f9(g9);
162
162
  });
163
163
  });
164
164
  }
165
- static setWindowSystemBarProperties(systemBarProperties) {
166
- PLVDeviceUtils.setWindowSystemBarProperties(systemBarProperties);
165
+ static setWindowSystemBarProperties(y8) {
166
+ PLVDeviceUtils.setWindowSystemBarProperties(y8);
167
167
  }
168
- static startScan(component) {
169
- return new Promise((g5) => {
168
+ static startScan(s8) {
169
+ return new Promise((t8) => {
170
170
  if (canIUse('SystemCapability.Multimedia.Scan.Core') && canIUse('SystemCapability.Multimedia.Scan.ScanBarcode')) {
171
- let options = {
171
+ let u8 = {
172
172
  scanTypes: [scanCore.ScanType.ALL],
173
173
  enableMultiMode: true,
174
174
  enableAlbum: true
175
175
  };
176
176
  try {
177
- scanBarcode.startScanForResult(getContext(component), options).then((result) => {
178
- PLVLogger.info(TAG, 'Promise scan result: ' + JSON.stringify(result));
179
- g5(result.originalValue);
180
- }).catch((error) => {
181
- PLVLogger.error(TAG, 'Promise error: ' + JSON.stringify(error));
177
+ scanBarcode.startScanForResult(getContext(s8), u8).then((x8) => {
178
+ PLVLogger.info(TAG, 'Promise scan result: ' + JSON.stringify(x8));
179
+ t8(x8.originalValue);
180
+ }).catch((w8) => {
181
+ PLVLogger.error(TAG, 'Promise error: ' + JSON.stringify(w8));
182
182
  });
183
183
  }
184
- catch (error) {
185
- PLVLogger.error(TAG, 'failReason: ' + JSON.stringify(error));
184
+ catch (v8) {
185
+ PLVLogger.error(TAG, 'failReason: ' + JSON.stringify(v8));
186
186
  }
187
187
  }
188
188
  });
189
189
  }
190
- static getVideoRectJS(e5) {
191
- let f5 = "function getVideoRect() {";
190
+ static getVideoRectJS(q8) {
191
+ let r8 = "function getVideoRect() {";
192
192
  {
193
- f5 += "let tags = document.getElementsByTagName('video');";
194
- f5 += "if (tags.length > 0) {";
193
+ r8 += "let tags = document.getElementsByTagName('video');";
194
+ r8 += "if (tags.length > 0) {";
195
195
  {
196
- f5 += "let video = tags[0];";
197
- f5 += "return {";
196
+ r8 += "let video = tags[0];";
197
+ r8 += "return {";
198
198
  {
199
- f5 += "'width': video.videoWidth,";
200
- f5 += "'height': video.videoHeight";
199
+ r8 += "'width': video.videoWidth,";
200
+ r8 += "'height': video.videoHeight";
201
201
  }
202
- f5 += "};";
202
+ r8 += "};";
203
203
  }
204
- f5 += "}";
205
- f5 += "return {};";
204
+ r8 += "}";
205
+ r8 += "return {};";
206
206
  }
207
- f5 += "}";
208
- f5 += "getVideoRect();";
209
- return e5 ? PLVCommonConstants.JS_PRE + f5 : f5;
210
- }
211
- static getExitFullScreenJS(c5) {
212
- let d5 = "function exitFullScreen() {";
213
- d5 += "document.getElementsByTagName('video')[0].webkitExitFullScreen()";
214
- d5 += "}";
215
- d5 += "exitFullScreen();";
216
- return c5 ? PLVCommonConstants.JS_PRE + d5 : d5;
217
- }
218
- static colorResourceToHex(resource) {
219
- return PLVUtils.colorIntToHex(getContext().resourceManager.getColorSync(resource));
220
- }
221
- static colorIntToHex(z4, a5 = false) {
222
- const b5 = z4.toString(16).padStart(8, '0');
223
- if (a5) {
224
- return `#${b5.toUpperCase()}`;
207
+ r8 += "}";
208
+ r8 += "getVideoRect();";
209
+ return q8 ? PLVCommonConstants.JS_PRE + r8 : r8;
210
+ }
211
+ static getExitFullScreenJS(o8) {
212
+ let p8 = "function exitFullScreen() {";
213
+ p8 += "document.getElementsByTagName('video')[0].webkitExitFullScreen()";
214
+ p8 += "}";
215
+ p8 += "exitFullScreen();";
216
+ return o8 ? PLVCommonConstants.JS_PRE + p8 : p8;
217
+ }
218
+ static colorResourceToHex(n8) {
219
+ return PLVUtils.colorIntToHex(getContext().resourceManager.getColorSync(n8));
220
+ }
221
+ static colorIntToHex(k8, l8 = false) {
222
+ const m8 = k8.toString(16).padStart(8, '0');
223
+ if (l8) {
224
+ return `#${m8.toUpperCase()}`;
225
225
  }
226
226
  else {
227
- return `#${b5.substring(2).toUpperCase()}`;
227
+ return `#${m8.substring(2).toUpperCase()}`;
228
228
  }
229
229
  }
230
- static debounce(func, delay = 500, key = 'default') {
231
- if (PLVUtils.TIMES.has(key)) {
232
- clearTimeout(PLVUtils.TIMES.get(key));
230
+ static debounce(g8, h8 = 500, i8 = 'default') {
231
+ if (PLVUtils.TIMES.has(i8)) {
232
+ clearTimeout(PLVUtils.TIMES.get(i8));
233
233
  }
234
- const timer = setTimeout(() => {
235
- func();
236
- PLVUtils.TIMES.delete(key);
237
- }, delay);
238
- PLVUtils.TIMES.set(key, timer);
234
+ const j8 = setTimeout(() => {
235
+ g8();
236
+ PLVUtils.TIMES.delete(i8);
237
+ }, h8);
238
+ PLVUtils.TIMES.set(i8, j8);
239
239
  }
240
240
  }
241
241
  PLVUtils.TIMES = new Map();
@@ -1,6 +1,6 @@
1
1
  export declare class PLVWebUtils {
2
- static toWebViewContent(content?: string, color?: string): string;
3
- static toRGBA(g6: string): string;
4
- static cleanHTML(input: string): string;
5
- static openWebLink(url?: string, component?: object): void;
2
+ static toWebViewContent(v11?: string, w11?: string): string;
3
+ static toRGBA(q11: string): string;
4
+ static cleanHTML(m11: string): string;
5
+ static openWebLink(h11?: string, i11?: object): void;
6
6
  }
@@ -2,27 +2,27 @@ import { PLVTextUtils } from './PLVTextUtils';
2
2
  import PLVLogger from '../modules/log/PLVLogger';
3
3
  const TAG = '[PLVWebUtils]';
4
4
  export class PLVWebUtils {
5
- static toWebViewContent(content, color) {
6
- if (!content) {
7
- return content;
5
+ static toWebViewContent(v11, w11) {
6
+ if (!v11) {
7
+ return v11;
8
8
  }
9
- if (!color) {
10
- color = "rgba(0, 0, 0, 1)";
9
+ if (!w11) {
10
+ w11 = "rgba(0, 0, 0, 1)";
11
11
  }
12
- const style = "style=\" width:100%;\"";
13
- const h6 = "word-break:break-all;";
14
- const i6 = "color: " + color + ";";
15
- content = content.replace(/src=\"\/\//g, "src=\"https://");
16
- content = content.replace(/<img /g, "<img " + style + " ");
17
- content = content.replace(/<li>/g, "<li style=\"" + i6 + "\">");
18
- content = content.replace(/<p>/g, "<p style=\"" + h6 + i6 + "\">");
19
- content = content.replace(/<div>/g, "<div style=\"" + h6 + i6 + "\">");
20
- content = content.replace(/<table>/g, "<table border='1' rules=all style=\"" + i6 + "\">");
21
- content = content.replace(/<td>/g, "<td width=\"36\">");
22
- content = content.replace(/color: (#([0-9a-fA-F]{6}|[0-9a-fA-F]{8}));/g, (j6, k6) => {
23
- return `color: ${PLVWebUtils.toRGBA(k6)};`;
12
+ const x11 = "style=\" width:100%;\"";
13
+ const y11 = "word-break:break-all;";
14
+ const z11 = "color: " + w11 + ";";
15
+ v11 = v11.replace(/src=\"\/\//g, "src=\"https://");
16
+ v11 = v11.replace(/<img /g, "<img " + x11 + " ");
17
+ v11 = v11.replace(/<li>/g, "<li style=\"" + z11 + "\">");
18
+ v11 = v11.replace(/<p>/g, "<p style=\"" + y11 + z11 + "\">");
19
+ v11 = v11.replace(/<div>/g, "<div style=\"" + y11 + z11 + "\">");
20
+ v11 = v11.replace(/<table>/g, "<table border='1' rules=all style=\"" + z11 + "\">");
21
+ v11 = v11.replace(/<td>/g, "<td width=\"36\">");
22
+ v11 = v11.replace(/color: (#([0-9a-fA-F]{6}|[0-9a-fA-F]{8}));/g, (a12, b12) => {
23
+ return `color: ${PLVWebUtils.toRGBA(b12)};`;
24
24
  });
25
- content = "<!DOCTYPE html>\n" +
25
+ v11 = "<!DOCTYPE html>\n" +
26
26
  "<html lang=\"en\">\n" +
27
27
  "<head>\n" +
28
28
  " <meta charset=\"UTF-8\">\n" +
@@ -30,46 +30,45 @@ export class PLVWebUtils {
30
30
  " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n" +
31
31
  " <title>Document</title>\n" +
32
32
  "</head>\n" +
33
- "<body style=\" color: " + color + ";margin:0;padding:0\">" +
34
- content + "</body>\n" +
33
+ "<body style=\" color: " + w11 + ";margin:0;padding:0\">" + v11 + "</body>\n" +
35
34
  "</html>";
36
- return content;
35
+ return v11;
37
36
  }
38
- static toRGBA(g6) {
39
- let alpha = 1;
40
- if (g6.length > 7) {
41
- alpha = parseInt(g6.substring(1, 3), 16) / 255;
42
- g6 = `#${g6.substring(3)}`;
37
+ static toRGBA(q11) {
38
+ let r11 = 1;
39
+ if (q11.length > 7) {
40
+ r11 = parseInt(q11.substring(1, 3), 16) / 255;
41
+ q11 = `#${q11.substring(3)}`;
43
42
  }
44
- const red = parseInt(g6.substring(1, 3), 16);
45
- const green = parseInt(g6.substring(3, 5), 16);
46
- const blue = parseInt(g6.substring(5, 7), 16);
47
- return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
43
+ const s11 = parseInt(q11.substring(1, 3), 16);
44
+ const t11 = parseInt(q11.substring(3, 5), 16);
45
+ const u11 = parseInt(q11.substring(5, 7), 16);
46
+ return `rgba(${s11}, ${t11}, ${u11}, ${r11})`;
48
47
  }
49
- static cleanHTML(input) {
50
- let e6 = input.replace(/<p>((?:<img[^>]*>)+)<\/p>/g, (match, f6) => {
51
- return f6.replace(/<img[^>]*>/g, '[图片]');
48
+ static cleanHTML(m11) {
49
+ let n11 = m11.replace(/<p>((?:<img[^>]*>)+)<\/p>/g, (o11, p11) => {
50
+ return p11.replace(/<img[^>]*>/g, '[图片]');
52
51
  });
53
- e6 = e6.replace(/<p><a[^>]*>(.*?)<\/a><\/p>/g, '$1');
54
- e6 = e6.replace(/<p>(.*?)<\/p>/g, '$1');
55
- e6 = e6.replace(/\n/g, ' ');
56
- e6 = PLVTextUtils.convertSpecialString(e6);
57
- return e6;
52
+ n11 = n11.replace(/<p><a[^>]*>(.*?)<\/a><\/p>/g, '$1');
53
+ n11 = n11.replace(/<p>(.*?)<\/p>/g, '$1');
54
+ n11 = n11.replace(/\n/g, ' ');
55
+ n11 = PLVTextUtils.convertSpecialString(n11);
56
+ return n11;
58
57
  }
59
- static openWebLink(url, component) {
60
- let want = {
58
+ static openWebLink(h11, i11) {
59
+ let j11 = {
61
60
  action: 'ohos.want.action.viewData',
62
61
  entities: ['entity.system.browsable'],
63
- uri: url
62
+ uri: h11
64
63
  };
65
- const context = getContext(component);
66
- if (context) {
67
- context.startAbility(want)
64
+ const k11 = getContext(i11);
65
+ if (k11) {
66
+ k11.startAbility(j11)
68
67
  .then(() => {
69
- PLVLogger.info(TAG, `openWebLink success, url: ${url}`);
68
+ PLVLogger.info(TAG, `openWebLink success, url: ${h11}`);
70
69
  })
71
- .catch((err) => {
72
- PLVLogger.error(TAG, `openWebLink error, url: ${url}, code: ${err.code}, message: ${err.message}`);
70
+ .catch((l11) => {
71
+ PLVLogger.error(TAG, `openWebLink error, url: ${h11}, code: ${l11.code}, message: ${l11.message}`);
73
72
  });
74
73
  }
75
74
  else {
@@ -1,12 +1,14 @@
1
- import { BuilderNode, NodeController, UIContext } from '@kit.ArkUI';
1
+ import { BuilderNode as BuilderNode } from "@ohos.arkui.node";
2
+ import { NodeController as NodeController } from "@ohos.arkui.node";
3
+ import { UIContext as UIContext } from "@ohos.arkui.UIContext";
2
4
  import { PLVPromiseValue } from '../PLVCallback';
3
5
  export declare class PLVNodeControllerManager {
4
6
  private static controllerManagers;
5
7
  private controllers;
6
8
  private constructor();
7
- static get(id?: number): PLVNodeControllerManager;
8
- static delete(id: number): void;
9
- getOrCreate(config: string | NodeControllerConfig): PLVNodeController;
9
+ static get(q12?: number): PLVNodeControllerManager;
10
+ static delete(p12: number): void;
11
+ getOrCreate(m12: string | NodeControllerConfig): PLVNodeController;
10
12
  private destroy;
11
13
  }
12
14
  export declare class PLVNodeController extends NodeController {
@@ -22,12 +24,12 @@ export declare class PLVNodeController extends NodeController {
22
24
  isShowPromise: PLVPromiseValue<boolean>;
23
25
  private uiContext;
24
26
  private environmentCallback?;
25
- constructor(config: NodeControllerConfig);
26
- makeNode(uiContext: UIContext): FrameNode | null;
27
- fill(wrapBuilder: WrappedBuilder<[
27
+ constructor(j12: NodeControllerConfig);
28
+ makeNode(i12: UIContext): FrameNode | null;
29
+ fill(g12: WrappedBuilder<[
28
30
  ESObject
29
- ]>, params: ESObject): PLVNodeController;
30
- show(isShow?: boolean): void;
31
+ ]>, h12: ESObject): PLVNodeController;
32
+ show(f12?: boolean): void;
31
33
  destroy(): void;
32
34
  private onEnvironment;
33
35
  }