@onekeyfe/react-native-native-list 6.7.0-alpha.354 → 6.7.0-alpha.362
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/src/main/java/com/onekey/nativelist/HybridNativeList.kt +0 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +7 -240
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +4 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +3 -6
- package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +0 -12
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +7 -87
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +1 -135
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +14 -43
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +0 -25
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +2 -17
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +0 -22
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +0 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +0 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +2 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +0 -69
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +1 -55
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +21 -585
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +0 -1
- package/docs/ROW_TEMPLATES.md +9 -60
- package/docs/SPEC.md +5 -317
- package/docs/STYLE_SPEC.md +0 -6
- package/ios/HybridNativeList.swift +0 -10
- package/ios/NativeListAccessoryStack.swift +37 -220
- package/ios/NativeListActivityDetailsView.swift +8 -18
- package/ios/NativeListActivityRenderer.swift +2 -8
- package/ios/NativeListDataRowRenderer.swift +8 -105
- package/ios/NativeListDesignAssets.swift +0 -3
- package/ios/NativeListIdentityRenderer.swift +4 -119
- package/ios/NativeListLeadingVisual.swift +14 -49
- package/ios/NativeListMessageRenderer.swift +1 -34
- package/ios/NativeListModels.swift +2 -16
- package/ios/NativeListRendererRegistry.swift +0 -1
- package/ios/NativeListResolvedText.swift +1 -2
- package/ios/NativeListRowHost.swift +0 -14
- package/ios/NativeListSectionHeaderRenderer.swift +0 -88
- package/ios/RNCNativeListView.swift +29 -331
- package/ios/tests/NativeListActivityPresentationTests.swift +0 -56
- package/ios/tests/NativeListLifecycleTests.swift +3 -890
- package/lib/module/NativeList.js +21 -39
- package/lib/module/NativeList.web.js +4 -51
- package/lib/module/models.js +0 -1
- package/lib/module/selection.js +1 -1
- package/lib/module/validation.js +8 -320
- package/lib/module/web/NativeListWebEngine.js +18 -373
- package/lib/module/web/templates/ActivityRowRenderer.js +7 -8
- package/lib/module/web/templates/DataRowRenderer.js +5 -40
- package/lib/module/web/templates/IdentityRowRenderer.js +4 -90
- package/lib/module/web/templates/MessageRowRenderer.js +2 -18
- package/lib/module/web/templates/RowContainerStyle.js +0 -1
- package/lib/module/web/templates/RowRendererRegistry.js +0 -3
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +2 -36
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
- package/lib/typescript/src/NativeList.nitro.d.ts +0 -1
- package/lib/typescript/src/NativeList.types.d.ts +0 -8
- package/lib/typescript/src/models.d.ts +9 -101
- package/lib/typescript/src/validation.d.ts +0 -10
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +0 -26
- package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
- package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +3 -9
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
- package/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
- package/package.json +3 -3
- package/react-native-native-list.podspec +0 -1
- package/src/NativeList.nitro.ts +0 -1
- package/src/NativeList.tsx +24 -72
- package/src/NativeList.types.ts +0 -9
- package/src/NativeList.web.tsx +8 -72
- package/src/models.ts +3 -113
- package/src/selection.ts +0 -1
- package/src/validation.ts +6 -721
- package/src/web/NativeListWebEngine.ts +19 -568
- package/src/web/templates/ActivityRowRenderer.ts +6 -14
- package/src/web/templates/DataRowRenderer.ts +20 -93
- package/src/web/templates/IdentityRowRenderer.ts +5 -150
- package/src/web/templates/MessageRowRenderer.ts +7 -23
- package/src/web/templates/RowContainerStyle.ts +0 -2
- package/src/web/templates/RowRendererRegistry.ts +1 -11
- package/src/web/templates/SectionHeaderRowRenderer.ts +4 -47
- package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +0 -102
- package/ios/NativeListButtonGroupRenderer.swift +0 -89
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/icon.svg +0 -4
- package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/icon.svg +0 -3
- package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/icon.svg +0 -3
- package/lib/module/web/templates/ButtonGroupRowRenderer.js +0 -47
- package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +0 -14
- package/src/web/templates/ButtonGroupRowRenderer.ts +0 -58
|
@@ -22,13 +22,13 @@ function bindLegacy(body, row, primitives) {
|
|
|
22
22
|
node.hidden = !row[key];
|
|
23
23
|
if (style?.[key]) primitives.textStyle(node, style[key]);
|
|
24
24
|
}
|
|
25
|
-
const visualKey = JSON.stringify([row.key, row.
|
|
25
|
+
const visualKey = JSON.stringify([row.key, row.leading, row.secondaryLeading]);
|
|
26
26
|
if (v.visualKey !== visualKey) {
|
|
27
27
|
v.visuals.forEach(node => {
|
|
28
28
|
primitives.dispose(node);
|
|
29
29
|
node.remove();
|
|
30
30
|
});
|
|
31
|
-
v.visuals =
|
|
31
|
+
v.visuals = [row.leading, row.secondaryLeading].map(source => primitives.visual(source)).filter(node => !!node);
|
|
32
32
|
v.visuals.forEach(node => body.insertBefore(node, v.column));
|
|
33
33
|
v.visualStyles = v.visuals.map(node => new RowVisualStyle(node));
|
|
34
34
|
v.visualKey = visualKey;
|
|
@@ -224,23 +224,22 @@ function bindHistory(body, row, primitives) {
|
|
|
224
224
|
Object.assign(v.identity.style, {
|
|
225
225
|
display: 'flex',
|
|
226
226
|
alignItems: 'center',
|
|
227
|
-
gap:
|
|
227
|
+
gap: '12px',
|
|
228
228
|
minWidth: '0',
|
|
229
229
|
flex: '1 1 0'
|
|
230
230
|
});
|
|
231
231
|
Object.assign(v.visual.style, {
|
|
232
|
-
display: row.hideLeading ? 'none' : '',
|
|
233
232
|
position: 'relative',
|
|
234
233
|
width: '40px',
|
|
235
234
|
height: '40px',
|
|
236
235
|
flex: '0 0 40px'
|
|
237
236
|
});
|
|
238
|
-
const visualKey = JSON.stringify([row.key, row.
|
|
237
|
+
const visualKey = JSON.stringify([row.key, row.leading, row.secondaryLeading]);
|
|
239
238
|
if (v.visualKey !== visualKey) {
|
|
240
239
|
Array.from(v.visual.children).forEach(n => primitives.dispose(n));
|
|
241
240
|
v.visual.replaceChildren();
|
|
242
241
|
v.visuals = [];
|
|
243
|
-
const sources =
|
|
242
|
+
const sources = [row.leading, row.secondaryLeading].filter(Boolean);
|
|
244
243
|
sources.forEach(source => {
|
|
245
244
|
const visual = primitives.visual(source);
|
|
246
245
|
if (!visual) return;
|
|
@@ -264,7 +263,7 @@ function bindHistory(body, row, primitives) {
|
|
|
264
263
|
});
|
|
265
264
|
v.visualKey = visualKey;
|
|
266
265
|
}
|
|
267
|
-
const sources =
|
|
266
|
+
const sources = [row.leading, row.secondaryLeading].filter(Boolean);
|
|
268
267
|
v.visuals.forEach((retained, index) => {
|
|
269
268
|
const {
|
|
270
269
|
node: visual,
|
|
@@ -494,7 +493,7 @@ function bindHistory(body, row, primitives) {
|
|
|
494
493
|
v.feeSecondary.style.cssText = ellipsis + 'font-size:14px;line-height:20px;font-weight:400;color:var(--nl-secondary);';
|
|
495
494
|
valueText(v.feePrimary, row.fee?.primary, row.fee?.primaryTextSegments, 14, 20, 400);
|
|
496
495
|
valueText(v.feeSecondary, row.fee?.secondary, row.fee?.secondaryTextSegments, 14, 20, 400);
|
|
497
|
-
v.actions.style.cssText =
|
|
496
|
+
v.actions.style.cssText = 'display:flex;gap:12px;padding-left:52px;padding-bottom:4px;';
|
|
498
497
|
v.actions.style.display = footer ? 'flex' : 'none';
|
|
499
498
|
const actionKeys = new Set();
|
|
500
499
|
for (const [index, action] of (row.footerActions ?? []).entries()) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { createElement,
|
|
4
|
-
import { applyValueSegments, fontWeight } from "./RowText.js";
|
|
3
|
+
import { createElement, tagSlot } from "./RowElements.js";
|
|
5
4
|
import { RowVisualStyle } from "./RowVisual.js";
|
|
6
5
|
const views = new WeakMap();
|
|
7
6
|
const tone = (value, fallback) => value === 'positive' ? 'var(--nl-positive)' : value === 'negative' ? 'var(--nl-negative)' : value === 'secondary' ? 'var(--nl-secondary)' : `var(--nl-${fallback})`;
|
|
@@ -17,9 +16,6 @@ function bind(body, row, primitives) {
|
|
|
17
16
|
v.controls.replaceChildren();
|
|
18
17
|
if (row.checkbox) v.controls.appendChild(primitives.accessory(row.key, row.checkbox, 0));
|
|
19
18
|
v.controls.style.display = 'contents';
|
|
20
|
-
v.trailing.replaceChildren();
|
|
21
|
-
row.trailing?.forEach((accessory, index) => v.trailing.appendChild(primitives.accessory(row.key, accessory, index)));
|
|
22
|
-
v.trailing.hidden = !row.trailing?.length;
|
|
23
19
|
v.index.style.cssText = '';
|
|
24
20
|
v.index.hidden = row.index === undefined;
|
|
25
21
|
v.index.textContent = String(row.index ?? '');
|
|
@@ -58,26 +54,7 @@ function bind(body, row, primitives) {
|
|
|
58
54
|
if (style?.titleBadgeGap !== undefined) cell.primaryLine.style.gap = `${style.titleBadgeGap}px`;
|
|
59
55
|
cell.primary.style.cssText = '';
|
|
60
56
|
cell.primary.textContent = column.text;
|
|
61
|
-
applyValueSegments(cell.primary, column.textSegments, style?.columns?.fontSize ?? 14, style?.columns?.lineHeight ?? 20, fontWeight(style?.columns?.fontWeight, 500));
|
|
62
57
|
if (style?.columns) primitives.textStyle(cell.primary, style.columns);
|
|
63
|
-
cell.titleIcons.replaceChildren();
|
|
64
|
-
if (column.titleIcon || column.secondaryTitleIcon) {
|
|
65
|
-
cell.primary.style.minWidth = '0';
|
|
66
|
-
cell.primary.style.overflow = 'hidden';
|
|
67
|
-
cell.primary.style.textOverflow = 'ellipsis';
|
|
68
|
-
cell.primary.style.whiteSpace = 'nowrap';
|
|
69
|
-
[column.titleIcon, column.secondaryTitleIcon].filter(icon => icon !== undefined).forEach(descriptor => {
|
|
70
|
-
const icon = primitives.iconAction(descriptor.name, undefined, undefined, descriptor.tintColor);
|
|
71
|
-
icon.className = 'ok-native-list-identity-title-icon';
|
|
72
|
-
if (descriptor.hoverActionKey) {
|
|
73
|
-
setData(icon, 'nativeListHoverAction', descriptor.hoverActionKey);
|
|
74
|
-
setData(icon, 'nativeListIconHelp', true);
|
|
75
|
-
markActionAnchorSource(icon, 'leadingAction');
|
|
76
|
-
}
|
|
77
|
-
if (descriptor.accessibilityLabel) icon.setAttribute('aria-label', descriptor.accessibilityLabel);else icon.setAttribute('aria-hidden', 'true');
|
|
78
|
-
cell.titleIcons.appendChild(icon);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
58
|
cell.badges.replaceChildren();
|
|
82
59
|
cell.badges.style.display = 'contents';
|
|
83
60
|
if (column.key === 'asset') row.badges?.forEach(badge => {
|
|
@@ -87,22 +64,17 @@ function bind(body, row, primitives) {
|
|
|
87
64
|
});
|
|
88
65
|
// Legacy Web layout: secondary leading text sits inline before the primary
|
|
89
66
|
// text; secondary text is a direct line below it, toned by secondaryTone.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
[column.secondaryLeadingText, secondaryText].forEach((text, slot) => {
|
|
67
|
+
cell.secondaryLine.style.display = column.secondaryText ? 'contents' : 'none';
|
|
68
|
+
[column.secondaryLeadingText, column.secondaryText].forEach((text, slot) => {
|
|
93
69
|
const label = cell.secondary[slot];
|
|
94
70
|
label.hidden = !text;
|
|
95
71
|
if (!text) label.remove();else if (slot === 0) cell.primaryLine.insertBefore(label, cell.primary);else cell.secondaryLine.appendChild(label);
|
|
96
72
|
label.style.cssText = '';
|
|
97
73
|
label.textContent = text ?? '';
|
|
98
|
-
if (slot === 1) {
|
|
99
|
-
applyValueSegments(label, column.secondaryTextSegments, style?.columnSecondary?.fontSize ?? 12, style?.columnSecondary?.lineHeight ?? 16, fontWeight(style?.columnSecondary?.fontWeight, 400));
|
|
100
|
-
}
|
|
101
74
|
if (slot === 1) label.style.color = tone(column.secondaryTone, 'secondary');
|
|
102
75
|
if (style?.columnSecondary) primitives.textStyle(label, style.columnSecondary);
|
|
103
76
|
});
|
|
104
77
|
});
|
|
105
|
-
body.appendChild(v.trailing);
|
|
106
78
|
}
|
|
107
79
|
function create(document, row, primitives) {
|
|
108
80
|
const body = createElement(document, 'div', 'ok-native-list-row ok-native-list-data');
|
|
@@ -110,7 +82,6 @@ function create(document, row, primitives) {
|
|
|
110
82
|
const index = tagSlot(createElement(document, 'span', 'ok-native-list-index'), 'index');
|
|
111
83
|
const favorite = createElement(document, 'span', 'ok-native-list-favorite');
|
|
112
84
|
const controls = createElement(document, 'span');
|
|
113
|
-
const trailing = createElement(document, 'span', 'ok-native-list-accessories');
|
|
114
85
|
body.append(controls, index, favorite);
|
|
115
86
|
const columns = Array.from({
|
|
116
87
|
length: 4
|
|
@@ -118,10 +89,8 @@ function create(document, row, primitives) {
|
|
|
118
89
|
const cell = createElement(document, 'span', 'ok-native-list-data-cell');
|
|
119
90
|
const primaryLine = createElement(document, 'span', 'ok-native-list-data-primary');
|
|
120
91
|
const primary = tagSlot(createElement(document, 'span'), 'columns');
|
|
121
|
-
const titleIcons = createElement(document, 'span');
|
|
122
|
-
titleIcons.style.display = 'contents';
|
|
123
92
|
const badges = createElement(document, 'span');
|
|
124
|
-
primaryLine.append(primary,
|
|
93
|
+
primaryLine.append(primary, badges);
|
|
125
94
|
const secondaryLine = createElement(document, 'span', 'ok-native-list-data-secondary-line');
|
|
126
95
|
const secondary = Array.from({
|
|
127
96
|
length: 2
|
|
@@ -133,18 +102,15 @@ function create(document, row, primitives) {
|
|
|
133
102
|
body: cell,
|
|
134
103
|
primaryLine,
|
|
135
104
|
primary,
|
|
136
|
-
titleIcons,
|
|
137
105
|
badges,
|
|
138
106
|
secondaryLine,
|
|
139
107
|
secondary
|
|
140
108
|
};
|
|
141
109
|
});
|
|
142
|
-
body.appendChild(trailing);
|
|
143
110
|
views.set(body, {
|
|
144
111
|
favorite,
|
|
145
112
|
index,
|
|
146
113
|
controls,
|
|
147
|
-
trailing,
|
|
148
114
|
columns,
|
|
149
115
|
visualKey: '',
|
|
150
116
|
primitives
|
|
@@ -163,7 +129,6 @@ function recycle(body) {
|
|
|
163
129
|
v.visualStyle = undefined;
|
|
164
130
|
v.visualKey = '';
|
|
165
131
|
v.controls.replaceChildren();
|
|
166
|
-
v.trailing.replaceChildren();
|
|
167
132
|
}
|
|
168
133
|
export const dataRowRenderer = {
|
|
169
134
|
key: 'dataRow',
|
|
@@ -172,7 +137,7 @@ export const dataRowRenderer = {
|
|
|
172
137
|
recycle,
|
|
173
138
|
// Legacy presets: table rows without secondary text are 8 units shorter.
|
|
174
139
|
measure: (row, _width, layout) => {
|
|
175
|
-
const secondary = row.columns.some(column => column.
|
|
140
|
+
const secondary = row.columns.some(column => column.secondaryText);
|
|
176
141
|
return (secondary ? 60 : 56) + (layout === 'table' && !secondary ? -8 : 0);
|
|
177
142
|
},
|
|
178
143
|
measureRendered: (_body, _row) => undefined
|
|
@@ -100,77 +100,6 @@ function createIdentityRow(document, primitives, row) {
|
|
|
100
100
|
});
|
|
101
101
|
column.insertBefore(segments, titleElement.nextSibling);
|
|
102
102
|
}
|
|
103
|
-
if (row.titleIcon || row.secondaryTitleIcon) {
|
|
104
|
-
const badgeLine = titleElement.querySelector(':scope > .ok-native-list-badges');
|
|
105
|
-
const titleText = createElement(document, 'span', 'ok-native-list-identity-title-text');
|
|
106
|
-
while (titleElement.firstChild && titleElement.firstChild !== badgeLine) titleText.appendChild(titleElement.firstChild);
|
|
107
|
-
titleElement.prepend(titleText);
|
|
108
|
-
const icons = [row.titleIcon, row.secondaryTitleIcon].filter(icon => icon !== undefined).map(descriptor => {
|
|
109
|
-
const icon = primitives.iconAction(descriptor.name, undefined, undefined, descriptor.tintColor);
|
|
110
|
-
icon.className = 'ok-native-list-identity-title-icon';
|
|
111
|
-
if (descriptor.hoverActionKey) {
|
|
112
|
-
setData(icon, 'nativeListHoverAction', descriptor.hoverActionKey);
|
|
113
|
-
setData(icon, 'nativeListIconHelp', true);
|
|
114
|
-
markActionAnchorSource(icon, 'leadingAction');
|
|
115
|
-
}
|
|
116
|
-
if (descriptor.accessibilityLabel) icon.setAttribute('aria-label', descriptor.accessibilityLabel);else icon.setAttribute('aria-hidden', 'true');
|
|
117
|
-
return icon;
|
|
118
|
-
});
|
|
119
|
-
titleText.after(...icons);
|
|
120
|
-
titleElement.style.display = 'flex';
|
|
121
|
-
titleElement.style.alignItems = 'center';
|
|
122
|
-
titleElement.style.gap = '4px';
|
|
123
|
-
}
|
|
124
|
-
if (row.titleSuffixes?.length) {
|
|
125
|
-
const badges = titleElement.querySelector(':scope > .ok-native-list-badges');
|
|
126
|
-
let titleText = titleElement.querySelector(':scope > .ok-native-list-identity-title-text, :scope > [data-nl-slot="title"]');
|
|
127
|
-
if (!titleText) {
|
|
128
|
-
titleText = tagSlot(createElement(document, 'span', 'ok-native-list-identity-title-text'), 'title');
|
|
129
|
-
while (titleElement.firstChild && titleElement.firstChild !== badges) titleText.appendChild(titleElement.firstChild);
|
|
130
|
-
titleElement.prepend(titleText);
|
|
131
|
-
titleElement.removeAttribute('data-nl-slot');
|
|
132
|
-
} else if (titleElement.hasAttribute('data-nl-slot')) {
|
|
133
|
-
titleElement.removeAttribute('data-nl-slot');
|
|
134
|
-
tagSlot(titleText, 'title');
|
|
135
|
-
}
|
|
136
|
-
titleElement.style.display = 'flex';
|
|
137
|
-
titleElement.style.alignItems = 'center';
|
|
138
|
-
titleText.style.flex = '0 1 auto';
|
|
139
|
-
titleText.style.minWidth = 'min(80px, 100%)';
|
|
140
|
-
titleText.style.overflow = 'hidden';
|
|
141
|
-
titleText.style.textOverflow = 'ellipsis';
|
|
142
|
-
titleText.style.whiteSpace = 'nowrap';
|
|
143
|
-
row.titleSuffixes.forEach(suffix => {
|
|
144
|
-
const label = createElement(document, 'span', 'ok-native-list-identity-title-suffix', suffix.text);
|
|
145
|
-
label.style.flex = '0 1 auto';
|
|
146
|
-
label.style.minWidth = '0';
|
|
147
|
-
label.style.marginInlineStart = row.titleIcon || row.secondaryTitleIcon ? '4px' : '8px';
|
|
148
|
-
label.style.maxWidth = suffix.maxWidth === undefined ? '' : `${suffix.maxWidth}px`;
|
|
149
|
-
label.style.overflow = 'hidden';
|
|
150
|
-
label.style.textOverflow = 'ellipsis';
|
|
151
|
-
label.style.whiteSpace = 'nowrap';
|
|
152
|
-
label.style.fontSize = '12px';
|
|
153
|
-
label.style.lineHeight = '16px';
|
|
154
|
-
label.style.fontWeight = '400';
|
|
155
|
-
label.style.fontFamily = 'var(--nl-font-regular)';
|
|
156
|
-
label.style.color = suffix.tone === 'disabled' ? 'var(--nl-disabled)' : 'var(--nl-secondary)';
|
|
157
|
-
titleElement.insertBefore(label, badges);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
if (row.badges?.length && !row.titleIcon && !row.secondaryTitleIcon) {
|
|
161
|
-
const titleText = titleElement.querySelector(':scope > [data-nl-slot="title"]');
|
|
162
|
-
const badges = titleElement.querySelector(':scope > .ok-native-list-badges');
|
|
163
|
-
titleElement.style.display = 'flex';
|
|
164
|
-
titleElement.style.alignItems = 'center';
|
|
165
|
-
if (titleText) {
|
|
166
|
-
titleText.style.flex = '0 1 auto';
|
|
167
|
-
titleText.style.minWidth = row.titleSuffixes?.length ? 'min(80px, 100%)' : '0';
|
|
168
|
-
}
|
|
169
|
-
if (badges) {
|
|
170
|
-
badges.style.flex = '0 1 auto';
|
|
171
|
-
badges.style.minWidth = '0';
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
103
|
if (presentation === 'walletSidebar' && row.badges?.length) {
|
|
175
104
|
const badges = createElement(document, 'span', 'ok-native-list-wallet-badges');
|
|
176
105
|
row.badges.forEach(badge => badges.appendChild(createBadge(document, badge)));
|
|
@@ -178,9 +107,9 @@ function createIdentityRow(document, primitives, row) {
|
|
|
178
107
|
}
|
|
179
108
|
for (const key of ['title', 'subtitle']) {
|
|
180
109
|
const lines = row.style?.[key]?.lines ?? row[`${key}Lines`];
|
|
181
|
-
if (lines !== undefined) column.querySelectorAll(`[data-nl-slot="${key}"]`).forEach(text => applyTextLayout(text,
|
|
110
|
+
if (lines !== undefined) column.querySelectorAll(`[data-nl-slot="${key}"]`).forEach(text => applyTextLayout(text, {
|
|
182
111
|
lines
|
|
183
|
-
}
|
|
112
|
+
}));
|
|
184
113
|
}
|
|
185
114
|
}
|
|
186
115
|
body.appendChild(column);
|
|
@@ -196,17 +125,6 @@ function applyIdentityStyle(body, row) {
|
|
|
196
125
|
if (box.verticalPadding !== undefined) body.style.paddingBlock = String(box.verticalPadding) + 'px';
|
|
197
126
|
const vertical = row.type === 'identity' && row.presentation === 'walletSidebar';
|
|
198
127
|
const leading = body.querySelector(':scope > .ok-native-list-visual, :scope > .ok-native-list-stacked');
|
|
199
|
-
if (row.style?.leadingContentMaxWidthRatio !== undefined && !vertical) {
|
|
200
|
-
const column = body.querySelector(':scope > .ok-native-list-flex');
|
|
201
|
-
const trailing = body.querySelector(':scope > .ok-native-list-accessories');
|
|
202
|
-
const visualWidth = leading ? row.style.image?.width ?? (row.presentation === 'accountSelector' || row.presentation === 'networkSelector' ? 32 : 40) : 0;
|
|
203
|
-
const gap = leading ? row.style.leadingGap ?? 12 : 0;
|
|
204
|
-
if (column) {
|
|
205
|
-
column.style.flex = '0 1 auto';
|
|
206
|
-
column.style.maxWidth = `calc(${row.style.leadingContentMaxWidthRatio * 100}% - ${visualWidth + gap}px)`;
|
|
207
|
-
}
|
|
208
|
-
if (trailing) trailing.style.marginInlineStart = 'auto';
|
|
209
|
-
}
|
|
210
128
|
const defaultGap = body.style.gap || (row.type === 'identity' && row.presentation === 'walletSidebar' ? '4px' : row.type === 'identity' && row.presentation === 'accountSelector' ? '8px' : '12px');
|
|
211
129
|
if (box.lineGap !== undefined) {
|
|
212
130
|
const targets = body.querySelectorAll(':scope > .ok-native-list-flex');
|
|
@@ -243,7 +161,7 @@ function applyIdentityStyle(body, row) {
|
|
|
243
161
|
// Clip the bitmap itself; decorations may extend beyond the visual slot.
|
|
244
162
|
leading.style.overflow = leading.matches('img') ? 'hidden' : 'visible';
|
|
245
163
|
}
|
|
246
|
-
const images = leading.matches('img') ? [leading] : leading.querySelectorAll(':scope > img
|
|
164
|
+
const images = leading.matches('img') ? [leading] : leading.querySelectorAll(':scope > img, :scope > .ok-native-list-visual-fallback');
|
|
247
165
|
images.forEach(bitmap => {
|
|
248
166
|
if (bitmap !== leading) {
|
|
249
167
|
if (image.width !== undefined) bitmap.style.width = '100%';
|
|
@@ -367,10 +285,6 @@ export const identityRowRenderer = {
|
|
|
367
285
|
recycle,
|
|
368
286
|
appliesSizePreset: row => !row.presentation,
|
|
369
287
|
measure: (row, _width) => row.presentation === 'walletSidebar' ? 68 + (row.badges?.length ? 24 : 0) : row.presentation === 'networkSelector' ? 47 : row.presentation === 'accountSelector' ? 58 : row.tertiary ? 72 : row.subtitle ? 60 : 56,
|
|
370
|
-
measureRendered: (
|
|
371
|
-
if (row.contentHeight !== 'auto' || hasExplicitRowHeight(row)) return undefined;
|
|
372
|
-
const height = body.getBoundingClientRect().height;
|
|
373
|
-
return height > 0 ? height : undefined;
|
|
374
|
-
}
|
|
288
|
+
measureRendered: (_body, _row) => undefined
|
|
375
289
|
};
|
|
376
290
|
//# sourceMappingURL=IdentityRowRenderer.js.map
|
|
@@ -46,7 +46,6 @@ export function bindMessageRow(body, row, primitives) {
|
|
|
46
46
|
body.style.cssText = '';
|
|
47
47
|
body.removeAttribute('data-nl-container-background');
|
|
48
48
|
body.removeAttribute('data-nl-container-border');
|
|
49
|
-
if (row.presentation === 'inlineWarning') body.setAttribute('data-nl-inline-warning', 'true');else body.removeAttribute('data-nl-inline-warning');
|
|
50
49
|
body.style.padding = `${resolved.verticalPadding}px ${resolved.horizontalPadding}px`;
|
|
51
50
|
body.style.height = resolved.automaticHeight ? 'auto' : '100%';
|
|
52
51
|
views.column.style.cssText = '';
|
|
@@ -54,22 +53,7 @@ export function bindMessageRow(body, row, primitives) {
|
|
|
54
53
|
for (const [view, text] of [[views.title, resolved.title], [views.body, resolved.body], [views.time, resolved.time]]) {
|
|
55
54
|
view.style.cssText = '';
|
|
56
55
|
view.textContent = text.value;
|
|
57
|
-
|
|
58
|
-
lines,
|
|
59
|
-
...textStyle
|
|
60
|
-
} = text.style;
|
|
61
|
-
primitives.textStyle(view, lines === 0 ? textStyle : {
|
|
62
|
-
...textStyle,
|
|
63
|
-
lines
|
|
64
|
-
});
|
|
65
|
-
if (lines === 0) {
|
|
66
|
-
view.style.whiteSpace = 'pre-wrap';
|
|
67
|
-
view.style.overflow = 'visible';
|
|
68
|
-
view.style.textOverflow = 'clip';
|
|
69
|
-
view.style.maxHeight = 'none';
|
|
70
|
-
view.style.removeProperty('-webkit-line-clamp');
|
|
71
|
-
view.style.removeProperty('-webkit-box-orient');
|
|
72
|
-
}
|
|
56
|
+
primitives.textStyle(view, text.style);
|
|
73
57
|
}
|
|
74
58
|
views.unread.style.cssText = '';
|
|
75
59
|
if (row.body) {
|
|
@@ -159,7 +143,7 @@ export function measureMessageRow(row, availableWidth) {
|
|
|
159
143
|
if (!text.value) return 0;
|
|
160
144
|
const value = text.style.lines === 1 ? text.value.replace(/\r\n|[\r\n]/g, ' ') : text.value;
|
|
161
145
|
const lines = value.split(/\r\n|[\r\n]/).reduce((total, line) => total + Math.max(1, Math.ceil(Array.from(line).reduce((sum, char) => sum + (char.charCodeAt(0) > 255 ? text.style.fontSize : text.style.fontSize / 2), 0) / Math.max(1, width))), 0);
|
|
162
|
-
return
|
|
146
|
+
return Math.min(text.style.lines, lines) * text.style.lineHeight;
|
|
163
147
|
};
|
|
164
148
|
const timeWidth = Math.min(availableWidth / 3, Math.max(0, r.time.value.length * r.time.style.fontSize / 2));
|
|
165
149
|
const textWidth = availableWidth - r.horizontalPadding * 2 - (row.leading ? r.imageWidth + r.leadingGap : 0) - (row.thumbnail ? 76 : 0) - (row.unread ? 19 : 0) - timeWidth - 12;
|
|
@@ -66,7 +66,6 @@ export function applyRowContainerStyle(body, row) {
|
|
|
66
66
|
body.style.removeProperty('background-color');
|
|
67
67
|
}
|
|
68
68
|
if (container.cornerRadius !== undefined) set(body, 'border-radius', `${container.cornerRadius}px`);
|
|
69
|
-
if (row.type === 'message' && row.presentation === 'inlineWarning') set(body, 'border-radius', '0px');
|
|
70
69
|
if (container.borderWidth !== undefined) {
|
|
71
70
|
// Paint above member backgrounds without changing the content box or hit targets.
|
|
72
71
|
body.setAttribute('data-nl-container-border', 'true');
|
|
@@ -10,7 +10,6 @@ import { dataRowRenderer } from "./DataRowRenderer.js";
|
|
|
10
10
|
import { activityRowRenderer } from "./ActivityRowRenderer.js";
|
|
11
11
|
import { systemRowRenderer } from "./SystemRowRenderer.js";
|
|
12
12
|
import { actionRowRenderer } from "./ActionRowRenderer.js";
|
|
13
|
-
import { buttonGroupRowRenderer } from "./ButtonGroupRowRenderer.js";
|
|
14
13
|
import { mediaTileRowRenderer } from "./MediaTileRowRenderer.js";
|
|
15
14
|
import { messageRowRenderer } from "./MessageRowRenderer.js";
|
|
16
15
|
import { railRowRenderer } from "./RailRowRenderer.js";
|
|
@@ -35,7 +34,6 @@ const factories = {
|
|
|
35
34
|
activity: row => registration(activityRowRenderer, row),
|
|
36
35
|
system: row => registration(systemRowRenderer, row),
|
|
37
36
|
action: row => registration(actionRowRenderer, row),
|
|
38
|
-
buttonGroup: row => registration(buttonGroupRowRenderer, row),
|
|
39
37
|
message: row => registration(messageRowRenderer, row),
|
|
40
38
|
rail: row => registration(railRowRenderer, row),
|
|
41
39
|
mediaTile: row => registration(mediaTileRowRenderer, row)
|
|
@@ -51,7 +49,6 @@ const renderers = {
|
|
|
51
49
|
activity: activityRowRenderer,
|
|
52
50
|
system: systemRowRenderer,
|
|
53
51
|
action: actionRowRenderer,
|
|
54
|
-
buttonGroup: buttonGroupRowRenderer,
|
|
55
52
|
message: messageRowRenderer,
|
|
56
53
|
rail: railRowRenderer,
|
|
57
54
|
mediaTile: mediaTileRowRenderer
|
|
@@ -4,20 +4,6 @@ import { applyTextWeight } from "./RowText.js";
|
|
|
4
4
|
import { applyTabularNumbers, hasExplicitRowHeight } from "./RowElements.js";
|
|
5
5
|
import { createElement, setData, tagSlot, markActionAnchorSource, createTextColumn } from "./RowElements.js";
|
|
6
6
|
import { applyValueSegments } from "./RowText.js";
|
|
7
|
-
function bindHelp(target, help) {
|
|
8
|
-
markActionAnchorSource(target, 'trailingAccessory', 0);
|
|
9
|
-
if (help.presentation === 'tooltip') {
|
|
10
|
-
setData(target, 'nativeListHoverAction', help.actionKey);
|
|
11
|
-
setData(target, 'nativeListIconHelp', true);
|
|
12
|
-
} else {
|
|
13
|
-
setData(target, 'nativeListAction', help.actionKey);
|
|
14
|
-
target.setAttribute('role', 'button');
|
|
15
|
-
}
|
|
16
|
-
if (help.underline === 'dashed') {
|
|
17
|
-
target.style.textDecoration = 'underline dashed';
|
|
18
|
-
target.style.textUnderlineOffset = '4px';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
7
|
function createSectionHeader(document, primitives, row) {
|
|
22
8
|
const body = createElement(document, 'div', 'ok-native-list-row ok-native-list-section');
|
|
23
9
|
setData(body, 'variant', row.variant);
|
|
@@ -31,11 +17,6 @@ function createSectionHeader(document, primitives, row) {
|
|
|
31
17
|
const column = createTextColumn(document, row.title, row.subtitle);
|
|
32
18
|
const title = column.firstElementChild;
|
|
33
19
|
title.classList.add('ok-native-list-section-title');
|
|
34
|
-
if (row.leadingBadge) {
|
|
35
|
-
const badge = createElement(document, 'span', 'ok-native-list-badge', row.leadingBadge.text);
|
|
36
|
-
if (row.leadingBadge.tone) setData(badge, 'tone', row.leadingBadge.tone);
|
|
37
|
-
body.appendChild(badge);
|
|
38
|
-
}
|
|
39
20
|
if (row.titleActionKey) {
|
|
40
21
|
setData(title, 'nativeListAction', row.titleActionKey);
|
|
41
22
|
markActionAnchorSource(title, 'leadingAction');
|
|
@@ -50,11 +31,6 @@ function createSectionHeader(document, primitives, row) {
|
|
|
50
31
|
}
|
|
51
32
|
if (row.titleActionOnHover) setData(title, 'nativeListHoverAction', true);
|
|
52
33
|
}
|
|
53
|
-
if (row.style?.titleDecoration === 'none') title.style.textDecoration = 'none';
|
|
54
|
-
if (row.style?.titleDecoration === 'dashed') {
|
|
55
|
-
title.style.textDecoration = 'underline dashed';
|
|
56
|
-
title.style.textUnderlineOffset = '4px';
|
|
57
|
-
}
|
|
58
34
|
if (row.presentation === 'networkSelector' && hasExplicitRowHeight(row)) {
|
|
59
35
|
body.style.padding = row.variant === 'summary' ? '24px 12px 20px' : '0 12px';
|
|
60
36
|
body.style.backgroundColor = 'var(--nl-bg)';
|
|
@@ -132,7 +108,7 @@ function createSectionHeader(document, primitives, row) {
|
|
|
132
108
|
body.appendChild(pendingLine);
|
|
133
109
|
} else body.appendChild(column);
|
|
134
110
|
if (row.value) {
|
|
135
|
-
const value = tagSlot(createElement(document, row.valueActionKey
|
|
111
|
+
const value = tagSlot(createElement(document, row.valueActionKey ? 'button' : 'span', row.valueActionKey ? 'ok-native-list-action-button ok-native-list-section-value' : 'ok-native-list-value ok-native-list-section-value', row.value), 'value');
|
|
136
112
|
applyValueSegments(value, row.valueSegments);
|
|
137
113
|
if (row.presentation === 'networkSelector' && hasExplicitRowHeight(row)) {
|
|
138
114
|
value.style.fontFamily = 'inherit';
|
|
@@ -151,17 +127,7 @@ function createSectionHeader(document, primitives, row) {
|
|
|
151
127
|
setData(value, 'nativeListAction', row.valueActionKey);
|
|
152
128
|
markActionAnchorSource(value, 'trailingAccessory', 0);
|
|
153
129
|
}
|
|
154
|
-
|
|
155
|
-
if (row.style?.valuePlacement === 'afterTitle') {
|
|
156
|
-
value.style.marginLeft = '0';
|
|
157
|
-
value.style.flexShrink = '0';
|
|
158
|
-
value.style.alignSelf = 'center';
|
|
159
|
-
title.insertAdjacentElement('afterend', value);
|
|
160
|
-
column.style.flexDirection = 'row';
|
|
161
|
-
column.style.alignItems = 'center';
|
|
162
|
-
column.style.justifyContent = 'flex-start';
|
|
163
|
-
column.style.gap = '8px';
|
|
164
|
-
} else body.appendChild(value);
|
|
130
|
+
body.appendChild(value);
|
|
165
131
|
}
|
|
166
132
|
if (row.valueIcon) {
|
|
167
133
|
const valueIcon = primitives.iconAction(row.valueIcon.name, row.valueIcon.actionKey, row.valueIcon.disabled, row.valueIcon.tintColor);
|
|
@@ -88,15 +88,6 @@ namespace margelo::nitro::nativelist {
|
|
|
88
88
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* containerSlotHeightsJson */)>("setContainerSlotHeightsJson");
|
|
89
89
|
method(_javaPart, jni::make_jstring(containerSlotHeightsJson));
|
|
90
90
|
}
|
|
91
|
-
std::string JHybridNativeListSpec::getSidecarLayoutJson() {
|
|
92
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getSidecarLayoutJson");
|
|
93
|
-
auto __result = method(_javaPart);
|
|
94
|
-
return __result->toStdString();
|
|
95
|
-
}
|
|
96
|
-
void JHybridNativeListSpec::setSidecarLayoutJson(const std::string& sidecarLayoutJson) {
|
|
97
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* sidecarLayoutJson */)>("setSidecarLayoutJson");
|
|
98
|
-
method(_javaPart, jni::make_jstring(sidecarLayoutJson));
|
|
99
|
-
}
|
|
100
91
|
NativeListScrollEdgeEffect JHybridNativeListSpec::getTopScrollEdgeEffect() {
|
|
101
92
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNativeListScrollEdgeEffect>()>("getTopScrollEdgeEffect");
|
|
102
93
|
auto __result = method(_javaPart);
|
|
@@ -56,8 +56,6 @@ namespace margelo::nitro::nativelist {
|
|
|
56
56
|
void setFontFamiliesJson(const std::string& fontFamiliesJson) override;
|
|
57
57
|
std::string getContainerSlotHeightsJson() override;
|
|
58
58
|
void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) override;
|
|
59
|
-
std::string getSidecarLayoutJson() override;
|
|
60
|
-
void setSidecarLayoutJson(const std::string& sidecarLayoutJson) override;
|
|
61
59
|
NativeListScrollEdgeEffect getTopScrollEdgeEffect() override;
|
|
62
60
|
void setTopScrollEdgeEffect(NativeListScrollEdgeEffect topScrollEdgeEffect) override;
|
|
63
61
|
double getTopOverlayHeight() override;
|
|
@@ -68,11 +68,6 @@ void JHybridNativeListStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
|
|
|
68
68
|
: !newProps->containerSlotHeightsJson.hasSameValue(oldProps->containerSlotHeightsJson)) {
|
|
69
69
|
hybridView->setContainerSlotHeightsJson(newProps->containerSlotHeightsJson.get());
|
|
70
70
|
}
|
|
71
|
-
if (oldProps == nullptr
|
|
72
|
-
? newProps->sidecarLayoutJson.isProvided()
|
|
73
|
-
: !newProps->sidecarLayoutJson.hasSameValue(oldProps->sidecarLayoutJson)) {
|
|
74
|
-
hybridView->setSidecarLayoutJson(newProps->sidecarLayoutJson.get());
|
|
75
|
-
}
|
|
76
71
|
if (oldProps == nullptr
|
|
77
72
|
? newProps->topScrollEdgeEffect.isProvided()
|
|
78
73
|
: !newProps->topScrollEdgeEffect.hasSameValue(oldProps->topScrollEdgeEffect)) {
|
package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt
CHANGED
|
@@ -45,12 +45,6 @@ abstract class HybridNativeListSpec: HybridView() {
|
|
|
45
45
|
@set:Keep
|
|
46
46
|
abstract var containerSlotHeightsJson: String
|
|
47
47
|
|
|
48
|
-
@get:DoNotStrip
|
|
49
|
-
@get:Keep
|
|
50
|
-
@set:DoNotStrip
|
|
51
|
-
@set:Keep
|
|
52
|
-
abstract var sidecarLayoutJson: String
|
|
53
|
-
|
|
54
48
|
@get:DoNotStrip
|
|
55
49
|
@get:Keep
|
|
56
50
|
@set:DoNotStrip
|
|
@@ -96,13 +96,6 @@ namespace margelo::nitro::nativelist {
|
|
|
96
96
|
inline void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) noexcept override {
|
|
97
97
|
_swiftPart.setContainerSlotHeightsJson(containerSlotHeightsJson);
|
|
98
98
|
}
|
|
99
|
-
inline std::string getSidecarLayoutJson() noexcept override {
|
|
100
|
-
auto __result = _swiftPart.getSidecarLayoutJson();
|
|
101
|
-
return __result;
|
|
102
|
-
}
|
|
103
|
-
inline void setSidecarLayoutJson(const std::string& sidecarLayoutJson) noexcept override {
|
|
104
|
-
_swiftPart.setSidecarLayoutJson(sidecarLayoutJson);
|
|
105
|
-
}
|
|
106
99
|
inline NativeListScrollEdgeEffect getTopScrollEdgeEffect() noexcept override {
|
|
107
100
|
auto __result = _swiftPart.getTopScrollEdgeEffect();
|
|
108
101
|
return static_cast<NativeListScrollEdgeEffect>(__result);
|
|
@@ -130,12 +130,6 @@ using namespace margelo::nitro::nativelist::views;
|
|
|
130
130
|
: !newViewProps.containerSlotHeightsJson.hasSameValue(oldViewProps->containerSlotHeightsJson)) {
|
|
131
131
|
swiftPart.setContainerSlotHeightsJson(newViewProps.containerSlotHeightsJson.get());
|
|
132
132
|
}
|
|
133
|
-
// sidecarLayoutJson: string
|
|
134
|
-
if (oldViewProps == nullptr
|
|
135
|
-
? newViewProps.sidecarLayoutJson.isProvided()
|
|
136
|
-
: !newViewProps.sidecarLayoutJson.hasSameValue(oldViewProps->sidecarLayoutJson)) {
|
|
137
|
-
swiftPart.setSidecarLayoutJson(newViewProps.sidecarLayoutJson.get());
|
|
138
|
-
}
|
|
139
133
|
// topScrollEdgeEffect: enum
|
|
140
134
|
if (oldViewProps == nullptr
|
|
141
135
|
? newViewProps.topScrollEdgeEffect.isProvided()
|
|
@@ -13,7 +13,6 @@ public protocol HybridNativeListSpec_protocol: HybridObject, HybridView {
|
|
|
13
13
|
var snapshotJson: String { get set }
|
|
14
14
|
var fontFamiliesJson: String { get set }
|
|
15
15
|
var containerSlotHeightsJson: String { get set }
|
|
16
|
-
var sidecarLayoutJson: String { get set }
|
|
17
16
|
var topScrollEdgeEffect: NativeListScrollEdgeEffect { get set }
|
|
18
17
|
var topOverlayHeight: Double { get set }
|
|
19
18
|
var scrollPositionThresholdsJson: String { get set }
|
|
@@ -154,17 +154,6 @@ open class HybridNativeListSpec_cxx {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
public final var sidecarLayoutJson: std.string {
|
|
158
|
-
@inline(__always)
|
|
159
|
-
get {
|
|
160
|
-
return std.string(self.__implementation.sidecarLayoutJson)
|
|
161
|
-
}
|
|
162
|
-
@inline(__always)
|
|
163
|
-
set {
|
|
164
|
-
self.__implementation.sidecarLayoutJson = String(newValue)
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
157
|
public final var topScrollEdgeEffect: Int32 {
|
|
169
158
|
@inline(__always)
|
|
170
159
|
get {
|
|
@@ -20,8 +20,6 @@ namespace margelo::nitro::nativelist {
|
|
|
20
20
|
prototype.registerHybridSetter("fontFamiliesJson", &HybridNativeListSpec::setFontFamiliesJson);
|
|
21
21
|
prototype.registerHybridGetter("containerSlotHeightsJson", &HybridNativeListSpec::getContainerSlotHeightsJson);
|
|
22
22
|
prototype.registerHybridSetter("containerSlotHeightsJson", &HybridNativeListSpec::setContainerSlotHeightsJson);
|
|
23
|
-
prototype.registerHybridGetter("sidecarLayoutJson", &HybridNativeListSpec::getSidecarLayoutJson);
|
|
24
|
-
prototype.registerHybridSetter("sidecarLayoutJson", &HybridNativeListSpec::setSidecarLayoutJson);
|
|
25
23
|
prototype.registerHybridGetter("topScrollEdgeEffect", &HybridNativeListSpec::getTopScrollEdgeEffect);
|
|
26
24
|
prototype.registerHybridSetter("topScrollEdgeEffect", &HybridNativeListSpec::setTopScrollEdgeEffect);
|
|
27
25
|
prototype.registerHybridGetter("topOverlayHeight", &HybridNativeListSpec::getTopOverlayHeight);
|
|
@@ -63,8 +63,6 @@ namespace margelo::nitro::nativelist {
|
|
|
63
63
|
virtual void setFontFamiliesJson(const std::string& fontFamiliesJson) = 0;
|
|
64
64
|
virtual std::string getContainerSlotHeightsJson() = 0;
|
|
65
65
|
virtual void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) = 0;
|
|
66
|
-
virtual std::string getSidecarLayoutJson() = 0;
|
|
67
|
-
virtual void setSidecarLayoutJson(const std::string& sidecarLayoutJson) = 0;
|
|
68
66
|
virtual NativeListScrollEdgeEffect getTopScrollEdgeEffect() = 0;
|
|
69
67
|
virtual void setTopScrollEdgeEffect(NativeListScrollEdgeEffect topScrollEdgeEffect) = 0;
|
|
70
68
|
virtual double getTopOverlayHeight() = 0;
|
|
@@ -23,7 +23,6 @@ namespace margelo::nitro::nativelist::views {
|
|
|
23
23
|
snapshotJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "snapshotJson", rawProps, sourceProps.snapshotJson)),
|
|
24
24
|
fontFamiliesJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "fontFamiliesJson", rawProps, sourceProps.fontFamiliesJson)),
|
|
25
25
|
containerSlotHeightsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "containerSlotHeightsJson", rawProps, sourceProps.containerSlotHeightsJson)),
|
|
26
|
-
sidecarLayoutJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "sidecarLayoutJson", rawProps, sourceProps.sidecarLayoutJson)),
|
|
27
26
|
topScrollEdgeEffect(nitro::ReactProp<NativeListScrollEdgeEffect>::fromRawValue("NativeList", "topScrollEdgeEffect", rawProps, sourceProps.topScrollEdgeEffect)),
|
|
28
27
|
topOverlayHeight(nitro::ReactProp<double>::fromRawValue("NativeList", "topOverlayHeight", rawProps, sourceProps.topOverlayHeight)),
|
|
29
28
|
scrollPositionThresholdsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "scrollPositionThresholdsJson", rawProps, sourceProps.scrollPositionThresholdsJson)),
|
|
@@ -43,7 +42,6 @@ namespace margelo::nitro::nativelist::views {
|
|
|
43
42
|
case hashString("snapshotJson"): return true;
|
|
44
43
|
case hashString("fontFamiliesJson"): return true;
|
|
45
44
|
case hashString("containerSlotHeightsJson"): return true;
|
|
46
|
-
case hashString("sidecarLayoutJson"): return true;
|
|
47
45
|
case hashString("topScrollEdgeEffect"): return true;
|
|
48
46
|
case hashString("topOverlayHeight"): return true;
|
|
49
47
|
case hashString("scrollPositionThresholdsJson"): return true;
|
|
@@ -49,7 +49,6 @@ namespace margelo::nitro::nativelist::views {
|
|
|
49
49
|
nitro::ReactProp<std::string> snapshotJson;
|
|
50
50
|
nitro::ReactProp<std::string> fontFamiliesJson;
|
|
51
51
|
nitro::ReactProp<std::string> containerSlotHeightsJson;
|
|
52
|
-
nitro::ReactProp<std::string> sidecarLayoutJson;
|
|
53
52
|
nitro::ReactProp<NativeListScrollEdgeEffect> topScrollEdgeEffect;
|
|
54
53
|
nitro::ReactProp<double> topOverlayHeight;
|
|
55
54
|
nitro::ReactProp<std::string> scrollPositionThresholdsJson;
|
|
@@ -69,7 +68,6 @@ namespace margelo::nitro::nativelist::views {
|
|
|
69
68
|
return snapshotJson.hasSameValue(other.snapshotJson) &&
|
|
70
69
|
fontFamiliesJson.hasSameValue(other.fontFamiliesJson) &&
|
|
71
70
|
containerSlotHeightsJson.hasSameValue(other.containerSlotHeightsJson) &&
|
|
72
|
-
sidecarLayoutJson.hasSameValue(other.sidecarLayoutJson) &&
|
|
73
71
|
topScrollEdgeEffect.hasSameValue(other.topScrollEdgeEffect) &&
|
|
74
72
|
topOverlayHeight.hasSameValue(other.topOverlayHeight) &&
|
|
75
73
|
scrollPositionThresholdsJson.hasSameValue(other.scrollPositionThresholdsJson) &&
|
|
@@ -90,7 +88,6 @@ namespace margelo::nitro::nativelist::views {
|
|
|
90
88
|
return snapshotJson.isProvided() ||
|
|
91
89
|
fontFamiliesJson.isProvided() ||
|
|
92
90
|
containerSlotHeightsJson.isProvided() ||
|
|
93
|
-
sidecarLayoutJson.isProvided() ||
|
|
94
91
|
topScrollEdgeEffect.isProvided() ||
|
|
95
92
|
topOverlayHeight.isProvided() ||
|
|
96
93
|
scrollPositionThresholdsJson.isProvided() ||
|