@onekeyfe/react-native-native-list 6.7.0-21 → 6.7.0-22

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 (126) hide show
  1. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +5 -0
  2. package/android/src/main/java/com/onekey/nativelist/NativeListGeneratedIcons.kt +47 -0
  3. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +5 -0
  4. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -338
  5. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +5 -0
  6. package/docs/SPEC.md +162 -8
  7. package/ios/NativeListAccessoryStack.swift +6 -16
  8. package/ios/NativeListDataRowRenderer.swift +15 -6
  9. package/ios/NativeListDesignAssets.swift +13 -84
  10. package/ios/NativeListGeneratedIcons.swift +55 -0
  11. package/ios/NativeListIconBinding.swift +171 -0
  12. package/ios/NativeListIdentityRenderer.swift +19 -10
  13. package/ios/NativeListLeadingVisual.swift +11 -9
  14. package/ios/NativeListMarketRenderer.swift +7 -13
  15. package/ios/NativeListMediaTileRenderer.swift +6 -2
  16. package/ios/NativeListMetricCardRenderer.swift +4 -2
  17. package/ios/NativeListSectionHeaderRenderer.swift +12 -4
  18. package/ios/tests/NativeListAccessoryStackTests.swift +12 -0
  19. package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
  20. package/ios/tests/NativeListSharedIconTests.swift +236 -0
  21. package/lib/module/web/NativeListGeneratedIcons.js +31 -0
  22. package/lib/module/web/NativeListWebEngine.js +21 -323
  23. package/lib/module/web/templates/ActivityRowRenderer.js +4 -24
  24. package/lib/module/web/templates/IdentityRowRenderer.js +8 -0
  25. package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
  26. package/lib/module/web/templates/MediaTileRowRenderer.js +2 -12
  27. package/lib/typescript/src/NativeList.types.d.ts +2 -2
  28. package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
  29. package/lib/typescript/src/web/NativeListWebEngine.d.ts +0 -1
  30. package/package.json +16 -10
  31. package/react-native-native-list.podspec +0 -5
  32. package/scripts/generate-icons.mjs +150 -0
  33. package/scripts/generate-icons.test.mjs +288 -0
  34. package/scripts/native-list-icons.json +260 -0
  35. package/src/NativeList.types.ts +2 -2
  36. package/src/web/NativeListGeneratedIcons.ts +28 -0
  37. package/src/web/NativeListWebEngine.ts +25 -405
  38. package/src/web/templates/ActivityRowRenderer.ts +15 -53
  39. package/src/web/templates/IdentityRowRenderer.ts +8 -0
  40. package/src/web/templates/MarketTableRowRenderer.ts +53 -33
  41. package/src/web/templates/MediaTileRowRenderer.ts +2 -15
  42. package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
  43. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
  44. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
  45. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
  46. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
  47. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
  48. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
  49. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
  50. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
  51. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
  52. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
  53. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
  54. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
  55. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
  56. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
  57. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
  58. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
  59. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
  60. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
  61. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
  62. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
  63. package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/Contents.json +0 -15
  64. package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/icon.svg +0 -4
  65. package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/Contents.json +0 -1
  66. package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/icon.svg +0 -1
  67. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
  68. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
  69. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/Contents.json +0 -1
  70. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/icon.svg +0 -1
  71. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
  72. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
  73. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
  74. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
  75. package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/Contents.json +0 -15
  76. package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/icon.svg +0 -3
  77. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
  78. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
  79. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
  80. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
  81. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
  82. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
  83. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
  84. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
  85. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
  86. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
  87. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
  88. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
  89. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/Contents.json +0 -1
  90. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/icon.svg +0 -1
  91. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
  92. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
  93. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
  94. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
  95. package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/Contents.json +0 -15
  96. package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/icon.svg +0 -3
  97. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
  98. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
  99. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
  100. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
  101. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
  102. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
  103. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
  104. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
  105. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
  106. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
  107. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
  108. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
  109. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
  110. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
  111. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
  112. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
  113. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
  114. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
  115. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
  116. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
  117. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
  118. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
  119. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
  120. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
  121. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
  122. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
  123. package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/Contents.json +0 -1
  124. package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/icon.svg +0 -1
  125. package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/Contents.json +0 -1
  126. package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/icon.svg +0 -1
