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

Table of Content block #7

Merged
merged 24 commits into from
Dec 29, 2024
1 change: 1 addition & 0 deletions includes/block-library/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function get_blocks() {
'mega-menu',
'styles-switcher',
'styles-switcher-item',
'table-of-contents',
'user-icon',
);
}
Expand Down
2 changes: 1 addition & 1 deletion languages/ja.l10n.php

Large diffs are not rendered by default.

Binary file modified languages/ja.mo
Binary file not shown.
87 changes: 87 additions & 0 deletions languages/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ msgstr "テンプレートパーツを作成するとメガメニューで選択
msgid "Menu"
msgstr "メニュー"

#: build/block-library/table-of-contents/index.php:100
msgid "Mone table of contents"
msgstr "Mone 目次"

#: build/block-library/user-icon/index.php:93
msgid "Mone Settings"
msgstr "Mone設定"
Expand Down Expand Up @@ -551,6 +555,11 @@ msgstr "%s 非表示"
msgid "Table Of Contents"
msgstr "目次"

#: build/block-library/table-of-contents/block.json
msgctxt "block description"
msgid "A table of contents is automatically created by retrieving headings from the content.A preview is displayed in the editor."
msgstr "コンテンツから見出しを取得して目次を自動的に作成します。プレビューはエディターに表示されます。"

#: build/block-editor/index.js:779
#: build/block-editor/index.js:629
msgid "Hide if no table of contents"
Expand Down Expand Up @@ -1037,6 +1046,84 @@ msgstr "Green"
msgid "White"
msgstr "White"

#: build/block-library/table-of-contents/index.js:84
#: build/block-library/table-of-contents/index.js:89
#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:120
msgid "Scroll animation"
msgstr "スクロールアニメーション"

#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:144
msgid "Circle Color"
msgstr "サークル カラー"

#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:145
msgid "Number Color"
msgstr "ナンバー カラー"

#: build/block-library/table-of-contents/index.js:110
#: build/block-library/table-of-contents/index.js:155
msgid "Deactivate text Color"
msgstr "非活性テキストカラー"

#: build/block-library/table-of-contents/index.js:117
#: build/block-library/table-of-contents/index.js:168
msgid "Circle deactivate Color"
msgstr "サークル非活性カラー"

#: build/block-library/table-of-contents/index.js:117
#: build/block-library/table-of-contents/index.js:172
msgid "Number deactivate Color"
msgstr "ナンバー非活性カラー"

#: build/block-library/table-of-contents/index.js:124
#: build/block-library/table-of-contents/index.js:188
msgid "Line Color"
msgstr "ラインカラー"

#: build/block-library/table-of-contents/index.js:143
#: build/block-library/table-of-contents/index.js:161
#: build/block-library/table-of-contents/index.js:214
#: build/block-library/table-of-contents/index.js:207
#: build/block-library/table-of-contents/index.js:233
#: build/block-library/table-of-contents/index.js:301
msgid "Table of Contents Editor Preview H2 Heading"
msgstr "目次エディタプレビュー H2 見出し"

#: build/block-library/table-of-contents/index.js:149
#: build/block-library/table-of-contents/index.js:154
#: build/block-library/table-of-contents/index.js:167
#: build/block-library/table-of-contents/index.js:191
#: build/block-library/table-of-contents/index.js:220
#: build/block-library/table-of-contents/index.js:215
#: build/block-library/table-of-contents/index.js:223
#: build/block-library/table-of-contents/index.js:241
#: build/block-library/table-of-contents/index.js:271
#: build/block-library/table-of-contents/index.js:309
msgid "Table of Contents Editor Preview H3 Heading"
msgstr "目次エディタプレビュー H3 見出し"

#: build/block-library/table-of-contents/index.js:173
#: build/block-library/table-of-contents/index.js:197
#: build/block-library/table-of-contents/index.js:249
#: build/block-library/table-of-contents/index.js:279
msgid "Table of Contents Editor Preview H4 Heading"
msgstr "目次エディタプレビュー H4 見出し"

#: build/block-library/table-of-contents/index.js:179
#: build/block-library/table-of-contents/index.js:203
#: build/block-library/table-of-contents/index.js:257
#: build/block-library/table-of-contents/index.js:287
msgid "Table of Contents Editor Preview H5 Heading"
msgstr "目次エディタプレビュー H5 見出し"

#: build/block-library/table-of-contents/index.js:309
#: build/block-library/table-of-contents/index.js:372
msgid "Table of contents"
msgstr "目次"

