@frontify/guideline-blocks-settings 0.25.2 → 0.25.3
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 +9 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +24 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @frontify/guideline-blocks-settings
|
|
2
2
|
|
|
3
|
+
## 0.25.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f140510`](https://github.com/Frontify/brand-sdk/commit/f14051013520f73a9e60bcbac704eb607a69468a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Added documentation link to the types.
|
|
8
|
+
Added custom section handling in types.
|
|
9
|
+
- Updated dependencies [[`ac89fc6`](https://github.com/Frontify/brand-sdk/commit/ac89fc60cdf58d1a7cae2aae2a057c744fc7e9b6)]:
|
|
10
|
+
- @frontify/sidebar-settings@0.0.7
|
|
11
|
+
|
|
3
12
|
## 0.25.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object.\n */\nexport const defineSettings = (settingsStructure: BlockSettingsStructureExport): BlockSettingsStructureExport =>\n settingsStructure;\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":"0JAcY,IAAAA,GAAAA,IACRA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,QAAU,UANFA,IAAAA,GAAA,CAAA,CAAA,EAyDC,MAAAC,EAAeC,GAAiDA,EAKhEC,EAAkBC,GAC3BA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,13 +4,31 @@ import type { FC } from 'react';
|
|
|
4
4
|
import type { SettingBlock as SettingBlock_2 } from '@frontify/sidebar-settings';
|
|
5
5
|
|
|
6
6
|
export declare type BlockConfigExport = {
|
|
7
|
+
/**
|
|
8
|
+
* Block component to render.
|
|
9
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}
|
|
10
|
+
*/
|
|
7
11
|
block: FC<BlockProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Contains the block settings and its structure.
|
|
14
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}
|
|
15
|
+
*/
|
|
8
16
|
settings: ReturnType<typeof defineSettings>;
|
|
17
|
+
/**
|
|
18
|
+
* Block lifecycle hook ran before the block gets added in the Guideline.
|
|
19
|
+
* The hook support both synchronous or asynchronous execution.
|
|
20
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}
|
|
21
|
+
*/
|
|
9
22
|
onBlockCreated?: (({ appBridge }: {
|
|
10
23
|
appBridge: AppBridgeBlock;
|
|
11
24
|
}) => void) | (({ appBridge }: {
|
|
12
25
|
appBridge: AppBridgeBlock;
|
|
13
26
|
}) => Promise<void>);
|
|
27
|
+
/**
|
|
28
|
+
* Block lifecycle hook ran before the block gets deleted from the Guideline.
|
|
29
|
+
* The hook support both synchronous or asynchronous execution.
|
|
30
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}
|
|
31
|
+
*/
|
|
14
32
|
onBlockDeleted?: (({ appBridge }: {
|
|
15
33
|
appBridge: AppBridgeBlock;
|
|
16
34
|
}) => void) | (({ appBridge }: {
|
|
@@ -19,6 +37,10 @@ export declare type BlockConfigExport = {
|
|
|
19
37
|
};
|
|
20
38
|
|
|
21
39
|
export declare type BlockProps = {
|
|
40
|
+
/**
|
|
41
|
+
* The Frontify App Bridge provides an interface to the Frontify app internals.
|
|
42
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}
|
|
43
|
+
*/
|
|
22
44
|
appBridge: AppBridgeBlock;
|
|
23
45
|
};
|
|
24
46
|
|
|
@@ -28,6 +50,8 @@ export declare type BlockSettingsStructureExport = {
|
|
|
28
50
|
[Sections.Layout]?: SettingBlock[];
|
|
29
51
|
[Sections.Style]?: SettingBlock[];
|
|
30
52
|
[Sections.Security]?: SettingBlock[];
|
|
53
|
+
} & {
|
|
54
|
+
[customSectionName: string]: SettingBlock[];
|
|
31
55
|
};
|
|
32
56
|
|
|
33
57
|
export declare type Bundle = Bundle_2<AppBridgeBlock>;
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object.\n */\nexport const defineSettings = (settingsStructure: BlockSettingsStructureExport): BlockSettingsStructureExport =>\n settingsStructure;\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":";AAcY,IAAAA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,UAAU,WANFA,IAAAA,KAAA,CAAA,CAAA;AAyDC,MAAAC,IAAc,CAACC,MAAiDA,GAKhEC,IAAiB,CAACC,MAC3BA;"}
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n Bundle as BundleSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object.\n */\nexport const defineSettings = (settingsStructure: BlockSettingsStructureExport): BlockSettingsStructureExport =>\n settingsStructure;\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":"sUAcY,IAAAA,GAAAA,IACRA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,QAAU,UANFA,IAAAA,GAAA,CAAA,CAAA,EAyDC,MAAAC,EAAeC,GAAiDA,EAKhEC,EAAkBC,GAC3BA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "Provides types and helpers for the guideline block development",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@frontify/fondue": "latest",
|
|
32
32
|
"@frontify/app-bridge": "3.0.0-beta.30",
|
|
33
|
-
"@frontify/sidebar-settings": "0.0.
|
|
33
|
+
"@frontify/sidebar-settings": "0.0.7"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@frontify/app-bridge": "*"
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
|
+
import type { FC } from 'react';
|
|
3
4
|
import type { AppBridgeBlock } from '@frontify/app-bridge';
|
|
4
5
|
import type {
|
|
5
6
|
Bundle as BundleSidebarSettings,
|
|
6
7
|
SettingBlock as SettingBlockSidebarSettings,
|
|
7
8
|
} from '@frontify/sidebar-settings';
|
|
8
|
-
import type { FC } from 'react';
|
|
9
9
|
|
|
10
10
|
export * from '@frontify/sidebar-settings';
|
|
11
11
|
|
|
@@ -27,18 +27,40 @@ export type BlockSettingsStructureExport = {
|
|
|
27
27
|
[Sections.Layout]?: SettingBlock[];
|
|
28
28
|
[Sections.Style]?: SettingBlock[];
|
|
29
29
|
[Sections.Security]?: SettingBlock[];
|
|
30
|
-
};
|
|
30
|
+
} & { [customSectionName: string]: SettingBlock[] };
|
|
31
31
|
|
|
32
32
|
export type BlockProps = {
|
|
33
|
+
/**
|
|
34
|
+
* The Frontify App Bridge provides an interface to the Frontify app internals.
|
|
35
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}
|
|
36
|
+
*/
|
|
33
37
|
appBridge: AppBridgeBlock;
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
export type BlockConfigExport = {
|
|
41
|
+
/**
|
|
42
|
+
* Block component to render.
|
|
43
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}
|
|
44
|
+
*/
|
|
37
45
|
block: FC<BlockProps>;
|
|
46
|
+
/**
|
|
47
|
+
* Contains the block settings and its structure.
|
|
48
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}
|
|
49
|
+
*/
|
|
38
50
|
settings: ReturnType<typeof defineSettings>;
|
|
51
|
+
/**
|
|
52
|
+
* Block lifecycle hook ran before the block gets added in the Guideline.
|
|
53
|
+
* The hook support both synchronous or asynchronous execution.
|
|
54
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}
|
|
55
|
+
*/
|
|
39
56
|
onBlockCreated?:
|
|
40
57
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
41
58
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|
|
59
|
+
/**
|
|
60
|
+
* Block lifecycle hook ran before the block gets deleted from the Guideline.
|
|
61
|
+
* The hook support both synchronous or asynchronous execution.
|
|
62
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}
|
|
63
|
+
*/
|
|
42
64
|
onBlockDeleted?:
|
|
43
65
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
44
66
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|