@okam/directus-block 1.6.1 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 1.6.2 (2026-01-13)
2
+
3
+ ### 🚀 Features
4
+
5
+ - React 19 + Next.js 15 support ([#369](https://github.com/OKAMca/stack/pull/369))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated stack-ui to 1.43.0
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Marie-Maxime Tanguay @marie-maxime
14
+
1
15
  ## 1.6.1 (2025-11-27)
2
16
 
3
17
  ### 🧱 Updated Dependencies
@@ -1,4 +1,5 @@
1
- import type { TBlockSerializerConfigComponent } from '../../components/BlockSerializer/interface';
2
- import type { BlockWysiwygFragment } from './interface';
1
+ import { TBlockSerializerConfigComponent } from '../../components/BlockSerializer/interface';
2
+ import { BlockWysiwygFragment } from './interface';
3
+
3
4
  declare const blockWysiwygConfig: TBlockSerializerConfigComponent<BlockWysiwygFragment>;
4
5
  export default blockWysiwygConfig;
@@ -1,4 +1,5 @@
1
- import type { TBlockSerializerProps } from '../../components/BlockSerializer/interface';
2
- import type { BlockWysiwygFragment } from './interface';
1
+ import { TBlockSerializerProps } from '../../components/BlockSerializer/interface';
2
+ import { BlockWysiwygFragment } from './interface';
3
+
3
4
  declare const BlockWysiwyg: (props: TBlockSerializerProps<BlockWysiwygFragment>) => Promise<import("react/jsx-runtime").JSX.Element | null>;
4
5
  export default BlockWysiwyg;
@@ -1,4 +1,5 @@
1
- import type { BlockSettingsFragment } from '../../generated/graphql';
1
+ import { BlockSettingsFragment } from '../../generated/graphql';
2
+
2
3
  export type BlockWysiwygFragment = {
3
4
  __typename?: 'block_wysiwyg';
4
5
  title?: string | null;
@@ -1,3 +1,4 @@
1
- import type { TBlockSerializerConfig } from '../BlockSerializer/interface';
1
+ import { TBlockSerializerConfig } from '../BlockSerializer/interface';
2
+
2
3
  declare const baseConfig: TBlockSerializerConfig;
3
4
  export default baseConfig;
@@ -1,3 +1,4 @@
1
- import type { TBlockDispatcherProps } from './interface';
2
- declare const BlockDispatcher: (props: TBlockDispatcherProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react").PromiseLikeOfReactNode | import("react/jsx-runtime").JSX.Element | (string | number | boolean | Iterable<import("react").ReactNode> | import("react").PromiseLikeOfReactNode | import("react/jsx-runtime").JSX.Element | null | undefined)[] | null | undefined;
1
+ import { TBlockDispatcherProps } from './interface';
2
+
3
+ declare const BlockDispatcher: (props: TBlockDispatcherProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | (string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined)[] | null | undefined;
3
4
  export default BlockDispatcher;
@@ -1,7 +1,8 @@
1
- import type { TDefaultComponent, Nullable } from '@okam/stack-ui';
2
- import type React from 'react';
3
- import type { TAdditionalProps } from '../../types/block';
4
- import type { TBlockSerializerProps, TBlockSerializerConfig } from '../BlockSerializer/interface';
1
+ import { TDefaultComponent, Nullable } from '../../../../../stack/stack-ui/src/index.ts';
2
+ import { default as React } from 'react';
3
+ import { TAdditionalProps } from '../../types/block';
4
+ import { TBlockSerializerProps, TBlockSerializerConfig } from '../BlockSerializer/interface';
5
+
5
6
  interface TBaseBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps> extends Omit<TDefaultComponent, 'children'> {
6
7
  config?: TBlockSerializerConfig;
7
8
  defaultVariant?: string;
@@ -1,3 +1,4 @@
1
- import type { TBlockSerializerProps } from './interface';
1
+ import { TBlockSerializerProps } from './interface';
2
+
2
3
  declare const BlockSerializer: (props: TBlockSerializerProps) => import("react/jsx-runtime").JSX.Element | null;
3
4
  export default BlockSerializer;
@@ -1,8 +1,9 @@
1
- import { type TypedDocumentNode } from '@graphql-typed-document-node/core';
2
- import type { Nullable, TDefaultComponent } from '@okam/stack-ui';
3
- import type { Variables as GraphQLVariables } from 'graphql-request';
4
- import type { FunctionComponent } from 'react';
5
- import type { TCommonBlockFragment, TAdditionalProps, TBlockQuery, TBlockVariables, TBlockDocument } from '../../types/block';
1
+ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
2
+ import { Nullable, TDefaultComponent } from '../../../../../stack/stack-ui/src/index.ts';
3
+ import { Variables as GraphQLVariables } from 'graphql-request';
4
+ import { FunctionComponent } from 'react';
5
+ import { TCommonBlockFragment, TAdditionalProps, TBlockQuery, TBlockVariables, TBlockDocument } from '../../types/block';
6
+
6
7
  /**
7
8
  * Base block data. See {@link TBlockSerializerProps} for actual props implementation.
8
9
  */
@@ -1,5 +1,6 @@
1
1
  import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2
2
  import { Incremental } from './graphql';
3
+
3
4
  export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
4
5
  ' $fragmentName'?: infer TKey;
5
6
  }] ? TKey extends string ? {
@@ -1,4 +1,5 @@
1
- import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
1
+ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
2
+
2
3
  export type Exact<T extends {
3
4
  [key: string]: unknown;
4
5
  }> = {
@@ -1,6 +1,7 @@
1
- import type { TToken } from '@okam/stack-ui';
2
- import type { TBlockSerializerProps } from '../components/BlockSerializer/interface';
3
- import type { TBlockDocument, TBlockVariables, TCommonBlockFragment } from '../types/block';
1
+ import { TToken } from '../../../../stack/stack-ui/src/index.ts';
2
+ import { TBlockSerializerProps } from '../components/BlockSerializer/interface';
3
+ import { TBlockDocument, TBlockVariables, TCommonBlockFragment } from '../types/block';
4
+
4
5
  /**
5
6
  * General function to fetch the block data and its settings. Features the decision-making logic of {@link getBlockProps} that allows blocks to work with both passed props and queried props.
6
7
  * @param props Props of the block component. Pass props directly from the block component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okam/directus-block",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -34,10 +34,15 @@
34
34
  "dependencies": {
35
35
  "@graphql-typed-document-node/core": "3.2.0",
36
36
  "@okam/directus-query": "1.4.2",
37
- "@okam/stack-ui": "1.42.4",
37
+ "@okam/stack-ui": "1.43.0",
38
38
  "graphql": "^16.9.0",
39
39
  "graphql-request": "^7.1.2",
40
- "radashi": "^12.3.0",
41
- "react": "18.3.1"
40
+ "radashi": "^12.3.0"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^18.0.0 || ^19.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "react": "^19.0.0"
42
47
  }
43
48
  }
package/types/block.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import type { DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2
- import type { Nullable } from '@okam/stack-ui';
3
- import type { Variables } from 'graphql-request';
4
- import type { FragmentType } from '../generated/fragment-masking';
5
- import type { BlockSettingsFragment } from '../generated/graphql';
1
+ import { DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2
+ import { Nullable } from '../../../../stack/stack-ui/src/index.ts';
3
+ import { Variables } from 'graphql-request';
4
+ import { FragmentType } from '../generated/fragment-masking';
5
+ import { BlockSettingsFragment } from '../generated/graphql';
6
+
6
7
  export type TAdditionalProps = {
7
8
  [key: string]: unknown;
8
9
  };
@@ -1,6 +1,7 @@
1
- import type { Nullable } from '@okam/stack-ui';
2
- import type { Variables } from 'graphql-request';
3
- import type { TBlockDocument, TBlockQuery, TBlockVariables, TCommonBlockFragment } from '../types/block';
1
+ import { Nullable } from '../../../../stack/stack-ui/src/index.ts';
2
+ import { Variables } from 'graphql-request';
3
+ import { TBlockDocument, TBlockQuery, TBlockVariables, TCommonBlockFragment } from '../types/block';
4
+
4
5
  type TGetBlockPropsParams<BlockFragment extends TCommonBlockFragment, BlockVariables extends Variables = Variables> = {
5
6
  document?: TBlockDocument<BlockFragment, BlockVariables>;
6
7
  item?: Nullable<NonNullable<NonNullable<TBlockQuery<BlockFragment>[string]>[' $fragmentRefs']>[string]>;
package/utils/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useFragment } from '../generated/fragment-masking';
2
+
2
3
  export { default as getBlockProps } from './get-block-props';
3
4
  export { default as mergeConfigs } from './merge-configs';
4
5
  export { useFragment as getFragment };
@@ -1,5 +1,6 @@
1
- import type { Nullable } from '@okam/stack-ui';
2
- import type { TBlockSerializerConfig } from '../components/BlockSerializer/interface';
1
+ import { Nullable } from '../../../../stack/stack-ui/src/index.ts';
2
+ import { TBlockSerializerConfig } from '../components/BlockSerializer/interface';
3
+
3
4
  /**
4
5
  * Merges multiple block dispatcher configs
5
6
  * @param baseConfig The base configuration. Other configurations will be prioritized over this one, which acts as a fallback