init commit
This commit is contained in:
33
remotion/node_modules/@remotion/studio/dist/helpers/url-state.js
generated
vendored
Normal file
33
remotion/node_modules/@remotion/studio/dist/helpers/url-state.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRoute = exports.reloadUrl = exports.clearUrl = exports.pushUrl = void 0;
|
||||
const getUrlHandlingType = () => {
|
||||
if (window.remotion_isReadOnlyStudio) {
|
||||
return 'query-string';
|
||||
}
|
||||
return 'spa';
|
||||
};
|
||||
const pushUrl = (url) => {
|
||||
if (getUrlHandlingType() === 'query-string') {
|
||||
window.history.pushState({}, 'Studio', `${window.location.pathname}?${url}`);
|
||||
}
|
||||
else {
|
||||
window.history.pushState({}, 'Studio', url);
|
||||
}
|
||||
};
|
||||
exports.pushUrl = pushUrl;
|
||||
const clearUrl = () => {
|
||||
window.location.href = window.location.pathname;
|
||||
};
|
||||
exports.clearUrl = clearUrl;
|
||||
const reloadUrl = () => {
|
||||
window.location.reload();
|
||||
};
|
||||
exports.reloadUrl = reloadUrl;
|
||||
const getRoute = () => {
|
||||
if (getUrlHandlingType() === 'query-string') {
|
||||
return window.location.search.substring(1);
|
||||
}
|
||||
return window.location.pathname;
|
||||
};
|
||||
exports.getRoute = getRoute;
|
||||
Reference in New Issue
Block a user