@dfosco/storyboard-react 4.2.0-beta.25 → 4.2.0-beta.26
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 +3 -3
- package/src/AuthModal/AuthModal.jsx +1 -2
- package/src/CommandPalette/CommandPalette.jsx +5 -3
- package/src/Viewfinder.jsx +7 -7
- package/src/canvas/CanvasPage.jsx +1 -1
- package/src/canvas/ConnectorLayer.jsx +1 -1
- package/src/canvas/PageSelector.test.jsx +1 -1
- package/src/canvas/widgets/ExpandedPane.jsx +4 -1
- package/src/canvas/widgets/MarkdownBlock.jsx +2 -0
- package/src/canvas/widgets/WidgetChrome.jsx +1 -0
- package/src/canvas/widgets/expandUtils.js +3 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfosco/storyboard-react",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@base-ui/react": "^1.4.0",
|
|
7
|
-
"@dfosco/storyboard-core": "4.2.0-beta.
|
|
8
|
-
"@dfosco/tiny-canvas": "4.2.0-beta.
|
|
7
|
+
"@dfosco/storyboard-core": "4.2.0-beta.26",
|
|
8
|
+
"@dfosco/tiny-canvas": "4.2.0-beta.26",
|
|
9
9
|
"@neodrag/react": "^2.3.1",
|
|
10
10
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
11
11
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { useState, useEffect, useCallback } from 'react'
|
|
8
8
|
import { Dialog } from '@base-ui/react/dialog'
|
|
9
|
-
import { Button } from '@base-ui/react/button'
|
|
10
9
|
import css from './AuthModal.module.css'
|
|
11
10
|
|
|
12
11
|
const COMMENTS_TOKEN_KEY = 'sb-comments-token'
|
|
@@ -31,7 +30,7 @@ export default function AuthModal() {
|
|
|
31
30
|
return () => document.removeEventListener('storyboard:open-auth-modal', handleOpen)
|
|
32
31
|
}, [])
|
|
33
32
|
|
|
34
|
-
const
|
|
33
|
+
const _handleClose = useCallback(() => {
|
|
35
34
|
setOpen(false)
|
|
36
35
|
setTokenValue('')
|
|
37
36
|
}, [])
|
|
@@ -86,6 +86,7 @@ function isHiddenInPalette(tool, basePath) {
|
|
|
86
86
|
function buildConfigSections(prefix, onNavigateToPage, onCreateAction) {
|
|
87
87
|
const config = getCommandPaletteConfig()
|
|
88
88
|
const sections = config?.sections || []
|
|
89
|
+
console.log('[devlog] CommandPalette buildConfigSections:', { sectionsCount: sections.length, providers: config?.providers, configKeys: Object.keys(config || {}) })
|
|
89
90
|
const groups = []
|
|
90
91
|
const toolMenus = []
|
|
91
92
|
const usedToolIds = new Set()
|
|
@@ -417,7 +418,7 @@ function buildDynamicSection(section, prefix, onNavigateToPage, onCreateAction)
|
|
|
417
418
|
if (section.source === 'starred') {
|
|
418
419
|
const STARRED_KEY = 'sb-workspace-starred'
|
|
419
420
|
let starredIds = []
|
|
420
|
-
try { starredIds = JSON.parse(localStorage.getItem(STARRED_KEY)) || [] } catch {}
|
|
421
|
+
try { starredIds = JSON.parse(localStorage.getItem(STARRED_KEY)) || [] } catch { /* empty */ }
|
|
421
422
|
if (starredIds.length === 0) return null
|
|
422
423
|
|
|
423
424
|
const index = buildPrototypeIndex()
|
|
@@ -639,7 +640,7 @@ function buildToolsSection(section, prefix, onNavigateToPage) {
|
|
|
639
640
|
const items = []
|
|
640
641
|
const subPages = []
|
|
641
642
|
|
|
642
|
-
for (const { toolId, tool, label,
|
|
643
|
+
for (const { toolId, tool, label, closeOnSelect: entryCloseOnSelect } of entries) {
|
|
643
644
|
// Inline actions
|
|
644
645
|
if (tool.inlineAction === 'toggle-chrome') {
|
|
645
646
|
const isHidden = document.documentElement.classList.contains('storyboard-chrome-hidden')
|
|
@@ -994,6 +995,7 @@ export default function StoryboardCommandPalette({ basePath }) {
|
|
|
994
995
|
useEffect(() => {
|
|
995
996
|
if (refreshKey === 0) return
|
|
996
997
|
const built = buildPaletteItems(basePath, handleCreateAction, handleNavigateToPage)
|
|
998
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
997
999
|
setItems(built.groups)
|
|
998
1000
|
setToolMenus(built.toolMenus)
|
|
999
1001
|
}, [refreshKey, basePath])
|
|
@@ -1196,7 +1198,7 @@ export default function StoryboardCommandPalette({ basePath }) {
|
|
|
1196
1198
|
!search && <Command.Separator key={list.id} />
|
|
1197
1199
|
) : (
|
|
1198
1200
|
<Command.Group key={list.id} heading={list.heading}>
|
|
1199
|
-
{list.items.map(({ id, children, keywords, onClick, itemType, toolIcon, toolMeta, closeOnSelect, hideFromSearch, url, ...
|
|
1201
|
+
{list.items.map(({ id, children, keywords, onClick, itemType, toolIcon, toolMeta, closeOnSelect, hideFromSearch, url, ..._rest }) => {
|
|
1200
1202
|
if (search && hideFromSearch) return null
|
|
1201
1203
|
if (hiddenFromSearchIds.size > 0) {
|
|
1202
1204
|
for (const toolId of hiddenFromSearchIds) {
|
package/src/Viewfinder.jsx
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Formerly known as Viewfinder — renamed to match the /workspace route.
|
|
6
6
|
*/
|
|
7
7
|
import { useState, useEffect, useRef, useMemo, useCallback, useSyncExternalStore } from 'react'
|
|
8
|
-
import { buildPrototypeIndex, listStories, getStoryData,
|
|
9
|
-
import { MarkGithubIcon, GitBranchIcon, ChevronDownIcon, ChevronRightIcon,
|
|
8
|
+
import { buildPrototypeIndex, listStories, getStoryData, BranchSelect } from '@dfosco/storyboard-core'
|
|
9
|
+
import { MarkGithubIcon, GitBranchIcon, ChevronDownIcon, ChevronRightIcon, PlusIcon, StarIcon, StarFillIcon, ThreeBarsIcon, XIcon, StackIcon, TrashIcon, ShieldLockIcon, KebabHorizontalIcon, PencilIcon } from '@primer/octicons-react'
|
|
10
10
|
import { Menu } from '@base-ui/react/menu'
|
|
11
11
|
import { Dialog } from '@base-ui/react/dialog'
|
|
12
12
|
import Icon from './Icon.jsx'
|
|
@@ -56,7 +56,7 @@ const COMMENTS_TOKEN_KEY = 'sb-comments-token'
|
|
|
56
56
|
* Resolve the current GitHub user for display in the sidebar.
|
|
57
57
|
* Priority: 1) PAT-cached user (from comments auth), 2) gh CLI login via git-user endpoint.
|
|
58
58
|
*/
|
|
59
|
-
function useGitHubUser(
|
|
59
|
+
function useGitHubUser(_basePath) {
|
|
60
60
|
const [user, setUser] = useState(() => {
|
|
61
61
|
try {
|
|
62
62
|
const raw = localStorage.getItem(COMMENTS_USER_KEY)
|
|
@@ -158,7 +158,7 @@ function withBase(basePath, route) {
|
|
|
158
158
|
|
|
159
159
|
const THUMB_CLASSES = ['thumbBlue', 'thumbAmber', 'thumbGreen', 'thumbPurple', 'thumbRose', 'thumbSlate']
|
|
160
160
|
|
|
161
|
-
function
|
|
161
|
+
function _thumbClass(name) {
|
|
162
162
|
let h = 0
|
|
163
163
|
for (let i = 0; i < name.length; i++) h = ((h << 5) - h + name.charCodeAt(i)) | 0
|
|
164
164
|
return css[THUMB_CLASSES[Math.abs(h) % THUMB_CLASSES.length]]
|
|
@@ -1081,7 +1081,7 @@ export default function Workspace({
|
|
|
1081
1081
|
hideDefaultFlow,
|
|
1082
1082
|
hideDefaultScene = false,
|
|
1083
1083
|
}) {
|
|
1084
|
-
const
|
|
1084
|
+
const _shouldHideDefault = hideDefaultFlow ?? hideDefaultScene
|
|
1085
1085
|
const themeAttrs = useToolbarTheme()
|
|
1086
1086
|
const ghUser = useGitHubUser(basePath)
|
|
1087
1087
|
const [settingsOpen, setSettingsOpen] = useState(false)
|
|
@@ -1258,7 +1258,7 @@ export default function Workspace({
|
|
|
1258
1258
|
const toggleGrouping = useCallback(() => {
|
|
1259
1259
|
setGroupByFolders(prev => {
|
|
1260
1260
|
const next = !prev
|
|
1261
|
-
try { localStorage.setItem(GROUP_BY_FOLDERS_KEY, String(next)) } catch {}
|
|
1261
|
+
try { localStorage.setItem(GROUP_BY_FOLDERS_KEY, String(next)) } catch { /* empty */ }
|
|
1262
1262
|
return next
|
|
1263
1263
|
})
|
|
1264
1264
|
}, [])
|
|
@@ -1291,7 +1291,7 @@ export default function Workspace({
|
|
|
1291
1291
|
// Starred items for sidebar
|
|
1292
1292
|
const starredItems = useMemo(() => visibleItems.filter(i => starred.has(i.id)), [visibleItems, starred])
|
|
1293
1293
|
|
|
1294
|
-
const
|
|
1294
|
+
const _pageTitle = NAV_ITEMS.find(n => n.id === activeNav)?.label || 'All artifacts'
|
|
1295
1295
|
|
|
1296
1296
|
return (
|
|
1297
1297
|
<div className={css.layout} {...themeAttrs}>
|
|
@@ -58,7 +58,7 @@ registerSmoothCorners()
|
|
|
58
58
|
registerHotPoolDevLogs()
|
|
59
59
|
|
|
60
60
|
/** Matches branch-deploy base path prefixes like /branch--my-feature/ */
|
|
61
|
-
const
|
|
61
|
+
const _BRANCH_PREFIX_RE = /^\/branch--[^/]+/
|
|
62
62
|
|
|
63
63
|
// Build a reverse map from story route paths → { storyId, route }
|
|
64
64
|
const storyRouteIndex = new Map()
|
|
@@ -21,7 +21,7 @@ function getEndpointStyle(widgetType, side) {
|
|
|
21
21
|
|
|
22
22
|
const DOT_OUTSET = 8
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function _getDotOffset(anchor) {
|
|
25
25
|
switch (anchor) {
|
|
26
26
|
case 'top': return { dx: 0, dy: -DOT_OUTSET }
|
|
27
27
|
case 'bottom': return { dx: 0, dy: DOT_OUTSET }
|
|
@@ -66,6 +66,7 @@ export default function ExpandedPane({ initialPanes, initialLayout, variant = 'm
|
|
|
66
66
|
|
|
67
67
|
// Sync layout when initialLayout changes (preserves column/row sizes)
|
|
68
68
|
useEffect(() => {
|
|
69
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
69
70
|
if (initialLayout) setLayout(initialLayout)
|
|
70
71
|
}, [initialLayout])
|
|
71
72
|
|
|
@@ -113,7 +114,9 @@ export default function ExpandedPane({ initialPanes, initialLayout, variant = 'm
|
|
|
113
114
|
}
|
|
114
115
|
detachRefs.current.clear()
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
// intentional mount-only
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
}, [])
|
|
117
120
|
|
|
118
121
|
// Handle pane list changes: attach new external panes, detach removed ones
|
|
119
122
|
useLayoutEffect(() => {
|
|
@@ -105,6 +105,7 @@ export default forwardRef(function MarkdownBlock({ id, props, onUpdate, resizabl
|
|
|
105
105
|
|
|
106
106
|
// Async-highlight code blocks after initial render or theme change
|
|
107
107
|
useEffect(() => {
|
|
108
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
108
109
|
setRenderedHtml(rawHtml)
|
|
109
110
|
if (!rawHtml.includes('<code class="language-')) return
|
|
110
111
|
let cancelled = false
|
|
@@ -149,6 +150,7 @@ export default forwardRef(function MarkdownBlock({ id, props, onUpdate, resizabl
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
} else {
|
|
153
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
152
154
|
setEditHeight(null)
|
|
153
155
|
}
|
|
154
156
|
}, [editingActive])
|
|
@@ -451,6 +451,7 @@ export default function WidgetChrome({
|
|
|
451
451
|
<div className={`${styles.toolbarContent} ${showToolbar ? styles.toolbarContentVisible : ''}`}>
|
|
452
452
|
{showFeatures && (
|
|
453
453
|
<div className={styles.featureButtons}>
|
|
454
|
+
{/* eslint-disable-next-line react-hooks/refs */}
|
|
454
455
|
{features.map((feature) => {
|
|
455
456
|
// Menu features are rendered in WidgetOverflowMenu
|
|
456
457
|
if (feature.menu) return null
|
|
@@ -22,7 +22,9 @@ export { isSplitScreenCapable }
|
|
|
22
22
|
*/
|
|
23
23
|
function MarkdownSecondaryPane({ widget, editingRef, onUpdate }) {
|
|
24
24
|
const [editing, setEditing] = useState(false)
|
|
25
|
+
// eslint-disable-next-line react-hooks/refs
|
|
25
26
|
editingRef.current = editing
|
|
27
|
+
// eslint-disable-next-line react-hooks/refs
|
|
26
28
|
editingRef.setter = (v) => {
|
|
27
29
|
setEditing(v)
|
|
28
30
|
// Notify ExpandedPane to re-render so titlebar features resolve updated toggle state
|
|
@@ -31,6 +33,7 @@ function MarkdownSecondaryPane({ widget, editingRef, onUpdate }) {
|
|
|
31
33
|
|
|
32
34
|
const content = widget.props?.content || ''
|
|
33
35
|
|
|
36
|
+
// eslint-disable-next-line react-hooks/refs
|
|
34
37
|
return createElement(ExpandedMarkdownEditor, {
|
|
35
38
|
content,
|
|
36
39
|
onUpdate,
|