@pienter/ui 0.19.0 → 0.20.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
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.20.0 - 2026-09-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `BlockEditor` takes `hint`, `emptyText` and `addLabel(typeLabel)`, the
|
|
10
|
+
three visible strings it used to hard-code in English: the reorder hint
|
|
11
|
+
above the list, the edit-mode empty message under the `empty` slot, and the
|
|
12
|
+
add-button label built from each block type's `label`. The English defaults
|
|
13
|
+
are unchanged, so a Dutch consumer can pass `Tekst toevoegen` and a Dutch
|
|
14
|
+
hint without CSS overrides or replacing the add row. The aria-only labels
|
|
15
|
+
and announcements are still English.
|
|
16
|
+
|
|
5
17
|
## 0.19.0 - 2026-09-16
|
|
6
18
|
|
|
7
19
|
### Added
|
|
@@ -24,6 +24,12 @@ const props = withDefaults(
|
|
|
24
24
|
/** Heading level of each block title: `3` sits under a level-2 `Panel` title. */
|
|
25
25
|
level?: 2 | 3 | 4 | 5 | 6;
|
|
26
26
|
blockLabel?: (block: T, index: number) => string;
|
|
27
|
+
/** Label of each add button, given the block type's `label`. */
|
|
28
|
+
addLabel?: (typeLabel: string) => string;
|
|
29
|
+
/** Reorder hint shown above the list in edit mode. */
|
|
30
|
+
hint?: string;
|
|
31
|
+
/** Empty-list message in edit mode; the `empty` slot replaces it entirely. */
|
|
32
|
+
emptyText?: string;
|
|
27
33
|
}>(),
|
|
28
34
|
{
|
|
29
35
|
disabled: false,
|
|
@@ -32,6 +38,9 @@ const props = withDefaults(
|
|
|
32
38
|
label: 'Content blocks',
|
|
33
39
|
level: 3,
|
|
34
40
|
blockLabel: undefined,
|
|
41
|
+
addLabel: (typeLabel: string) => `Add ${typeLabel}`,
|
|
42
|
+
hint: 'Use the move buttons to reorder, or drag with a pointer.',
|
|
43
|
+
emptyText: 'No blocks yet. Add a block to start writing.',
|
|
35
44
|
},
|
|
36
45
|
);
|
|
37
46
|
|
|
@@ -317,7 +326,7 @@ onBeforeUnmount(stopDrag);
|
|
|
317
326
|
:data-readonly="readonly ? 'true' : undefined"
|
|
318
327
|
>
|
|
319
328
|
<p v-if="!readonly" :id="`${id}-hint`" class="pui-block-editor__hint">
|
|
320
|
-
|
|
329
|
+
{{ hint }}
|
|
321
330
|
</p>
|
|
322
331
|
<ol
|
|
323
332
|
v-if="modelValue.length"
|
|
@@ -448,9 +457,7 @@ onBeforeUnmount(stopDrag);
|
|
|
448
457
|
</ol>
|
|
449
458
|
<div v-else class="pui-block-editor__empty">
|
|
450
459
|
<slot name="empty">{{
|
|
451
|
-
readonly
|
|
452
|
-
? 'No content blocks.'
|
|
453
|
-
: 'No blocks yet. Add a block to start writing.'
|
|
460
|
+
readonly ? 'No content blocks.' : emptyText
|
|
454
461
|
}}</slot>
|
|
455
462
|
</div>
|
|
456
463
|
<div v-if="!readonly" :id="`${id}-add`" class="pui-block-editor__add">
|
|
@@ -461,7 +468,7 @@ onBeforeUnmount(stopDrag);
|
|
|
461
468
|
size="sm"
|
|
462
469
|
:disabled="disabled"
|
|
463
470
|
@click="add(type)"
|
|
464
|
-
>
|
|
471
|
+
>{{ addLabel(type.label) }}</Button
|
|
465
472
|
>
|
|
466
473
|
</div>
|
|
467
474
|
</div>
|