@geophrase/core 1.3.6 → 1.3.8
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/README.md +4 -4
- package/package.json +2 -2
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The core vanilla JavaScript library for Geophrase Connect. Drop the Geophrase address selector into any web checkout in minutes and capture perfectly structured Indian addresses and coordinates to reduce Return to Origin (RTO) costs.
|
|
4
4
|
|
|
5
|
-
👉 **[Full documentation and integration guide](https://
|
|
5
|
+
👉 **[Full documentation and integration guide](https://geophrase.com/docs/vanilla-js)**
|
|
6
6
|
|
|
7
7
|
*Building a React or Next.js app? Use [`@geophrase/react`](https://www.npmjs.com/package/@geophrase/react) instead. It wraps this core library in native hooks.*
|
|
8
8
|
|
|
@@ -59,7 +59,7 @@ The SDK supports two modes. Pick whichever fits your architecture:
|
|
|
59
59
|
|
|
60
60
|
- **`client`**: the widget resolves the address in the browser and passes it straight to `onSuccess`. Requires `key` in the SDK options.
|
|
61
61
|
|
|
62
|
-
> Both modes require a Geophrase API key. See [creating and securing an API key](https://
|
|
62
|
+
> Both modes require a Geophrase API key. See [creating and securing an API key](https://geophrase.com/docs/api-keys).
|
|
63
63
|
>
|
|
64
64
|
> If your app has a backend, `server` mode keeps your API key entirely off the frontend, which is the most secure option. If you don't have a backend (or want the fastest possible integration), `client` mode with a domain-restricted key is fine.
|
|
65
65
|
|
|
@@ -77,7 +77,7 @@ const geo = new Geophrase({
|
|
|
77
77
|
| Parameter | Type | Required | Description |
|
|
78
78
|
| :---------- | :--------- | :-------------- | :----------------------------------------------------------- |
|
|
79
79
|
| `mode` | `string` | Optional | `'client'` (default) or `'server'`. Determines the architectural flow of the SDK. |
|
|
80
|
-
| `key` | `string` | **Conditional** | Your [Geophrase API key](https://
|
|
80
|
+
| `key` | `string` | **Conditional** | Your [Geophrase API key](https://geophrase.com/docs/api-keys). **Required if `mode` is `'client'`.** Omit if using server mode. |
|
|
81
81
|
| `theme` | `string` | Optional | `'light'`, `'dark'`, or `'system'`. Defaults to `'system'`. |
|
|
82
82
|
| `orderId` | `string` | Optional | Your internal reference ID for this checkout session. |
|
|
83
83
|
| `phone` | `string` | Optional | The customer's 10-digit phone number (pre-fills the widget). |
|
|
@@ -97,4 +97,4 @@ The underlying `Geophrase` instance is created on mount and destroyed on unmount
|
|
|
97
97
|
|
|
98
98
|
TypeScript definitions (`GeophraseOptions`, `GeophraseAddress`, `GeophraseToken`, `GeophraseError`) ship with the package.
|
|
99
99
|
|
|
100
|
-
See the [full docs](https://
|
|
100
|
+
See the [full docs](https://geophrase.com/docs/vanilla-js) for the complete configuration reference, security guidance, and response schemas.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geophrase/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Drop-in address picker widget for Indian e-commerce checkouts. Captures structured addresses with coordinates to reduce RTO.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Geophrase",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://geophrase.com/docs",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/geophrase/geophrase-js.git"
|
package/src/index.js
CHANGED
|
@@ -95,7 +95,7 @@ class Geophrase {
|
|
|
95
95
|
style.id = this.styleId;
|
|
96
96
|
style.innerHTML = `
|
|
97
97
|
#${this.overlayId} {
|
|
98
|
-
position: fixed;
|
|
98
|
+
position: fixed; inset: 0; width: 100dvw; height: 100dvh;
|
|
99
99
|
background-color: rgba(0, 0, 0, 0.6); z-index: 999999;
|
|
100
100
|
display: flex; justify-content: center; align-items: center;
|
|
101
101
|
opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
|