@capgo/capacitor-widget-kit 8.1.9 → 8.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Package.swift CHANGED
@@ -7,22 +7,37 @@ let package = Package(
7
7
  products: [
8
8
  .library(
9
9
  name: "CapgoCapacitorWidgetKit",
10
- targets: ["CapgoWidgetKitPlugin"])
10
+ targets: ["CapgoWidgetKitPlugin"]
11
+ ),
12
+ .library(
13
+ name: "CapgoWidgetKitShared",
14
+ targets: ["CapgoWidgetKitShared"]
15
+ )
11
16
  ],
12
17
  dependencies: [
13
18
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
14
19
  ],
15
20
  targets: [
21
+ .target(
22
+ name: "CapgoWidgetKitShared",
23
+ dependencies: [],
24
+ path: "ios/Sources/CapgoWidgetKitPlugin",
25
+ exclude: ["CapgoWidgetKitPlugin.swift"]
26
+ ),
16
27
  .target(
17
28
  name: "CapgoWidgetKitPlugin",
18
29
  dependencies: [
30
+ "CapgoWidgetKitShared",
19
31
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
32
  .product(name: "Cordova", package: "capacitor-swift-pm")
21
33
  ],
22
- path: "ios/Sources/CapgoWidgetKitPlugin"),
34
+ path: "ios/Sources/CapgoWidgetKitPlugin",
35
+ sources: ["CapgoWidgetKitPlugin.swift"]
36
+ ),
23
37
  .testTarget(
24
38
  name: "CapgoWidgetKitPluginTests",
25
- dependencies: ["CapgoWidgetKitPlugin"],
26
- path: "ios/Tests/CapgoWidgetKitPluginTests")
39
+ dependencies: ["CapgoWidgetKitShared"],
40
+ path: "ios/Tests/CapgoWidgetKitPluginTests"
41
+ )
27
42
  ]
28
43
  )
package/README.md CHANGED
@@ -1,16 +1,45 @@
1
1
  # @capgo/capacitor-widget-kit
2
- <a href="https://capgo.app/"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-widget-kit" alt="Capgo - Instant updates for Capacitor" /></a>
3
2
 
4
- <div align="center">
5
- <h2><a href="https://capgo.app/?ref=plugin_widget_kit"> ➡️ Get Instant updates for your App with Capgo</a></h2>
6
- <h2><a href="https://capgo.app/consulting/?ref=plugin_widget_kit"> Missing a feature? We’ll build the plugin for you 💪</a></h2>
7
- </div>
3
+ Build iOS Home Screen widgets, Lock Screen Live Activities and Android widgets from your Capacitor app, with SVG templates or fully native widget code.
8
4
 
9
- Create Home Screen WidgetKit, ActivityKit, and Android widget experiences from Capacitor without forcing one rendering model.
5
+ <a href="https://capgo.app/?ref=plugin_widget_kit"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-widget-kit" alt="Capgo - Instant updates for Capacitor" /></a>
10
6
 
11
- ## Demo
7
+ <div align="center">
8
+ <p><b>Capgo</b>: open-source live updates for Ionic and Capacitor apps. Ship OTA fixes and features instantly, without waiting for app store review.</p>
9
+ <h2><a href="https://capgo.app/register/?ref=plugin_widget_kit">➡️ Get started for free</a></h2>
10
+ <p>14-day unlimited free trial. No credit card required</p>
11
+ <p><a href="https://capgo.app/consulting/?ref=plugin_widget_kit">Missing a feature? We'll build the plugin for you 💪</a></p>
12
+ </div>
12
13
 
