@shortkitsdk/react-native 0.2.27 → 0.2.28

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 (36) hide show
  1. package/android/libs/shortkit-release.aar +0 -0
  2. package/android/src/main/java/com/shortkit/reactnative/ShortKitBridge.kt +8 -0
  3. package/android/src/main/java/com/shortkit/reactnative/ShortKitModule.kt +10 -0
  4. package/android/src/main/java/com/shortkit/reactnative/ShortKitPlayerNativeView.kt +4 -0
  5. package/android/src/main/java/com/shortkit/reactnative/ShortKitWidgetNativeView.kt +45 -33
  6. package/ios/ShortKitBridge.swift +8 -0
  7. package/ios/ShortKitModule.mm +11 -0
  8. package/ios/ShortKitPlayerNativeView.swift +7 -1
  9. package/ios/ShortKitSDK.xcframework/Info.plist +5 -5
  10. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
  11. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +200 -17
  12. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +6 -2
  13. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  14. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +6 -2
  15. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
  16. package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
  17. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
  18. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +200 -17
  19. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +6 -2
  20. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -2
  22. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +200 -17
  23. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +6 -2
  24. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  25. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +6 -2
  26. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
  27. package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
  28. package/ios/ShortKitWidgetNativeView.swift +33 -12
  29. package/package.json +1 -1
  30. package/src/ShortKitFeed.tsx +3 -0
  31. package/src/ShortKitPlayer.tsx +25 -15
  32. package/src/ShortKitWidget.tsx +24 -18
  33. package/src/index.ts +1 -0
  34. package/src/serialization.ts +38 -0
  35. package/src/specs/NativeShortKitModule.ts +1 -0
  36. package/src/types.ts +19 -1
@@ -17413,6 +17413,28 @@
17413
17413
  }
17414
17414
  ]
17415
17415
  },
