Skip to content

Commit

Permalink
Storybook build
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jun 11, 2021
1 parent 89c780f commit 6333307
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 134 deletions.
12 changes: 6 additions & 6 deletions packages/fuselage-ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
"@rocket.chat/icons": "^0.26.0",
"@rocket.chat/prettier-config": "^0.26.0",
"@rocket.chat/ui-kit": "^0.26.0",
"@storybook/addon-essentials": "^6.2.9",
"@storybook/addons": "^6.2.9",
"@storybook/builder-webpack5": "^6.2.9",
"@storybook/react": "^6.2.9",
"@storybook/source-loader": "^6.2.9",
"@storybook/theming": "^6.2.9",
"@storybook/addon-essentials": "^6.1.11",
"@storybook/addons": "^6.1.11",
"@storybook/builder-webpack5": "^6.1.11",
"@storybook/react": "^6.1.11",
"@storybook/source-loader": "^6.1.11",
"@storybook/theming": "^6.1.11",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"eslint": "^7.26.0",
Expand Down
55 changes: 18 additions & 37 deletions packages/fuselage-ui-kit/src/surfaces/banner.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
UiKitParserBanner,
TextObjectType,
BlockElementType,
LayoutBlockType,
} from '@rocket.chat/ui-kit';
import { UiKitParserBanner } from '@rocket.chat/ui-kit';
import React from 'react';

import {
Expand All @@ -25,37 +20,23 @@ import {
} from '../renderers';
import BannerSurface from './BannerSurface';

class BannerParser extends UiKitParserBanner {
[TextObjectType.PLAIN_TEXT] = plainText;

[TextObjectType.MARKDOWN] = mrkdwn;

[BlockElementType.BUTTON] = button;

[BlockElementType.DATEPICKER] = datePicker;

[BlockElementType.IMAGE] = image;

[BlockElementType.STATIC_SELECT] = staticSelect;

[BlockElementType.MULTI_STATIC_SELECT] = multiStaticSelect;

[BlockElementType.OVERFLOW] = overflow;

[BlockElementType.PLAIN_TEXT_INPUT] = plainInput;

[BlockElementType.LINEAR_SCALE] = linearScale;

[LayoutBlockType.ACTIONS] = actions;

[LayoutBlockType.CONTEXT] = context;

[LayoutBlockType.DIVIDER] = divider;

[LayoutBlockType.INPUT] = input;

[LayoutBlockType.SECTION] = section;
}
class BannerParser extends UiKitParserBanner {}

BannerParser.prototype.plainText = plainText;
BannerParser.prototype.mrkdwn = mrkdwn;
BannerParser.prototype.divider = divider;
BannerParser.prototype.section = section;
BannerParser.prototype.image = image;
BannerParser.prototype.actions = actions;
BannerParser.prototype.context = context;
BannerParser.prototype.input = input;
BannerParser.prototype.button = button;
BannerParser.prototype.datePicker = datePicker;
BannerParser.prototype.staticSelect = staticSelect;
BannerParser.prototype.multiStaticSelect = multiStaticSelect;
BannerParser.prototype.overflow = overflow;
BannerParser.prototype.plainInput = plainInput;
BannerParser.prototype.linearScale = linearScale;

export const bannerParser = new BannerParser();

Expand Down
46 changes: 15 additions & 31 deletions packages/fuselage-ui-kit/src/surfaces/message.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
TextObjectType,
UiKitParserMessage,
BlockElementType,
LayoutBlockType,
} from '@rocket.chat/ui-kit';
import { UiKitParserMessage } from '@rocket.chat/ui-kit';
import React from 'react';

import {
Expand All @@ -22,31 +17,20 @@ import {
} from '../renderers';
import MessageSurface from './MessageSurface';

class MessageParser extends UiKitParserMessage {
[TextObjectType.PLAIN_TEXT] = plainText;

[TextObjectType.MARKDOWN] = mrkdwn;

[BlockElementType.BUTTON] = button;

[BlockElementType.DATEPICKER] = datePicker;

[BlockElementType.IMAGE] = image;

[BlockElementType.STATIC_SELECT] = staticSelect;

[BlockElementType.MULTI_STATIC_SELECT] = multiStaticSelect;

[BlockElementType.OVERFLOW] = overflow;

[LayoutBlockType.ACTIONS] = actions;

[LayoutBlockType.CONTEXT] = context;

[LayoutBlockType.DIVIDER] = divider;

[LayoutBlockType.SECTION] = section;
}
class MessageParser extends UiKitParserMessage {}

MessageParser.prototype.plainText = plainText;
MessageParser.prototype.mrkdwn = mrkdwn;
MessageParser.prototype.divider = divider;
MessageParser.prototype.section = section;
MessageParser.prototype.image = image;
MessageParser.prototype.actions = actions;
MessageParser.prototype.context = context;
MessageParser.prototype.button = button;
MessageParser.prototype.datePicker = datePicker;
MessageParser.prototype.staticSelect = staticSelect;
MessageParser.prototype.multiStaticSelect = multiStaticSelect;
MessageParser.prototype.overflow = overflow;

export const messageParser = new MessageParser();

Expand Down
58 changes: 48 additions & 10 deletions packages/fuselage-ui-kit/src/surfaces/message.stories.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 18 additions & 37 deletions packages/fuselage-ui-kit/src/surfaces/modal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
UiKitParserModal,
TextObjectType,
BlockElementType,
LayoutBlockType,
} from '@rocket.chat/ui-kit';
import { UiKitParserModal } from '@rocket.chat/ui-kit';
import React from 'react';

