@shortkitsdk/react-native 0.2.29 → 0.2.31

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 (37) hide show
  1. package/android/libs/shortkit-release.aar +0 -0
  2. package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedView.kt +8 -1
  3. package/android/src/main/java/com/shortkit/reactnative/ShortKitFeedViewManager.kt +6 -0
  4. package/ios/ShortKitBridge.swift +5 -1
  5. package/ios/ShortKitFeedView.swift +9 -13
  6. package/ios/ShortKitFeedViewManager.mm +1 -0
  7. package/ios/ShortKitModule.mm +5 -1
  8. package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
  9. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
  10. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +4732 -872
  11. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +77 -8
  12. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  13. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +77 -8
  14. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
  15. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
  16. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
  17. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +4732 -872
  18. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +77 -8
  19. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  20. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +77 -8
  21. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +4732 -872
  22. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +77 -8
  23. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  24. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +77 -8
  25. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
  26. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
  27. package/ios/ShortKitWidgetNativeView.swift +23 -0
  28. package/ios/ShortKitWidgetNativeViewManager.mm +1 -0
  29. package/package.json +1 -1
  30. package/src/ShortKitFeed.tsx +2 -0
  31. package/src/ShortKitProvider.tsx +4 -0
  32. package/src/ShortKitWidget.tsx +47 -2
  33. package/src/specs/NativeShortKitModule.ts +9 -0
  34. package/src/specs/ShortKitFeedViewNativeComponent.ts +5 -0
  35. package/src/specs/ShortKitWidgetViewNativeComponent.ts +6 -0
  36. package/src/types.ts +21 -0
  37. package/ios/DebugPanelView.swift +0 -302
