@meith/theme-phasebook 0.32.0 → 0.33.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/package.json +4 -4
- package/src/shared.tsx +2 -2
- package/src/slots/post-actions.tsx +6 -2
- package/src/theme.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/theme-phasebook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "A theme for Meith with a familiar social shape, built on the default theme's slots.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@meith/theme-default": "^0.
|
|
24
|
-
"@meith/theme-kit": "^0.
|
|
25
|
-
"@meith/ui": "^0.
|
|
23
|
+
"@meith/theme-default": "^0.33.0",
|
|
24
|
+
"@meith/theme-kit": "^0.33.0",
|
|
25
|
+
"@meith/ui": "^0.33.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^19.2.0"
|
package/src/shared.tsx
CHANGED
|
@@ -178,8 +178,8 @@ export function Rail({
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export function isEmptyRegion(node: React.ReactNode): boolean {
|
|
181
|
-
if (node === null || node === undefined || node === false) return true
|
|
182
|
-
return Array.isArray(node) && node.
|
|
181
|
+
if (node === null || node === undefined || node === false || node === '') return true
|
|
182
|
+
return Array.isArray(node) && node.every((child) => isEmptyRegion(child))
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
export function count(value: CountModel): string {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PostActionsSlotModel, SlotCopy } from '@meith/theme-kit'
|
|
2
2
|
import { fromSlotCopy } from '@meith/theme-kit'
|
|
3
3
|
|
|
4
|
+
import { isEmptyRegion } from '../shared'
|
|
5
|
+
|
|
4
6
|
interface Action {
|
|
5
7
|
readonly href: string
|
|
6
8
|
readonly label: string
|
|
@@ -31,7 +33,9 @@ export function PostActions({
|
|
|
31
33
|
actions.moderateHref === null ? null : { href: actions.moderateHref, label: c('moderate') },
|
|
32
34
|
].filter((action): action is Action => action !== null)
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
const extra = isEmptyRegion(children) ? null : children
|
|
37
|
+
|
|
38
|
+
if (reader.length === 0 && staff.length === 0 && extra === null) return null
|
|
35
39
|
|
|
36
40
|
return (
|
|
37
41
|
<nav aria-label={c('ariaLabel')} className="flex flex-wrap items-center gap-1">
|
|
@@ -47,7 +51,7 @@ export function PostActions({
|
|
|
47
51
|
</a>
|
|
48
52
|
))}
|
|
49
53
|
|
|
50
|
-
{
|
|
54
|
+
{extra !== null && <span className="ms-auto">{extra}</span>}
|
|
51
55
|
</nav>
|
|
52
56
|
)
|
|
53
57
|
}
|
package/src/theme.ts
CHANGED