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

@prosekit/extensions

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prosekit/extensions - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

dist/chunk-DI46QWLX.js

6

dist/_tsup-dts-rollup.d.ts
import { Attrs } from '@prosekit/pm/model';
import type { BundledTheme } from 'shikiji';
import type { Command } from '@prosekit/pm/state';
import { CommandArgs } from '@prosekit/core';

@@ -20,2 +21,3 @@ import type { ContentMatch } from '@prosekit/pm/model';

import { ProseMirrorNode } from '@prosekit/pm/model';
import type { Selection as Selection_2 } from '@prosekit/pm/state';
import { ToggleCollapsedOptions } from 'prosemirror-flat-list';

@@ -572,2 +574,4 @@ import { Transaction } from '@prosekit/pm/state';

export declare function isInCodeBlock(selection: Selection_2): boolean | undefined;
/**

@@ -651,2 +655,4 @@ * @public

export declare function withSkipCodeBlock(command: Command): Command;
export { }

30

dist/prosekit-extensions-heading.js
import {
isInCodeBlock
} from "./chunk-DI46QWLX.js";
import {
defineTextBlockInputRule

@@ -15,2 +18,14 @@ } from "./chunk-DYFRBXUX.js";

} from "@prosekit/core";
// src/utils/with-skip-code-block.ts
function withSkipCodeBlock(command) {
return (state, dispatch, view) => {
if (isInCodeBlock(state.selection)) {
return false;
}
return command(state, dispatch, view);
};
}
// src/heading/index.ts
function defineHeadingSpec() {

@@ -38,10 +53,13 @@ return defineNodeSpec({

return defineKeymap({
"mod-1": toggleNode({ type: "heading", attrs: { level: 1 } }),
"mod-2": toggleNode({ type: "heading", attrs: { level: 2 } }),
"mod-3": toggleNode({ type: "heading", attrs: { level: 3 } }),
"mod-4": toggleNode({ type: "heading", attrs: { level: 4 } }),
"mod-5": toggleNode({ type: "heading", attrs: { level: 5 } }),
"mod-6": toggleNode({ type: "heading", attrs: { level: 6 } })
"mod-1": toggleHeadingKeybinding(1),
"mod-2": toggleHeadingKeybinding(2),
"mod-3": toggleHeadingKeybinding(3),
"mod-4": toggleHeadingKeybinding(4),
"mod-5": toggleHeadingKeybinding(5),
"mod-6": toggleHeadingKeybinding(6)
});
}
function toggleHeadingKeybinding(level) {
return withSkipCodeBlock(toggleNode({ type: "heading", attrs: { level } }));
}
function defineHeadingInputRule() {

@@ -48,0 +66,0 @@ return defineTextBlockInputRule({

@@ -0,1 +1,5 @@

import {
isInCodeBlock
} from "./chunk-DI46QWLX.js";
// src/placeholder/index.ts

@@ -17,2 +21,5 @@ import { definePlugin } from "@prosekit/core";

}
if (isInCodeBlock(state.selection)) {
return null;
}
const placeholderText = options.placeholder;

@@ -19,0 +26,0 @@ const deco = createPlaceholderDecoration(state, placeholderText);

4

package.json
{
"name": "@prosekit/extensions",
"type": "module",
"version": "0.2.1",
"version": "0.2.2",
"private": false,

@@ -124,3 +124,3 @@ "author": {

"dependencies": {
"@prosekit/core": "^0.2.0",
"@prosekit/core": "^0.2.2",
"@prosekit/pm": "^0.1.1",

@@ -127,0 +127,0 @@ "prosemirror-flat-list": "^0.4.5",

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