Skip to content

Commit

Permalink
revert: shad-editor.svelte component to legacy mode
Browse files Browse the repository at this point in the history
$state() is not giving expected behavior for editor variable. It's not
being updated in onTransaction callback.
  • Loading branch information
Tsuzat committed Nov 12, 2024
1 parent fd3c66f commit bc256cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shadeditor",
"version": "0.0.5",
"version": "0.0.6",
"description": "Text editor build for svelte with tiptap and shadcn",
"author": {
"name": "Tsuzat",
Expand Down
16 changes: 7 additions & 9 deletions src/lib/shad-editor/shad-editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@
import { all, createLowlight } from 'lowlight';
import './onedark.css';
import SearchAndReplace from './custom/Extentions/SearchAndReplace.js';
interface Props {
class?: string;
content?: Content;
showToolbar?: boolean;
}
let { class: className = '', content = $bindable(null), showToolbar = true }: Props = $props();
const lowlight = createLowlight(all);
let editor: Editor | undefined = $state();
let element: HTMLElement | undefined = $state();
let className: string = '';
export { className as class };
export let content: Content = '';
export let showToolbar: boolean = true;
let editor: Editor;
let element: HTMLElement;
onMount(() => {
editor = new Editor({
Expand Down

0 comments on commit bc256cd

Please sign in to comment.