@frontify/guideline-blocks-settings 0.2.0 → 0.4.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.
@@ -15,11 +15,9 @@ export declare type AssetInputValue = {
15
15
  };
16
16
  export declare type AssetInputBlock = {
17
17
  type: 'assetInput';
18
- value?: AssetInputValue | AssetInputValue['value'];
19
- defaultValue?: AssetInputValue | AssetInputValue['value'];
20
18
  multiSelection?: boolean;
21
19
  extensions?: FileExtension[];
22
20
  projectTypes?: AssetChooserProjectType[];
23
21
  objectTypes?: AssetChooserObjectType[];
24
22
  mode?: AssetInputMode;
25
- } & BaseBlock;
23
+ } & BaseBlock<AssetInputValue | AssetInputValue['value']>;
@@ -1,8 +1,10 @@
1
1
  import { Bundle } from '../bundle';
2
- export declare type BaseBlock = {
2
+ export declare type BaseBlock<T = undefined> = {
3
3
  id: string;
4
4
  label?: string;
5
5
  info?: string;
6
+ value?: T;
7
+ defaultValue?: T;
6
8
  show?: (bundle: Bundle) => boolean;
7
9
  onChange?: (bundle: Bundle) => void;
8
10
  };
@@ -3,8 +3,6 @@ import { Checkbox } from './checkbox';
3
3
  export declare type ChecklistBlock = {
4
4
  type: 'checklist';
5
5
  choices: Checkbox[];
6
- value?: string[] | null;
7
- defaultValue: string[];
8
6
  showClearAndSelectAllButtons?: boolean;
9
7
  columns?: 1 | 2;
10
- } & BaseBlock;
8
+ } & BaseBlock<string[] | null>;
@@ -7,6 +7,4 @@ export declare type Choice = {
7
7
  };
8
8
  export declare type ChoicesType = {
9
9
  choices: Choice[];
10
- value?: string | number;
11
- defaultValue: string | number;
12
- } & BaseBlock;
10
+ } & BaseBlock<string | number>;
@@ -2,6 +2,4 @@ import { Color } from '@frontify/arcade';
2
2
  import { BaseBlock } from './base';
3
3
  export declare type ColorInputBlock = {
4
4
  type: 'colorInput';
5
- value?: Color;
6
- defaultValue?: Color;
7
- } & BaseBlock;
5
+ } & BaseBlock<Color>;
@@ -4,16 +4,21 @@ import { ColorInputBlock } from './colorInput';
4
4
  import { DropdownBlock } from './dropdown';
5
5
  import { InputBlock } from './input';
6
6
  import { MultiInputBlock } from './multiInput';
7
+ import { ReferenceBlock } from './reference';
8
+ import { SectionHeadingBlock } from './sectionHeading';
7
9
  import { SliderBlock } from './slider';
8
10
  import { SwitchBlock } from './switch';
9
11
  import { TemplateInputBlock } from './templateInput';
10
12
  export * from './assetInput';
11
13
  export * from './checklist';
14
+ export * from './choices';
12
15
  export * from './colorInput';
13
16
  export * from './dropdown';
14
17
  export * from './input';
15
18
  export * from './multiInput';
19
+ export * from './reference';
20
+ export * from './sectionHeading';
16
21
  export * from './slider';
17
22
  export * from './switch';
18
23
  export * from './templateInput';
19
- export declare type SettingBlock = AssetInputBlock | ChecklistBlock | ColorInputBlock | DropdownBlock | InputBlock | MultiInputBlock | SliderBlock | SwitchBlock | TemplateInputBlock;
24
+ export declare type SettingBlock = AssetInputBlock | ChecklistBlock | ColorInputBlock | DropdownBlock | SectionHeadingBlock | InputBlock | MultiInputBlock | SliderBlock | SwitchBlock | TemplateInputBlock | ReferenceBlock;
@@ -13,10 +13,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  __exportStar(require("./assetInput"), exports);
15
15
  __exportStar(require("./checklist"), exports);
16
+ __exportStar(require("./choices"), exports);
16
17
  __exportStar(require("./colorInput"), exports);
17
18
  __exportStar(require("./dropdown"), exports);
18
19
  __exportStar(require("./input"), exports);
19
20
  __exportStar(require("./multiInput"), exports);
21
+ __exportStar(require("./reference"), exports);
22
+ __exportStar(require("./sectionHeading"), exports);
20
23
  __exportStar(require("./slider"), exports);
21
24
  __exportStar(require("./switch"), exports);
22
25
  __exportStar(require("./templateInput"), exports);
