@okam/directus-block 1.2.0 → 1.2.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/blocks/BlockWysiwyg/config.d.ts +4 -0
- package/blocks/BlockWysiwyg/index.d.ts +4 -0
- package/blocks/BlockWysiwyg/interface.d.ts +17 -0
- package/components/BlockDispatcher/config.d.ts +3 -0
- package/components/BlockDispatcher/interface.d.ts +16 -0
- package/components/BlockSerializer/interface.d.ts +31 -0
- package/generated/fragment-masking.d.ts +15 -0
- package/generated/graphql.d.ts +64 -0
- package/index.d.ts +6 -0
- package/index.js +96 -0
- package/index.mjs +5966 -0
- package/package.json +1 -1
- package/style.css +1 -0
- package/types/block.d.ts +27 -0
- package/utils/get-block-props.d.ts +17 -0
- package/utils/index.d.ts +4 -0
- package/utils/merge-configs.d.ts +9 -0
- package/.eslintrc.js +0 -21
- package/.storybook/.eslintrc.js +0 -29
- package/.storybook/main.ts +0 -33
- package/.storybook/preview.ts +0 -0
- package/.storybook/tsconfig.json +0 -17
- package/CHANGELOG.md +0 -21
- package/README.md +0 -161
- package/project.json +0 -57
- package/src/blocks/BlockWysiwyg/config.tsx +0 -10
- package/src/blocks/BlockWysiwyg/index.tsx +0 -38
- package/src/blocks/BlockWysiwyg/interface.ts +0 -13
- package/src/components/BlockDispatcher/config.ts +0 -10
- package/src/components/BlockDispatcher/index.tsx +0 -30
- package/src/components/BlockDispatcher/interface.ts +0 -17
- package/src/components/BlockSerializer/index.tsx +0 -40
- package/src/components/BlockSerializer/interface.ts +0 -51
- package/src/generated/fragment-masking.ts +0 -66
- package/src/generated/graphql.ts +0 -31
- package/src/index.ts +0 -30
- package/src/types/block.ts +0 -40
- package/src/utils/get-block-props.ts +0 -44
- package/src/utils/index.ts +0 -5
- package/src/utils/merge-configs.ts +0 -21
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -25
- package/vite.config.ts +0 -51
package/package.json
CHANGED
package/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\ 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);font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translateZ(0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0,-50%,0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, .25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}
|
package/types/block.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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';
|
|
6
|
+
export type TAdditionalProps = {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
type BlockSettings = FragmentType<DocumentTypeDecoration<BlockSettingsFragment, unknown>>;
|
|
10
|
+
export type TCommonBlockFragment = {
|
|
11
|
+
id?: Nullable<string>;
|
|
12
|
+
settings?: Nullable<BlockSettings>;
|
|
13
|
+
} & Record<string, unknown>;
|
|
14
|
+
export type TBlockQuery<BlockFragment extends TCommonBlockFragment> = {
|
|
15
|
+
__typename?: 'Query';
|
|
16
|
+
} & {
|
|
17
|
+
[blockKey: string]: {
|
|
18
|
+
' $fragmentRefs'?: {
|
|
19
|
+
[blockFragmentKey: string]: BlockFragment;
|
|
20
|
+
} | null | undefined;
|
|
21
|
+
} | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type TBlockVariables<BlockVariables extends Variables = Variables> = {
|
|
24
|
+
id: string;
|
|
25
|
+
} & BlockVariables;
|
|
26
|
+
export type TBlockDocument<BlockFragment extends TCommonBlockFragment, BlockVariables extends Variables = Variables> = TypedDocumentNode<TBlockQuery<BlockFragment>, TBlockVariables<BlockVariables>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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';
|
|
4
|
+
type TGetBlockPropsParams<BlockFragment extends TCommonBlockFragment, BlockVariables extends Variables = Variables> = {
|
|
5
|
+
document?: TBlockDocument<BlockFragment, BlockVariables>;
|
|
6
|
+
item?: Nullable<NonNullable<NonNullable<TBlockQuery<BlockFragment>[string]>[' $fragmentRefs']>[string]>;
|
|
7
|
+
blockKey?: string;
|
|
8
|
+
variables?: TBlockVariables<BlockVariables>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Returns the passed item if it is defined. Otherwise, queried its own block
|
|
12
|
+
* @param params.blockKey Key of the queried field
|
|
13
|
+
* @param params.item Item of the block. If null or only contains the block's id, the function will make a query
|
|
14
|
+
* @returns The block data
|
|
15
|
+
*/
|
|
16
|
+
export default function getBlockProps<BlockFragment extends TCommonBlockFragment, BlockVariables extends Variables = Variables>(params: TGetBlockPropsParams<BlockFragment, BlockVariables>): Promise<BlockFragment | null | undefined>;
|
|
17
|
+
export {};
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Nullable } from '@okam/stack-ui';
|
|
2
|
+
import type { TBlockSerializerConfig } from '../components/BlockSerializer/interface';
|
|
3
|
+
/**
|
|
4
|
+
* Merges multiple block dispatcher configs
|
|
5
|
+
* @param baseConfig The base configuration. Other configurations will be prioritized over this one, which acts as a fallback
|
|
6
|
+
* @param configs Array of block dispatcher serializers to merge. Later elements will always be prioritized over first elements
|
|
7
|
+
* @returns Merged config
|
|
8
|
+
*/
|
|
9
|
+
export default function mergeConfigs(baseConfig: TBlockSerializerConfig, ...configs: Nullable<TBlockSerializerConfig>[]): TBlockSerializerConfig;
|
package/.eslintrc.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const { getDefaultIgnorePatterns } = require("../../../linter/helpers");
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: ['plugin:@nx/react', '../../../.eslintrc.js', '../../../linter/bases/typescript', '../../../linter/bases/regexp', '../../../linter/bases/jest', '../../../linter/bases/rtl', '../../../linter/bases/react', '../../../linter/bases/prettier'],
|
|
5
|
-
ignorePatterns: ['!**/*', ...getDefaultIgnorePatterns()],
|
|
6
|
-
overrides: [
|
|
7
|
-
{
|
|
8
|
-
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
9
|
-
// We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
|
|
10
|
-
parserOptions: {
|
|
11
|
-
project: `${__dirname}/tsconfig.*?.json`,
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
"@nx/dependency-checks": "error"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
rules: {
|
|
19
|
-
'react/react-in-jsx-scope': 'off',
|
|
20
|
-
},
|
|
21
|
-
}
|
package/.storybook/.eslintrc.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const { getDefaultIgnorePatterns } = require('../../../../linter/helpers')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: [
|
|
5
|
-
'plugin:@nx/react',
|
|
6
|
-
'../../../../.eslintrc.js',
|
|
7
|
-
'../../../../linter/bases/typescript',
|
|
8
|
-
'../../../../linter/bases/regexp',
|
|
9
|
-
'../../../../linter/bases/jest',
|
|
10
|
-
'../../../../linter/bases/rtl',
|
|
11
|
-
'../../../../linter/bases/storybook',
|
|
12
|
-
'../../../../linter/bases/react',
|
|
13
|
-
'../../../../linter/bases/prettier',
|
|
14
|
-
'plugin:storybook/recommended',
|
|
15
|
-
],
|
|
16
|
-
ignorePatterns: ['!**/*', ...getDefaultIgnorePatterns()],
|
|
17
|
-
overrides: [
|
|
18
|
-
{
|
|
19
|
-
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
20
|
-
// We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
|
|
21
|
-
parserOptions: {
|
|
22
|
-
project: `${__dirname}/tsconfig.*?.json`,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
rules: {
|
|
27
|
-
'react/react-in-jsx-scope': 'off',
|
|
28
|
-
},
|
|
29
|
-
}
|
package/.storybook/main.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
import type { StorybookConfig } from '@storybook/nextjs'
|
|
3
|
-
|
|
4
|
-
const config: StorybookConfig = {
|
|
5
|
-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
|
6
|
-
addons: [
|
|
7
|
-
'@storybook/addon-a11y',
|
|
8
|
-
'@storybook/addon-links',
|
|
9
|
-
'@storybook/addon-essentials',
|
|
10
|
-
'@storybook/addon-interactions',
|
|
11
|
-
{
|
|
12
|
-
name: '@storybook/addon-styling',
|
|
13
|
-
options: {
|
|
14
|
-
// Check out https://github.com/storybookjs/addon-styling/blob/main/docs/api.md
|
|
15
|
-
// For more details on this addon's options.
|
|
16
|
-
postCss: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
framework: {
|
|
21
|
-
name: '@storybook/nextjs',
|
|
22
|
-
options: {},
|
|
23
|
-
},
|
|
24
|
-
docs: {
|
|
25
|
-
autodocs: 'tag',
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default config
|
|
30
|
-
|
|
31
|
-
// To customize your Vite configuration you can use the viteFinal field.
|
|
32
|
-
// Check https://storybook.js.org/docs/react/builders/vite#configuration
|
|
33
|
-
// and https://nx.dev/packages/storybook/documents/custom-builder-configs
|
package/.storybook/preview.ts
DELETED
|
File without changes
|
package/.storybook/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"emitDecoratorMetadata": true
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
"exclude": ["../**/*.spec.ts"],
|
|
8
|
-
"include": [
|
|
9
|
-
"../src/**/*.stories.ts",
|
|
10
|
-
"../src/**/*.stories.js",
|
|
11
|
-
"../src/**/*.stories.jsx",
|
|
12
|
-
"../src/**/*.stories.tsx",
|
|
13
|
-
"../src/**/*.stories.mdx",
|
|
14
|
-
"*.ts",
|
|
15
|
-
"*.js"
|
|
16
|
-
]
|
|
17
|
-
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
## 1.2.0 (2024-06-28)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### 🚀 Features
|
|
5
|
-
|
|
6
|
-
- STACK-72-Lib-Create-directus-block ([#115](https://github.com/OKAMca/stack/pull/115))
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### 🩹 Fixes
|
|
10
|
-
|
|
11
|
-
- publishing for new libs ([#125](https://github.com/OKAMca/stack/pull/125))
|
|
12
|
-
|
|
13
|
-
- **directus-block:** update package version ([9f93408](https://github.com/OKAMca/stack/commit/9f93408))
|
|
14
|
-
|
|
15
|
-
- **block-directus:** add server only to get block props ([330e76f](https://github.com/OKAMca/stack/commit/330e76f))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### ❤️ Thank You
|
|
19
|
-
|
|
20
|
-
- Marie-Maxime Tanguay @marie-maxime
|
|
21
|
-
- Pierre-Olivier Clerson @poclerson
|
package/README.md
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
# directus-block
|
|
2
|
-
|
|
3
|
-
This library was generated with [Nx](https://nx.dev).
|
|
4
|
-
|
|
5
|
-
## Building
|
|
6
|
-
|
|
7
|
-
Run `nx build directus-block` to build the library.
|
|
8
|
-
|
|
9
|
-
## Components
|
|
10
|
-
|
|
11
|
-
### Dispatcher
|
|
12
|
-
|
|
13
|
-
#### Props
|
|
14
|
-
|
|
15
|
-
- config: Configuration the block dispatcher will use. This configuration will get merged with the base config of directus-block. In case of overrides, the passed configuration will always win over the directus-block configuration.
|
|
16
|
-
- blocks: Array of `TBlockSerializerProps` containing the actual blocks data. This is the prop that will be used by the block dispatcher to iterate through its children.
|
|
17
|
-
- block: In case you want to pass a single block
|
|
18
|
-
- children: Function receiving the current block `TBlockSerializerProps` as props. Will use BlockSerializer alone by default. This is useful in scenarios where you want every block to be wrapped in other components:
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
<BlockDispatcher config={baseBlockDispatcherConfig} blocks={blocks}>
|
|
22
|
-
{(block) => (
|
|
23
|
-
<Container tokens={{ isLowestContainerLevel: true }}>
|
|
24
|
-
<ErrorBoundary fallback={<ErrorFallback />}>
|
|
25
|
-
<BlockSerializer {...block} />
|
|
26
|
-
</ErrorBoundary>
|
|
27
|
-
</Container>
|
|
28
|
-
)}
|
|
29
|
-
</BlockDispatcher>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
This would allow to remove a lot of repetitive code accross blocks definitions, for example as they all need to be wrapped in a `Container` and an `ErrorBoundary`
|
|
33
|
-
|
|
34
|
-
### Serializer
|
|
35
|
-
|
|
36
|
-
This component calls the good component in the configuration from the `collection` prop
|
|
37
|
-
|
|
38
|
-
## Configuration
|
|
39
|
-
|
|
40
|
-
A configuration uses the `components` prop to map a key value, like so:
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
const config = {
|
|
44
|
-
components: {
|
|
45
|
-
block_wysiwyg: {
|
|
46
|
-
default: (props) => <BlockWysiwyg {...props} />,
|
|
47
|
-
document: BlockWysiwygDocument,
|
|
48
|
-
defaultVariant: 'reversed',
|
|
49
|
-
getVariant: (props) => props.settings.variants,
|
|
50
|
-
variants: {
|
|
51
|
-
reversed: (props) => (
|
|
52
|
-
<ReversedThemeProvider>
|
|
53
|
-
<BlockWysiwyg {...props} />
|
|
54
|
-
</ReversedThemeProvider>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Props
|
|
63
|
-
|
|
64
|
-
- default: The default component if no variants/invalid variants are used
|
|
65
|
-
- defaultVariant: Overrides the default use of the `default` prop, instead mapping the default component on a specific variant
|
|
66
|
-
- getVariant: Callback to specify a different variant path from the one in the block's settings
|
|
67
|
-
- variants: key-value mapping of `{[variant]: component}`
|
|
68
|
-
- document: The necessary document for querying the data. This prop can either be passed directly to the block or in the config. Since Stack blocks don't yet have their own documents, you can override them and add their document like so:
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
import { blockWysiwygConfig } from '@okam/directus-block'
|
|
72
|
-
|
|
73
|
-
const brandConfig = {
|
|
74
|
-
components: {
|
|
75
|
-
block_wysiwyg: {
|
|
76
|
-
document: BlockWysiwygDocument,
|
|
77
|
-
...blockWysiwygConfig.block_wysiwyg,
|
|
78
|
-
},
|
|
79
|
-
block_image: {
|
|
80
|
-
default: (props) => <BrandBlockImage {...props} />
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
<BlockDispatcher config={brandConfig} />
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Overriding the configuration with brand blocks
|
|
89
|
-
|
|
90
|
-
To override the base block dispatcher configuration, you name a block component configuration with the same key as the ones in the configuration.
|
|
91
|
-
|
|
92
|
-
For example, if this is the base configuration:
|
|
93
|
-
|
|
94
|
-
```tsx
|
|
95
|
-
const baseConfig = {
|
|
96
|
-
components: {
|
|
97
|
-
block_wysiwyg: {
|
|
98
|
-
default: (props) => <BlockWysiwyg {...props}>,
|
|
99
|
-
},
|
|
100
|
-
block_hero: {
|
|
101
|
-
default: (props) => <BlockHero {...props}>,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
But that you to call a branded wysiwyg component from the dispatcher configuration, you may pass the following configuration:
|
|
108
|
-
|
|
109
|
-
```tsx
|
|
110
|
-
const brandConfig = {
|
|
111
|
-
components: {
|
|
112
|
-
block_wysiwyg: {
|
|
113
|
-
default: (props) => <BrandBlockWysiwyg {...props} />
|
|
114
|
-
},
|
|
115
|
-
block_image: {
|
|
116
|
-
default: (props) => <BrandBlockImage {...props} />
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
<BlockDispatcher config={brandConfig} />
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
In this example, the BlockWysiwyg definition would be overriden. However, you would now also have access to the `block_image`, and still retain access to the `block_hero`
|
|
125
|
-
|
|
126
|
-
You could also re-use only a part of the base configuration while overriding another part
|
|
127
|
-
|
|
128
|
-
```tsx
|
|
129
|
-
import { blockWysiwygConfig } from '@okam/directus-block'
|
|
130
|
-
|
|
131
|
-
const brandConfig = {
|
|
132
|
-
components: {
|
|
133
|
-
block_wysiwyg: {
|
|
134
|
-
default: (props) => <BrandBlockWysiwyg {...props} />,
|
|
135
|
-
variants: blockWysiwygConfig.block_wysiwyg.variants,
|
|
136
|
-
},
|
|
137
|
-
block_image: {
|
|
138
|
-
default: (props) => <BrandBlockImage {...props} />
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
<BlockDispatcher config={brandConfig} />
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Extending the configuration with stack blocks
|
|
147
|
-
|
|
148
|
-
Some blocks may be in the Stack without being in the base configuration. To use them, simply import their own configuration from the stack and spread them in yours
|
|
149
|
-
|
|
150
|
-
```tsx
|
|
151
|
-
import { blockHeroConfig } from '@okam/directus-block'
|
|
152
|
-
|
|
153
|
-
const brandConfigWithStackBlocks = {
|
|
154
|
-
components: {
|
|
155
|
-
block_image: {
|
|
156
|
-
default: (props) => <BrandBlockImage {...props} />
|
|
157
|
-
},
|
|
158
|
-
...blockHeroConfig,
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
```
|
package/project.json
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "directus-block",
|
|
3
|
-
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "libs/directus/directus-block/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"tags": [],
|
|
7
|
-
"targets": {
|
|
8
|
-
"lint": {
|
|
9
|
-
"executor": "@nx/linter:eslint",
|
|
10
|
-
"outputs": ["{options.outputFile}"],
|
|
11
|
-
"options": {
|
|
12
|
-
"lintFilePatterns": ["libs/directus/directus-block/**/*.{ts,tsx,js,jsx}"]
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"build": {
|
|
16
|
-
"executor": "@nx/vite:build",
|
|
17
|
-
"outputs": ["{options.outputPath}"],
|
|
18
|
-
"defaultConfiguration": "production",
|
|
19
|
-
"options": {
|
|
20
|
-
"outputPath": "dist/libs/directus/directus-block"
|
|
21
|
-
},
|
|
22
|
-
"configurations": {
|
|
23
|
-
"development": {
|
|
24
|
-
"mode": "development"
|
|
25
|
-
},
|
|
26
|
-
"production": {
|
|
27
|
-
"mode": "production"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"storybook": {
|
|
32
|
-
"executor": "@nx/storybook:storybook",
|
|
33
|
-
"options": {
|
|
34
|
-
"port": 4400,
|
|
35
|
-
"configDir": "libs/directus/directus-block/.storybook"
|
|
36
|
-
},
|
|
37
|
-
"configurations": {
|
|
38
|
-
"ci": {
|
|
39
|
-
"quiet": true
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"build-storybook": {
|
|
44
|
-
"executor": "@nx/storybook:build",
|
|
45
|
-
"outputs": ["{options.outputDir}"],
|
|
46
|
-
"options": {
|
|
47
|
-
"outputDir": "dist/storybook/directus-block",
|
|
48
|
-
"configDir": "libs/directus/directus-block/.storybook"
|
|
49
|
-
},
|
|
50
|
-
"configurations": {
|
|
51
|
-
"ci": {
|
|
52
|
-
"quiet": true
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TBlockSerializerConfigComponent } from '../../components/BlockSerializer/interface'
|
|
2
|
-
import BlockWysiwyg from '.'
|
|
3
|
-
|
|
4
|
-
const blockWysiwygConfig: TBlockSerializerConfigComponent = {
|
|
5
|
-
block_wysiwyg: {
|
|
6
|
-
default: (props) => <BlockWysiwyg {...props} />,
|
|
7
|
-
},
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default blockWysiwygConfig
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Box, WysiwygBlock } from '@okam/stack-ui'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import type { TBlockSerializerProps } from '../../components/BlockSerializer/interface'
|
|
4
|
-
import { BlockSettingsFragmentDoc } from '../../generated/graphql'
|
|
5
|
-
import { getBlockProps, getFragment } from '../../utils'
|
|
6
|
-
import type { BlockWysiwygFragment } from './interface'
|
|
7
|
-
|
|
8
|
-
const BlockWysiwyg = async (props: TBlockSerializerProps<BlockWysiwygFragment>) => {
|
|
9
|
-
const { variables, themeName = 'wysiwyg', tokens, item, document } = props
|
|
10
|
-
|
|
11
|
-
const propsWithFallback = await getBlockProps({
|
|
12
|
-
item,
|
|
13
|
-
blockKey: 'block_wysiwyg_by_id',
|
|
14
|
-
document,
|
|
15
|
-
variables,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
if (!propsWithFallback) return null
|
|
19
|
-
|
|
20
|
-
const { content, title, level, settings } = propsWithFallback
|
|
21
|
-
|
|
22
|
-
const { tokens: cmsTokens } = getFragment(BlockSettingsFragmentDoc, settings) ?? {}
|
|
23
|
-
|
|
24
|
-
if (!content && !(title && level)) return null
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
{title && level && (
|
|
29
|
-
<Box as="span" themeName={themeName} tokens={{ ...tokens, ...cmsTokens }}>
|
|
30
|
-
{React.createElement(level, {}, title)}
|
|
31
|
-
</Box>
|
|
32
|
-
)}
|
|
33
|
-
{content && <WysiwygBlock themeName={themeName} tokens={{ ...tokens, ...cmsTokens }} content={content} />}
|
|
34
|
-
</>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default BlockWysiwyg
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import type { BlockSettingsFragment } from '../../generated/graphql'
|
|
3
|
-
|
|
4
|
-
export type BlockWysiwygFragment = {
|
|
5
|
-
__typename?: 'block_wysiwyg'
|
|
6
|
-
title?: string | null
|
|
7
|
-
content?: string | null
|
|
8
|
-
level?: string | null
|
|
9
|
-
variant?: string | null
|
|
10
|
-
settings?:
|
|
11
|
-
| ({ __typename?: 'block_settings' } & { ' $fragmentRefs'?: { BlockSettingsFragment: BlockSettingsFragment } })
|
|
12
|
-
| null
|
|
13
|
-
} & { ' $fragmentName'?: 'BlockWysiwygFragment' }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import blockWysiwygConfig from '../../blocks/BlockWysiwyg/config'
|
|
2
|
-
import type { TBlockSerializerConfig } from '../BlockSerializer/interface'
|
|
3
|
-
|
|
4
|
-
const baseConfig: TBlockSerializerConfig = {
|
|
5
|
-
components: {
|
|
6
|
-
...blockWysiwygConfig,
|
|
7
|
-
},
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default baseConfig
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Nullable } from '@okam/stack-ui'
|
|
2
|
-
import { mergeConfigs } from '../../utils'
|
|
3
|
-
import BlockSerializer from '../BlockSerializer'
|
|
4
|
-
import type { TBlockSerializerProps } from '../BlockSerializer/interface'
|
|
5
|
-
import baseConfig from './config'
|
|
6
|
-
import type { TBlockDispatcherProps } from './interface'
|
|
7
|
-
|
|
8
|
-
const BlockDispatcher = (props: TBlockDispatcherProps) => {
|
|
9
|
-
const { children, config, ...rest } = props
|
|
10
|
-
|
|
11
|
-
const finalConfig = mergeConfigs(baseConfig, config)
|
|
12
|
-
|
|
13
|
-
const renderBlock = (blockProps: Nullable<TBlockSerializerProps>) => {
|
|
14
|
-
return children ? (
|
|
15
|
-
children({ ...rest, ...blockProps, config: finalConfig })
|
|
16
|
-
) : (
|
|
17
|
-
<BlockSerializer {...rest} {...blockProps} config={finalConfig} />
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if ('blocks' in props) {
|
|
22
|
-
const { blocks } = props
|
|
23
|
-
return blocks.map(renderBlock)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const { block } = props
|
|
27
|
-
return renderBlock(block)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default BlockDispatcher
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import type { TDefaultComponent, Nullable } from '@okam/stack-ui'
|
|
3
|
-
import type React from 'react'
|
|
4
|
-
import type { TAdditionalProps } from '../../types/block'
|
|
5
|
-
import type { TBlockSerializerProps, TBlockSerializerConfig } from '../BlockSerializer/interface'
|
|
6
|
-
|
|
7
|
-
interface TBaseBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps>
|
|
8
|
-
extends Omit<TDefaultComponent, 'children'> {
|
|
9
|
-
config?: TBlockSerializerConfig
|
|
10
|
-
defaultVariant?: string
|
|
11
|
-
additionalProps?: AdditionalProps
|
|
12
|
-
children?: (props: TBlockSerializerProps) => React.ReactNode
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type TBlockDispatcherProps<AdditionalProps extends TAdditionalProps = TAdditionalProps> =
|
|
16
|
-
| (TBaseBlockDispatcherProps<AdditionalProps> & { block: Nullable<TBlockSerializerProps> })
|
|
17
|
-
| (TBaseBlockDispatcherProps<AdditionalProps> & { blocks: Nullable<TBlockSerializerProps>[] })
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { BlockSettingsFragmentDoc } from '../../generated/graphql'
|
|
2
|
-
import { getFragment } from '../../utils'
|
|
3
|
-
import type { TBlockSerializerProps } from './interface'
|
|
4
|
-
|
|
5
|
-
const BlockSerializer = (props: TBlockSerializerProps) => {
|
|
6
|
-
const { item, collection, config, variables, defaultVariant, ...rest } = props
|
|
7
|
-
|
|
8
|
-
if (!collection || !item || !config) return null
|
|
9
|
-
|
|
10
|
-
const blockConfig = config?.components?.[collection]
|
|
11
|
-
|
|
12
|
-
if (!blockConfig) return null
|
|
13
|
-
|
|
14
|
-
const { id, settings } = item
|
|
15
|
-
|
|
16
|
-
const { variant } = getFragment(BlockSettingsFragmentDoc, settings) ?? {}
|
|
17
|
-
|
|
18
|
-
const variantWithFallback = blockConfig.getVariant?.(props) ?? variant ?? defaultVariant
|
|
19
|
-
|
|
20
|
-
const { default: defaultBlockComponent, document } = blockConfig
|
|
21
|
-
|
|
22
|
-
const variantBlockComponent = blockConfig.variants?.[variantWithFallback ?? '']
|
|
23
|
-
const BlockComponent = variantBlockComponent ?? defaultBlockComponent
|
|
24
|
-
|
|
25
|
-
if (!BlockComponent) return null
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<BlockComponent
|
|
29
|
-
key={id}
|
|
30
|
-
document={document}
|
|
31
|
-
config={config}
|
|
32
|
-
collection={collection}
|
|
33
|
-
item={item}
|
|
34
|
-
{...(id ? { variables: { ...variables, id } } : { variables })}
|
|
35
|
-
{...rest}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default BlockSerializer
|