Skip to content

Commit 1e5f765

Browse files
committed
Merge branch 'main' into unzela/rename_enum
2 parents 5d86186 + ed866b6 commit 1e5f765

File tree

5 files changed

+35
-41
lines changed

5 files changed

+35
-41
lines changed

src/pages/guides/develop/how_to/use_color.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ Please note that Adobe Express uses the terms **make** and **create** to disting
133133

134134
Adobe Express includes a native Color Picker, with special features such as Recommended Swatches, Eyedropper, Themes, Library and Brand colors. The Color Picker is available also to add-ons, you can invoke it using the [`addOnUISdk.app.showColorPicker()`](../../../references/addonsdk/addonsdk-app.md#showcolorpicker) method.
135135

136-
<InlineAlert slots="text" variant="warning"/>
137-
138-
**IMPORTANT:** This is currently **_experimental only_** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../references/manifest/index.md#requirements) section of the `manifest.json`.
139-
140136
#### Benefits
141137

142138
- It simplifies the process of selecting a color, bypassing the Browser's color picker.
@@ -167,7 +163,7 @@ The `showColorPicker()` method requires an HTML element as its anchor point. Her
167163

168164
```js
169165
import addOnUISdk, {
170-
ColorPickerEvents,
166+
ColorPickerEvent,
171167
ColorPickerPlacement,
172168
} from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
173169

@@ -192,14 +188,14 @@ addOnUISdk.ready.then(async () => {
192188
});
193189

194190
// Add a listener for the colorpicker-color-change event
195-
colorPickerButton.addEventListener(ColorPickerEvents.colorChange, (event) => {
191+
colorPickerButton.addEventListener(ColorPickerEvent.colorChange, (event) => {
196192
// Get the color from the event
197193
console.log(event.detail.color);
198194
// e.g., "#F0EDD8FF" in HEX (RRGGBBAA) format
199195
});
200196

201197
// Add a listener for the colorpicker-close event
202-
colorPickerButton.addEventListener(ColorPickerEvents.close, (event) => {
198+
colorPickerButton.addEventListener(ColorPickerEvent.close, (event) => {
203199
console.log(event.type); // "colorpicker-close"
204200
});
205201
});
@@ -266,7 +262,7 @@ addOnUISdk.ready.then(async () => {
266262
});
267263
});
268264

269-
colorDisplay.addEventListener(ColorPickerEvents.colorChange, (event) => {
265+
colorDisplay.addEventListener(ColorPickerEvent.colorChange, (event) => {
270266
// Update the color swatch display in the UI
271267
colorDisplay.style.backgroundColor = event.detail.color;
272268
});

src/pages/references/addonsdk/addonsdk-app.md

+8-16
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ See the use case implementations for an example of the [custom modal dialog](../
258258

259259
Shows the Adobe Express color picker based on specific options passed in.
260260

261-
<InlineAlert slots="text" variant="warning"/>
262-
263-
**IMPORTANT:** This is currently **_experimental only_** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../manifest/index.md#requirements) section of the `manifest.json`.
264-
265261
#### Signature
266262

267263
`showColorPicker(anchorElement: HTMLElement, options?: ColorPickerOptions): Promise<void>;`
@@ -275,13 +271,13 @@ Shows the Adobe Express color picker based on specific options passed in.
275271

276272
##### `ColorPickerOptions`
277273

278-
| Name | Type | Description |
279-
| ------------------------ | -----------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
280-
| `title?` | `string` | Label header/title for the color picker. Default value: `""` |
281-
| `initialColor?` | `number` | Default/starting color when you open the color picker for the first time on a `anchorElement`. When you have already changed the color with this picker, then the next time you open the picker, the last selected color will be the starting color. Default: `0xFFFFFF` (white) |
282-
| `placement?` | `object` [ColorPickerPlacement](./addonsdk-constants.md#constants) | Placement of the popover with respect to the anchor element (default: `"left"`). |
283-
| `eyedropperHidesPicker?` | `boolean` | Closes the color picker popover while using the EyeDropper. After the color is selected via the EyeDropper, the color picker popup opens again. Default: `false`. |
284-
| `disableAlphaChannel?` | `boolean` | Disables the transparency slider in the "custom" section of the color picker. Default: `false`. |
274+
| Name | Type | Description |
275+
| ------------------------ | -----------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
276+
| `title?` | `string` | Label header/title for the color picker. Default value: `""` |
277+
| `initialColor?` | `number` or `string` | Default/starting color when you open the color picker for the first time on a `anchorElement`, in the format `0xRRGGBB[AA]` or `"#RRGGBB[AA]"`. When you have already changed the color with this picker, then the next time you open the picker, the last selected color will be the starting color. Default: `0xFFFFFF` (white) |
278+
| `placement?` | `object` [ColorPickerPlacement](./addonsdk-constants.md#constants) | Placement of the popover with respect to the anchor element (default: `"left"`). |
279+
| `eyedropperHidesPicker?` | `boolean` | Closes the color picker popover while using the EyeDropper. After the color is selected via the EyeDropper, the color picker popup opens again. Default: `false`. |
280+
| `disableAlphaChannel?` | `boolean` | Disables the transparency slider in the "custom" section of the color picker. Default: `false`. |
285281

286282
#### Return Value
287283

@@ -301,7 +297,7 @@ colorPickerButton.addEventListener("click", () => {
301297
});
302298
});
303299

304-
colorPickerButton.addEventListener(ColorPickerEvents.colorChange, (event) => {
300+
colorPickerButton.addEventListener(ColorPickerEvent.colorChange, (event) => {
305301
console.log("Color change event received!", event.detail.color;);
306302
});
307303
```
@@ -310,10 +306,6 @@ colorPickerButton.addEventListener(ColorPickerEvents.colorChange, (event) => {
310306

311307
Hides the Adobe Express color picker.
312308

313-
<InlineAlert slots="text" variant="warning"/>
314-
315-
**IMPORTANT:** This is currently **_experimental only_** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../manifest/index.md#requirements) section of the `manifest.json`.
316-
317309
#### Signature
318310

319311
`hideColorPicker(): Promise<void>;`

src/pages/references/addonsdk/addonsdk-constants.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A set of constants used throughout the add-on SDK. These constants are equal to
4040
</td>
4141
</tr>
4242
<tr class="spectrum-Table-row">
43-
<td class="spectrum-Table-cell"><p><pre>ColorPickerEvents</pre></p></td>
43+
<td class="spectrum-Table-cell"><p><pre>ColorPickerEvent</pre></p></td>
4444
<td class="spectrum-Table-cell"><p><pre>string</pre></p></td>
4545
<td style="vertical-align: bottom;">
4646
<p>Custom events dispatched by the Color Picker.</p>

src/pages/references/changelog.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ contributors:
2222

2323
# Changelog
2424

25-
## 2025-04-30
25+
## 2025-05-05
2626

2727
### Updated
2828

29-
- Renamed enum TextType to [`TextLayout`](./document-sandbox/document-apis/enumerations/TextLayout.md) in the Text APIs.
29+
- There are a few notable changes regarding the [Color Picker APIs](../references/addonsdk/addonsdk-app.md#showcolorpicker), which have now moved to stable:
30+
- The `initialColor` parameter now accepts a string in `"#RRGGBB[AA]"` format, in addition to the previous HEX number `0xRRGGBB[AA]`—both with optional alpha channel.
31+
- We fixed the return value of the `ColorPickerEvent.colorChange` event, which now correctly handles the color with or without the alpha channel, depending on the value of the `disableAlphaChannel` parameter.
32+
- **Breaking change**: the `ColorPickerEvents` enum has been renamed to `ColorPickerEvent` (singular).
33+
- Renamed the TextType enumerable to [`TextLayout`](./document-sandbox/document-apis/enumerations/TextLayout.md) in the Text APIs.
3034

3135
## 2025-04-22
3236

src/pages/references/ui-components/color-picker.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ The Adobe Express native Color Picker offers several unique features, compared t
3232

3333
![Color Picker](./images/colorpicker_brand.png)
3434

35-
Using the Adobe ExpressColor Picker in your add-on instead of building your own version provides a few benefits:
35+
Using the Adobe Express Color Picker in your add-on instead of building your own version provides a few benefits:
3636

3737
- It simplifies the process of selecting a color, bypassing the Browser's color picker.
3838
- It provides a consistent experience to users, as the color picker is integrated with Adobe Express.
3939
- It's in sync with any swatches or Brand colors defined in the application.
4040
- It will evolve with Adobe Express, adding new features over time.
4141

42+
Please note that the Color Picker is going to be available to add-ons in Adobe Express on desktop environment only.
43+
4244
## API
4345

4446
The [`addOnUISdk.app`](../addonsdk/addonsdk-app.md) has two dedicated method:
@@ -137,18 +139,18 @@ addOnUISdk.app.showColorPicker(element, {
137139

138140
```js
139141
import addOnUISdk, {
140-
ColorPickerEvents,
142+
ColorPickerEvent,
141143
} from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
142144

143145
addOnUISdk.ready.then(async () => {
144146
const colorPickerButton = document.getElementById("colorPicker");
145147

146148
// Add event listeners for color picker events
147-
colorPickerButton.addEventListener(ColorPickerEvents.colorChange, (event) => {
149+
colorPickerButton.addEventListener(ColorPickerEvent.colorChange, (event) => {
148150
console.log("Color picker color change event from add-on:", event.detail);
149151
});
150152

151-
colorPickerButton.addEventListener(ColorPickerEvents.close, (event) => {
153+
colorPickerButton.addEventListener(ColorPickerEvent.close, (event) => {
152154
console.log("Color picker closed from add-on:", event.detail);
153155
});
154156

@@ -197,30 +199,30 @@ The color picker can be positioned relative to the anchor element using the `pla
197199

198200
**Invalid anchor element: must be an instance of `HTMLElement`.**
199201

200-
- **Origin:** Parameter `anchorElement`
201-
- **Fix:** the anchorElement should be a valid `HTMLElement`
202+
- **Origin:** Parameter `anchorElement`.
203+
- **Fix:** the anchorElement should be a valid `HTMLElement`.
202204

203205
**Invalid title: must be a string.**
204206

205-
- **Origin:** Property `title` in the `ColorPickerOptions`
206-
- **Fix:** the `title` should be a valid string
207+
- **Origin:** Property `title` in the `ColorPickerOptions`.
208+
- **Fix:** the `title` should be a valid string.
207209

208-
**Invalid initial color: must be a HEX number in `0xRRGGBB` format.**
210+
**Invalid initialColor: must be either a number in `0xRRGGBB[AA]` format or a string in `"#RRGGBB[AA]"` format.**
209211

210-
- **Origin:** Property `initialColor` in the `ColorPickerOptions`
211-
- **Fix:** the `initialColor` should be a valid number in 0xRRGGBB format.
212+
- **Origin:** Property `initialColor` in the `ColorPickerOptions`.
213+
- **Fix:** the `initialColor` should be a valid number in `0xRRGGBB[AA]` format or a valid string in `"#RRGGBB[AA]"` format.
212214

213215
**Invalid placement value: must be one of the valid `ColorPickerPlacement` values.**
214216

215-
- **Origin:** Property `placement` in the `ColorPickerOptions`
217+
- **Origin:** Property `placement` in the `ColorPickerOptions`.
216218
- **Fix:** the `placement` should be a valid string from the `ColorPickerPlacement` enum.
217219

218220
**Invalid `eyedropperHidesPicker`: must be a boolean value.**
219221

220-
- **Origin:** Property `eyedropperHidesPicker` in the `ColorPickerOptions`
222+
- **Origin:** Property `eyedropperHidesPicker` in the `ColorPickerOptions`.
221223
- **Fix:** the `eyedropperHidesPicker` must be a boolean value.
222224

223225
**Invalid `disableAlphaChannel`: must be a boolean value.**
224226

225-
- **Origin:** Property `disableAlphaChannel` in the `ColorPickerOptions`
227+
- **Origin:** Property `disableAlphaChannel` in the `ColorPickerOptions`.
226228
- **Fix:** the `disableAlphaChannel` must be a boolean value.

0 commit comments

Comments
 (0)