2022-12-15 11:57:06 +01:00

58 lines
1.5 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= typeof title !== 'undefined'? title : 'Storybook'%></title>
<link rel="icon" type="image/svg+xml" href="./favicon.svg">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="./sb-preview/runtime.mjs" rel="preload" as="script">
<% if (typeof head !== 'undefined') { %> <%- head %> <% } %>
<style>
#storybook-root[hidden]{
display: none !important;
}
</style>
<% files.css.forEach(file => { %>
<link href="<%= file %>" rel="stylesheet" />
<% }); %>
</head>
<body>
<div id="root"></div>
<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
<script>
<% for (var varName in globals) { %>
<% if (globals[varName] !== undefined) { %>
window['<%=varName%>'] = <%- (globals[varName]) %>;
<% } %>
<% } %>
</script>
<% } %>
<script type="module">
import './sb-manager/runtime.mjs';
const addons = [
<% files.js.forEach(file => { %>
'./<%= file %>',
<% }); %>
];
/* error handling of manager-addons being broken */
const results = await Promise.allSettled(addons.map(addon => import(addon))).then(results => {
results.forEach((result, index) => {
if(result.status =='rejected'){
console.error(`loading ${addons[index]} failed to load correctly`);
}
})
});
</script>
</body>
</html>