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 visible (Hide)

solid-codemirror - [email protected] Latest Release

Published by github-actions[bot] 11 months ago

Patch Changes

  • e3daa5a: Fix type exports in package.json.
solid-codemirror - [email protected]

Published by github-actions[bot] over 1 year ago

Breaking Changes

Warning This version could cause breaking changes due to @codemirror/state and @codemirror/view version update.
Updating @codemirror/state to ^6.2.0 and @codemirror/view to ^6.12.0 it's highly recommended

  • Update minimum version of @codemirror/view and @codemirror/state

Minor Changes

  • b0e6157: Add transaction dispatch events, update CodeMirror and peer dependency version #24
solid-codemirror - [email protected]

Published by github-actions[bot] over 1 year ago

Patch Changes

  • 6a103b3: chore: fix ci
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 github-actions[bot] almost 2 years ago

This version of solid-codemirror introduces a new helper: createLazyCompartmentExtension. This new helper will not introduce any magic at all, it will just provide a cleaner syntax to support extensions returning a Promise.

// ✅ 1. Remove the static import
// import { largeExtension } from './large-extension';
import { createLazyCompartmentExtension } from './createLazyCompartmentExtension';
import { Show } from 'solid-js';

function App() {
  const [code, setCode] = createSignal("console.log('hello world!')");
  const { ref, createExtension } = createCodeMirror({ onValueChange: setCode });

  // ✅ 2. Call the helper providing a Promise<Extension>
  // The extension will be configured only after the Promise resolves
  const largeExt = createLazyCompartmentExtension(
    () => import('./large-extension').then(res => res.largeExtension)
  );

  return (
    <div>
      <div ref={ref} />
      {/*✅ 3. You can read the pending state of the Promise*/}
      <Show when={largeExt.loading}>
        Loading...
      </Show>
    </div>
  )
}

Minor Changes

  • 06762fe: feat: add support for lazy compartment extensions
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

solid-codemirror - v1.0.3

Published by github-actions[bot] over 2 years ago

1.0.3 (2022-05-04)

Bug Fixes

solid-codemirror - v1.0.2

Published by github-actions[bot] over 2 years ago

1.0.2 (2022-02-07)

Bug Fixes

  • update package.json build definitions (a4c0fa0)
  • update package.json meta (f263924)
solid-codemirror - v1.0.2-beta.2

Published by github-actions[bot] over 2 years ago

1.0.2-beta.2 (2022-02-07)

Bug Fixes

  • update package.json build definitions (a4c0fa0)
solid-codemirror - v1.0.2-beta.1

Published by github-actions[bot] over 2 years ago

1.0.2-beta.1 (2022-02-07)

Bug Fixes

  • update package.json meta (f263924)
solid-codemirror - v1.0.1

Published by github-actions[bot] over 2 years ago

1.0.1 (2022-02-06)

Bug Fixes

  • revert package.json version (for release) (76d3625)