Skip to content

Commit

Permalink
Merge pull request #267 from KevinBatdorf/move-line-settings-up
Browse files Browse the repository at this point in the history
Release 1.25.0
  • Loading branch information
KevinBatdorf committed Nov 13, 2023
2 parents 82e8d35 + ed8e410 commit dc4f9ad
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 46 deletions.
2 changes: 1 addition & 1 deletion code-block-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://code-block-pro.com/?utm_campaign=plugin&utm_source=author-uri
* Requires at least: 6.0
* Requires PHP: 7.0
* Version: 1.24.1
* Version: 1.25.0
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: code-block-pro
Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: kbat82, dcooney
Tags: block, code, syntax, snippet, highlighter, JavaScript, php, js, vs code
Tested up to: 6.4
Stable tag: 1.24.1
Stable tag: 1.25.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -310,10 +310,11 @@ Themes are rendered inside the editor as you type or make changes, so the code b

== Changelog ==

= 1.25.0 - 2023-11-13 =
- Feature: Allow for overriding copy button text and invoke a callback
- Feature: Added new programming fonts, Monaspace (5), Geist, Cozette and Deja Vu
- Feature: Add pluggable sidebar slots to allow others to add functionality
- Tweak: Renamed Themes to Theme and moved it to the top
- Tweak: Reorganized sidebar based on common daily usage
- Legal: Added (open source) license files for all fonts

= 1.24.1 - 2023-10-11 =
Expand Down
86 changes: 43 additions & 43 deletions src/editor/controls/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,49 @@ export const SidebarControls = ({
attributes={attributes}
setAttributes={setAttributes}
/>
<PanelBody
title={__('Line Settings', 'code-block-pro')}
initialOpen={false}>
<div className="code-block-pro-editor">
<BaseControl id="code-block-pro-show-line-numbers">
<CheckboxControl
data-cy="show-line-numbers"
label={__('Line numbers', 'code-block-pro')}
help={__(
'Enable line numbers and set a starting number.',
'code-block-pro',
)}
checked={attributes.lineNumbers}
onChange={(lineNumbers) => {
setAttributes({ lineNumbers });
updateThemeHistory({ lineNumbers });
}}
/>
{attributes.lineNumbers && (
<BaseControl id="code-block-pro-line-number-start">
<TextControl
id="code-block-pro-line-number-start"
spellCheck={false}
autoComplete="off"
label={__('Start from', 'code-block-pro')}
onChange={(startingLineNumber) => {
setAttributes({ startingLineNumber });
}}
value={attributes.startingLineNumber}
/>
</BaseControl>
)}
</BaseControl>
<HighlightingControl
attributes={attributes}
setAttributes={setAttributes}
/>
<BlurControl
attributes={attributes}
setAttributes={setAttributes}
/>
</div>
</PanelBody>
<ThemesPanel
bringAttentionToThemes={bringAttention === 'theme-select'}
attributes={attributes}
Expand Down Expand Up @@ -224,49 +267,6 @@ export const SidebarControls = ({
}}
/>
</PanelBody>
<PanelBody
title={__('Line Settings', 'code-block-pro')}
initialOpen={false}>
<div className="code-block-pro-editor">
<BaseControl id="code-block-pro-show-line-numbers">
<CheckboxControl
data-cy="show-line-numbers"
label={__('Line numbers', 'code-block-pro')}
help={__(
'Enable line numbers and set a starting number.',
'code-block-pro',
)}
checked={attributes.lineNumbers}
onChange={(lineNumbers) => {
setAttributes({ lineNumbers });
updateThemeHistory({ lineNumbers });
}}
/>
{attributes.lineNumbers && (
<BaseControl id="code-block-pro-line-number-start">
<TextControl
id="code-block-pro-line-number-start"
spellCheck={false}
autoComplete="off"
label={__('Start from', 'code-block-pro')}
onChange={(startingLineNumber) => {
setAttributes({ startingLineNumber });
}}
value={attributes.startingLineNumber}
/>
</BaseControl>
)}
</BaseControl>
<HighlightingControl
attributes={attributes}
setAttributes={setAttributes}
/>
<BlurControl
attributes={attributes}
setAttributes={setAttributes}
/>
</div>
</PanelBody>
<SlotFactory
name="CodeBlockPro.Sidebar.Middle"
attributes={attributes}
Expand Down

0 comments on commit dc4f9ad

Please sign in to comment.