ablok-components 0.3.35 → 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.
@@ -1,88 +0,0 @@
1
- import { Mark as d, markPasteRule as r, markInputRule as n, mergeAttributes as l } from "./index-BIlA-HIk.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: a, ...o } = 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, o, a];
11
- }, u = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, i = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, p = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, g = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, h = 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
- renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
43
- addCommands() {
44
- return {
45
- setBold: () => ({ commands: e }) => e.setMark(this.name),
46
- toggleBold: () => ({ commands: e }) => e.toggleMark(this.name),
47
- unsetBold: () => ({ commands: e }) => e.unsetMark(this.name)
48
- };
49
- },
50
- addKeyboardShortcuts() {
51
- return {
52
- "Mod-b": () => this.editor.commands.toggleBold(),
53
- "Mod-B": () => this.editor.commands.toggleBold()
54
- };
55
- },
56
- addInputRules() {
57
- return [
58
- n({
59
- find: u,
60
- type: this.type
61
- }),
62
- n({
63
- find: p,
64
- type: this.type
65
- })
66
- ];
67
- },
68
- addPasteRules() {
69
- return [
70
- r({
71
- find: i,
72
- type: this.type
73
- }),
74
- r({
75
- find: g,
76
- type: this.type
77
- })
78
- ];
79
- }
80
- }), _ = h;
81
- export {
82
- h as Bold,
83
- _ as default,
84
- u as starInputRegex,
85
- i as starPasteRegex,
86
- p as underscoreInputRegex,
87
- g as underscorePasteRegex
88
- };