Skip to content

Commit fa2b31d

Browse files
authored
Merge pull request #70 from t-hamano/wp6.3
Version 3.3.0 (Release for WP6.3)
2 parents 1e71959 + 84a4304 commit fa2b31d

File tree

278 files changed

+35339
-19372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+35339
-19372
lines changed

.eslintrc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ module.exports = {
22
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
33
parser: '@babel/eslint-parser',
44
globals: {
5-
chbeObj: true,
6-
Blob: true,
7-
FileReader: true,
85
jQuery: true,
96
},
107
rules: {

.github/workflows/run-test-and-deploy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
php-versions: [
16-
'7.3',
1716
'7.4',
1817
'8.0'
1918
]
2019
wp-versions: [
21-
'WordPress#5.9.4',
22-
'WordPress#6.0.3',
23-
'WordPress#6.1',
20+
'WordPress#6.1.3',
21+
'WordPress#6.2.2',
2422
'WordPress'
2523
]
2624
name: PHP ${{ matrix.php-versions }} / ${{ matrix.wp-versions }} Test

.github/workflows/run-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ jobs:
1616
strategy:
1717
matrix:
1818
php-versions: [
19-
'7.3',
2019
'7.4',
2120
'8.0'
2221
]
2322
wp-versions: [
24-
'WordPress#5.9.4',
25-
'WordPress#6.0.3',
26-
'WordPress#6.1',
23+
'WordPress#6.1.3',
24+
'WordPress#6.2.2',
2725
'WordPress'
2826
]
2927
name: PHP ${{ matrix.php-versions }} / ${{ matrix.wp-versions }} Test
@@ -57,3 +55,11 @@ jobs:
5755
5856
- name: Running e2e tests
5957
run: npm run test:e2e
58+
59+
- name: Archive debug artifacts
60+
uses: actions/upload-artifact@v3
61+
if: always()
62+
with:
63+
name: failures-artifacts
64+
path: artifacts
65+
if-no-files-found: ignore

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14
1+
16

.wp-env.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
".",
44
"https://downloads.wordpress.org/plugin/classic-editor.zip"
55
],
6-
"config": {
7-
"WP_DEBUG": true,
8-
"SCRIPT_DEBUG": true
6+
"env": {
7+
"tests": {
8+
"config": {
9+
"WP_DEBUG": true,
10+
"SCRIPT_DEBUG": true
11+
}
12+
}
913
}
1014
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Custom HTML Block Extension
1+
# Custom HTML Block Extension
22

33
[![Tests](https://github.com/t-hamano/custom-html-block-extension/actions/workflows/run-test.yml/badge.svg)](https://github.com/t-hamano/custom-html-block-extension/actions/workflows/run-test.yml)
44
[![Tests and Deploy](https://github.com/t-hamano/custom-html-block-extension/actions/workflows/run-test-and-deploy.yml/badge.svg)](https://github.com/t-hamano/custom-html-block-extension/actions/workflows/run-test-and-deploy.yml)
55

66
![Custom HTML Block Extension](https://raw.githubusercontent.com/t-hamano/custom-html-block-extension/main/assets/images/admin/welcome-guide/slide_1.gif)
77

8-
Custom HTML Block Extension extends "Custom HTML block" to evolve into an advanced code editor.
8+
Custom HTML Block Extension extends Custom HTML block to evolve into the advanced code editor.
99

1010
## Features
1111

@@ -33,7 +33,7 @@ Supports the classic editor, the theme/plugin editor, import/export editor setti
3333

3434
You can use your own favorite fonts in addition to the default fonts.
3535

36-
### STEP1: Place font files
36+
### STEP1: Place font files
3737

3838
Place the font files in **the public directory** of the server where WordPress is installed.
3939
It is recommended to create `fonts` folder directly under the theme and place the fonts there.
41.5 KB
Loading

classes/class-admin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function admin_enqueue_scripts( $hook_suffix ) {
4444
$content = '<h3>' . __( 'Custom HTML Block Extension', 'custom-html-block-extension' ) . '</h3>';
4545
$content .= '<p>';
4646
$content .= sprintf(
47-
/* translators: 1: setting page url */
47+
/* translators: %s is replaced with the setting page url. */
4848
__(
4949
'Custom HTML Block Extension enabled. You can customize the editor in <a href="%s">setting page</a>.',
5050
'custom-html-block-extension'
@@ -113,6 +113,7 @@ public function admin_enqueue_scripts( $hook_suffix ) {
113113
'editorSettings' => Settings::get_editor_settings(),
114114
'editorOptions' => Settings::get_editor_options(),
115115
'options' => Settings::get_options(),
116+
'userRoles' => Settings::get_user_roles(),
116117
'fontFamily' => Settings::get_font_families(),
117118
'dismissWelcomeGuide' => get_option( Settings::OPTION_NAME['dismiss_welcome_guide'] ),
118119
)

classes/class-block-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function enqueue_editor_scripts() {
2626
// Abort the process if permission is disabled.
2727
$options = Settings::get_options();
2828

29-
if ( ! $options['permissionBlockEditor'] ) {
29+
if ( ! $options['permissionBlockEditor'] || ! Settings::is_allowed_user() ) {
3030
return;
3131
}
3232

classes/class-classic-editor.php

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,45 +133,43 @@ public function admin_footer() {
133133
// phpcs:disable Generic.ControlStructures.InlineControlStructure
134134
?>
135135
<div id="chbe-replace-indent-dialog" class="chbe-dialog__inner">
136-
<p class="chbe-dialog__ttl"><?php echo esc_attr_e( 'Change Indentation', 'custom-html-block-extension' ); ?></p>
136+
<h2 class="chbe-dialog__title"><?php echo esc_attr_e( 'Change Indentation', 'custom-html-block-extension' ); ?></h2>
137137
<div class="chbe-dialog__row">
138-
<div class="chbe-dialog__col chbe-dialog__col--setting">
139-
<p class="chbe-dialog__subttl"><?php esc_html_e( 'Current Indent', 'custom-html-block-extension' ); ?></p>
140-
<p>
141-
<strong><?php esc_html_e( 'Indent type', 'custom-html-block-extension' ); ?></strong>
138+
<div class="chbe-dialog__setting">
139+
<h3 class="chbe-dialog__subtitle"><?php esc_html_e( 'Current Indent', 'custom-html-block-extension' ); ?></h3>
140+
<fieldset>
141+
<legend><?php esc_html_e( 'Current indent type', 'custom-html-block-extension' ); ?></legend>
142142
<label>
143143
<?php esc_html_e( 'Space', 'custom-html-block-extension' ); ?>
144-
<input type="radio" name="before_insert_spaces" value="1" <?php if ( $settings['insertSpaces'] ) echo 'checked'; ?>>
144+
<input type="radio" name="before_insert_spaces" value="1" <?php checked( $settings['insertSpaces'] ); ?>>
145145
</label>
146146
<label>
147147
<?php esc_html_e( 'Tab', 'custom-html-block-extension' ); ?>
148-
<input type="radio" name="before_insert_spaces" value="0" <?php if ( ! $settings['insertSpaces'] ) echo 'checked'; ?>>
148+
<input type="radio" name="before_insert_spaces" value="0" <?php checked( ! $settings['insertSpaces'] ); ?>>
149149
</label>
150-
</p>
150+
</fieldset>
151151
<p id="chbe-item-before-tab-size" style="<?php if ( ! $settings['insertSpaces'] ) echo 'display:none;'; ?>">
152-
<strong><?php esc_html_e( 'Indent width', 'custom-html-block-extension' ); ?></strong>
153-
<input type="number" name="before_tab_size" min="1" max="8" value="<?php echo esc_attr( $settings['tabSize'] ); ?>">
152+
<label for="chbe_before_tab_size"><strong><?php esc_html_e( 'Current indent width', 'custom-html-block-extension' ); ?></strong></label>
153+
<input type="number" id="chbe_before_tab_size" name="before_tab_size" min="1" max="8" value="<?php echo esc_attr( $settings['tabSize'] ); ?>">
154154
</p>
155155
</div>
156-
<div class="chbe-dialog__col chbe-dialog__col--arrow">
157-
<span class="dashicons dashicons-arrow-right-alt">
158-
</div>
159-
<div class="chbe-dialog__col chbe-dialog__col--setting">
160-
<p class="chbe-dialog__subttl"><?php esc_html_e( 'New Indent', 'custom-html-block-extension' ); ?></p>
161-
<p>
162-
<strong><?php esc_html_e( 'Indent type', 'custom-html-block-extension' ); ?></strong>
156+
<span class="chbe-dialog__arrow dashicons dashicons-arrow-right-alt"></span>
157+
<div class="chbe-dialog__setting">
158+
<h3 class="chbe-dialog__subtitle"><?php esc_html_e( 'New Indent', 'custom-html-block-extension' ); ?></h3>
159+
<fieldset>
160+
<legend><?php esc_html_e( 'New indent type', 'custom-html-block-extension' ); ?></legend>
163161
<label>
164162
<?php esc_html_e( 'Space', 'custom-html-block-extension' ); ?>
165-
<input type="radio" name="after_insert_spaces" value="1" <?php if ( $settings['insertSpaces'] ) echo 'checked'; ?>>
163+
<input type="radio" name="after_insert_spaces" value="1" <?php checked( $settings['insertSpaces'] ); ?>>
166164
</label>
167165
<label>
168166
<?php esc_html_e( 'Tab', 'custom-html-block-extension' ); ?>
169-
<input type="radio" name="after_insert_spaces" value="0" <?php if ( ! $settings['insertSpaces'] ) echo 'checked'; ?>>
167+
<input type="radio" name="after_insert_spaces" value="0" <?php checked( ! $settings['insertSpaces'] ); ?>>
170168
</label>
171-
</p>
169+
</fieldset>
172170
<p id="chbe-item-after-tab-size" style="<?php if ( ! $settings['insertSpaces'] ) echo 'display:none;'; ?>">
173-
<strong><?php esc_html_e( 'Indent width', 'custom-html-block-extension' ); ?></strong>
174-
<input type="number" name="after_tab_size" min="1" max="8" value="<?php echo esc_attr( $settings['tabSize'] ); ?>">
171+
<label for="chbe_after_tab_size"><strong><?php esc_html_e( 'New indent width', 'custom-html-block-extension' ); ?></strong></label>
172+
<input type="number" id="chbe_after_tab_size" name="after_tab_size" min="1" max="8" value="<?php echo esc_attr( $settings['tabSize'] ); ?>">
175173
</p>
176174
</div>
177175
</div>

0 commit comments

Comments
 (0)