@storyblok/react 4.3.0 → 4.3.2

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,3 +1,3 @@
1
- import type { TUseStoryblokState } from '@/types';
1
+ import { TUseStoryblokState } from '../types';
2
2
  export declare const useStoryblokState: TUseStoryblokState;
3
3
  //# sourceMappingURL=client.d.ts.map
@@ -1,10 +1,10 @@
1
- import type { SbReactComponentsMap, SbReactSDKOptions, StoryblokClient } from '@/types';
1
+ import { SbReactComponentsMap, SbReactSDKOptions, StoryblokClient } from '../types';
2
2
  export * from '../types';
3
3
  export declare const useStoryblokApi: () => StoryblokClient;
4
4
  export declare const setComponents: (newComponentsMap: SbReactComponentsMap) => SbReactComponentsMap;
5
- export declare const getComponent: (componentKey: string) => false | import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>;
5
+ export declare const getComponent: (componentKey: string) => false | import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>;
6
6
  export declare const getEnableFallbackComponent: () => boolean;
7
- export declare const getCustomFallbackComponent: () => import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>;
7
+ export declare const getCustomFallbackComponent: () => import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>;
8
8
  export declare const storyblokInit: (pluginOptions?: SbReactSDKOptions) => void;
9
9
  export { useStoryblokApi as getStoryblokApi };
10
10
  export { default as StoryblokComponent } from './storyblok-component';