@@ -1 +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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/blocks/index.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;AAcvD,+CAA6B;AAC7B,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,mDAAiC;AACjC,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC"}
@@ -5,8 +5,6 @@ export declare type InputBlock = {
5
5
  type: 'input';
6
6
  inputType?: TextInputType;
7
7
  placeholder?: string;
8
- value?: string;
9
- defaultValue?: string;
10
8
  clearable?: boolean;
11
9
  rules?: Rule<string>[];
12
- } & BaseBlock;
10
+ } & BaseBlock<string>;
@@ -7,6 +7,5 @@ export declare type MultiInputBlock = {
7
7
  type: 'multiInput';
8
8
  layout: MultiInputLayout;
9
9
  blocks: (Omit<InputBlock, 'value'> | Omit<ColorInputBlock, 'value'> | Omit<DropdownBlock, 'value'>)[];
10
- value?: (InputBlock['value'] | ColorInputBlock['value'] | DropdownBlock['value'])[];
11
10
  lastItemFullWidth?: boolean;
12
- } & BaseBlock;
11
+ } & BaseBlock<(InputBlock['value'] | ColorInputBlock['value'] | DropdownBlock['value'])[]>;
@@ -0,0 +1,28 @@
1
+ import { BaseBlock } from './base';
2
+ export declare enum ReferenceStyle {
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 ReferenceBlockDividerPosition {
14
+ Top = "Top",
15
+ Bottom = "Bottom",
16
+ Both = "Both",
17
+ None = "None"
18
+ }
19
+ export declare type ReferenceBlock = {
20
+ type: 'reference';
21
+ title?: string;
22
+ text?: string;
23
+ style: ReferenceStyle;
24
+ link?: Link;
25
+ styles?: {
26
+ divider?: ReferenceBlockDividerPosition;
27
+ };
28
+ } & BaseBlock;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /* (c) Copyright Frontify Ltd., all rights reserved. */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ReferenceBlockDividerPosition = exports.ReferenceStyle = void 0;
5
+ var ReferenceStyle;
6
+ (function (ReferenceStyle) {
7
+ ReferenceStyle["Warning"] = "Warning";
8
+ ReferenceStyle["Negative"] = "Negative";
9
+ ReferenceStyle["Positive"] = "Positive";
10
+ ReferenceStyle["Info"] = "Info";
11
+ })(ReferenceStyle = exports.ReferenceStyle || (exports.ReferenceStyle = {}));
12
+ var ReferenceBlockDividerPosition;
13
+ (function (ReferenceBlockDividerPosition) {
14
+ ReferenceBlockDividerPosition["Top"] = "Top";
15
+ ReferenceBlockDividerPosition["Bottom"] = "Bottom";
16
+ ReferenceBlockDividerPosition["Both"] = "Both";
17
+ ReferenceBlockDividerPosition["None"] = "None";
18
+ })(ReferenceBlockDividerPosition = exports.ReferenceBlockDividerPosition || (exports.ReferenceBlockDividerPosition = {}));
19
+ //# sourceMappingURL=reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.js","sourceRoot":"","sources":["../../types/blocks/reference.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;AAIvD,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACjB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAQD,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACrC,4CAAW,CAAA;IACX,kDAAiB,CAAA;IACjB,8CAAa,CAAA;IACb,8CAAa,CAAA;AACjB,CAAC,EALW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAKxC"}
@@ -0,0 +1,7 @@
1
+ import { BaseBlock } from './base';
2
+ import { SettingBlock } from './index';
3
+ export declare type SectionHeadingBlock = {
4
+ type: 'sectionHeading';
5
+ blocks: SettingBlock[];
6
+ label: string;
7
+ } & BaseBlock;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /* (c) Copyright Frontify Ltd., all rights reserved. */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=sectionHeading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sectionHeading.js","sourceRoot":"","sources":["../../types/blocks/sectionHeading.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
@@ -5,6 +5,4 @@ export declare type SwitchBlock = {
5
5
  switchLabel?: string;
6
6
  on?: SettingBlock[];
7
7
  off?: SettingBlock[];
8
- value?: boolean;
9
- defaultValue: boolean;
10
- } & BaseBlock;
8
+ } & BaseBlock<boolean>;
@@ -1,7 +1,5 @@
1
1
  import { BaseBlock } from './base';
2
2
  export declare type TemplateInputBlock = {
3
3
  type: 'templateInput';
4
- value?: number;
5
- defaultValue?: number;
6
4
  multiSelection?: boolean;
7
- } & BaseBlock;
5
+ } & BaseBlock<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontify/guideline-blocks-settings",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Provides the types for the block settings",
5
5
  "sideEffects": false,
6
6
  "module": "dist/index.js",
@@ -18,16 +18,17 @@
18
18
  "lint": "eslint types",
19
19
  "lint:fix": "eslint --fix types",
20
20
  "prettier": "prettier --check types",
21
- "prettier:fix": "prettier --write types"
21
+ "prettier:fix": "prettier --write types",
22
+ "typecheck": "tsc --noEmit"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@frontify/eslint-config-typescript": "0.14.0",
25
- "eslint": "8.5.0",
26
+ "eslint": "8.7.0",
26
27
  "prettier": "2.5.1",
27
- "typescript": "4.5.4"
28
+ "typescript": "4.5.5"
28
29
  },
29
30
  "dependencies": {
30
31
  "@frontify/app-bridge": "2.11.0",
31
- "@frontify/arcade": "0.16.2"
32
+ "@frontify/arcade": "1.0.0"
32
33
  }
33
34
  }