Changeset 2180208
- Timestamp:
- 10/25/2019 04:02:22 PM (6 years ago)
- Location:
- slide/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
slide/trunk/index.js
r2179945 r2180208 20 20 const { useSelect, useDispatch, subscribe, select, dispatch } = data; 21 21 const { TextareaControl, ColorPicker, PanelBody, RangeControl, SelectControl, ToggleControl, Button, FocalPointPicker, ExternalLink, Notice, TextControl, RadioControl } = components; 22 const { MediaUpload, __experimentalGradientPickerControl, InnerBlocks, InspectorControls, RichTextToolbarButton } = blockEditor;22 const { MediaUpload, __experimentalGradientPickerControl, InnerBlocks, InspectorControls, RichTextToolbarButton, ColorPalette } = blockEditor; 23 23 const { addQueryArgs } = url; 24 24 const colorKey = 'presentation-color'; … … 44 44 const horizontalPaddingKey = 'presentation-horizontal-padding'; 45 45 const verticalPaddingKey = 'presentation-vertical-padding'; 46 const colorPaletteKey = 'presentation-color-palette'; 46 47 47 48 const CodeEditor = memo(({ onChange, ...props }) => { … … 412 413 }); 413 414 } 415 }) 416 ), 417 e( 418 PluginDocumentSettingPanel, 419 { 420 name: 'slide-palette', 421 title: __('Color Palette', 'slide'), 422 icon: 'art' 423 }, 424 e(TextareaControl, { 425 label: __('Comma separated list of color values. Please refresh the page to be able to use the palette.', 'slide'), 426 value: meta[colorPaletteKey], 427 onChange: (value) => updateMeta(value, colorPaletteKey) 414 428 }) 415 429 ), … … 583 597 initialOpen: false 584 598 }, 585 e(ColorPicker, { 586 disableAlpha: true, 599 e(ColorPalette, { 587 600 label: __('Color', 'slide'), 588 color: attributes.color,589 onChange Complete: ({ hex: color }) =>601 value: attributes.color, 602 onChange: (color) => 590 603 setAttributes({ color }) 591 604 }), … … 606 619 initialOpen: false 607 620 }, 608 e(ColorPicker, { 609 disableAlpha: true, 621 e(ColorPalette, { 610 622 label: __('Background Color', 'slide'), 611 color: attributes.backgroundColor,612 onChange Complete: ({ hex: backgroundColor }) =>623 value: attributes.backgroundColor, 624 onChange: (backgroundColor) => 613 625 setAttributes({ backgroundColor })