@@ -0,0 +1,236 @@
1
+ import UIKit
2
+ import XCTest
3
+ import OneKeyImage
4
+ @testable import NativeListModule
5
+
6
+ @MainActor
7
+ final class NativeListSharedIconTests: XCTestCase {
8
+ private func field<T>(_ object: Any, _ name: String, as type: T.Type = T.self) throws -> T {
9
+ var mirror: Mirror? = Mirror(reflecting: object)
10
+ while let current = mirror {
11
+ if let child = current.children.first(where: { $0.label == name }) { return try XCTUnwrap(child.value as? T) }
12
+ mirror = current.superclassMirror
13
+ }
14
+ throw NSError(domain: "Missing field " + name, code: 1)
15
+ }
16
+ private func binding(_ button: UIButton) throws -> Any {
17
+ let mirror = try XCTUnwrap(Mirror(reflecting: button).superclassMirror)
18
+ let storage = try XCTUnwrap(mirror.children.first { $0.label?.contains("iconBinding") == true }?.value)
19
+ return try XCTUnwrap(Mirror(reflecting: storage).children.first?.value)
20
+ }
21
+ private func eventually(_ message: String, _ condition: () -> Bool) {
22
+ let end = Date().addingTimeInterval(5)
23
+ while !condition(), Date() < end { RunLoop.main.run(until: Date().addingTimeInterval(0.01)) }
24
+ XCTAssertTrue(condition(), message)
25
+ }
26
+ private func window() throws -> UIWindow {
27
+ guard UIApplication.perform(NSSelectorFromString("sharedApplication"))?.takeUnretainedValue() is UIApplication else {
28
+ throw XCTSkip("A UIApplication host is required for attached glyph acceptance")
29
+ }
30
+ let window = UIWindow(frame: UIScreen.main.bounds)
31
+ window.rootViewController = UIViewController()
32
+ window.makeKeyAndVisible()
33
+ return window
34
+ }
35
+ private func save(_ image: UIImage, _ name: String) throws {
36
+ guard let directory = ProcessInfo.processInfo.environment["ICON_EVIDENCE_DIR"] else { return }
37
+ try XCTUnwrap(image.pngData()).write(to: URL(fileURLWithPath: directory).appendingPathComponent(name + ".png"))
38
+ }
39
+ private func bind(_ stack: NativeListAccessoryStack, amount: String = "1", name: String = "DotVerSolid", kind: String = "icon", disabled: Bool = false) throws {
40
+ let descriptors: [[String: Any]] = [
41
+ ["kind": "valuePair", "primary": amount, "secondary": "$1"],
42
+ ["kind": kind, "name": name, "text": "Text", "buttonStyle": "tertiary", "actionKey": "menu", "disabled": disabled],
43
+ ]
44
+ let item = try NativeListItem(data: ["key": "swap", "type": "identity", "title": "USDC", "height": 60, "trailing": descriptors])
45
+ stack.axis = .horizontal
46
+ stack.bind(item, descriptors: descriptors, theme: nil,
47
+ style: ["horizontalPadding": 20, "verticalPadding": 8, "leadingGap": 12, "trailingGap": 8],
48
+ checkboxState: { _, _, fallback in fallback }, fonts: NativeListFontFamilies())
49
+ stack.setNeedsLayout(); stack.layoutIfNeeded()
50
+ }
51
+ func testDetachedMeasurementAndRealSwapRebindPreservePendingAndReadyImage() throws {
52
+ let service = OneKeyNamedSVG.shared
53
+ let metadataLock: NSLock = try field(service, "metadataLock")
54
+ let stateLock: NSLock = try field(service, "lock")
55
+ func state(_ owner: NSObject? = nil) throws -> (Int, Int) {
56
+ stateLock.lock(); defer { stateLock.unlock() }
57
+ let pending: Any = try field(service, "pending")
58
+ let keys = Mirror(reflecting: pending).children.compactMap { Mirror(reflecting: $0.value).children.first?.value as? ObjectIdentifier }
59
+ return (try field(service, "workers"), owner.map { owner in keys.filter { $0 == ObjectIdentifier(owner) }.count } ?? keys.count)
60
+ }
61
+ metadataLock.lock()
62
+ var locked = true
63
+ defer { if locked { metadataLock.unlock() } }
64
+ let baseline = try state()
65
+ let stack = NativeListAccessoryStack(frame: CGRect(x: 10, y: 80, width: 180, height: 44))
66
+ try bind(stack)
67
+ let button = try XCTUnwrap(stack.subviews.compactMap { $0 as? NativeListAccessoryButton }.first { !$0.isHidden && $0.image(for: .normal) != nil })
68
+ let slot = try binding(button)
69
+ let owner: NSObject = try field(slot, "owner")
70
+ XCTAssertEqual(try state(owner).0, baseline.0)
71
+ XCTAssertEqual(try state(owner).1, 0)
72
+ let beforeSize = try XCTUnwrap(button.image(for: .normal)).size
73
+ let detachedSize = stack.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
74
+ XCTAssertEqual(try state(owner).0, baseline.0)
75
+ XCTAssertEqual(try state(owner).1, 0)
76
+ let window = try window(); defer { window.isHidden = true }
77
+ do {
78
+ defer { metadataLock.unlock(); locked = false }
79
+ window.rootViewController!.view.addSubview(stack)
80
+ stack.layoutIfNeeded()
81
+ XCTAssertGreaterThan(try state(owner).0 + state(owner).1, baseline.0)
82
+ let bounds = button.bounds.size
83
+ let revision: UInt64 = try field(slot, "revision")
84
+ for index in 0..<100 { try bind(stack, amount: String(index)) }
85
+ XCTAssertEqual(try field(slot, "revision", as: UInt64.self), revision)
86
+ XCTAssertEqual(button.image(for: .normal)?.size, beforeSize)
87
+ XCTAssertEqual(button.bounds.size, bounds)
88
+ XCTAssertEqual(stack.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height, detachedSize.height)
89
+ }
90
+ eventually("Attached Swap glyph has an actual raster") { button.image(for: .normal)?.cgImage != nil && button.image(for: .normal)?.size == beforeSize && (try? self.field(slot, "currentImage", as: UIImage?.self)) != nil }
91
+ // A transparent measurement placeholder also has a CGImage: require painted pixels.
92
+ eventually("Decoded glyph is visible") { self.alphaCount(button.image(for: .normal)) > 0 }
93
+ let ready = try XCTUnwrap(button.image(for: .normal))
94
+ XCTAssertEqual(maximumAlpha(ready), 255)
95
+ try bind(stack, amount: "101")
96
+ XCTAssertTrue(button.image(for: .normal) === ready)
97
+ button.tintColor = .blue
98
+ XCTAssertTrue(button.image(for: .normal) === ready)
99
+ XCTAssertNotNil(button.image(for: .disabled))
100
+ try bind(stack, amount: "101")
101
+ func captureButton() -> UIImage {
102
+ let rect = button.convert(button.bounds, to: stack)
103
+ return UIGraphicsImageRenderer(size: button.bounds.size).image { context in
104
+ context.cgContext.translateBy(x: -rect.minX, y: -rect.minY)
105
+ stack.drawHierarchy(in: stack.bounds, afterScreenUpdates: true)
106
+ }
107
+ }
108
+ try save(captureButton(), "ios-swap-menu-normal")
109
+ var actions = 0
110
+ stack.onAction = { _, _, _, _ in actions += 1 }
111
+ try bind(stack, amount: "101", disabled: true)
112
+ XCTAssertFalse(button.isEnabled); XCTAssertEqual(button.alpha, 0.4, accuracy: 0.000001)
113
+ XCTAssertTrue(button.image(for: .normal) === ready)
114
+ button.sendActions(for: .touchUpInside); XCTAssertEqual(actions, 0)
115
+ button.layoutIfNeeded()
116
+ try save(captureButton(), "ios-swap-menu-disabled")
117
+ try bind(stack, amount: "101")
118
+ try bind(stack, name: "UnknownIcon")
119
+ XCTAssertNil(button.image(for: .normal))
120
+ try bind(stack, kind: "value")
121
+ XCTAssertNil(button.image(for: .normal))
122
+ stack.removeFromSuperview()
123
+ RunLoop.main.run(until: Date().addingTimeInterval(0.05))
124
+ XCTAssertNil(button.image(for: .normal))
125
+ }
126
+ private func alphaCount(_ image: UIImage?) -> Int {
127
+ guard let cg = image?.cgImage else { return 0 }
128
+ var bytes = [UInt8](repeating: 0, count: cg.width * cg.height * 4)
129
+ guard let context = CGContext(data: &bytes, width: cg.width, height: cg.height, bitsPerComponent: 8,
130
+ bytesPerRow: cg.width * 4, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) else { return 0 }
131
+ context.draw(cg, in: CGRect(x: 0, y: 0, width: cg.width, height: cg.height))
132
+ return stride(from: 3, to: bytes.count, by: 4).filter { bytes[$0] > 0 }.count
133
+ }
134
+ func testMainLineGlyphsPaintInTheSharedNativeSlot() throws {
135
+ let window = try window(); defer { window.isHidden = true }
136
+ let view = NativeListIconImageView(frame: CGRect(x: 10, y: 80, width: 64, height: 64))
137
+ window.rootViewController!.view.addSubview(view)
138
+ for name in ["Document2Outline", "WalletOutline", "PlusLargeOutline", "TicketOutline"] {
139
+ let metadata = try XCTUnwrap(nativeListIconMetadata(named: name))
140
+ XCTAssertEqual(metadata.name, name)
141
+ XCTAssertEqual(metadata.size, CGSize(width: 24, height: 24))
142
+ view.bindIcon(name)
143
+ eventually("Shared main-line glyph paints: " + name) { self.alphaCount(view.image) > 0 }
144
+ let image = try XCTUnwrap(view.image)
145
+ XCTAssertEqual(image.renderingMode, .alwaysTemplate)
146
+ try save(image.withTintColor(.red, renderingMode: .alwaysOriginal), "ios-main-integration-" + name)
147
+ }
148
+ }
149
+ private func maximumAlpha(_ image: UIImage) -> UInt8 {
150
+ guard let cg = image.cgImage else { return 0 }
151
+ var bytes = [UInt8](repeating: 0, count: cg.width * cg.height * 4)
152
+ guard let context = CGContext(data: &bytes, width: cg.width, height: cg.height, bitsPerComponent: 8,
153
+ bytesPerRow: cg.width * 4, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) else { return 0 }
154
+ context.draw(cg, in: CGRect(x: 0, y: 0, width: cg.width, height: cg.height))
155
+ return stride(from: 3, to: bytes.count, by: 4).map { bytes[$0] }.max() ?? 0
156
+ }
157
+ func testLifecycleLegacyModesAndSizeOverride() throws {
158
+ let window = try window(); defer { window.isHidden = true }
159
+ let view = NativeListIconImageView(frame: CGRect(x: 10, y: 80, width: 64, height: 64))
160
+ window.rootViewController!.view.addSubview(view)
161
+ for name in ["AppleBrand", "BotIllus", "GoogleIllus", "AccountErrorCustom", "StarOutline", "StarSolid", "BadgeVerifiedSolid", "CheckboxCheckedCustom", "CheckboxIndeterminateCustom"] {
162
+ view.bindIcon(name)
163
+ eventually(name) { self.alphaCount(view.image) > 0 }
164
+ let metadata = try XCTUnwrap(nativeListIconMetadata(named: name))
165
+ XCTAssertEqual(view.image?.size, metadata.size)
166
+ if !metadata.original { XCTAssertEqual(maximumAlpha(try XCTUnwrap(view.image)), 255) }
167
+ XCTAssertEqual(view.image?.renderingMode, metadata.original ? .alwaysOriginal : .alwaysTemplate)
168
+ let image = try XCTUnwrap(view.image)
169
+ try save(metadata.original ? image : image.withTintColor(.red, renderingMode: .alwaysOriginal), "ios-new-" + name)
170
+ }
171
+ view.bindIcon("AppleBrand", size: CGSize(width: 28, height: 20))
172
+ eventually("Non-square source stretches to legacy explicit size") { self.alphaCount(view.image) > 0 }
173
+ XCTAssertEqual(view.image?.size, CGSize(width: 28, height: 20))
174
+ XCTAssertEqual(view.image?.renderingMode, .alwaysTemplate)
175
+ try save(try XCTUnwrap(view.image).withTintColor(.red, renderingMode: .alwaysOriginal), "ios-new-AppleBrand-override")
176
+ view.bindIcon("DotVerSolid")
177
+ view.removeFromSuperview()
178
+ RunLoop.main.run(until: Date().addingTimeInterval(0.1))
179
+ XCTAssertEqual(alphaCount(view.image), 0)
180
+ window.rootViewController!.view.addSubview(view)
181
+ eventually("Same glyph redraws after detached completion") { self.alphaCount(view.image) > 0 }
182
+ view.bindIcon("UnknownIcon"); XCTAssertNil(view.image)
183
+ let ordinary = UIGraphicsImageRenderer(size: CGSize(width: 8, height: 8)).image { c in UIColor.green.setFill(); c.fill(CGRect(x: 0, y: 0, width: 8, height: 8)) }
184
+ view.image = ordinary
185
+ XCTAssertTrue(view.image === ordinary)
186
+ }
187
+ func testLegacyCompiledAssetRasterComparison() throws {
188
+ guard let directory = ProcessInfo.processInfo.environment["NATIVE_LIST_LEGACY_BUNDLE"], let bundle = Bundle(path: directory) else {
189
+ throw XCTSkip("An archived pre-migration resource bundle is required for raster comparison")
190
+ }
191
+ let window = try window(); defer { window.isHidden = true }
192
+ let view = NativeListIconImageView(frame: CGRect(x: 0, y: 80, width: 96, height: 96))
193
+ window.rootViewController!.view.addSubview(view)
194
+ let names = [
195
+ "AppleBrand": "onekey_selector_apple_brand", "BotIllus": "onekey_selector_bot_illus",
196
+ "GoogleIllus": "onekey_selector_google_illus", "AccountErrorCustom": "onekey_selector_account_error_custom",
197
+ "BadgeVerifiedSolid": "onekey_badge_verified_solid", "StarOutline": "onekey_star", "StarSolid": "onekey_star_solid",
198
+ "CheckboxCheckedCustom": "onekey_checkbox_checked", "CheckboxIndeterminateCustom": "onekey_checkbox_indeterminate",
199
+ ]
200
+ func raster(_ image: UIImage) -> UIImage {
201
+ let format = UIGraphicsImageRendererFormat(); format.scale = 1
202
+ return UIGraphicsImageRenderer(size: CGSize(width: 96, height: 96), format: format).image { _ in
203
+ image.draw(in: CGRect(x: 0, y: 0, width: 96, height: 96))
204
+ }
205
+ }
206
+ for name in names.keys.sorted() {
207
+ let metadata = try XCTUnwrap(nativeListIconMetadata(named: name))
208
+ let old = try XCTUnwrap(UIImage(named: names[name]!, in: bundle, compatibleWith: nil))
209
+ view.bindIcon(name)
210
+ eventually("Shared raster for legacy comparison " + name) { self.alphaCount(view.image) > 0 }
211
+ let next = try XCTUnwrap(view.image)
212
+ XCTAssertEqual(next.size, old.size)
213
+ let before = raster(metadata.original ? old : old.withTintColor(.red, renderingMode: .alwaysOriginal))
214
+ let after = raster(metadata.original ? next : next.withTintColor(.red, renderingMode: .alwaysOriginal))
215
+ XCTAssertGreaterThan(alphaCount(before), 0); XCTAssertGreaterThan(alphaCount(after), 0)
216
+ if name == "AccountErrorCustom" {
217
+ // The source eye center is inside its 0.447-opacity fill, away from raster edges.
218
+ for image in [before, after] {
219
+ let cg = try XCTUnwrap(image.cgImage)
220
+ var bytes = [UInt8](repeating: 0, count: 96 * 96 * 4)
221
+ let context = try XCTUnwrap(CGContext(data: &bytes, width: 96, height: 96, bitsPerComponent: 8,
222
+ bytesPerRow: 96 * 4, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue))
223
+ context.draw(cg, in: CGRect(x: 0, y: 0, width: 96, height: 96))
224
+ for (x,y) in [(6,48),(48,6),(48,91),(91,64),(67,61)] {
225
+ let index = (y * 96 + x) * 4
226
+ XCTAssertEqual(Array(bytes[index..<(index+3)]), [0,0,0])
227
+ XCTAssertEqual(bytes[index+3], 114)
228
+ }
229
+ for (x,y) in [(48,48),(15,48)] { XCTAssertEqual(bytes[(y * 96 + x) * 4 + 3], 0) }
230
+ }
231
+ } else { XCTAssertEqual(maximumAlpha(after), maximumAlpha(before)) }
232
+ try save(before, "ios-before-" + name); try save(after, "ios-after-" + name)
233
+ }
234
+ }
235
+
236
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ // Generated by scripts/generate-icons.mjs. Coverage and legacy names only; hosts provide SVG resources.
4
+ export const nativeListGeneratedIcons = {
5
+ AccountErrorCustom: 'AccountErrorCustom',
6
+ AllNetworksSolid: 'AllNetworksSolid',
7
+ AppleBrand: 'AppleBrand',
8
+ BadgeVerifiedSolid: 'BadgeRecognizedSolid',
9
+ BotIllus: 'BotIllus',
10
+ CheckboxCheckedCustom: 'CheckboxCheckedCustom',
11
+ CheckboxIndeterminateCustom: 'CheckboxIndeterminateCustom',
12
+ ChevronRightSmallOutline: 'ChevronRightSmallOutline',
13
+ Circle: 'Circle',
14
+ CrossedSmallSolid: 'CrossedSmallSolid',
15
+ CryptoCoinOutline: 'CryptoCoinOutline',
16
+ Document2Outline: 'Document2Outline',
17
+ DotHorOutline: 'DotHorOutline',
18
+ DotVerSolid: 'DotVerSolid',
19
+ DragOutline: 'DragOutline',
20
+ GasSolid: 'GasSolid',
21
+ GlobusOutline: 'GlobusOutline',
22
+ GoogleIllus: 'GoogleIllus',
23
+ LockSolid: 'LockSolid',
24
+ PencilOutline: 'PencilOutline',
25
+ PlusLargeOutline: 'PlusLargeOutline',
26
+ PlusSmallOutline: 'PlusSmallOutline',
27
+ RefreshCcwOutline: 'RefreshCcwOutline',
28
+ TicketOutline: 'TicketOutline',
29
+ WalletOutline: 'WalletOutline'
30
+ };
31
+ //# sourceMappingURL=NativeListGeneratedIcons.js.map
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ import { createNamedIcon } from '@onekeyfe/react-native-image/icon/dom';
4
+ import { nativeListGeneratedIcons as selectorIcons } from "./NativeListGeneratedIcons.js";
3
5
  import { applyTextWeight } from "./templates/RowText.js";
4
6
  import { applyRowContainerStyle, resetRowContainerStyle } from "./templates/RowContainerStyle.js";
5
7
  import { hasExplicitRowHeight, rowSizeModifier } from "./templates/RowElements.js";
@@ -37,7 +39,6 @@ export const WEB_REORDER_ANIMATION = {
37
39
  const REORDER_TOUCH_LONG_PRESS_MS = 120;
38
40
  const MARKET_LONG_PRESS_MS = 800;
39
41
  const MARKET_MOVE_CANCEL_PX = 10;
40
- export const WEB_MARKET_VERIFIED_PATH = 'M9.483 11.458v3.5h-1v-3.5z M10.467 2.698a2.03 2.03 0 0 1 3.065 0l1.358 1.564a.03.03 0 0 0 .028.01l2.046-.325a2.03 2.03 0 0 1 2.347 1.971l.037 2.07q0 .016.014.026l1.776 1.066a2.03 2.03 0 0 1 .532 3.019l-1.304 1.609a.03.03 0 0 0-.005.03l.675 1.956a2.03 2.03 0 0 1-1.533 2.656l-2.033.394a.03.03 0 0 0-.023.019l-.741 1.933a2.03 2.03 0 0 1-2.88 1.05l-1.811-1.006a.03.03 0 0 0-.03 0l-1.811 1.005a2.03 2.03 0 0 1-2.88-1.049l-.742-1.933a.03.03 0 0 0-.023-.019l-2.033-.394a2.03 2.03 0 0 1-1.532-2.656l.675-1.957a.03.03 0 0 0-.005-.029l-1.304-1.61a2.03 2.03 0 0 1 .532-3.018l1.776-1.066a.03.03 0 0 0 .014-.026l.035-2.07a2.03 2.03 0 0 1 2.349-1.97l2.045.324a.03.03 0 0 0 .028-.01zm1.516 3.76a.5.5 0 0 0-.447.276l-1.861 3.724H8.483a1 1 0 0 0-1 1v3.5a1 1 0 0 0 1 1h6.692a2 2 0 0 0 1.981-1.73l.341-2.5a2 2 0 0 0-1.982-2.27h-1.939l.197-1.269a1.5 1.5 0 0 0-1.481-1.731z';
41
42
  const REORDER_MOUSE_MOVE_THRESHOLD_PX = 5;
42
43
  const REORDER_EDGE_RATIO = 0.25;
43
44
  const REORDER_MAX_SPEED_ZONE_RATIO = 0.05;
@@ -723,332 +724,28 @@ function paintSelectorImageBackground(image, frame, inset = 0) {
723
724
  frame.insertBefore(paint, image);
724
725
  if (image.complete && image.naturalWidth > 0) update();
725
726
  }
726
-
727
- // OneKey patch: use source SVG paths for selector actions and wallet provider marks.
728
- const selectorIcons = {
729
- RefreshCcwOutline: {
730
- viewBox: '0 0 24 24',
731
- paths: [{
732
- d: 'M5 12a7 7 0 0 0 7 7 7.15 7.15 0 0 0 4.955-2h-2.943v-2h6v6h-2v-2.257A9.148 9.148 0 0 1 12 21a9 9 0 0 1-9-9v-1h2v1Zm1-6.754A9.148 9.148 0 0 1 12 3a9 9 0 0 1 9 9v1h-2v-1a7 7 0 0 0-7-7 7.15 7.15 0 0 0-4.955 2H10v2H4V3h2v2.246Z',
733
- fill: 'currentColor',
734
- fillRule: 'nonzero',
735
- opacity: 1
736
- }]
737
- },
738
- DotVerSolid: {
739
- viewBox: '0 0 24 24',
740
- paths: [{
741
- d: 'M14 18v4h-4v-4zm0-4h-4v-4h4zm0-8h-4V2h4z',
742
- fill: 'currentColor',
743
- fillRule: 'nonzero',
744
- opacity: 1
745
- }]
746
- },
747
- Document2Outline: {
748
- viewBox: '0 0 24 24',
749
- paths: [{
750
- d: 'M12 16H8v-2h4zm4-4H8v-2h8zm0-4H8V6h8z',
751
- fill: 'currentColor',
752
- fillRule: 'nonzero',
753
- opacity: 1
754
- }, {
755
- d: 'M20 22H4V2h16zM6 20h12V4H6z',
756
- fill: 'currentColor',
757
- fillRule: 'evenodd',
758
- opacity: 1
759
- }]
760
- },
761
- WalletOutline: {
762
- viewBox: '0 0 24 24',
763
- paths: [{
764
- d: 'M15.5 13.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5',
765
- fill: 'currentColor',
766
- fillRule: 'nonzero',
767
- opacity: 1
768
- }, {
769
- d: 'M17 8h4v13H7a4 4 0 0 1-4-4V6.5A3.5 3.5 0 0 1 6.5 3H17zM5 17a2 2 0 0 0 2 2h12v-9H6.5c-.537 0-1.045-.12-1.5-.337zM6.5 5a1.5 1.5 0 1 0 0 3H15V5z',
770
- fill: 'currentColor',
771
- fillRule: 'evenodd',
772
- opacity: 1
773
- }]
774
- },
775
- PlusLargeOutline: {
776
- viewBox: '0 0 24 24',
777
- paths: [{
778
- d: 'M13 11h8v2h-8v8h-2v-8H3v-2h8V3h2z',
779
- fill: 'currentColor',
780
- fillRule: 'nonzero',
781
- opacity: 1
782
- }]
783
- },
784
- TicketOutline: {
785
- viewBox: '0 0 24 24',
786
- paths: [{
787
- d: 'M16 17.01h-2V15h2v2.01Zm0-4h-2V11h2v2.01Zm0-4h-2V7h2v2.01Z',
788
- fill: 'currentColor',
789
- fillRule: 'nonzero',
790
- opacity: 1
791
- }, {
792
- d: 'm22 9.927-.629.252c-1.661.665-1.661 2.977 0 3.642l.629.252V20H2v-5.927l.629-.252c1.661-.665 1.661-2.977 0-3.642L2 9.927V4h20v5.927ZM4 8.636c2.5 1.52 2.499 5.207 0 6.727V18h16v-2.637c-2.499-1.52-2.5-5.208 0-6.727V6H4v2.636Z',
793
- fill: 'currentColor',
794
- fillRule: 'evenodd',
795
- opacity: 1
796
- }]
797
- },
798
- GasSolid: {
799
- viewBox: '0 0 24 24',
800
- paths: [{
801
- d: 'M15 9h4v7h1V8.414L17.586 6 19 4.586l3 3V18h-5v-7h-2v8h1v2H2v-2h1V3h12zM6 9v2h6V9z',
802
- fill: 'currentColor',
803
- fillRule: 'evenodd',
804
- opacity: 1
805
- }]
806
- },
807
- CryptoCoinOutline: {
808
- viewBox: '0 0 24 24',
809
- paths: [{
810
- d: 'M11 16.387a4.5 4.5 0 0 1 0-8.775V6h2v1.613a4.5 4.5 0 0 1 2.856 2.067l-1.712 1.032a2.5 2.5 0 1 0 0 2.576l1.712 1.032A4.5 4.5 0 0 1 13 16.386V18h-2z',
811
- fill: 'currentColor',
812
- fillRule: 'nonzero',
813
- opacity: 1
814
- }, {
815
- d: 'M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0',
816
- fill: 'currentColor',
817
- fillRule: 'evenodd',
818
- opacity: 1
819
- }]
820
- },
821
- GlobusOutline: {
822
- viewBox: '0 0 24 24',
823
- paths: [{
824
- d: 'M12 2c5.185 0 9.448 3.947 9.95 9H22v2h-.05c-.502 5.053-4.765 9-9.95 9s-9.448-3.947-9.95-9H2v-2h.05C2.552 5.947 6.815 2 12 2M9.523 13c.09 1.982.438 3.726.934 5.002.29.746.612 1.282.917 1.614.304.331.517.384.626.384s.322-.053.626-.384c.305-.332.627-.868.917-1.614.496-1.276.845-3.02.934-5.002zm-5.459 0a8 8 0 0 0 4.8 6.36 10 10 0 0 1-.271-.633C7.994 17.187 7.61 15.189 7.52 13zm12.416 0c-.09 2.189-.474 4.187-1.073 5.727a10 10 0 0 1-.271.633 8 8 0 0 0 4.8-6.36zM8.863 4.639A8 8 0 0 0 4.064 11h3.457c.09-2.189.473-4.187 1.072-5.727q.127-.327.27-.634M12 4c-.109 0-.322.053-.626.384-.305.332-.627.868-.917 1.614-.496 1.276-.844 3.02-.934 5.002h4.954c-.09-1.982-.438-3.726-.934-5.002-.29-.746-.612-1.282-.917-1.614C12.322 4.053 12.109 4 12 4m3.136.639q.144.307.271.634c.599 1.54.982 3.538 1.073 5.727h3.456a8 8 0 0 0-4.8-6.361',
825
- fill: 'currentColor',
826
- fillRule: 'evenodd',
827
- opacity: 1.0
828
- }]
829
- },
830
- LockSolid: {
831
- viewBox: '0 0 24 24',
832
- paths: [{
833
- d: 'M12 2a5 5 0 0 1 5 5v2h3v13H4V9h3V7a5 5 0 0 1 5-5m-1 11v5h2v-5zm1-9a3 3 0 0 0-3 3v2h6V7a3 3 0 0 0-3-3',
834
- fill: 'currentColor',
835
- fillRule: 'evenodd',
836
- opacity: 1.0
837
- }]
838
- },
839
- GoogleIllus: {
840
- viewBox: '0 0 24 24',
841
- paths: [{
842
- d: 'M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09',
843
- fill: '#4285F4',
844
- fillRule: 'nonzero',
845
- opacity: 1.0
846
- }, {
847
- d: 'M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23',
848
- fill: '#34A853',
849
- fillRule: 'nonzero',
850
- opacity: 1.0
851
- }, {
852
- d: 'M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22z',
853
- fill: '#FBBC05',
854
- fillRule: 'nonzero',
855
- opacity: 1.0
856
- }, {
857
- d: 'M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53',
858
- fill: '#EA4335',
859
- fillRule: 'nonzero',
860
- opacity: 1.0
861
- }]
862
- },
863
- AppleBrand: {
864
- viewBox: '0 0 16 20',
865
- paths: [{
866
- d: 'M11.67.834c.117 1.074-.315 2.153-.955 2.928-.64.773-1.692 1.378-2.718 1.298-.14-1.054.38-2.151.971-2.836C9.63 1.45 10.746.872 11.67.834M14.994 7.093c-.176.108-1.992 1.224-1.972 3.482.025 2.769 2.428 3.693 2.46 3.705l-.004.015a10.1 10.1 0 0 1-1.264 2.593c-.764 1.116-1.556 2.229-2.806 2.254-.598.011-1-.162-1.416-.343-.437-.19-.891-.386-1.609-.386-.751 0-1.226.203-1.683.398-.397.169-.78.333-1.32.354-1.208.047-2.124-1.207-2.895-2.32C.909 14.57-.294 10.414 1.322 7.612c.803-1.395 2.237-2.275 3.794-2.298.671-.014 1.32.244 1.89.47.434.172.821.326 1.135.326.282 0 .659-.149 1.099-.323.692-.273 1.539-.607 2.41-.518.599.026 2.276.24 3.354 1.818z',
867
- fill: 'currentColor',
868
- fillRule: 'nonzero',
869
- opacity: 1.0
870
- }]
871
- },
872
- BotIllus: {
873
- viewBox: '0 0 24 24',
874
- paths: [{
875
- d: 'M11 2a1 1 0 1 1 2 0v1.8l1.6 1.6a1 1 0 1 1-1.4 1.4L12 5.6l-1.2 1.2a1 1 0 0 1-1.4-1.4L11 3.8z',
876
- fill: '#8897A5',
877
- fillRule: 'nonzero',
878
- opacity: 1.0
879
- }, {
880
- d: 'M8.0 6.0h8.0a5.0 5.0 0 0 1 5.0 5.0v4.0a5.0 5.0 0 0 1 -5.0 5.0h-8.0a5.0 5.0 0 0 1 -5.0 -5.0v-4.0a5.0 5.0 0 0 1 5.0 -5.0z',
881
- fill: '#3FA9F5',
882
- fillRule: 'nonzero',
883
- opacity: 1.0
884
- }, {
885
- d: 'M3.0 10.0h0.0a1.5 1.5 0 0 1 1.5 1.5v3.0a1.5 1.5 0 0 1 -1.5 1.5h0.0a1.5 1.5 0 0 1 -1.5 -1.5v-3.0a1.5 1.5 0 0 1 1.5 -1.5z',
886
- fill: '#8897A5',
887
- fillRule: 'nonzero',
888
- opacity: 1.0
889
- }, {
890
- d: 'M21.0 10.0h0.0a1.5 1.5 0 0 1 1.5 1.5v3.0a1.5 1.5 0 0 1 -1.5 1.5h0.0a1.5 1.5 0 0 1 -1.5 -1.5v-3.0a1.5 1.5 0 0 1 1.5 -1.5z',
891
- fill: '#8897A5',
892
- fillRule: 'nonzero',
893
- opacity: 1.0
894
- }, {
895
- d: 'M7.5 12.0a1.5 1.5 0 1 0 3.0 0a1.5 1.5 0 1 0 -3.0 0',
896
- fill: '#10243E',
897
- fillRule: 'nonzero',
898
- opacity: 1.0
899
- }, {
900
- d: 'M13.5 12.0a1.5 1.5 0 1 0 3.0 0a1.5 1.5 0 1 0 -3.0 0',
901
- fill: '#10243E',
902
- fillRule: 'nonzero',
903
- opacity: 1.0
904
- }, {
905
- d: 'M8.5 15.4c.9.8 2.08 1.2 3.5 1.2s2.6-.4 3.5-1.2c.24-.2.6-.18.8.06.2.23.17.6-.06.8-1.14.98-2.58 1.46-4.24 1.46s-3.1-.48-4.24-1.46a.58.58 0 0 1-.06-.8c.2-.24.56-.26.8-.06',
906
- fill: '#10243E',
907
- fillRule: 'nonzero',
908
- opacity: 1.0
909
- }]
910
- },
911
- AllNetworksSolid: {
912
- viewBox: '0 0 24 24',
913
- paths: [{
914
- d: 'M15.333 13.998a1.335 1.335 0 1 1 0 2.67 1.335 1.335 0 0 1 0-2.67',
915
- fill: 'currentColor',
916
- fillRule: 'nonzero',
917
- opacity: 1.0
918
- }, {
919
- d: 'M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0M8 12.668A2 2 0 0 0 6 14.666V16c0 1.103.895 1.997 1.998 1.998h1.334A2 2 0 0 0 11.33 16v-1.334a2 2 0 0 0-1.998-1.998zm7.333 0a2.665 2.665 0 1 0 0 5.33 2.665 2.665 0 0 0 0-5.33M7.999 6.001A2 2 0 0 0 6.001 8v1.334c0 1.103.895 1.998 1.998 1.998h1.334a2 2 0 0 0 1.998-1.998V7.999a2 2 0 0 0-1.998-1.998zm6.667 0A2 2 0 0 0 12.668 8v1.334c0 1.103.895 1.998 1.998 1.998H16a2 2 0 0 0 1.998-1.998V7.999A2 2 0 0 0 16 6.001z',
920
- fill: 'currentColor',
921
- fillRule: 'evenodd',
922
- opacity: 1.0
923
- }]
924
- },
925
- CrossedSmallSolid: {
926
- viewBox: '0 0 24 24',
927
- paths: [{
928
- d: 'M17.87 8.25 14.12 12l3.75 3.75-2.12 2.121-3.75-3.75-3.75 3.75-2.121-2.121L9.879 12l-3.75-3.75 2.12-2.121L12 9.879l3.75-3.75 2.122 2.121Z',
929
- fill: 'currentColor',
930
- fillRule: 'nonzero',
931
- opacity: 1.0
932
- }]
933
- },
934
- AccountErrorCustom: {
935
- viewBox: '0 0 18 18',
936
- paths: [{
937
- d: 'M12.5 12.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5',
938
- fill: '#000',
939
- fillRule: 'nonzero',
940
- opacity: 0.447
941
- }, {
942
- d: 'M0 3.5A3.5 3.5 0 0 1 3.5 0h8.088A2.41 2.41 0 0 1 14 2.412V5h1a3 3 0 0 1 3 3v7a3 3 0 0 1-3 3H4a4 4 0 0 1-4-4zm2 3.163V14a2 2 0 0 0 2 2h11a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3.5c-.537 0-1.045-.12-1.5-.337M2 3.5A1.5 1.5 0 0 0 3.5 5H12V2.412A.41.41 0 0 0 11.588 2H3.5A1.5 1.5 0 0 0 2 3.5',
943
- fill: '#000',
944
- fillRule: 'evenodd',
945
- opacity: 0.447
946
- }]
947
- },
948
- PlusSmallOutline: {
949
- viewBox: '0 0 24 24',
950
- paths: [{
951
- d: 'M13 11h5v2h-5v5h-2v-5H6v-2h5V6h2z',
952
- fill: 'currentColor',
953
- fillRule: 'nonzero',
954
- opacity: 1.0
955
- }]
956
- },
957
- DotHorOutline: {
958
- viewBox: '0 0 24 24',
959
- paths: [{
960
- d: 'M6 14H2v-4h4zm8 0h-4v-4h4zm8 0h-4v-4h4z',
961
- fill: 'currentColor',
962
- fillRule: 'nonzero',
963
- opacity: 1.0
964
- }]
965
- },
966
- ChevronRightSmallOutline: {
967
- viewBox: '0 0 24 24',
968
- paths: [{
969
- d: 'M15.414 12 10 17.414 8.586 16l4-4-4-4L10 6.586z',
970
- fill: 'currentColor',
971
- fillRule: 'nonzero',
972
- opacity: 1.0
973
- }]
974
- },
975
- DragOutline: {
976
- viewBox: '0 0 24 24',
977
- paths: [{
978
- d: 'M11 21H7v-4h4zm6 0h-4v-4h4zm-6-7H7v-4h4zm6 0h-4v-4h4zm-6-7H7V3h4zm6 0h-4V3h4z',
979
- fill: 'currentColor',
980
- fillRule: 'nonzero',
981
- opacity: 1.0
982
- }]
983
- },
984
- PencilOutline: {
985
- viewBox: '0 0 24 24',
986
- paths: [{
987
- d: 'M22.414 7.5 7.914 22H2v-5.914l14.5-14.5zM4 16.914V20h3.086l9.5-9.5L13.5 7.414zM14.914 6 18 9.086 19.586 7.5 16.5 4.414z',
988
- fill: 'currentColor',
989
- fillRule: 'evenodd',
990
- opacity: 1.0
991
- }]
992
- },
993
- CheckboxCheckedCustom: {
994
- viewBox: '0 0 16 16',
995
- paths: [{
996
- d: 'M12.204 5.043a1 1 0 0 1 0 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-2-2a1 1 0 1 1 1.414-1.414l1.293 1.293 3.793-3.793a1 1 0 0 1 1.414 0',
997
- fill: 'currentColor',
998
- fillRule: 'evenodd',
999
- opacity: 1.0
1000
- }]
1001
- },
1002
- CheckboxIndeterminateCustom: {
1003
- viewBox: '0 0 16 16',
1004
- paths: [{
1005
- d: 'M4 8a1 1 0 0 1 1-1h6a1 1 0 0 1 0 2H5a1 1 0 0 1-1-1',
1006
- fill: 'currentColor',
1007
- fillRule: 'evenodd',
1008
- opacity: 1.0
1009
- }]
1010
- },
1011
- Circle: {
1012
- viewBox: '0 0 24 24',
1013
- paths: [{
1014
- d: 'M0 12a12 12 0 1 0 24 0a12 12 0 1 0 -24 0',
1015
- fill: 'currentColor',
1016
- fillRule: 'nonzero',
1017
- opacity: 1
1018
- }]
1019
- },
1020
- BadgeVerifiedSolid: {
1021
- viewBox: '0 0 24 24',
1022
- paths: [{
1023
- d: WEB_MARKET_VERIFIED_PATH,
1024
- fill: 'currentColor',
1025
- fillRule: 'evenodd',
1026
- opacity: 1
1027
- }]
1028
- }
1029
- };
1030
727
  function applySelectorIcon(element, name) {
1031
- const icon = selectorIcons[name];
1032
- if (!icon) return;
1033
- element.textContent = '';
1034
- const svg = element.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'svg');
1035
- svg.setAttribute('viewBox', icon.viewBox);
1036
- svg.setAttribute('width', '24');
1037
- svg.setAttribute('height', '24');
1038
- svg.setAttribute('aria-hidden', 'true');
1039
- icon.paths.forEach(path => {
1040
- const child = element.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'path');
1041
- child.setAttribute('d', path.d);
1042
- child.setAttribute('fill', path.fill);
1043
- child.setAttribute('fill-rule', path.fillRule);
1044
- child.setAttribute('fill-opacity', String(path.opacity));
1045
- svg.appendChild(child);
1046
- });
1047
- element.appendChild(svg);
728
+ const canonical = selectorIcons[name];
729
+ if (!canonical) return;
730
+ if (canonical === 'Circle') {
731
+ const svg = element.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'svg');
732
+ svg.setAttribute('viewBox', '0 0 24 24');
733
+ svg.setAttribute('width', '24');
734
+ svg.setAttribute('height', '24');
735
+ svg.setAttribute('aria-hidden', 'true');
736
+ const circle = element.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'circle');
737
+ circle.setAttribute('cx', '12');
738
+ circle.setAttribute('cy', '12');
739
+ circle.setAttribute('r', '12');
740
+ circle.setAttribute('fill', 'currentColor');
741
+ svg.append(circle);
742
+ element.replaceChildren(svg);
743
+ return;
744
+ }
745
+ element.replaceChildren(createNamedIcon(element.ownerDocument, canonical));
1048
746
  }
1049
747
  function iconGlyph(name) {
1050
748
  const normalized = name.toLocaleLowerCase();
1051
- if (normalized === 'dotversolid') return '⋮';
1052
749
  if (normalized.includes('chevron')) {
1053
750
  if (normalized.includes('top')) return '⌃';
1054
751
  if (normalized.includes('bottom')) return '⌄';
@@ -1291,6 +988,7 @@ function createIconAction(context, name, actionKey, disabled, tintColor) {
1291
988
  if (element.tagName === 'BUTTON') {
1292
989
  element.setAttribute('type', 'button');
1293
990
  element.toggleAttribute('disabled', Boolean(disabled));
991
+ if (name === 'DotVerSolid') element.setAttribute('aria-label', '⋮');
1294
992
  }
1295
993
  applySelectorIcon(element, name);
1296
994
  if (actionKey) setData(element, 'nativeListAction', actionKey);