Svelte: fix pre-init error check and Properties panel
This commit is contained in:
parent
fb10e5194e
commit
05425e39ec
|
|
@ -52,22 +52,26 @@
|
||||||
|
|
||||||
// Display an error if the browser is incompatible with a required API
|
// Display an error if the browser is incompatible with a required API
|
||||||
// This is run outside the JS code bundle in case unsupported features cause a syntax error when parsing the bundle, preventing the any bundle code from running
|
// This is run outside the JS code bundle in case unsupported features cause a syntax error when parsing the bundle, preventing the any bundle code from running
|
||||||
// TODO: Svelte: reenable this
|
let incompatibility;
|
||||||
let error;
|
|
||||||
if (!("BigUint64Array" in window)) {
|
if (!("BigUint64Array" in window)) {
|
||||||
error = `
|
incompatibility = `
|
||||||
<style>
|
<style>
|
||||||
body::after { content: none; }
|
body::after { content: none; }
|
||||||
h2, p, a { text-align: center; color: white; }
|
h2, p, a { text-align: center; color: #eee; font-family: "Source Sans Pro", Arial, sans-serif; }
|
||||||
</style>
|
</style>
|
||||||
<h2>This browser is too old to run Graphite</h2>
|
<h2>This browser is too old to run Graphite</h2>
|
||||||
<p>Please upgrade to a modern web browser such as the latest Firefox, Chrome, Edge, or Safari version 15 or newer.</p>
|
<p>Please upgrade to a modern web browser such as the latest Firefox, Chrome, Edge, or Safari version 15 or newer.</p>
|
||||||
<p>(The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array#browser_compatibility" target="_blank"><code>BigInt64Array</code></a>
|
<p>(The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array#browser_compatibility" target="_blank"><code>BigInt64Array</code></a>
|
||||||
JavaScript API must be supported by the browser for Graphite to function.)</p>
|
JavaScript API must be supported by the browser for Graphite to function.)</p>
|
||||||
`.trim();
|
`.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the editor application or display the incompatibility message
|
||||||
|
if (!incompatibility) {
|
||||||
|
import("/build/bundle.js");
|
||||||
|
} else {
|
||||||
|
document.body.innerHTML += incompatibility;
|
||||||
}
|
}
|
||||||
if (error) document.body.innerHTML = error;
|
|
||||||
</script>
|
</script>
|
||||||
<script src="/build/bundle.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@
|
||||||
|
|
||||||
editor.subscriptions.subscribeJsMessage(UpdateLayerTreeOptionsLayout, (updateLayerTreeOptionsLayout) => {
|
editor.subscriptions.subscribeJsMessage(UpdateLayerTreeOptionsLayout, (updateLayerTreeOptionsLayout) => {
|
||||||
patchWidgetLayout(layerTreeOptionsLayout, updateLayerTreeOptionsLayout);
|
patchWidgetLayout(layerTreeOptionsLayout, updateLayerTreeOptionsLayout);
|
||||||
|
layerTreeOptionsLayout = layerTreeOptionsLayout;
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.subscriptions.subscribeJsMessage(UpdateDocumentLayerDetails, (updateDocumentLayerDetails) => {
|
editor.subscriptions.subscribeJsMessage(UpdateDocumentLayerDetails, (updateDocumentLayerDetails) => {
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,12 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
editor.subscriptions.subscribeJsMessage(UpdatePropertyPanelOptionsLayout, (updatePropertyPanelOptionsLayout) => {
|
editor.subscriptions.subscribeJsMessage(UpdatePropertyPanelOptionsLayout, (updatePropertyPanelOptionsLayout) => {
|
||||||
patchWidgetLayout(propertiesOptionsLayout, updatePropertyPanelOptionsLayout);
|
patchWidgetLayout(propertiesOptionsLayout, updatePropertyPanelOptionsLayout);
|
||||||
|
propertiesOptionsLayout = propertiesOptionsLayout;
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.subscriptions.subscribeJsMessage(UpdatePropertyPanelSectionsLayout, (updatePropertyPanelSectionsLayout) => {
|
editor.subscriptions.subscribeJsMessage(UpdatePropertyPanelSectionsLayout, (updatePropertyPanelSectionsLayout) => {
|
||||||
patchWidgetLayout(propertiesSectionsLayout, updatePropertyPanelSectionsLayout);
|
patchWidgetLayout(propertiesSectionsLayout, updatePropertyPanelSectionsLayout);
|
||||||
|
propertiesSectionsLayout = propertiesSectionsLayout;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
.optional-input {
|
.optional-input {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
|
|
||||||
label {
|
.checkbox-input label {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled label {
|
&.disabled .checkbox-input label {
|
||||||
border: 1px solid var(--color-4-dimgray);
|
border: 1px solid var(--color-4-dimgray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue