Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【CSS 待ち】大まかな完成 #9

Merged
merged 358 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
358 commits
Select commit Hold shift + click to select a range
933cb42
Add align-items for entry meta
Dec 9, 2024
a9d49f6
Add border for avatar
Dec 9, 2024
501de6d
Move _contents position
Dec 9, 2024
df2638a
Add avater img css
Dec 9, 2024
ec11b11
Fix: typo
Dec 9, 2024
564f41a
Add css for atag
Dec 9, 2024
612deb7
Delete align-items
Dec 10, 2024
b086022
Add span css for post date
Dec 10, 2024
2c5f4ff
Move html potision
Dec 10, 2024
d92e7fb
Move html potision
Dec 10, 2024
5ec0a85
Move html potision
Dec 10, 2024
b38c305
Add Display item
Dec 10, 2024
0b7162a
Add font size for entry meta
Dec 10, 2024
b74bc0b
Fix: Display item
Dec 10, 2024
c2c8b00
Fix: margin ando gap
Dec 10, 2024
6b50817
Delete taxonomiesand info css
Dec 10, 2024
ceca193
Add post margin css
Dec 11, 2024
623ac12
Add button css
Dec 11, 2024
d019a0f
Fix: const and translate
Dec 11, 2024
954e015
Add attributes
Dec 11, 2024
d417112
Move editor css
Dec 11, 2024
a601e32
Add new mark
Dec 11, 2024
2c3c5d3
Add new mark
Dec 11, 2024
bbc85df
Fix: New mark option
Dec 11, 2024
d30596c
Fix:
Dec 11, 2024
c4f9182
Add classname setting
Dec 11, 2024
86a2e54
Add gap combination
Dec 11, 2024
1c1dad3
O
Dec 11, 2024
ebcb0a7
Add thmbnail image setting
Dec 12, 2024
4c09c9a
Add thmbnail image
Dec 12, 2024
843e4d5
Fix: button color
Dec 12, 2024
176fca2
Add margin
Dec 12, 2024
1b4ea90
Fix: margin
Dec 12, 2024
620ec91
Delete Toggle Control
Dec 12, 2024
70834e8
Fix
Dec 12, 2024
d6f59ad
Merge branch 'develop' into feature/pattern-list
Dec 12, 2024
9ca3b0d
Merge pull request #19 from vektor-inc/feature/pattern-list
mtdkei Dec 12, 2024
cba3e76
Revert "パターンリストブロック調整"
mtdkei Dec 12, 2024
eb866d5
Merge pull request #21 from vektor-inc/revert-19-feature/pattern-list
mtdkei Dec 12, 2024
731e05b
Add display_btn_view_text
Dec 12, 2024
e0120be
Merge branch 'develop' into feature/pattern-list
mtdkei Dec 12, 2024
2fa3fd5
Fix: lint
Dec 12, 2024
23dfc68
Add article css
Dec 12, 2024
0e32102
Add article css
Dec 12, 2024
028539a
Add article css
Dec 12, 2024
1bfa364
Add attributes
Dec 12, 2024
cc2fd77
Fix none value
Dec 12, 2024
2022d13
Fix: view button
Dec 12, 2024
7c94cf0
Fix:lint
Dec 12, 2024
0135c1b
Fix: none for image
Dec 12, 2024
91542d2
Fix: display_image
Dec 12, 2024
968f594
Add grid-template-rows
Dec 12, 2024
005396d
Fix: button
Dec 12, 2024
f12340d
Fix: new mark position
Dec 12, 2024
4b4b3c8
Add search internal link
Dec 12, 2024
0d99e45
Improved linking user experience
Dec 12, 2024
8b886c3
Delete unnesessary code
Dec 12, 2024
2652014
Add remove_image_sizes_attributes
Dec 13, 2024
e710829
Add useEffect
Dec 13, 2024
b0b7e9a
Fix: attributes
Dec 13, 2024
71ceffc
Merge pull request #23 from vektor-inc/feature/pattern-display
mtdkei Dec 13, 2024
53b9a9d
Merge branch 'develop' into feature/pattern-list
Dec 13, 2024
f7a2f36
Separate custom block and shortcode setting
Dec 13, 2024
12906e8
Separate custom block and shortcode style setting
Dec 13, 2024
91cef27
Fix: priority
Dec 13, 2024
009ab90
Add default attributes
Dec 13, 2024
f14c957
Add iframe size
Dec 13, 2024
5f8720a
Merge pull request #24 from vektor-inc/fix/iframe-width
mtdkei Dec 13, 2024
459a96a
Merge pull request #22 from vektor-inc/feature/pattern-list
mtdkei Dec 14, 2024
840769b
Add archive page setting
Dec 14, 2024
a01752a
Add some settings
Dec 14, 2024
bf46643
Add colwidth and gap setting
Dec 17, 2024
5f0ac52
Fix: optimization
Dec 17, 2024
f439ea9
Add option setting
Dec 17, 2024
c756e4f
Delete unessecary line
Dec 17, 2024
50fcbf3
Fix: save setting
Dec 17, 2024
a3e7f9a
Fix: generated shortcode
Dec 17, 2024
651b025
Add display_image and thumbnail_size
Dec 17, 2024
db0b788
Add tr setting
Dec 18, 2024
a1564ed
Moved dynamic styles to vkpdc_generate_archive_html
Dec 18, 2024
d11faa6
Fix: Organized PostListEdit const
mtdkei Dec 18, 2024
d875fa5
Add preview
Dec 18, 2024
4d2c111
Fix: selectbox
mtdkei Dec 18, 2024
e44379d
Fix: setting order
Dec 18, 2024
350c21a
Fix: setting menu
Dec 18, 2024
f9f29cd
Fix: label
Dec 18, 2024
affd78c
Add hook setting
Dec 18, 2024
e1797ae
Fix array
Dec 18, 2024
8aae0ed
Fix: vkpdc_get_patterns_archive_shortcode
Dec 18, 2024
378fbbe
Fix: Output shortcode only
Dec 19, 2024
ffccea8
Fix: html
Dec 19, 2024
ed79b1e
Fix: button position
Dec 19, 2024
4f9e4e2
Add case theme lightining#
Dec 19, 2024
3486183
Fix: delete unnessecary html
Dec 19, 2024
e46b959
Merge pull request #25 from vektor-inc/feature/post-list-shortcode-se…
mtdkei Dec 19, 2024
9c3dafc
Fix: attrubutes
mtdkei Dec 19, 2024
2faa24a
Fix: attrubutes
mtdkei Dec 19, 2024
812c502
Update index.js
mtdkei Dec 19, 2024
c018c27
Fix: attrubutes
mtdkei Dec 19, 2024
7be9ced
Fix: attrubutes
mtdkei Dec 19, 2024
a6db979
Fix: attrubutes
mtdkei Dec 19, 2024
2db75c7
Fix: shortcode
Dec 19, 2024
4a65fa8
Fix: const shortcode
Dec 19, 2024
5724cb8
Fix: var
mtdkei Dec 19, 2024
f52a302
Fix: var
mtdkei Dec 19, 2024
a346c12
Add display_paged
Dec 19, 2024
c56be2f
Fix: default setting for display_paged
Dec 20, 2024
c5a4b0a
Fix: pagenation
Dec 20, 2024
a52e930
fix: vkpdc_execute_shortcode_on_hook
Dec 20, 2024
f4c559b
Add parameter
Dec 20, 2024
2096c5c
Add conditional branch for shortcode and archive
Dec 20, 2024
035cf15
Fix: html stractor
Dec 20, 2024
6250b46
Fix: vkpdc_get_patterns_archive_shortcode
Dec 20, 2024
801ae76
Fix: html stractor
Dec 20, 2024
de5aac6
Fix: paging
Dec 20, 2024
5926a3c
Undo code
Dec 23, 2024
868ded9
Add link for archive
Dec 23, 2024
d4971db
Fix: archive pagenation
mtdkei Dec 24, 2024
aa4806b
Undo develop file
mtdkei Dec 24, 2024
ba16192
Add vkpdc_render_pattern_list_callback
Dec 24, 2024
f6fb2c5
Add display_paged
Dec 24, 2024
c5a18de
Fix: display_paged
Dec 24, 2024
f1854a2
Fix: organized function
Dec 24, 2024
4862d29
Merge pull request #27 from vektor-inc/feature/nav
mtdkei Dec 24, 2024
9e9c7af
Fix: archive setting
Dec 24, 2024
b6e9793
Fix: preview
Dec 24, 2024
f2ad5b6
Fix: label
Dec 24, 2024
882f311
Fix: description
Dec 24, 2024
add197f
Delete:
Dec 25, 2024
e07fd4b
Fix: realtime preview
Dec 25, 2024
d477ccc
Fix: nav link
Dec 25, 2024
337e13e
Fix: vkpdc_register_shortcode_on_hook
Dec 25, 2024
2398563
Merge pull request #28 from vektor-inc/fix/delete-shortcode-setting-page
mtdkei Dec 25, 2024
3b98ae0
Adjust indent
mtdkei Dec 25, 2024
57091fd
Add content-archive-setting.php
mtdkei Dec 25, 2024
5431430
Revert "Adjust indent"
Dec 25, 2024
652950e
Add vkpdc_register_shortcode_on_hook for lightning_extend_loop setting
Dec 25, 2024
3abf503
Addif ( === 'lightning_extend_loop' ) {
Dec 25, 2024
c192f0e
Add template_redirect
Dec 25, 2024
a7ba887
Add template_redirect
Dec 25, 2024
af8cc0d
Fix: space
Dec 25, 2024
b2cfefe
Fix: space
Dec 25, 2024
df1c51f
Add classname
Dec 25, 2024
659bc2f
Add pagination classname
Dec 25, 2024
d18c2a0
Add pagination css
Dec 25, 2024
3324bbc
Add classname
Dec 25, 2024
33c6153
Add placeholder-article
Dec 25, 2024
54845f6
Add vkpdc_add_placeholder_articles
Dec 25, 2024
7420cdc
Delete commentout
Dec 25, 2024
427e517
Fix: pagination
Dec 26, 2024
31bd887
Fix: functions name
Dec 26, 2024
0874ba8
Fix: indent and commentout and functions name
Dec 26, 2024
b3391fb
Fix functions name
Dec 26, 2024
94cb0f5
Add vkpdc_reset_hook_name_on_theme_switch
Dec 26, 2024
f96a3e8
Fix: functions order
Dec 26, 2024
dad54ad
Delete error_log
Dec 26, 2024
9f4e5af
Fix functions name
Dec 26, 2024
9491db8
Fix: space to tab
Dec 26, 2024
00e8dda
Add disableLinks
Dec 26, 2024
8c6f182
Add if for vkpdc_adjust_query
Dec 26, 2024
74f14db
Fix: vkpdc_adjust_query
Dec 26, 2024
ce29376
Fix: desabled link
Dec 26, 2024
0dec698
Add vkpdc_enqueue_global_styles
Dec 26, 2024
b25e5a9
Fix: attributes for display_paged
Dec 26, 2024
55ede72
Add Enqueue Global Styles
Dec 26, 2024
b55ed92
Add css
Dec 26, 2024
65ec89d
Add classnema
Dec 26, 2024
ba9a4e9
Add security for hook name
Dec 26, 2024
ed94b60
Delete unnessecary code
Dec 26, 2024
e3ffd12
Fix: attrubutes
mtdkei Dec 26, 2024
2cddf6a
Add hook_name security
Dec 26, 2024
40bd902
Fix: hook_name js
Dec 27, 2024
24911e3
Fix: disableLinks
Dec 27, 2024
0cbb23e
Add classname for vkpdc_render_pattern_list_callback
Dec 27, 2024
9b0f012
Fix: minor correct
Dec 27, 2024
92336c8
Fix: pagination
Dec 27, 2024
b768cfe
Fix: pagination
Dec 27, 2024
663c630
Fix: markdown
mtdkei Jan 6, 2025
e3a99ed
Add iframe-theme-settings.php
Jan 6, 2025
7fad4a1
Add
Jan 6, 2025
d2299ee
Add vkpdc_switch_theme_for_iframe
Jan 6, 2025
cba631a
Add description
Jan 6, 2025
d20dd13
Fix: indent
Jan 6, 2025
93dd984
Delete unnecessary code
Jan 6, 2025
17692b5
Fix: undo code
Jan 6, 2025
9f0deaa
Fix: undo code
Jan 6, 2025
38c321a
Fix: undo code
Jan 6, 2025
8a443c2
Delete: blank
Jan 6, 2025
97c41ba
Delete: error_log
Jan 6, 2025
ef25ae2
Merge pull request #29 from vektor-inc/feature/iframe-theme-switcher
mtdkei Jan 6, 2025
e3c662d
Delete: error_log
Jan 6, 2025
76301f3
Fix: indent
Jan 6, 2025
161fe7d
Fix: indent
Jan 6, 2025
2cd4132
Add custom-fields.php
Jan 8, 2025
77abc2d
Changed require_once position
Jan 8, 2025
20d5315
Add Permalink Settings lonk
Jan 9, 2025
3891dc7
Merge branch 'develop' of https://github.com/vektor-inc/vk-pattern-di…
Jan 9, 2025
b4dd43a
Fix: taxonomy archive
Jan 9, 2025
4e3b50b
Add is_front_page
Jan 9, 2025
a12f927
Fix: navigation
Jan 9, 2025
9c93afd
Delete commentout
Jan 10, 2025
a7ce532
Delete desable settin
Jan 10, 2025
958ac67
Add pointer setting
Jan 10, 2025
ff88bc5
Update style.scss
mtdkei Jan 14, 2025
5c7dd19
Add vkpdc_iframe-outer--archive css
mtdkei Jan 14, 2025
cefa2e9
Undo css
mtdkei Jan 14, 2025
a086b34
Add padding
mtdkei Jan 14, 2025
4950d19
Fix: padding
mtdkei Jan 14, 2025
c45d44a
Add :overflow
mtdkei Jan 14, 2025
ac1ee28
Add: overflow: hidden;
mtdkei Jan 14, 2025
3e14cf5
Update style.scss
mtdkei Jan 14, 2025
0a8be8d
Delete: width
mtdkei Jan 14, 2025
757d33c
Add a folder for Smaveksive.
mtdkei Jan 15, 2025
3e7704c
Add a folder for Smaveksive.
mtdkei Jan 15, 2025
3598660
Delete modules/init.php
mtdkei Jan 15, 2025
7c3e63c
Add functions.php
Jan 15, 2025
1b749dc
Add description for SmaVeksive
mtdkei Jan 15, 2025
e473703
Merge pull request #31 from vektor-inc/feature/for-smaveksive
mtdkei Jan 15, 2025
0180c60
Fix: __()
Jan 15, 2025
13064f0
Merge branch 'develop' of https://github.com/vektor-inc/vk-pattern-di…
Jan 15, 2025
49192ee
Fix: display_paged
Jan 15, 2025
ef9feee
Add remove_action for veu_add_pagetop
Jan 15, 2025
9f575f8
Add max-width
Jan 15, 2025
4639789
fix max-width
Jan 15, 2025
aadfd4e
Delete: unnessecary html
Jan 15, 2025
b3295cc
Add vkpdc_iframe-wrapper vkpdc_iframe-wrapper--archive class for disp…
Jan 15, 2025
39d3957
Fix: font-size
Jan 15, 2025
115d946
Fix: font-size
Jan 16, 2025
07e264e
Fix: post list css
Jan 17, 2025
2a0d523
Fix: iframe width for smaveksive
mtdkei Jan 17, 2025
29dfea5
Add $exclusion
mtdkei Jan 17, 2025
7423e6e
Add excluded_taxonomies
mtdkei Jan 17, 2025
0e7bf7b
Add excluded_taxonomies
mtdkei Jan 17, 2025
aa5f141
Add excluded_taxonomies
mtdkei Jan 17, 2025
a4982ab
Add excluded_taxonomies
mtdkei Jan 17, 2025
00b7d72
Add padding
mtdkei Jan 17, 2025
d66b2ff
Add: $excluded_taxonomies
mtdkei Jan 17, 2025
a9b23ad
Add setting
Jan 20, 2025
6191f70
Fix: changed position
Jan 20, 2025
877f7d7
Fix: $exclusion
mtdkei Jan 21, 2025
14d07c4
Fix excluded_taxonomies
Jan 21, 2025
79477ca
Fix excluded_taxonomies
Jan 21, 2025
0f17975
Fix excluded_taxonomies
Jan 21, 2025
86a9f93
Merge branch 'feature/checked-taxonomies' of https://github.com/vekto…
Jan 21, 2025
b277eae
Fix: Exclude Taxonomies
Jan 21, 2025
5054a1b
Fix: padding
Jan 21, 2025
59224f9
Merge pull request #33 from vektor-inc/feature/checked-taxonomies
mtdkei Jan 21, 2025
36a949b
Fix:
Jan 22, 2025
e3b67b0
Add _taxonomies
Jan 22, 2025
1adbc3e
Add wp_get_theme
Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.git/
.github/
bin/
blocks/src/
dist/
docs/
node_modules/
Expand All @@ -14,6 +15,9 @@ vendor/
.node-version
.phpcs.xml
.phpunit.xml
.prettierignore
.stylelintignore
.stylelintrc.js
.wp-env.json
babel.config.js
composer.json
Expand Down
8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ module.exports = {
root: true,
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
rules: {
'@wordpress/no-unsafe-wp-apis': 'off',
camelcase: 'off',

'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
camelcase: 'off',
'react-hooks/exhaustive-deps': 'off',
'@wordpress/no-unsafe-wp-apis': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/label-has-associated-control': 'off',
},
};
8 changes: 6 additions & 2 deletions .github/workflows/deploy_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
wp-versions: ['6.2', '6.1.1', '5.9.5']
php-versions: ['8.0', '8.1', '8.2']
wp-versions: ['6.5', '6.6', '6.7']

services:
mysql:
Expand Down Expand Up @@ -54,6 +54,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Install Theme
run: bash bin/install-theme.sh
- name: Install several WordPress version by wp-env.override.json
Expand Down Expand Up @@ -96,6 +98,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Make Distribution
run: bash bin/deploy.sh
- name: Deploy to test server
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/php_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
wp-versions: ['6.2', '6.1.1', '5.9.5']
php-versions: ['8.0', '8.1', '8.2']
wp-versions: ['6.5', '6.6', '6.7']
name: PHP Unit test ${{ matrix.php-versions }} / WP ${{ matrix.wp-versions }} Test on ${{ matrix.operating-system }}
services:
mysql:
Expand Down Expand Up @@ -57,6 +57,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Install Theme
run: bash bin/install-theme.sh
- name: Install several WordPress version by wp-env.override.json
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/wp-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
wp-versions: ['6.2', '6.1.1', '5.9.5']
php-versions: ['8.0', '8.1', '8.2']
wp-versions: ['6.5', '6.6', '6.7']

services:
mysql:
Expand Down Expand Up @@ -51,6 +51,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Install Theme
run: bash bin/install-theme.sh
- name: Install several WordPress version by wp-env.override.json
Expand Down Expand Up @@ -86,6 +88,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Make Distribution
run: bash bin/deploy.sh
- name: WordPress Plugin Deploy
Expand Down Expand Up @@ -119,6 +123,8 @@ jobs:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Build
run: npm run build
- name: Make Distribution
run: bash bin/dist.sh
- name: Test ZIP
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
build/
dist/
temp/
vendor/
Expand All @@ -8,3 +7,5 @@ vendor/
/test-results/
/playwright-report/
/playwright/.cache/
**/build/**
.phpunit.result.cache
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.15.1
20.9.0
2 changes: 1 addition & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/tests/phpunit/</exclude-pattern>

<exclude-pattern>/temp/</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
Expand Down
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
# VK Pattern Directory Creator
VK Pattern Directory Creator

https://pdc.vs4.nagoya/ にて開発中

## これはなに?

ブロックパターンディレクトリのサイトを作るためのプラグイン。

ブロックパターンディレクトリのサイトを作るためのプラグイン。
※ https://github.com/vektor-inc/vk-patterns に依存関係のないまったく別で独立したプラグイン

### 想定用途

* ベクトルサーバーで、ベクトルのテーマ用のパターンを提供する
* ベクトルテーマから API で直接アクセスして、ユーザーが管理画面から直接呼び出せるようにする
* ベクトル以外の開発者がパターンディレクトリを作る事が出来る -> 販売するかどうかは未定
- ベクトルサーバーで、ベクトルのテーマ用のパターンを提供する
- ベクトルテーマから API で直接アクセスして、ユーザーが管理画面から直接呼び出せるようにする
- ベクトル以外の開発者がパターンディレクトリを作る事が出来る 販売するかどうかは未定

## なぜ必要?

現状 patterns.vektor-inc.co.jp 複数のテーマ用のパターンを入れているが、余白や色の定義 / 幅処理の方式 などがテーマによって異なるため、テーマ指定の余白サイズが使いづらかったりいろいろ無理がある。
現状 `patterns.vektor-inc.co.jp` は複数のテーマ用のパターンを入れているが、余白や色の定義 / 幅処理の方式などがテーマによって異なるため、テーマ指定の余白サイズが使いづらかったりいろいろ無理がある。
特に SmaVeksive は幅の扱いが全く違うため、SmaVeksive 専用のパターンディレクトリを作らないといけない。

## 仕様

### assets

| ファイル名 | 説明 |
|--------------------------|------------------------------------------------------------------------------------------|
| **`copy-button.js`** | ボタンをクリックして、コードスニペットを簡単にコピー。コピー回数を記録して人気のあるパターンを把握。 |
| **`iframe-responsive.js`** | ページ内のiframeをレスポンシブ対応にするスクリプトです。 |
| **`size-select.js`** | ユーザーが選択したサイズで、iframe内のコンテンツをプレビュー。 |

### modules

| ファイル名 | 説明 |
|-------------------------------|------------------------------------------------------------------------------------------|
| **`blocks.php`** | カスタムブロックを登録し、WordPressブロックエディタ内で使用可能にする。 |
| **`content-archive.php`** | アーカイブページ用のコンテンツテンプレートを提供。 |
| **`content-archive-setting.php`** | アーカイブページ設定用の画面。 |
| **`content-part.php`** | 特定の部分テンプレート(パーツ)を構成し、再利用性を向上させる。クラシックテーマのみ利用可能。 |
| **`content-single.php`** | シングル投稿ページのコンテンツをレンダリング。 |
| **`enquque-scripts.php`** | 必要なCSSやJavaScriptをWordPressに登録・読み込み。 |
| **`iframe-sizes.php`** | iframeのサイズに関する設定・レスポンシブ対応を管理。 |
| **`iframe-view.php`** | iframeの表示ロジックを定義し、ビューを出力するテンプレート。 |
| **`register-post-type.php`** | カスタム投稿タイプ「Block Patterns」の登録ロジックを実装し、独自投稿タイプを作成。 |
| **`register-custom-taxonomies.php`** | カスタム投稿タイプ「Block Patterns」のタクソノミー登録画面を実装し、独自カスタムタクソノミーを作成。 |

また、テーマ「SmaVeksive」用にiframeの幅処理が必要なため、smaveksiveフォルダにまとめています。

### blocks

| ブロック名 | 説明 |
|-----------------------------|---------------------------------------------------------------------------------------|
| **VK Pattern Description** | `vk-pattern-directory-creator/assets/src/js/copy-button.js`でパターンをコピーする際に、パターンの説明を入れたいけどコピーされたくない時は「VK Pattern Description」を使うとコピーされない。 |
| **VK Pattern Display** | 固定ページか投稿か何かにブロックエディターで作ったページを参照してコピーできるブロック。 |
| **VK Pattern List** | アーカイブなどでパターン一覧を作る時に使用。現在は件数、表示順が変更可能。 |

### views

テーマがブロックテーマかクラシックテーマかを見分ける時に使用される。
41 changes: 41 additions & 0 deletions assets/src/js/copy-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const copyButtonOuterAll = document.querySelectorAll(
'.vkpdc_button-outer--copy'
);
// eslint-disable-next-line no-undef
const beforeTextSingle = VKPDCButtonCopy.beforeTextSingle;
// eslint-disable-next-line no-undef
const beforeTextArchive = VKPDCButtonCopy.beforeTextArchive;
// eslint-disable-next-line no-undef
const afterText = VKPDCButtonCopy.afterText;
// eslint-disable-next-line no-undef
const copyAjaxUrl = VKPDCButtonCopy.ajaxUrl;

copyButtonOuterAll.forEach( ( copyButtonOuter ) => {
const post_id = Number( copyButtonOuter.dataset.post );
const copyButton = copyButtonOuter.querySelector( `.vkpdc_button--copy` );

copyButton.onclick = () => {
const req = new XMLHttpRequest(); // eslint-disable-line no-undef
req.open( 'POST', copyAjaxUrl, true );
req.setRequestHeader(
'content-type',
'application/x-www-form-urlencoded;charset=UTF-8'
);
req.send( `action=copy_count&post=${ post_id }` );
let str = copyButton.getAttribute( 'data-clipboard-text' );
str = str.replace( /\\\[/g, '[' );
str = str.replace( /\\\]/g, ']' );
// eslint-disable-next-line no-undef
navigator.clipboard.writeText( str ).then(
// eslint-disable-next-line no-unused-vars
( success ) => {
let html = copyButton.innerHTML;
html = html.replace( beforeTextSingle, afterText );
html = html.replace( beforeTextArchive, afterText );
copyButton.innerHTML = html;
},
// eslint-disable-next-line no-unused-vars, no-undef, no-alert
( error ) => alert( 'テキストのコピーに失敗😫' )
);
};
} );
38 changes: 38 additions & 0 deletions assets/src/js/iframe-responsive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
( ( window, document ) => {
/*-------------------------------------------*/
/* iframeのレスポンシブ対応
/*-------------------------------------------*/
function iframe_responsive() {
Array.prototype.forEach.call(
document.getElementsByTagName( 'iframe' ),
( i ) => {
const iframeUrl = i.getAttribute( 'src' );
if ( ! iframeUrl ) {
return;
}
// iframeのURLの中に youtube か map が存在する位置を検索する
// 見つからなかった場合には -1 が返される
if (
iframeUrl.indexOf( 'youtube' ) >= 0 ||
iframeUrl.indexOf( 'vimeo' ) >= 0 ||
iframeUrl.indexOf( 'maps' ) >= 0
) {
const iframeWidth = i.getAttribute( 'width' );
const iframeHeight = i.getAttribute( 'height' );
const iframeRate = iframeHeight / iframeWidth;
const nowIframeWidth = i.offsetWidth;
const newIframeHeight = nowIframeWidth * iframeRate;
i.style.maxWidth = '100%';
i.style.height = newIframeHeight + 'px';
}
}
);
}

window.addEventListener( 'DOMContentLoaded', iframe_responsive );
let timer = false;
window.addEventListener( 'resize', () => {
if ( timer ) clearTimeout( timer );
timer = setTimeout( iframe_responsive, 200 );
} );
} )( window, document );
42 changes: 42 additions & 0 deletions assets/src/js/size-select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const SelectSizeAll = document.querySelectorAll( '.vkpdc_select--size' );
// eslint-disable-next-line no-undef
const SizeList = vkPatternsSizeSelect.sizeList;
let WindowSize = document.body.clientWidth;
const iframeContainer = document.querySelector( '.vkpdc_iframe-wrapper' );

function updateSizeOptionsAndIframe( selectSizeElement ) {
const sizeOption = selectSizeElement.querySelectorAll( 'option' );
let selectFlag = false;

SizeList.forEach( ( size ) => {
sizeOption.forEach( ( option ) => {
if ( size.value === option.value ) {
if ( parseInt( size.value ) > WindowSize ) {
option.style.display = 'none';
} else {
option.style.display = 'block';
}
}
} );
} );
}

SelectSizeAll.forEach( ( selectSize ) => {
// 初期設定としてオプションとiframeの幅を更新
updateSizeOptionsAndIframe( selectSize );

// セレクトボックス変更時のイベントリスナー
selectSize.onchange = () => {
if ( selectSize.value === '100%' ) {
iframeContainer.style.width = '100%';
} else {
iframeContainer.style.width = (parseInt(selectSize.value) + 2) + 'px';
}
};
});

// ウィンドウリサイズ時のイベントリスナー
window.addEventListener( 'resize', () => {
WindowSize = document.body.clientWidth;
SelectSizeAll.forEach( updateSizeOptionsAndIframe );
} );
Loading
Loading