import {
Expand All @@ -25,37 +20,23 @@ import {
} from '../renderers';
import ModalSurface from './ModalSurface';

class ModalParser extends UiKitParserModal {
[TextObjectType.PLAIN_TEXT] = plainText;

[TextObjectType.MARKDOWN] = mrkdwn;

[BlockElementType.BUTTON] = button;

[BlockElementType.DATEPICKER] = datePicker;

[BlockElementType.IMAGE] = image;

[BlockElementType.STATIC_SELECT] = staticSelect;

[BlockElementType.MULTI_STATIC_SELECT] = multiStaticSelect;

[BlockElementType.OVERFLOW] = overflow;

[BlockElementType.PLAIN_TEXT_INPUT] = plainInput;

[BlockElementType.LINEAR_SCALE] = linearScale;

[LayoutBlockType.ACTIONS] = actions;

[LayoutBlockType.CONTEXT] = context;

[LayoutBlockType.DIVIDER] = divider;

[LayoutBlockType.INPUT] = input;

[LayoutBlockType.SECTION] = section;
}
class ModalParser extends UiKitParserModal {}

ModalParser.prototype.plainText = plainText;
ModalParser.prototype.mrkdwn = mrkdwn;
ModalParser.prototype.divider = divider;
ModalParser.prototype.section = section;
ModalParser.prototype.image = image;
ModalParser.prototype.actions = actions;
ModalParser.prototype.context = context;
ModalParser.prototype.input = input;
ModalParser.prototype.button = button;
ModalParser.prototype.datePicker = datePicker;
ModalParser.prototype.staticSelect = staticSelect;
ModalParser.prototype.multiStaticSelect = multiStaticSelect;
ModalParser.prototype.overflow = overflow;
ModalParser.prototype.plainInput = plainInput;
ModalParser.prototype.linearScale = linearScale;

export const modalParser = new ModalParser();

Expand Down
22 changes: 22 additions & 0 deletions packages/fuselage-ui-kit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"baseUrl": "./",
"allowSyntheticDefaultImports": true,
"module": "es2015",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": false,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "../",
"outDir": "dist",
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
2 changes: 2 additions & 0 deletions packages/ui-kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export { PlainText } from './blocks/text/PlainText';
export { Markdown } from './blocks/text/Markdown';
export { TextObject } from './blocks/TextObject';

export { Conditions } from './rendering/Conditions';

export { ButtonElement } from './blocks/elements/ButtonElement';
export { ChannelsSelectElement } from './blocks/elements/ChannelsSelectElement';
export { ConversationsSelectElement } from './blocks/elements/ConversationsSelectElement';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/src/rendering/BaseSurfaceRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export abstract class BaseSurfaceRenderer<
}

/** @deprecated */
public mrkdwn(
public [TextObjectType.MARKDOWN](
_element: Markdown,
_context: BlockContext,
_index: number
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4231,12 +4231,12 @@ __metadata:
"@rocket.chat/icons": ^0.26.0
"@rocket.chat/prettier-config": ^0.26.0
"@rocket.chat/ui-kit": ^0.26.0
"@storybook/addon-essentials": ^6.2.9
"@storybook/addons": ^6.2.9
"@storybook/builder-webpack5": ^6.2.9
"@storybook/react": ^6.2.9
"@storybook/source-loader": ^6.2.9
"@storybook/theming": ^6.2.9
"@storybook/addon-essentials": ^6.1.11
"@storybook/addons": ^6.1.11
"@storybook/builder-webpack5": ^6.1.11
"@storybook/react": ^6.1.11
"@storybook/source-loader": ^6.1.11
"@storybook/theming": ^6.1.11
babel-loader: ^8.2.2
cross-env: ^7.0.3
eslint: ^7.26.0
Expand Down Expand Up @@ -4810,7 +4810,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/addon-essentials@npm:^6.2.9":
"@storybook/addon-essentials@npm:^6.1.11, @storybook/addon-essentials@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/addon-essentials@npm:6.2.9"
dependencies:
Expand Down Expand Up @@ -4948,7 +4948,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/addons@npm:6.2.9, @storybook/addons@npm:^6.2.9":
"@storybook/addons@npm:6.2.9, @storybook/addons@npm:^6.1.11, @storybook/addons@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/addons@npm:6.2.9"
dependencies:
Expand Down Expand Up @@ -5083,7 +5083,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/builder-webpack5@npm:^6.2.9":
"@storybook/builder-webpack5@npm:^6.1.11, @storybook/builder-webpack5@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/builder-webpack5@npm:6.2.9"
dependencies:
Expand Down Expand Up @@ -5479,7 +5479,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/react@npm:^6.2.9":
"@storybook/react@npm:^6.1.11, @storybook/react@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/react@npm:6.2.9"
dependencies:
Expand Down Expand Up @@ -5556,7 +5556,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/source-loader@npm:6.2.9, @storybook/source-loader@npm:^6.2.9":
"@storybook/source-loader@npm:6.2.9, @storybook/source-loader@npm:^6.1.11, @storybook/source-loader@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/source-loader@npm:6.2.9"
dependencies:
Expand All @@ -5577,7 +5577,7 @@ __metadata:
languageName: node
linkType: hard

"@storybook/theming@npm:6.2.9, @storybook/theming@npm:^6.2.9":
"@storybook/theming@npm:6.2.9, @storybook/theming@npm:^6.1.11, @storybook/theming@npm:^6.2.9":
version: 6.2.9
resolution: "@storybook/theming@npm:6.2.9"
dependencies:
Expand Down

0 comments on commit 6333307

Please sign in to comment.