Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Color settings #21326

Merged
merged 77 commits into from
May 5, 2020
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
ed821f9
First color picker implementation
lukewalczak Mar 9, 2020
f3eb7c9
Rename context provider and consumer
lukewalczak Mar 9, 2020
073650a
Export BottomSheetConsumer
lukewalczak Mar 9, 2020
ea04b22
Add first animation
lukewalczak Mar 10, 2020
3e11cf2
Add second animation - layout animation
lukewalczak Mar 11, 2020
67c7892
Add SegmentedControls component
lukewalczak Mar 11, 2020
e521c27
Add ColorPalette
lukewalczak Mar 13, 2020
e3e9b13
Create ColorIndicator
lukewalczak Mar 13, 2020
a11712d
Correct styles file
lukewalczak Mar 13, 2020
f20ec02
First main refactor
lukewalczak Mar 16, 2020
e4ce3a5
Make SegmentedControls platform specific
lukewalczak Mar 16, 2020
3f124b0
Extract ColorPicker to separate file, update NavigationHeader
lukewalczak Mar 17, 2020
b682139
Connect Text color settings
lukewalczak Mar 17, 2020
298dc71
Extract ColorSettings to separate file
lukewalczak Mar 18, 2020
3df7536
Support dark mode in SegmentedControls
lukewalczak Mar 18, 2020
d55cbef
Implement CustomSwatch
lukewalczak Mar 19, 2020
badf276
Handle closing bottom sheet from picker
lukewalczak Mar 19, 2020
2436753
Theme tweaks
lukewalczak Mar 19, 2020
ec94046
Correct palette scroll, some styling fixes, correct isSelected condit…
lukewalczak Mar 20, 2020
c37ae2f
Design adjustments
lukewalczak Mar 24, 2020
4726ff3
Animate swatch press
lukewalczak Mar 24, 2020
29c8f8d
Add wrapper for bottom sheet children
lukewalczak Mar 24, 2020
88478fd
Correct animation, bottom sheet, make scrollable area taller
lukewalczak Mar 25, 2020
6933353
Color hex text next to swatch
lukewalczak Mar 25, 2020
8ede0b5
Correct segmented controls
lukewalczak Mar 25, 2020
e4c8757
Animate segemented controls
lukewalczak Mar 26, 2020
f0f8dd5
Remove hex next to swatch, small improvements
lukewalczak Mar 26, 2020
b571fd0
Support hex color copying, change animation duration, fix scrollview
lukewalczak Mar 27, 2020
6581e6e
Adjustments for the largest font sizes
lukewalczak Mar 30, 2020
fbb2874
Unblock maxHeight for bottom sheet with color picker
lukewalczak Mar 30, 2020
ad5d6a7
Correct impementation to correct transition
lukewalczak Mar 31, 2020
5c7692e
Support android hardware back button in subsheet navigation
lukewalczak Apr 1, 2020
eb39721
Remove selecting swatch
lukewalczak Apr 1, 2020
f003b34
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 1, 2020
9e17587
Correct scrolling, border width issue
lukewalczak Apr 2, 2020
8eaccfa
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 2, 2020
3ded391
Fix lint issues
lukewalczak Apr 2, 2020
1922e9d
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 2, 2020
c4757a5
Add new lib to test setup
lukewalczak Apr 2, 2020
a065d33
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 2, 2020
0f019e6
Colors and outline refactor, creating gradient hoc
lukewalczak Apr 3, 2020
7040712
Navigation refactor, segemented controls refactor
lukewalczak Apr 6, 2020
8eaf90a
ColorPalette fix, correct swatches border color
lukewalczak Apr 8, 2020
c127ea1
Move onReplaceSubsheet function to BottomSheet
lukewalczak Apr 14, 2020
28fdfac
Revert UnsupportedFooterControl
lukewalczak Apr 14, 2020
4e682f2
First refactor part
lukewalczak Apr 16, 2020
1c7b7be
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 16, 2020
15082b9
Small cleanup after merging
lukewalczak Apr 16, 2020
ffd5b07
Set colors workaround
lukewalczak Apr 16, 2020
de340b3
Correct if-else in setColor
lukewalczak Apr 16, 2020
56b07bc
Refactor footer buttons
lukewalczak Apr 17, 2020
142b0ad
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 17, 2020
2922555
move color settings to color hook
dratwas Apr 17, 2020
0ca7159
remove separator from last control
dratwas Apr 17, 2020
0311932
Correct animation on Android, remove default color, render text when …
lukewalczak Apr 20, 2020
ec16422
Disable flag __experimentalColor in native block which are not suppor…
lukewalczak Apr 20, 2020
5d6d97e
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 20, 2020
f33310d
Remove hoc related to setting gradient
lukewalczak Apr 20, 2020
a80f03a
Code clean up
lukewalczak Apr 21, 2020
623163c
Make supporting colors dependent on platform
lukewalczak Apr 21, 2020
bfe38fb
Revert changes from button index
lukewalczak Apr 21, 2020
836ca75
Use styles button destructuring
lukewalczak Apr 21, 2020
31fcfec
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak Apr 22, 2020
0c8c886
Another code clean up
lukewalczak Apr 22, 2020
6ab1081
Refactor button styles
lukewalczak Apr 22, 2020
b4f3cca
Documented bottom sheet context content
lukewalczak Apr 22, 2020
d04348f
Another code clean up
lukewalczak Apr 22, 2020
67b0134
Remove redundant provider export
lukewalczak Apr 23, 2020
84e0331
Refactor color palette
lukewalczak Apr 23, 2020
7cd1875
Refactor: use usePreferredColorSchemeStyle, move subsheets and segmen…
lukewalczak Apr 27, 2020
e56bb60
Move default BottomSheet context to separate file
lukewalczak Apr 27, 2020
9e8ba7f
Move function isGradient to utils
lukewalczak Apr 27, 2020
03b69f9
Refactor colorsUtils, unify colors label
lukewalczak May 4, 2020
3a674b4
Merge branch 'master' into rnmobile/settings-color-picker
lukewalczak May 4, 2020
fa36fc3
Correct using colors in reverted Button block
lukewalczak May 4, 2020
4c49765
Correct button colors
lukewalczak May 4, 2020
92e2c6c
Remove redundant check
lukewalczak May 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor colorsUtils, unify colors label
lukewalczak committed May 4, 2020
commit 03b69f935350575c5742d9d93bd716dccd23dda8
Original file line number Diff line number Diff line change
@@ -35,15 +35,15 @@ function BottomSheetSettings( {
<BottomSheetConsumer>
{ ( { currentScreen, extraProps, ...bottomSheetProps } ) => {
switch ( currentScreen ) {
case colorsUtils.subsheets[ 1 ]:
case colorsUtils.subsheets.color:
return (
<ColorSettings
defaultSettings={ defaultSettings }
{ ...bottomSheetProps }
{ ...extraProps }
/>
);
case colorsUtils.subsheets[ 0 ]:
case colorsUtils.subsheets.settings:
default:
return <InspectorControls.Slot />;
}
10 changes: 2 additions & 8 deletions packages/block-editor/src/hooks/color.js
Original file line number Diff line number Diff line change
@@ -250,10 +250,7 @@ export function ColorEdit( props ) {
clientId={ props.clientId }
settings={ [
{
label:
Platform.OS === 'web'
? __( 'Text Color' )
: __( 'Text' ),
label: __( 'Text Color' ),
onColorChange: onChangeColor( 'text' ),
colorValue: getColorObjectByAttributeValues(
colors,
@@ -262,10 +259,7 @@ export function ColorEdit( props ) {
).color,
},
{
label:
Platform.OS === 'web'
? __( 'Background Color' )
: __( 'Background' ),
label: __( 'Background Color' ),
onColorChange: onChangeColor( 'background' ),
colorValue: getColorObjectByAttributeValues(
colors,
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export const colorsUtils = {
subsheets: [ 'Settings', 'Color' ],
subsheets: {
settings: 'Settings',
color: 'Color',
},
segments: [ 'Solid', 'Gradient' ],
isGradient: ( color ) => color?.includes( 'linear-gradient' ),
};