init commit

This commit is contained in:
Carlos
2026-02-21 10:33:18 +01:00
parent c863a943ed
commit 9d955bf338
9512 changed files with 2015317 additions and 1305 deletions

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deriveCanvasContentFromUrl = void 0;
const url_state_1 = require("../helpers/url-state");
const deriveCanvasContentFromUrl = () => {
const route = (0, url_state_1.getRoute)();
const substrings = route.split('/').filter(Boolean);
// CJK-named composition IDs are not automatically reselected after page refresh
const lastPart = substrings[substrings.length - 1];
if (substrings[0] === 'assets') {
return {
type: 'asset',
asset: decodeURIComponent(route.substring('/assets/'.length)),
};
}
if (substrings[0] === 'outputs') {
return {
type: 'output',
path: decodeURIComponent(route.substring('/outputs/'.length)),
};
}
if (lastPart) {
return {
type: 'composition',
compositionId: decodeURIComponent(lastPart),
};
}
return null;
};
exports.deriveCanvasContentFromUrl = deriveCanvasContentFromUrl;