@okam/directus-block 1.7.8 → 1.7.9
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,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/directus-block",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
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.4",
|
|
44
|
+
"@okam/stack-ui": "1.44.5",
|
|
45
45
|
"graphql": "^16.9.0",
|
|
46
46
|
"graphql-request": "^7.1.2",
|
|
47
47
|
"radashi": "^12.3.0"
|