@finsweet/webflow-apps-utils 1.0.41 → 1.0.42

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.
@@ -64,7 +64,11 @@ export interface Webflow extends Pick<WebflowCallback[], 'push'> {
64
64
  destroy: () => void;
65
65
  ready: () => void;
66
66
  env: () => boolean;
67
- analytics: {
67
+ require: <Key extends WebflowModule>(key: Key) => (Key extends 'commerce' ? WebflowCommerce : Key extends 'lightbox' ? WebflowLightbox : Key extends 'slider' ? WebflowSlider : Key extends 'tabs' ? WebflowTabs : WebflowIx2) | undefined;
68
+ /**
69
+ * @deprecated - Legacy API, use `window.wf` instead
70
+ */
71
+ analytics?: {
68
72
  optIn: ({ reload }: {
69
73
  reload?: boolean;
70
74
  }) => void;
@@ -73,7 +77,31 @@ export interface Webflow extends Pick<WebflowCallback[], 'push'> {
73
77
  }) => void;
74
78
  getIsOptedOut: () => 'true' | null;
75
79
  };
76
- require: <Key extends WebflowModule>(key: Key) => (Key extends 'commerce' ? WebflowCommerce : Key extends 'lightbox' ? WebflowLightbox : Key extends 'slider' ? WebflowSlider : Key extends 'tabs' ? WebflowTabs : WebflowIx2) | undefined;
80
+ }
81
+ /**
82
+ * Includes methods of the wf object
83
+ */
84
+ export interface WF {
85
+ ready: (callback?: () => void) => void;
86
+ /**
87
+ * Enables user tracking for the current user.
88
+ * @param options
89
+ */
90
+ allowUserTracking?: (options?: {
91
+ reload?: boolean;
92
+ activate?: boolean;
93
+ }) => void;
94
+ /**
95
+ * Disables user tracking for the current user.
96
+ * @param options
97
+ */
98
+ denyUserTracking?: (options?: {
99
+ reload?: boolean;
100
+ }) => void;
101
+ /**
102
+ * Retrieves the user’s current tracking preference.
103
+ */
104
+ getUserTrackingChoice?: () => 'allow' | 'deny' | 'none';
77
105
  }
78
106
  export type XSCPMetadata = {
79
107
  meta: {
@@ -1,4 +1,4 @@
1
- import type { Webflow, WebflowCallback } from './webflow';
1
+ import type { Webflow, WebflowCallback, WF } from './webflow';
2
2
  /**
3
3
  * Window object.
4
4
  */
@@ -9,6 +9,7 @@ declare global {
9
9
  event: string;
10
10
  } | IArguments>;
11
11
  Webflow?: Webflow | WebflowCallback[];
12
+ wf?: WF;
12
13
  isLoadingCustomCodeConfigs: boolean;
13
14
  }
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finsweet/webflow-apps-utils",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "Shared utilities for Webflow apps",
5
5
  "homepage": "https://github.com/finsweet/webflow-apps-utils",
6
6
  "repository": {