Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Sep 8, 2023
1 parent 7cf1387 commit 9f5459f
Show file tree
Hide file tree
Showing 55 changed files with 44,466 additions and 20,843 deletions.
19 changes: 18 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
module.exports = {
extends: ['@gravity-ui/eslint-config'],
extends: ['@gravity-ui/eslint-config', '@gravity-ui/eslint-config/prettier'],
root: true,
rules: {
'no-param-reassign': 'off',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
groups: [['builtin', 'external'], 'internal', 'parent', 'sibling', 'index'],
warnOnUnassignedImports: true,
pathGroups: [
{
pattern: '*.s?css$',
group: 'index',
},
],
},
],
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.publish.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: ['@gravity-ui/eslint-config/prettier', './.eslintrc.js'],
extends: ['./.eslintrc.js', '@gravity-ui/eslint-config/prettier'],
root: true,
};
112 changes: 112 additions & 0 deletions V3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
## Breaking

- Update to `@gravity-ui/uilit@5`
- Remove peer dependency on `@doc-tools/transform`
`@doc-tools/transform` js and css bundles should be attached directly to final projects
- `DISLIKE_VARIANTS` not exported from package. Use `i18n['feedback-variants']` instead.


### BookmarkButton
- `bookmarkedPage` prop was changed to `isBookmarked`. (Same as `isLiked`, `isDislaked` in Feedback component)
- `onChangeBookmarkPage` renamed to `onBookmark`

### Contributors
- Removed `lang` prop

### Control
- Replace `setRef` prop with `ref` (using forwardRef now)

### Controls
- Removed `lang` prop
- Prop `showEditControl` replaced by `hideEditControl`

### DividerControl
- Removed `size`, `isVerticalView` props
- Values for `size`, `isVerticalView` now stored in `ControlsLayoutContext`

### FullScreenControl
- Removed `lang` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop
- Icon replaced with equal from `@gravity-ui/uikit`

### LangControl
- Prop `onChangeLang` is required now
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop
- Icon replaced with equal from `@gravity-ui/uikit`

### PdfControl
- Prop `pdfLink` is required now
- Removed `lang` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop

### SettingsControl
- Removed `lang` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop

### SinglePageControl
- Prop `onChange` is required now
- Removed `lang` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop

### DocLayout
- Removed `lang` prop
-
### DocLeadingPage
- Removed `lang` prop

### DocPageTitle
- Ownership on bookmarks was removed.
Bookmarks should be passed as children.
- Removed `bookmarkedPage`, `onChangeBookmarkPage` props.

### EditButton
- Was removed in favor of EditControl

### ErrorPage
- Removed `lang` prop

### Feedback
- Removed `lang` prop
- Removed `singlePage` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop
- Pick `dislikeVariants` from i18n by default
- Icons replaced with equal from `@gravity-ui/uikit`

### MiniToc
- Removed `lang` prop
- MiniToc returns `null` on empty headings. (Previously it render useless title)

### SearchBar
- Removed `lang` prop
- Icons replaced with equal from `@gravity-ui/uikit`

### SearchItem
- Removed `lang` prop

### SearchPage
- Removed `lang` prop

### Subscribe
- Prop `onSubscribe` is required now
- Removed `lang` prop
- Removed `size`, `isVerticalView`, `className`, `popupPosition` props
- Values for `size`, `isVerticalView`, `popupPosition` now stored in `ControlsLayoutContext`
- Value for `className` now stored in `ControlsLayoutContext.controlClassName` prop

### Toc
- Removed `lang` prop

### TocNavPanel
- Removed `lang` prop
3 changes: 0 additions & 3 deletions assets/icons/full-screen-clicked.svg

This file was deleted.

4 changes: 0 additions & 4 deletions assets/icons/subscribe.svg

This file was deleted.

4 changes: 0 additions & 4 deletions assets/icons/unsubscribe.svg

This file was deleted.

18 changes: 18 additions & 0 deletions demo/.babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": []
}
3 changes: 3 additions & 0 deletions demo/.storybook/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.sb-show-main.sb-main-centered #storybook-root {
padding: 0;
}
45 changes: 45 additions & 0 deletions demo/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {join, dirname} from 'path';

/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{
name: '@storybook/addon-styling',
options: {
sass: {
implementation: require("sass"),
},
}
},
'@storybook/addon-onboarding',
'@storybook/addon-interactions',

],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
docs: {
autodocs: 'tag',
},
async webpackFinal(config, { configType }) {
config.resolve = config.resolve || {};
config.resolve.alias = {
...(config.resolve.alias || {}),
'react': dirname(require.resolve('react')),
'react-dom': dirname(require.resolve('react-dom')),
};
config.module.rules.push({
test: /\.svg$/,
type: 'javascript/auto',
use: ['@svgr/webpack'],
});

return config;
}
};

export default config;
18 changes: 18 additions & 0 deletions demo/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type { import('@storybook/react').Preview } */
import { Preview } from '@storybook/react';

import './global.css';

const preview: Preview = {
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
Loading

0 comments on commit 9f5459f

Please sign in to comment.