@betty-blocks/cli 25.27.3 → 25.28.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.
@@ -1,28 +1,68 @@
1
1
  {
2
2
  "name": "component-set",
3
- "version": "1.0.0",
3
+ "version": "1.227.0",
4
4
  "main": "dist/templates.json",
5
5
  "license": "UNLICENSED",
6
- "private": true,
6
+ "private": false,
7
7
  "devDependencies": {
8
- "@betty-blocks/cli": "^23.20.0",
9
- "eslint": "^5.9.0",
10
- "eslint-config-airbnb": "17.1.0",
11
- "eslint-config-prettier": "^3.3.0",
12
- "eslint-plugin-import": "^2.14.0",
13
- "eslint-plugin-jsx-a11y": "^6.1.1",
14
- "eslint-plugin-prettier": "^3.0.0",
15
- "eslint-plugin-react": "^7.11.1",
16
- "prettier": "^1.15.3",
17
- "nodemon": "^1.19.1",
18
- "rimraf": "^3.0.0"
8
+ "@betty-blocks/cli": "^25.27.1",
9
+ "@commitlint/cli": "^16.1.0",
10
+ "@commitlint/config-angular": "^16.0.0",
11
+ "@semantic-release/changelog": "^6.0.1",
12
+ "@semantic-release/git": "^10.0.1",
13
+ "@types/node": "^17.0.10",
14
+ "@typescript-eslint/eslint-plugin": "^5.21.0",
15
+ "@typescript-eslint/parser": "^5.21.0",
16
+ "eslint": "^8.3.0",
17
+ "eslint-config-airbnb": "^19.0.4",
18
+ "eslint-config-airbnb-typescript": "^17.0.0",
19
+ "eslint-config-prettier": "^8.3.0",
20
+ "eslint-plugin-import": "^2.25.3",
21
+ "eslint-plugin-jsx-a11y": "^6.5.1",
22
+ "eslint-plugin-prettier": "^4.0.0",
23
+ "eslint-plugin-react": "^7.27.1",
24
+ "eslint-plugin-react-hooks": "^4.3.0",
25
+ "husky": "^4.2.5",
26
+ "nodemon": "^2.0.15",
27
+ "prettier": "^2.5.0",
28
+ "semantic-release": "^19.0.2",
29
+ "webpack": "^5.64.4",
30
+ "webpack-cli": "^4.9.1"
31
+ },
32
+ "husky": {
33
+ "hooks": {
34
+ "pre-commit": "yarn lint",
35
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
36
+ }
19
37
  },
20
38
  "scripts": {
21
- "start": "bb components serve",
39
+ "start": "bb components serve -p 5002",
22
40
  "build": "bb components build",
23
41
  "dev": "nodemon",
24
- "preview": "bb components preview",
25
- "lint": "eslint --ext js ./src"
42
+ "lint": "eslint --ext .js,.ts,.tsx ./src",
43
+ "lint:ci": "yarn lint --max-warnings 0",
44
+ "prettier:base": "prettier --single-quote",
45
+ "prettier:check": "yarn prettier:base --list-different \"src/**/*.js\"",
46
+ "prettier:write": "yarn prettier:base --write \"src/**/*.js\"",
47
+ "upload": "bb components publish -b material-ui-component-set",
48
+ "test": "echo \"Error: no test specified\" && exit 0",
49
+ "bundle": "npx webpack --config webpack.config.js"
50
+ },
51
+ "files": ["dist"],
52
+ "dependencies": {
53
+ "@betty-blocks/component-sdk": "^1.7.1",
54
+ "@date-io/date-fns": "^1.3.13",
55
+ "@material-ui/core": "^4.9.11",
56
+ "@material-ui/icons": "^4.11.2",
57
+ "@material-ui/lab": "^4.0.0-alpha.50",
58
+ "@material-ui/pickers": "^3.2.10",
59
+ "@material-ui/styles": "^4.9.10",
60
+ "date-fns": "^2.11.0",
61
+ "react": "^16.13.1",
62
+ "react-dom": "^16.13.1"
26
63
  },
27
- "files": ["dist"]
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "https://github.com/bettyblocks/material-ui-component-set.git"
67
+ }
28
68
  }
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import {
3
+ component,
4
+ prefab,
5
+ variable,
6
+ Icon,
7
+ font,
8
+ buttongroup,
9
+ color,
10
+ ThemeColor,
11
+ } from '@betty-blocks/component-sdk';
12
+ import { showOn } from '../utils';
13
+
14
+ const attributes = {
15
+ category: 'CONTENT',
16
+ icon: Icon.TextInputIcon,
17
+ };
18
+
19
+ const options = {
20
+ content: variable('Content', { value: ['This is my first component!'] }),
21
+ type: font('Type', { value: 'Title1' }),
22
+ align: buttongroup(
23
+ 'Align',
24
+ [
25
+ ['Left', 'left'],
26
+ ['Center', 'center'],
27
+ ['Right', 'right'],
28
+ ],
29
+ { value: 'left' },
30
+ ),
31
+ padding: buttongroup(
32
+ 'Padding',
33
+ [
34
+ ['None', 'none'],
35
+ ['Dense', 'dense'],
36
+ ['Normal', 'normal'],
37
+ ],
38
+ { value: 'normal' },
39
+ ),
40
+ color: color('Text color', {
41
+ value: ThemeColor.BLACK,
42
+ ...showOn('styles'),
43
+ }),
44
+ };
45
+
46
+ export default prefab('Hello World', attributes, null, [
47
+ component('HelloWorld', { options }, []),
48
+ ]);
@@ -0,0 +1,18 @@
1
+ import { PrefabComponentOption, showIfTrue } from '@betty-blocks/component-sdk';
2
+
3
+ // TODO: export OptionProducer from the sdk
4
+ type OptionProducer = (key: string) => PrefabComponentOption;
5
+ type Attributes = Partial<PrefabComponentOption>;
6
+
7
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
8
+
9
+ export const updateOption = (
10
+ producer: OptionProducer,
11
+ attrs: Attributes,
12
+ ): OptionProducer => {
13
+ return (key) => ({ ...producer(key), ...attrs });
14
+ };
15
+
16
+ export const showOn = (key: string) => ({
17
+ configuration: { condition: showIfTrue(key) },
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betty-blocks/cli",
3
- "version": "25.27.3",
3
+ "version": "25.28.0",
4
4
  "description": "A Betty Blocks CLI",
5
5
  "main": "build/index.js",
6
6
  "author": "Niek Nijland <niek.nijland@bettyblocks.com>",
@@ -1,52 +0,0 @@
1
- (() => ({
2
- name: 'HelloWorld',
3
- icon: 'TitleIcon',
4
- category: 'CONTENT',
5
- structure: [
6
- {
7
- name: 'HelloWorld',
8
- options: [
9
- {
10
- type: 'FONT',
11
- label: 'Type',
12
- key: 'type',
13
- value: 'Title1',
14
- },
15
- {
16
- type: 'TEXT',
17
- label: 'Content',
18
- key: 'content',
19
- value: 'Hello World!',
20
- },
21
- {
22
- type: 'CUSTOM',
23
- label: 'Align',
24
- key: 'align',
25
- value: 'center',
26
- configuration: {
27
- as: 'BUTTONGROUP',
28
- dataType: 'string',
29
- allowedInput: [
30
- { name: 'Left', value: 'left' },
31
- { name: 'Center', value: 'center' },
32
- { name: 'Right', value: 'right' },
33
- ],
34
- },
35
- },
36
- {
37
- type: 'SIZES',
38
- label: 'Padding',
39
- key: 'padding',
40
- value: ['S', 'S', 'S', 'S'],
41
- },
42
- {
43
- type: 'COLOR',
44
- label: 'Color',
45
- key: 'color',
46
- value: 'Black',
47
- },
48
- ],
49
- descendants: [],
50
- },
51
- ],
52
- }))();