Skip to content

Commit

Permalink
feat: ui-kit-unified (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Jun 11, 2021
1 parent 67a86ec commit ce48ca9
Show file tree
Hide file tree
Showing 144 changed files with 2,071 additions and 1,292 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
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
4 changes: 2 additions & 2 deletions packages/fuselage-ui-kit/src/elements/OverflowElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const OverflowElement = ({ element, context, parser }) => {
action,
]);

const convertedOptions = convertOptions(options, parser.text);
const convertedOptions = convertOptions(options, parser.text.bind(parser));
const [
cursor,
handleKeyDown,
Expand Down Expand Up @@ -68,7 +68,7 @@ const OverflowElement = ({ element, context, parser }) => {
>
<Options
onSelect={handleSelection}
options={convertOptions(options, parser.text)}
options={convertOptions(options, parser.text.bind(parser))}
cursor={cursor}
/>
</PositionAnimated>
Expand Down
1 change: 0 additions & 1 deletion packages/fuselage-ui-kit/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export const UiKitComponent = ({ render, blocks }) => render(blocks);
export * from './surfaces/banner';
export * from './surfaces/message';
export * from './surfaces/modal';
export * from './surfaces/text';
export * from './hooks';
6 changes: 2 additions & 4 deletions packages/fuselage-ui-kit/src/surfaces/banner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uiKitBanner, UiKitParserBanner } from '@rocket.chat/ui-kit';
import { UiKitParserBanner } from '@rocket.chat/ui-kit';
import React from 'react';

import {
Expand Down Expand Up @@ -42,8 +42,6 @@ export const bannerParser = new BannerParser();

export const UiKitBanner = (blocks, conditions = {}) => (
<BannerSurface>
{uiKitBanner(bannerParser, { engine: 'rocket.chat', ...conditions })(
blocks
)}
{bannerParser.render(blocks, { engine: 'rocket.chat', ...conditions })}
</BannerSurface>
);
6 changes: 2 additions & 4 deletions packages/fuselage-ui-kit/src/surfaces/message.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uiKitMessage, UiKitParserMessage } from '@rocket.chat/ui-kit';
import { UiKitParserMessage } from '@rocket.chat/ui-kit';
import React from 'react';

import {
Expand Down Expand Up @@ -36,8 +36,6 @@ export const messageParser = new MessageParser();

export const UiKitMessage = (blocks, conditions = {}) => (
<MessageSurface>
{uiKitMessage(messageParser, { engine: 'rocket.chat', ...conditions })(
blocks
)}
{messageParser.render(blocks, { engine: 'rocket.chat', ...conditions })}
</MessageSurface>
);
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.

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

import {
Expand Down Expand Up @@ -42,6 +42,6 @@ export const modalParser = new ModalParser();

export const UiKitModal = (blocks, conditions = {}) => (
<ModalSurface>
{uiKitModal(modalParser, { engine: 'rocket.chat', ...conditions })(blocks)}
{modalParser.render(blocks, { engine: 'rocket.chat', ...conditions })}
</ModalSurface>
);
13 changes: 0 additions & 13 deletions packages/fuselage-ui-kit/src/surfaces/text.js

This file was deleted.

75 changes: 0 additions & 75 deletions packages/fuselage-ui-kit/src/surfaces/text.stories.js

This file was deleted.

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"]
}
1 change: 1 addition & 0 deletions packages/ui-kit/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
errorOnDeprecated: true,
testMatch: ['<rootDir>/src/**/*.spec.[jt]s?(x)'],
globals: {
Expand Down
19 changes: 15 additions & 4 deletions packages/ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,28 @@
"bugs": {
"url": "https://github.com/RocketChat/Rocket.Chat.Fuselage/issues"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"typesVersions": {
"<4.1": {
"*": [
"ts3.4/*"
]
}
},
"files": [
"/dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "run-s .:build:clean .:build:prod",
"build": "run-s .:build:clean .:build:esm .:build:cjs .:build:ts3.4",
".:build:clean": "rimraf dist",
".:build:prod": "webpack --mode production",
".:build:esm": "tsc -p tsconfig.json",
".:build:cjs": "tsc -p tsconfig-cjs.json",
".:build:ts3.4": "downlevel-dts dist/esm/ dist/ts3.4/ --to=3.4",
"lint": "eslint --ext js,ts src",
"lint-fix": "eslint --fix --ext js,ts src",
"lint-staged": "lint-staged",
Expand All @@ -43,6 +53,7 @@
"@rocket.chat/prettier-config": "^0.26.0",
"@types/jest": "^26.0.23",
"babel-loader": "^8.2.2",
"downlevel-dts": "^0.7.0",
"eslint": "^7.26.0",
"jest": "^26.6.3",
"lint-staged": "^11.0.0",
Expand Down
Loading

0 comments on commit ce48ca9

Please sign in to comment.