From e96675174fdc4fd0f839c68ff0c4cc1256ad6bcb Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 13 May 2025 17:54:23 -0400 Subject: [PATCH] Minor changes --- README.md | 2 +- README_guidelines.md | 3 +++ package.json | 2 +- src/lib/e_app_codemirror_v5.svelte | 18 ++++++++++-------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4d58a71a..d80b3b35 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # One Sky IT's Aether App - SvelteKit v2 -This uses SvelteKit version 2, TailwindCSS, and Skelton. +This uses SvelteKit version 2.x with Svelte version 5.x, TailwindCSS, and Skelton. # Current Modules diff --git a/README_guidelines.md b/README_guidelines.md index 0f76f819..bd23a3e5 100644 --- a/README_guidelines.md +++ b/README_guidelines.md @@ -38,6 +38,9 @@ Waiting to upgrade to 4.x when ShadCN is ready. ShadCN is still being worked on * https://ui.shadcn.com/docs/tailwind-v4 +## CodeMirror 6.x (text and code editor) +* https://codemirror.net + ## ShadCN (Tailwind Components) * https://ui.shadcn.com/docs * https://github.com/shadcn-ui/ui diff --git a/package.json b/package.json index adaad8ed..3abdf84c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ae-app-svelte5", - "version": "0.2.507", + "version": "0.2.513", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/lib/e_app_codemirror_v5.svelte b/src/lib/e_app_codemirror_v5.svelte index 61f145a1..de62b4a3 100644 --- a/src/lib/e_app_codemirror_v5.svelte +++ b/src/lib/e_app_codemirror_v5.svelte @@ -4,7 +4,7 @@ // *** Import Svelte version 5 specific import { browser } from '$app/environment'; -import { onMount, onDestroy, createEventDispatcher } from 'svelte'; +import { onMount, onDestroy } from 'svelte'; import { EditorView, keymap, highlightSpecialChars, drawSelection, highlightActiveLine, dropCursor, rectangularSelection, @@ -38,8 +38,10 @@ import { languages } from '@codemirror/language-data'; // import { } from '@codemirror/gutter'; // Merged into @codemirror/view import { basicSetup } from 'codemirror'; import { markdown, markdownLanguage } from '@codemirror/lang-markdown'; -import { javascript } from '@codemirror/lang-javascript'; -import { json } from '@codemirror/lang-json'; +// import { css } from '@codemirror/lang-css'; +// import { javascript } from '@codemirror/lang-javascript'; +// import { json } from '@codemirror/lang-json'; +// import { html } from '@codemirror/lang-html'; import { oneDark } from "@codemirror/theme-one-dark"; // Props @@ -64,8 +66,6 @@ export let tab_size: number = 4; let classes = ""; export { classes as class }; -const dispatch = createEventDispatcher<{ change: string }>(); - let editor_element: HTMLDivElement; let editorView: EditorView; @@ -152,8 +152,10 @@ $: editor_extensions = [ // placeholderExt(placeholder), // language, markdown({base: markdownLanguage, codeLanguages: languages}), - javascript({typescript: true}), - json({ jsx: true }), + // javascript({typescript: true}), + // json(), + // css(), + // html(), theme, ...extensions @@ -193,7 +195,7 @@ onMount(() => { if (transaction.docChanged) { new_content = editorView.state.doc.toString(); const newContent = editorView.state.doc.toString(); - dispatch('change', newContent); + // dispatch('change', newContent); } } });