@onekeyfe/react-native-native-list 3.0.179-alpha.302 → 3.0.179-alpha.303

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 (113) 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 +3 -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 +19 -69
  31. package/docs/STYLE_SPEC.md +2 -12
  32. package/ios/HybridNativeList.swift +21 -15
  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 +92 -38
  55. package/ios/tests/NativeListActivityPresentationTests.swift +3 -5
  56. package/ios/tests/NativeListLifecycleTests.swift +2 -77
  57. package/lib/module/NativeList.js +24 -8
  58. package/lib/module/NativeList.web.js +3 -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 +18 -9
  67. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -2
  68. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -5
  69. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +8 -2
  70. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +12 -7
  71. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -6
  72. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -1
  73. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +17 -6
  74. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -2
  75. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -2
  76. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -2
  77. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -3
  78. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -1
  79. package/lib/typescript/src/NativeList.nitro.d.ts +2 -1
  80. package/lib/typescript/src/NativeList.types.d.ts +4 -0
  81. package/lib/typescript/src/index.d.ts +0 -2
  82. package/lib/typescript/src/web/NativeListWebEngine.d.ts +1 -4
  83. package/lib/typescript/src/web/templates/RowText.d.ts +0 -1
  84. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +18 -9
  85. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -2
  86. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -5
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +8 -2
  88. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +12 -7
  89. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -6
  90. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -1
  91. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +17 -6
  92. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -2
  93. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -2
  94. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -2
  95. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -3
  96. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -1
  97. package/package.json +5 -4
  98. package/react-native-native-list.podspec +1 -0
  99. package/src/NativeList.nitro.ts +2 -1
  100. package/src/NativeList.tsx +25 -4
  101. package/src/NativeList.types.ts +4 -0
  102. package/src/NativeList.web.tsx +3 -10
  103. package/src/index.ts +0 -3
  104. package/src/web/NativeListWebEngine.ts +24 -53
  105. package/src/web/templates/ActionRowRenderer.ts +1 -2
  106. package/src/web/templates/IdentityRowRenderer.ts +3 -4
  107. package/src/web/templates/MarketRowRenderer.ts +2 -4
  108. package/src/web/templates/RowText.ts +3 -15
  109. package/src/web/templates/SectionHeaderRowRenderer.ts +3 -6
  110. package/LICENSE +0 -36
  111. package/lib/module/fonts.js +0 -44
  112. package/lib/typescript/src/fonts.d.ts +0 -10
  113. package/src/fonts.ts +0 -64
@@ -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
- }