@dfosco/storyboard-react 1.17.1 → 1.17.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard-react",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@dfosco/storyboard-core": "*",
@@ -3,6 +3,13 @@ import { useState, useEffect, useMemo } from 'react'
3
3
  import { hash, resolveSceneRoute, getSceneMeta } from '@dfosco/storyboard-core'
4
4
  import styles from './Viewfinder.module.css'
5
5
 
6
+ function formatSceneName(name) {
7
+ return name
8
+ .split('-')
9
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
10
+ .join(' ')
11
+ }
12
+
6
13
  function PlaceholderGraphic({ name }) {
7
14
  const seed = hash(name)
8
15
  const rects = []
@@ -180,7 +187,7 @@ export default function Viewfinder({ scenes = {}, pageModules = {}, basePath, ti
180
187
  <div className={showThumbnails ? styles.grid : styles.list}>
181
188
  {sceneNames.map((name) => {
182
189
  const meta = getSceneMeta(name)
183
- const displayName = meta?.name || name
190
+ const displayName = meta?.title || meta?.name || formatSceneName(name)
184
191
  return (
185
192
  <a key={name} href={resolveSceneRoute(name, knownRoutes)} className={showThumbnails ? styles.card : styles.listItem}>
186
193
  {showThumbnails && (
@@ -179,6 +179,9 @@
179
179
  background-repeat: no-repeat;
180
180
  background-position: right 12px center;
181
181
  min-width: 140px;
182
+ max-width: 220px;
183
+ text-overflow: ellipsis;
184
+ overflow: hidden;
182
185
  transition: border-color 0.15s ease;
183
186
  }
184
187