@webview-native-ui/engine 0.0.0-stage → 0.0.2

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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -2
  3. package/WebViewNativeUIEngine.podspec +17 -0
  4. package/dist/dom/geometry.d.ts +2 -0
  5. package/dist/dom/geometry.js +25 -0
  6. package/dist/dom/overlays.d.ts +42 -0
  7. package/dist/dom/overlays.js +181 -0
  8. package/dist/dom/scroll-bindings.d.ts +11 -0
  9. package/dist/dom/scroll-bindings.js +55 -0
  10. package/dist/dom/scroll-placement.d.ts +5 -0
  11. package/dist/dom/scroll-placement.js +85 -0
  12. package/dist/dom/visibility.d.ts +6 -0
  13. package/dist/dom/visibility.js +29 -0
  14. package/dist/index.d.ts +10 -0
  15. package/dist/index.js +9 -0
  16. package/dist/ionic.d.ts +16 -0
  17. package/dist/ionic.js +31 -0
  18. package/dist/native/bootstrap.d.ts +8 -0
  19. package/dist/native/bootstrap.js +138 -0
  20. package/dist/native/bridge.d.ts +4 -0
  21. package/dist/native/bridge.js +15 -0
  22. package/dist/native/resource-url.d.ts +2 -0
  23. package/dist/native/resource-url.js +11 -0
  24. package/dist/native/session.d.ts +49 -0
  25. package/dist/native/session.js +520 -0
  26. package/dist/projection/events.d.ts +12 -0
  27. package/dist/projection/events.js +44 -0
  28. package/dist/projection/placement.d.ts +14 -0
  29. package/dist/projection/placement.js +18 -0
  30. package/dist/projection/scope.d.ts +6 -0
  31. package/dist/projection/scope.js +8 -0
  32. package/dist/projection/styles.d.ts +2 -0
  33. package/dist/projection/styles.js +14 -0
  34. package/dist/projection/web.d.ts +52 -0
  35. package/dist/projection/web.js +838 -0
  36. package/dist/types.d.ts +88 -0
  37. package/dist/types.js +1 -0
  38. package/docs/assets/hero.png +0 -0
  39. package/docs/capacitor-plugin.md +279 -0
  40. package/docs/cordova-plugin.md +198 -0
  41. package/docs/cordova.md +3 -0
  42. package/docs/maintenance.md +52 -0
  43. package/docs/projection.md +340 -0
  44. package/ios/Sources/WebViewNativeUIEngine/ClippedView.swift +16 -0
  45. package/ios/Sources/WebViewNativeUIEngine/CoveredSnapshots.swift +256 -0
  46. package/ios/Sources/WebViewNativeUIEngine/Frame.swift +15 -0
  47. package/ios/Sources/WebViewNativeUIEngine/NativeUIProjection.swift +314 -0
  48. package/ios/Sources/WebViewNativeUIEngine/Resources/native-ui-engine.js +14 -0
  49. package/ios/Sources/WebViewNativeUIEngine/ScrollBindings.swift +27 -0
  50. package/ios/Sources/WebViewNativeUIEngine/ScrollTracker.swift +117 -0
  51. package/package.json +63 -4
@@ -0,0 +1,52 @@
1
+ import type { WebProjectionSource, ScopedWebProjectionSource as Candidate, WebProjectionTransport } from '../types.js';
2
+ import type { WebProjectionScope } from './scope.js';
3
+ import { type ProjectionEvents } from './events.js';
4
+ export interface WebProjectionOptions {
5
+ /** Existing plugin notifications, scoped to this presentation surface. */
6
+ events?: ProjectionEvents;
7
+ /** Debounce before preparing replacement pixels, in milliseconds. Defaults to 50; never delays handoff. */
8
+ captureDelayMs?: number;
9
+ wake(): void;
10
+ blocked(): boolean;
11
+ revision?(): number;
12
+ /** Content version for native pixel reuse; layout revision remains independent. */
13
+ captureRevision?(): number;
14
+ /** Select this surface's sources, e.g. the underlying page or the active overlay. */
15
+ eligible?(source: Candidate): boolean;
16
+ /** Reject a cached image when its owning surface has changed. */
17
+ current?(sources: HTMLElement[]): boolean;
18
+ /** Temporary movement handoff: rebase return pixels to the current display DOM. */
19
+ transient?: boolean;
20
+ /** Opaque full-view pixels map to the host border box and may paint beneath native. */
21
+ opaqueUnderlay?: boolean;
22
+ }
23
+ /** Images are prepared after accepted native updates, never on the overlay's critical path. */
24
+ declare const createProjectionEngine: (scope: WebProjectionScope, transport: WebProjectionTransport, callbacks: WebProjectionOptions) => Promise<{
25
+ readonly owners: readonly HTMLElement[];
26
+ readonly visibleOwners: readonly HTMLElement[];
27
+ readonly preparedOwners: readonly HTMLElement[];
28
+ consider: (revision: number, candidates: Candidate[]) => void;
29
+ changed: (scrollOwner?: EventTarget) => void;
30
+ moved: () => void;
31
+ readonly token: string | undefined;
32
+ begin: () => void;
33
+ readonly restoring: boolean;
34
+ readonly handoffPending: boolean;
35
+ retireRestoration: () => void;
36
+ end: () => void;
37
+ updated: (token: string | undefined, restoredIDs?: string[], revision?: number) => void;
38
+ invalidate: () => void;
39
+ destroy(): Promise<void>;
40
+ }>;
41
+ type Engine = Awaited<ReturnType<typeof createProjectionEngine>>;
42
+ export type WebProjection = Omit<Engine, 'consider'> & {
43
+ consider(revision: number, sources: WebProjectionSource[]): void;
44
+ };
45
+ export type WebProjectionBatch = Omit<Engine, 'consider'> & {
46
+ consider(revision: number, sources: Candidate[]): void;
47
+ };
48
+ /** One existing fallback DOM, with no separate document or rendering destination. */
49
+ export declare const createWebProjection: (scope: WebProjectionScope, transport: WebProjectionTransport, options: WebProjectionOptions) => Promise<WebProjection>;
50
+ /** A single Native transaction for multiple fixed fallback DOMs. */
51
+ export declare const createWebProjectionBatch: (transport: WebProjectionTransport, options: WebProjectionOptions) => Promise<WebProjectionBatch>;
52
+ export {};