@dfosco/storyboard-react 4.0.0-beta.38 → 4.0.0-beta.39

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.0.0-beta.38",
3
+ "version": "4.0.0-beta.39",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@base-ui/react": "^1.4.0",
7
- "@dfosco/storyboard-core": "4.0.0-beta.38",
8
- "@dfosco/tiny-canvas": "4.0.0-beta.38",
7
+ "@dfosco/storyboard-core": "4.0.0-beta.39",
8
+ "@dfosco/tiny-canvas": "4.0.0-beta.39",
9
9
  "@neodrag/react": "^2.3.1",
10
10
  "glob": "^11.0.0",
11
11
  "jsonc-parser": "^3.3.1",
@@ -713,9 +713,20 @@ function BranchDropdown({ basePath }) {
713
713
  .filter(b => !b.lastModified || new Date(b.lastModified).getTime() > twoWeeksAgo)
714
714
  .sort((a, b) => (a.branch || '').localeCompare(b.branch || ''))
715
715
 
716
+ const isLocalDev = typeof window !== 'undefined' && window.__SB_LOCAL_DEV__ === true
717
+
716
718
  const switchBranch = async (branch) => {
717
719
  setSwitching(branch)
718
720
  setSwitchError(null)
721
+
722
+ if (!isLocalDev) {
723
+ // Prod: direct navigation
724
+ const target = branches?.find(b => b.branch === branch)
725
+ window.location.href = `${branchBasePath}${target?.folder || (branch === 'main' ? '' : `branch--${branch}/`)}`
726
+ return
727
+ }
728
+
729
+ // Dev: call switch-branch API to spin up server
719
730
  const apiBase = (basePath || '/').replace(/\/$/, '')
720
731
  try {
721
732
  const res = await fetch(`${apiBase}/_storyboard/switch-branch`, {
@@ -834,7 +834,7 @@ export default function storyboardDataPlugin() {
834
834
  // can't trace into its deps. Include the remark entry points so
835
835
  // Vite pre-bundles the full chain — covers all transitive CJS
836
836
  // packages (debug, extend, etc.) without whack-a-mole.
837
- include: ['remark', 'remark-gfm', 'remark-html'],
837
+ include: ['remark', 'remark-gfm', 'remark-html', 'use-sync-external-store/shim', 'use-sync-external-store/shim/with-selector'],
838
838
  exclude: ['@dfosco/storyboard-react'],
839
839
  },
840
840
  }