17416
+ {
17417
+ "kind": "Function",
17418
+ "name": "refresh",
17419
+ "printedName": "refresh()",
17420
+ "children": [
17421
+ {
17422
+ "kind": "TypeNominal",
17423
+ "name": "Void",
17424
+ "printedName": "()"
17425
+ }
17426
+ ],
17427
+ "declKind": "Func",
17428
+ "usr": "s:11ShortKitSDK0aB18FeedViewControllerC7refreshyyF",
17429
+ "mangledName": "$s11ShortKitSDK0aB18FeedViewControllerC7refreshyyF",
17430
+ "moduleName": "ShortKitSDK",
17431
+ "declAttributes": [
17432
+ "AccessControl",
17433
+ "Custom",
17434
+ "RawDocComment"
17435
+ ],
17436
+ "funcSelfKind": "NonMutating"
17437
+ },
17416
17438
  {
17417
17439
  "kind": "Var",
17418
17440
  "name": "canBecomeFirstResponder",
@@ -41739,7 +41761,7 @@
41739
41761
  {
41740
41762
  "kind": "Constructor",
41741
41763
  "name": "init",
41742
- "printedName": "init(shortKit:config:)",
41764
+ "printedName": "init(shortKit:config:items:)",
41743
41765
  "children": [
41744
41766
  {
41745
41767
  "kind": "TypeNominal",
@@ -41758,11 +41780,26 @@
41758
41780
  "name": "WidgetConfig",
41759
41781
  "printedName": "ShortKitSDK.WidgetConfig",
41760
41782
  "usr": "s:11ShortKitSDK12WidgetConfigV"
41783
+ },
41784
+ {
41785
+ "kind": "TypeNominal",
41786
+ "name": "Array",
41787
+ "printedName": "[ShortKitSDK.WidgetInput]",
41788
+ "children": [
41789
+ {
41790
+ "kind": "TypeNominal",
41791
+ "name": "WidgetInput",
41792
+ "printedName": "ShortKitSDK.WidgetInput",
41793
+ "usr": "s:11ShortKitSDK11WidgetInputO"
41794
+ }
41795
+ ],
41796
+ "hasDefaultArg": true,
41797
+ "usr": "s:Sa"
41761
41798
  }
41762
41799
  ],
41763
41800
  "declKind": "Constructor",
41764
- "usr": "s:11ShortKitSDK0aB20WidgetViewControllerC05shortB06configAcA0aB0C_AA0D6ConfigVtcfc",
41765
- "mangledName": "$s11ShortKitSDK0aB20WidgetViewControllerC05shortB06configAcA0aB0C_AA0D6ConfigVtcfc",
41801
+ "usr": "s:11ShortKitSDK0aB20WidgetViewControllerC05shortB06config5itemsAcA0aB0C_AA0D6ConfigVSayAA0D5InputOGtcfc",
41802
+ "mangledName": "$s11ShortKitSDK0aB20WidgetViewControllerC05shortB06config5itemsAcA0aB0C_AA0D6ConfigVSayAA0D5InputOGtcfc",
41766
41803
  "moduleName": "ShortKitSDK",
41767
41804
  "declAttributes": [
41768
41805
  "Preconcurrency",
@@ -41785,21 +41822,21 @@
41785
41822
  {
41786
41823
  "kind": "TypeNominal",
41787
41824
  "name": "Array",
41788
- "printedName": "[ShortKitSDK.ContentItem]",
41825
+ "printedName": "[ShortKitSDK.WidgetInput]",
41789
41826
  "children": [
41790
41827
  {
41791
41828
  "kind": "TypeNominal",
41792
- "name": "ContentItem",
41793
- "printedName": "ShortKitSDK.ContentItem",
41794
- "usr": "s:11ShortKitSDK11ContentItemV"
41829
+ "name": "WidgetInput",
41830
+ "printedName": "ShortKitSDK.WidgetInput",
41831
+ "usr": "s:11ShortKitSDK11WidgetInputO"
41795
41832
  }
41796
41833
  ],
41797
41834
  "usr": "s:Sa"
41798
41835
  }
41799
41836
  ],
41800
41837
  "declKind": "Func",
41801
- "usr": "s:11ShortKitSDK0aB20WidgetViewControllerC9configure4withySayAA11ContentItemVG_tF",
41802
- "mangledName": "$s11ShortKitSDK0aB20WidgetViewControllerC9configure4withySayAA11ContentItemVG_tF",
41838
+ "usr": "s:11ShortKitSDK0aB20WidgetViewControllerC9configure4withySayAA0D5InputOG_tF",
41839
+ "mangledName": "$s11ShortKitSDK0aB20WidgetViewControllerC9configure4withySayAA0D5InputOG_tF",
41803
41840
  "moduleName": "ShortKitSDK",
41804
41841
  "declAttributes": [
41805
41842
  "Preconcurrency",
@@ -43452,6 +43489,138 @@
43452
43489
  "mangledName": "$ss9EscapableP"
43453
43490
  }
43454
43491
  ]
43492
+ },
43493
+ {
43494
+ "kind": "Import",
43495
+ "name": "Foundation",
43496
+ "printedName": "Foundation",
43497
+ "declKind": "Import",
43498
+ "moduleName": "ShortKitSDK"
43499
+ },
43500
+ {
43501
+ "kind": "TypeDecl",
43502
+ "name": "WidgetInput",
43503
+ "printedName": "WidgetInput",
43504
+ "children": [
43505
+ {
43506
+ "kind": "Var",
43507
+ "name": "video",
43508
+ "printedName": "video",
43509
+ "children": [
43510
+ {
43511
+ "kind": "TypeFunc",
43512
+ "name": "Function",
43513
+ "printedName": "(ShortKitSDK.WidgetInput.Type) -> (Swift.String, ShortKitSDK.ContentOrigin, Swift.String?) -> ShortKitSDK.WidgetInput",
43514
+ "children": [
43515
+ {
43516
+ "kind": "TypeFunc",
43517
+ "name": "Function",
43518
+ "printedName": "(Swift.String, ShortKitSDK.ContentOrigin, Swift.String?) -> ShortKitSDK.WidgetInput",
43519
+ "children": [
43520
+ {
43521
+ "kind": "TypeNominal",
43522
+ "name": "WidgetInput",
43523
+ "printedName": "ShortKitSDK.WidgetInput",
43524
+ "usr": "s:11ShortKitSDK11WidgetInputO"
43525
+ },
43526
+ {
43527
+ "kind": "TypeNominal",
43528
+ "name": "Tuple",
43529
+ "printedName": "(playbackId: Swift.String, origin: ShortKitSDK.ContentOrigin, fallbackUrl: Swift.String?)",
43530
+ "children": [
43531
+ {
43532
+ "kind": "TypeNominal",
43533
+ "name": "String",
43534
+ "printedName": "Swift.String",
43535
+ "usr": "s:SS"
43536
+ },
43537
+ {
43538
+ "kind": "TypeNominal",
43539
+ "name": "ContentOrigin",
43540
+ "printedName": "ShortKitSDK.ContentOrigin",
43541
+ "usr": "s:11ShortKitSDK13ContentOriginO"
43542
+ },
43543
+ {
43544
+ "kind": "TypeNominal",
43545
+ "name": "Optional",
43546
+ "printedName": "Swift.String?",
43547
+ "children": [
43548
+ {
43549
+ "kind": "TypeNominal",
43550
+ "name": "String",
43551
+ "printedName": "Swift.String",
43552
+ "usr": "s:SS"
43553
+ }
43554
+ ],
43555
+ "usr": "s:Sq"
43556
+ }
43557
+ ]
43558
+ }
43559
+ ]
43560
+ },
43561
+ {
43562
+ "kind": "TypeNominal",
43563
+ "name": "Metatype",
43564
+ "printedName": "ShortKitSDK.WidgetInput.Type",
43565
+ "children": [
43566
+ {
43567
+ "kind": "TypeNominal",
43568
+ "name": "WidgetInput",
43569
+ "printedName": "ShortKitSDK.WidgetInput",
43570
+ "usr": "s:11ShortKitSDK11WidgetInputO"
43571
+ }
43572
+ ]
43573
+ }
43574
+ ]
43575
+ }
43576
+ ],
43577
+ "declKind": "EnumElement",
43578
+ "usr": "s:11ShortKitSDK11WidgetInputO5videoyACSS_AA13ContentOriginOSSSgtcACmF",
43579
+ "mangledName": "$s11ShortKitSDK11WidgetInputO5videoyACSS_AA13ContentOriginOSSSgtcACmF",
43580
+ "moduleName": "ShortKitSDK",
43581
+ "declAttributes": [
43582
+ "RawDocComment"
43583
+ ]
43584
+ }
43585
+ ],
43586
+ "declKind": "Enum",
43587
+ "usr": "s:11ShortKitSDK11WidgetInputO",
43588
+ "mangledName": "$s11ShortKitSDK11WidgetInputO",
43589
+ "moduleName": "ShortKitSDK",
43590
+ "declAttributes": [
43591
+ "AccessControl",
43592
+ "RawDocComment"
43593
+ ],
43594
+ "conformances": [
43595
+ {
43596
+ "kind": "Conformance",
43597
+ "name": "Copyable",
43598
+ "printedName": "Copyable",
43599
+ "usr": "s:s8CopyableP",
43600
+ "mangledName": "$ss8CopyableP"
43601
+ },
43602
+ {
43603
+ "kind": "Conformance",
43604
+ "name": "Escapable",
43605
+ "printedName": "Escapable",
43606
+ "usr": "s:s9EscapableP",
43607
+ "mangledName": "$ss9EscapableP"
43608
+ },
43609
+ {
43610
+ "kind": "Conformance",
43611
+ "name": "Sendable",
43612
+ "printedName": "Sendable",
43613
+ "usr": "s:s8SendableP",
43614
+ "mangledName": "$ss8SendableP"
43615
+ },
43616
+ {
43617
+ "kind": "Conformance",
43618
+ "name": "SendableMetatype",
43619
+ "printedName": "SendableMetatype",
43620
+ "usr": "s:s16SendableMetatypeP",
43621
+ "mangledName": "$ss16SendableMetatypeP"
43622
+ }
43623
+ ]
43455
43624
  }
