Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bangle.dev/base-components

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bangle.dev/base-components - npm Package Compare versions

Comparing version 0.28.1 to 0.28.3

66

__tests__/italic.test.js

@@ -6,3 +6,8 @@ /**

/** @jsx psx */
import { psx, sendKeyToPm, setSelectionNear } from '@bangle.dev/test-helpers';
import {
psx,
sendKeyToPm,
setSelectionNear,
typeText,
} from '@bangle.dev/test-helpers';
import { italic } from '../index';

@@ -64,1 +69,60 @@ import { defaultTestEditor } from './test-editor';

});
describe('markdown shortcuts', () => {
const testEditor = defaultTestEditor();
test('_ shortcut', async () => {
const { editorView } = testEditor(
<doc>
<para>first</para>
<para>[]</para>
</doc>,
);
typeText(editorView, '_magic_');
expect(editorView.state).toEqualDocAndSelection(
<doc>
<para>first</para>
<para>
<italic>magic</italic>
</para>
</doc>,
);
});
test('_ shortcut after a word', async () => {
const { editorView } = testEditor(
<doc>
<para>first</para>
<para>hey there []</para>
</doc>,
);
typeText(editorView, '_sweety_');
expect(editorView.state).toEqualDocAndSelection(
<doc>
<para>first</para>
<para>
hey there <italic>sweety</italic>
</para>
</doc>,
);
});
test('_ shortcut while inside a word', async () => {
const { editorView } = testEditor(
<doc>
<para>first</para>
<para>hey there[]</para>
</doc>,
);
typeText(editorView, '_omg_');
expect(editorView.state).toEqualDocAndSelection(
<doc>
<para>first</para>
<para>hey there_omg_</para>
</doc>,
);
});
});

8

bold.ts

@@ -76,5 +76,9 @@ import type { RawPlugins, RawSpecs } from '@bangle.dev/core';

markdownShortcut &&
markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g, type),
markPasteRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g, type),
markdownShortcut &&
markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/, type),
markPasteRule(/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g, type),
markdownShortcut &&
markInputRule(/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/, type),
markdownShortcut &&
markInputRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/, type),
keybindings &&

@@ -81,0 +85,0 @@ keymap(createObject([[keybindings.toggleBold, toggleBold()]])),

@@ -53,5 +53,9 @@ import { keymap, toggleMark, } from '@bangle.dev/pm';

markdownShortcut &&
markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g, type),
markPasteRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g, type),
markdownShortcut &&
markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/, type),
markPasteRule(/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g, type),
markdownShortcut &&
markInputRule(/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/, type),
markdownShortcut &&
markInputRule(/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/, type),
keybindings &&

@@ -58,0 +62,0 @@ keymap(createObject([[keybindings.toggleBold, toggleBold()]])),

@@ -41,4 +41,4 @@ import { keymap, toggleMark, } from '@bangle.dev/pm';

markPasteRule(/\*([^*]+)\*/g, type),
markInputRule(/(?:^|[^_])(_([^_]+)_)$/, type),
markInputRule(/(?:^|[^*])(\*([^*]+)\*)$/, type),
markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/, type),
markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/, type),
keybindings &&

@@ -45,0 +45,0 @@ keymap(createObject([[keybindings.toggleItalic, toggleMark(type)]])),

@@ -53,4 +53,4 @@ import { keymap, toggleMark, } from '@bangle.dev/pm';

return [
markPasteRule(/~([^~]+)~/g, type),
markInputRule(/~([^~]+)~$/, type),
markPasteRule(/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g, type),
markInputRule(/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/, type),
keybindings &&

@@ -57,0 +57,0 @@ keymap(createObject([[keybindings.toggleStrike, toggleMark(type)]])),

@@ -59,4 +59,4 @@ import type { RawPlugins, RawSpecs } from '@bangle.dev/core';

markPasteRule(/\*([^*]+)\*/g, type),
markInputRule(/(?:^|[^_])(_([^_]+)_)$/, type),
markInputRule(/(?:^|[^*])(\*([^*]+)\*)$/, type),
markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/, type),
markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/, type),
keybindings &&

@@ -63,0 +63,0 @@ keymap(createObject([[keybindings.toggleItalic, toggleMark(type)]])),

{
"name": "@bangle.dev/base-components",
"version": "0.28.1",
"version": "0.28.3",
"homepage": "https://bangle.dev",

@@ -35,9 +35,9 @@ "authors": [

"dependencies": {
"@bangle.dev/pm-commands": "0.28.1",
"@bangle.dev/utils": "0.28.1"
"@bangle.dev/pm-commands": "0.28.3",
"@bangle.dev/utils": "0.28.3"
},
"devDependencies": {
"@bangle.dev/core": "0.28.1",
"@bangle.dev/pm": "0.28.1",
"@bangle.dev/test-helpers": "0.28.1",
"@bangle.dev/core": "0.28.3",
"@bangle.dev/pm": "0.28.3",
"@bangle.dev/test-helpers": "0.28.3",
"@types/jest": "^26.0.23",

@@ -44,0 +44,0 @@ "@types/markdown-it": "^12.0.3",

@@ -72,4 +72,4 @@ import type { RawPlugins, RawSpecs } from '@bangle.dev/core';

return [
markPasteRule(/~([^~]+)~/g, type),
markInputRule(/~([^~]+)~$/, type),
markPasteRule(/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g, type),
markInputRule(/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/, type),
keybindings &&

@@ -76,0 +76,0 @@ keymap(createObject([[keybindings.toggleStrike, toggleMark(type)]])),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc