Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bangle.dev/react-sticker

bangle-io9MIT0.32.1TypeScript support: included

null

readme

Node.js CI Netlify Status

psst we have great documentation at https://bangle.dev

What is bangle.dev ?

bangle.dev is a collection of components for building powerful editing experiences for the web.

  • :battery: Batteries included\ We expose plenty of components to help you get started with your Editor.

  • Insanely powerful API\ Bangle uses Prosemirror to provide an API which can help you build the next google docs including collaboration.

  • Vanilla JS\ Bangle is written in a framework agnostic way, so that you can focus on building the editor and not learning a new framework. That said, we have support for React and I have plans to add Vue support in the coming months.

  • Customize UI with React (more frameworks to come)\ Doing UI in vanilla Javascript is not fun. Bangle comes with first party React support and React components (the ones starting with `@bangle.dev/react-`) to add some extra :nail_care: oomph to your Editor.

  • :car: Fast as a racing car\ Bangle is as fast as a rich text editor can be; try pasting a really long document in one of its example (:wink: don't forget to compare it with your current favourite editor).

Getting started

npm install @bangle.dev/core

Read the docs at https://bangle.dev/docs/getting-started for more details.

changelog

NOTE: until we hit v1, expect breaking changes the minor versions (0.x).

0.32.0

  • Dependency updates

0.31.6

  • enhancement: `@bangle.dev/markdownupdated theinlineNodeParser's parametergetTokenDetails` to provide extra information in the callback and you can return in the callback whether a white space needs to be added before or after.
inlineNodeParser(md, {
    tokenName: 'note_tag',
    regex: MARKDOWN_REGEX,
    // new parameters `offset` and `srcText`
    getTokenDetails: (match, offset, srcText) => {
       // use extra information to return the token details
       return {
            payload: string;
            markup: string;
            // Tell whether to insert a space before this token
            whiteSpaceBefore?: boolean;
            // Tell whether to insert a space after this token
            whiteSpaceAfter?: boolean;
       }
    }
});

0.31.3

  • enhancement: `@bangle.dev/collab-managerallows you to manually request (usecollabManager.requestDeleteInstance(...)`) deletion of an instance to save memory.

0.31.2

  • enhancement: `@bangle.dev/collab-manageradded two classesbangle-collab-activeandbangle-collab-frozen` on editor to indicate whether the editor is active or frozen to reflect the collaboration state.

0.31.1

0.31.0

  • Breaking: `@bangle.dev/collab-client` has been rewritten. Docs are still WIP.
  • New package: `@bangle.dev/collab-comms` for communicating between collab-manager and collab-client. Docs are still WIP.
  • New package: `@bangle.dev/collab-manager` for managing collab-client. Docs are still WIP.
  • Archived: `@bangle.dev/diskand@bangle.dev/collab-server` have been archived.

0.30.0

0.29.0

  • Breaking: bangle.dev now uses typescript version of Prosemirror. This might cause some type errors.

  • If you notice errors like Uncaught Error: Invalid plugin, please try to make sure you have only 1 version of prosemirror-view,prosemirror-state, prosemirror-transform in your node_modules. You can delete your lock file and re-run yarn install to resolve the issue.

0.28.10

0.28.9

**@bangle.dev/collab-manager**

  • enhancement: export CollabClientRequestType

0.28.8

  • enhancement: Improve serial execute queue utility

0.28.7

  • enhancement: Collab server recognizes when a document is not defined

0.28.6

  • Fix: Collab server debounces initialization to prevent overloading of requests.

0.28.5

  • All packages now set the type to module.

0.28.4

**@bangle.dev/react**

0.28.3

**@bangle.dev/base-components**

  • enhancement: Improved mark input regex.

**@bangle.dev/tooltip**

  • enhancement: suggestMark disallows any other mark when it is active.

0.28.2

**@bangle.dev/core**

  • enhancement: The editor.destroy() and editor.destroyed use pmViews new isDestroyed field.

0.28.1

**@bangle.dev/base-components**

  • chore: Typing updates

0.28.0

**@bangle.dev/utils**

  • Breaking: deleted plugin-key-store.

**@bangle.dev/react-emoji-suggest**

  • feature: Now saves suggestTooltipKey in its plugin state.

**@bangle.dev/core**

  • feature: BangleEditorState now accepts prosemirror-drop-cursor options.

0.27.6

**@bangle.dev/tooltip**

  • bug: fix issues with Typescript 4.4

0.27.4

**@bangle.dev/react-emoji-suggest**

0.27.3

**@bangle.dev/core**

**@bangle.dev/react-emoji-suggest**

  • bug: Fixed the case when selectEmoji command was using incorrect plugin key.

0.27.2

  • bug: Fixed situation where ordered list markdown shortcut would not trigger.

0.27.0

**@bangle.dev/react**

  • Bug: Fix renderNodeViews types.

