@tiptap/extension-bold
Advanced tools
+136
| "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, { | ||
| Bold: () => Bold, | ||
| default: () => index_default, | ||
| starInputRegex: () => starInputRegex, | ||
| starPasteRegex: () => starPasteRegex, | ||
| underscoreInputRegex: () => underscoreInputRegex, | ||
| underscorePasteRegex: () => underscorePasteRegex | ||
| }); | ||
| module.exports = __toCommonJS(index_exports); | ||
| // src/bold.tsx | ||
| var import_core = require("@tiptap/core"); | ||
| var import_jsx_runtime = require("@tiptap/core/jsx-runtime"); | ||
| var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/; | ||
| var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g; | ||
| var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/; | ||
| var underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g; | ||
| var Bold = import_core.Mark.create({ | ||
| name: "bold", | ||
| addOptions() { | ||
| return { | ||
| HTMLAttributes: {} | ||
| }; | ||
| }, | ||
| parseHTML() { | ||
| return [ | ||
| { | ||
| tag: "strong" | ||
| }, | ||
| { | ||
| tag: "b", | ||
| getAttrs: (node) => node.style.fontWeight !== "normal" && null | ||
| }, | ||
| { | ||
| style: "font-weight=400", | ||
| clearMark: (mark) => mark.type.name === this.name | ||
| }, | ||
| { | ||
| style: "font-weight", | ||
| getAttrs: (value) => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null | ||
| } | ||
| ]; | ||
| }, | ||
| renderHTML({ HTMLAttributes }) { | ||
| return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { ...(0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("slot", {}) }); | ||
| }, | ||
| markdownTokenName: "strong", | ||
| parseMarkdown: (token, helpers) => { | ||
| return helpers.applyMark("bold", helpers.parseInline(token.tokens || [])); | ||
| }, | ||
| markdownOptions: { | ||
| htmlReopen: { | ||
| open: "<strong>", | ||
| close: "</strong>" | ||
| } | ||
| }, | ||
| renderMarkdown: (node, h) => { | ||
| return `**${h.renderChildren(node)}**`; | ||
| }, | ||
| addCommands() { | ||
| return { | ||
| setBold: () => ({ commands }) => { | ||
| return commands.setMark(this.name); | ||
| }, | ||
| toggleBold: () => ({ commands }) => { | ||
| return commands.toggleMark(this.name); | ||
| }, | ||
| unsetBold: () => ({ commands }) => { | ||
| return commands.unsetMark(this.name); | ||
| } | ||
| }; | ||
| }, | ||
| addKeyboardShortcuts() { | ||
| return { | ||
| "Mod-b": () => this.editor.commands.toggleBold(), | ||
| "Mod-B": () => this.editor.commands.toggleBold() | ||
| }; | ||
| }, | ||
| addInputRules() { | ||
| return [ | ||
| (0, import_core.markInputRule)({ | ||
| find: starInputRegex, | ||
| type: this.type | ||
| }), | ||
| (0, import_core.markInputRule)({ | ||
| find: underscoreInputRegex, | ||
| type: this.type | ||
| }) | ||
| ]; | ||
| }, | ||
| addPasteRules() { | ||
| return [ | ||
| (0, import_core.markPasteRule)({ | ||
| find: starPasteRegex, | ||
| type: this.type | ||
| }), | ||
| (0, import_core.markPasteRule)({ | ||
| find: underscorePasteRegex, | ||
| type: this.type | ||
| }) | ||
| ]; | ||
| } | ||
| }); | ||
| // src/index.ts | ||
| var index_default = Bold; | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| Bold, | ||
| starInputRegex, | ||
| starPasteRegex, | ||
| underscoreInputRegex, | ||
| underscorePasteRegex | ||
| }); | ||
| //# sourceMappingURL=index.cjs.map |
| {"version":3,"sources":["../src/index.ts","../src/bold.tsx"],"sourcesContent":["import { Bold } from './bold.jsx'\n\nexport * from './bold.jsx'\n\nexport default Bold\n","/** @jsxImportSource @tiptap/core */\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from '@tiptap/core'\n\nexport interface BoldOptions {\n /**\n * HTML attributes to add to the bold element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n bold: {\n /**\n * Set a bold mark\n */\n setBold: () => ReturnType\n /**\n * Toggle a bold mark\n */\n toggleBold: () => ReturnType\n /**\n * Unset a bold mark\n */\n unsetBold: () => ReturnType\n }\n }\n}\n\n/**\n * Matches bold text via `**` as input.\n */\nexport const starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/\n\n/**\n * Matches bold text via `**` while pasting.\n */\nexport const starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g\n\n/**\n * Matches bold text via `__` as input.\n */\nexport const underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/\n\n/**\n * Matches bold text via `__` while pasting.\n */\nexport const underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g\n\n/**\n * This extension allows you to mark text as bold.\n * @see https://tiptap.dev/api/marks/bold\n */\nexport const Bold = Mark.create<BoldOptions>({\n name: 'bold',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'strong',\n },\n {\n tag: 'b',\n getAttrs: node => (node as HTMLElement).style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight=400',\n clearMark: mark => mark.type.name === this.name,\n },\n {\n style: 'font-weight',\n getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value as string) && null,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return (\n <strong {...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)}>\n <slot />\n </strong>\n )\n },\n\n markdownTokenName: 'strong',\n\n parseMarkdown: (token, helpers) => {\n // Convert 'strong' token to bold mark\n return helpers.applyMark('bold', helpers.parseInline(token.tokens || []))\n },\n\n markdownOptions: {\n htmlReopen: {\n open: '<strong>',\n close: '</strong>',\n },\n },\n\n renderMarkdown: (node, h) => {\n return `**${h.renderChildren(node)}**`\n },\n\n addCommands() {\n return {\n setBold:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleBold:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetBold:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-b': () => this.editor.commands.toggleBold(),\n 'Mod-B': () => this.editor.commands.toggleBold(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type,\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type,\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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ACF,YACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,IAAI;AAAA,MACtC;AAAA,MACF,WACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,UAAU,KAAK,IAAI;AAAA,MACrC;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,SAAS,MAAM,KAAK,OAAO,SAAS,WAAW;AAAA,MAC/C,SAAS,MAAM,KAAK,OAAO,SAAS,WAAW;AAAA,IACjD;AAAA,EACF;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,UACL,2BAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,MACb,CAAC;AAAA,UACD,2BAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,MACb,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,UACL,2BAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,MACb,CAAC;AAAA,UACD,2BAAc;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,KAAK;AAAA,MACb,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;;;AD9JD,IAAO,gBAAQ;","names":[]} |
| import { Mark } from '@tiptap/core'; | ||
| /** @jsxImportSource @tiptap/core */ | ||
| interface BoldOptions { | ||
| /** | ||
| * HTML attributes to add to the bold element. | ||
| * @default {} | ||
| * @example { class: 'foo' } | ||
| */ | ||
| HTMLAttributes: Record<string, any>; | ||
| } | ||
| declare module '@tiptap/core' { | ||
| interface Commands<ReturnType> { | ||
| bold: { | ||
| /** | ||
| * Set a bold mark | ||
| */ | ||
| setBold: () => ReturnType; | ||
| /** | ||
| * Toggle a bold mark | ||
| */ | ||
| toggleBold: () => ReturnType; | ||
| /** | ||
| * Unset a bold mark | ||
| */ | ||
| unsetBold: () => ReturnType; | ||
| }; | ||
| } | ||
| } | ||
| /** | ||
| * Matches bold text via `**` as input. | ||
| */ | ||
| declare const starInputRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `**` while pasting. | ||
| */ | ||
| declare const starPasteRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `__` as input. | ||
| */ | ||
| declare const underscoreInputRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `__` while pasting. | ||
| */ | ||
| declare const underscorePasteRegex: RegExp; | ||
| /** | ||
| * This extension allows you to mark text as bold. | ||
| * @see https://tiptap.dev/api/marks/bold | ||
| */ | ||
| declare const Bold: Mark<BoldOptions, any>; | ||
| export { Bold, type BoldOptions, Bold as default, starInputRegex, starPasteRegex, underscoreInputRegex, underscorePasteRegex }; |
| import { Mark } from '@tiptap/core'; | ||
| /** @jsxImportSource @tiptap/core */ | ||
| interface BoldOptions { | ||
| /** | ||
| * HTML attributes to add to the bold element. | ||
| * @default {} | ||
| * @example { class: 'foo' } | ||
| */ | ||
| HTMLAttributes: Record<string, any>; | ||
| } | ||
| declare module '@tiptap/core' { | ||
| interface Commands<ReturnType> { | ||
| bold: { | ||
| /** | ||
| * Set a bold mark | ||
| */ | ||
| setBold: () => ReturnType; | ||
| /** | ||
| * Toggle a bold mark | ||
| */ | ||
| toggleBold: () => ReturnType; | ||
| /** | ||
| * Unset a bold mark | ||
| */ | ||
| unsetBold: () => ReturnType; | ||
| }; | ||
| } | ||
| } | ||
| /** | ||
| * Matches bold text via `**` as input. | ||
| */ | ||
| declare const starInputRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `**` while pasting. | ||
| */ | ||
| declare const starPasteRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `__` as input. | ||
| */ | ||
| declare const underscoreInputRegex: RegExp; | ||
| /** | ||
| * Matches bold text via `__` while pasting. | ||
| */ | ||
| declare const underscorePasteRegex: RegExp; | ||
| /** | ||
| * This extension allows you to mark text as bold. | ||
| * @see https://tiptap.dev/api/marks/bold | ||
| */ | ||
| declare const Bold: Mark<BoldOptions, any>; | ||
| export { Bold, type BoldOptions, Bold as default, starInputRegex, starPasteRegex, underscoreInputRegex, underscorePasteRegex }; |
+105
| // src/bold.tsx | ||
| import { Mark, markInputRule, markPasteRule, mergeAttributes } from "@tiptap/core"; | ||
| import { jsx } from "@tiptap/core/jsx-runtime"; | ||
| var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/; | ||
| var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g; | ||
| var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/; | ||
| var underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g; | ||
| var Bold = Mark.create({ | ||
| name: "bold", | ||
| addOptions() { | ||
| return { | ||
| HTMLAttributes: {} | ||
| }; | ||
| }, | ||
| parseHTML() { | ||
| return [ | ||
| { | ||
| tag: "strong" | ||
| }, | ||
| { | ||
| tag: "b", | ||
| getAttrs: (node) => node.style.fontWeight !== "normal" && null | ||
| }, | ||
| { | ||
| style: "font-weight=400", | ||
| clearMark: (mark) => mark.type.name === this.name | ||
| }, | ||
| { | ||
| style: "font-weight", | ||
| getAttrs: (value) => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null | ||
| } | ||
| ]; | ||
| }, | ||
| renderHTML({ HTMLAttributes }) { | ||
| return /* @__PURE__ */ jsx("strong", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx("slot", {}) }); | ||
| }, | ||
| markdownTokenName: "strong", | ||
| parseMarkdown: (token, helpers) => { | ||
| return helpers.applyMark("bold", helpers.parseInline(token.tokens || [])); | ||
| }, | ||
| markdownOptions: { | ||
| htmlReopen: { | ||
| open: "<strong>", | ||
| close: "</strong>" | ||
| } | ||
| }, | ||
| renderMarkdown: (node, h) => { | ||
| return `**${h.renderChildren(node)}**`; | ||
| }, | ||
| addCommands() { | ||
| return { | ||
| setBold: () => ({ commands }) => { | ||
| return commands.setMark(this.name); | ||
| }, | ||
| toggleBold: () => ({ commands }) => { | ||
| return commands.toggleMark(this.name); | ||
| }, | ||
| unsetBold: () => ({ commands }) => { | ||
| return commands.unsetMark(this.name); | ||
| } | ||
| }; | ||
| }, | ||
| addKeyboardShortcuts() { | ||
| return { | ||
| "Mod-b": () => this.editor.commands.toggleBold(), | ||
| "Mod-B": () => this.editor.commands.toggleBold() | ||
| }; | ||
| }, | ||
| addInputRules() { | ||
| return [ | ||
| markInputRule({ | ||
| find: starInputRegex, | ||
| type: this.type | ||
| }), | ||
| markInputRule({ | ||
| find: underscoreInputRegex, | ||
| type: this.type | ||
| }) | ||
| ]; | ||
| }, | ||
| addPasteRules() { | ||
| return [ | ||
| markPasteRule({ | ||
| find: starPasteRegex, | ||
| type: this.type | ||
| }), | ||
| markPasteRule({ | ||
| find: underscorePasteRegex, | ||
| type: this.type | ||
| }) | ||
| ]; | ||
| } | ||
| }); | ||
| // src/index.ts | ||
| var index_default = Bold; | ||
| export { | ||
| Bold, | ||
| index_default as default, | ||
| starInputRegex, | ||
| starPasteRegex, | ||
| underscoreInputRegex, | ||
| underscorePasteRegex | ||
| }; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"sources":["../src/bold.tsx","../src/index.ts"],"sourcesContent":["/** @jsxImportSource @tiptap/core */\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from '@tiptap/core'\n\nexport interface BoldOptions {\n /**\n * HTML attributes to add to the bold element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n bold: {\n /**\n * Set a bold mark\n */\n setBold: () => ReturnType\n /**\n * Toggle a bold mark\n */\n toggleBold: () => ReturnType\n /**\n * Unset a bold mark\n */\n unsetBold: () => ReturnType\n }\n }\n}\n\n/**\n * Matches bold text via `**` as input.\n */\nexport const starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/\n\n/**\n * Matches bold text via `**` while pasting.\n */\nexport const starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g\n\n/**\n * Matches bold text via `__` as input.\n */\nexport const underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/\n\n/**\n * Matches bold text via `__` while pasting.\n */\nexport const underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g\n\n/**\n * This extension allows you to mark text as bold.\n * @see https://tiptap.dev/api/marks/bold\n */\nexport const Bold = Mark.create<BoldOptions>({\n name: 'bold',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'strong',\n },\n {\n tag: 'b',\n getAttrs: node => (node as HTMLElement).style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight=400',\n clearMark: mark => mark.type.name === this.name,\n },\n {\n style: 'font-weight',\n getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value as string) && null,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return (\n <strong {...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)}>\n <slot />\n </strong>\n )\n },\n\n markdownTokenName: 'strong',\n\n parseMarkdown: (token, helpers) => {\n // Convert 'strong' token to bold mark\n return helpers.applyMark('bold', helpers.parseInline(token.tokens || []))\n },\n\n markdownOptions: {\n htmlReopen: {\n open: '<strong>',\n close: '</strong>',\n },\n },\n\n renderMarkdown: (node, h) => {\n return `**${h.renderChildren(node)}**`\n },\n\n addCommands() {\n return {\n setBold:\n () =>\n ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleBold:\n () =>\n ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetBold:\n () =>\n ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-b': () => this.editor.commands.toggleBold(),\n 'Mod-B': () => this.editor.commands.toggleBold(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type,\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type,\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import { Bold } from './bold.jsx'\n\nexport * from './bold.jsx'\n\nexport default Bold\n"],"mappings":";AACA,SAAS,MAAM,eAAe,eAAe,uBAAuB;AAsF5D;AArDD,IAAM,iBAAiB;AAKvB,IAAM,iBAAiB;AAKvB,IAAM,uBAAuB;AAK7B,IAAM,uBAAuB;AAM7B,IAAM,OAAO,KAAK,OAAoB;AAAA,EAC3C,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,UAAU,UAAS,KAAqB,MAAM,eAAe,YAAY;AAAA,MAC3E;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,WAAW,UAAQ,KAAK,KAAK,SAAS,KAAK;AAAA,MAC7C;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,UAAU,WAAS,4BAA4B,KAAK,KAAe,KAAK;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WACE,oBAAC,YAAQ,GAAG,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,GACrE,8BAAC,UAAK,GACR;AAAA,EAEJ;AAAA,EAEA,mBAAmB;AAAA,EAEnB,eAAe,CAAC,OAAO,YAAY;AAEjC,WAAO,QAAQ,UAAU,Q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for tiptap", | ||
| "version": "3.20.3", | ||
| "version": "3.20.4", | ||
| "homepage": "https://tiptap.dev", | ||
@@ -34,6 +34,6 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@tiptap/core": "^3.20.3" | ||
| "@tiptap/core": "^3.20.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "@tiptap/core": "^3.20.3" | ||
| "@tiptap/core": "^3.20.4" | ||
| }, | ||
@@ -40,0 +40,0 @@ "repository": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27110
305.84%11
120%433
192.57%