#: build/components/index.js:617
#: build/plugins/index.js:163
#: build/components/index.js:1410
Expand Down
2 changes: 1 addition & 1 deletion languages/mone-ja-b3219700b482574310e9f3d466c763fd.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/block-library\/table-of-contents\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"Max height":["\u6700\u5927\u306e\u9ad8\u3055"]}}}
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/block-library\/table-of-contents\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"Scroll animation":["\u30b9\u30af\u30ed\u30fc\u30eb\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3"],"Circle Color":["\u30b5\u30fc\u30af\u30eb \u30ab\u30e9\u30fc"],"Number Color":["\u30ca\u30f3\u30d0\u30fc \u30ab\u30e9\u30fc"],"Deactivate text Color":["\u975e\u6d3b\u6027\u30c6\u30ad\u30b9\u30c8\u30ab\u30e9\u30fc"],"Circle deactivate Color":["\u30b5\u30fc\u30af\u30eb\u975e\u6d3b\u6027\u30ab\u30e9\u30fc"],"Number deactivate Color":["\u30ca\u30f3\u30d0\u30fc\u975e\u6d3b\u6027\u30ab\u30e9\u30fc"],"Line Color":["\u30e9\u30a4\u30f3\u30ab\u30e9\u30fc"],"Table of Contents Editor Preview H2 Heading":["\u76ee\u6b21\u30a8\u30c7\u30a3\u30bf\u30d7\u30ec\u30d3\u30e5\u30fc H2 \u898b\u51fa\u3057"],"Table of Contents Editor Preview H3 Heading":["\u76ee\u6b21\u30a8\u30c7\u30a3\u30bf\u30d7\u30ec\u30d3\u30e5\u30fc H3 \u898b\u51fa\u3057"],"Table of Contents Editor Preview H4 Heading":["\u76ee\u6b21\u30a8\u30c7\u30a3\u30bf\u30d7\u30ec\u30d3\u30e5\u30fc H4 \u898b\u51fa\u3057"],"Table of Contents Editor Preview H5 Heading":["\u76ee\u6b21\u30a8\u30c7\u30a3\u30bf\u30d7\u30ec\u30d3\u30e5\u30fc H5 \u898b\u51fa\u3057"],"Table of contents":["\u76ee\u6b21"],"Max height":["\u6700\u5927\u306e\u9ad8\u3055"]}}}
120 changes: 100 additions & 20 deletions languages/mone.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-12-22T01:31:53+00:00\n"
"POT-Creation-Date: 2024-12-26T12:27:24+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: mone\n"
Expand Down Expand Up @@ -91,6 +91,10 @@ msgstr ""
msgid "Menu"
msgstr ""

#: build/block-library/table-of-contents/index.php:100
msgid "Mone table of contents"
msgstr ""

#: build/block-library/user-icon/index.php:97
msgid "Mone Settings"
msgstr ""
Expand Down Expand Up @@ -600,60 +604,60 @@ msgstr ""

#: build/block-editor/index.js:883
#: build/block-editor/index.js:956
#: build/block-editor/index.js:716
#: build/block-editor/index.js:798
#: build/block-editor/index.js:719
#: build/block-editor/index.js:801
msgid "Position"
msgstr ""

#: build/block-editor/index.js:902
#: build/block-editor/index.js:920
#: build/block-editor/index.js:736
#: build/block-editor/index.js:755
#: build/block-editor/index.js:739
#: build/block-editor/index.js:758
msgid "Type"
msgstr ""

#: build/block-editor/index.js:935
#: build/block-editor/index.js:771
#: build/block-editor/index.js:774
msgid "Default"
msgstr ""

#: build/block-editor/index.js:938
#: build/block-editor/index.js:775
#: build/block-editor/index.js:778
msgid "Sticky"
msgstr ""

#: build/block-editor/index.js:941
#: build/block-editor/index.js:779
#: build/block-editor/index.js:782
msgid "Fixed"
msgstr ""

#: build/block-editor/index.js:958
#: build/block-editor/index.js:801
#: build/block-editor/index.js:804
msgid "Top"
msgstr ""

#: build/block-editor/index.js:981
#: build/block-editor/index.js:832
#: build/block-editor/index.js:835
msgid "Right"
msgstr ""

#: build/block-editor/index.js:1004
#: build/block-editor/index.js:863
#: build/block-editor/index.js:866
msgid "Bottom"
msgstr ""

#: build/block-editor/index.js:1027
#: build/block-editor/index.js:894
#: build/block-editor/index.js:897
msgid "Left"
msgstr ""

#: build/block-editor/index.js:1203
#: build/block-editor/index.js:1080
#: build/block-editor/index.js:1083
msgid "Unlock content only"
msgstr ""

#: build/block-editor/index.js:1203
#: build/block-editor/index.js:1081
#: build/block-editor/index.js:1084
msgid "Lock content only"
msgstr ""

