@blotoutio/providers-blotout-consent-sdk 1.59.1 → 1.61.0
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 +27 -0
- package/hydrogen.d.ts +20 -0
- package/index.cjs.js +529 -99
- package/index.d.ts +10 -0
- package/index.js +529 -99
- package/index.mjs +529 -99
- package/package.json +18 -2
- package/stores/shopify/hydrogen/index.cjs.js +151 -0
- package/stores/shopify/hydrogen/index.js +154 -0
- package/stores/shopify/hydrogen/index.mjs +149 -0
- package/stores/shopify/index.cjs.js +21 -1
- package/stores/shopify/index.js +21 -1
- package/stores/shopify/index.mjs +21 -1
package/README.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
This library was generated with [Nx](https://nx.dev).
|
|
4
4
|
|
|
5
|
+
## Link-based controls
|
|
6
|
+
|
|
7
|
+
The banner and privacy forms can be opened from plain links — no JavaScript
|
|
8
|
+
required — by pointing an anchor at a reserved URL fragment. This works on any
|
|
9
|
+
platform where you can set a link's URL (Shopify theme, CMS, page builder) and
|
|
10
|
+
coexists with the JavaScript API.
|
|
11
|
+
|
|
12
|
+
| Action | Link |
|
|
13
|
+
| ---------------- | -------------------------------------------------------- |
|
|
14
|
+
| Open the banner | `<a href="#blotout-open-consent">Cookie settings</a>` |
|
|
15
|
+
| Open Do Not Sell | `<a href="#blotout-do-not-sell">Do Not Sell My Info</a>` |
|
|
16
|
+
| Open Delete form | `<a href="#blotout-delete">Delete my data</a>` |
|
|
17
|
+
|
|
18
|
+
Clicking the link sets the fragment, the SDK opens the matching control and then
|
|
19
|
+
clears the fragment from the URL (so clicking the same link again re-opens it).
|
|
20
|
+
Links added after the SDK loads also work, and a page deep-linked to a reserved
|
|
21
|
+
fragment opens the matching control once the SDK is ready. Matching is exact, so
|
|
22
|
+
unrelated fragments such as `#blotout-delete-account` are ignored. The JavaScript
|
|
23
|
+
API (`window[Symbol.for('blotout-consent')].showDnsForm()`, etc.) remains
|
|
24
|
+
available.
|
|
25
|
+
|
|
26
|
+
> **Note:** on pages where the SDK does not initialize — e.g. a domain excluded
|
|
27
|
+
> by the domain filter, inside an iframe, or where the script is blocked — the
|
|
28
|
+
> link is left as an ordinary anchor and does nothing. Because Do Not Sell and
|
|
29
|
+
> Delete are compliance-mandated controls, verify the links actually open on the
|
|
30
|
+
> pages where you place them rather than assuming the markup is enough.
|
|
31
|
+
|
|
5
32
|
## Building
|
|
6
33
|
|
|
7
34
|
Run `nx build providers-blotout-consent-sdk` to build the library.
|
package/hydrogen.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Hand-written type shim for the `/stores/shopify/hydrogen/index.js` subpath
|
|
2
|
+
// export. Mirrors the runtime types in `stores/shopify/hydrogen/bridge.tsx`.
|
|
3
|
+
// Kept in sync by `stores/shopify/hydrogen/types-check.ts`, which fails
|
|
4
|
+
// `nx typecheck` if any drift is introduced.
|
|
5
|
+
//
|
|
6
|
+
// Lives at the top of `src/` (like evo-search's `hooks.d.ts`) so the rollup
|
|
7
|
+
// asset copy lands it flat at the package root, where the subpath export's
|
|
8
|
+
// `types` field points.
|
|
9
|
+
|
|
10
|
+
declare module '@blotoutio/providers-blotout-consent-sdk/stores/shopify/hydrogen/index.js' {
|
|
11
|
+
export type BlotoutHydrogenConsentProps = {
|
|
12
|
+
checkoutDomain: string
|
|
13
|
+
storefrontAccessToken: string
|
|
14
|
+
storefrontRootDomain?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const BlotoutHydrogenConsent: (
|
|
18
|
+
props: BlotoutHydrogenConsentProps
|
|
19
|
+
) => null
|
|
20
|
+
}
|