@webview-native-ui/engine 0.0.2 → 0.0.3

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.
@@ -25,13 +25,13 @@ xcodebuild -scheme WebViewNativeUIEngine -destination 'platform=iOS Simulator,id
25
25
 
26
26
  Lint combines strict TypeScript checking, the standard ESLint/TypeScript recommended rules, and typed Promise checks for `src`. Scripts and tests receive syntax-level linting; Prettier owns formatting. `npm run format` applies formatting only. Bridge payloads and test doubles may use explicit `any`; production boundary validation remains necessary. An explicit `void` marks background work, but does not handle a rejected Promise. Android uses `lintRelease` with warnings treated as errors in CI; Swift is compiled and tested on an iOS simulator.
27
27
 
28
- The engine is versioned independently of its consumers. Publish order is the native Maven artifact → npm engine; consumers upgrade separately. npm releases verify that the matching POM and AAR exist on Maven Central before publication. No publication is performed by build or test commands. Tests cover plain DOM, fractional/RTL geometry, stale ACKs, image ownership and native WKWebView scroll tracking; consumer tests remain responsible for Ionic/SDK integration.
28
+ The engine is versioned independently of its consumers. Publish order is Maven publication acceptance → npm engine; consumers upgrade separately. npm releases require a successful Maven publication workflow for the exact tagged commit. Maven Central distribution may still be pending: Android consumers must wait until the matching POM and AAR are downloadable, while iOS and Web consumers can upgrade immediately. No publication is performed by build or test commands. Tests cover plain DOM, fractional/RTL geometry, stale ACKs, image ownership and native WKWebView scroll tracking; consumer tests remain responsible for Ionic/SDK integration.
29
29
 
30
30
  CI-only setup, packaging commands and GitHub outputs are defined in `.github/workflows/`. Scripts retain the runtime build, reusable consumer/package verification, and tested publication logic (Central state handling and npm artifact comparison).
31
31
 
32
32
  ## Maven publication
33
33
 
34
- The `Native UI Engine Maven Release` workflow is manually dispatched on `main` with the exact engine package version. That commit must first pass `Native UI Engine` CI. It signs an AAR, source archive, generated Kotlin API documentation and Maven metadata, uploads once, and completes when Central reports `PUBLISHING` or `PUBLISHED`. The deployment ID and state changes are recorded in the run summary. `PUBLISHING` means validation passed and Central accepted publication; it does not guarantee that artifacts can already be downloaded. This workflow does not wait for distribution. The npm release still requires the matching POM and AAR to be available on Maven Central. Existing coordinates are never overwritten; if an upload times out, inspect the recorded deployment in Central before taking further action.
34
+ The `Native UI Engine Maven Release` workflow is manually dispatched on `main` with the exact engine package version. That commit must first pass `Native UI Engine` CI. It signs an AAR, source archive, generated Kotlin API documentation and Maven metadata, uploads once, and completes when Central reports `PUBLISHING` or `PUBLISHED`. The deployment ID and state changes are recorded in the run summary. `PUBLISHING` means validation passed and Central accepted publication; it does not guarantee that artifacts can already be downloaded. This workflow does not wait for distribution. The npm release checks that this workflow succeeded for the exact release commit; it does not wait for Maven Central distribution. Existing coordinates are never overwritten; if an upload times out, inspect the recorded deployment in Central before taking further action.
35
35
 
36
36
  Configure the repository's Actions secrets with `CENTRAL_USERNAME`, `CENTRAL_PASSWORD` (a Central user token), `MAVEN_SIGNING_KEY` (ASCII-armored private key) and `MAVEN_SIGNING_PASSWORD`. The signing public key must be available to Central. GitHub secrets are scoped to this repository.
37
37
 
