@onekeyfe/react-native-native-list 6.7.0-5 → 6.7.0-51

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 (214) hide show
  1. package/README.md +312 -375
  2. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
  3. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +250 -9
  4. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
  5. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
  6. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
  7. package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
  8. package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
  9. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
  10. package/android/src/main/java/com/onekey/nativelist/NativeListGeneratedIcons.kt +47 -0
  11. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
  12. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +152 -33
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPlaceholderView.kt +244 -0
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
  16. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +32 -11
  17. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
  18. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
  19. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -287
  20. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
  21. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +7 -0
  22. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
  24. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
  25. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1978 -136
  26. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
  27. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
  28. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
  29. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
  30. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
  31. package/docs/ROW_TEMPLATES.md +74 -13
  32. package/docs/SPEC.md +1232 -16
  33. package/docs/STYLE_SPEC.md +14 -0
  34. package/ios/HybridNativeList.swift +21 -2
  35. package/ios/NativeListAccessoryStack.swift +237 -51
  36. package/ios/NativeListActivityDetailsView.swift +30 -11
  37. package/ios/NativeListActivityRenderer.swift +8 -2
  38. package/ios/NativeListButtonGroupRenderer.swift +89 -0
  39. package/ios/NativeListDataRowRenderer.swift +167 -30
  40. package/ios/NativeListDesignAssets.swift +13 -75
  41. package/ios/NativeListGeneratedIcons.swift +55 -0
  42. package/ios/NativeListIconBinding.swift +171 -0
  43. package/ios/NativeListIdentityRenderer.swift +256 -39
  44. package/ios/NativeListLeadingVisual.swift +127 -28
  45. package/ios/NativeListMarketRenderer.swift +120 -31
  46. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  47. package/ios/NativeListMediaPreviewSlot.swift +122 -61
  48. package/ios/NativeListMediaTileRenderer.swift +15 -11
  49. package/ios/NativeListMessageRenderer.swift +34 -1
  50. package/ios/NativeListMetricCardRenderer.swift +4 -2
  51. package/ios/NativeListModels.swift +42 -2
  52. package/ios/NativeListRendererRegistry.swift +1 -0
  53. package/ios/NativeListResolvedText.swift +2 -1
  54. package/ios/NativeListRowHost.swift +14 -0
  55. package/ios/NativeListSectionHeaderRenderer.swift +100 -4
  56. package/ios/RNCNativeListView.swift +1093 -59
  57. package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
  58. package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
  59. package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
  60. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
  61. package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
  62. package/ios/tests/NativeListLifecycleTests.swift +2915 -4
  63. package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
  64. package/ios/tests/NativeListMediaVisibilityTests.swift +26 -1
  65. package/ios/tests/NativeListSharedIconTests.swift +236 -0
  66. package/lib/module/NativeList.js +236 -38
  67. package/lib/module/NativeList.web.js +167 -46
  68. package/lib/module/index.js +1 -1
  69. package/lib/module/models.js +3 -0
  70. package/lib/module/selection.js +1 -1
  71. package/lib/module/validation.js +1246 -48
  72. package/lib/module/web/NativeListGeneratedIcons.js +31 -0
  73. package/lib/module/web/NativeListWebEngine.js +513 -275
  74. package/lib/module/web/templates/ActivityRowRenderer.js +12 -31
  75. package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
  76. package/lib/module/web/templates/DataRowRenderer.js +40 -5
  77. package/lib/module/web/templates/IdentityRowRenderer.js +158 -6
  78. package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
  79. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -25
  80. package/lib/module/web/templates/MessageRowRenderer.js +18 -2
  81. package/lib/module/web/templates/RowContainerStyle.js +1 -0
  82. package/lib/module/web/templates/RowRendererRegistry.js +3 -0
  83. package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
  84. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  85. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  86. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  87. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  88. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  89. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  90. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  91. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  92. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  93. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  94. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  95. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  96. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  97. package/lib/typescript/src/NativeList.d.ts +3 -3
  98. package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
  99. package/lib/typescript/src/NativeList.types.d.ts +20 -2
  100. package/lib/typescript/src/index.d.ts +2 -2
  101. package/lib/typescript/src/models.d.ts +126 -17
  102. package/lib/typescript/src/validation.d.ts +20 -0
  103. package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
  104. package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
  105. package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
  106. package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
  107. package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +9 -3
  108. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  109. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  110. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  112. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  113. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  114. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  115. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  116. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  117. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  118. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  119. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  120. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  121. package/package.json +16 -10
  122. package/react-native-native-list.podspec +2 -6
  123. package/scripts/generate-icons.mjs +150 -0
  124. package/scripts/generate-icons.test.mjs +288 -0
  125. package/scripts/native-list-icons.json +260 -0
  126. package/src/NativeList.nitro.ts +2 -0
  127. package/src/NativeList.tsx +439 -91
  128. package/src/NativeList.types.ts +24 -2
  129. package/src/NativeList.web.tsx +295 -89
  130. package/src/index.ts +2 -0
  131. package/src/models.ts +263 -144
  132. package/src/selection.ts +1 -0
  133. package/src/validation.ts +3013 -152
  134. package/src/web/NativeListGeneratedIcons.ts +28 -0
  135. package/src/web/NativeListWebEngine.ts +818 -343
  136. package/src/web/templates/ActivityRowRenderer.ts +29 -59
  137. package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
  138. package/src/web/templates/DataRowRenderer.ts +93 -20
  139. package/src/web/templates/IdentityRowRenderer.ts +231 -6
  140. package/src/web/templates/MarketTableRowRenderer.ts +53 -33
  141. package/src/web/templates/MediaTileRowRenderer.ts +90 -28
  142. package/src/web/templates/MessageRowRenderer.ts +23 -7
  143. package/src/web/templates/RowContainerStyle.ts +2 -0
  144. package/src/web/templates/RowRendererRegistry.ts +11 -1
  145. package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
  146. package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
  147. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
  148. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
  149. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
  150. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
  151. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
  152. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
  153. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
  154. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
  155. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
  156. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
  157. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
  158. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
  159. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
  160. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
  161. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
  162. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
  163. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
  164. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
  165. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
  166. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
  167. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
  168. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
  169. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
  170. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
  171. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
  172. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
  173. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
  174. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
  175. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
  176. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
  177. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
  178. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
  179. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
  180. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
  181. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
  182. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
  183. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
  184. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
  185. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
  186. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
  187. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
  188. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
  189. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
  190. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
  191. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
  192. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
  193. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
  194. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
  195. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
  196. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
  197. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
  198. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
  199. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
  200. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
  201. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
  202. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
  203. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
  204. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
  205. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
  206. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
  207. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
  208. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
  209. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
  210. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
  211. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
  212. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
  213. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
  214. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
