@prosekit/extensions
Advanced tools
Comparing version 0.0.0-next-20240505104851 to 0.0.0-next-20240519080336
@@ -642,2 +642,28 @@ import { Attrs } from '@prosekit/pm/model'; | ||
/** | ||
* Adds a `textAlign` attribute to the specified nodes. This will be rendered as | ||
* a CSS `text-align` style. | ||
* | ||
* @public | ||
*/ | ||
export declare function defineTextAlign(options: TextAlignOptions): Extension<{ | ||
COMMAND_ARGS: { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
}>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function defineTextAlignCommands(types: string[]): Extension<{ | ||
COMMAND_ARGS: { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
}>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function defineTextAlignKeymap(types: string[]): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
/** | ||
* Defines an enter rule that replaces the matched text with a block node. | ||
@@ -858,7 +884,2 @@ * | ||
/** | ||
* @deprecated Use `isApple` from `@prosekit/core` | ||
*/ | ||
export declare const isApple: boolean; | ||
export declare const LINK_ENTER_RE: RegExp; | ||
@@ -972,4 +993,29 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export declare function setTextAlign({ types, value, }: { | ||
types: string[]; | ||
value: string | null; | ||
}): Command; | ||
export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction; | ||
export declare interface TextAlignOptions { | ||
/** | ||
* The names of node to add the attribute to. | ||
* | ||
* @example | ||
* | ||
* ["paragraph", "heading"] | ||
*/ | ||
types: string[]; | ||
/** | ||
* The default value for the attribute. | ||
* | ||
* @default "left" | ||
*/ | ||
default?: string; | ||
} | ||
/** | ||
@@ -976,0 +1022,0 @@ * Options for {@link defineTextBlockEnterRule}. |
// src/autocomplete/index.ts | ||
import { | ||
Facet, | ||
defineFacet, | ||
defineFacetPayload, | ||
pluginFacet | ||
@@ -173,21 +174,16 @@ } from "@prosekit/core"; | ||
function defineAutocomplete(rule) { | ||
return autocompleteFacet.extension([rule]); | ||
return defineFacetPayload(autocompleteFacet, [rule]); | ||
} | ||
var autocompleteFacet = Facet.define({ | ||
converter: () => { | ||
let localRules = []; | ||
const getRules = () => localRules; | ||
return { | ||
create: (rules) => { | ||
localRules = rules; | ||
const plugin = createAutocompletePlugin({ getRules }); | ||
return () => [plugin]; | ||
}, | ||
update: (rules) => { | ||
localRules = rules; | ||
return null; | ||
} | ||
var autocompleteFacet = defineFacet({ | ||
reduce: () => { | ||
let rules = []; | ||
const getRules = () => rules; | ||
const plugin = createAutocompletePlugin({ getRules }); | ||
return function reducer(inputs) { | ||
rules = inputs; | ||
return plugin; | ||
}; | ||
}, | ||
next: pluginFacet | ||
parent: pluginFacet, | ||
singleton: true | ||
}); | ||
@@ -194,0 +190,0 @@ export { |
import { | ||
defineWrappingInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/blockquote/index.ts |
import { | ||
defineMarkInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/bold/index.ts |
import { | ||
defineTextBlockInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
import { | ||
defineTextBlockEnterRule | ||
} from "./chunk-HLBUHIMJ.js"; | ||
} from "./chunk-DZAKXWWF.js"; | ||
@@ -8,0 +8,0 @@ // src/code-block/code-block.ts |
import { | ||
defineMarkInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/code/index.ts |
import { | ||
defineEnterRule, | ||
defineTextBlockEnterRule | ||
} from "./chunk-HLBUHIMJ.js"; | ||
} from "./chunk-DZAKXWWF.js"; | ||
export { | ||
@@ -6,0 +6,0 @@ defineEnterRule, |
import { | ||
defineTextBlockInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/heading/index.ts |
@@ -7,3 +7,3 @@ import { | ||
defineWrappingInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
export { | ||
@@ -10,0 +10,0 @@ createMarkInputRule, |
import { | ||
defineMarkInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/italic/index.ts |
import { | ||
defineMarkRule | ||
} from "./chunk-7G7COECS.js"; | ||
} from "./chunk-ZOBSD7ZH.js"; | ||
import { | ||
defineInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
import { | ||
defineEnterRule | ||
} from "./chunk-HLBUHIMJ.js"; | ||
} from "./chunk-DZAKXWWF.js"; | ||
@@ -11,0 +11,0 @@ // src/link/index.ts |
import { | ||
defineInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/list/index.ts |
import { | ||
defineMarkRule | ||
} from "./chunk-7G7COECS.js"; | ||
} from "./chunk-ZOBSD7ZH.js"; | ||
export { | ||
defineMarkRule | ||
}; |
// src/mod-click-prevention/index.ts | ||
import { definePlugin } from "@prosekit/core"; | ||
import { definePlugin, isApple } from "@prosekit/core"; | ||
import { Plugin, PluginKey } from "@prosekit/pm/state"; | ||
// src/mod-click-prevention/env.ts | ||
var isApple = typeof navigator !== "undefined" ? /Mac|iP(hone|[ao]d)/.test(navigator.platform) : false; | ||
// src/mod-click-prevention/index.ts | ||
function defineModClickPrevention() { | ||
@@ -10,0 +5,0 @@ return definePlugin(new Plugin({ key, props: { handleClick } })); |
@@ -7,5 +7,4 @@ // src/readonly/index.ts | ||
} | ||
var key = new PluginKey("readonly"); | ||
var plugin = new ProseMirrorPlugin({ | ||
key, | ||
key: new PluginKey("prosekey-readonly"), | ||
props: { | ||
@@ -12,0 +11,0 @@ editable: () => false |
import { | ||
defineMarkInputRule | ||
} from "./chunk-CJ3SOSL6.js"; | ||
} from "./chunk-LVMTQOWG.js"; | ||
@@ -5,0 +5,0 @@ // src/strike/index.ts |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.0.0-next-20240505104851", | ||
"version": "0.0.0-next-20240519080336", | ||
"private": false, | ||
@@ -142,2 +142,7 @@ "author": { | ||
}, | ||
"./text-align": { | ||
"types": "./dist/prosekit-extensions-text-align.d.ts", | ||
"import": "./dist/prosekit-extensions-text-align.js", | ||
"default": "./dist/prosekit-extensions-text-align.js" | ||
}, | ||
"./underline": { | ||
@@ -161,4 +166,4 @@ "types": "./dist/prosekit-extensions-underline.d.ts", | ||
"dependencies": { | ||
"@prosekit/core": "0.0.0-next-20240505104851", | ||
"@prosekit/pm": "0.0.0-next-20240505104851", | ||
"@prosekit/core": "0.0.0-next-20240519080336", | ||
"@prosekit/pm": "0.0.0-next-20240519080336", | ||
"prosemirror-dropcursor": "^1.8.1", | ||
@@ -168,9 +173,9 @@ "prosemirror-flat-list": "^0.5.0", | ||
"prosemirror-tables": "^1.3.7", | ||
"shiki": "^1.4.0" | ||
"shiki": "^1.5.2" | ||
}, | ||
"devDependencies": { | ||
"@prosekit/dev": "*", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
"vitest": "^1.6.0", | ||
"@prosekit/dev": "0.0.0" | ||
}, | ||
@@ -247,2 +252,5 @@ "scripts": { | ||
], | ||
"text-align": [ | ||
"./dist/prosekit-extensions-text-align.d.ts" | ||
], | ||
"underline": [ | ||
@@ -249,0 +257,0 @@ "./dist/prosekit-extensions-underline.d.ts" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104663
60
3095
+ Added@prosekit/core@0.0.0-next-20240519080336(transitive)
+ Added@prosekit/pm@0.0.0-next-20240519080336(transitive)
- Removed@prosekit/core@0.0.0-next-20240505104851(transitive)
- Removed@prosekit/pm@0.0.0-next-20240505104851(transitive)
Updatedshiki@^1.5.2