43456
43625
  ],
43457
43626
  "json_format_version": 8
@@ -44297,31 +44466,38 @@
44297
44466
  "length": 3,
44298
44467
  "value": "0.2"
44299
44468
  },
44469
+ {
44470
+ "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Feed\/FeedViewController.swift",
44471
+ "kind": "BooleanLiteral",
44472
+ "offset": 10812,
44473
+ "length": 5,
44474
+ "value": "false"
44475
+ },
44300
44476
  {
44301
44477
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Feed\/FeedViewController.swift",
44302
44478
  "kind": "IntegerLiteral",
44303
- "offset": 10814,
44479
+ "offset": 10862,
44304
44480
  "length": 2,
44305
44481
  "value": "24"
44306
44482
  },
44307
44483
  {
44308
44484
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Feed\/FeedViewController.swift",
44309
44485
  "kind": "BooleanLiteral",
44310
- "offset": 25761,
44486
+ "offset": 25904,
44311
44487
  "length": 5,
44312
44488
  "value": "false"
44313
44489
  },
44314
44490
  {
44315
44491
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Feed\/FeedViewController.swift",
44316
44492
  "kind": "BooleanLiteral",
44317
- "offset": 86573,
44493
+ "offset": 88164,
44318
44494
  "length": 5,
44319
44495
  "value": "false"
44320
44496
  },