@@ -122,6 +122,79 @@ function recycleLegacy(body) {
122
122
  v.imageKey = v.networkKey = '';
123
123
  }
124
124
  const galleries = new WeakMap();
125
+ const SVG_NS = 'http://www.w3.org/2000/svg';
126
+ let glyphMaskId = 0;
127
+
128
+ /**
129
+ * Placeholder glyphs share one 24pt geometry with the iOS and Android renderers:
130
+ * a rounded frame with a sun and a ridge; the failed glyph adds a slash and cuts
131
+ * a gap into the frame around it.
132
+ */
133
+ function createMediaGlyph(document, state) {
134
+ const svg = document.createElementNS(SVG_NS, 'svg');
135
+ svg.setAttribute('viewBox', '0 0 24 24');
136
+ svg.setAttribute('fill', 'none');
137
+ svg.setAttribute('stroke', 'currentColor');
138
+ svg.setAttribute('stroke-width', '1.5');
139
+ svg.setAttribute('stroke-linecap', 'round');
140
+ svg.setAttribute('stroke-linejoin', 'round');
141
+ svg.setAttribute('aria-hidden', 'true');
142
+ const shape = (tag, attributes) => {
143
+ const node = document.createElementNS(SVG_NS, tag);
144
+ Object.entries(attributes).forEach(([key, value]) => node.setAttribute(key, value));
145
+ return node;
146
+ };
147
+ const picture = shape('g', {});
148
+ picture.append(shape('rect', {
149
+ x: '3',
150
+ y: '3',
151
+ width: '18',
152
+ height: '18',
153
+ rx: '4'
154
+ }), shape('circle', {
155
+ cx: '9',
156
+ cy: '9',
157
+ r: '1.6'
158
+ }), shape('path', {
159
+ d: 'M5 20.5L14.5 11L21 17.5'
160
+ }));
161
+ if (state === 'failed') {
162
+ glyphMaskId += 1;
163
+ const id = `ok-native-list-media-cut-${glyphMaskId}`;
164
+ const mask = shape('mask', {
165
+ id,
166
+ maskUnits: 'userSpaceOnUse'
167
+ });
168
+ mask.append(shape('rect', {
169
+ x: '0',
170
+ y: '0',
171
+ width: '24',
172
+ height: '24',
173
+ fill: '#fff',
174
+ stroke: 'none'
175
+ }), shape('path', {
176
+ d: 'M2.6 -0.6L24.6 21.4L21.4 24.6L-0.6 2.6Z',
177
+ fill: '#000',
178
+ stroke: 'none'
179
+ }));
180
+ picture.setAttribute('mask', `url(#${id})`);
181
+ svg.append(mask, picture, shape('path', {
182
+ d: 'M3 3L21 21'
183
+ }));
184
+ } else svg.append(picture);
185
+ const wrap = document.createElement('div');
186
+ wrap.className = 'ok-native-list-media-glyph';
187
+ wrap.dataset.glyph = state;
188
+ wrap.append(svg);
189
+ return wrap;
190
+ }
191
+ const SWEEP_PERIOD_MS = 1600;
192
+ function setPlaceholderState(v, state) {
193
+ v.fallback.dataset.state = state;
194
+ if (state === 'loading')
195
+ // Keep every loading tile on one sweep phase, including recycled rows.
196
+ v.fallback.style.setProperty('--nl-media-sweep-delay', `-${Math.round(performance.now() % SWEEP_PERIOD_MS)}ms`);
197
+ }
125
198
  const isGalleryMedia = row => row.variant === 'gallery' && (!row.image || !!row.media && !row.imageState);
