@frontify/guideline-blocks-settings 0.0.1-alpha.0 → 0.2.0
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/README.md +6 -7
- package/dist/blocks/assetInput.d.ts +25 -0
- package/dist/blocks/assetInput.js +16 -0
- package/dist/blocks/assetInput.js.map +1 -0
- package/dist/blocks/base.d.ts +8 -0
- package/dist/blocks/base.js +4 -0
- package/dist/blocks/base.js.map +1 -0
- package/dist/blocks/checkbox.d.ts +4 -0
- package/dist/blocks/checkbox.js +4 -0
- package/dist/blocks/checkbox.js.map +1 -0
- package/{types → dist}/blocks/checklist.d.ts +1 -4
- package/dist/blocks/checklist.js +4 -0
- package/dist/blocks/checklist.js.map +1 -0
- package/{types → dist}/blocks/choices.d.ts +2 -6
- package/dist/blocks/choices.js +4 -0
- package/dist/blocks/choices.js.map +1 -0
- package/{types → dist}/blocks/colorInput.d.ts +1 -4
- package/dist/blocks/colorInput.js +4 -0
- package/dist/blocks/colorInput.js.map +1 -0
- package/{types → dist}/blocks/dropdown.d.ts +3 -5
- package/dist/blocks/dropdown.js +4 -0
- package/dist/blocks/dropdown.js.map +1 -0
- package/dist/blocks/index.d.ts +19 -0
- package/dist/blocks/index.js +23 -0
- package/dist/blocks/index.js.map +1 -0
- package/{types → dist}/blocks/input.d.ts +1 -4
- package/dist/blocks/input.js +4 -0
- package/dist/blocks/input.js.map +1 -0
- package/{types → dist}/blocks/multiInput.d.ts +1 -4
- package/dist/blocks/multiInput.js +4 -0
- package/dist/blocks/multiInput.js.map +1 -0
- package/{types → dist}/blocks/slider.d.ts +1 -4
- package/dist/blocks/slider.js +4 -0
- package/dist/blocks/slider.js.map +1 -0
- package/dist/blocks/switch.d.ts +10 -0
- package/dist/blocks/switch.js +4 -0
- package/dist/blocks/switch.js.map +1 -0
- package/dist/blocks/templateInput.d.ts +7 -0
- package/dist/blocks/templateInput.js +4 -0
- package/dist/blocks/templateInput.js.map +1 -0
- package/dist/bundle.d.ts +8 -0
- package/dist/bundle.js +4 -0
- package/dist/bundle.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/validation.d.ts +4 -0
- package/dist/validation.js +4 -0
- package/dist/validation.js.map +1 -0
- package/package.json +20 -8
- package/types/blocks/assetInput.d.ts +0 -12
- package/types/blocks/base.d.ts +0 -11
- package/types/blocks/checkbox.d.ts +0 -6
- package/types/blocks/index.d.ts +0 -20
- package/types/blocks/switch.d.ts +0 -29
- package/types/bundle.d.ts +0 -12
- package/types/index.d.ts +0 -23
- package/types/validation.d.ts +0 -6
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# Block Settings
|
|
2
|
+
|
|
2
3
|
Provides the block settings types for the guideline-blocks.
|
|
3
4
|
|
|
4
5
|
## Example
|
|
6
|
+
|
|
5
7
|
```ts
|
|
6
|
-
import {
|
|
8
|
+
import { Bundle, BlockSettings } from '@frontify/guideline-blocks-settings';
|
|
7
9
|
import { IconEnum } from '@frontify/arcade';
|
|
8
10
|
|
|
9
|
-
const Settings:
|
|
11
|
+
const Settings: BlockSettings = {
|
|
10
12
|
main: [
|
|
11
13
|
{
|
|
12
14
|
id: 'example',
|
|
13
15
|
type: 'dropdown',
|
|
14
|
-
size: '
|
|
16
|
+
size: 'Large',
|
|
15
17
|
defaultValue: 'solid',
|
|
16
18
|
choices: [
|
|
17
19
|
{
|
|
@@ -25,7 +27,7 @@ const Settings: ApiSettings = {
|
|
|
25
27
|
label: 'Line',
|
|
26
28
|
},
|
|
27
29
|
],
|
|
28
|
-
onChange: (bundle:
|
|
30
|
+
onChange: (bundle: Bundle): void => {
|
|
29
31
|
const blockWidth = Number(bundle.getBlock('widthCustom')?.value);
|
|
30
32
|
if (!Number.isNaN(blockWidth)) {
|
|
31
33
|
bundle.setBlockValue('widthCustom', `${blockWidth}%`);
|
|
@@ -34,6 +36,3 @@ const Settings: ApiSettings = {
|
|
|
34
36
|
},
|
|
35
37
|
],
|
|
36
38
|
```
|
|
37
|
-
|
|
38
|
-
## Publish a new version to npm
|
|
39
|
-
Use `npm publish` from root of the monorepo to create a new version.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FileExtension, AssetChooserProjectType, AssetChooserObjectType } from '@frontify/app-bridge';
|
|
2
|
+
import { BaseBlock } from './base';
|
|
3
|
+
export declare enum AssetInputSource {
|
|
4
|
+
Library = "Library",
|
|
5
|
+
Upload = "Upload"
|
|
6
|
+
}
|
|
7
|
+
export declare enum AssetInputMode {
|
|
8
|
+
Both = "Both",
|
|
9
|
+
UploadOnly = "UploadOnly",
|
|
10
|
+
BrowseOnly = "BrowseOnly"
|
|
11
|
+
}
|
|
12
|
+
export declare type AssetInputValue = {
|
|
13
|
+
source: AssetInputSource;
|
|
14
|
+
value: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type AssetInputBlock = {
|
|
17
|
+
type: 'assetInput';
|
|
18
|
+
value?: AssetInputValue | AssetInputValue['value'];
|
|
19
|
+
defaultValue?: AssetInputValue | AssetInputValue['value'];
|
|
20
|
+
multiSelection?: boolean;
|
|
21
|
+
extensions?: FileExtension[];
|
|
22
|
+
projectTypes?: AssetChooserProjectType[];
|
|
23
|
+
objectTypes?: AssetChooserObjectType[];
|
|
24
|
+
mode?: AssetInputMode;
|
|
25
|
+
} & BaseBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AssetInputMode = exports.AssetInputSource = void 0;
|
|
5
|
+
var AssetInputSource;
|
|
6
|
+
(function (AssetInputSource) {
|
|
7
|
+
AssetInputSource["Library"] = "Library";
|
|
8
|
+
AssetInputSource["Upload"] = "Upload";
|
|
9
|
+
})(AssetInputSource = exports.AssetInputSource || (exports.AssetInputSource = {}));
|
|
10
|
+
var AssetInputMode;
|
|
11
|
+
(function (AssetInputMode) {
|
|
12
|
+
AssetInputMode["Both"] = "Both";
|
|
13
|
+
AssetInputMode["UploadOnly"] = "UploadOnly";
|
|
14
|
+
AssetInputMode["BrowseOnly"] = "BrowseOnly";
|
|
15
|
+
})(AssetInputMode = exports.AssetInputMode || (exports.AssetInputMode = {}));
|
|
16
|
+
//# sourceMappingURL=assetInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetInput.js","sourceRoot":"","sources":["../../types/blocks/assetInput.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;AAKvD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;AACrB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,2CAAyB,CAAA;IACzB,2CAAyB,CAAA;AAC7B,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../types/blocks/base.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../types/blocks/checkbox.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { BaseBlock } from './base';
|
|
4
2
|
import { Checkbox } from './checkbox';
|
|
5
|
-
|
|
6
|
-
export type ChecklistBlock = {
|
|
3
|
+
export declare type ChecklistBlock = {
|
|
7
4
|
type: 'checklist';
|
|
8
5
|
choices: Checkbox[];
|
|
9
6
|
value?: string[] | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist.js","sourceRoot":"","sources":["../../types/blocks/checklist.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { IconEnum } from '@frontify/arcade';
|
|
4
2
|
import { BaseBlock } from './base';
|
|
5
|
-
|
|
6
|
-
export type Choice = {
|
|
3
|
+
export declare type Choice = {
|
|
7
4
|
label?: string | number;
|
|
8
5
|
icon?: IconEnum;
|
|
9
6
|
value: string | number;
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
export type ChoicesType = {
|
|
8
|
+
export declare type ChoicesType = {
|
|
13
9
|
choices: Choice[];
|
|
14
10
|
value?: string | number;
|
|
15
11
|
defaultValue: string | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choices.js","sourceRoot":"","sources":["../../types/blocks/choices.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { Color } from '@frontify/arcade';
|
|
4
2
|
import { BaseBlock } from './base';
|
|
5
|
-
|
|
6
|
-
export type ColorInputBlock = {
|
|
3
|
+
export declare type ColorInputBlock = {
|
|
7
4
|
type: 'colorInput';
|
|
8
5
|
value?: Color;
|
|
9
6
|
defaultValue?: Color;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorInput.js","sourceRoot":"","sources":["../../types/blocks/colorInput.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { DropdownSize } from '@frontify/arcade';
|
|
3
2
|
import { ChoicesType } from './choices';
|
|
4
|
-
|
|
5
|
-
export type DropdownBlock = {
|
|
3
|
+
export declare type DropdownBlock = {
|
|
6
4
|
type: 'dropdown';
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
placeholder?: string;
|
|
9
|
-
size?:
|
|
7
|
+
size?: DropdownSize;
|
|
10
8
|
} & ChoicesType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../types/blocks/dropdown.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { MultiInputBlock } from './multiInput';
|
|
7
|
+
import { SliderBlock } from './slider';
|
|
8
|
+
import { SwitchBlock } from './switch';
|
|
9
|
+
import { TemplateInputBlock } from './templateInput';
|
|
10
|
+
export * from './assetInput';
|
|
11
|
+
export * from './checklist';
|
|
12
|
+
export * from './colorInput';
|
|
13
|
+
export * from './dropdown';
|
|
14
|
+
export * from './input';
|
|
15
|
+
export * from './multiInput';
|
|
16
|
+
export * from './slider';
|
|
17
|
+
export * from './switch';
|
|
18
|
+
export * from './templateInput';
|
|
19
|
+
export declare type SettingBlock = AssetInputBlock | ChecklistBlock | ColorInputBlock | DropdownBlock | InputBlock | MultiInputBlock | SliderBlock | SwitchBlock | TemplateInputBlock;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6
|
+
}) : (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
o[k2] = m[k];
|
|
9
|
+
}));
|
|
10
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
11
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
__exportStar(require("./assetInput"), exports);
|
|
15
|
+
__exportStar(require("./checklist"), exports);
|
|
16
|
+
__exportStar(require("./colorInput"), exports);
|
|
17
|
+
__exportStar(require("./dropdown"), exports);
|
|
18
|
+
__exportStar(require("./input"), exports);
|
|
19
|
+
__exportStar(require("./multiInput"), exports);
|
|
20
|
+
__exportStar(require("./slider"), exports);
|
|
21
|
+
__exportStar(require("./switch"), exports);
|
|
22
|
+
__exportStar(require("./templateInput"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/blocks/index.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;AAYvD,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { TextInputType } from '@frontify/arcade';
|
|
4
2
|
import { Rule } from '../validation';
|
|
5
3
|
import { BaseBlock } from './base';
|
|
6
|
-
|
|
7
|
-
export type InputBlock = {
|
|
4
|
+
export declare type InputBlock = {
|
|
8
5
|
type: 'input';
|
|
9
6
|
inputType?: TextInputType;
|
|
10
7
|
placeholder?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../types/blocks/input.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { MultiInputLayout } from '@frontify/arcade';
|
|
4
2
|
import { BaseBlock } from './base';
|
|
5
3
|
import { ColorInputBlock } from './colorInput';
|
|
6
4
|
import { DropdownBlock } from './dropdown';
|
|
7
5
|
import { InputBlock } from './input';
|
|
8
|
-
|
|
9
|
-
export type MultiInputBlock = {
|
|
6
|
+
export declare type MultiInputBlock = {
|
|
10
7
|
type: 'multiInput';
|
|
11
8
|
layout: MultiInputLayout;
|
|
12
9
|
blocks: (Omit<InputBlock, 'value'> | Omit<ColorInputBlock, 'value'> | Omit<DropdownBlock, 'value'>)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiInput.js","sourceRoot":"","sources":["../../types/blocks/multiInput.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.js","sourceRoot":"","sources":["../../types/blocks/slider.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseBlock } from './base';
|
|
2
|
+
import { SettingBlock } from './index';
|
|
3
|
+
export declare type SwitchBlock = {
|
|
4
|
+
type: 'switch';
|
|
5
|
+
switchLabel?: string;
|
|
6
|
+
on?: SettingBlock[];
|
|
7
|
+
off?: SettingBlock[];
|
|
8
|
+
value?: boolean;
|
|
9
|
+
defaultValue: boolean;
|
|
10
|
+
} & BaseBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../types/blocks/switch.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateInput.js","sourceRoot":"","sources":["../../types/blocks/templateInput.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SettingBlock } from './blocks';
|
|
2
|
+
export declare type SettingValue = {
|
|
3
|
+
value?: SettingBlock['value'];
|
|
4
|
+
};
|
|
5
|
+
export declare type Bundle = {
|
|
6
|
+
getBlock: (id: string) => SettingValue | null;
|
|
7
|
+
setBlockValue: (key: string, value: SettingBlock['value']) => void;
|
|
8
|
+
};
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../types/bundle.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SettingBlock } from './blocks';
|
|
2
|
+
export * from './blocks';
|
|
3
|
+
export type { BaseBlock } from './blocks/base';
|
|
4
|
+
export type { Bundle, SettingValue } from './bundle';
|
|
5
|
+
export type { Rule } from './validation';
|
|
6
|
+
export declare enum Sections {
|
|
7
|
+
Main = "main",
|
|
8
|
+
Content = "content",
|
|
9
|
+
Layout = "layout",
|
|
10
|
+
Style = "style",
|
|
11
|
+
Security = "security",
|
|
12
|
+
Targets = "targets"
|
|
13
|
+
}
|
|
14
|
+
export declare type BlockSettings = {
|
|
15
|
+
[Sections.Main]?: SettingBlock[];
|
|
16
|
+
[Sections.Content]?: SettingBlock[];
|
|
17
|
+
[Sections.Layout]?: SettingBlock[];
|
|
18
|
+
[Sections.Style]?: SettingBlock[];
|
|
19
|
+
[Sections.Security]?: SettingBlock[];
|
|
20
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6
|
+
}) : (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
o[k2] = m[k];
|
|
9
|
+
}));
|
|
10
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
11
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Sections = void 0;
|
|
15
|
+
__exportStar(require("./blocks"), exports);
|
|
16
|
+
var Sections;
|
|
17
|
+
(function (Sections) {
|
|
18
|
+
Sections["Main"] = "main";
|
|
19
|
+
Sections["Content"] = "content";
|
|
20
|
+
Sections["Layout"] = "layout";
|
|
21
|
+
Sections["Style"] = "style";
|
|
22
|
+
Sections["Security"] = "security";
|
|
23
|
+
Sections["Targets"] = "targets";
|
|
24
|
+
})(Sections = exports.Sections || (exports.Sections = {}));
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../types/index.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;AAIvD,2CAAyB;AAKzB,IAAY,QAOX;AAPD,WAAY,QAAQ;IAChB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;IACf,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;AACvB,CAAC,EAPW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAOnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../types/validation.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Provides the types for the block settings",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"main": "dist/index.js",
|
|
5
8
|
"files": [
|
|
6
|
-
"
|
|
9
|
+
"dist"
|
|
7
10
|
],
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
8
12
|
"publishConfig": {
|
|
9
13
|
"access": "public"
|
|
10
14
|
},
|
|
11
|
-
"types": "types/index.d.ts",
|
|
12
15
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"lint": "eslint types",
|
|
19
|
+
"lint:fix": "eslint --fix types",
|
|
20
|
+
"prettier": "prettier --check types",
|
|
21
|
+
"prettier:fix": "prettier --write types"
|
|
22
|
+
},
|
|
13
23
|
"devDependencies": {
|
|
14
|
-
"typescript": "
|
|
24
|
+
"@frontify/eslint-config-typescript": "0.14.0",
|
|
25
|
+
"eslint": "8.5.0",
|
|
26
|
+
"prettier": "2.5.1",
|
|
27
|
+
"typescript": "4.5.4"
|
|
15
28
|
},
|
|
16
29
|
"dependencies": {
|
|
17
|
-
"@frontify/app-bridge": "
|
|
18
|
-
"@frontify/arcade": "
|
|
19
|
-
}
|
|
20
|
-
"gitHead": "1b93acd36853dba4103b56903b817816eb86f11f"
|
|
30
|
+
"@frontify/app-bridge": "2.11.0",
|
|
31
|
+
"@frontify/arcade": "0.16.2"
|
|
32
|
+
}
|
|
21
33
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { FileExtension } from '@frontify/app-bridge';
|
|
4
|
-
import { AssetInputProps } from '@frontify/arcade';
|
|
5
|
-
import { BaseBlock } from './base';
|
|
6
|
-
|
|
7
|
-
export type AssetInputBlock = {
|
|
8
|
-
type: 'assetInput';
|
|
9
|
-
asset?: AssetInputProps['asset'];
|
|
10
|
-
value?: number;
|
|
11
|
-
allowedExtensions: FileExtension[];
|
|
12
|
-
} & BaseBlock;
|
package/types/blocks/base.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { ApiBundle } from '../bundle';
|
|
4
|
-
|
|
5
|
-
export type BaseBlock = {
|
|
6
|
-
id: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
info?: string;
|
|
9
|
-
show?: (bundle: ApiBundle) => boolean;
|
|
10
|
-
onChange?: (bundle: ApiBundle) => void;
|
|
11
|
-
};
|
package/types/blocks/index.d.ts
DELETED
|
@@ -1,20 +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 { MultiInputBlock } from './multiInput';
|
|
9
|
-
import { SliderBlock } from './slider';
|
|
10
|
-
import { SwitchBlock } from './switch';
|
|
11
|
-
|
|
12
|
-
export type ApiBlock =
|
|
13
|
-
| AssetInputBlock
|
|
14
|
-
| ColorInputBlock
|
|
15
|
-
| SwitchBlock
|
|
16
|
-
| DropdownBlock
|
|
17
|
-
| SliderBlock
|
|
18
|
-
| InputBlock
|
|
19
|
-
| MultiInputBlock
|
|
20
|
-
| ChecklistBlock;
|
package/types/blocks/switch.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { BaseBlock } from './base';
|
|
4
|
-
import { AssetInputBlock } from './assetInput';
|
|
5
|
-
import { ChecklistBlock } from './checklist';
|
|
6
|
-
import { ColorInputBlock } from './colorInput';
|
|
7
|
-
import { DropdownBlock } from './dropdown';
|
|
8
|
-
import { InputBlock } from './input';
|
|
9
|
-
import { MultiInputBlock } from './multiInput';
|
|
10
|
-
import { SliderBlock } from './slider';
|
|
11
|
-
|
|
12
|
-
export type Block =
|
|
13
|
-
| AssetInputBlock
|
|
14
|
-
| ChecklistBlock
|
|
15
|
-
| ColorInputBlock
|
|
16
|
-
| DropdownBlock
|
|
17
|
-
| InputBlock
|
|
18
|
-
| MultiInputBlock
|
|
19
|
-
| SliderBlock
|
|
20
|
-
| SwitchBlock;
|
|
21
|
-
|
|
22
|
-
export type SwitchBlock = {
|
|
23
|
-
type: 'switch';
|
|
24
|
-
switchLabel?: string;
|
|
25
|
-
on?: Block[];
|
|
26
|
-
off?: Block[];
|
|
27
|
-
value?: boolean;
|
|
28
|
-
defaultValue: boolean;
|
|
29
|
-
} & BaseBlock;
|
package/types/bundle.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { ApiBlock } from './blocks';
|
|
4
|
-
|
|
5
|
-
type ApiField = {
|
|
6
|
-
value?: ApiBlock['value'];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type ApiBundle = {
|
|
10
|
-
getBlock: (id: string) => ApiField | null;
|
|
11
|
-
setBlockValue: (key: string, value: ApiBlock['value']) => void;
|
|
12
|
-
};
|
package/types/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { ApiBlock } from './blocks';
|
|
4
|
-
|
|
5
|
-
export { BaseBlock } from './blocks/base';
|
|
6
|
-
export { ApiBundle } from './bundle';
|
|
7
|
-
|
|
8
|
-
export enum Sections {
|
|
9
|
-
Main = 'main',
|
|
10
|
-
Content = 'content',
|
|
11
|
-
Layout = 'layout',
|
|
12
|
-
Style = 'style',
|
|
13
|
-
Security = 'security',
|
|
14
|
-
Targets = 'targets',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type ApiSettings = {
|
|
18
|
-
[Sections.Main]?: ApiBlock[];
|
|
19
|
-
[Sections.Content]?: ApiBlock[];
|
|
20
|
-
[Sections.Layout]?: ApiBlock[];
|
|
21
|
-
[Sections.Style]?: ApiBlock[];
|
|
22
|
-
[Sections.Security]?: ApiBlock[];
|
|
23
|
-
};
|