44321
44497
  {
44322
44498
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Feed\/FeedViewController.swift",
44323
44499
  "kind": "BooleanLiteral",
44324
- "offset": 197685,
44500
+ "offset": 199276,
44325
44501
  "length": 5,
44326
44502
  "value": "false"
44327
44503
  },
@@ -45121,7 +45297,7 @@
45121
45297
  "kind": "StringLiteral",
45122
45298
  "offset": 124,
45123
45299
  "length": 8,
45124
- "value": "\"0.2.27\""
45300
+ "value": "\"0.2.28\""
45125
45301
  },
45126
45302
  {
45127
45303
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/ShortKit.swift",
@@ -45494,24 +45670,31 @@
45494
45670
  "length": 1,
45495
45671
  "value": "0"
45496
45672
  },
45673
+ {
45674
+ "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Widget\/ShortKitWidgetViewController.swift",
45675
+ "kind": "Array",
45676
+ "offset": 1666,
45677
+ "length": 2,
45678
+ "value": "[]"
45679
+ },
45497
45680
  {
45498
45681
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Widget\/ShortKitWidgetViewController.swift",
45499
45682
  "kind": "BooleanLiteral",
45500
- "offset": 2098,
45683
+ "offset": 3175,
45501
45684
  "length": 5,
45502
45685
  "value": "false"
45503
45686
  },
45504
45687
  {
45505
45688
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Widget\/ShortKitWidgetViewController.swift",
45506
45689
  "kind": "BooleanLiteral",
45507
- "offset": 2184,
45690
+ "offset": 3261,
45508
45691
  "length": 5,
45509
45692
  "value": "false"
45510
45693
  },
45511
45694
  {
45512
45695
  "filePath": "\/Users\/michaelseleman\/shortkit\/swift_sdk\/Sources\/ShortKit\/Widget\/ShortKitWidgetViewController.swift",
45513
45696
  "kind": "StringLiteral",
45514
- "offset": 15136,
45697
+ "offset": 16213,
45515
45698
  "length": 16,
45516
45699
  "value": "\"WidgetCardCell\""
45517
45700
  },