@@ -43,9 +43,9 @@ This repository starts from the merged Engine implementation at [ionic-theme-ios
43
43
 
44
44
  The npm organization `webview-native-ui` and Maven Central namespace `io.github.webview-native-ui` are registered. Maintain npm trusted publishing for `webview-native-ui/engine`, workflow `release.yml`, and provision the Maven secrets above in this repository. Credentials are not copied by moving source files.
45
45
 
46
- 1. Prepare the next version and release notes on `main`; use `npm run release` to create a standard `vX.Y.Z` tag/GitHub release. Keep the GitHub release as a draft until Maven is downloadable.
46
+ 1. Prepare the next version and release notes on `main`; use `npm run release` to create a standard `vX.Y.Z` tag/GitHub release. Keep the GitHub release as a draft until the Maven publication workflow succeeds.
47
47
  2. After that main commit passes CI, dispatch `native-ui-engine-release.yml` with the exact package version.
48
- 3. Central `PUBLISHING` is an accepted upload, not download readiness. Once the POM and AAR are available, publish the prepared GitHub release. `release.yml` verifies the tag, package version, CI and Maven artifacts before npm publication (`next` for prereleases, `latest` otherwise).
48
+ 3. Central `PUBLISHING` is an accepted upload, not download readiness. Once the Maven publication workflow succeeds, publish the prepared GitHub release. Note any pending Android artifact distribution in the release notes. `release.yml` verifies the tag, package version, CI and Maven publication acceptance before npm publication (`next` for prereleases, `latest` otherwise).
49
49
 
50
50
  No build or test command publishes a package. Existing npm/Maven versions are never overwritten.
51
51
 
@@ -244,7 +244,7 @@ The image transport accepts `WebProjectionRequest` and returns prepared token/pa
244
244
  | `release` | Release the named token, files and associated temporary views. |
245
245
  | `reset` | Owner teardown only; release all native capture resources. |
246
246
 
247
- Use `NativeUICoveredSnapshots.observe` to notify the JS listener when interaction starts/ends. Captures use composited pixels so blur/refraction is preserved; they include the background under the clipped native component. Cache validity therefore includes layout and the plugin's visual-change notifications. The engine does not capture continuously or guarantee every possible renderer can be captured.
247
+ Use `NativeUICoveredSnapshots.observe` to notify the JS listener when interaction starts/ends. On iOS, captures rasterize the visible window with `drawHierarchy(in:afterScreenUpdates:)`, including the background under the clipped native component. Screen snapshot views are display replicas and are not used as bitmap sources. UIKit rasterization can differ from the live compositor for materials such as Liquid Glass; validate the appearance on physical devices with the backgrounds your plugin supports. Cache validity therefore includes layout and the plugin's visual-change notifications. The engine does not capture continuously or guarantee every possible renderer can be captured.
248
248
 
249
249
  ### Temporary storage and application permissions
250
250
 
@@ -14,13 +14,7 @@ public final class NativeUICoveredSnapshots {
14
14
  let webFrame: CGRect
15
15
  let parts: [Part]
16
16
  }
17
- private let snapshotView: (UIWindow) -> UIView
18
- public convenience init() {
19
- self.init(snapshotView: { $0.screen.snapshotView(afterScreenUpdates: false) })
20
- }
21
- init(snapshotView: @escaping (UIWindow) -> UIView) {
22
- self.snapshotView = snapshotView
23
- }
17
+ public init() {}
24
18
  private var captures: [String: Capture] = [:]
25
19
  private var restoration: (token: String, views: [UIImageView], entry: Bool)?
26
20
  private var hiddenControls: (token: String, restore: [() -> Void])?
@@ -89,15 +83,13 @@ public final class NativeUICoveredSnapshots {
89
83
  let format = UIGraphicsImageRendererFormat()
90
84
  format.scale = scale
91
85
  format.opaque = true
92
- // Render the compositor's frozen screen, not UIKit's reconstruction of
93
- // the hierarchy: the latter loses Liquid Glass background refraction.
94
- // The replica remains detached and never changes visible UI or input.
95
- let replica = snapshotView(window)
96
- let screenBounds = window.convert(bounds, to: window.screen.coordinateSpace)
86
+ // Rasterize the visible window directly. A screen snapshot is a display
87
+ // replica, not a bitmap source; drawing that replica can succeed with
88
+ // black pixels on physical devices.
97
89
  var drawn = false
98
90
  let image = UIGraphicsImageRenderer(size: bounds.size, format: format).image { context in
99
- context.cgContext.translateBy(x: -screenBounds.minX, y: -screenBounds.minY)
100
- drawn = replica.drawHierarchy(in: window.screen.bounds, afterScreenUpdates: true)
91
+ context.cgContext.translateBy(x: -bounds.minX, y: -bounds.minY)
92
+ drawn = window.drawHierarchy(in: window.bounds, afterScreenUpdates: true)
101
93
  }
102
94
  guard drawn, let pixels = image.cgImage else { complete([:]); return }
103
95
  let token = UUID().uuidString
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webview-native-ui/engine",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Native UI placement, scroll tracking, and Web projection for Capacitor and Cordova plugin maintainers.",
5
5
  "type": "module",
6
6
  "license": "MIT",