@contentful/experiences-sdk-react 1.0.4-dev-20240412T1127-32f6129.0 → 1.0.5-beta.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.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- import { VisualEditorMode } from '@contentful/experiences-core';
2
+ import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
3
+ import type { Experience } from '@contentful/experiences-core/types';
3
4
  type VisualEditorLoaderProps = {
4
5
  visualEditorMode: VisualEditorMode;
6
+ experience?: Experience<EntityStore>;
5
7
  };
6
8
  export declare const VisualEditorLoader: React.FC<VisualEditorLoaderProps>;
7
9
  export default VisualEditorLoader;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
3
+ import type { Experience } from '@contentful/experiences-core/types';
3
4
  type VisualEditorRootProps = {
4
5
  visualEditorMode: VisualEditorMode;
5
- initialEntities: EntityStore['entities'];
6
+ experience?: Experience<EntityStore>;
6
7
  initialLocale: string;
7
8
  };
8
9
  export declare const VisualEditorRoot: React.FC<VisualEditorRootProps>;
@@ -4,7 +4,8 @@ type CompositionBlockProps = {
4
4
  node: ComponentTreeNode;
5
5
  locale: string;
6
6
  entityStore: EntityStore;
7
+ hyperlinkPattern?: string | undefined;
7
8
  resolveDesignValue: ResolveDesignValueType;
8
9
  };
9
- export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, resolveDesignValue, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
10
11
  export {};
@@ -4,10 +4,14 @@ export type UseFetchByIdArgs = {
4
4
  id: string;
5
5
  experienceTypeId: string;
6
6
  localeCode: string;
7
+ hyperlinkPattern?: string;
7
8
  };
8
- export declare const useFetchById: ({ id, localeCode, client, experienceTypeId }: UseFetchByIdArgs) => {
9
+ export declare const useFetchById: ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchByIdArgs) => {
10
+ experience: {
11
+ hyperlinkPattern: string | undefined;
12
+ entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
13
+ };
9
14
  error: Error | undefined;
10
- experience: import("@contentful/experiences-core/types").Experience<import("@contentful/experiences-core").EntityStore> | undefined;
11
15
  isLoading: boolean;
12
16
  isEditorMode: boolean;
13
17
  };
@@ -4,10 +4,15 @@ export type UseFetchBySlugArgs = {
4
4
  slug: string;
5
5
  experienceTypeId: string;
6
6
  localeCode: string;
7
+ /** The pattern being used to generate links for hyperlink properties **/
8
+ hyperlinkPattern?: string;
7
9
  };
8
- export declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, }: UseFetchBySlugArgs) => {
10
+ export declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchBySlugArgs) => {
11
+ experience: {
12
+ hyperlinkPattern: string | undefined;
13
+ entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
14
+ };
9
15
  error: Error | undefined;
10
- experience: import("@contentful/experiences-core/types").Experience<import("@contentful/experiences-core").EntityStore> | undefined;
11
16
  isLoading: boolean;
12
17
  isEditorMode: boolean;
13
18
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.3";
1
+ export declare const SDK_VERSION = "1.0.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-sdk-react",
3
- "version": "1.0.4-dev-20240412T1127-32f6129.0",
3
+ "version": "1.0.5-beta.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  "depcruise": "depcruise src"
32
32
  },
33
33
  "dependencies": {
34
- "@contentful/experiences-components-react": "1.0.4-dev-20240412T1127-32f6129.0",
35
- "@contentful/experiences-core": "1.0.4-dev-20240412T1127-32f6129.0",
36
- "@contentful/experiences-visual-editor-react": "1.0.4-dev-20240412T1127-32f6129.0",
34
+ "@contentful/experiences-components-react": "1.0.5-beta.0",
35
+ "@contentful/experiences-core": "1.0.5-beta.0",
36
+ "@contentful/experiences-visual-editor-react": "1.0.5-beta.0",
37
37
  "@contentful/rich-text-types": "^16.2.1",
38
38
  "classnames": "^2.3.2",
39
39
  "csstype": "^3.1.2",
@@ -88,5 +88,5 @@
88
88
  "dist",
89
89
  "package.json"
90
90
  ],
91
- "gitHead": "32f6129774db6b363120c4c5b073ff0bd964cecf"
91
+ "gitHead": "b0c3cf50858919d32c4fff4de94db0dddee951e6"
92
92
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisualEditorLoader-255ce544.js","sources":["../../src/blocks/editor/VisualEditorLoader.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { VisualEditorMode } from '@contentful/experiences-core';\n\ntype VisualEditorLoaderProps = {\n visualEditorMode: VisualEditorMode;\n};\n\nexport const VisualEditorLoader: React.FC<VisualEditorLoaderProps> = ({ visualEditorMode }) => {\n const [VisualEditor, setVisualEditor] = useState<React.ComponentType | null>(null);\n\n useEffect(() => {\n // Dynamically import the visual editor based on the configured mode\n switch (visualEditorMode) {\n case VisualEditorMode.InjectScript:\n import('./VisualEditorInjectScript').then((module) => {\n setVisualEditor(() => module.default);\n });\n break;\n\n // VisualEditorMode.LazyLoad:\n default:\n import('@contentful/experiences-visual-editor-react').then((module) => {\n setVisualEditor(() => module.default);\n });\n }\n }, [visualEditorMode]);\n\n if (!VisualEditor) return null;\n\n return <VisualEditor />;\n};\n\nexport default VisualEditorLoader;\n"],"names":["_jsx"],"mappings":";;;;MAOa,kBAAkB,GAAsC,CAAC,EAAE,gBAAgB,EAAE,KAAI;IAC5F,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA6B,IAAI,CAAC,CAAC;IAEnF,SAAS,CAAC,MAAK;;QAEb,QAAQ,gBAAgB;YACtB,KAAK,gBAAgB,CAAC,YAAY;gBAChC,OAAO,wCAA4B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAI;oBACnD,eAAe,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;AACxC,iBAAC,CAAC,CAAC;gBACH,MAAM;;AAGR,YAAA;gBACE,OAAO,6CAA6C,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAI;oBACpE,eAAe,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;AACxC,iBAAC,CAAC,CAAC;SACN;AACH,KAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAEvB,IAAA,IAAI,CAAC,YAAY;AAAE,QAAA,OAAO,IAAI,CAAC;IAE/B,OAAOA,GAAA,CAAC,YAAY,EAAA,EAAA,CAAG,CAAC;AAC1B;;;;"}