@webround/editor 0.3.0 → 0.3.2
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.
|
@@ -187,6 +187,8 @@ function setCustomFont(root, family, faces) {
|
|
|
187
187
|
rule.append({ prop: 'font-style', value: face.style });
|
|
188
188
|
if (face.stretch)
|
|
189
189
|
rule.append({ prop: 'font-stretch', value: face.stretch });
|
|
190
|
+
// The text shows at once in a fallback and changes when the font arrives (without it, it stays invisible until the file is there)
|
|
191
|
+
rule.append({ prop: 'font-display', value: 'swap' });
|
|
190
192
|
root.append(rule);
|
|
191
193
|
}
|
|
192
194
|
}
|
|
@@ -11,6 +11,14 @@ function wrServerConfigPlugin(allowedHosts) {
|
|
|
11
11
|
config: () => ({ server: { allowedHosts } }),
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
+
// `.wr/` è dell'editor (i commenti, mai nel sito): nessuno dei suoi file è del sito, e il dev server non deve guardarli. Se li guarda,
|
|
15
|
+
// Tailwind li trova tra i file che scansiona e a ogni commento ricarica tutta la pagina (il flash bianco).
|
|
16
|
+
function wrWatchConfigPlugin() {
|
|
17
|
+
return {
|
|
18
|
+
name: 'wr-watch-config',
|
|
19
|
+
config: () => ({ server: { watch: { ignored: ['**/.wr/**'] } } }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
14
22
|
/**
|
|
15
23
|
* Facade: tutti i plugin dell'editor, nell'ordine giusto. Il vite.config.ts di un progetto
|
|
16
24
|
* deve solo spargere `...wrPlugins()` accanto a react() e tailwindcss(); aggiungere un plugin
|
|
@@ -19,6 +27,7 @@ function wrServerConfigPlugin(allowedHosts) {
|
|
|
19
27
|
export function wrPlugins(options = {}) {
|
|
20
28
|
return [
|
|
21
29
|
...(options.allowedHosts ? [wrServerConfigPlugin(options.allowedHosts)] : []),
|
|
30
|
+
wrWatchConfigPlugin(),
|
|
22
31
|
// The one door into the project for the editor's page (see operations/)
|
|
23
32
|
wrOperationsPlugin(),
|
|
24
33
|
wrPagesPlugin(),
|