126
199
  function clearGalleryMedia(v) {
127
200
  v.epoch += 1;
@@ -148,29 +221,7 @@ function initGallery(body, primitives) {
148
221
  };
149
222
  const frame = element('ok-native-list-media-image');
150
223
  const fallback = element('ok-native-list-media-fallback');
151
- const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
152
- svg.setAttribute('viewBox', '0 0 24 24');
153
- svg.setAttribute('width', '24');
154
- svg.setAttribute('height', '24');
155
- svg.setAttribute('aria-hidden', 'true');
156
- svg.setAttribute('fill', 'currentColor');
157
- for (const d of ['M14.25 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4', 'M21 21H3V3h18zM5 16.414V19h12.586L14 15.414l-2 2-4-4zm0-2.828 3-3 4 4 2-2 5 5V5H5z']) {
158
- const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
159
- path.setAttribute('d', d);
160
- path.setAttribute('fill-rule', 'evenodd');
161
- svg.append(path);
162
- }
163
- fallback.append(svg);
164
- Object.assign(fallback.style, {
165
- position: 'absolute',
166
- inset: '0',
167
- display: 'flex',
168
- alignItems: 'center',
169
- justifyContent: 'center',
170
- color: 'var(--nl-disabled)',
171
- borderRadius: '10px',
172
- background: 'var(--nl-strong)'
173
- });
224
+ fallback.append(element('ok-native-list-media-hatch'), element('ok-native-list-media-sheen'), createMediaGlyph(document, 'loading'), createMediaGlyph(document, 'failed'));
174
225
  const metadata = element('ok-native-list-media-meta');
175
226
  const subtitleLine = element('ok-native-list-media-subtitle-row');
176
227
  const subtitle = element('ok-native-list-media-subtitle');
@@ -250,10 +301,14 @@ function bindGallery(body, row, primitives) {
250
301
  v.fallback.style.visibility = 'visible';
251
302
  const epoch = v.epoch;
252
303
  const source = row.imageState ? undefined : row.media?.source;
304
+ setPlaceholderState(v, source?.uri && row.media?.probeOrder.length ? 'loading' : 'failed');
253
305
  const probe = attempt => {
254
306
  if (v.epoch !== epoch) return;
255
307
  const kind = row.media?.probeOrder[attempt];
256
- if (!source?.uri || !kind) return;
308
+ if (!source?.uri || !kind) {
309
+ setPlaceholderState(v, 'failed');
310
+ return;
311
+ }
257
312
  const media = body.ownerDocument.createElement(kind === 'video' ? 'video' : 'img');
258
313
  v.frame.style.borderRadius = kind === 'video' ? '0' : '10px';
259
314
  Object.assign(media.style, {
@@ -294,7 +349,11 @@ function bindGallery(body, row, primitives) {
294
349
  probe(attempt + 1);
295
350
  };
296
351
  const ready = () => {
297
- if (v.epoch === epoch && v.media === media) v.fallback.style.visibility = 'hidden';
352
+ if (v.epoch === epoch && v.media === media) {
353
+ v.fallback.style.visibility = 'hidden';
354
+ // Stops the sweep animation behind the picture.
355
+ setPlaceholderState(v, 'loaded');
356
+ }
298
357
  };
299
358
  if (media.tagName === 'VIDEO') media.onloadeddata = ready;else media.onload = ready;
300
359
  v.media = media;
@@ -46,6 +46,7 @@ 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');
49
50
  body.style.padding = `${resolved.verticalPadding}px ${resolved.horizontalPadding}px`;
50
51
  body.style.height = resolved.automaticHeight ? 'auto' : '100%';
51
52
  views.column.style.cssText = '';
@@ -53,7 +54,22 @@ export function bindMessageRow(body, row, primitives) {
53
54
  for (const [view, text] of [[views.title, resolved.title], [views.body, resolved.body], [views.time, resolved.time]]) {
54
55
  view.style.cssText = '';
55
56
  view.textContent = text.value;
56
- primitives.textStyle(view, text.style);
57
+ const {
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
+ }
57
73
  }
58
74
  views.unread.style.cssText = '';
59
75
  if (row.body) {
@@ -143,7 +159,7 @@ export function measureMessageRow(row, availableWidth) {
143
159
  if (!text.value) return 0;
144
160
  const value = text.style.lines === 1 ? text.value.replace(/\r\n|[\r\n]/g, ' ') : text.value;
145
161
  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);
146
- return Math.min(text.style.lines, lines) * text.style.lineHeight;
162
+ return (text.style.lines === 0 ? lines : Math.min(text.style.lines, lines)) * text.style.lineHeight;
147
163
  };
148
164
  const timeWidth = Math.min(availableWidth / 3, Math.max(0, r.time.value.length * r.time.style.fontSize / 2));
149
165
  const textWidth = availableWidth - r.horizontalPadding * 2 - (row.leading ? r.imageWidth + r.leadingGap : 0) - (row.thumbnail ? 76 : 0) - (row.unread ? 19 : 0) - timeWidth - 12;
@@ -66,6 +66,7 @@ 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');
69
70
  if (container.borderWidth !== undefined) {
70
71
  // Paint above member backgrounds without changing the content box or hit targets.
71
72
  body.setAttribute('data-nl-container-border', 'true');
@@ -10,6 +10,7 @@ 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";
13
14
  import { mediaTileRowRenderer } from "./MediaTileRowRenderer.js";
14
15
  import { messageRowRenderer } from "./MessageRowRenderer.js";
15
16
  import { railRowRenderer } from "./RailRowRenderer.js";
@@ -34,6 +35,7 @@ const factories = {
34
35
  activity: row => registration(activityRowRenderer, row),
35
36
  system: row => registration(systemRowRenderer, row),
36
37
  action: row => registration(actionRowRenderer, row),
38
+ buttonGroup: row => registration(buttonGroupRowRenderer, row),
37
39
  message: row => registration(messageRowRenderer, row),
38
40
  rail: row => registration(railRowRenderer, row),
39
41
  mediaTile: row => registration(mediaTileRowRenderer, row)
@@ -49,6 +51,7 @@ const renderers = {
49
51
  activity: activityRowRenderer,
50
52
  system: systemRowRenderer,
51
53
  action: actionRowRenderer,
54
+ buttonGroup: buttonGroupRowRenderer,
52
55
  message: messageRowRenderer,
53
56
  rail: railRowRenderer,
54
57
  mediaTile: mediaTileRowRenderer
@@ -4,6 +4,20 @@ 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
+ }
7
21
  function createSectionHeader(document, primitives, row) {
8
22
  const body = createElement(document, 'div', 'ok-native-list-row ok-native-list-section');
9
23
  setData(body, 'variant', row.variant);
@@ -17,6 +31,11 @@ function createSectionHeader(document, primitives, row) {
17
31
  const column = createTextColumn(document, row.title, row.subtitle);
18
32
  const title = column.firstElementChild;
19
33
  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
+ }
20
39
  if (row.titleActionKey) {
21
40
  setData(title, 'nativeListAction', row.titleActionKey);
22
41
  markActionAnchorSource(title, 'leadingAction');
@@ -31,6 +50,11 @@ function createSectionHeader(document, primitives, row) {
31
50
  }
32
51
  if (row.titleActionOnHover) setData(title, 'nativeListHoverAction', true);
33
52
  }
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
+ }
34
58
  if (row.presentation === 'networkSelector' && hasExplicitRowHeight(row)) {
35
59
  body.style.padding = row.variant === 'summary' ? '24px 12px 20px' : '0 12px';
36
60
  body.style.backgroundColor = 'var(--nl-bg)';
@@ -108,7 +132,7 @@ function createSectionHeader(document, primitives, row) {
108
132
  body.appendChild(pendingLine);
109
133
  } else body.appendChild(column);
110
134
  if (row.value) {
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');
135
+ const value = tagSlot(createElement(document, row.valueActionKey || row.valueHelp?.presentation === 'popover' ? 'button' : 'span', row.valueActionKey || row.valueHelp?.presentation === 'popover' ? 'ok-native-list-action-button ok-native-list-section-value' : 'ok-native-list-value ok-native-list-section-value', row.value), 'value');
112
136
  applyValueSegments(value, row.valueSegments);
113
137
  if (row.presentation === 'networkSelector' && hasExplicitRowHeight(row)) {
114
138
  value.style.fontFamily = 'inherit';
@@ -127,7 +151,17 @@ function createSectionHeader(document, primitives, row) {
127
151
  setData(value, 'nativeListAction', row.valueActionKey);
128
152
  markActionAnchorSource(value, 'trailingAccessory', 0);
129
153
  }
130
- body.appendChild(value);
154
+ if (row.valueHelp) bindHelp(value, row.valueHelp);
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);
131
165
  }
132
166
  if (row.valueIcon) {
133
167
  const valueIcon = primitives.iconAction(row.valueIcon.name, row.valueIcon.actionKey, row.valueIcon.disabled, row.valueIcon.tintColor);
@@ -88,6 +88,15 @@ 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
+ }
91
100
  NativeListScrollEdgeEffect JHybridNativeListSpec::getTopScrollEdgeEffect() {
92
101
  static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JNativeListScrollEdgeEffect>()>("getTopScrollEdgeEffect");
93
102
  auto __result = method(_javaPart);
@@ -252,6 +261,23 @@ namespace margelo::nitro::nativelist {
252
261
  static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onVisibleRangeChanged */)>("setOnVisibleRangeChanged_cxx");
253
262
  method(_javaPart, onVisibleRangeChanged.has_value() ? JFunc_void_std__string_cxx::fromCpp(onVisibleRangeChanged.value()) : nullptr);
254
263
  }
264
+ std::optional<std::function<void(const std::string& /* payloadJson */)>> JHybridNativeListSpec::getOnStructuralTransitionSettled() {
265
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnStructuralTransitionSettled_cxx");
266
+ auto __result = method(_javaPart);
267
+ return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* payloadJson */)> {
268
+ if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
269
+ auto downcast = jni::static_ref_cast<JFunc_void_std__string_cxx::javaobject>(__result);
270
+ return downcast->cthis()->getFunction();
271
+ } else {
272
+ auto __resultRef = jni::make_global(__result);
273
+ return JNICallable<JFunc_void_std__string, void(std::string)>(std::move(__resultRef));
274
+ }
275
+ }()) : std::nullopt;
276
+ }
277
+ void JHybridNativeListSpec::setOnStructuralTransitionSettled(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onStructuralTransitionSettled) {
278
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onStructuralTransitionSettled */)>("setOnStructuralTransitionSettled_cxx");
279
+ method(_javaPart, onStructuralTransitionSettled.has_value() ? JFunc_void_std__string_cxx::fromCpp(onStructuralTransitionSettled.value()) : nullptr);
280
+ }
255
281
 
256
282
  // Methods
257
283
  void JHybridNativeListSpec::applySnapshot(const std::string& snapshotJson) {
@@ -56,6 +56,8 @@ 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;
59
61
  NativeListScrollEdgeEffect getTopScrollEdgeEffect() override;
60
62
  void setTopScrollEdgeEffect(NativeListScrollEdgeEffect topScrollEdgeEffect) override;
61
63
  double getTopOverlayHeight() override;
@@ -80,6 +82,8 @@ namespace margelo::nitro::nativelist {
80
82
  void setOnEndReached(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onEndReached) override;
81
83
  std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnVisibleRangeChanged() override;
82
84
  void setOnVisibleRangeChanged(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onVisibleRangeChanged) override;
85
+ std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnStructuralTransitionSettled() override;
86
+ void setOnStructuralTransitionSettled(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onStructuralTransitionSettled) override;
83
87
 
84
88
  public:
85
89
  // Methods
@@ -68,6 +68,11 @@ 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
+ }
71
76
  if (oldProps == nullptr
72
77
  ? newProps->topScrollEdgeEffect.isProvided()
73
78
  : !newProps->topScrollEdgeEffect.hasSameValue(oldProps->topScrollEdgeEffect)) {
@@ -128,6 +133,11 @@ void JHybridNativeListStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
128
133
  : !newProps->onVisibleRangeChanged.hasSameValue(oldProps->onVisibleRangeChanged)) {
129
134
  hybridView->setOnVisibleRangeChanged(newProps->onVisibleRangeChanged.get());
130
135
  }
136
+ if (oldProps == nullptr
137
+ ? newProps->onStructuralTransitionSettled.isProvided()
138
+ : !newProps->onStructuralTransitionSettled.hasSameValue(oldProps->onStructuralTransitionSettled)) {
139
+ hybridView->setOnStructuralTransitionSettled(newProps->onStructuralTransitionSettled.get());
140
+ }
131
141
 
132
142
  // Update hybridRef if it changed
133
143
  if (oldProps == nullptr
@@ -45,6 +45,12 @@ 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
+
48
54
  @get:DoNotStrip
49
55
  @get:Keep
50
56
  @set:DoNotStrip
@@ -172,6 +178,20 @@ abstract class HybridNativeListSpec: HybridView() {
172
178
  set(value) {
173
179
  onVisibleRangeChanged = value?.let { it }
174
180
  }
181
+
182
+ abstract var onStructuralTransitionSettled: ((payloadJson: String) -> Unit)?
183
+
184
+ private var onStructuralTransitionSettled_cxx: Func_void_std__string?
185
+ @Keep
186
+ @DoNotStrip
187
+ get() {
188
+ return onStructuralTransitionSettled?.let { Func_void_std__string_java(it) }
189
+ }
190
+ @Keep
191
+ @DoNotStrip
192
+ set(value) {
193
+ onStructuralTransitionSettled = value?.let { it }
194
+ }
175
195
 
176
196
  // Methods
177
197
  @DoNotStrip
@@ -96,6 +96,13 @@ 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
+ }
99
106
  inline NativeListScrollEdgeEffect getTopScrollEdgeEffect() noexcept override {
100
107
  auto __result = _swiftPart.getTopScrollEdgeEffect();
101
108
  return static_cast<NativeListScrollEdgeEffect>(__result);
@@ -179,6 +186,13 @@ namespace margelo::nitro::nativelist {
179
186
  inline void setOnVisibleRangeChanged(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onVisibleRangeChanged) noexcept override {
180
187
  _swiftPart.setOnVisibleRangeChanged(onVisibleRangeChanged);
181
188
  }
189
+ inline std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnStructuralTransitionSettled() noexcept override {
190
+ auto __result = _swiftPart.getOnStructuralTransitionSettled();
191
+ return __result;
192
+ }
193
+ inline void setOnStructuralTransitionSettled(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onStructuralTransitionSettled) noexcept override {
194
+ _swiftPart.setOnStructuralTransitionSettled(onStructuralTransitionSettled);
195
+ }
182
196
 
183
197
  public:
184
198
  // Methods
@@ -130,6 +130,12 @@ 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
+ }
133
139
  // topScrollEdgeEffect: enum
134
140
  if (oldViewProps == nullptr
135
141
  ? newViewProps.topScrollEdgeEffect.isProvided()
@@ -202,6 +208,12 @@ using namespace margelo::nitro::nativelist::views;
202
208
  : !newViewProps.onVisibleRangeChanged.hasSameValue(oldViewProps->onVisibleRangeChanged)) {
203
209
  swiftPart.setOnVisibleRangeChanged(newViewProps.onVisibleRangeChanged.get());
204
210
  }
211
+ // onStructuralTransitionSettled: optional
212
+ if (oldViewProps == nullptr
213
+ ? newViewProps.onStructuralTransitionSettled.isProvided()
214
+ : !newViewProps.onStructuralTransitionSettled.hasSameValue(oldViewProps->onStructuralTransitionSettled)) {
215
+ swiftPart.setOnStructuralTransitionSettled(newViewProps.onStructuralTransitionSettled.get());
216
+ }
205
217
 
206
218
  // Update hybridRef if it changed
207
219
  if (oldViewProps == nullptr
@@ -13,6 +13,7 @@ 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 }
16
17
  var topScrollEdgeEffect: NativeListScrollEdgeEffect { get set }
17
18
  var topOverlayHeight: Double { get set }
18
19
  var scrollPositionThresholdsJson: String { get set }
@@ -25,6 +26,7 @@ public protocol HybridNativeListSpec_protocol: HybridObject, HybridView {
25
26
  var onReorder: ((_ payloadJson: String) -> Void)? { get set }
26
27
  var onEndReached: ((_ payloadJson: String) -> Void)? { get set }
27
28
  var onVisibleRangeChanged: ((_ payloadJson: String) -> Void)? { get set }
29
+ var onStructuralTransitionSettled: ((_ payloadJson: String) -> Void)? { get set }
28
30
 
29
31
  // Methods
30
32
  func applySnapshot(snapshotJson: String) throws -> Void
@@ -154,6 +154,17 @@ 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
+
157
168
  public final var topScrollEdgeEffect: Int32 {
158
169
  @inline(__always)
159
170
  get {
@@ -432,6 +443,38 @@ open class HybridNativeListSpec_cxx {
432
443
  }()
433
444
  }
434
445
  }
446
+
447
+ public final var onStructuralTransitionSettled: bridge.std__optional_std__function_void_const_std__string_____payloadJson______ {
448
+ @inline(__always)
449
+ get {
450
+ return { () -> bridge.std__optional_std__function_void_const_std__string_____payloadJson______ in
451
+ if let __unwrappedValue = self.__implementation.onStructuralTransitionSettled {
452
+ return bridge.create_std__optional_std__function_void_const_std__string_____payloadJson______({ () -> bridge.Func_void_std__string in
453
+ let __closureWrapper = Func_void_std__string(__unwrappedValue)
454
+ return bridge.create_Func_void_std__string(__closureWrapper.toUnsafe())
455
+ }())
456
+ } else {
457
+ return .init()
458
+ }
459
+ }()
460
+ }
461
+ @inline(__always)
462
+ set {
463
+ self.__implementation.onStructuralTransitionSettled = { () -> ((_ payloadJson: String) -> Void)? in
464
+ if bridge.has_value_std__optional_std__function_void_const_std__string_____payloadJson______(newValue) {
465
+ let __unwrapped = bridge.get_std__optional_std__function_void_const_std__string_____payloadJson______(newValue)
466
+ return { () -> (String) -> Void in
467
+ let __wrappedFunction = bridge.wrap_Func_void_std__string(__unwrapped)
468
+ return { (__payloadJson: String) -> Void in
469
+ __wrappedFunction.call(std.string(__payloadJson))
470
+ }
471
+ }()
472
+ } else {
473
+ return nil
474
+ }
475
+ }()
476
+ }
477
+ }
435
478
 
436
479
  // Methods
437
480
  @inline(__always)
@@ -20,6 +20,8 @@ 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);
23
25
  prototype.registerHybridGetter("topScrollEdgeEffect", &HybridNativeListSpec::getTopScrollEdgeEffect);
24
26
  prototype.registerHybridSetter("topScrollEdgeEffect", &HybridNativeListSpec::setTopScrollEdgeEffect);
25
27
  prototype.registerHybridGetter("topOverlayHeight", &HybridNativeListSpec::getTopOverlayHeight);
@@ -44,6 +46,8 @@ namespace margelo::nitro::nativelist {
44
46
  prototype.registerHybridSetter("onEndReached", &HybridNativeListSpec::setOnEndReached);
45
47
  prototype.registerHybridGetter("onVisibleRangeChanged", &HybridNativeListSpec::getOnVisibleRangeChanged);
46
48
  prototype.registerHybridSetter("onVisibleRangeChanged", &HybridNativeListSpec::setOnVisibleRangeChanged);
49
+ prototype.registerHybridGetter("onStructuralTransitionSettled", &HybridNativeListSpec::getOnStructuralTransitionSettled);
50
+ prototype.registerHybridSetter("onStructuralTransitionSettled", &HybridNativeListSpec::setOnStructuralTransitionSettled);
47
51
  prototype.registerHybridMethod("applySnapshot", &HybridNativeListSpec::applySnapshot);
48
52
  prototype.registerHybridMethod("applyPatches", &HybridNativeListSpec::applyPatches);
49
53
  prototype.registerHybridMethod("reconcileSelection", &HybridNativeListSpec::reconcileSelection);
@@ -63,6 +63,8 @@ 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;
66
68
  virtual NativeListScrollEdgeEffect getTopScrollEdgeEffect() = 0;
67
69
  virtual void setTopScrollEdgeEffect(NativeListScrollEdgeEffect topScrollEdgeEffect) = 0;
68
70
  virtual double getTopOverlayHeight() = 0;
@@ -87,6 +89,8 @@ namespace margelo::nitro::nativelist {
87
89
  virtual void setOnEndReached(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onEndReached) = 0;
88
90
  virtual std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnVisibleRangeChanged() = 0;
89
91
  virtual void setOnVisibleRangeChanged(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onVisibleRangeChanged) = 0;
92
+ virtual std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnStructuralTransitionSettled() = 0;
93
+ virtual void setOnStructuralTransitionSettled(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onStructuralTransitionSettled) = 0;
90
94
 
91
95
  public:
92
96
  // Methods
@@ -23,6 +23,7 @@ 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)),
26
27
  topScrollEdgeEffect(nitro::ReactProp<NativeListScrollEdgeEffect>::fromRawValue("NativeList", "topScrollEdgeEffect", rawProps, sourceProps.topScrollEdgeEffect)),
27
28
  topOverlayHeight(nitro::ReactProp<double>::fromRawValue("NativeList", "topOverlayHeight", rawProps, sourceProps.topOverlayHeight)),
28
29
  scrollPositionThresholdsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "scrollPositionThresholdsJson", rawProps, sourceProps.scrollPositionThresholdsJson)),
@@ -35,6 +36,7 @@ namespace margelo::nitro::nativelist::views {
35
36
  onReorder(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onReorder", rawProps, sourceProps.onReorder)),
36
37
  onEndReached(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onEndReached", rawProps, sourceProps.onEndReached)),
37
38
  onVisibleRangeChanged(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onVisibleRangeChanged", rawProps, sourceProps.onVisibleRangeChanged)),
39
+ onStructuralTransitionSettled(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onStructuralTransitionSettled", rawProps, sourceProps.onStructuralTransitionSettled)),
38
40
  hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNativeListSpec>& /* ref */)>>>::fromRawValue("NativeList", "hybridRef", rawProps, sourceProps.hybridRef)) { }
39
41
 
40
42
  bool HybridNativeListProps::filterObjectKeys(const std::string& propName) {
@@ -42,6 +44,7 @@ namespace margelo::nitro::nativelist::views {
42
44
  case hashString("snapshotJson"): return true;
43
45
  case hashString("fontFamiliesJson"): return true;
44
46
  case hashString("containerSlotHeightsJson"): return true;
47
+ case hashString("sidecarLayoutJson"): return true;
45
48
  case hashString("topScrollEdgeEffect"): return true;
46
49
  case hashString("topOverlayHeight"): return true;
47
50
  case hashString("scrollPositionThresholdsJson"): return true;
@@ -54,6 +57,7 @@ namespace margelo::nitro::nativelist::views {
54
57
  case hashString("onReorder"): return true;
55
58
  case hashString("onEndReached"): return true;
56
59
  case hashString("onVisibleRangeChanged"): return true;
60
+ case hashString("onStructuralTransitionSettled"): return true;
57
61
  case hashString("hybridRef"): return true;
58
62
  default: return false;
59
63
  }