@dfosco/storyboard-react 4.2.5 → 4.2.6

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard-react",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@base-ui/react": "^1.4.0",
7
- "@dfosco/storyboard-core": "4.2.5",
8
- "@dfosco/tiny-canvas": "4.2.5",
7
+ "@dfosco/storyboard-core": "4.2.6",
8
+ "@dfosco/tiny-canvas": "4.2.6",
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",
@@ -56,6 +56,31 @@ function AvatarIcon({ username }) {
56
56
  )
57
57
  }
58
58
 
59
+ /**
60
+ * Alt-reactive label for the "Hide toolbars" command palette item.
61
+ * Shows "Completely hide toolbars" when alt is held, "Hide toolbars" otherwise.
62
+ */
63
+ function HideToolbarsLabel({ isHidden }) {
64
+ const [altHeld, setAltHeld] = useState(false)
65
+ useEffect(() => {
66
+ const onKey = (e) => setAltHeld(e.altKey)
67
+ const onUp = () => setAltHeld(false)
68
+ document.addEventListener('keydown', onKey, true)
69
+ document.addEventListener('keyup', onUp, true)
70
+ return () => {
71
+ document.removeEventListener('keydown', onKey, true)
72
+ document.removeEventListener('keyup', onUp, true)
73
+ }
74
+ }, [])
75
+
76
+ return (
77
+ <span style={{ display: 'flex', width: '100%', justifyContent: 'space-between', alignItems: 'center' }}>
78
+ <span>{altHeld ? 'Completely hide toolbars' : 'Hide toolbars'}</span>
79
+ <span>{isHidden ? '✓' : ''}</span>
80
+ </span>
81
+ )
82
+ }
83
+
59
84
  /**
60
85
  * Check if a tool should be hidden from the command palette on the current route.
61
86
  * Uses the same pattern-matching logic as excludeRoutes.
@@ -228,11 +253,16 @@ function buildConfigSections(prefix, onNavigateToPage, onCreateAction) {
228
253
  remainingItems.push({
229
254
  id: `cfg:${section.id}:${toolId}`,
230
255
  children: label,
231
- keywords: [label, toolId, 'hide', 'show', 'toolbar'].filter(Boolean),
256
+ keywords: [label, toolId, 'hide', 'show', 'toolbar', 'completely'].filter(Boolean),
232
257
  showType: false,
233
258
  onClick: () => {
259
+ document.documentElement.classList.remove('storyboard-chrome-completely-hidden')
234
260
  document.documentElement.classList.toggle('storyboard-chrome-hidden')
235
261
  },
262
+ onAltClick: () => {
263
+ document.documentElement.classList.add('storyboard-chrome-hidden')
264
+ document.documentElement.classList.add('storyboard-chrome-completely-hidden')
265
+ },
236
266
  })
237
267
  continue
238
268
  }
@@ -666,17 +696,19 @@ function buildToolsSection(section, prefix, onNavigateToPage) {
666
696
  const isHidden = document.documentElement.classList.contains('storyboard-chrome-hidden')
667
697
  items.push({
668
698
  id: `cfg:${section.id}:${toolId}`,
669
- toolIcon: isHidden ? 'primer/light-bulb' : 'primer/light-bulb',
670
- children: <span style={{ display: 'flex', width: '100%', justifyContent: 'space-between', alignItems: 'center' }}>
671
- <span>Hide toolbars</span>
672
- <span>{isHidden ? '✓' : ''}</span>
673
- </span>,
674
- keywords: [label, toolId, 'hide', 'show', 'toolbar'].filter(Boolean),
699
+ toolIcon: 'primer/light-bulb',
700
+ children: <HideToolbarsLabel isHidden={isHidden} />,
701
+ keywords: [label, toolId, 'hide', 'show', 'toolbar', 'completely'].filter(Boolean),
675
702
  showType: false,
676
703
  closeOnSelect: entryCloseOnSelect,
677
704
  onClick: () => {
705
+ document.documentElement.classList.remove('storyboard-chrome-completely-hidden')
678
706
  document.documentElement.classList.toggle('storyboard-chrome-hidden')
679
707
  },
708
+ onAltClick: () => {
709
+ document.documentElement.classList.add('storyboard-chrome-hidden')
710
+ document.documentElement.classList.add('storyboard-chrome-completely-hidden')
711
+ },
680
712
  })
681
713
  continue
682
714
  }
@@ -1218,7 +1250,7 @@ export default function StoryboardCommandPalette({ basePath }) {
1218
1250
  !search && <Command.Separator key={list.id} />
1219
1251
  ) : (
1220
1252
  <Command.Group key={list.id} heading={list.heading}>
1221
- {list.items.map(({ id, children, keywords, onClick, itemType, toolIcon, toolMeta, closeOnSelect, hideFromSearch, url }) => {
1253
+ {list.items.map(({ id, children, keywords, onClick, onAltClick, itemType, toolIcon, toolMeta, closeOnSelect, hideFromSearch, url }) => {
1222
1254
  if (search && hideFromSearch) return null
1223
1255
  if (hiddenFromSearchIds.size > 0) {
1224
1256
  for (const toolId of hiddenFromSearchIds) {
@@ -1234,6 +1266,8 @@ export default function StoryboardCommandPalette({ basePath }) {
1234
1266
  copyLinkToClipboard(url, itemType)
1235
1267
  } else if (url && modifierHeldRef.current) {
1236
1268
  window.open(url, '_blank')
1269
+ } else if (onAltClick && altHeldRef.current) {
1270
+ onAltClick()
1237
1271
  } else {
1238
1272
  onClick?.()
1239
1273
  }
@@ -18,6 +18,7 @@ import { isGitHubEmbedUrl } from './widgets/githubUrl.js'
18
18
  import { WebGLContextPoolProvider, usePoolVisibilityUpdater } from './WebGLContextPool.jsx'
19
19
 
20
20
  import WidgetChrome from './widgets/WidgetChrome.jsx'
21
+ import ComponentWidget from './widgets/ComponentWidget.jsx'
21
22
  import useUndoRedo from './useUndoRedo.js'
22
23
  import useMarqueeSelect from './useMarqueeSelect.js'
23
24
  import MarqueeOverlay from './MarqueeOverlay.jsx'
@@ -0,0 +1,14 @@
1
+ // Deprecated stub — ComponentWidget was removed in 4.2.5.
2
+ // This file exists only to prevent crashes in CanvasPage's jsx- code path,
3
+ // which still references ComponentWidget for legacy canvas companion files.
4
+ // The jsx- system is dormant (no canvases define a `jsx` field).
5
+ import WidgetWrapper from './WidgetWrapper.jsx'
6
+
7
+ export default function ComponentWidget({ component: Component, exportName }) {
8
+ if (!Component) return null
9
+ return (
10
+ <WidgetWrapper>
11
+ <Component />
12
+ </WidgetWrapper>
13
+ )
14
+ }