Binary file
@@ -30,6 +30,12 @@ class ShortKitFeedView(context: Context) : FrameLayout(context) {
30
30
  var feedId: String? = null
31
31
  var startAtItemId: String? = null
32
32
  var preloadId: String? = null
33
+ // Fabric's generated delegate maps an absent boolean prop to the Java
34
+ // primitive false, so Boolean? is always non-null from the bridge. Track
35
+ // whether the prop was explicitly set so we can fall back to the provider
36
+ // flag when it wasn't.
37
+ var debugPanel: Boolean = false
38
+ var debugPanelPropSet: Boolean = false
33
39
 
34
40
  // -----------------------------------------------------------------------
35
41
  // Fragment management
@@ -191,7 +197,8 @@ class ShortKitFeedView(context: Context) : FrameLayout(context) {
191
197
 
192
198
  val fragment = ShortKitFeedFragment.newInstance(sdk, feedConfig, startAtItemId)
193
199
 
194
- if (sdk.debugPanelEnabled) {
200
+ val debugPanelEnabled = if (debugPanelPropSet) debugPanel else sdk.debugPanelEnabled
201
+ if (debugPanelEnabled) {
195
202
  fragment.debugPanelFactory = { active, prev, next, lifecycleOwner ->
196
203
  com.shortkit.sdk.debug.DebugPanelView(context).also { panel ->
197
204
  panel.subscribe(active, prev, next, lifecycleOwner)
@@ -35,6 +35,12 @@ class ShortKitFeedViewManager : SimpleViewManager<ShortKitFeedView>() {
35
35
  view.preloadId = preloadId
36
36
  }
37
37
 
38
+ @ReactProp(name = "debugPanel")
39
+ fun setDebugPanel(view: ShortKitFeedView, debugPanel: Boolean) {
40
+ view.debugPanel = debugPanel
41
+ view.debugPanelPropSet = true
42
+ }
43
+
38
44
  override fun onDropViewInstance(view: ShortKitFeedView) {
39
45
  view.destroy()
40
46
  super.onDropViewInstance(view)
@@ -176,6 +176,8 @@ import ShortKitSDK
176
176
  clientAppVersion: String?,
177
177
  customDimensions customDimensionsJSON: String?,
178
178
  debugPanel: Bool,
179
+ serverTracingEnabled: Bool,
180
+ consoleTracingEnabled: Bool,
179
181
  delegate: ShortKitBridgeDelegateProtocol,
180
182
  surfacePresenter: AnyObject?
181
183
  ) {
@@ -190,7 +192,9 @@ import ShortKitSDK
190
192
  clientAppName: clientAppName,
191
193
  clientAppVersion: clientAppVersion,
192
194
  customDimensions: dimensions,
193
- debugPanelEnabled: debugPanel
195
+ debugPanelEnabled: debugPanel,
196
+ serverTracingEnabled: serverTracingEnabled,
197
+ consoleTracingEnabled: consoleTracingEnabled
194
198
  )
195
199
  self.shortKit = sdk
196
200
 
@@ -59,6 +59,12 @@ import ShortKitSDK
59
59
  }
60
60
  }
61
61
 
62
+ /// Per-surface debug panel override. NSNumber so we can distinguish
63
+ /// unset (fall back to provider-global) from explicit true/false.
64
+ @objc public var debugPanel: NSNumber? {
65
+ didSet { /* read once at embed time */ }
66
+ }
67
+
62
68
  @objc var feedId: String?
63
69
 
64
70
  // MARK: - Child VC
@@ -166,19 +172,9 @@ import ShortKitSDK
166
172
  feedVC.seedThumbnail = image
167
173
  }
168
174
 
169
- if sdk.debugPanelEnabled {
170
- feedVC.debugPanelFactory = { active, prev, next in
171
- let panel = DebugPanelView(frame: CGRect(
172
- x: 0, y: 0,
173
- width: DebugPanelView.panelWidth,
174
- height: DebugPanelView.panelHeight
175
- ))
176
- panel.center = CGPoint(x: UIScreen.main.bounds.width / 2,
177
- y: UIScreen.main.bounds.height / 2)
178
- panel.subscribe(to: active)
179
- panel.subscribeAdjacent(prev: prev, next: next)
180
- return panel
181
- }
175
+ let debugPanelEnabled = self.debugPanel?.boolValue ?? sdk.debugPanelEnabled
176
+ if debugPanelEnabled {
177
+ feedVC.debugPanelFactory = ShortKit.defaultDebugPanelFactory
182
178
  }
183
179
 
184
180
  feedVC.onDismiss = {
@@ -29,5 +29,6 @@ RCT_EXPORT_VIEW_PROPERTY(feedId, NSString)
29
29
  RCT_EXPORT_VIEW_PROPERTY(seedThumbnailUrl, NSString)
30
30
  RCT_EXPORT_VIEW_PROPERTY(feedItemsJSON, NSString)
31
31
  RCT_EXPORT_VIEW_PROPERTY(active, BOOL)
32
+ RCT_EXPORT_VIEW_PROPERTY(debugPanel, NSNumber)
32
33
 
33
34
  @end
@@ -134,7 +134,9 @@ RCT_EXPORT_METHOD(initialize:(NSString *)apiKey
134
134
  clientAppName:(NSString *)clientAppName
135
135
  clientAppVersion:(NSString *)clientAppVersion
136
136
  customDimensions:(NSString *)customDimensions
137
- debugPanel:(NSNumber *)debugPanel) {
137
+ debugPanel:(NSNumber *)debugPanel
138
+ serverTracingEnabled:(NSNumber *)serverTracingEnabled
139
+ consoleTracingEnabled:(NSNumber *)consoleTracingEnabled) {
138
140
  // Tear down any existing instance to prevent leaks on re-initialize
139
141
  [_shortKitBridge teardown];
140
142
 
@@ -144,6 +146,8 @@ RCT_EXPORT_METHOD(initialize:(NSString *)apiKey
144
146
  clientAppVersion:clientAppVersion
145
147
  customDimensions:customDimensions
146
148
  debugPanel:[debugPanel boolValue]
149
+ serverTracingEnabled:[serverTracingEnabled boolValue]
150
+ consoleTracingEnabled:[consoleTracingEnabled boolValue]
147
151
  delegate:self
148
152
  surfacePresenter:_surfacePresenter];
149
153
 
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>ShortKitSDK.framework/ShortKitSDK</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>ShortKitSDK.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>x86_64</string>
18
17
  </array>
19
18
  <key>SupportedPlatform</key>
20
19
  <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
20
  </dict>
24
21
  <dict>
25
22
  <key>BinaryPath</key>
26
23
  <string>ShortKitSDK.framework/ShortKitSDK</string>
27
24
  <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
25
+ <string>ios-arm64_x86_64-simulator</string>
29
26
  <key>LibraryPath</key>
30
27
  <string>ShortKitSDK.framework</string>
31
28
  <key>SupportedArchitectures</key>
32
29
  <array>
33
30
  <string>arm64</string>
31
+ <string>x86_64</string>
34
32
  </array>
35
33
  <key>SupportedPlatform</key>
36
34
  <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -11,9 +11,9 @@
11
11
  <key>CFBundlePackageType</key>
12
12
  <string>FMWK</string>
13
13
  <key>CFBundleVersion</key>
14
- <string>0.2.29</string>
14
+ <string>0.2.31</string>
15
15
  <key>CFBundleShortVersionString</key>
16
- <string>0.2.29</string>
16
+ <string>0.2.31</string>
17
17
  <key>MinimumOSVersion</key>
18
18
  <string>16.0</string>
19
19
  </dict>