@okam/directus-block 1.7.8 → 1.7.10
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 +7 -0
- package/blocks/BlockWysiwyg/index.js +2 -19
- package/blocks/BlockWysiwyg/index.mjs +2 -2
- package/components/BlockDispatcher/interface.d.ts +2 -2
- package/index.js +6 -6
- package/index.mjs +1 -1
- package/package.json +3 -3
- package/server.js +2 -2
- package/server.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const stackUi = require("@okam/stack-ui");
|
|
4
|
-
const
|
|
4
|
+
const react = require("react");
|
|
5
5
|
const getBlock = require("../../utils/getBlock.js");
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
-
if (e) {
|
|
9
|
-
for (const k in e) {
|
|
10
|
-
if (k !== "default") {
|
|
11
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: () => e[k]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
23
6
|
async function BlockWysiwyg(props) {
|
|
24
7
|
const key = "block_wysiwygs_by_id";
|
|
25
8
|
const { themeName = "wysiwyg", tokens } = props;
|
|
@@ -27,7 +10,7 @@ async function BlockWysiwyg(props) {
|
|
|
27
10
|
if ((content == null || content === "") && !(title != null && title !== "" && (level != null && level !== "")))
|
|
28
11
|
return null;
|
|
29
12
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
30
|
-
title != null && title !== "" && (level != null && level !== "") && /* @__PURE__ */ jsxRuntime.jsx(stackUi.Box, { as: "span", themeName, tokens: { ...tokens, ...cmsTokens }, children:
|
|
13
|
+
title != null && title !== "" && (level != null && level !== "") && /* @__PURE__ */ jsxRuntime.jsx(stackUi.Box, { as: "span", themeName, tokens: { ...tokens, ...cmsTokens }, children: react.createElement(level, {}, title) }),
|
|
31
14
|
content != null && content !== "" && /* @__PURE__ */ jsxRuntime.jsx(stackUi.WysiwygBlock, { themeName, tokens: { ...tokens, ...cmsTokens }, content })
|
|
32
15
|
] });
|
|
33
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, WysiwygBlock } from "@okam/stack-ui";
|
|
3
|
-
import
|
|
3
|
+
import { createElement } from "react";
|
|
4
4
|
import { getBlock } from "../../utils/getBlock.mjs";
|
|
5
5
|
async function BlockWysiwyg(props) {
|
|
6
6
|
const key = "block_wysiwygs_by_id";
|
|
@@ -9,7 +9,7 @@ async function BlockWysiwyg(props) {
|
|
|
9
9
|
if ((content == null || content === "") && !(title != null && title !== "" && (level != null && level !== "")))
|
|
10
10
|
return null;
|
|
11
11
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
-
title != null && title !== "" && (level != null && level !== "") && /* @__PURE__ */ jsx(Box, { as: "span", themeName, tokens: { ...tokens, ...cmsTokens }, children:
|
|
12
|
+
title != null && title !== "" && (level != null && level !== "") && /* @__PURE__ */ jsx(Box, { as: "span", themeName, tokens: { ...tokens, ...cmsTokens }, children: createElement(level, {}, title) }),
|
|
13
13
|
content != null && content !== "" && /* @__PURE__ */ jsx(WysiwygBlock, { themeName, tokens: { ...tokens, ...cmsTokens }, content })
|
|
14
14
|
] });
|
|
15
15
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Nullable, TDefaultComponent } from '@okam/stack-ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { TAdditionalProps } from '../../types/block';
|
|
3
4
|
import { TBlockSerializerConfig, TBlockSerializerProps } from '../BlockSerializer/interface';
|
|
4
|
-
import type * as React from 'react';
|
|
5
5
|
interface TBaseBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps> extends Omit<TDefaultComponent, 'children'> {
|
|
6
6
|
config?: TBlockSerializerConfig;
|
|
7
7
|
defaultVariant?: string;
|
|
8
8
|
additionalProps?: AdditionalProps;
|
|
9
|
-
children?: (_props: TBlockSerializerProps) =>
|
|
9
|
+
children?: (_props: TBlockSerializerProps) => ReactNode;
|
|
10
10
|
}
|
|
11
11
|
export type TBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps> = (TBaseBlockDispatcherProps<AdditionalProps> & {
|
|
12
12
|
block: Nullable<TBlockSerializerProps>;
|
package/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const index = require("./blocks/BlockWysiwyg/index.js");
|
|
4
|
-
const config = require("./blocks/BlockWysiwyg/config.js");
|
|
5
|
-
const config
|
|
4
|
+
const config$1 = require("./blocks/BlockWysiwyg/config.js");
|
|
5
|
+
const config = require("./components/BlockDispatcher/config.js");
|
|
6
6
|
const index$1 = require("./utils/index.js");
|
|
7
7
|
const getBlockProps = require("./utils/getBlockProps.js");
|
|
8
8
|
const mergeConfigs = require("./utils/mergeConfigs.js");
|
|
9
|
-
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
10
9
|
const getBlock = require("./utils/getBlock.js");
|
|
10
|
+
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
11
11
|
exports.BlockWysiwyg = index;
|
|
12
|
-
exports.blockWysiwygConfig = config;
|
|
13
|
-
exports.baseConfig = config
|
|
12
|
+
exports.blockWysiwygConfig = config$1;
|
|
13
|
+
exports.baseConfig = config;
|
|
14
14
|
exports.useBlock = index$1.useBlock;
|
|
15
15
|
exports.getBlockProps = getBlockProps;
|
|
16
16
|
exports.mergeConfigs = mergeConfigs;
|
|
17
|
-
exports.getFragment = fragmentMasking.useFragment;
|
|
18
17
|
exports.getBlock = getBlock.getBlock;
|
|
18
|
+
exports.getFragment = fragmentMasking.useFragment;
|
package/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { default as default4 } from "./components/BlockDispatcher/config.mjs";
|
|
|
4
4
|
import { useBlock } from "./utils/index.mjs";
|
|
5
5
|
import { default as default5 } from "./utils/getBlockProps.mjs";
|
|
6
6
|
import { default as default6 } from "./utils/mergeConfigs.mjs";
|
|
7
|
-
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
8
7
|
import { getBlock } from "./utils/getBlock.mjs";
|
|
8
|
+
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
9
9
|
export {
|
|
10
10
|
default2 as BlockWysiwyg,
|
|
11
11
|
default4 as baseConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/directus-block",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
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": "1.5.
|
|
44
|
-
"@okam/stack-ui": "1.44.
|
|
43
|
+
"@okam/directus-query": "1.5.5",
|
|
44
|
+
"@okam/stack-ui": "1.44.6",
|
|
45
45
|
"graphql": "^16.9.0",
|
|
46
46
|
"graphql-request": "^7.1.2",
|
|
47
47
|
"radashi": "^12.3.0"
|
package/server.js
CHANGED
|
@@ -6,12 +6,12 @@ const index$1 = require("./components/BlockSerializer/index.js");
|
|
|
6
6
|
const index$2 = require("./utils/index.js");
|
|
7
7
|
const getBlockProps = require("./utils/getBlockProps.js");
|
|
8
8
|
const mergeConfigs = require("./utils/mergeConfigs.js");
|
|
9
|
-
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
10
9
|
const getBlock = require("./utils/getBlock.js");
|
|
10
|
+
const fragmentMasking = require("./generated/fragment-masking.js");
|
|
11
11
|
exports.BlockDispatcher = index;
|
|
12
12
|
exports.BlockSerializer = index$1;
|
|
13
13
|
exports.useBlock = index$2.useBlock;
|
|
14
14
|
exports.getBlockProps = getBlockProps;
|
|
15
15
|
exports.mergeConfigs = mergeConfigs;
|
|
16
|
-
exports.getFragment = fragmentMasking.useFragment;
|
|
17
16
|
exports.getBlock = getBlock.getBlock;
|
|
17
|
+
exports.getFragment = fragmentMasking.useFragment;
|
package/server.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { default as default3 } from "./components/BlockSerializer/index.mjs";
|
|
|
4
4
|
import { useBlock } from "./utils/index.mjs";
|
|
5
5
|
import { default as default4 } from "./utils/getBlockProps.mjs";
|
|
6
6
|
import { default as default5 } from "./utils/mergeConfigs.mjs";
|
|
7
|
-
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
8
7
|
import { getBlock } from "./utils/getBlock.mjs";
|
|
8
|
+
import { useFragment } from "./generated/fragment-masking.mjs";
|
|
9
9
|
export {
|
|
10
10
|
default2 as BlockDispatcher,
|
|
11
11
|
default3 as BlockSerializer,
|