Skip to content

Commit 93e9869

Browse files
authored
Merge pull request #7 from new-data-services/2.0
2.0
2 parents 6a084d5 + fdb89f8 commit 93e9869

30 files changed

Lines changed: 370 additions & 189 deletions

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- statamic:hide -->
22

3-
# Bard Color Picker
3+
# Statamic Bard Text Color
44

55
<!-- /statamic:hide -->
66

@@ -9,10 +9,9 @@
99
## Features
1010

1111
- Set text color in Bard fields
12-
- Customizable layouts
1312
- Predefined color swatches
14-
- Support for HEX, RGB, CMYK and more
1513
- Beautiful and easy to use color panel
14+
- Dark Mode Support
1615

1716
## Installation
1817

@@ -30,16 +29,31 @@ Open the blueprint or fieldset that contains your Bard field, open the settings
3029

3130
## Configuration
3231

33-
If you want to change the layout, components or predefined colors, make sure that the configuration file is published by entering the following command:
32+
If you want to define swatches or disable the color picker, make sure that the configuration file is published by entering the following command:
3433

3534
``` bash
3635
php artisan vendor:publish --tag=bard-color-picker-config
3736
```
3837

39-
This addon uses the [@simonwep/pickr](https://github.com/Simonwep/pickr) package under the hood and supports many configuration options including different layouts.
40-
4138
Have a look at the [configuration file](config/bard-color-picker.php) for details.
4239

40+
## Migrate from 1.x
41+
42+
Instead of the @simonwep/pickr package, this addon uses a native HTML color picker since v2.0. This causes some breaking changes.
43+
44+
- Statamic 5 is required
45+
- Colors are always saved in HEX format
46+
- The [configuration file](config/bard-color-picker.php) has changed completely
47+
48+
After updating from v1.x to v2.0 we recommend to republish the addon configuration, overwrite old settings and define new ones:
49+
50+
``` bash
51+
php artisan vendor:publish --tag=bard-color-picker-config --force
52+
```
53+
54+
Alternatively, you could rename the `recommended` item to `swatches` in your configuration.
55+
56+
4357
## About us
4458

4559
We develop digital solutions for all kinds of disciplines. From the idea and concepts to implementation and operation.
@@ -50,7 +64,6 @@ Visit our website: [new-data-services.de](https://new-data-services.de/)
5064

5165
---
5266

53-
<a href="https://statamic.com/addons/new-data-services/bard-color-picker"><img src="https://img.shields.io/badge/Statamic-3.4+-FF269E?style=for-the-badge"></a>
5467
<a href="https://packagist.org/packages/ndx/statamic-bard-color-picker"><img src="https://img.shields.io/packagist/v/ndx/statamic-bard-color-picker?style=for-the-badge"></a>
5568
<a href="https://packagist.org/packages/ndx/statamic-bard-color-picker"><img src="https://img.shields.io/packagist/dt/ndx/statamic-bard-color-picker?style=for-the-badge"></a>
5669

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"statamic/cms": "^3.4 || ^4.0 || ^5.0"
14+
"statamic/cms": "^5.0"
1515
},
1616
"require-dev": {
1717
"orchestra/testbench": "^9.0",

config/bard-color-picker.php

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,29 @@
44

55
/*
66
|--------------------------------------------------------------------------
7-
| Pickr theme
7+
| Color Swatches
88
|--------------------------------------------------------------------------
99
|
10-
| Set the pickr theme
11-
| https://simonwep.github.io/pickr/
12-
| Supported: "classic", "monolith", "nano"
10+
| Specify an array with predefined colors (swatches).
11+
| The colors should be in HEX format.
1312
|
1413
*/
1514

16-
'theme' => 'nano',
17-
18-
/*
19-
|--------------------------------------------------------------------------
20-
| Main components
21-
|--------------------------------------------------------------------------
22-
*/
23-
24-
'components' => [
25-
'preview' => true, // comparison between old and new color
26-
'opacity' => true, // opacity slider
27-
'hue' => true, // hue slider
28-
],
29-
30-
/*
31-
|--------------------------------------------------------------------------
32-
| Pickr swatches (recommended colors)
33-
|--------------------------------------------------------------------------
34-
*/
35-
36-
'recommended' => [
15+
'swatches' => [
3716
//'#FF269E',
3817
//'#01D7B0',
3918
],
4019

4120
/*
4221
|--------------------------------------------------------------------------
43-
| Input / output options
22+
| Allow any Color
4423
|--------------------------------------------------------------------------
24+
|
25+
| Set this to false to deactivate the color picker.
26+
| (Swatches only mode)
27+
|
4528
*/
4629

47-
'interactions' => [
48-
'hex' => false,
49-
'rgba' => false,
50-
'hsla' => false,
51-
'hsva' => false,
52-
'cmyk' => false,
53-
'input' => false,
54-
],
30+
'allow_any' => true,
5531

5632
];

dist/css/addon.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/classic.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)