@dotcms/experiments 0.0.1-beta.9 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/experiments",
3
- "version": "0.0.1-beta.9",
3
+ "version": "1.0.0",
4
4
  "description": "Official JavaScript library to use Experiments with DotCMS.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,9 +25,10 @@
25
25
  "peerDependencies": {
26
26
  "react": ">=18",
27
27
  "react-dom": ">=18",
28
- "@dotcms/client": "0.0.1-beta.9",
29
- "@dotcms/react": "0.0.1-beta.9",
30
- "@dotcms/uve": "0.0.1-beta.9"
28
+ "@dotcms/client": "^1.0.0",
29
+ "@dotcms/react": "^1.0.0",
30
+ "@dotcms/uve": "^1.0.0",
31
+ "@dotcms/types": "^1.0.0"
31
32
  },
32
33
  "module": "./index.esm.js",
33
34
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { DotcmsPageProps } from '@dotcms/react';
3
- interface ExperimentHandlingProps extends DotcmsPageProps {
4
- WrappedComponent: React.ComponentType<DotcmsPageProps>;
2
+ import { DotCMSLayoutBodyProps } from '@dotcms/react';
3
+ interface ExperimentHandlingProps extends DotCMSLayoutBodyProps {
4
+ WrappedComponent: React.ComponentType<DotCMSLayoutBodyProps>;
5
5
  }
6
6
  /**
7
7
  * A React functional component that conditionally renders a WrappedComponent based on the
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { DotcmsPageProps } from '@dotcms/react';
2
+ import { DotCMSLayoutBodyProps } from '@dotcms/react';
3
3
  import { DotExperimentConfig } from '../shared/models';
4
4
  export interface PageProviderProps {
5
5
  readonly entity: any;
@@ -17,4 +17,4 @@ export interface PageProviderProps {
17
17
  * @returns {React.FunctionComponent<DotcmsPageProps>} A component that wraps the original component,
18
18
  * adding experiment handling based on the specified configuration.
19
19
  */
20
- export declare const withExperiments: (WrappedComponent: React.ComponentType<DotcmsPageProps>, config: DotExperimentConfig) => (props: DotcmsPageProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const withExperiments: (WrappedComponent: React.ComponentType<DotCMSLayoutBodyProps>, config: DotExperimentConfig) => (props: DotCMSLayoutBodyProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { DotCMSPageAsset } from '@dotcms/types';
1
2
  /**
2
3
  * A React Hook that determines whether to wait for the correct variant in an A/B testing scenario.
3
4
  * This is used to avoid flickering - showing the original content before redirecting to the assigned variant.
@@ -11,11 +12,6 @@
11
12
  * @param {Object} data - An object containing the runningExperimentId and viewAs (containing variantId).
12
13
  * @returns {Object} An object with a function `shouldWaitForVariant` that, when called, returns `true` if it should wait for the correct variant, `false` otherwise.
13
14
  */
14
- export declare const useExperimentVariant: (data: {
15
- runningExperimentId?: string;
16
- viewAs: {
17
- variantId: string;
18
- };
19
- }) => {
15
+ export declare const useExperimentVariant: (data: DotCMSPageAsset) => {
20
16
  shouldWaitForVariant: boolean;
21
17
  };