@okam/directus-block 1.6.0 → 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 +20 -0
- package/blocks/BlockWysiwyg/config.d.ts +3 -2
- package/blocks/BlockWysiwyg/index.d.ts +3 -2
- package/blocks/BlockWysiwyg/interface.d.ts +2 -1
- package/components/BlockDispatcher/config.d.ts +2 -1
- package/components/BlockDispatcher/index.d.ts +3 -2
- package/components/BlockDispatcher/interface.d.ts +5 -4
- package/components/BlockSerializer/index.d.ts +2 -1
- package/components/BlockSerializer/interface.d.ts +6 -5
- package/generated/fragment-masking.d.ts +1 -0
- package/generated/graphql.d.ts +2 -1
- package/hooks/useBlock.d.ts +4 -3
- package/package.json +9 -4
- package/types/block.d.ts +6 -5
- package/utils/get-block-props.d.ts +4 -3
- package/utils/index.d.ts +1 -0
- package/utils/merge-configs.d.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
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
|
+
|
|
15
|
+
## 1.6.1 (2025-11-27)
|
|
16
|
+
|
|
17
|
+
### 🧱 Updated Dependencies
|
|
18
|
+
|
|
19
|
+
- Updated stack-ui to 1.42.4
|
|
20
|
+
|
|
1
21
|
## 1.6.0 (2025-10-17)
|
|
2
22
|
|
|
3
23
|
### 🚀 Features
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
|
2
|
-
import
|
|
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,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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 ? {
|
package/generated/graphql.d.ts
CHANGED
package/hooks/useBlock.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
package/utils/merge-configs.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|