@@ -472,6 +472,7 @@ public enum ShortKitDownloadError : Swift.Error {
472
472
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public var supportedInterfaceOrientations: UIKit.UIInterfaceOrientationMask {
473
473
  @objc get
474
474
  }
475
+ @_Concurrency.MainActor public func refresh()
475
476
  @objc deinit
476
477
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public var canBecomeFirstResponder: Swift.Bool {
477
478
  @objc get
@@ -1141,8 +1142,8 @@ extension ShortKitSDK.ShortKitPlayerViewController : UIKit.UIViewControllerTrans
1141
1142
  }
1142
1143
  @objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency final public class ShortKitWidgetViewController : UIKit.UIViewController {
1143
1144
  @_Concurrency.MainActor @preconcurrency final public var feedMask: ShortKitSDK.FeedMaskMode
1144
- @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig)
1145
- @_Concurrency.MainActor @preconcurrency final public func configure(with items: [ShortKitSDK.ContentItem])
1145
+ @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig, items: [ShortKitSDK.WidgetInput] = [])
1146
+ @_Concurrency.MainActor @preconcurrency final public func configure(with inputs: [ShortKitSDK.WidgetInput])
1146
1147
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewDidLoad()
1147
1148
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewDidAppear(_ animated: Swift.Bool)
1148
1149
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewWillDisappear(_ animated: Swift.Bool)
@@ -1175,6 +1176,9 @@ public struct WidgetConfig {
1175
1176
  public init(cardCount: Swift.Int = 3, cardSpacing: CoreFoundation.CGFloat = 8, cornerRadius: CoreFoundation.CGFloat = 12, autoplay: Swift.Bool = true, muteOnStart: Swift.Bool = true, loop: Swift.Bool = true, rotationInterval: Foundation.TimeInterval = 10, clickAction: ShortKitSDK.PlayerClickAction = .feed, cardOverlay: ShortKitSDK.VideoOverlayMode = .none, feedConfig: ShortKitSDK.FeedConfig = FeedConfig(), filter: ShortKitSDK.FeedFilter? = nil)
1176
1177
  public func resolvedFeedConfig() -> ShortKitSDK.FeedConfig
1177
1178
  }
1179
+ public enum WidgetInput : Swift.Sendable {
1180
+ case video(playbackId: Swift.String, origin: ShortKitSDK.ContentOrigin = .other, fallbackUrl: Swift.String? = nil)
1181
+ }
1178
1182
  extension ShortKitSDK.AdQuartile : Swift.Equatable {}
1179
1183
  extension ShortKitSDK.AdQuartile : Swift.Hashable {}
1180
1184
  extension ShortKitSDK.ScrollAxis : Swift.Hashable {}
