@onekeyfe/react-native-native-list 6.8.0-alpha.514 → 6.8.0-alpha.540
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.
- package/android/build.gradle +3 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +18 -4
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +70 -33
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +3 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +8 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +21 -4
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +24 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListRowUpdates.kt +34 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +11 -4
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +84 -9
- package/android/src/main/res/values/native_scroll_coordinator_ids.xml +1 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentitySubtitleBindingTest.kt +177 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +2 -0
- package/docs/SPEC.md +159 -2
- package/docs/STYLE_SPEC.md +7 -1
- package/ios/NativeListAccessoryStack.swift +22 -0
- package/ios/NativeListDataRowRenderer.swift +12 -5
- package/ios/NativeListIdentityRenderer.swift +36 -58
- package/ios/NativeListLeadingVisual.swift +8 -0
- package/ios/NativeListMarketRenderer.swift +6 -2
- package/ios/NativeListModels.swift +7 -0
- package/ios/NativeListResolvedText.swift +9 -7
- package/ios/NativeListSectionHeaderRenderer.swift +9 -43
- package/ios/NativeListTextStyles.swift +72 -12
- package/ios/RNCNativeListView.swift +203 -45
- package/ios/tests/NativeListLifecycleTests.swift +298 -24
- package/lib/module/validation.js +21 -10
- package/lib/module/web/NativeListWebEngine.js +213 -23
- package/lib/module/web/templates/ActivityRowRenderer.js +1 -1
- package/lib/module/web/templates/IdentityRowRenderer.js +12 -1
- package/lib/module/web/templates/MarketRowRenderer.js +2 -0
- package/lib/module/web/templates/MediaTileRowRenderer.js +1 -0
- package/lib/module/web/templates/RowElements.js +2 -2
- package/lib/module/web/templates/RowText.js +2 -0
- package/lib/typescript/src/models.d.ts +15 -1
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +8 -1
- package/lib/typescript/src/web/templates/RowRendererRegistry.d.ts +6 -2
- package/lib/typescript/src/web/templates/RowVisual.d.ts +1 -1
- package/package.json +1 -1
- package/src/models.ts +15 -0
- package/src/validation.ts +67 -4
- package/src/web/NativeListWebEngine.ts +382 -27
- package/src/web/templates/ActivityRowRenderer.ts +1 -1
- package/src/web/templates/IdentityRowRenderer.ts +23 -1
- package/src/web/templates/MarketRowRenderer.ts +2 -0
- package/src/web/templates/MediaTileRowRenderer.ts +1 -0
- package/src/web/templates/RowElements.ts +3 -2
- package/src/web/templates/RowText.ts +6 -0
- package/src/web/templates/RowVisual.ts +2 -1
|
@@ -44,6 +44,16 @@ function appendAccessories(
|
|
|
44
44
|
'ok-native-list-accessories'
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
+
// ListItem's rename + drag pair sits in <XStack gap="$6">; iOS and Android
|
|
48
|
+
// lay the same pair out natively.
|
|
49
|
+
if (
|
|
50
|
+
accessories.length === 2 &&
|
|
51
|
+
accessories[0].kind === 'icon' &&
|
|
52
|
+
accessories[0].name === 'PencilOutline' &&
|
|
53
|
+
accessories[1].kind === 'drag'
|
|
54
|
+
)
|
|
55
|
+
container.style.gap = '24px';
|
|
56
|
+
|
|
47
57
|
if (
|
|
48
58
|
row &&
|
|
49
59
|
hasExplicitRowHeight(row) &&
|
|
@@ -111,9 +121,21 @@ function createIdentityRow(
|
|
|
111
121
|
row.leadingAction.name,
|
|
112
122
|
row.leadingAction.actionKey,
|
|
113
123
|
row.leadingAction.disabled,
|
|
114
|
-
row.leadingAction.tintColor
|
|
124
|
+
row.leadingAction.tintColor,
|
|
125
|
+
row.leadingAction.accessibilityLabel
|
|
115
126
|
);
|
|
116
127
|
markActionAnchorSource(action, 'leadingAction');
|
|
128
|
+
// ListItem.IconButton geometry, as on iOS and Android: the medium tertiary
|
|
129
|
+
// frame overhangs its 24-point slot by 7 on each side.
|
|
130
|
+
action.classList.add('ok-native-list-tertiary-icon');
|
|
131
|
+
const glyph = createElement(
|
|
132
|
+
document,
|
|
133
|
+
'span',
|
|
134
|
+
'ok-native-list-action-glyph'
|
|
135
|
+
);
|
|
136
|
+
glyph.dataset.nativeListAnchorGlyph = '';
|
|
137
|
+
glyph.append(...action.childNodes);
|
|
138
|
+
action.append(glyph);
|
|
117
139
|
body.appendChild(action);
|
|
118
140
|
}
|
|
119
141
|
const visual = primitives.visual(
|
|
@@ -66,6 +66,8 @@ function applyMarketTextStyle(
|
|
|
66
66
|
String(fontWeight(style?.fontWeight, defaults.weight))
|
|
67
67
|
);
|
|
68
68
|
element.style.color = style?.color ?? '';
|
|
69
|
+
element.style.letterSpacing = '';
|
|
70
|
+
element.style.fontVariantNumeric = '';
|
|
69
71
|
element.style.textAlign = style?.alignment ?? defaults.alignment;
|
|
70
72
|
element.style.whiteSpace = (style?.lines ?? 1) > 1 ? 'normal' : 'nowrap';
|
|
71
73
|
element.style.display = '';
|
|
@@ -102,8 +102,9 @@ export function createBadge(
|
|
|
102
102
|
// Selector digits retain their font family, including explicit button fonts.
|
|
103
103
|
export function applyTabularNumbers(body: HTMLElement): void {
|
|
104
104
|
body.style.fontVariantNumeric = 'tabular-nums';
|
|
105
|
-
body.querySelectorAll
|
|
106
|
-
|
|
105
|
+
body.querySelectorAll('button').forEach((button) => {
|
|
106
|
+
if (!button.style.fontVariantNumeric)
|
|
107
|
+
button.style.fontVariantNumeric = 'inherit';
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -150,6 +150,12 @@ export function applyTextStyleToSlot(
|
|
|
150
150
|
if (style.fontWeight !== undefined)
|
|
151
151
|
applyTextWeight(element, String(fontWeight(style.fontWeight, 400)));
|
|
152
152
|
if (style.color !== undefined) element.style.color = style.color;
|
|
153
|
+
if (style.tabularNumbers !== undefined)
|
|
154
|
+
element.style.fontVariantNumeric = style.tabularNumbers
|
|
155
|
+
? 'tabular-nums'
|
|
156
|
+
: 'proportional-nums';
|
|
157
|
+
if (style.letterSpacing !== undefined)
|
|
158
|
+
element.style.letterSpacing = String(style.letterSpacing) + 'px';
|
|
153
159
|
// Explicit overrides also apply to rich text runs, but never to sibling badges.
|
|
154
160
|
// Subscript segments keep their legacy size relative to the field size.
|
|
155
161
|
element.querySelectorAll<HTMLElement>('span').forEach((run) => {
|