volto-searchblocks 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 0.4.0 (2026-10-20)
12
+
13
+ ### Bugfix
14
+
15
+ - Show a translated label ("Empty block (placeholder)") for the `empty` block type, the placeholder Volto gives to unfilled cells of container blocks such as the grid, instead of the raw type name. @cekk
16
+
11
17
  ## 0.3.1 (2026-10-07)
12
18
 
13
19
  ### Feature
@@ -26,6 +26,11 @@ msgstr ""
26
26
  msgid "Created"
27
27
  msgstr ""
28
28
 
29
+ #. Default: "Empty block (placeholder)"
30
+ #: components/SearchBlocks/SearchBlocks
31
+ msgid "Empty block (placeholder)"
32
+ msgstr ""
33
+
29
34
  #. Default: "Home"
30
35
  #: components/SearchBlocks/SearchBlocks
31
36
  msgid "Home"
@@ -26,6 +26,11 @@ msgstr ""
26
26
  msgid "Created"
27
27
  msgstr ""
28
28
 
29
+ #. Default: "Empty block (placeholder)"
30
+ #: components/SearchBlocks/SearchBlocks
31
+ msgid "Empty block (placeholder)"
32
+ msgstr ""
33
+
29
34
  #. Default: "Home"
30
35
  #: components/SearchBlocks/SearchBlocks
31
36
  msgid "Home"
@@ -33,6 +33,11 @@ msgstr ""
33
33
  msgid "Created"
34
34
  msgstr ""
35
35
 
36
+ #. Default: "Empty block (placeholder)"
37
+ #: components/SearchBlocks/SearchBlocks
38
+ msgid "Empty block (placeholder)"
39
+ msgstr ""
40
+
36
41
  #. Default: "Home"
37
42
  #: components/SearchBlocks/SearchBlocks
38
43
  msgid "Home"
@@ -27,6 +27,11 @@ msgstr "Scegli un tipo di blocco"
27
27
  msgid "Created"
28
28
  msgstr "Creato"
29
29
 
30
+ #. Default: "Empty block (placeholder)"
31
+ #: components/SearchBlocks/SearchBlocks
32
+ msgid "Empty block (placeholder)"
33
+ msgstr "Blocco vuoto (segnaposto)"
34
+
30
35
  #. Default: "Home"
31
36
  #: components/SearchBlocks/SearchBlocks
32
37
  msgid "Home"
@@ -31,6 +31,11 @@ msgstr ""
31
31
  msgid "Created"
32
32
  msgstr ""
33
33
 
34
+ #. Default: "Empty block (placeholder)"
35
+ #: components/SearchBlocks/SearchBlocks
36
+ msgid "Empty block (placeholder)"
37
+ msgstr ""
38
+
34
39
  #. Default: "Home"
35
40
  #: components/SearchBlocks/SearchBlocks
36
41
  msgid "Home"
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2026-10-07T13:14:45.245Z\n"
4
+ "POT-Creation-Date: 2026-10-20T09:28:08.400Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "Content-Type: text/plain; charset=utf-8\n"
@@ -28,6 +28,11 @@ msgstr ""
28
28
  msgid "Created"
29
29
  msgstr ""
30
30
 
31
+ #. Default: "Empty block (placeholder)"
32
+ #: components/SearchBlocks/SearchBlocks
33
+ msgid "Empty block (placeholder)"
34
+ msgstr ""
35
+
31
36
  #. Default: "Home"
32
37
  #: components/SearchBlocks/SearchBlocks
33
38
  msgid "Home"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volto-searchblocks",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Additional control-panel that allow users to search which contents using a specific block",
5
5
  "main": "src/index.ts",
6
6
  "license": "MIT",
@@ -94,6 +94,10 @@ const messages = defineMessages({
94
94
  id: 'draft',
95
95
  defaultMessage: 'Draft',
96
96
  },
97
+ emptyBlock: {
98
+ id: 'Empty block (placeholder)',
99
+ defaultMessage: 'Empty block (placeholder)',
100
+ },
97
101
  });
98
102
 
99
103
  const SearchBlocks = (props) => {
@@ -125,6 +129,13 @@ const SearchBlocks = (props) => {
125
129
  return <Error error={error} />;
126
130
  }
127
131
 
132
+ // 'empty' is the placeholder @type Volto gives to unfilled container
133
+ // (e.g. grid) cells: it has no blocksConfig entry, so translate it here.
134
+ const getBlockTitle = (type) =>
135
+ type === 'empty'
136
+ ? intl.formatMessage(messages.emptyBlock)
137
+ : config.blocks.blocksConfig[type]?.title || type;
138
+
128
139
  const handleSelect = (key) => {
129
140
  setSelectedBlockType(key);
130
141
  setCurrentPage(0);
@@ -185,10 +196,7 @@ const SearchBlocks = (props) => {
185
196
  value={selectedBlockType || ''}
186
197
  onChange={(id, value) => handleSelect(value)}
187
198
  choices={
188
- block_types?.map((type) => [
189
- type,
190
- config.blocks.blocksConfig[type]?.title || type,
191
- ]) || []
199
+ block_types?.map((type) => [type, getBlockTitle(type)]) || []
192
200
  }
193
201
  wrapped={false}
194
202
  isClearable={false}
@@ -286,9 +294,7 @@ const SearchBlocks = (props) => {
286
294
  {...messages.noResults}
287
295
  values={{ blockType: selectedBlockType }}
288
296
  />{' '}
289
- {config.blocks.blocksConfig[selectedBlockType]?.title ||
290
- selectedBlockType}
291
- .
297
+ {getBlockTitle(selectedBlockType)}.
292
298
  </p>
293
299
  )}
294
300
  </div>