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:
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025, Tiptap GmbH
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
# @tiptap/extension-horizontal-rule
|
||||
|
||||
[](https://www.npmjs.com/package/@tiptap/extension-horizontal-rule)
|
||||
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
||||
[](https://www.npmjs.com/package/@tiptap/extension-horizontal-rule)
|
||||
[](https://github.com/sponsors/ueberdosis)
|
||||
|
||||
## Introduction
|
||||
|
||||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
||||
|
||||
## License
|
||||
|
||||
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
"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 index_exports = {};
|
||||
__export(index_exports, {
|
||||
HorizontalRule: () => HorizontalRule,
|
||||
default: () => index_default
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
|
||||
// src/horizontal-rule.ts
|
||||
var import_core = require("@tiptap/core");
|
||||
var import_state = require("@tiptap/pm/state");
|
||||
var HorizontalRule = import_core.Node.create({
|
||||
name: "horizontalRule",
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {},
|
||||
nextNodeType: "paragraph"
|
||||
};
|
||||
},
|
||||
group: "block",
|
||||
parseHTML() {
|
||||
return [{ tag: "hr" }];
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ["hr", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
|
||||
},
|
||||
markdownTokenName: "hr",
|
||||
parseMarkdown: (token, helpers) => {
|
||||
return helpers.createNode("horizontalRule");
|
||||
},
|
||||
renderMarkdown: () => {
|
||||
return "---";
|
||||
},
|
||||
addCommands() {
|
||||
return {
|
||||
setHorizontalRule: () => ({ chain, state }) => {
|
||||
if (!(0, import_core.canInsertNode)(state, state.schema.nodes[this.name])) {
|
||||
return false;
|
||||
}
|
||||
const { selection } = state;
|
||||
const { $to: $originTo } = selection;
|
||||
const currentChain = chain();
|
||||
if ((0, import_core.isNodeSelection)(selection)) {
|
||||
currentChain.insertContentAt($originTo.pos, {
|
||||
type: this.name
|
||||
});
|
||||
} else {
|
||||
currentChain.insertContent({ type: this.name });
|
||||
}
|
||||
return currentChain.command(({ state: chainState, tr, dispatch }) => {
|
||||
if (dispatch) {
|
||||
const { $to } = tr.selection;
|
||||
const posAfter = $to.end();
|
||||
if ($to.nodeAfter) {
|
||||
if ($to.nodeAfter.isTextblock) {
|
||||
tr.setSelection(import_state.TextSelection.create(tr.doc, $to.pos + 1));
|
||||
} else if ($to.nodeAfter.isBlock) {
|
||||
tr.setSelection(import_state.NodeSelection.create(tr.doc, $to.pos));
|
||||
} else {
|
||||
tr.setSelection(import_state.TextSelection.create(tr.doc, $to.pos));
|
||||
}
|
||||
} else {
|
||||
const nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;
|
||||
const node = nodeType == null ? void 0 : nodeType.create();
|
||||
if (node) {
|
||||
tr.insert(posAfter, node);
|
||||
tr.setSelection(import_state.TextSelection.create(tr.doc, posAfter + 1));
|
||||
}
|
||||
}
|
||||
tr.scrollIntoView();
|
||||
}
|
||||
return true;
|
||||
}).run();
|
||||
}
|
||||
};
|
||||
},
|
||||
addInputRules() {
|
||||
return [
|
||||
(0, import_core.nodeInputRule)({
|
||||
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
||||
type: this.type
|
||||
})
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var index_default = HorizontalRule;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
HorizontalRule
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
+1
File diff suppressed because one or more lines are too long
+34
@@ -0,0 +1,34 @@
|
||||
import { Node } from '@tiptap/core';
|
||||
|
||||
interface HorizontalRuleOptions {
|
||||
/**
|
||||
* The HTML attributes for a horizontal rule node.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>;
|
||||
/**
|
||||
* The default type to insert after the horizontal rule.
|
||||
* @default "paragraph"
|
||||
* @example "heading"
|
||||
*/
|
||||
nextNodeType: string;
|
||||
}
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
horizontalRule: {
|
||||
/**
|
||||
* Add a horizontal rule
|
||||
* @example editor.commands.setHorizontalRule()
|
||||
*/
|
||||
setHorizontalRule: () => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This extension allows you to insert horizontal rules.
|
||||
* @see https://www.tiptap.dev/api/nodes/horizontal-rule
|
||||
*/
|
||||
declare const HorizontalRule: Node<HorizontalRuleOptions, any>;
|
||||
|
||||
export { HorizontalRule, type HorizontalRuleOptions, HorizontalRule as default };
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { Node } from '@tiptap/core';
|
||||
|
||||
interface HorizontalRuleOptions {
|
||||
/**
|
||||
* The HTML attributes for a horizontal rule node.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>;
|
||||
/**
|
||||
* The default type to insert after the horizontal rule.
|
||||
* @default "paragraph"
|
||||
* @example "heading"
|
||||
*/
|
||||
nextNodeType: string;
|
||||
}
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
horizontalRule: {
|
||||
/**
|
||||
* Add a horizontal rule
|
||||
* @example editor.commands.setHorizontalRule()
|
||||
*/
|
||||
setHorizontalRule: () => ReturnType;
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This extension allows you to insert horizontal rules.
|
||||
* @see https://www.tiptap.dev/api/nodes/horizontal-rule
|
||||
*/
|
||||
declare const HorizontalRule: Node<HorizontalRuleOptions, any>;
|
||||
|
||||
export { HorizontalRule, type HorizontalRuleOptions, HorizontalRule as default };
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
// src/horizontal-rule.ts
|
||||
import { canInsertNode, isNodeSelection, mergeAttributes, Node, nodeInputRule } from "@tiptap/core";
|
||||
import { NodeSelection, TextSelection } from "@tiptap/pm/state";
|
||||
var HorizontalRule = Node.create({
|
||||
name: "horizontalRule",
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {},
|
||||
nextNodeType: "paragraph"
|
||||
};
|
||||
},
|
||||
group: "block",
|
||||
parseHTML() {
|
||||
return [{ tag: "hr" }];
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ["hr", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
||||
},
|
||||
markdownTokenName: "hr",
|
||||
parseMarkdown: (token, helpers) => {
|
||||
return helpers.createNode("horizontalRule");
|
||||
},
|
||||
renderMarkdown: () => {
|
||||
return "---";
|
||||
},
|
||||
addCommands() {
|
||||
return {
|
||||
setHorizontalRule: () => ({ chain, state }) => {
|
||||
if (!canInsertNode(state, state.schema.nodes[this.name])) {
|
||||
return false;
|
||||
}
|
||||
const { selection } = state;
|
||||
const { $to: $originTo } = selection;
|
||||
const currentChain = chain();
|
||||
if (isNodeSelection(selection)) {
|
||||
currentChain.insertContentAt($originTo.pos, {
|
||||
type: this.name
|
||||
});
|
||||
} else {
|
||||
currentChain.insertContent({ type: this.name });
|
||||
}
|
||||
return currentChain.command(({ state: chainState, tr, dispatch }) => {
|
||||
if (dispatch) {
|
||||
const { $to } = tr.selection;
|
||||
const posAfter = $to.end();
|
||||
if ($to.nodeAfter) {
|
||||
if ($to.nodeAfter.isTextblock) {
|
||||
tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1));
|
||||
} else if ($to.nodeAfter.isBlock) {
|
||||
tr.setSelection(NodeSelection.create(tr.doc, $to.pos));
|
||||
} else {
|
||||
tr.setSelection(TextSelection.create(tr.doc, $to.pos));
|
||||
}
|
||||
} else {
|
||||
const nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;
|
||||
const node = nodeType == null ? void 0 : nodeType.create();
|
||||
if (node) {
|
||||
tr.insert(posAfter, node);
|
||||
tr.setSelection(TextSelection.create(tr.doc, posAfter + 1));
|
||||
}
|
||||
}
|
||||
tr.scrollIntoView();
|
||||
}
|
||||
return true;
|
||||
}).run();
|
||||
}
|
||||
};
|
||||
},
|
||||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
||||
type: this.type
|
||||
})
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var index_default = HorizontalRule;
|
||||
export {
|
||||
HorizontalRule,
|
||||
index_default as default
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+50
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@tiptap/extension-horizontal-rule",
|
||||
"description": "horizontal rule extension for tiptap",
|
||||
"version": "3.19.0",
|
||||
"homepage": "https://tiptap.dev",
|
||||
"keywords": [
|
||||
"tiptap",
|
||||
"tiptap extension"
|
||||
],
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ueberdosis"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": {
|
||||
"import": "./dist/index.d.ts",
|
||||
"require": "./dist/index.d.cts"
|
||||
},
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@tiptap/core": "^3.19.0",
|
||||
"@tiptap/pm": "^3.19.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tiptap/core": "^3.19.0",
|
||||
"@tiptap/pm": "^3.19.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ueberdosis/tiptap",
|
||||
"directory": "packages/extension-horizontal-rule"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
import { canInsertNode, isNodeSelection, mergeAttributes, Node, nodeInputRule } from '@tiptap/core'
|
||||
import { NodeSelection, TextSelection } from '@tiptap/pm/state'
|
||||
|
||||
export interface HorizontalRuleOptions {
|
||||
/**
|
||||
* The HTML attributes for a horizontal rule node.
|
||||
* @default {}
|
||||
* @example { class: 'foo' }
|
||||
*/
|
||||
HTMLAttributes: Record<string, any>
|
||||
/**
|
||||
* The default type to insert after the horizontal rule.
|
||||
* @default "paragraph"
|
||||
* @example "heading"
|
||||
*/
|
||||
nextNodeType: string
|
||||
}
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
horizontalRule: {
|
||||
/**
|
||||
* Add a horizontal rule
|
||||
* @example editor.commands.setHorizontalRule()
|
||||
*/
|
||||
setHorizontalRule: () => ReturnType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This extension allows you to insert horizontal rules.
|
||||
* @see https://www.tiptap.dev/api/nodes/horizontal-rule
|
||||
*/
|
||||
export const HorizontalRule = Node.create<HorizontalRuleOptions>({
|
||||
name: 'horizontalRule',
|
||||
|
||||
addOptions() {
|
||||
return {
|
||||
HTMLAttributes: {},
|
||||
nextNodeType: 'paragraph',
|
||||
}
|
||||
},
|
||||
|
||||
group: 'block',
|
||||
|
||||
parseHTML() {
|
||||
return [{ tag: 'hr' }]
|
||||
},
|
||||
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ['hr', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]
|
||||
},
|
||||
|
||||
markdownTokenName: 'hr',
|
||||
|
||||
parseMarkdown: (token, helpers) => {
|
||||
return helpers.createNode('horizontalRule')
|
||||
},
|
||||
|
||||
renderMarkdown: () => {
|
||||
return '---'
|
||||
},
|
||||
|
||||
addCommands() {
|
||||
return {
|
||||
setHorizontalRule:
|
||||
() =>
|
||||
({ chain, state }) => {
|
||||
// Check if we can insert the node at the current selection
|
||||
if (!canInsertNode(state, state.schema.nodes[this.name])) {
|
||||
return false
|
||||
}
|
||||
|
||||
const { selection } = state
|
||||
const { $to: $originTo } = selection
|
||||
|
||||
const currentChain = chain()
|
||||
|
||||
if (isNodeSelection(selection)) {
|
||||
currentChain.insertContentAt($originTo.pos, {
|
||||
type: this.name,
|
||||
})
|
||||
} else {
|
||||
currentChain.insertContent({ type: this.name })
|
||||
}
|
||||
|
||||
return (
|
||||
currentChain
|
||||
// set cursor after horizontal rule
|
||||
.command(({ state: chainState, tr, dispatch }) => {
|
||||
if (dispatch) {
|
||||
const { $to } = tr.selection
|
||||
const posAfter = $to.end()
|
||||
|
||||
if ($to.nodeAfter) {
|
||||
if ($to.nodeAfter.isTextblock) {
|
||||
tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1))
|
||||
} else if ($to.nodeAfter.isBlock) {
|
||||
tr.setSelection(NodeSelection.create(tr.doc, $to.pos))
|
||||
} else {
|
||||
tr.setSelection(TextSelection.create(tr.doc, $to.pos))
|
||||
}
|
||||
} else {
|
||||
// add node after horizontal rule if it’s the end of the document
|
||||
const nodeType =
|
||||
chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType
|
||||
const node = nodeType?.create()
|
||||
|
||||
if (node) {
|
||||
tr.insert(posAfter, node)
|
||||
tr.setSelection(TextSelection.create(tr.doc, posAfter + 1))
|
||||
}
|
||||
}
|
||||
|
||||
tr.scrollIntoView()
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
.run()
|
||||
)
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
||||
type: this.type,
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { HorizontalRule } from './horizontal-rule.js'
|
||||
|
||||
export * from './horizontal-rule.js'
|
||||
|
||||
export default HorizontalRule
|
||||
Reference in New Issue
Block a user