solid-codemirror

A library of SolidJS primitives to build code editors using CodeMirror 6 @codemirror

MIT License

Downloads
366
Stars
57
Committers
7

Bot releases are hidden (Show)

solid-codemirror - [email protected]

Published by riccardoperra over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]@2.2.2

solid-codemirror - [email protected]

Published by riccardoperra about 2 years ago

Breaking Change

What's Changed

Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]@2.1.0

solid-codemirror - [email protected]

Published by riccardoperra over 2 years ago

This version of solid-codemirror has many breaking changes due to the update to official v6 release and support for compartments. For more detailed informations about CodeMirror6 and extension/compartments, see the official documentation

What's Changed

  • Refactor createCodeMirror with extension modularity and compartments support
  • Allows to control editor value with createEditorControlledValue extension helper
  • Allows to observe and update focused state with createEditorFocus helper
  • Allows to update the readOnly state with createEditorReadonly helper

Breaking Changes

  • Remove CodeMirror component (BREAKING!!)

The createCodeMirror has been refactored removing the setOptions function which allowed to do a top-level reconfiguration. Instead, it has been relpaced with the createExtension function which create a compartment for the given extension/s.

Old

const {setOptions} = createCodeMirror();

setOptions({extensions: [
  basicSetup(),
  EditorView.theme([]),
  lineNumbers()
]})

New

const {createExtension} = createCodeMirror();

// Single-extension compartment
const reconfigurebasicSetup = createExtension(basicSetup());
const reconfigureTheme = createExtension(EditorView.theme([]);
const reconfigureLineNumbers = createExtension(lineNumbers());

// Multi-extension compartment
const configureExtensions = createExtension([
  basicSetup(),
  EditorView.theme([]),
  lineNumbers()
])

Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]

solid-codemirror - v1.1.0

Published by riccardoperra over 2 years ago

1.1.0 (2022-06-12)

Features

  • add support for CodeMirror 6.0.0 (b47dfad)

Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/v1.0.3...v1.1.0