fix: resolve TypeScript errors in frontend build
This commit is contained in:
41
node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.cts
generated
vendored
Normal file
41
node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.cts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Plugin as Plugin_2 } from 'prosemirror-state';
|
||||
|
||||
/**
|
||||
* This creates the plugin for trailing node.
|
||||
*
|
||||
* ```ts
|
||||
* import { schema } from 'prosemirror-schema-basic';
|
||||
* import { trailingNode } from 'prosemirror-trailing-node';
|
||||
*
|
||||
* // Include the plugin in the created editor state.
|
||||
* const state = EditorState.create({
|
||||
* schema,
|
||||
* plugins: [trailingNode({ ignoredNodes: [], nodeName: 'paragraph' })],
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param options - the options that can be provided to this plugin.
|
||||
*/
|
||||
declare function trailingNode(options?: TrailingNodePluginOptions): Plugin_2<boolean>;
|
||||
export { trailingNode }
|
||||
export { trailingNode as trailingNode_alias_1 }
|
||||
|
||||
declare interface TrailingNodePluginOptions {
|
||||
/**
|
||||
* The node to create at the end of the document.
|
||||
*
|
||||
* **Note**: the nodeName will always be added to the `ignoredNodes` lists to
|
||||
* prevent an infinite loop.
|
||||
*
|
||||
* @defaultValue 'paragraph'
|
||||
*/
|
||||
nodeName?: string;
|
||||
/**
|
||||
* The nodes for which this rule should not apply.
|
||||
*/
|
||||
ignoredNodes?: string[];
|
||||
}
|
||||
export { TrailingNodePluginOptions }
|
||||
export { TrailingNodePluginOptions as TrailingNodePluginOptions_alias_1 }
|
||||
|
||||
export { }
|
||||
41
node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.ts
generated
vendored
Normal file
41
node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Plugin as Plugin_2 } from 'prosemirror-state';
|
||||
|
||||
/**
|
||||
* This creates the plugin for trailing node.
|
||||
*
|
||||
* ```ts
|
||||
* import { schema } from 'prosemirror-schema-basic';
|
||||
* import { trailingNode } from 'prosemirror-trailing-node';
|
||||
*
|
||||
* // Include the plugin in the created editor state.
|
||||
* const state = EditorState.create({
|
||||
* schema,
|
||||
* plugins: [trailingNode({ ignoredNodes: [], nodeName: 'paragraph' })],
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param options - the options that can be provided to this plugin.
|
||||
*/
|
||||
declare function trailingNode(options?: TrailingNodePluginOptions): Plugin_2<boolean>;
|
||||
export { trailingNode }
|
||||
export { trailingNode as trailingNode_alias_1 }
|
||||
|
||||
declare interface TrailingNodePluginOptions {
|
||||
/**
|
||||
* The node to create at the end of the document.
|
||||
*
|
||||
* **Note**: the nodeName will always be added to the `ignoredNodes` lists to
|
||||
* prevent an infinite loop.
|
||||
*
|
||||
* @defaultValue 'paragraph'
|
||||
*/
|
||||
nodeName?: string;
|
||||
/**
|
||||
* The nodes for which this rule should not apply.
|
||||
*/
|
||||
ignoredNodes?: string[];
|
||||
}
|
||||
export { TrailingNodePluginOptions }
|
||||
export { TrailingNodePluginOptions as TrailingNodePluginOptions_alias_1 }
|
||||
|
||||
export { }
|
||||
70
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.cjs
generated
vendored
Normal file
70
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.cjs
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
trailingNode: () => trailingNode
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// src/trailing-node-plugin.ts
|
||||
var import_prosemirror_state = require("prosemirror-state");
|
||||
var trailingNodePluginKey = new import_prosemirror_state.PluginKey("trailingNode");
|
||||
function trailingNode(options) {
|
||||
const { ignoredNodes = [], nodeName = "paragraph" } = options != null ? options : {};
|
||||
const ignoredNodeNames = /* @__PURE__ */ new Set([...ignoredNodes, nodeName]);
|
||||
let type;
|
||||
let types;
|
||||
return new import_prosemirror_state.Plugin({
|
||||
key: trailingNodePluginKey,
|
||||
appendTransaction(_, __, state) {
|
||||
const { doc, tr } = state;
|
||||
const shouldInsertNodeAtEnd = trailingNodePluginKey.getState(state);
|
||||
const endPosition = doc.content.size;
|
||||
if (!shouldInsertNodeAtEnd) {
|
||||
return;
|
||||
}
|
||||
return tr.insert(endPosition, type.create());
|
||||
},
|
||||
state: {
|
||||
init: (_, { doc, schema }) => {
|
||||
var _a;
|
||||
const nodeType = schema.nodes[nodeName];
|
||||
if (!nodeType) {
|
||||
throw new Error("Invalid node being used for trailing node extension: '".concat(nodeName, "'"));
|
||||
}
|
||||
type = nodeType;
|
||||
types = Object.values(schema.nodes).map((node) => node).filter((node) => !ignoredNodeNames.has(node.name));
|
||||
return types.includes((_a = doc.lastChild) == null ? void 0 : _a.type);
|
||||
},
|
||||
apply: (tr, value) => {
|
||||
var _a;
|
||||
if (!tr.docChanged) {
|
||||
return value;
|
||||
}
|
||||
return types.includes((_a = tr.doc.lastChild) == null ? void 0 : _a.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
trailingNode
|
||||
});
|
||||
2
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.cts
generated
vendored
Normal file
2
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.cts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { TrailingNodePluginOptions } from './_tsup-dts-rollup';
|
||||
export { trailingNode } from './_tsup-dts-rollup';
|
||||
2
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.ts
generated
vendored
Normal file
2
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { TrailingNodePluginOptions } from './_tsup-dts-rollup';
|
||||
export { trailingNode } from './_tsup-dts-rollup';
|
||||
43
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.js
generated
vendored
Normal file
43
node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
// src/trailing-node-plugin.ts
|
||||
import { Plugin, PluginKey } from "prosemirror-state";
|
||||
var trailingNodePluginKey = new PluginKey("trailingNode");
|
||||
function trailingNode(options) {
|
||||
const { ignoredNodes = [], nodeName = "paragraph" } = options != null ? options : {};
|
||||
const ignoredNodeNames = /* @__PURE__ */ new Set([...ignoredNodes, nodeName]);
|
||||
let type;
|
||||
let types;
|
||||
return new Plugin({
|
||||
key: trailingNodePluginKey,
|
||||
appendTransaction(_, __, state) {
|
||||
const { doc, tr } = state;
|
||||
const shouldInsertNodeAtEnd = trailingNodePluginKey.getState(state);
|
||||
const endPosition = doc.content.size;
|
||||
if (!shouldInsertNodeAtEnd) {
|
||||
return;
|
||||
}
|
||||
return tr.insert(endPosition, type.create());
|
||||
},
|
||||
state: {
|
||||
init: (_, { doc, schema }) => {
|
||||
var _a;
|
||||
const nodeType = schema.nodes[nodeName];
|
||||
if (!nodeType) {
|
||||
throw new Error("Invalid node being used for trailing node extension: '".concat(nodeName, "'"));
|
||||
}
|
||||
type = nodeType;
|
||||
types = Object.values(schema.nodes).map((node) => node).filter((node) => !ignoredNodeNames.has(node.name));
|
||||
return types.includes((_a = doc.lastChild) == null ? void 0 : _a.type);
|
||||
},
|
||||
apply: (tr, value) => {
|
||||
var _a;
|
||||
if (!tr.docChanged) {
|
||||
return value;
|
||||
}
|
||||
return types.includes((_a = tr.doc.lastChild) == null ? void 0 : _a.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
export {
|
||||
trailingNode
|
||||
};
|
||||
Reference in New Issue
Block a user