@dfosco/storyboard-react 4.1.0-beta.0 → 4.1.0-beta.2
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/context.jsx +21 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfosco/storyboard-react",
|
|
3
|
-
"version": "4.1.0-beta.
|
|
3
|
+
"version": "4.1.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@base-ui/react": "^1.4.0",
|
|
7
|
-
"@dfosco/storyboard-core": "4.1.0-beta.
|
|
8
|
-
"@dfosco/tiny-canvas": "4.1.0-beta.
|
|
7
|
+
"@dfosco/storyboard-core": "4.1.0-beta.2",
|
|
8
|
+
"@dfosco/tiny-canvas": "4.1.0-beta.2",
|
|
9
9
|
"@neodrag/react": "^2.3.1",
|
|
10
10
|
"glob": "^11.0.0",
|
|
11
11
|
"jsonc-parser": "^3.3.1",
|
package/src/context.jsx
CHANGED
|
@@ -10,6 +10,7 @@ export { StoryboardContext }
|
|
|
10
10
|
|
|
11
11
|
const CanvasPageLazy = lazy(() => import('./canvas/CanvasPage.jsx'))
|
|
12
12
|
const StoryPageLazy = lazy(() => import('./story/StoryPage.jsx'))
|
|
13
|
+
const CommandPaletteLazy = lazy(() => import('./CommandPalette/CommandPalette.jsx'))
|
|
13
14
|
|
|
14
15
|
// Build a map from canvas route paths → canvas names at module load time
|
|
15
16
|
const canvasRouteMap = new Map()
|
|
@@ -115,6 +116,26 @@ function getPageFlowName(pathname) {
|
|
|
115
116
|
* The matched record entry is injected under the "record" key in flow data.
|
|
116
117
|
*/
|
|
117
118
|
export default function StoryboardProvider({ flowName, sceneName, recordName, recordParam, children }) {
|
|
119
|
+
const basePath = import.meta.env?.BASE_URL || '/'
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<StoryboardProviderInner
|
|
124
|
+
flowName={flowName}
|
|
125
|
+
sceneName={sceneName}
|
|
126
|
+
recordName={recordName}
|
|
127
|
+
recordParam={recordParam}
|
|
128
|
+
>
|
|
129
|
+
{children}
|
|
130
|
+
</StoryboardProviderInner>
|
|
131
|
+
<Suspense fallback={null}>
|
|
132
|
+
<CommandPaletteLazy basePath={basePath} />
|
|
133
|
+
</Suspense>
|
|
134
|
+
</>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function StoryboardProviderInner({ flowName, sceneName, recordName, recordParam, children }) {
|
|
118
139
|
const location = useLocation()
|
|
119
140
|
const params = useParams()
|
|
120
141
|
|