@onekeyfe/react-native-native-list 3.0.179-alpha.304 → 3.0.179

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 (111) hide show
  1. package/README.md +3 -32
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +1 -22
  4. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +8 -8
  5. package/android/src/main/java/com/onekey/nativelist/NativeListActionRenderer.kt +5 -5
  6. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +4 -4
  7. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +6 -6
  8. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +1 -6
  9. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +11 -11
  10. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +20 -20
  11. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +4 -5
  12. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +7 -7
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +5 -5
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +7 -8
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMetricCardRenderer.kt +14 -14
  16. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +15 -28
  17. package/android/src/main/java/com/onekey/nativelist/NativeListRailRenderer.kt +4 -4
  18. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +3 -3
  19. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +2 -3
  20. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +4 -5
  21. package/android/src/main/java/com/onekey/nativelist/NativeListRowHost.kt +1 -1
  22. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +20 -20
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSystemRenderer.kt +3 -3
  24. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +18 -104
  25. package/android/src/main/java/com/onekey/nativelist/NativeListWalletGroupRenderer.kt +5 -6
  26. package/common/fonts/Roobert-Bold.ttf +0 -0
  27. package/common/fonts/Roobert-Medium.ttf +0 -0
  28. package/common/fonts/Roobert-Regular.ttf +0 -0
  29. package/common/fonts/Roobert-SemiBold.ttf +0 -0
  30. package/docs/SPEC.md +0 -69
  31. package/docs/STYLE_SPEC.md +2 -12
  32. package/ios/HybridNativeList.swift +6 -18
  33. package/ios/NativeListAccessoryStack.swift +10 -14
  34. package/ios/NativeListActionRenderer.swift +4 -7
  35. package/ios/NativeListActivityDetailsView.swift +24 -63
  36. package/ios/NativeListActivityRenderer.swift +10 -19
  37. package/ios/NativeListDataRowRenderer.swift +19 -23
  38. package/ios/NativeListDesignAssets.swift +34 -43
  39. package/ios/NativeListIdentityRenderer.swift +19 -23
  40. package/ios/NativeListLeadingVisual.swift +4 -9
  41. package/ios/NativeListMarketRenderer.swift +11 -19
  42. package/ios/NativeListMediaTileRenderer.swift +7 -11
  43. package/ios/NativeListMessageRenderer.swift +10 -20
  44. package/ios/NativeListMetricCardRenderer.swift +12 -16
  45. package/ios/NativeListRailRenderer.swift +7 -9
  46. package/ios/NativeListRendererCell.swift +4 -6
  47. package/ios/NativeListRendererRegistry.swift +3 -8
  48. package/ios/NativeListResolvedText.swift +3 -3
  49. package/ios/NativeListRowHost.swift +2 -7
  50. package/ios/NativeListSectionHeaderRenderer.swift +19 -22
  51. package/ios/NativeListSystemRenderer.swift +16 -18
  52. package/ios/NativeListTextStyles.swift +12 -18
  53. package/ios/NativeListWalletGroupRenderer.swift +4 -6
  54. package/ios/RNCNativeListView.swift +5 -38
  55. package/ios/tests/NativeListActivityPresentationTests.swift +3 -5
  56. package/ios/tests/NativeListLifecycleTests.swift +2 -77
  57. package/lib/module/NativeList.js +0 -3
  58. package/lib/module/NativeList.web.js +1 -8
  59. package/lib/module/index.js +0 -1
  60. package/lib/module/web/NativeListWebEngine.js +24 -48
  61. package/lib/module/web/templates/ActionRowRenderer.js +1 -2
  62. package/lib/module/web/templates/IdentityRowRenderer.js +3 -4
  63. package/lib/module/web/templates/MarketRowRenderer.js +1 -2
  64. package/lib/module/web/templates/RowText.js +3 -13
  65. package/lib/module/web/templates/SectionHeaderRowRenderer.js +2 -3
  66. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
  67. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
  68. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
  69. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
  70. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
  71. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
  72. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
  73. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
  74. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
  75. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
  76. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
  77. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
  78. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
  79. package/lib/typescript/src/NativeList.nitro.d.ts +0 -1
  80. package/lib/typescript/src/index.d.ts +0 -2
  81. package/lib/typescript/src/web/NativeListWebEngine.d.ts +1 -4
  82. package/lib/typescript/src/web/templates/RowText.d.ts +0 -1
  83. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
  84. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
  85. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
  87. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
  88. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
  89. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
  90. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
  91. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
  92. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
  93. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
  94. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
  95. package/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
  96. package/package.json +5 -4
  97. package/react-native-native-list.podspec +1 -0
  98. package/src/NativeList.nitro.ts +0 -1
  99. package/src/NativeList.tsx +0 -3
  100. package/src/NativeList.web.tsx +1 -10
  101. package/src/index.ts +0 -3
  102. package/src/web/NativeListWebEngine.ts +24 -53
  103. package/src/web/templates/ActionRowRenderer.ts +1 -2
  104. package/src/web/templates/IdentityRowRenderer.ts +3 -4
  105. package/src/web/templates/MarketRowRenderer.ts +2 -4
  106. package/src/web/templates/RowText.ts +3 -15
  107. package/src/web/templates/SectionHeaderRowRenderer.ts +3 -6
  108. package/LICENSE +0 -36
  109. package/lib/module/fonts.js +0 -44
  110. package/lib/typescript/src/fonts.d.ts +0 -10
  111. package/src/fonts.ts +0 -64
