@dfosco/storyboard-react 3.11.3 → 3.12.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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard-react",
3
- "version": "3.11.3",
3
+ "version": "3.12.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@dfosco/storyboard-core": "3.11.3",
7
- "@dfosco/tiny-canvas": "3.11.3",
6
+ "@dfosco/storyboard-core": "3.12.0",
7
+ "@dfosco/tiny-canvas": "3.12.0",
8
8
  "@neodrag/react": "^2.3.1",
9
9
  "glob": "^11.0.0",
10
10
  "jsonc-parser": "^3.3.1"
@@ -287,7 +287,6 @@ export default function CanvasPage({ name }) {
287
287
  const zoomRef = useRef(initialViewport?.zoom ?? 100)
288
288
  const scrollRef = useRef(null)
289
289
  const pendingScrollRestore = useRef(initialViewport)
290
- const initialWidgetParam = useRef(new URLSearchParams(window.location.search).has('widget'))
291
290
  const [canvasTitle, setCanvasTitle] = useState(canvas?.title || name)
292
291
  const titleInputRef = useRef(null)
293
292
  const [localSources, setLocalSources] = useState(canvas?.sources ?? [])
@@ -396,8 +395,6 @@ export default function CanvasPage({ name }) {
396
395
  setLocalWidgets(canvas?.widgets ?? null)
397
396
  setLocalSources(canvas?.sources ?? [])
398
397
  setCanvasTitle(canvas?.title || name)
399
- setSnapEnabled(canvas?.snapToGrid ?? false)
400
- setSnapGridSize(canvas?.gridSize || 40)
401
398
  undoRedo.reset()
402
399
  }
403
400
 
@@ -863,7 +860,7 @@ export default function CanvasPage({ name }) {
863
860
  function handleSnapToggle() {
864
861
  setSnapEnabled((prev) => {
865
862
  const next = !prev
866
- updateCanvas(name, { settings: { snapToGrid: next } }).catch((err) =>
863
+ updateCanvas(name, { snapToGrid: next }).catch((err) =>
867
864
  console.error('[canvas] Failed to persist snap setting:', err)
868
865
  )
869
866
  return next
@@ -922,16 +919,6 @@ export default function CanvasPage({ name }) {
922
919
  return () => document.removeEventListener('storyboard:canvas:zoom-to-fit', handleZoomToFit)
923
920
  }, [localWidgets, localSources, jsxExports])
924
921
 
925
- // On initial load without a ?widget= deep link, zoom to fit all objects.
926
- // Wait for jsxExports when the canvas has a JSX module so components are
927
- // included in the bounding-box calculation.
928
- useEffect(() => {
929
- if (loading || initialWidgetParam.current) return
930
- if (canvas?._jsxModule && !jsxExports) return
931
- initialWidgetParam.current = true // only once
932
- document.dispatchEvent(new CustomEvent('storyboard:canvas:zoom-to-fit'))
933
- }, [loading, jsxExports, canvas])
934
-
935
922
  // Canvas background should follow toolbar theme target.
936
923
  useEffect(() => {
937
924
  function readMode() {
@@ -64,6 +64,8 @@ export default forwardRef(function PrototypeEmbed({ props, onUpdate, resizable }
64
64
 
65
65
  const iframeSrc = useMemo(() => {
66
66
  if (!rawSrc) return ''
67
+ // External URLs are embedded as-is — storyboard query params only apply to local prototypes
68
+ if (/^https?:\/\//.test(rawSrc)) return rawSrc
67
69
  const hashIdx = rawSrc.indexOf('#')
68
70
  const base = hashIdx >= 0 ? rawSrc.slice(0, hashIdx) : rawSrc
69
71
  const hash = hashIdx >= 0 ? rawSrc.slice(hashIdx) : ''