**@bangle.dev/markdown**

  • Feature: Expose inlineNodeParser a utility for inline markdown tokens.

0.26.5

  • Bug: Typing fixes for suggestions.

0.26.4

  • Bug: Typing fixes for keybindings.

0.26.3

  • Bug: Typing fixes across multiple packages.

0.26.2

**@bangle.dev/core**

  • Feature: Now exports BaseRawNodeSpec and BaseRawMarkSpec.

0.26.1

**@bangle.dev/react**

  • Feature: The react component now allows for forwarding of refs, see docs for example.

0.26.0

**@bangle.dev/core**

  • We have a new package `@bangle.dev/base-componentscarved out from@bangle.dev/corewhich now exports all components likebold,heading,listItem` etc.

  • Breaking🚨: `@bangle.dev/coreNo longer exports the following undocumented APIbrowser,utils,loggingpluginKeyStore,setSelectionAtEnd,corePluginsandcoreSpec`.

  • Breaking🚨: No longer exports any bangle components, please check out the code example below for transitioning to using `@bangle.dev/base-components`.

  • If you were importing individual components, corePlugins or coreSpec please import each component individually.

// old
import { bulletList, orderedList } from '@bangle.dev/core';

// new
import { bulletList, orderedList } from '@bangle.dev/base-components';

If you were importing components, you can either club all imports from `@bangle.dev/base-components` and call it components or just import each individual component like in the above example.

// old
import { components } from '@bangle.dev/core';

// new
import * as components from '@bangle.dev/base-components';

0.25.3

  • `@bangle.dev/pm` package now follows the same versioning as other bangle.dev packages.

0.25.0

**@bangle.dev/core**

  • Breaking🚨: if pluginMetadata param is not provided, it will default to undefined.

**@bangle.dev/react**

  • Breaking🚨: The undocumented hook useSpecRegistry & usePlugins are now removed.

0.24.0

  • Breaking🚨: package `@bangle.dev/pm-utilsand@bangle.dev/js-utilshave been merged into a single package@bangle.dev/utils`.

0.23.1

**@bangle.dev/react-sticker**

  • Fixed a problem in prepack script which prevented it from being built.

0.23.0

  • All the packages are now written in Typescript.

0.22.2

**@bangle.dev/core**

  • A bug in tsconfig was prevent typescript compilation.

0.22.1

  • Updates prosemirror package versions.

0.22.0

**@bangle.dev/markdown**

  • breaking🚨: defaultMarkdownItTokenizer is now a function getDefaultMarkdownItTokenizer which returns the default tokenizer.

**@bangle.dev/search**

  • breaking🚨: Search no longer uses a caseSensitive param, users should instead send a query regex i flag for case insensitivity.

0.21.1

**@bangle.dev/core**

  • breaking🚨: All imports are now expected to be done by doing import { ... } from '@bangle.dev/core'. Direct file imports like import { ... } from '@bangle.dev/core/xyz' are no longer supported.
  • breaking🚨: keymap is no longer exported, please use prosemirror-keymap directly.

0.20.0

**@bangle.dev/tooltip**

  • breaking🚨: Command showSuggestionsTooltip is now renamed to renderSuggestionsTooltip to more accurately reflect what the command does.

**@bangle.dev/search**

  • new: A new component for highlight text in response to a search query.

**@bangle.dev/react-menu**

0.19.0

**@bangle.dev/core**

0.18.1

  • bug: Fixed package dependency issues.

0.18.0

**@bangle.dev/tooltip**

  • We have now added typescript types to the tooltip package.

0.17.2

**@bangle.dev/core**

**@bangle.dev/collab-client**

  • bug: preserve selection if it was provided in a collab session.

0.17.1

**@bangle.dev/collab-sever** , **@bangle.dev/collab-client** **@bangle.dev/disk**

0.17.0

**@bangle.dev/collab-sever** , **@bangle.dev/collab-client** **@bangle.dev/disk**

  • disk.load is now expected to return a Node.
  • collab plugin now accepts onFatalError.

0.16.2

**@bangle.dev/core**

  • bug: Fixes a problem with 0.16.1's pluginMetadata.

0.16.1

**@bangle.dev/core**

  • feat: EditorState now accepts an additional prop pluginMetadata which will be then passed to a plugin function as metadata.

**@bangle.dev/react-emoji-suggest**

  • bug: Fixed the font size of the emojis so that in windows they don't get clipped.

0.16.0

  • breaking🚨: `@bangle.dev/collab-severwill no longer throw errors inmanager.handleRequest. You should useparseCollabResponsethat parses the response and throwsCollabError`.
  • breaking🚨: `@bangle.dev/collab-severThe request typeget_eventsis now renamed topull_events`.

0.15.0

  • breaking🚨: `@bangle.dev/collabis now broken into two packages:@bangle.dev/collab-sever&@bangle.dev/collab-client`.