@@ -1,4 +1,3 @@
1
- import { applyTextWeight } from './RowText';
2
1
  import { applyTabularNumbers, hasExplicitRowHeight } from './RowElements';
3
2
  import type { SectionHeaderRow } from '../../models';
4
3
  import {
@@ -57,12 +56,10 @@ function createSectionHeader(
57
56
  body.style.gap = row.checkbox ? '12px' : '8px';
58
57
  title.style.fontSize = row.variant === 'summary' ? '16px' : '14px';
59
58
  title.style.lineHeight = row.variant === 'summary' ? '24px' : '20px';
60
- applyTextWeight(
61
- title,
59
+ title.style.fontWeight =
62
60
  row.variant === 'summary' || (row.titleActionKey && !row.checkbox)
63
61
  ? '500'
64
- : '600'
65
- );
62
+ : '600';
66
63
  if (row.titleActionKey) {
67
64
  const text = createElement(
68
65
  document,
@@ -132,7 +129,7 @@ function createSectionHeader(
132
129
  value.style.fontFamily = 'inherit';
133
130
  value.style.fontSize = '16px';
134
131
  value.style.lineHeight = '24px';
135
- applyTextWeight(value, '500');
132
+ value.style.fontWeight = '500';
136
133
  if (row.valueActionKey) {
137
134
  value.style.color = 'var(--nl-secondary)';
138
135
  value.style.padding = '0';
package/LICENSE DELETED
@@ -1,36 +0,0 @@
1
- License scope
2
-
3
- The MIT grant below applies to OneKey-owned source code. The adapted avatar
4
- algorithms retain the upstream attribution below. No font files are distributed
5
- by this package.
6
-
7
- MIT License
8
-
9
- Copyright (c) 2024 OneKey
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
-
29
- ---
30
-
31
- Avatar PRNG/HSL algorithms in src/web/NativeListAvatarWorker.js are adapted from
32
- MyCrypto ethereum-blockies-base64 1.0.2 (MIT), commit
33
- 1290187d9c099335a06a2f867d5240a6034a6631. The upstream package declares MyCrypto
34
- as its author and MIT as its license, but contains no separate LICENSE file.
35
- The inline MIT grant remains in the worker. The upstream pnglib implementation
36
- is not included; PNG encoding uses OffscreenCanvas.
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- import { useSyncExternalStore } from 'react';
4
- const weights = ['regular', 'medium', 'semibold', 'bold'];
5
- let configuration = '{}';
6
- const listeners = new Set();
7
-
8
- /** Configure names already provided by the host in this JavaScript runtime. */
9
- export function configureNativeListFonts(families) {
10
- if (!families || typeof families !== 'object' || Array.isArray(families)) {
11
- throw new TypeError('NativeList font families must be an object');
12
- }
13
- if (Object.keys(families).some(key => !weights.includes(key))) {
14
- throw new TypeError('Unknown NativeList font weight');
15
- }
16
- const normalized = {};
17
- for (const weight of weights) {
18
- const name = families[weight];
19
- if (name === undefined) continue;
20
- if (typeof name !== 'string' || Array.from(name).some(character => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127)) {
21
- throw new TypeError(`Invalid NativeList ${weight} font family`);
22
- }
23
- const trimmed = name.trim();
24
- if (trimmed.length === 0 || trimmed.length > 128) {
25
- throw new TypeError(`Invalid NativeList ${weight} font family`);
26
- }
27
- normalized[weight] = trimmed;
28
- }
29
- const next = JSON.stringify(normalized);
30
- if (next === configuration) return;
31
- configuration = next;
32
- listeners.forEach(listener => listener());
33
- }
34
- function subscribe(listener) {
35
- listeners.add(listener);
36
- return () => listeners.delete(listener);
37
- }
38
- function getSnapshot() {
39
- return configuration;
40
- }
41
- export function useNativeListFontFamiliesJson() {
42
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
43
- }
44
- //# sourceMappingURL=fonts.js.map
@@ -1,10 +0,0 @@
1
- export type NativeListFontFamilies = Readonly<{
2
- regular?: string;
3
- medium?: string;
4
- semibold?: string;
5
- bold?: string;
6
- }>;
7
- /** Configure names already provided by the host in this JavaScript runtime. */
8
- export declare function configureNativeListFonts(families: NativeListFontFamilies): void;
9
- export declare function useNativeListFontFamiliesJson(): string;
10
- //# sourceMappingURL=fonts.d.ts.map
package/src/fonts.ts DELETED
@@ -1,64 +0,0 @@
1
- import { useSyncExternalStore } from 'react';
2
-
3
- export type NativeListFontFamilies = Readonly<{
4
- regular?: string;
5
- medium?: string;
6
- semibold?: string;
7
- bold?: string;
8
- }>;
9
-
10
- const weights = ['regular', 'medium', 'semibold', 'bold'] as const;
11
- let configuration = '{}';
12
- const listeners = new Set<() => void>();
13
-
14
- /** Configure names already provided by the host in this JavaScript runtime. */
15
- export function configureNativeListFonts(
16
- families: NativeListFontFamilies
17
- ): void {
18
- if (!families || typeof families !== 'object' || Array.isArray(families)) {
19
- throw new TypeError('NativeList font families must be an object');
20
- }
21
- if (
22
- Object.keys(families).some(
23
- (key) => !weights.includes(key as (typeof weights)[number])
24
- )
25
- ) {
26
- throw new TypeError('Unknown NativeList font weight');
27
- }
28
- const normalized: Record<string, string> = {};
29
- for (const weight of weights) {
30
- const name = families[weight];
31
- if (name === undefined) continue;
32
- if (
33
- typeof name !== 'string' ||
34
- Array.from(name).some(
35
- (character) =>
36
- character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127
37
- )
38
- ) {
39
- throw new TypeError(`Invalid NativeList ${weight} font family`);
40
- }
41
- const trimmed = name.trim();
42
- if (trimmed.length === 0 || trimmed.length > 128) {
43
- throw new TypeError(`Invalid NativeList ${weight} font family`);
44
- }
45
- normalized[weight] = trimmed;
46
- }
47
- const next = JSON.stringify(normalized);
48
- if (next === configuration) return;
49
- configuration = next;
50
- listeners.forEach((listener) => listener());
51
- }
52
-
53
- function subscribe(listener: () => void): () => void {
54
- listeners.add(listener);
55
- return () => listeners.delete(listener);
56
- }
57
-
58
- function getSnapshot(): string {
59
- return configuration;
60
- }
61
-
62
- export function useNativeListFontFamiliesJson(): string {
63
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
64
- }