@okam/directus-block 2.1.0 → 2.1.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 +17 -0
- package/components/BlockDispatcher/index.d.ts +1 -1
- package/components/BlockDispatcher/index.js +2 -2
- package/components/BlockDispatcher/index.mjs +2 -2
- package/components/BlockDispatcher/interface.d.ts +1 -1
- package/index.d.ts +2 -0
- package/index.js +8 -4
- package/index.mjs +10 -6
- package/package.json +3 -3
- package/server.d.ts +2 -0
- package/server.js +6 -2
- package/server.mjs +12 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 2.1.2 (2026-04-14)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **directus-block:** BlockDispatcher is a synchronous function ([#477](https://github.com/OKAMca/stack/pull/477))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Pierre-Olivier Clerson @poclerson
|
|
10
|
+
|
|
11
|
+
## 2.1.0 (2026-04-06)
|
|
12
|
+
|
|
13
|
+
### 🧱 Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated stack-ui to 2.1.0
|
|
16
|
+
- Updated directus-query to 2.1.0
|
|
17
|
+
|
|
1
18
|
## 2.0.3 (2026-03-26)
|
|
2
19
|
|
|
3
20
|
### 🧱 Updated Dependencies
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TBlockDispatcherProps } from './interface';
|
|
2
|
-
declare function BlockDispatcher(props: TBlockDispatcherProps):
|
|
2
|
+
declare function BlockDispatcher(props: TBlockDispatcherProps): string | number | bigint | boolean | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element | (string | number | bigint | boolean | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined)[] | null | undefined;
|
|
3
3
|
export default BlockDispatcher;
|
|
@@ -3,10 +3,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
3
3
|
const index = require("../BlockSerializer/index.js");
|
|
4
4
|
const config = require("./config.js");
|
|
5
5
|
const mergeConfigs = require("../../utils/mergeConfigs.js");
|
|
6
|
-
|
|
6
|
+
function BlockDispatcher(props) {
|
|
7
7
|
const { children, config: config$1, ...rest } = props;
|
|
8
8
|
const finalConfig = mergeConfigs(config, config$1);
|
|
9
|
-
const renderBlock =
|
|
9
|
+
const renderBlock = (blockProps) => {
|
|
10
10
|
return children != null ? children({ ...rest, ...blockProps, config: finalConfig }) : /* @__PURE__ */ jsxRuntime.jsx(index, { ...rest, ...blockProps, config: finalConfig });
|
|
11
11
|
};
|
|
12
12
|
if ("blocks" in props) {
|
|
@@ -2,10 +2,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import BlockSerializer from "../BlockSerializer/index.mjs";
|
|
3
3
|
import baseConfig from "./config.mjs";
|
|
4
4
|
import mergeConfigs from "../../utils/mergeConfigs.mjs";
|
|
5
|
-
|
|
5
|
+
function BlockDispatcher(props) {
|
|
6
6
|
const { children, config, ...rest } = props;
|
|
7
7
|
const finalConfig = mergeConfigs(baseConfig, config);
|
|
8
|
-
const renderBlock =
|
|
8
|
+
const renderBlock = (blockProps) => {
|
|
9
9
|
return children != null ? children({ ...rest, ...blockProps, config: finalConfig }) : /* @__PURE__ */ jsx(BlockSerializer, { ...rest, ...blockProps, config: finalConfig });
|
|
10
10
|
};
|
|
11
11
|
if ("blocks" in props) {
|
|
@@ -6,7 +6,7 @@ interface TBaseBlockDispatcherProps<AdditionalProps extends TAdditionalProps = T
|
|
|
6
6
|
config?: TBlockSerializerConfig;
|
|
7
7
|
defaultVariant?: string;
|
|
8
8
|
additionalProps?: AdditionalProps;
|
|
9
|
-
children?: (_props: TBlockSerializerProps) => ReactNode
|
|
9
|
+
children?: (_props: TBlockSerializerProps) => Awaited<ReactNode>;
|
|
10
10
|
}
|
|
11
11
|
export type TBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps> = (TBaseBlockDispatcherProps<AdditionalProps> & {
|
|
12
12
|
block: Nullable<TBlockSerializerProps>;
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { default as BlockWysiwyg } from './blocks/BlockWysiwyg';
|
|
2
2
|
export { default as blockWysiwygConfig } from './blocks/BlockWysiwyg/config';
|
|
3
|
+
export { default as BlockDispatcher } from './components/BlockDispatcher';
|
|
3
4
|
export { default as baseConfig } from './components/BlockDispatcher/config';
|
|
4
5
|
export type { TBlockDispatcherProps } from './components/BlockDispatcher/interface';
|
|
6
|
+
export { default as BlockSerializer } from './components/BlockSerializer';
|
|
5
7
|
export type { TBlock, TBlockSerializerConfig, TBlockSerializerConfigComponent, TBlockSerializerProps, } from './components/BlockSerializer/interface';
|
|
6
8
|
export type { BlockSettingsFragment } from './generated/graphql';
|
|
7
9
|
export type { TAdditionalProps, TBlockDocument, TBlockQuery, TBlockVariables, TCommonBlockFragment, } from './types/block';
|
package/index.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./blocks/BlockWysiwyg/index.js");
|
|
3
|
+
const index$2 = require("./blocks/BlockWysiwyg/index.js");
|
|
4
4
|
const config$1 = require("./blocks/BlockWysiwyg/config.js");
|
|
5
|
+
const index = require("./components/BlockDispatcher/index.js");
|
|
5
6
|
const config = require("./components/BlockDispatcher/config.js");
|
|
6
|
-
const index$1 = require("./
|
|
7
|
+
const index$1 = require("./components/BlockSerializer/index.js");
|
|
8
|
+
const index$3 = require("./utils/index.js");
|
|
7
9
|
const getBlockProps = require("./utils/getBlockProps.js");
|
|
8
10
|
const mergeConfigs = require("./utils/mergeConfigs.js");
|
|
9
11
|
const getBlock = require("./utils/getBlock.js");
|
|
10
12
|
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
11
|
-
exports.BlockWysiwyg = index;
|
|
13
|
+
exports.BlockWysiwyg = index$2;
|
|
12
14
|
exports.blockWysiwygConfig = config$1;
|
|
15
|
+
exports.BlockDispatcher = index;
|
|
13
16
|
exports.baseConfig = config;
|
|
14
|
-
exports.
|
|
17
|
+
exports.BlockSerializer = index$1;
|
|
18
|
+
exports.useBlock = index$3.useBlock;
|
|
15
19
|
exports.getBlockProps = getBlockProps;
|
|
16
20
|
exports.mergeConfigs = mergeConfigs;
|
|
17
21
|
exports.getBlock = getBlock.getBlock;
|
package/index.mjs
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { default as default2 } from "./blocks/BlockWysiwyg/index.mjs";
|
|
2
2
|
import { default as default3 } from "./blocks/BlockWysiwyg/config.mjs";
|
|
3
|
-
import { default as default4 } from "./components/BlockDispatcher/
|
|
3
|
+
import { default as default4 } from "./components/BlockDispatcher/index.mjs";
|
|
4
|
+
import { default as default5 } from "./components/BlockDispatcher/config.mjs";
|
|
5
|
+
import { default as default6 } from "./components/BlockSerializer/index.mjs";
|
|
4
6
|
import { useBlock } from "./utils/index.mjs";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
+
import { default as default7 } from "./utils/getBlockProps.mjs";
|
|
8
|
+
import { default as default8 } from "./utils/mergeConfigs.mjs";
|
|
7
9
|
import { getBlock } from "./utils/getBlock.mjs";
|
|
8
10
|
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
9
11
|
export {
|
|
12
|
+
default4 as BlockDispatcher,
|
|
13
|
+
default6 as BlockSerializer,
|
|
10
14
|
default2 as BlockWysiwyg,
|
|
11
|
-
|
|
15
|
+
default5 as baseConfig,
|
|
12
16
|
default3 as blockWysiwygConfig,
|
|
13
17
|
getBlock,
|
|
14
|
-
|
|
18
|
+
default7 as getBlockProps,
|
|
15
19
|
useFragment as getFragment,
|
|
16
|
-
|
|
20
|
+
default8 as mergeConfigs,
|
|
17
21
|
useBlock
|
|
18
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/directus-block",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/OKAMca/stack.git"
|
|
6
6
|
},
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
43
|
-
"@okam/directus-query": "2.1.
|
|
44
|
-
"@okam/stack-ui": "2.1.
|
|
43
|
+
"@okam/directus-query": "2.1.1",
|
|
44
|
+
"@okam/stack-ui": "2.1.1",
|
|
45
45
|
"graphql": "^16.9.0",
|
|
46
46
|
"graphql-request": "^7.1.2",
|
|
47
47
|
"radashi": "^12.3.0"
|
package/server.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { default as BlockWysiwyg } from './blocks/BlockWysiwyg';
|
|
2
|
+
export { default as blockWysiwygConfig } from './blocks/BlockWysiwyg/config';
|
|
1
3
|
export { default as BlockDispatcher } from './components/BlockDispatcher';
|
|
2
4
|
export { default as BlockSerializer } from './components/BlockSerializer';
|
|
3
5
|
export * from './utils';
|
package/server.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
"server-only";
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const index$2 = require("./blocks/BlockWysiwyg/index.js");
|
|
5
|
+
const config = require("./blocks/BlockWysiwyg/config.js");
|
|
4
6
|
const index = require("./components/BlockDispatcher/index.js");
|
|
5
7
|
const index$1 = require("./components/BlockSerializer/index.js");
|
|
6
|
-
const index$
|
|
8
|
+
const index$3 = require("./utils/index.js");
|
|
7
9
|
const getBlockProps = require("./utils/getBlockProps.js");
|
|
8
10
|
const mergeConfigs = require("./utils/mergeConfigs.js");
|
|
9
11
|
const getBlock = require("./utils/getBlock.js");
|
|
10
12
|
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
13
|
+
exports.BlockWysiwyg = index$2;
|
|
14
|
+
exports.blockWysiwygConfig = config;
|
|
11
15
|
exports.BlockDispatcher = index;
|
|
12
16
|
exports.BlockSerializer = index$1;
|
|
13
|
-
exports.useBlock = index$
|
|
17
|
+
exports.useBlock = index$3.useBlock;
|
|
14
18
|
exports.getBlockProps = getBlockProps;
|
|
15
19
|
exports.mergeConfigs = mergeConfigs;
|
|
16
20
|
exports.getBlock = getBlock.getBlock;
|
package/server.mjs
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"server-only";
|
|
2
|
-
import { default as default2 } from "./
|
|
3
|
-
import { default as default3 } from "./
|
|
2
|
+
import { default as default2 } from "./blocks/BlockWysiwyg/index.mjs";
|
|
3
|
+
import { default as default3 } from "./blocks/BlockWysiwyg/config.mjs";
|
|
4
|
+
import { default as default4 } from "./components/BlockDispatcher/index.mjs";
|
|
5
|
+
import { default as default5 } from "./components/BlockSerializer/index.mjs";
|
|
4
6
|
import { useBlock } from "./utils/index.mjs";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
+
import { default as default6 } from "./utils/getBlockProps.mjs";
|
|
8
|
+
import { default as default7 } from "./utils/mergeConfigs.mjs";
|
|
7
9
|
import { getBlock } from "./utils/getBlock.mjs";
|
|
8
10
|
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
default4 as BlockDispatcher,
|
|
13
|
+
default5 as BlockSerializer,
|
|
14
|
+
default2 as BlockWysiwyg,
|
|
15
|
+
default3 as blockWysiwygConfig,
|
|
12
16
|
getBlock,
|
|
13
|
-
|
|
17
|
+
default6 as getBlockProps,
|
|
14
18
|
useFragment as getFragment,
|
|
15
|
-
|
|
19
|
+
default7 as mergeConfigs,
|
|
16
20
|
useBlock
|
|
17
21
|
};
|