commit bbb1dae58d2f1a4280af058b517b5758b2dc95a6
parent e790cf70785b117161dc53244f38dcd44739d40d
Author: Hunter
Date:   Sat, 12 Jul 2025 15:41:44 -0400

close brackets for embedded CSS

Diffstat:
Mindex.html | 6++++--
Msw.js | 5+++--
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/index.html b/index.html @@ -10,11 +10,12 @@ import {EditorView, keymap, placeholder} from "https://esm.sh/@codemirror/view@6" import {EditorState} from "https://esm.sh/@codemirror/state@6" import {defaultKeymap, indentWithTab, undo, redo, undoDepth, redoDepth, history, historyKeymap} from "https://esm.sh/@codemirror/commands@6" + import {closeBrackets, closeBracketsKeymap} from "https://esm.sh/@codemirror/autocomplete@6" import {html} from "https://esm.sh/@codemirror/lang-html@6" import {githubDark} from "https://esm.sh/@fsegurai/codemirror-theme-github-dark" import {indentUnit} from "https://esm.sh/@codemirror/language@6" - window.CodeMirror = {EditorView, EditorState, keymap, defaultKeymap, indentWithTab, html, githubDark, indentUnit, placeholder, undo, redo, undoDepth, redoDepth, history, historyKeymap}; + window.CodeMirror = {EditorView, EditorState, keymap, defaultKeymap, indentWithTab, html, githubDark, indentUnit, placeholder, undo, redo, undoDepth, redoDepth, history, historyKeymap, closeBrackets, closeBracketsKeymap}; </script> <style> :root { @@ -249,7 +250,7 @@ return; } - const {EditorView, EditorState, keymap, defaultKeymap, indentWithTab, html, githubDark, indentUnit, placeholder, undo, redo, undoDepth, redoDepth, history, historyKeymap} = window.CodeMirror; + const {EditorView, EditorState, keymap, defaultKeymap, indentWithTab, html, githubDark, indentUnit, placeholder, undo, redo, undoDepth, redoDepth, history, historyKeymap, closeBrackets, closeBracketsKeymap} = window.CodeMirror; // Load saved content const savedContent = loadFromStorage(); @@ -260,6 +261,7 @@ doc: savedContent, extensions: [ history(), + closeBrackets(), keymap.of([ {key: "Mod-z", run: undo}, {key: "Mod-y", run: redo}, diff --git a/sw.js b/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'web-workshop-v6'; +const CACHE_NAME = 'web-workshop-v7'; const urlsToCache = [ '/web_workshop/', '/web_workshop/index.html', @@ -9,7 +9,8 @@ const urlsToCache = [ 'https://esm.sh/@codemirror/commands@6', 'https://esm.sh/@codemirror/lang-html@6', 'https://esm.sh/@fsegurai/codemirror-theme-github-dark', - 'https://esm.sh/@codemirror/language@6' + 'https://esm.sh/@codemirror/language@6', + 'https://esm.sh/@codemirror/autocomplete@6' ]; // Function to discover and cache all files in directories