ablok-components 0.3.36 → 0.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.36",
4
+ "version": "0.3.37",
5
5
  "scripts": {
6
6
  "dev": "vite --host",
7
7
  "story:dev": "histoire dev",
@@ -20,6 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@popperjs/core": "^2.11.8",
23
+ "@tiptap/core": "^3.18.0",
24
+ "@tiptap/extension-bold": "^3.18.0",
23
25
  "@tiptap/extension-highlight": "^3.18.0",
24
26
  "@tiptap/extension-link": "^3.18.0",
25
27
  "@tiptap/extension-text-align": "^3.18.0",
@@ -1,94 +0,0 @@
1
- import { Mark as d, markPasteRule as r, markInputRule as n, mergeAttributes as l } from "./index-_eTitAbu.mjs";
2
- var s = (e, t) => {
3
- if (e === "slot")
4
- return 0;
5
- if (e instanceof Function)
6
- return e(t);
7
- const { children: o, ...a } = t ?? {};
8
- if (e === "svg")
9
- throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
10
- return [e, a, o];
11
- }, i = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, u = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, p = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, g = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, m = d.create({
12
- name: "bold",
13
- addOptions() {
14
- return {
15
- HTMLAttributes: {}
16
- };
17
- },
18
- parseHTML() {
19
- return [
20
- {
21
- tag: "strong"
22
- },
23
- {
24
- tag: "b",
25
- getAttrs: (e) => e.style.fontWeight !== "normal" && null
26
- },
27
- {
28
- style: "font-weight=400",
29
- clearMark: (e) => e.type.name === this.name
30
- },
31
- {
32
- style: "font-weight",
33
- getAttrs: (e) => /^(bold(er)?|[5-9]\d{2,})$/.test(e) && null
34
- }
35
- ];
36
- },
37
- renderHTML({ HTMLAttributes: e }) {
38
- return /* @__PURE__ */ s("strong", { ...l(this.options.HTMLAttributes, e), children: /* @__PURE__ */ s("slot", {}) });
39
- },
40
- markdownTokenName: "strong",
41
- parseMarkdown: (e, t) => t.applyMark("bold", t.parseInline(e.tokens || [])),
42
- markdownOptions: {
43
- htmlReopen: {
44
- open: "<strong>",
45
- close: "</strong>"
46
- }
47
- },
48
- renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
49
- addCommands() {
50
- return {
51
- setBold: () => ({ commands: e }) => e.setMark(this.name),
52
- toggleBold: () => ({ commands: e }) => e.toggleMark(this.name),
53
- unsetBold: () => ({ commands: e }) => e.unsetMark(this.name)
54
- };
55
- },
56
- addKeyboardShortcuts() {
57
- return {
58
- "Mod-b": () => this.editor.commands.toggleBold(),
59
- "Mod-B": () => this.editor.commands.toggleBold()
60
- };
61
- },
62
- addInputRules() {
63
- return [
64
- n({
65
- find: i,
66
- type: this.type
67
- }),
68
- n({
69
- find: p,
70
- type: this.type
71
- })
72
- ];
73
- },
74
- addPasteRules() {
75
- return [
76
- r({
77
- find: u,
78
- type: this.type
79
- }),
80
- r({
81
- find: g,
82
- type: this.type
83
- })
84
- ];
85
- }
86
- }), _ = m;
87
- export {
88
- m as Bold,
89
- _ as default,
90
- i as starInputRegex,
91
- u as starPasteRegex,
92
- p as underscoreInputRegex,
93
- g as underscorePasteRegex
94
- };