@frontify/guideline-blocks-settings 0.25.2 → 0.25.4
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 +15 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +75 -0
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +58 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @frontify/guideline-blocks-settings
|
|
2
2
|
|
|
3
|
+
## 0.25.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`56eecbe`](https://github.com/Frontify/brand-sdk/commit/56eecbe5c5b60080d814dc5678510af8aeb111f8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add more export with AppBridge passed to generic
|
|
8
|
+
|
|
9
|
+
## 0.25.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f140510`](https://github.com/Frontify/brand-sdk/commit/f14051013520f73a9e60bcbac704eb607a69468a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Added documentation link to the types.
|
|
14
|
+
Added custom section handling in types.
|
|
15
|
+
- Updated dependencies [[`ac89fc6`](https://github.com/Frontify/brand-sdk/commit/ac89fc60cdf58d1a7cae2aae2a057c744fc7e9b6)]:
|
|
16
|
+
- @frontify/sidebar-settings@0.0.7
|
|
17
|
+
|
|
3
18
|
## 0.25.2
|
|
4
19
|
|
|
5
20
|
### 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 AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SliderBlock as SliderBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock = BaseBlockSidebarSettings<AppBridgeBlock>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SliderBlock = SliderBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\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":"0JAgDY,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
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
import type { AppBridgeBlock } from '@frontify/app-bridge';
|
|
2
|
+
import type { AssetInputBlock as AssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
3
|
+
import type { BaseBlock as BaseBlock_2 } from '@frontify/sidebar-settings';
|
|
2
4
|
import type { Bundle as Bundle_2 } from '@frontify/sidebar-settings';
|
|
5
|
+
import type { ChecklistBlock as ChecklistBlock_2 } from '@frontify/sidebar-settings';
|
|
6
|
+
import type { ChoicesType as ChoicesType_2 } from '@frontify/sidebar-settings';
|
|
7
|
+
import type { DropdownBlock as DropdownBlock_2 } from '@frontify/sidebar-settings';
|
|
8
|
+
import type { DynamicSupportedBlock as DynamicSupportedBlock_2 } from '@frontify/sidebar-settings';
|
|
3
9
|
import type { FC } from 'react';
|
|
10
|
+
import type { InputBlock as InputBlock_2 } from '@frontify/sidebar-settings';
|
|
11
|
+
import type { LegacyAssetInputBlock as LegacyAssetInputBlock_2 } from '@frontify/sidebar-settings';
|
|
12
|
+
import type { LinkChooserBlock as LinkChooserBlock_2 } from '@frontify/sidebar-settings';
|
|
13
|
+
import type { MultiInputBlock as MultiInputBlock_2 } from '@frontify/sidebar-settings';
|
|
14
|
+
import type { NotificationBlock as NotificationBlock_2 } from '@frontify/sidebar-settings';
|
|
15
|
+
import type { SectionHeadingBlock as SectionHeadingBlock_2 } from '@frontify/sidebar-settings';
|
|
4
16
|
import type { SettingBlock as SettingBlock_2 } from '@frontify/sidebar-settings';
|
|
17
|
+
import type { SliderBlock as SliderBlock_2 } from '@frontify/sidebar-settings';
|
|
18
|
+
import type { SwitchBlock as SwitchBlock_2 } from '@frontify/sidebar-settings';
|
|
19
|
+
import type { TemplateInputBlock as TemplateInputBlock_2 } from '@frontify/sidebar-settings';
|
|
20
|
+
import type { TextareaBlock as TextareaBlock_2 } from '@frontify/sidebar-settings';
|
|
21
|
+
import type { ValueOrPromisedValue as ValueOrPromisedValue_2 } from '@frontify/sidebar-settings';
|
|
22
|
+
|
|
23
|
+
export declare type AssetInputBlock = AssetInputBlock_2<AppBridgeBlock>;
|
|
24
|
+
|
|
25
|
+
export declare type BaseBlock = BaseBlock_2<AppBridgeBlock>;
|
|
5
26
|
|
|
6
27
|
export declare type BlockConfigExport = {
|
|
28
|
+
/**
|
|
29
|
+
* Block component to render.
|
|
30
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}
|
|
31
|
+
*/
|
|
7
32
|
block: FC<BlockProps>;
|
|
33
|
+
/**
|
|
34
|
+
* Contains the block settings and its structure.
|
|
35
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}
|
|
36
|
+
*/
|
|
8
37
|
settings: ReturnType<typeof defineSettings>;
|
|
38
|
+
/**
|
|
39
|
+
* Block lifecycle hook ran before the block gets added in the Guideline.
|
|
40
|
+
* The hook support both synchronous or asynchronous execution.
|
|
41
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}
|
|
42
|
+
*/
|
|
9
43
|
onBlockCreated?: (({ appBridge }: {
|
|
10
44
|
appBridge: AppBridgeBlock;
|
|
11
45
|
}) => void) | (({ appBridge }: {
|
|
12
46
|
appBridge: AppBridgeBlock;
|
|
13
47
|
}) => Promise<void>);
|
|
48
|
+
/**
|
|
49
|
+
* Block lifecycle hook ran before the block gets deleted from the Guideline.
|
|
50
|
+
* The hook support both synchronous or asynchronous execution.
|
|
51
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}
|
|
52
|
+
*/
|
|
14
53
|
onBlockDeleted?: (({ appBridge }: {
|
|
15
54
|
appBridge: AppBridgeBlock;
|
|
16
55
|
}) => void) | (({ appBridge }: {
|
|
@@ -19,6 +58,10 @@ export declare type BlockConfigExport = {
|
|
|
19
58
|
};
|
|
20
59
|
|
|
21
60
|
export declare type BlockProps = {
|
|
61
|
+
/**
|
|
62
|
+
* The Frontify App Bridge provides an interface to the Frontify app internals.
|
|
63
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}
|
|
64
|
+
*/
|
|
22
65
|
appBridge: AppBridgeBlock;
|
|
23
66
|
};
|
|
24
67
|
|
|
@@ -28,10 +71,16 @@ export declare type BlockSettingsStructureExport = {
|
|
|
28
71
|
[Sections.Layout]?: SettingBlock[];
|
|
29
72
|
[Sections.Style]?: SettingBlock[];
|
|
30
73
|
[Sections.Security]?: SettingBlock[];
|
|
74
|
+
} & {
|
|
75
|
+
[customSectionName: string]: SettingBlock[];
|
|
31
76
|
};
|
|
32
77
|
|
|
33
78
|
export declare type Bundle = Bundle_2<AppBridgeBlock>;
|
|
34
79
|
|
|
80
|
+
export declare type ChecklistBlock = ChecklistBlock_2<AppBridgeBlock>;
|
|
81
|
+
|
|
82
|
+
export declare type ChoicesType = ChoicesType_2<AppBridgeBlock>;
|
|
83
|
+
|
|
35
84
|
/**
|
|
36
85
|
* Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.
|
|
37
86
|
*/
|
|
@@ -42,6 +91,22 @@ export declare const defineBlock: (config: BlockConfigExport) => BlockConfigExpo
|
|
|
42
91
|
*/
|
|
43
92
|
export declare const defineSettings: (settingsStructure: BlockSettingsStructureExport) => BlockSettingsStructureExport;
|
|
44
93
|
|
|
94
|
+
export declare type DropdownBlock = DropdownBlock_2<AppBridgeBlock>;
|
|
95
|
+
|
|
96
|
+
export declare type DynamicSupportedBlock = DynamicSupportedBlock_2<AppBridgeBlock>;
|
|
97
|
+
|
|
98
|
+
export declare type InputBlock = InputBlock_2<AppBridgeBlock>;
|
|
99
|
+
|
|
100
|
+
export declare type LegacyAssetInputBlock = LegacyAssetInputBlock_2<AppBridgeBlock>;
|
|
101
|
+
|
|
102
|
+
export declare type LinkChooserBlock = LinkChooserBlock_2<AppBridgeBlock>;
|
|
103
|
+
|
|
104
|
+
export declare type MultiInputBlock = MultiInputBlock_2<AppBridgeBlock>;
|
|
105
|
+
|
|
106
|
+
export declare type NotificationBlock = NotificationBlock_2<AppBridgeBlock>;
|
|
107
|
+
|
|
108
|
+
export declare type SectionHeadingBlock = SectionHeadingBlock_2<AppBridgeBlock>;
|
|
109
|
+
|
|
45
110
|
export declare enum Sections {
|
|
46
111
|
Main = "main",
|
|
47
112
|
Basics = "basics",
|
|
@@ -53,6 +118,16 @@ export declare enum Sections {
|
|
|
53
118
|
|
|
54
119
|
export declare type SettingBlock = SettingBlock_2<AppBridgeBlock>;
|
|
55
120
|
|
|
121
|
+
export declare type SliderBlock = SliderBlock_2<AppBridgeBlock>;
|
|
122
|
+
|
|
123
|
+
export declare type SwitchBlock = SwitchBlock_2<AppBridgeBlock>;
|
|
124
|
+
|
|
125
|
+
export declare type TemplateInputBlock = TemplateInputBlock_2<AppBridgeBlock>;
|
|
126
|
+
|
|
127
|
+
export declare type TextareaBlock = TextareaBlock_2<AppBridgeBlock>;
|
|
128
|
+
|
|
129
|
+
export declare type ValueOrPromisedValue<T> = ValueOrPromisedValue_2<AppBridgeBlock, T>;
|
|
130
|
+
|
|
56
131
|
|
|
57
132
|
export * from "@frontify/sidebar-settings";
|
|
58
133
|
|
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 AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SliderBlock as SliderBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock = BaseBlockSidebarSettings<AppBridgeBlock>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SliderBlock = SliderBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\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":";AAgDY,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 AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SliderBlock as SliderBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock = BaseBlockSidebarSettings<AppBridgeBlock>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SliderBlock = SliderBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\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":"sUAgDY,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.4",
|
|
4
4
|
"description": "Provides types and helpers for the guideline block development",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@frontify/fondue": "latest",
|
|
32
|
-
"@frontify/app-bridge": "3.0.0-beta.
|
|
33
|
-
"@frontify/sidebar-settings": "0.0.
|
|
32
|
+
"@frontify/app-bridge": "3.0.0-beta.31",
|
|
33
|
+
"@frontify/sidebar-settings": "0.0.7"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@frontify/app-bridge": "*"
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,50 @@
|
|
|
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 {
|
|
6
|
+
AssetInputBlock as AssetInputBlockSidebarSettings,
|
|
7
|
+
BaseBlock as BaseBlockSidebarSettings,
|
|
5
8
|
Bundle as BundleSidebarSettings,
|
|
9
|
+
ChecklistBlock as ChecklistBlockSidebarSettings,
|
|
10
|
+
ChoicesType as ChoicesTypeSidebarSettings,
|
|
11
|
+
DropdownBlock as DropdownBlockSidebarSettings,
|
|
12
|
+
DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,
|
|
13
|
+
InputBlock as InputBlockSidebarSettings,
|
|
14
|
+
LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,
|
|
15
|
+
LinkChooserBlock as LinkChooserBlockSidebarSettings,
|
|
16
|
+
MultiInputBlock as MultiInputBlockSidebarSettings,
|
|
17
|
+
NotificationBlock as NotificationBlockSidebarSettings,
|
|
18
|
+
SectionHeadingBlock as SectionHeadingBlockSidebarSettings,
|
|
6
19
|
SettingBlock as SettingBlockSidebarSettings,
|
|
20
|
+
SliderBlock as SliderBlockSidebarSettings,
|
|
21
|
+
SwitchBlock as SwitchBlockSidebarSettings,
|
|
22
|
+
TemplateInputBlock as TemplateInputBlockSidebarSettings,
|
|
23
|
+
TextareaBlock as TextareaBlockSidebarSettings,
|
|
24
|
+
ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,
|
|
7
25
|
} from '@frontify/sidebar-settings';
|
|
8
|
-
import type { FC } from 'react';
|
|
9
26
|
|
|
10
27
|
export * from '@frontify/sidebar-settings';
|
|
11
28
|
|
|
29
|
+
export type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;
|
|
30
|
+
export type BaseBlock = BaseBlockSidebarSettings<AppBridgeBlock>;
|
|
12
31
|
export type Bundle = BundleSidebarSettings<AppBridgeBlock>;
|
|
32
|
+
export type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;
|
|
33
|
+
export type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;
|
|
34
|
+
export type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;
|
|
35
|
+
export type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;
|
|
36
|
+
export type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;
|
|
37
|
+
export type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;
|
|
38
|
+
export type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;
|
|
39
|
+
export type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;
|
|
40
|
+
export type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;
|
|
41
|
+
export type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;
|
|
13
42
|
export type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;
|
|
43
|
+
export type SliderBlock = SliderBlockSidebarSettings<AppBridgeBlock>;
|
|
44
|
+
export type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;
|
|
45
|
+
export type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;
|
|
46
|
+
export type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;
|
|
47
|
+
export type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;
|
|
14
48
|
|
|
15
49
|
export enum Sections {
|
|
16
50
|
Main = 'main',
|
|
@@ -27,18 +61,40 @@ export type BlockSettingsStructureExport = {
|
|
|
27
61
|
[Sections.Layout]?: SettingBlock[];
|
|
28
62
|
[Sections.Style]?: SettingBlock[];
|
|
29
63
|
[Sections.Security]?: SettingBlock[];
|
|
30
|
-
};
|
|
64
|
+
} & { [customSectionName: string]: SettingBlock[] };
|
|
31
65
|
|
|
32
66
|
export type BlockProps = {
|
|
67
|
+
/**
|
|
68
|
+
* The Frontify App Bridge provides an interface to the Frontify app internals.
|
|
69
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks/introducing-the-appbridge}
|
|
70
|
+
*/
|
|
33
71
|
appBridge: AppBridgeBlock;
|
|
34
72
|
};
|
|
35
73
|
|
|
36
74
|
export type BlockConfigExport = {
|
|
75
|
+
/**
|
|
76
|
+
* Block component to render.
|
|
77
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/content-blocks}
|
|
78
|
+
*/
|
|
37
79
|
block: FC<BlockProps>;
|
|
80
|
+
/**
|
|
81
|
+
* Contains the block settings and its structure.
|
|
82
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/block-settings}
|
|
83
|
+
*/
|
|
38
84
|
settings: ReturnType<typeof defineSettings>;
|
|
85
|
+
/**
|
|
86
|
+
* Block lifecycle hook ran before the block gets added in the Guideline.
|
|
87
|
+
* The hook support both synchronous or asynchronous execution.
|
|
88
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-creation}
|
|
89
|
+
*/
|
|
39
90
|
onBlockCreated?:
|
|
40
91
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
41
92
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|
|
93
|
+
/**
|
|
94
|
+
* Block lifecycle hook ran before the block gets deleted from the Guideline.
|
|
95
|
+
* The hook support both synchronous or asynchronous execution.
|
|
96
|
+
* {@link https://developer.frontify.com/document/1366#/details-concepts/new-block-lifecycle/on-block-deletion}
|
|
97
|
+
*/
|
|
42
98
|
onBlockDeleted?:
|
|
43
99
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
44
100
|
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|