**@bangle.dev/react-emoji-suggest**

  • feat: A new and improved emoji suggest tooltip.

**@bangle.dev/core**

0.14.0

**@bangle.dev/emoji**

  • breaking🚨: The package no longer exports data and the user is expected to provide its own datasource, see emoji docs for more details.
  • feat: The emoji.spec() now accepts a new parameter getEmoji.

**@bangle.dev/core**

0.13.0

**@bangle.dev/core**

**@bangle.dev/collab**

0.12.1

**@bangle.dev/core**

0.12.0

**@bangle.dev/core**

  • feat: The image component's plugin now accepts two new params acceptFileType and createImageNodes which help saving an input image.

**@bangle.dev/collab**

  • bug: fixed a bug in which the module was accessing a field on an undefined.

0.11.0

**@bangle.dev/wiki-link**

  • 🎉 We have a new component which allows for wiki style links. It also supports parsing and serializing the format into markdown.

0.10.5

**@bangle.dev/core**

  • chore: Export the list item commands insertEmptySiblingListAbove & insertEmptySiblingListBelow.

0.10.4

**@bangle.dev/core**

  • chore: added insert para above/below commands to blockquote & heading.
  • chore: export prosemirror-keymap via `@bangle.dev/core/prosemirror/keymap`.

0.10.3

**@bangle.dev/core**

  • bug: editorStateCounter was missing in bangle.dev/core.

0.10.2

  • chore: doc updates and cleanup

0.10.1

  • chore: doc updates and cleanup

0.10.0

**@bangle.dev/core**

  • breaking bug: Follow stricter ESM (ecma-script module) pattern by not having index.js within sub-directories of a module. Unlike node resolver, importing a folder in ESM does not return the index.js file in the folder.

If you were doing something like import {xyz} from '@bangle.dev/core/components/index' please instead do import {xyz} from '@bangle.dev/core' or directly import the file import {xyz} from '@bangle.dev/core/components/doc'.

// make this
import { doc, heading } from '@bangle.dev/core/components/index';

// into this
import { components } from '@bangle.dev/core';
const { doc, heading } = components;

// or
import doc from '@bangle.dev/core/components/doc';

0.9.1

**@bangle.dev/tooltip**

  • bug: suggest tooltip now resets counter on hide.
  • feat: triggers can now be more than one characters.

0.9.0

**@bangle.dev/core**

  • feat: adding a new tight attribute to ordered and unorder list components.

**@bangle.dev/markdown**

  • feat: Markdown parsing now remembers whether lists are tightly spaced or not.

0.8.0

**@bangle.dev/core**

  • feat: add insertEmptyParagraphBelow, insertEmptyParagraphAbove command to paragraph component.
  • feat: add moveListItemUp, moveListItemDown to listItem component.

**@bangle.dev/react-menu**

  • bug: disable menu buttons when view is not editable

0.7.2

**@bangle.dev/react-emoji-suggest**

  • bug: stray console statement

0.7.1

**@bangle.dev/table**

  • bug: Renamed table.css to style.css

0.7.0

**@bangle.dev/markdown**

  • feat: Now parses and serializes markdown

**@bangle.dev/table**

  • NEW package for dealing with tables!

0.6.0

**@bangle.dev/react-menu**

  • bug: Use button attribute for menu items

**@bangle.dev/markdown**

  • bug: When opening a file with empty list item crashed the editor.

0.5.1

**@bangle.dev/core**

  • bug: Fix css settings that were being applied globally instead of scoped to the editor.
  • bug: Fix css margins for the first child of the editor.

0.5.0

**@bangle.dev/react-menu**

  • feat: Added an undo and redo button.

0.4.1

**@bangle.dev/core**

  • deprecation: BangleEditorState expects plugins named parameter to be a function. Previous usage of an array of plugins is now deprecated.

0.4.0

  • bug: Fix cyclic dependencies across the project.
  • chore: Moved away from export * as xyz syntax as it causes problem with certain bundlers.

0.3.3

**@bangle.dev/core**

  • bug: Fixed issue in collab by checking the position when restarting.

0.3.2

**@bangle.dev/core**

  • bug: Fixed bugs related todo list joining and working with list items.
  • bug: Fixed when pressing an enter on a checked todo created another checked todo list.
  • bug: Fixed issue in collab by checking the position when restarting.

0.3.1

**@bangle.dev/core**

  • bug: Fixed some bugs which cause non-intuitive toggling between todo bullet lists and regular bullet lists.

0.3.0

**@bangle.dev/core**

  • bug: Fixed an issue when toggling a nested list item with empty sibbling caused errors.

  • breaking: todoList and todoItem no longer exist and now have been implemented with bulletList and listItem with the node attribute todoChecked.

0.2.1

**@bangle.dev/core**

  • patch: expose flattenFragmentJSON in heading component.

0.2.0

**@bangle.dev/core**