Skip to content

Commit 3e843d9

Browse files
committed
Update README packages and architecture sections
Add links to package directories, use consistent @snapfill/ naming, and expand architecture tree to cover all four packages.
1 parent 2d23e6d commit 3e843d9

1 file changed

Lines changed: 33 additions & 22 deletions

File tree

README.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ Uses native property setters to bypass React/Vue/Angular framework interceptors.
8989

9090
| Package | Description | Platform |
9191
|---------|-------------|----------|
92-
| `@snapfill/core` | Core detection + filling engine | Any JS runtime |
93-
| `@snapfill/react-native` | React Native WebView adapter (hook + component) | React Native |
94-
| `packages/android` | Kotlin library for Android `WebView` | Android 7.0+ |
95-
| `packages/ios` | Swift Package for `WKWebView` | iOS 15+ |
92+
| [`@snapfill/core`](packages/core) | Core detection + filling engine | Any JS runtime |
93+
| [`@snapfill/react-native`](packages/react-native) | React Native WebView adapter (hook + component) | React Native |
94+
| [`@snapfill/android`](packages/android) | Kotlin library for Android `WebView` | Android 7.0+ |
95+
| [`@snapfill/ios`](packages/ios) | Swift package for `WKWebView` | iOS 15+ |
9696

9797
## Platform Guides
9898

@@ -117,23 +117,34 @@ The Android and iOS libraries load the same injectable scripts from `@snapfill/c
117117
## Architecture
118118

119119
```
120-
@snapfill/core
121-
├── detectors/
122-
│ ├── formDetector # Field detection + classification
123-
│ ├── cartDetector # Shopping cart extraction
124-
│ └── valueCapture # Form value monitoring
125-
├── fillers/
126-
│ └── formFiller # Field filling with native setters
127-
├── injectable # WebView-injectable script strings
128-
├── constants # Regex patterns, autocomplete maps
129-
└── types # TypeScript type definitions
130-
131-
packages/android # Kotlin library — Snapfill, SnapfillWebView, SnapfillListener
132-
packages/ios # Swift Package — Snapfill, SnapfillWebView, SnapfillDelegate
120+
packages/
121+
├── core/src/ # @snapfill/core — JS engine
122+
│ ├── detectors/
123+
│ │ ├── formDetector # Field detection + classification
124+
│ │ ├── cartDetector # Shopping cart extraction
125+
│ │ └── valueCapture # Form value monitoring
126+
│ ├── fillers/
127+
│ │ └── formFiller # Field filling with native setters
128+
│ ├── injectable # WebView-injectable script strings
129+
│ ├── constants # Regex patterns, autocomplete maps
130+
│ └── types # TypeScript type definitions
131+
132+
├── react-native/src/ # @snapfill/react-native — RN adapter
133+
│ ├── useSnapfill # Hook for WebView script injection + messaging
134+
│ ├── SnapfillWebView # Pre-wired WebView component
135+
│ └── parseMessage # Message type parser
136+
137+
├── android/src/ # @snapfill/android — Kotlin library
138+
│ ├── Snapfill # Script injection + message bridge
139+
│ ├── SnapfillWebView # Pre-wired Android WebView
140+
│ ├── SnapfillListener # Callback interface
141+
│ └── SnapfillModels # Data classes
142+
143+
└── ios/Sources/Snapfill/ # @snapfill/ios — Swift package
144+
├── Snapfill # Script injection + message bridge
145+
├── SnapfillWebView # Pre-wired WKWebView
146+
├── SnapfillDelegate # Delegate protocol
147+
└── SnapfillModels # Data structs
133148
```
134149

135-
Each module exports both:
136-
- **Functions** for direct use in web context (tree-shakeable)
137-
- **Script strings** (via `injectable.ts`) for WebView injection
138-
139-
Native libraries use the script strings, injecting them via platform-specific WebView APIs (`evaluateJavascript` on Android, `WKUserScript` on iOS). A bridge shim creates `window.ReactNativeWebView.postMessage()` so the same scripts work across all platforms.
150+
Core exports both **functions** for direct web use (tree-shakeable) and **script strings** (via `injectable.ts`) for WebView injection. Native libraries inject the same scripts via platform-specific WebView APIs (`evaluateJavascript` on Android, `WKUserScript` on iOS). A bridge shim provides `window.ReactNativeWebView.postMessage()` so the same scripts work across all platforms.

0 commit comments

Comments
 (0)