@@ -472,6 +472,7 @@ public enum ShortKitDownloadError : Swift.Error {
472
472
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public var supportedInterfaceOrientations: UIKit.UIInterfaceOrientationMask {
473
473
  @objc get
474
474
  }
475
+ @_Concurrency.MainActor public func refresh()
475
476
  @objc deinit
476
477
  @_Concurrency.MainActor @preconcurrency @objc override dynamic public var canBecomeFirstResponder: Swift.Bool {
477
478
  @objc get
@@ -1141,8 +1142,8 @@ extension ShortKitSDK.ShortKitPlayerViewController : UIKit.UIViewControllerTrans
1141
1142
  }
1142
1143
  @objc @_hasMissingDesignatedInitializers @_Concurrency.MainActor @preconcurrency final public class ShortKitWidgetViewController : UIKit.UIViewController {
1143
1144
  @_Concurrency.MainActor @preconcurrency final public var feedMask: ShortKitSDK.FeedMaskMode
1144
- @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig)
1145
- @_Concurrency.MainActor @preconcurrency final public func configure(with items: [ShortKitSDK.ContentItem])
1145
+ @_Concurrency.MainActor @preconcurrency public init(shortKit: ShortKitSDK.ShortKit, config: ShortKitSDK.WidgetConfig, items: [ShortKitSDK.WidgetInput] = [])
1146
+ @_Concurrency.MainActor @preconcurrency final public func configure(with inputs: [ShortKitSDK.WidgetInput])
1146
1147
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewDidLoad()
1147
1148
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewDidAppear(_ animated: Swift.Bool)
1148
1149
  @_Concurrency.MainActor @preconcurrency @objc override final public func viewWillDisappear(_ animated: Swift.Bool)
@@ -1175,6 +1176,9 @@ public struct WidgetConfig {
1175
1176
  public init(cardCount: Swift.Int = 3, cardSpacing: CoreFoundation.CGFloat = 8, cornerRadius: CoreFoundation.CGFloat = 12, autoplay: Swift.Bool = true, muteOnStart: Swift.Bool = true, loop: Swift.Bool = true, rotationInterval: Foundation.TimeInterval = 10, clickAction: ShortKitSDK.PlayerClickAction = .feed, cardOverlay: ShortKitSDK.VideoOverlayMode = .none, feedConfig: ShortKitSDK.FeedConfig = FeedConfig(), filter: ShortKitSDK.FeedFilter? = nil)
1176
1177
  public func resolvedFeedConfig() -> ShortKitSDK.FeedConfig
1177
1178
  }
1179
+ public enum WidgetInput : Swift.Sendable {
1180
+ case video(playbackId: Swift.String, origin: ShortKitSDK.ContentOrigin = .other, fallbackUrl: Swift.String? = nil)
1181
+ }
1178
1182
  extension ShortKitSDK.AdQuartile : Swift.Equatable {}
1179
1183
  extension ShortKitSDK.AdQuartile : Swift.Hashable {}
1180
1184
  extension ShortKitSDK.ScrollAxis : Swift.Hashable {}
@@ -10,39 +10,39 @@
10
10
  </data>
11
11
  <key>Info.plist</key>
12
12
  <data>
13
- vTgqqfDJyF8GYp6hOl5ygsKZXpc=
13
+ ojzrG3Ap08GJYamHkQPBUeXk/l0=
14
14
  </data>
15
15
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
16
16
  <data>
17
- 1CWbP83M4niqwACjutv+h5bAQI8=
17
+ 21myiENnbm60Ispq3tQ5ew19FSk=
18
18
  </data>
19
19
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
20
20
  <data>
21
- SY4J8Ap5bvNmlGr2eHB/mIEc9/4=
21
+ zPo7oMw2NLtjLxfYCxXyViI9stM=
22
22
  </data>
23
23
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
24
24
  <data>
25
- Jifa8RGekCm+oLvj1vexV+qHBxg=
25
+ 40YCNN9uv8BRz93OzhGUKoz3RAA=
26
26
  </data>
27
27
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
28
28
  <data>
29
- SY4J8Ap5bvNmlGr2eHB/mIEc9/4=
29
+ zPo7oMw2NLtjLxfYCxXyViI9stM=
30
30
  </data>
31
31
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
32
32
  <data>
33
- 1CWbP83M4niqwACjutv+h5bAQI8=
33
+ 21myiENnbm60Ispq3tQ5ew19FSk=
34
34
  </data>
35
35
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
36
36
  <data>
37
- RSB+lYIOsHV+EHcf6nw6updgwoE=
37
+ vcLubVZzFhhcaxIe+CkCl0boQWs=
38
38
  </data>
39
39
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
40
40
  <data>
41
- 4SaiyfqnnCuP3NHBedJ86U5WUvk=
41
+ /2fiMms53INV4XQrQbZvM6gqOEg=
42
42
  </data>
43
43
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
44
44
  <data>
45
- RSB+lYIOsHV+EHcf6nw6updgwoE=
45
+ vcLubVZzFhhcaxIe+CkCl0boQWs=
46
46
  </data>
47
47
  <key>Modules/module.modulemap</key>
48
48
  <data>
@@ -66,56 +66,56 @@
66
66
  <dict>
67
67
  <key>hash2</key>
68
68
  <data>
69
- 6osxQFoWx1z1shKfM1SJVKzrEMvwpavL4nz8CXhPCf0=
69
+ Dsiu+M+BzZQooc8siWOeQ+tS8azZJ7BfE+71duXglXs=
70
70
  </data>
71
71
  </dict>
72
72
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
73
73
  <dict>
74
74
  <key>hash2</key>
75
75
  <data>
76
- 1/jxH+/lRA97UGj3ZA78cxyVLWeDthh0KFAHyutYAGs=
76
+ FMAJh9SjpqLB6134JfHMNDpUINiMPb9TP4YXvhZEUug=
77
77
  </data>
78
78
  </dict>
79
79
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
80
80
  <dict>
81
81
  <key>hash2</key>
82
82
  <data>
83
- 1ZNQBox7b3AwcLy9/eOdX9J9kLPO6aiDoKklf4b+uDw=
83
+ Cw1QZDVkmMiaSLxpl7OxGadGNlHAFn08jn1ClL2XN6s=
84
84
  </data>
85
85
  </dict>
86
86
  <key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
87
87
  <dict>
88
88
  <key>hash2</key>
89
89
  <data>
90
- 1/jxH+/lRA97UGj3ZA78cxyVLWeDthh0KFAHyutYAGs=
90
+ FMAJh9SjpqLB6134JfHMNDpUINiMPb9TP4YXvhZEUug=
91
91
  </data>
92
92
  </dict>
93
93
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
94
94
  <dict>
95
95
  <key>hash2</key>
96
96
  <data>
97
- 6osxQFoWx1z1shKfM1SJVKzrEMvwpavL4nz8CXhPCf0=
97
+ Dsiu+M+BzZQooc8siWOeQ+tS8azZJ7BfE+71duXglXs=
98
98
  </data>
99
99
  </dict>
100
100
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
101
101
  <dict>
102
102
  <key>hash2</key>
103
103
  <data>
104
- LcZQmnn2zALd1t49D1Ky9DkTE/qLtiA/Y8X7G8X0tpA=
104
+ 2I1oGbLXn9JJAJEdBxgRR/gyfKA2c1l0bFbNOsCRUNY=
105
105
  </data>
106
106
  </dict>
107
107
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
108
108
  <dict>
109
109
  <key>hash2</key>
110
110
  <data>
111
- rFL1rnzbA6I/ynZT99TT87vcqERbX/oj+lvvjIITisM=
111
+ E73Dx8SYkIk9zbpx6V2HLAdRZAIFitk3aKJVzM2p95g=
112
112
  </data>
113
113
  </dict>
114
114
  <key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
115
115
  <dict>
116
116
  <key>hash2</key>
117
117
  <data>
118
- LcZQmnn2zALd1t49D1Ky9DkTE/qLtiA/Y8X7G8X0tpA=
118
+ 2I1oGbLXn9JJAJEdBxgRR/gyfKA2c1l0bFbNOsCRUNY=
119
119
  </data>
120
120
  </dict>
121
121
  <key>Modules/module.modulemap</key>
@@ -6,7 +6,7 @@ import ShortKitSDK
6
6
  ///
7
7
  /// Props (set by RCTViewManager):
8
8
  /// - `config`: JSON string with WidgetConfig values
9
- /// - `items`: JSON string with ContentItem array
9
+ /// - `items`: JSON string with WidgetInput array (compact playback-ID form)
10
10
  @objc public class ShortKitWidgetNativeView: UIView {
11
11
 
12
12
  // MARK: - Props
@@ -29,6 +29,7 @@ import ShortKitSDK
29
29
 
30
30
  private var widgetVC: ShortKitWidgetViewController?
31
31
  private var parsedConfig: WidgetConfig?
32
+ private var parsedItems: [WidgetInput] = []
32
33
 
33
34
  // MARK: - Lifecycle
34
35
 
@@ -60,7 +61,9 @@ import ShortKitSDK
60
61
 
61
62
  let widgetConfig = parsedConfig ?? WidgetConfig()
62
63
 
63
- let vc = ShortKitWidgetViewController(shortKit: sdk, config: widgetConfig)
64
+ // Pass items at construction so the VC never races the server fetch —
65
+ // analogous to the feed's `feedItems` prop wiring.
66
+ let vc = ShortKitWidgetViewController(shortKit: sdk, config: widgetConfig, items: parsedItems)
64
67
  self.widgetVC = vc
65
68
 
66
69
  parentVC.addChild(vc)
@@ -68,11 +71,6 @@ import ShortKitSDK
68
71
  vc.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
69
72
  addSubview(vc.view)
70
73
  vc.didMove(toParent: parentVC)
71
-
72
- // If items were already set, apply them
73
- if let json = items, let contentItems = Self.parseContentItems(json) {
74
- vc.configure(with: contentItems)
75
- }
76
74
  }
77
75
 
78
76
  private func removeWidgetVC() {
@@ -95,8 +93,11 @@ import ShortKitSDK
95
93
  }
96
94
 
97
95
  private func applyItems() {
98
- guard let json = items, let contentItems = Self.parseContentItems(json) else { return }
99
- widgetVC?.configure(with: contentItems)
96
+ parsedItems = items.flatMap { Self.parseWidgetInputs($0) } ?? []
97
+ // Post-mount updates: push items through the public API.
98
+ if let vc = widgetVC {
99
+ vc.configure(with: parsedItems)
100
+ }
100
101
  }
101
102
 
102
103
  // MARK: - Parsing
@@ -140,6 +141,11 @@ import ShortKitSDK
140
141
  return ShortKitBridge.parseFeedFilter(filterStr)
141
142
  }()
