@dfosco/storyboard-react 4.2.0-beta.23 → 4.2.0-beta.25
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/vite/data-plugin.js +12 -7
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.25",
|
|
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.25",
|
|
8
|
+
"@dfosco/tiny-canvas": "4.2.0-beta.25",
|
|
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",
|
package/src/vite/data-plugin.js
CHANGED
|
@@ -1397,9 +1397,10 @@ export default function storyboardDataPlugin() {
|
|
|
1397
1397
|
*
|
|
1398
1398
|
* Sources (in priority order):
|
|
1399
1399
|
* 1. assets/.storyboard-public/terminal-snapshots/<widgetId>.snapshot.json (new, flat)
|
|
1400
|
-
* 2.
|
|
1400
|
+
* 2. assets/.storyboard-public/terminal-snapshots/<widgetId>.snapshot.txt (human-readable companion)
|
|
1401
|
+
* 3. .storyboard/terminal-snapshots/<canvasDir>/<widgetId>.json (legacy, nested)
|
|
1401
1402
|
*
|
|
1402
|
-
*
|
|
1403
|
+
* All are emitted to `_storyboard/terminal-snapshots/` in the build.
|
|
1403
1404
|
* Tilde-prefixed files (~) are excluded (private).
|
|
1404
1405
|
*/
|
|
1405
1406
|
export function terminalSnapshotPlugin() {
|
|
@@ -1409,14 +1410,18 @@ export function terminalSnapshotPlugin() {
|
|
|
1409
1410
|
generateBundle() {
|
|
1410
1411
|
const emittedIds = new Set()
|
|
1411
1412
|
|
|
1412
|
-
// 1. New public snapshots (flat structure)
|
|
1413
|
+
// 1. New public snapshots (flat structure) — .json and .txt
|
|
1413
1414
|
const publicDir = path.resolve('assets/.storyboard-public/terminal-snapshots')
|
|
1414
1415
|
if (fs.existsSync(publicDir)) {
|
|
1415
1416
|
for (const file of fs.readdirSync(publicDir)) {
|
|
1416
|
-
if (file.startsWith('~') || file.startsWith('.')
|
|
1417
|
-
|
|
1418
|
-
const
|
|
1419
|
-
if (
|
|
1417
|
+
if (file.startsWith('~') || file.startsWith('.')) continue
|
|
1418
|
+
const isJson = file.endsWith('.snapshot.json')
|
|
1419
|
+
const isTxt = file.endsWith('.snapshot.txt')
|
|
1420
|
+
if (!isJson && !isTxt) continue
|
|
1421
|
+
if (isJson) {
|
|
1422
|
+
const widgetId = file.replace(/\.snapshot\.json$/, '')
|
|
1423
|
+
if (widgetId) emittedIds.add(widgetId)
|
|
1424
|
+
}
|
|
1420
1425
|
this.emitFile({
|
|
1421
1426
|
type: 'asset',
|
|
1422
1427
|
fileName: `_storyboard/terminal-snapshots/${file}`,
|