gdpr audit implemented, email log, vollmachten, pdf delete cancel data privacy and vollmachten, removed message no id card in engergy car, and other contracts that are not telecom contracts, added insert counter for engery
This commit is contained in:
Generated
Vendored
+43
@@ -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