142
143
 
144
+ let feedConfig: FeedConfig = {
145
+ guard let feedConfigStr = obj["feedConfig"] as? String else { return FeedConfig() }
146
+ return ShortKitBridge.parseFeedConfig(feedConfigStr)
147
+ }()
148
+
143
149
  return WidgetConfig(
144
150
  cardCount: cardCount,
145
151
  cardSpacing: cardSpacing,
@@ -150,13 +156,28 @@ import ShortKitSDK
150
156
  rotationInterval: rotationInterval / 1000.0, // JS sends ms, iOS expects seconds
151
157
  clickAction: clickAction,
152
158
  cardOverlay: overlayMode,
159
+ feedConfig: feedConfig,
153
160
  filter: filter
154
161
  )
155
162
  }
156
163
 
157
- private static func parseContentItems(_ json: String) -> [ContentItem]? {
158
- guard let data = json.data(using: .utf8) else { return nil }
159
- return try? JSONDecoder().decode([ContentItem].self, from: data)
164
+ /// Parse a JSON array of `WidgetInput` values (compact playback-ID form).
165
+ /// Mirrors the JS `WidgetInput` type: `{ type: 'video'; playbackId: string; origin?: string; fallbackUrl?: string }`.
166
+ private static func parseWidgetInputs(_ json: String) -> [WidgetInput]? {
167
+ guard let data = json.data(using: .utf8),
168
+ let arr = try? JSONSerialization.jsonObject(with: data) as? [[String: Any]] else {
169
+ return nil
170
+ }
171
+ return arr.compactMap { obj -> WidgetInput? in
172
+ guard let type = obj["type"] as? String, type == "video",
173
+ let playbackId = obj["playbackId"] as? String else { return nil }
174
+ let origin: ContentOrigin = {
175
+ guard let s = obj["origin"] as? String else { return .other }
176
+ return s == "ios_upload" ? .iosUpload : .other
177
+ }()
178
+ let fallbackUrl = obj["fallbackUrl"] as? String
179
+ return .video(playbackId: playbackId, origin: origin, fallbackUrl: fallbackUrl)
180
+ }
160
181
  }
161
182
 
162
183
  // MARK: - Helpers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shortkitsdk/react-native",
3
- "version": "0.2.27",
3
+ "version": "0.2.28",
4
4
  "description": "ShortKit React Native SDK — short-form video feed",
5
5
  "react-native": "src/index",
6
6
  "source": "src/index",
@@ -76,6 +76,9 @@ export const ShortKitFeed = forwardRef<ShortKitFeedHandle, ShortKitFeedProps>(
76
76
  applyFilter: (filter: FeedFilter | null) => {
77
77
  NativeShortKitModule?.applyFilter(feedId, filter ? JSON.stringify(filter) : null);
78
78
  },
79
+ refresh: () => {
80
+ NativeShortKitModule?.refresh(feedId);
81
+ },
79
82
  }), [feedId]);
80
83
 
81
84
  // Subscribe to per-feed remaining content count events