13
- <img src="./docs/demo.webp" alt="Demo of capacitor-widget-kit in action" width="300" />
14
+ <p align="center">
15
+ <img src="./.github/assets/readme-demo.webp" alt="Demo of capacitor-widget-kit showing a Lock Screen Live Activity" width="300" />
16
+ </p>
17
+
18
+ ## Key features
19
+
20
+ - **SVG template widgets**: `startTemplateWidget()` and `startTemplateActivity()` store layouts for the Home Screen, Lock Screen, Dynamic Island and Android.
21
+ - **Updates and actions**: `updateTemplateActivity()`, `endTemplateActivity()` and `performTemplateAction()` with declarative state patches and timers.
22
+ - **Interaction events**: `listTemplateEvents()` and `acknowledgeTemplateEvents()` process widget taps in your app.
23
+ - **Native widget sessions**: `startWidgetSession()`, `updateWidgetSession()` and `sendWidgetMessage()` share JSON state with Swift or Kotlin widget code.
24
+ - **Shared storage**: data lives in your App Group on iOS so widgets and the app stay in sync.
25
+ - **Platforms**: iOS, Android and Web. Live Activities need ActivityKit on iOS. Web stores state in `localStorage` for development.
26
+
27
+ ## Widget Screenshots
28
+
29
+ <table>
30
+ <tr>
31
+ <td align="center">
32
+ <img src="./docs/screenshots/lock-screen-live-activity.webp" alt="iOS Lock Screen Live Activity widget screenshot" width="260" />
33
+ <br />
34
+ <sub>iOS Lock Screen / Live Activity</sub>
35
+ </td>
36
+ <td align="center">
37
+ <img src="./docs/screenshots/dynamic-island-widget.webp" alt="iOS Dynamic Island widget screenshot" width="260" />
38
+ <br />
39
+ <sub>iOS Dynamic Island</sub>
40
+ </td>
41
+ </tr>
42
+ </table>
14
43
 
15
44
  The plugin has two implementation paths:
16
45
 
@@ -74,7 +103,7 @@ In your iOS widget extension bundle:
74
103
  import ActivityKit
75
104
  import SwiftUI
76
105
  import WidgetKit
77
- import CapgoWidgetKitPlugin
106
+ import CapgoWidgetKitShared
78
107
 
79
108
  @main
80
109
  struct ExampleWidgetBundle: WidgetBundle {
@@ -3,11 +3,11 @@ import Foundation
3
3
  import WidgetKit
4
4
  #endif
5
5
 
6
- enum CapgoWidgetKitBridgeError: LocalizedError {
6
+ public enum CapgoWidgetKitBridgeError: LocalizedError {
7
7
  case missingObject(String)
8
8
  case invalidObject(String)
9
9
 
10
- var errorDescription: String? {
10
+ public var errorDescription: String? {
11
11
  switch self {
12
12
  case .missingObject(let name):
13
13
  return "The `\(name)` object is required."
@@ -1,4 +1,5 @@
1
1
  import Capacitor
2
+ import CapgoWidgetKitShared
2
3
  import Foundation
3
4
 
4
5
  @objc(CapgoWidgetKitPlugin)
@@ -1,6 +1,6 @@
1
1
  // swiftlint:disable function_body_length
2
2
  import XCTest
3
- @testable import CapgoWidgetKitPlugin
3
+ @testable import CapgoWidgetKitShared
4
4
 
5
5
  final class CapgoWidgetKitPluginTests: XCTestCase {
6
6
  func testResolveSvgInterpolatesStateTimerAndMetaScope() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-widget-kit",
3
- "version": "8.1.9",
3
+ "version": "8.1.11",
4
4
  "private": false,
5
5
  "description": "Capacitor plugin for generic iOS Home Screen widgets, WidgetKit, and Live Activities using SVG templates, declarative actions, and shared App Group persistence.",
6
6
  "main": "dist/plugin.cjs.js",
@@ -54,8 +54,10 @@
54
54
  "watch": "tsc --watch",
55
55
  "prepublishOnly": "bun run build",
56
56
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
57
+ "check:cap9-deprecated": "bun scripts/check-cap9-deprecated.mjs",
57
58
  "example:install": "cd example-app && bun install --frozen-lockfile",
58
- "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
59
+ "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
60
+ "changelog:ai": "node scripts/generate-ai-changelog.mjs"
59
61
  },
60
62
  "devDependencies": {
61
63
  "@capacitor/android": "^8.0.0",