@@ -1,7 +1,7 @@
1
- import type { SbBlokData } from '@/types';
2
- interface StoryblokComponentProps {
1
+ import { SbBlokData } from '../types';
2
+ interface StoryblokComponentProps extends Omit<Record<string, unknown>, 'blok'> {
3
3
  blok: SbBlokData;
4
4
  }
5
- declare const StoryblokComponent: import("react").ForwardRefExoticComponent<StoryblokComponentProps & import("react").RefAttributes<HTMLElement>>;
5
+ declare const StoryblokComponent: import('react').ForwardRefExoticComponent<Omit<StoryblokComponentProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
6
6
  export default StoryblokComponent;
7
7
  //# sourceMappingURL=storyblok-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storyblok-component.d.ts","sourceRoot":"","sources":["../../src/common/storyblok-component.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,uBAAuB;IAC/B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,QAAA,MAAM,kBAAkB,iHAuCvB,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"storyblok-component.d.ts","sourceRoot":"","sources":["../../src/common/storyblok-component.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,uBAAwB,SAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAC7E,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,QAAA,MAAM,kBAAkB,8HAuCvB,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ISbStoriesParams, ISbStoryData, StoryblokBridgeConfigV2 } from './types';
2
- export declare const useStoryblok: (slug: string, apiOptions?: ISbStoriesParams, bridgeOptions?: StoryblokBridgeConfigV2) => ISbStoryData<import("@storyblok/js").StoryblokComponentType<string> & {
1
+ import { ISbStoriesParams, ISbStoryData, StoryblokBridgeConfigV2 } from './types';
2
+ export declare const useStoryblok: (slug: string, apiOptions?: ISbStoriesParams, bridgeOptions?: StoryblokBridgeConfigV2) => ISbStoryData<import('@storyblok/js').StoryblokComponentType<string> & {
3
3
  [index: string]: any;
4
4
  }>;
5
5
  export * from './common/client';
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { StoryblokRichTextNode, StoryblokRichTextOptions } from '@storyblok/js';
1
+ import { default as React } from 'react';
2
+ import { StoryblokRichTextNode, StoryblokRichTextOptions } from '@storyblok/js';
3
3
  export declare function componentResolver(node: StoryblokRichTextNode<React.ReactElement>): React.ReactElement;
4
4
  export declare function useStoryblokRichTextResolver(options: StoryblokRichTextOptions<React.ReactElement>): {
5
5
  render: (node: StoryblokRichTextNode<React.ReactNode>) => React.ReactNode;
@@ -1,9 +1,9 @@
1
- import type { SbReactComponentsMap, SbReactSDKOptions, StoryblokClient } from '@/types';
1
+ import { SbReactComponentsMap, SbReactSDKOptions, StoryblokClient } from '../types';
2
2
  export declare const useStoryblokApi: () => StoryblokClient;
3
- export declare const setComponents: (newComponentsMap: SbReactComponentsMap) => Map<string, import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
3
+ export declare const setComponents: (newComponentsMap: SbReactComponentsMap) => Map<string, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>;
4
4
  export declare const getComponent: (componentKey: string) => React.ElementType | false;
5
5
  export declare const getEnableFallbackComponent: () => boolean;
6
- export declare const getCustomFallbackComponent: () => import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>;
6
+ export declare const getCustomFallbackComponent: () => import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>;
7
7
  export declare const storyblokInit: (pluginOptions?: SbReactSDKOptions) => (() => StoryblokClient);
8
8
  export * from '../types';
9
9
  export { useStoryblokApi as getStoryblokApi };
@@ -1,7 +1,7 @@
1
- import type { SbBlokData } from '@/types';
2
- interface SbServerComponentProps {
1
+ import { SbBlokData } from '../types';
2
+ interface SbServerComponentProps extends Omit<Record<string, unknown>, 'blok'> {
3
3
  blok: SbBlokData;
4
4
  }
5
- declare const StoryblokServerComponent: import("react").ForwardRefExoticComponent<SbServerComponentProps & import("react").RefAttributes<HTMLElement>>;
5
+ declare const StoryblokServerComponent: import('react').ForwardRefExoticComponent<Omit<SbServerComponentProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
6
6
  export default StoryblokServerComponent;
7
7
  //# sourceMappingURL=server-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-component.d.ts","sourceRoot":"","sources":["../../src/rsc/server-component.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,sBAAsB;IAC9B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,QAAA,MAAM,wBAAwB,gHAuC7B,CAAC;AAIF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"server-component.d.ts","sourceRoot":"","sources":["../../src/rsc/server-component.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,UAAU,sBAAuB,SAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAC5E,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,QAAA,MAAM,wBAAwB,6HAuC7B,CAAC;AAIF,eAAe,wBAAwB,CAAC"}
@@ -1,8 +1,8 @@
1
- import type { ISbStoryData, StoryblokBridgeConfigV2 } from '@/types';
2
- interface StoryblokStoryProps {
1
+ import { ISbStoryData, StoryblokBridgeConfigV2 } from '../types';
2
+ interface StoryblokStoryProps extends Omit<Record<string, unknown>, 'story' | 'bridgeOptions'> {
3
3
  story: ISbStoryData;
4
4
  bridgeOptions?: StoryblokBridgeConfigV2;
5
5
  }
6
- declare const StoryblokStory: import("react").ForwardRefExoticComponent<StoryblokStoryProps & import("react").RefAttributes<HTMLElement>>;
6
+ declare const StoryblokStory: import('react').ForwardRefExoticComponent<Omit<StoryblokStoryProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
7
7
  export default StoryblokStory;
8
8
  //# sourceMappingURL=story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../src/rsc/story.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIrE,UAAU,mBAAmB;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,6GAiCnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../src/rsc/story.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIrE,UAAU,mBAAoB,SAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAC5F,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,0HAiCnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { StoryblokRichTextProps } from './types';
1
+ import { default as React } from 'react';
2
+ import { StoryblokRichTextProps } from './types';
3
3
  declare const StoryblokRichText: React.ForwardRefExoticComponent<StoryblokRichTextProps & React.RefAttributes<HTMLDivElement>>;
4
4
  export default StoryblokRichText;
5
5
  //# sourceMappingURL=storyblok-rich-text.d.ts.map
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type React from 'react';
2
- import type { ISbStoryData, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokRichTextNode, StoryblokRichTextResolvers } from '@storyblok/js';
1
+ import { default as React } from 'react';
2
+ import { ISbStoryData, SbSDKOptions, StoryblokBridgeConfigV2, StoryblokRichTextNode, StoryblokRichTextResolvers } from '@storyblok/js';
3
3
  export interface SbReactComponentsMap {
4
4
  [key: string]: React.ElementType;
5
5
  }
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { default as React } from 'react';
2
2
  /**
3
3
  * Recursively converts HTML attributes in a React element tree to their JSX property names.
4
4
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storyblok/react",
3
3
  "type": "module",
4
- "version": "4.3.0",
4
+ "version": "4.3.2",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@9.13.2",
7
7
  "description": "SDK to integrate Storyblok into your project using React.",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "dev": "vite build --watch",
37
- "build": "vite build && tsc --project tsconfig.json",
37
+ "build": "vite build",
38
38
  "test": "pnpm run test:unit:ci && pnpm run test:e2e",
39
39
  "test:unit": "vitest",
40
40
  "test:unit:ci": "vitest run",
@@ -69,7 +69,7 @@
69
69
  "@cypress/vite-dev-server": "^5.2.1",
70
70
  "@storyblok/eslint-config": "^0.3.0",
71
71
  "@tsconfig/recommended": "^1.0.8",
72
- "@types/node": "^22.10.1",
72
+ "@types/node": "^20.17.10",
73
73
  "@types/react": "18.3.12",
74
74
  "@vitejs/plugin-react": "^4.3.4",
75
75
  "babel-jest": "^29.7.0",
@@ -84,6 +84,7 @@
84
84
  "start-server-and-test": "^2.0.8",
85
85
  "typescript": "5.6.3",
86
86
  "vite": "^5.4.11",
87
+ "vite-plugin-dts": "^4.3.0",
87
88
  "vitest": "^2.1.8"
88
89
  },
89
90
  "babel": {
@@ -101,7 +102,14 @@
101
102
  "commitlint": {
102
103
  "extends": [
103
104
  "@commitlint/config-conventional"
104
- ]
105
+ ],
106
+ "rules": {
107
+ "body-max-line-length": [
108
+ 2,
109
+ "always",
110
+ 200
111
+ ]
112
+ }
105
113
  },
106
114
  "release": {
107
115
  "branches": [