@frontify/guideline-blocks-settings 0.25.0 → 0.25.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/.eslintrc.js +1 -6
- package/CHANGELOG.md +42 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +59 -20
- package/dist/index.es.js +6 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +19 -11
- package/src/index.ts +56 -0
- package/tsconfig.json +2 -1
- package/vite.config.ts +2 -2
- package/dist/blocks/assetInput.d.ts +0 -27
- package/dist/blocks/assetInput.es.js +0 -6
- package/dist/blocks/assetInput.es.js.map +0 -1
- package/dist/blocks/base.d.ts +0 -12
- package/dist/blocks/checkbox.d.ts +0 -7
- package/dist/blocks/checklist.d.ts +0 -8
- package/dist/blocks/choices.d.ts +0 -10
- package/dist/blocks/colorInput.d.ts +0 -7
- package/dist/blocks/dropdown.d.ts +0 -8
- package/dist/blocks/index.d.ts +0 -38
- package/dist/blocks/input.d.ts +0 -11
- package/dist/blocks/legacyAssetInput.d.ts +0 -25
- package/dist/blocks/legacyAssetInput.es.js +0 -6
- package/dist/blocks/legacyAssetInput.es.js.map +0 -1
- package/dist/blocks/linkChooser.d.ts +0 -14
- package/dist/blocks/multiInput.d.ts +0 -11
- package/dist/blocks/notification.d.ts +0 -29
- package/dist/blocks/notification.es.js +0 -6
- package/dist/blocks/notification.es.js.map +0 -1
- package/dist/blocks/sectionHeading.d.ts +0 -7
- package/dist/blocks/slider.d.ts +0 -5
- package/dist/blocks/switch.d.ts +0 -10
- package/dist/blocks/templateInput.d.ts +0 -5
- package/dist/blocks/textarea.d.ts +0 -7
- package/dist/bundle.d.ts +0 -10
- package/dist/validation.d.ts +0 -4
- package/types/blocks/assetInput.ts +0 -33
- package/types/blocks/base.ts +0 -19
- package/types/blocks/checkbox.ts +0 -9
- package/types/blocks/checklist.ts +0 -11
- package/types/blocks/choices.ts +0 -14
- package/types/blocks/colorInput.ts +0 -10
- package/types/blocks/dropdown.ts +0 -11
- package/types/blocks/index.ts +0 -59
- package/types/blocks/input.ts +0 -14
- package/types/blocks/legacyAssetInput.ts +0 -31
- package/types/blocks/linkChooser.ts +0 -14
- package/types/blocks/multiInput.ts +0 -14
- package/types/blocks/notification.ts +0 -35
- package/types/blocks/sectionHeading.ts +0 -10
- package/types/blocks/slider.ts +0 -8
- package/types/blocks/switch.ts +0 -13
- package/types/blocks/templateInput.ts +0 -8
- package/types/blocks/textarea.ts +0 -10
- package/types/bundle.ts +0 -14
- package/types/index.ts +0 -25
- package/types/validation.ts +0 -6
package/.eslintrc.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
extends: ['@frontify/eslint-config-
|
|
4
|
+
extends: ['@frontify/eslint-config-typescript'],
|
|
5
5
|
plugins: ['notice'],
|
|
6
|
-
settings: {
|
|
7
|
-
react: {
|
|
8
|
-
version: 'detect',
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
6
|
overrides: [
|
|
12
7
|
{
|
|
13
8
|
files: ['*.js', '*.ts', '*.tsx'],
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @frontify/guideline-blocks-settings
|
|
2
|
+
|
|
3
|
+
## 0.25.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`e58c9d5`](https://github.com/Frontify/brand-sdk/commit/e58c9d5ef0b20e33d91c831f4b19c37afae4f9aa), [`b651e3d`](https://github.com/Frontify/brand-sdk/commit/b651e3d06d19cbf9de6e85ed58aae8a9f2ed2615)]:
|
|
8
|
+
- @frontify/sidebar-settings@0.0.6
|
|
9
|
+
|
|
10
|
+
## 0.25.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`712730e`](https://github.com/Frontify/frontify-cli/commit/712730ec8abda54a1fbc6df5447dcd10fd159ed1) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - export `SettingBlock` with generic
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`d4bd194`](https://github.com/Frontify/frontify-cli/commit/d4bd194133470d2a212be80d14e299e63bc12783)]:
|
|
17
|
+
- @frontify/sidebar-settings@0.0.5
|
|
18
|
+
|
|
19
|
+
## 0.24.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`ab6318e`](https://github.com/Frontify/frontify-cli/commit/ab6318e02b460271fa4ca4d80aa2f95f70a1db2d)]:
|
|
24
|
+
- @frontify/sidebar-settings@0.0.4
|
|
25
|
+
|
|
26
|
+
## 0.24.2
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [#279](https://github.com/Frontify/frontify-cli/pull/279) [`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export everything from the sidebar types
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [[`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af)]:
|
|
33
|
+
- @frontify/sidebar-settings@0.0.3
|
|
34
|
+
|
|
35
|
+
## 0.24.1
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- [#277](https://github.com/Frontify/frontify-cli/pull/277) [`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Use `@frontify/sidebar-settings` type package
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [[`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d)]:
|
|
42
|
+
- @frontify/sidebar-settings@0.0.2
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@frontify/sidebar-settings");var r=(e=>(e.Main="main",e.Basics="basics",e.Layout="layout",e.Style="style",e.Security="security",e.Targets="targets",e))(r||{});const i=e=>e,s=e=>e;exports.Sections=r;exports.defineBlock=i;exports.defineSettings=s;for(const e in t)e!=="default"&&!exports.hasOwnProperty(e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../
|
|
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';\nimport type { FC } from 'react';\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};\n\nexport type BlockProps = {\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n block: FC<BlockProps>;\n settings: ReturnType<typeof defineSettings>;\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\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,EAmCC,MAAAC,EAAeC,GAAiDA,EAKhEC,EAAkBC,GAC3BA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import type { AppBridgeBlock } from '@frontify/app-bridge';
|
|
2
|
+
import type { Bundle as Bundle_2 } from '@frontify/sidebar-settings';
|
|
3
|
+
import type { FC } from 'react';
|
|
4
|
+
import type { SettingBlock as SettingBlock_2 } from '@frontify/sidebar-settings';
|
|
5
|
+
|
|
6
|
+
export declare type BlockConfigExport = {
|
|
7
|
+
block: FC<BlockProps>;
|
|
8
|
+
settings: ReturnType<typeof defineSettings>;
|
|
9
|
+
onBlockCreated?: (({ appBridge }: {
|
|
10
|
+
appBridge: AppBridgeBlock;
|
|
11
|
+
}) => void) | (({ appBridge }: {
|
|
12
|
+
appBridge: AppBridgeBlock;
|
|
13
|
+
}) => Promise<void>);
|
|
14
|
+
onBlockDeleted?: (({ appBridge }: {
|
|
15
|
+
appBridge: AppBridgeBlock;
|
|
16
|
+
}) => void) | (({ appBridge }: {
|
|
17
|
+
appBridge: AppBridgeBlock;
|
|
18
|
+
}) => Promise<void>);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export declare type BlockProps = {
|
|
22
|
+
appBridge: AppBridgeBlock;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export declare type BlockSettingsStructureExport = {
|
|
26
|
+
[Sections.Main]?: SettingBlock[];
|
|
27
|
+
[Sections.Basics]?: SettingBlock[];
|
|
28
|
+
[Sections.Layout]?: SettingBlock[];
|
|
29
|
+
[Sections.Style]?: SettingBlock[];
|
|
30
|
+
[Sections.Security]?: SettingBlock[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export declare type Bundle = Bundle_2<AppBridgeBlock>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.
|
|
37
|
+
*/
|
|
38
|
+
export declare const defineBlock: (config: BlockConfigExport) => BlockConfigExport;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object.
|
|
42
|
+
*/
|
|
43
|
+
export declare const defineSettings: (settingsStructure: BlockSettingsStructureExport) => BlockSettingsStructureExport;
|
|
44
|
+
|
|
45
|
+
export declare enum Sections {
|
|
46
|
+
Main = "main",
|
|
47
|
+
Basics = "basics",
|
|
48
|
+
Layout = "layout",
|
|
49
|
+
Style = "style",
|
|
50
|
+
Security = "security",
|
|
51
|
+
Targets = "targets"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare type SettingBlock = SettingBlock_2<AppBridgeBlock>;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export * from "@frontify/sidebar-settings";
|
|
58
|
+
|
|
59
|
+
export { }
|
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var e = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(e || {});
|
|
1
|
+
export * from "@frontify/sidebar-settings";
|
|
2
|
+
var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
|
|
3
|
+
const a = (t) => t, e = (t) => t;
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
y as LegacyAssetInputSource,
|
|
10
|
-
c as NotificationBlockDividerPosition,
|
|
11
|
-
f as NotificationStyleType,
|
|
12
|
-
e as Sections
|
|
5
|
+
r as Sections,
|
|
6
|
+
a as defineBlock,
|
|
7
|
+
e as defineSettings
|
|
13
8
|
};
|
|
14
9
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../
|
|
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';\nimport type { FC } from 'react';\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};\n\nexport type BlockProps = {\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n block: FC<BlockProps>;\n settings: ReturnType<typeof defineSettings>;\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\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;AAmCC,MAAAC,IAAc,CAACC,MAAiDA,GAKhEC,IAAiB,CAACC,MAC3BA;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@frontify/sidebar-settings")):typeof define=="function"&&define.amd?define(["exports","@frontify/sidebar-settings"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t.GuidelineBlocksSettings={},t.sidebarSettings))})(this,function(t,i){"use strict";var n=(e=>(e.Main="main",e.Basics="basics",e.Layout="layout",e.Style="style",e.Security="security",e.Targets="targets",e))(n||{});const f=e=>e,s=e=>e;t.Sections=n,t.defineBlock=f,t.defineSettings=s;for(const e in i)e!=="default"&&!t.hasOwnProperty(e)&&Object.defineProperty(t,e,{enumerable:!0,get:()=>i[e]});Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../
|
|
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';\nimport type { FC } from 'react';\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};\n\nexport type BlockProps = {\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n block: FC<BlockProps>;\n settings: ReturnType<typeof defineSettings>;\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\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,EAmCC,MAAAC,EAAeC,GAAiDA,EAKhEC,EAAkBC,GAC3BA"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
|
-
"version": "0.25.
|
|
4
|
-
"description": "Provides
|
|
3
|
+
"version": "0.25.2",
|
|
4
|
+
"description": "Provides types and helpers for the guideline block development",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"unpkg": "dist/index.umd.js",
|
|
8
8
|
"jsdelivr": "dist/index.umd.js",
|
|
9
9
|
"module": "dist/index.es.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
|
-
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
},
|
|
14
11
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/Frontify/brand-sdk",
|
|
15
|
+
"directory": "packages/guideline-blocks-settings"
|
|
16
|
+
},
|
|
15
17
|
"devDependencies": {
|
|
16
18
|
"@frontify/eslint-config-typescript": "0.15.5",
|
|
17
|
-
"
|
|
19
|
+
"@types/react": "17",
|
|
20
|
+
"@types/react-dom": "17",
|
|
21
|
+
"eslint": "8.28.0",
|
|
18
22
|
"eslint-plugin-notice": "0.9.10",
|
|
19
|
-
"prettier": "2.
|
|
23
|
+
"prettier": "2.8.0",
|
|
20
24
|
"react": "17.0.2",
|
|
21
25
|
"react-dom": "17.0.2",
|
|
22
26
|
"typescript": "4.8.4",
|
|
23
|
-
"vite": "3.2.
|
|
24
|
-
"vite-plugin-dts": "1.7.
|
|
27
|
+
"vite": "3.2.4",
|
|
28
|
+
"vite-plugin-dts": "1.7.1"
|
|
25
29
|
},
|
|
26
30
|
"dependencies": {
|
|
27
|
-
"@frontify/
|
|
28
|
-
"@frontify/
|
|
31
|
+
"@frontify/fondue": "latest",
|
|
32
|
+
"@frontify/app-bridge": "3.0.0-beta.30",
|
|
33
|
+
"@frontify/sidebar-settings": "0.0.6"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@frontify/app-bridge": "*"
|
|
29
37
|
},
|
|
30
38
|
"scripts": {
|
|
31
39
|
"build": "vite build",
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type { AppBridgeBlock } from '@frontify/app-bridge';
|
|
4
|
+
import type {
|
|
5
|
+
Bundle as BundleSidebarSettings,
|
|
6
|
+
SettingBlock as SettingBlockSidebarSettings,
|
|
7
|
+
} from '@frontify/sidebar-settings';
|
|
8
|
+
import type { FC } from 'react';
|
|
9
|
+
|
|
10
|
+
export * from '@frontify/sidebar-settings';
|
|
11
|
+
|
|
12
|
+
export type Bundle = BundleSidebarSettings<AppBridgeBlock>;
|
|
13
|
+
export type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;
|
|
14
|
+
|
|
15
|
+
export enum Sections {
|
|
16
|
+
Main = 'main',
|
|
17
|
+
Basics = 'basics',
|
|
18
|
+
Layout = 'layout',
|
|
19
|
+
Style = 'style',
|
|
20
|
+
Security = 'security',
|
|
21
|
+
Targets = 'targets',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type BlockSettingsStructureExport = {
|
|
25
|
+
[Sections.Main]?: SettingBlock[];
|
|
26
|
+
[Sections.Basics]?: SettingBlock[];
|
|
27
|
+
[Sections.Layout]?: SettingBlock[];
|
|
28
|
+
[Sections.Style]?: SettingBlock[];
|
|
29
|
+
[Sections.Security]?: SettingBlock[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type BlockProps = {
|
|
33
|
+
appBridge: AppBridgeBlock;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type BlockConfigExport = {
|
|
37
|
+
block: FC<BlockProps>;
|
|
38
|
+
settings: ReturnType<typeof defineSettings>;
|
|
39
|
+
onBlockCreated?:
|
|
40
|
+
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
41
|
+
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|
|
42
|
+
onBlockDeleted?:
|
|
43
|
+
| (({ appBridge }: { appBridge: AppBridgeBlock }) => void)
|
|
44
|
+
| (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.
|
|
49
|
+
*/
|
|
50
|
+
export const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object.
|
|
54
|
+
*/
|
|
55
|
+
export const defineSettings = (settingsStructure: BlockSettingsStructureExport): BlockSettingsStructureExport =>
|
|
56
|
+
settingsStructure;
|
package/tsconfig.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
3
4
|
"strictNullChecks": true,
|
|
4
5
|
"strictFunctionTypes": true,
|
|
5
6
|
"alwaysStrict": true,
|
|
@@ -19,6 +20,6 @@
|
|
|
19
20
|
"esModuleInterop": true,
|
|
20
21
|
"skipLibCheck": true
|
|
21
22
|
},
|
|
22
|
-
"include": ["
|
|
23
|
+
"include": ["src/**/*"],
|
|
23
24
|
"exclude": ["node_modules", "dist"]
|
|
24
25
|
}
|
package/vite.config.ts
CHANGED
|
@@ -8,10 +8,10 @@ import dts from 'vite-plugin-dts';
|
|
|
8
8
|
const dependencies = Object.keys(dependenciesMap);
|
|
9
9
|
|
|
10
10
|
export default defineConfig({
|
|
11
|
-
plugins: [dts({ insertTypesEntry: true })],
|
|
11
|
+
plugins: [dts({ insertTypesEntry: true, rollupTypes: true })],
|
|
12
12
|
build: {
|
|
13
13
|
lib: {
|
|
14
|
-
entry: resolve(__dirname, '
|
|
14
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
15
15
|
fileName: (format: string) => `[name].${format}.js`,
|
|
16
16
|
name: 'GuidelineBlocksSettings',
|
|
17
17
|
},
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';
|
|
2
|
-
import { AssetInputSize } from '@frontify/fondue';
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
export declare enum AssetInputSource {
|
|
5
|
-
Library = "Library",
|
|
6
|
-
Upload = "Upload"
|
|
7
|
-
}
|
|
8
|
-
export declare enum AssetInputMode {
|
|
9
|
-
BrowseAndUpload = "BrowseAndUpload",
|
|
10
|
-
UploadOnly = "UploadOnly",
|
|
11
|
-
BrowseOnly = "BrowseOnly"
|
|
12
|
-
}
|
|
13
|
-
export declare type AssetInputValue = {
|
|
14
|
-
source: AssetInputSource;
|
|
15
|
-
value: number;
|
|
16
|
-
};
|
|
17
|
-
export declare type AssetInputBlock = {
|
|
18
|
-
type: 'assetInput';
|
|
19
|
-
multiSelection?: boolean;
|
|
20
|
-
extensions?: (FileExtension | string)[];
|
|
21
|
-
projectTypes?: AssetChooserProjectType[];
|
|
22
|
-
objectTypes?: AssetChooserObjectType[];
|
|
23
|
-
mode?: AssetInputMode;
|
|
24
|
-
size?: AssetInputSize;
|
|
25
|
-
hideExtension?: boolean;
|
|
26
|
-
hideSize?: boolean;
|
|
27
|
-
} & BaseBlock<AssetInputValue | AssetInputValue['value']>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var a = /* @__PURE__ */ ((r) => (r.Library = "Library", r.Upload = "Upload", r))(a || {}), l = /* @__PURE__ */ ((r) => (r.BrowseAndUpload = "BrowseAndUpload", r.UploadOnly = "UploadOnly", r.BrowseOnly = "BrowseOnly", r))(l || {});
|
|
2
|
-
export {
|
|
3
|
-
l as AssetInputMode,
|
|
4
|
-
a as AssetInputSource
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=assetInput.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetInput.es.js","sources":["../../types/blocks/assetInput.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';\nimport { AssetInputSize } from '@frontify/fondue';\nimport { BaseBlock } from './base';\n\nexport enum AssetInputSource {\n Library = 'Library',\n Upload = 'Upload',\n}\n\nexport enum AssetInputMode {\n BrowseAndUpload = 'BrowseAndUpload',\n UploadOnly = 'UploadOnly',\n BrowseOnly = 'BrowseOnly',\n}\n\nexport type AssetInputValue = {\n source: AssetInputSource;\n value: number;\n};\n\nexport type AssetInputBlock = {\n type: 'assetInput';\n multiSelection?: boolean;\n extensions?: (FileExtension | string)[];\n projectTypes?: AssetChooserProjectType[];\n objectTypes?: AssetChooserObjectType[];\n mode?: AssetInputMode;\n size?: AssetInputSize;\n hideExtension?: boolean;\n hideSize?: boolean;\n} & BaseBlock<AssetInputValue | AssetInputValue['value']>;\n"],"names":["AssetInputSource","AssetInputMode"],"mappings":"AAMY,IAAAA,sBAAAA,OACRA,EAAA,UAAU,WACVA,EAAA,SAAS,UAFDA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACRA,EAAA,kBAAkB,mBAClBA,EAAA,aAAa,cACbA,EAAA,aAAa,cAHLA,IAAAA,KAAA,CAAA,CAAA;"}
|
package/dist/blocks/base.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Bundle } from '../bundle';
|
|
2
|
-
export declare type ValueOrPromisedValue<FieldType> = FieldType | ((bundle: Bundle) => FieldType) | ((bundle: Bundle) => Promise<FieldType>);
|
|
3
|
-
export declare type BaseBlock<T = undefined> = {
|
|
4
|
-
id: string;
|
|
5
|
-
label?: ValueOrPromisedValue<string>;
|
|
6
|
-
info?: ValueOrPromisedValue<string>;
|
|
7
|
-
value?: T;
|
|
8
|
-
defaultValue?: T;
|
|
9
|
-
showForTranslations?: boolean;
|
|
10
|
-
show?: (bundle: Bundle) => boolean;
|
|
11
|
-
onChange?: (bundle: Bundle) => void;
|
|
12
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BaseBlock, ValueOrPromisedValue } from './base';
|
|
2
|
-
import type { Checkbox } from './checkbox';
|
|
3
|
-
export declare type ChecklistBlock = {
|
|
4
|
-
type: 'checklist';
|
|
5
|
-
choices: ValueOrPromisedValue<Checkbox[]>;
|
|
6
|
-
showClearAndSelectAllButtons?: boolean;
|
|
7
|
-
columns?: 1 | 2;
|
|
8
|
-
} & BaseBlock<string[] | null>;
|
package/dist/blocks/choices.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IconEnum } from '@frontify/fondue';
|
|
2
|
-
import { BaseBlock, ValueOrPromisedValue } from './base';
|
|
3
|
-
export declare type Choice = {
|
|
4
|
-
label?: string | number;
|
|
5
|
-
icon?: IconEnum;
|
|
6
|
-
value: string | number;
|
|
7
|
-
};
|
|
8
|
-
export declare type ChoicesType = {
|
|
9
|
-
choices: ValueOrPromisedValue<Choice[]>;
|
|
10
|
-
} & BaseBlock<string | number>;
|
package/dist/blocks/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AssetInputBlock } from './assetInput';
|
|
2
|
-
import { ChecklistBlock } from './checklist';
|
|
3
|
-
import { ColorInputBlock } from './colorInput';
|
|
4
|
-
import { DropdownBlock } from './dropdown';
|
|
5
|
-
import { InputBlock } from './input';
|
|
6
|
-
import { LegacyAssetInputBlock } from './legacyAssetInput';
|
|
7
|
-
import { LinkChooserBlock } from './linkChooser';
|
|
8
|
-
import { MultiInputBlock } from './multiInput';
|
|
9
|
-
import { NotificationBlock } from './notification';
|
|
10
|
-
import { SectionHeadingBlock } from './sectionHeading';
|
|
11
|
-
import { SliderBlock } from './slider';
|
|
12
|
-
import { SwitchBlock } from './switch';
|
|
13
|
-
import { TemplateInputBlock } from './templateInput';
|
|
14
|
-
import { TextareaBlock } from './textarea';
|
|
15
|
-
export * from './assetInput';
|
|
16
|
-
export * from './checklist';
|
|
17
|
-
export * from './choices';
|
|
18
|
-
export * from './colorInput';
|
|
19
|
-
export * from './dropdown';
|
|
20
|
-
export * from './input';
|
|
21
|
-
export * from './legacyAssetInput';
|
|
22
|
-
export * from './linkChooser';
|
|
23
|
-
export * from './multiInput';
|
|
24
|
-
export * from './notification';
|
|
25
|
-
export * from './sectionHeading';
|
|
26
|
-
export * from './slider';
|
|
27
|
-
export * from './switch';
|
|
28
|
-
export * from './templateInput';
|
|
29
|
-
export * from './textarea';
|
|
30
|
-
export declare type SimpleSettingBlock = AssetInputBlock | ChecklistBlock | ColorInputBlock | DropdownBlock | InputBlock | LegacyAssetInputBlock | LinkChooserBlock | MultiInputBlock | NotificationBlock | SectionHeadingBlock | SliderBlock | SwitchBlock | TemplateInputBlock | TextareaBlock;
|
|
31
|
-
export declare type DynamicSupportedBlock = InputBlock | ColorInputBlock | DropdownBlock;
|
|
32
|
-
export declare type DynamicSettingBlock<T extends DynamicSupportedBlock = DynamicSupportedBlock> = Omit<T, 'value'> & {
|
|
33
|
-
value?: DynamicSupportedBlock['value'][];
|
|
34
|
-
dynamic: {
|
|
35
|
-
addButtonLabel: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export declare type SettingBlock = SimpleSettingBlock | DynamicSettingBlock;
|
package/dist/blocks/input.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IconEnum, TextInputType } from '@frontify/fondue';
|
|
2
|
-
import { Rule } from '../validation';
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
export declare type InputBlock = {
|
|
5
|
-
type: 'input';
|
|
6
|
-
icon?: IconEnum;
|
|
7
|
-
inputType?: TextInputType;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
clearable?: boolean;
|
|
10
|
-
rules?: Rule<string>[];
|
|
11
|
-
} & BaseBlock<string>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';
|
|
2
|
-
import { AssetInputSize } from '@frontify/fondue';
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
export declare enum LegacyAssetInputSource {
|
|
5
|
-
Library = "Library",
|
|
6
|
-
Upload = "Upload"
|
|
7
|
-
}
|
|
8
|
-
export declare enum LegacyAssetInputMode {
|
|
9
|
-
BrowseAndUpload = "BrowseAndUpload",
|
|
10
|
-
UploadOnly = "UploadOnly",
|
|
11
|
-
BrowseOnly = "BrowseOnly"
|
|
12
|
-
}
|
|
13
|
-
export declare type LegacyAssetInputValue = {
|
|
14
|
-
source: LegacyAssetInputSource;
|
|
15
|
-
value: number;
|
|
16
|
-
};
|
|
17
|
-
export declare type LegacyAssetInputBlock = {
|
|
18
|
-
type: 'legacyAssetInput';
|
|
19
|
-
multiSelection?: boolean;
|
|
20
|
-
extensions?: (FileExtension | string)[];
|
|
21
|
-
projectTypes?: AssetChooserProjectType[];
|
|
22
|
-
objectTypes?: AssetChooserObjectType[];
|
|
23
|
-
mode?: LegacyAssetInputMode;
|
|
24
|
-
size?: AssetInputSize;
|
|
25
|
-
} & BaseBlock<LegacyAssetInputValue | LegacyAssetInputValue['value']>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var l = /* @__PURE__ */ ((r) => (r.Library = "Library", r.Upload = "Upload", r))(l || {}), o = /* @__PURE__ */ ((r) => (r.BrowseAndUpload = "BrowseAndUpload", r.UploadOnly = "UploadOnly", r.BrowseOnly = "BrowseOnly", r))(o || {});
|
|
2
|
-
export {
|
|
3
|
-
o as LegacyAssetInputMode,
|
|
4
|
-
l as LegacyAssetInputSource
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=legacyAssetInput.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacyAssetInput.es.js","sources":["../../types/blocks/legacyAssetInput.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';\nimport { AssetInputSize } from '@frontify/fondue';\nimport { BaseBlock } from './base';\n\nexport enum LegacyAssetInputSource {\n Library = 'Library',\n Upload = 'Upload',\n}\n\nexport enum LegacyAssetInputMode {\n BrowseAndUpload = 'BrowseAndUpload',\n UploadOnly = 'UploadOnly',\n BrowseOnly = 'BrowseOnly',\n}\n\nexport type LegacyAssetInputValue = {\n source: LegacyAssetInputSource;\n value: number;\n};\n\nexport type LegacyAssetInputBlock = {\n type: 'legacyAssetInput';\n multiSelection?: boolean;\n extensions?: (FileExtension | string)[];\n projectTypes?: AssetChooserProjectType[];\n objectTypes?: AssetChooserObjectType[];\n mode?: LegacyAssetInputMode;\n size?: AssetInputSize;\n} & BaseBlock<LegacyAssetInputValue | LegacyAssetInputValue['value']>;\n"],"names":["LegacyAssetInputSource","LegacyAssetInputMode"],"mappings":"AAMY,IAAAA,sBAAAA,OACRA,EAAA,UAAU,WACVA,EAAA,SAAS,UAFDA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACRA,EAAA,kBAAkB,mBAClBA,EAAA,aAAa,cACbA,EAAA,aAAa,cAHLA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SearchResult, Validation } from '@frontify/fondue';
|
|
2
|
-
import { BaseBlock } from './base';
|
|
3
|
-
export declare type LinkChooserBlock = {
|
|
4
|
-
type: 'linkChooser';
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
openInNewTab?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
clearable?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
validation?: Validation;
|
|
11
|
-
} & BaseBlock<{
|
|
12
|
-
link: SearchResult | null;
|
|
13
|
-
openInNewTab: boolean | null;
|
|
14
|
-
}>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MultiInputLayout } from '@frontify/fondue';
|
|
2
|
-
import { BaseBlock } from './base';
|
|
3
|
-
import { ColorInputBlock } from './colorInput';
|
|
4
|
-
import { DropdownBlock } from './dropdown';
|
|
5
|
-
import { InputBlock } from './input';
|
|
6
|
-
export declare type MultiInputBlock = {
|
|
7
|
-
type: 'multiInput';
|
|
8
|
-
layout: MultiInputLayout;
|
|
9
|
-
blocks: (Omit<InputBlock, 'value'> | Omit<ColorInputBlock, 'value'> | Omit<DropdownBlock, 'value'>)[];
|
|
10
|
-
lastItemFullWidth?: boolean;
|
|
11
|
-
} & BaseBlock;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseBlock } from './base';
|
|
2
|
-
export declare enum NotificationStyleType {
|
|
3
|
-
Warning = "Warning",
|
|
4
|
-
Negative = "Negative",
|
|
5
|
-
Positive = "Positive",
|
|
6
|
-
Info = "Info"
|
|
7
|
-
}
|
|
8
|
-
export declare type Link = {
|
|
9
|
-
label?: string;
|
|
10
|
-
href: string;
|
|
11
|
-
target?: '_self' | '_blank';
|
|
12
|
-
};
|
|
13
|
-
export declare enum NotificationBlockDividerPosition {
|
|
14
|
-
Top = "Top",
|
|
15
|
-
Bottom = "Bottom",
|
|
16
|
-
Both = "Both",
|
|
17
|
-
None = "None"
|
|
18
|
-
}
|
|
19
|
-
export declare type NotificationBlock = {
|
|
20
|
-
type: 'notification';
|
|
21
|
-
title?: string;
|
|
22
|
-
text?: string;
|
|
23
|
-
link?: Link;
|
|
24
|
-
styles: {
|
|
25
|
-
type: NotificationStyleType;
|
|
26
|
-
icon?: boolean;
|
|
27
|
-
divider?: NotificationBlockDividerPosition;
|
|
28
|
-
};
|
|
29
|
-
} & BaseBlock;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var g = /* @__PURE__ */ ((r) => (r.Warning = "Warning", r.Negative = "Negative", r.Positive = "Positive", r.Info = "Info", r))(g || {}), v = /* @__PURE__ */ ((r) => (r.Top = "Top", r.Bottom = "Bottom", r.Both = "Both", r.None = "None", r))(v || {});
|
|
2
|
-
export {
|
|
3
|
-
v as NotificationBlockDividerPosition,
|
|
4
|
-
g as NotificationStyleType
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=notification.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.es.js","sources":["../../types/blocks/notification.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BaseBlock } from './base';\n\nexport enum NotificationStyleType {\n Warning = 'Warning',\n Negative = 'Negative',\n Positive = 'Positive',\n Info = 'Info',\n}\n\nexport type Link = {\n label?: string;\n href: string;\n target?: '_self' | '_blank';\n};\n\nexport enum NotificationBlockDividerPosition {\n Top = 'Top',\n Bottom = 'Bottom',\n Both = 'Both',\n None = 'None',\n}\n\nexport type NotificationBlock = {\n type: 'notification';\n title?: string;\n text?: string;\n link?: Link;\n styles: {\n type: NotificationStyleType;\n icon?: boolean;\n divider?: NotificationBlockDividerPosition;\n };\n} & BaseBlock;\n"],"names":["NotificationStyleType","NotificationBlockDividerPosition"],"mappings":"AAIY,IAAAA,sBAAAA,OACRA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,OAAO,QAJCA,IAAAA,KAAA,CAAA,CAAA,GAaAC,sBAAAA,OACRA,EAAA,MAAM,OACNA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJCA,IAAAA,KAAA,CAAA,CAAA;"}
|
package/dist/blocks/slider.d.ts
DELETED
package/dist/blocks/switch.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SwitchSize } from '@frontify/fondue';
|
|
2
|
-
import { BaseBlock } from './base';
|
|
3
|
-
import { SettingBlock } from './index';
|
|
4
|
-
export declare type SwitchBlock = {
|
|
5
|
-
type: 'switch';
|
|
6
|
-
switchLabel?: string;
|
|
7
|
-
on?: SettingBlock[];
|
|
8
|
-
off?: SettingBlock[];
|
|
9
|
-
size?: SwitchSize;
|
|
10
|
-
} & BaseBlock<boolean>;
|
package/dist/bundle.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
2
|
-
import { SettingBlock } from './blocks';
|
|
3
|
-
export declare type SettingValue = {
|
|
4
|
-
value?: SettingBlock['value'];
|
|
5
|
-
};
|
|
6
|
-
export declare type Bundle = {
|
|
7
|
-
getBlock: (id: string) => SettingValue | null;
|
|
8
|
-
getAppBridge: () => AppBridgeBlock;
|
|
9
|
-
setBlockValue: (key: string, value: SettingBlock['value']) => void;
|
|
10
|
-
};
|
package/dist/validation.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';
|
|
4
|
-
import { AssetInputSize } from '@frontify/fondue';
|
|
5
|
-
import { BaseBlock } from './base';
|
|
6
|
-
|
|
7
|
-
export enum AssetInputSource {
|
|
8
|
-
Library = 'Library',
|
|
9
|
-
Upload = 'Upload',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export enum AssetInputMode {
|
|
13
|
-
BrowseAndUpload = 'BrowseAndUpload',
|
|
14
|
-
UploadOnly = 'UploadOnly',
|
|
15
|
-
BrowseOnly = 'BrowseOnly',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type AssetInputValue = {
|
|
19
|
-
source: AssetInputSource;
|
|
20
|
-
value: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type AssetInputBlock = {
|
|
24
|
-
type: 'assetInput';
|
|
25
|
-
multiSelection?: boolean;
|
|
26
|
-
extensions?: (FileExtension | string)[];
|
|
27
|
-
projectTypes?: AssetChooserProjectType[];
|
|
28
|
-
objectTypes?: AssetChooserObjectType[];
|
|
29
|
-
mode?: AssetInputMode;
|
|
30
|
-
size?: AssetInputSize;
|
|
31
|
-
hideExtension?: boolean;
|
|
32
|
-
hideSize?: boolean;
|
|
33
|
-
} & BaseBlock<AssetInputValue | AssetInputValue['value']>;
|
package/types/blocks/base.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { Bundle } from '../bundle';
|
|
4
|
-
|
|
5
|
-
export type ValueOrPromisedValue<FieldType> =
|
|
6
|
-
| FieldType
|
|
7
|
-
| ((bundle: Bundle) => FieldType)
|
|
8
|
-
| ((bundle: Bundle) => Promise<FieldType>);
|
|
9
|
-
|
|
10
|
-
export type BaseBlock<T = undefined> = {
|
|
11
|
-
id: string;
|
|
12
|
-
label?: ValueOrPromisedValue<string>;
|
|
13
|
-
info?: ValueOrPromisedValue<string>;
|
|
14
|
-
value?: T;
|
|
15
|
-
defaultValue?: T;
|
|
16
|
-
showForTranslations?: boolean;
|
|
17
|
-
show?: (bundle: Bundle) => boolean;
|
|
18
|
-
onChange?: (bundle: Bundle) => void;
|
|
19
|
-
};
|
package/types/blocks/checkbox.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import type { BaseBlock, ValueOrPromisedValue } from './base';
|
|
4
|
-
import type { Checkbox } from './checkbox';
|
|
5
|
-
|
|
6
|
-
export type ChecklistBlock = {
|
|
7
|
-
type: 'checklist';
|
|
8
|
-
choices: ValueOrPromisedValue<Checkbox[]>;
|
|
9
|
-
showClearAndSelectAllButtons?: boolean;
|
|
10
|
-
columns?: 1 | 2;
|
|
11
|
-
} & BaseBlock<string[] | null>;
|
package/types/blocks/choices.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { IconEnum } from '@frontify/fondue';
|
|
4
|
-
import { BaseBlock, ValueOrPromisedValue } from './base';
|
|
5
|
-
|
|
6
|
-
export type Choice = {
|
|
7
|
-
label?: string | number;
|
|
8
|
-
icon?: IconEnum;
|
|
9
|
-
value: string | number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type ChoicesType = {
|
|
13
|
-
choices: ValueOrPromisedValue<Choice[]>;
|
|
14
|
-
} & BaseBlock<string | number>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { Color, ColorRgb } from '@frontify/fondue';
|
|
4
|
-
import { BaseBlock } from './base';
|
|
5
|
-
|
|
6
|
-
type ColorFormats = Color | ColorRgb;
|
|
7
|
-
|
|
8
|
-
export type ColorInputBlock = {
|
|
9
|
-
type: 'colorInput';
|
|
10
|
-
} & BaseBlock<ColorFormats>;
|
package/types/blocks/dropdown.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { DropdownSize } from '@frontify/fondue';
|
|
4
|
-
import { ChoicesType } from './choices';
|
|
5
|
-
|
|
6
|
-
export type DropdownBlock = {
|
|
7
|
-
type: 'dropdown';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
size?: DropdownSize;
|
|
11
|
-
} & ChoicesType;
|
package/types/blocks/index.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { AssetInputBlock } from './assetInput';
|
|
4
|
-
import { ChecklistBlock } from './checklist';
|
|
5
|
-
import { ColorInputBlock } from './colorInput';
|
|
6
|
-
import { DropdownBlock } from './dropdown';
|
|
7
|
-
import { InputBlock } from './input';
|
|
8
|
-
import { LegacyAssetInputBlock } from './legacyAssetInput';
|
|
9
|
-
import { LinkChooserBlock } from './linkChooser';
|
|
10
|
-
import { MultiInputBlock } from './multiInput';
|
|
11
|
-
import { NotificationBlock } from './notification';
|
|
12
|
-
import { SectionHeadingBlock } from './sectionHeading';
|
|
13
|
-
import { SliderBlock } from './slider';
|
|
14
|
-
import { SwitchBlock } from './switch';
|
|
15
|
-
import { TemplateInputBlock } from './templateInput';
|
|
16
|
-
import { TextareaBlock } from './textarea';
|
|
17
|
-
|
|
18
|
-
export * from './assetInput';
|
|
19
|
-
export * from './checklist';
|
|
20
|
-
export * from './choices';
|
|
21
|
-
export * from './colorInput';
|
|
22
|
-
export * from './dropdown';
|
|
23
|
-
export * from './input';
|
|
24
|
-
export * from './legacyAssetInput';
|
|
25
|
-
export * from './linkChooser';
|
|
26
|
-
export * from './multiInput';
|
|
27
|
-
export * from './notification';
|
|
28
|
-
export * from './sectionHeading';
|
|
29
|
-
export * from './slider';
|
|
30
|
-
export * from './switch';
|
|
31
|
-
export * from './templateInput';
|
|
32
|
-
export * from './textarea';
|
|
33
|
-
|
|
34
|
-
export type SimpleSettingBlock =
|
|
35
|
-
| AssetInputBlock
|
|
36
|
-
| ChecklistBlock
|
|
37
|
-
| ColorInputBlock
|
|
38
|
-
| DropdownBlock
|
|
39
|
-
| InputBlock
|
|
40
|
-
| LegacyAssetInputBlock
|
|
41
|
-
| LinkChooserBlock
|
|
42
|
-
| MultiInputBlock
|
|
43
|
-
| NotificationBlock
|
|
44
|
-
| SectionHeadingBlock
|
|
45
|
-
| SliderBlock
|
|
46
|
-
| SwitchBlock
|
|
47
|
-
| TemplateInputBlock
|
|
48
|
-
| TextareaBlock;
|
|
49
|
-
|
|
50
|
-
export type DynamicSupportedBlock = InputBlock | ColorInputBlock | DropdownBlock;
|
|
51
|
-
|
|
52
|
-
export type DynamicSettingBlock<T extends DynamicSupportedBlock = DynamicSupportedBlock> = Omit<T, 'value'> & {
|
|
53
|
-
value?: DynamicSupportedBlock['value'][];
|
|
54
|
-
dynamic: {
|
|
55
|
-
addButtonLabel: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export declare type SettingBlock = SimpleSettingBlock | DynamicSettingBlock;
|
package/types/blocks/input.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { IconEnum, TextInputType } from '@frontify/fondue';
|
|
4
|
-
import { Rule } from '../validation';
|
|
5
|
-
import { BaseBlock } from './base';
|
|
6
|
-
|
|
7
|
-
export type InputBlock = {
|
|
8
|
-
type: 'input';
|
|
9
|
-
icon?: IconEnum;
|
|
10
|
-
inputType?: TextInputType;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
clearable?: boolean;
|
|
13
|
-
rules?: Rule<string>[];
|
|
14
|
-
} & BaseBlock<string>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { AssetChooserObjectType, AssetChooserProjectType, FileExtension } from '@frontify/app-bridge';
|
|
4
|
-
import { AssetInputSize } from '@frontify/fondue';
|
|
5
|
-
import { BaseBlock } from './base';
|
|
6
|
-
|
|
7
|
-
export enum LegacyAssetInputSource {
|
|
8
|
-
Library = 'Library',
|
|
9
|
-
Upload = 'Upload',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export enum LegacyAssetInputMode {
|
|
13
|
-
BrowseAndUpload = 'BrowseAndUpload',
|
|
14
|
-
UploadOnly = 'UploadOnly',
|
|
15
|
-
BrowseOnly = 'BrowseOnly',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type LegacyAssetInputValue = {
|
|
19
|
-
source: LegacyAssetInputSource;
|
|
20
|
-
value: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type LegacyAssetInputBlock = {
|
|
24
|
-
type: 'legacyAssetInput';
|
|
25
|
-
multiSelection?: boolean;
|
|
26
|
-
extensions?: (FileExtension | string)[];
|
|
27
|
-
projectTypes?: AssetChooserProjectType[];
|
|
28
|
-
objectTypes?: AssetChooserObjectType[];
|
|
29
|
-
mode?: LegacyAssetInputMode;
|
|
30
|
-
size?: AssetInputSize;
|
|
31
|
-
} & BaseBlock<LegacyAssetInputValue | LegacyAssetInputValue['value']>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { SearchResult, Validation } from '@frontify/fondue';
|
|
4
|
-
import { BaseBlock } from './base';
|
|
5
|
-
|
|
6
|
-
export type LinkChooserBlock = {
|
|
7
|
-
type: 'linkChooser';
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
openInNewTab?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
clearable?: boolean;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
validation?: Validation;
|
|
14
|
-
} & BaseBlock<{ link: SearchResult | null; openInNewTab: boolean | null }>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { MultiInputLayout } from '@frontify/fondue';
|
|
4
|
-
import { BaseBlock } from './base';
|
|
5
|
-
import { ColorInputBlock } from './colorInput';
|
|
6
|
-
import { DropdownBlock } from './dropdown';
|
|
7
|
-
import { InputBlock } from './input';
|
|
8
|
-
|
|
9
|
-
export type MultiInputBlock = {
|
|
10
|
-
type: 'multiInput';
|
|
11
|
-
layout: MultiInputLayout;
|
|
12
|
-
blocks: (Omit<InputBlock, 'value'> | Omit<ColorInputBlock, 'value'> | Omit<DropdownBlock, 'value'>)[];
|
|
13
|
-
lastItemFullWidth?: boolean;
|
|
14
|
-
} & BaseBlock;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
|
|
5
|
-
export enum NotificationStyleType {
|
|
6
|
-
Warning = 'Warning',
|
|
7
|
-
Negative = 'Negative',
|
|
8
|
-
Positive = 'Positive',
|
|
9
|
-
Info = 'Info',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Link = {
|
|
13
|
-
label?: string;
|
|
14
|
-
href: string;
|
|
15
|
-
target?: '_self' | '_blank';
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export enum NotificationBlockDividerPosition {
|
|
19
|
-
Top = 'Top',
|
|
20
|
-
Bottom = 'Bottom',
|
|
21
|
-
Both = 'Both',
|
|
22
|
-
None = 'None',
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type NotificationBlock = {
|
|
26
|
-
type: 'notification';
|
|
27
|
-
title?: string;
|
|
28
|
-
text?: string;
|
|
29
|
-
link?: Link;
|
|
30
|
-
styles: {
|
|
31
|
-
type: NotificationStyleType;
|
|
32
|
-
icon?: boolean;
|
|
33
|
-
divider?: NotificationBlockDividerPosition;
|
|
34
|
-
};
|
|
35
|
-
} & BaseBlock;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
import { SettingBlock } from './index';
|
|
5
|
-
|
|
6
|
-
export type SectionHeadingBlock = {
|
|
7
|
-
type: 'sectionHeading';
|
|
8
|
-
blocks: SettingBlock[];
|
|
9
|
-
label: string;
|
|
10
|
-
} & BaseBlock;
|
package/types/blocks/slider.ts
DELETED
package/types/blocks/switch.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { SwitchSize } from '@frontify/fondue';
|
|
4
|
-
import { BaseBlock } from './base';
|
|
5
|
-
import { SettingBlock } from './index';
|
|
6
|
-
|
|
7
|
-
export type SwitchBlock = {
|
|
8
|
-
type: 'switch';
|
|
9
|
-
switchLabel?: string;
|
|
10
|
-
on?: SettingBlock[];
|
|
11
|
-
off?: SettingBlock[];
|
|
12
|
-
size?: SwitchSize;
|
|
13
|
-
} & BaseBlock<boolean>;
|
package/types/blocks/textarea.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { Rule } from '../validation';
|
|
4
|
-
import { BaseBlock } from './base';
|
|
5
|
-
|
|
6
|
-
export type TextareaBlock = {
|
|
7
|
-
type: 'textarea';
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
rules?: Rule<string>[];
|
|
10
|
-
} & BaseBlock<string>;
|
package/types/bundle.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
4
|
-
import { SettingBlock } from './blocks';
|
|
5
|
-
|
|
6
|
-
export type SettingValue = {
|
|
7
|
-
value?: SettingBlock['value'];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type Bundle = {
|
|
11
|
-
getBlock: (id: string) => SettingValue | null;
|
|
12
|
-
getAppBridge: () => AppBridgeBlock;
|
|
13
|
-
setBlockValue: (key: string, value: SettingBlock['value']) => void;
|
|
14
|
-
};
|
package/types/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { SettingBlock } from './blocks';
|
|
4
|
-
|
|
5
|
-
export * from './blocks';
|
|
6
|
-
export type { BaseBlock } from './blocks/base';
|
|
7
|
-
export type { Bundle, SettingValue } from './bundle';
|
|
8
|
-
export type { Rule } from './validation';
|
|
9
|
-
|
|
10
|
-
export enum Sections {
|
|
11
|
-
Main = 'main',
|
|
12
|
-
Basics = 'basics',
|
|
13
|
-
Layout = 'layout',
|
|
14
|
-
Style = 'style',
|
|
15
|
-
Security = 'security',
|
|
16
|
-
Targets = 'targets',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type BlockSettings = {
|
|
20
|
-
[Sections.Main]?: SettingBlock[];
|
|
21
|
-
[Sections.Basics]?: SettingBlock[];
|
|
22
|
-
[Sections.Layout]?: SettingBlock[];
|
|
23
|
-
[Sections.Style]?: SettingBlock[];
|
|
24
|
-
[Sections.Security]?: SettingBlock[];
|
|
25
|
-
};
|