Expand Down Expand Up @@ -1177,11 +1181,87 @@ msgstr ""
msgid "white"
msgstr ""

#: build/block-library/table-of-contents/index.js:51
#: build/block-library/table-of-contents/index.js:58
#: build/block-library/table-of-contents/index.js:30
#: build/block-library/table-of-contents/index.js:38
msgid "Max height"
#: build/block-library/table-of-contents/index.js:84
#: build/block-library/table-of-contents/index.js:89
#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:120
msgid "Scroll animation"
msgstr ""

#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:144
msgid "Circle Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:103
#: build/block-library/table-of-contents/index.js:145
msgid "Number Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:110
#: build/block-library/table-of-contents/index.js:155
msgid "Deactivate text Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:117
#: build/block-library/table-of-contents/index.js:168
msgid "Circle deactivate Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:117
#: build/block-library/table-of-contents/index.js:172
msgid "Number deactivate Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:124
#: build/block-library/table-of-contents/index.js:188
msgid "Line Color"
msgstr ""

#: build/block-library/table-of-contents/index.js:143
#: build/block-library/table-of-contents/index.js:161
#: build/block-library/table-of-contents/index.js:214
#: build/block-library/table-of-contents/index.js:207
#: build/block-library/table-of-contents/index.js:233
#: build/block-library/table-of-contents/index.js:301
msgid "Table of Contents Editor Preview H2 Heading"
msgstr ""

#: build/block-library/table-of-contents/index.js:149
#: build/block-library/table-of-contents/index.js:154
#: build/block-library/table-of-contents/index.js:167
#: build/block-library/table-of-contents/index.js:191
#: build/block-library/table-of-contents/index.js:220
#: build/block-library/table-of-contents/index.js:215
#: build/block-library/table-of-contents/index.js:223
#: build/block-library/table-of-contents/index.js:241
#: build/block-library/table-of-contents/index.js:271
#: build/block-library/table-of-contents/index.js:309
msgid "Table of Contents Editor Preview H3 Heading"
msgstr ""

#: build/block-library/table-of-contents/index.js:173
#: build/block-library/table-of-contents/index.js:197
#: build/block-library/table-of-contents/index.js:249
#: build/block-library/table-of-contents/index.js:279
msgid "Table of Contents Editor Preview H4 Heading"
msgstr ""

#: build/block-library/table-of-contents/index.js:179
#: build/block-library/table-of-contents/index.js:203
#: build/block-library/table-of-contents/index.js:257
#: build/block-library/table-of-contents/index.js:287
msgid "Table of Contents Editor Preview H5 Heading"
msgstr ""

#: build/block-library/table-of-contents/index.js:309
#: build/block-library/table-of-contents/index.js:372
msgid "Table of contents"
msgstr ""

#: build/block-library/table-of-contents/index.js:317
#: build/block-library/table-of-contents/index.js:381
msgid "Table of Contents (dot)"
msgstr ""

#: build/components/index.js:617
Expand Down Expand Up @@ -1495,7 +1575,7 @@ msgstr ""

#: build/block-library/table-of-contents/block.json
msgctxt "block description"
msgid "Table of contents"
msgid "A table of contents is automatically created by retrieving headings from the content.A preview is displayed in the editor."
msgstr ""

#: build/post-featured-image/blocks/group/block.json
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html

= 1.3.0 =

- Added Table of Contents block
- Added heading plane style
- Added Position UI

= 1.2.0 = 2024-12-09

Expand Down
14 changes: 9 additions & 5 deletions src/block-editor/position/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function addInspectorControls( BlockEdit ) {
if (
( style?.position?.type === 'sticky' ||
style?.position?.type === 'fixed' ) &&
style?.position?.top === undefined
style?.position?.top === undefined &&
style?.position?.left === undefined &&
style?.position?.right === undefined &&
style?.position?.bottom === undefined
) {
const newStyle = {
...style,
Expand Down Expand Up @@ -131,10 +134,11 @@ function addInspectorControls( BlockEdit ) {
label: __( 'Sticky', 'mone' ),
value: 'sticky',
},
{
label: __( 'Fixed', 'mone' ),
value: 'fixed',
},
// fixedはtocで調整が必要
// {
// label: __( 'Fixed', 'mone' ),
// value: 'fixed',
// },
] }
/>
</ToolsPanelItem>
Expand Down
6 changes: 6 additions & 0 deletions src/block-hook/group/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@
.wp-block-group.mone_wrap-on-mobile.is-layout-grid {
grid-template-columns: 1fr;
column-gap: 0;

// とても細くした時に横スクロールするのを防ぐ
// https://coliss.com/articles/build-websites/operation/css/minimum-content-size-in-css-grid.html
> * {
min-width: 0;
}
}
}
Loading
Loading