GIGADOC-380: Add ColorPicker#2709
Conversation
a300a72 to
16a2cc7
Compare
|
Theme Builder app deployed! https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-2709/ |
16a2cc7 to
6572433
Compare
6572433 to
4221fab
Compare
de87d13 to
c980fca
Compare
ce0d5ed to
c44157d
Compare
c44157d to
782630c
Compare
|
782630c to
1185882
Compare
shuga2704
left a comment
There was a problem hiding this comment.
По мелочи оставил комментарии, а так очень хорошая большая работа 👍
There was a problem hiding this comment.
А доки в plasma-giga-docs не будет для этого компонента?
There was a problem hiding this comment.
Заведу, как только будет готов сам компонент с учетом правок
| value: number; | ||
| }) => React.ReactElement; | ||
| removeGradientStopSlot?: (props: { onRemove: () => void }) => React.ReactElement; | ||
| }; |
There was a problem hiding this comment.
Кажется нужен extends от HTMLDivElement
There was a problem hiding this comment.
И тогда кстати можно будет избавиться от className, style, width, height.
There was a problem hiding this comment.
А, ну еще заомиттить onChange из HTMLDivElement, чтобы оно не смержилось с нашим пропсом
There was a problem hiding this comment.
Низя. Тк во-первых потянется вериница dom-пропов, которые нам не нужны
Во-вторых поломается реф на forwarderRef
There was a problem hiding this comment.
Низя. Тк во-первых потянется вериница dom-пропов, которые нам не нужны
принял, ок
Во-вторых поломается реф на forwarderRef
А почему он бы сломался? Ведь он у тебя тоже от HTMLDivElement
There was a problem hiding this comment.
Ломается именно на уровне фабрики компонента, которая у вас вызывается, видимо из-за несогласованности типов или просто передаче целой кучи "мусорных" пропов из HtmlAttributes, которые вне не нужны
There was a problem hiding this comment.
Так я слегка запутался.
- Я все равно не понял почему сломается типизация рефки, если типы заэкстендить к примеру от
React.HTMLAttributes<HTMLDivElement>. Рефка прекрасно будет работать также и без экстенда т.к. ее тип задается не в пропсах, а вforwardRef<HTMLDivElement, ColorPickerProps>.
Хотя мб я не так тебя понял изначально, раскрой мысль плз
- Вижу ты все таки добавил строку
} & HTMLAttributesWithoutOnChange<HTMLElement>;, хотя изначально все эти пропсы были не нужны. Столкнулся с какой-то проблемой?
There was a problem hiding this comment.
А наш готовый Portal не сможешь переиспользовать?
There was a problem hiding this comment.
А кинь как использовать и я посмотрю
There was a problem hiding this comment.
собсна вот он packages/plasma-new-hope/src/components/Portal/index.ts, чекни если подойдет то вообще супер
| return () => window.removeEventListener('mouseup', handleUp); | ||
| }, []); | ||
|
|
||
| const handleColor = useCallback( |
There was a problem hiding this comment.
точно нужен useCallback?
There was a problem hiding this comment.
Да, мы не должны менять ссылку на функцию при изменении внешних факторов. React-way(
There was a problem hiding this comment.
А я не вижу дальше нигде иной мемоизации, чтобы делать этот колбэк тоже мемным. Тогда зачем?
There was a problem hiding this comment.
Убрал useCallback. dragPos менялся при каждом движении, и функция всё равно пересоздавалась.
| console.log({ | ||
| selectedColor, | ||
| colors, | ||
| }); |
There was a problem hiding this comment.
не забыть удалить в конце
There was a problem hiding this comment.
Сделаю сейчас же
| import { Opacity } from './Opacity'; | ||
| import { Swatches } from './Swatches'; | ||
|
|
||
| export interface PickerProps { |
There was a problem hiding this comment.
может лучше напикать все эти свойства из ColorPickerProps?
1185882 to
ef92a4c
Compare
|
Important Review skippedToo many files! This PR contains 297 files, which is 147 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (297)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |


Core
ColorPicker
What/why changed
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @salutejs/plasma-asdk@0.378.0-canary.2709.26571222811.0 npm install @salutejs/plasma-b2c@1.620.0-canary.2709.26571222811.0 npm install @salutejs/plasma-core@1.228.0-canary.2709.26571222811.0 npm install @salutejs/plasma-giga@0.347.0-canary.2709.26571222811.0 npm install @salutejs/plasma-homeds@0.347.0-canary.2709.26571222811.0 npm install @salutejs/plasma-hope@1.374.0-canary.2709.26571222811.0 npm install @salutejs/plasma-icons@1.239.0-canary.2709.26571222811.0 npm install @salutejs/plasma-new-hope@0.364.0-canary.2709.26571222811.0 npm install @salutejs/plasma-tokens-b2b@1.56.0-canary.2709.26571222811.0 npm install @salutejs/plasma-tokens-b2c@0.67.0-canary.2709.26571222811.0 npm install @salutejs/plasma-tokens-web@1.71.0-canary.2709.26571222811.0 npm install @salutejs/plasma-tokens@1.140.0-canary.2709.26571222811.0 npm install @salutejs/plasma-typo@0.44.0-canary.2709.26571222811.0 npm install @salutejs/plasma-ui@1.350.0-canary.2709.26571222811.0 npm install @salutejs/plasma-web@1.622.0-canary.2709.26571222811.0 npm install @salutejs/sdds-bizcom@0.352.0-canary.2709.26571222811.0 npm install @salutejs/sdds-cs@0.356.0-canary.2709.26571222811.0 npm install @salutejs/sdds-dfa@0.350.0-canary.2709.26571222811.0 npm install @salutejs/sdds-finai@0.343.0-canary.2709.26571222811.0 npm install @salutejs/sdds-insol@0.347.0-canary.2709.26571222811.0 npm install @salutejs/sdds-netology@0.351.0-canary.2709.26571222811.0 npm install @salutejs/sdds-os@0.22.0-canary.2709.26571222811.0 npm install @salutejs/sdds-platform-ai@0.351.0-canary.2709.26571222811.0 npm install @salutejs/sdds-sbcom@0.352.0-canary.2709.26571222811.0 npm install @salutejs/sdds-scan@0.350.0-canary.2709.26571222811.0 npm install @salutejs/sdds-serv@0.351.0-canary.2709.26571222811.0 npm install @salutejs/core-themes@0.31.0-canary.2709.26571222811.0 npm install @salutejs/plasma-themes@0.52.0-canary.2709.26571222811.0 npm install @salutejs/sdds-themes@0.67.0-canary.2709.26571222811.0 npm install @salutejs/sdds-api-tests@0.9.0-canary.2709.26571222811.0 npm install @salutejs/plasma-cy-utils@0.158.0-canary.2709.26571222811.0 npm install @salutejs/plasma-sb-utils@0.228.0-canary.2709.26571222811.0 npm install @salutejs/plasma-tokens-utils@0.52.0-canary.2709.26571222811.0 # or yarn add @salutejs/plasma-asdk@0.378.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-b2c@1.620.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-core@1.228.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-giga@0.347.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-homeds@0.347.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-hope@1.374.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-icons@1.239.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-new-hope@0.364.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-tokens-b2b@1.56.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-tokens-b2c@0.67.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-tokens-web@1.71.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-tokens@1.140.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-typo@0.44.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-ui@1.350.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-web@1.622.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-bizcom@0.352.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-cs@0.356.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-dfa@0.350.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-finai@0.343.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-insol@0.347.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-netology@0.351.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-os@0.22.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-platform-ai@0.351.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-sbcom@0.352.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-scan@0.350.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-serv@0.351.0-canary.2709.26571222811.0 yarn add @salutejs/core-themes@0.31.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-themes@0.52.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-themes@0.67.0-canary.2709.26571222811.0 yarn add @salutejs/sdds-api-tests@0.9.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-cy-utils@0.158.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-sb-utils@0.228.0-canary.2709.26571222811.0 yarn add @salutejs/plasma-tokens-utils@0.52.0-canary.2709.26571222811.0