markdown-wysiwyg-editor 0.2.6 → 0.2.8
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/dist/index.js +119 -38
- package/dist/index.js.map +7 -7
- package/package.json +6 -21
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`);
|
|
|
1560
1560
|
// src/components/MarkdownEditor.tsx
|
|
1561
1561
|
import React8, { useState as useState15, useCallback as useCallback4, useEffect as useEffect14 } from "react";
|
|
1562
1562
|
|
|
1563
|
-
// node_modules/.bun/@tiptap+react@3.
|
|
1563
|
+
// node_modules/.bun/@tiptap+react@3.15.3+2bbf2f46acd5f4b8/node_modules/@tiptap/react/dist/index.js
|
|
1564
1564
|
var import_shim = __toESM(require_shim(), 1);
|
|
1565
1565
|
import { createContext, useContext, useMemo } from "react";
|
|
1566
1566
|
import React3, { forwardRef } from "react";
|
|
@@ -12081,7 +12081,7 @@ function keydownHandler(bindings) {
|
|
|
12081
12081
|
return false;
|
|
12082
12082
|
};
|
|
12083
12083
|
}
|
|
12084
|
-
// node_modules/.bun/@tiptap+core@3.
|
|
12084
|
+
// node_modules/.bun/@tiptap+core@3.15.3+2552a9caaf6753d4/node_modules/@tiptap/core/dist/index.js
|
|
12085
12085
|
var __defProp2 = Object.defineProperty;
|
|
12086
12086
|
var __export = (target, all) => {
|
|
12087
12087
|
for (var name in all)
|
|
@@ -12519,6 +12519,9 @@ function isAndroid() {
|
|
|
12519
12519
|
function isiOS() {
|
|
12520
12520
|
return ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
12521
12521
|
}
|
|
12522
|
+
function isSafari() {
|
|
12523
|
+
return typeof navigator !== "undefined" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : false;
|
|
12524
|
+
}
|
|
12522
12525
|
var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch }) => {
|
|
12523
12526
|
options = {
|
|
12524
12527
|
scrollIntoView: true,
|
|
@@ -12528,6 +12531,9 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
|
|
|
12528
12531
|
if (isiOS() || isAndroid()) {
|
|
12529
12532
|
view.dom.focus();
|
|
12530
12533
|
}
|
|
12534
|
+
if (isSafari() && !isiOS() && !isAndroid()) {
|
|
12535
|
+
view.dom.focus({ preventScroll: true });
|
|
12536
|
+
}
|
|
12531
12537
|
requestAnimationFrame(() => {
|
|
12532
12538
|
if (!editor.isDestroyed) {
|
|
12533
12539
|
view.focus();
|
|
@@ -15095,6 +15101,26 @@ var ExtensionManager = class {
|
|
|
15095
15101
|
return [extension.name, nodeview];
|
|
15096
15102
|
}));
|
|
15097
15103
|
}
|
|
15104
|
+
dispatchTransaction(baseDispatch) {
|
|
15105
|
+
const { editor } = this;
|
|
15106
|
+
const extensions = sortExtensions([...this.extensions].reverse());
|
|
15107
|
+
return extensions.reduceRight((next, extension) => {
|
|
15108
|
+
const context = {
|
|
15109
|
+
name: extension.name,
|
|
15110
|
+
options: extension.options,
|
|
15111
|
+
storage: this.editor.extensionStorage[extension.name],
|
|
15112
|
+
editor,
|
|
15113
|
+
type: getSchemaTypeByName(extension.name, this.schema)
|
|
15114
|
+
};
|
|
15115
|
+
const dispatchTransaction = getExtensionField(extension, "dispatchTransaction", context);
|
|
15116
|
+
if (!dispatchTransaction) {
|
|
15117
|
+
return next;
|
|
15118
|
+
}
|
|
15119
|
+
return (transaction) => {
|
|
15120
|
+
dispatchTransaction.call(context, { transaction, next });
|
|
15121
|
+
};
|
|
15122
|
+
}, baseDispatch);
|
|
15123
|
+
}
|
|
15098
15124
|
get markViews() {
|
|
15099
15125
|
const { editor } = this;
|
|
15100
15126
|
const { markExtensions } = splitExtensions(this.extensions);
|
|
@@ -15883,7 +15909,8 @@ var Editor = class extends EventEmitter {
|
|
|
15883
15909
|
},
|
|
15884
15910
|
onPaste: () => null,
|
|
15885
15911
|
onDrop: () => null,
|
|
15886
|
-
onDelete: () => null
|
|
15912
|
+
onDelete: () => null,
|
|
15913
|
+
enableExtensionDispatchTransaction: true
|
|
15887
15914
|
};
|
|
15888
15915
|
this.isCapturingTransaction = false;
|
|
15889
15916
|
this.capturedTransaction = null;
|
|
@@ -16130,14 +16157,16 @@ var Editor = class extends EventEmitter {
|
|
|
16130
16157
|
return doc3;
|
|
16131
16158
|
}
|
|
16132
16159
|
createView(element) {
|
|
16133
|
-
|
|
16160
|
+
const { editorProps, enableExtensionDispatchTransaction } = this.options;
|
|
16161
|
+
const baseDispatch = editorProps.dispatchTransaction || this.dispatchTransaction.bind(this);
|
|
16162
|
+
const dispatch = enableExtensionDispatchTransaction ? this.extensionManager.dispatchTransaction(baseDispatch) : baseDispatch;
|
|
16134
16163
|
this.editorView = new EditorView(element, {
|
|
16135
|
-
...
|
|
16164
|
+
...editorProps,
|
|
16136
16165
|
attributes: {
|
|
16137
16166
|
role: "textbox",
|
|
16138
|
-
...
|
|
16167
|
+
...editorProps == null ? undefined : editorProps.attributes
|
|
16139
16168
|
},
|
|
16140
|
-
dispatchTransaction:
|
|
16169
|
+
dispatchTransaction: dispatch,
|
|
16141
16170
|
state: this.editorState,
|
|
16142
16171
|
markViews: this.extensionManager.markViews,
|
|
16143
16172
|
nodeViews: this.extensionManager.nodeViews
|
|
@@ -17590,7 +17619,7 @@ function markPasteRule(config) {
|
|
|
17590
17619
|
});
|
|
17591
17620
|
}
|
|
17592
17621
|
|
|
17593
|
-
// node_modules/.bun/@tiptap+react@3.
|
|
17622
|
+
// node_modules/.bun/@tiptap+react@3.15.3+2bbf2f46acd5f4b8/node_modules/@tiptap/react/dist/index.js
|
|
17594
17623
|
var import_shim2 = __toESM(require_shim(), 1);
|
|
17595
17624
|
import { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
17596
17625
|
|
|
@@ -18029,7 +18058,7 @@ function createCustomEqual(options = {}) {
|
|
|
18029
18058
|
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
18030
18059
|
}
|
|
18031
18060
|
|
|
18032
|
-
// node_modules/.bun/@tiptap+react@3.
|
|
18061
|
+
// node_modules/.bun/@tiptap+react@3.15.3+2bbf2f46acd5f4b8/node_modules/@tiptap/react/dist/index.js
|
|
18033
18062
|
var import_with_selector = __toESM(require_with_selector(), 1);
|
|
18034
18063
|
import { useDebugValue, useEffect, useLayoutEffect, useState } from "react";
|
|
18035
18064
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -18540,6 +18569,7 @@ function isReact19Plus() {
|
|
|
18540
18569
|
var ReactRenderer = class {
|
|
18541
18570
|
constructor(component, { editor, props = {}, as = "div", className = "" }) {
|
|
18542
18571
|
this.ref = null;
|
|
18572
|
+
this.destroyed = false;
|
|
18543
18573
|
this.id = Math.floor(Math.random() * 4294967295).toString();
|
|
18544
18574
|
this.component = component;
|
|
18545
18575
|
this.editor = editor;
|
|
@@ -18555,12 +18585,18 @@ var ReactRenderer = class {
|
|
|
18555
18585
|
});
|
|
18556
18586
|
} else {
|
|
18557
18587
|
queueMicrotask(() => {
|
|
18588
|
+
if (this.destroyed) {
|
|
18589
|
+
return;
|
|
18590
|
+
}
|
|
18558
18591
|
this.render();
|
|
18559
18592
|
});
|
|
18560
18593
|
}
|
|
18561
18594
|
}
|
|
18562
18595
|
render() {
|
|
18563
18596
|
var _a;
|
|
18597
|
+
if (this.destroyed) {
|
|
18598
|
+
return;
|
|
18599
|
+
}
|
|
18564
18600
|
const Component = this.component;
|
|
18565
18601
|
const props = this.props;
|
|
18566
18602
|
const editor = this.editor;
|
|
@@ -18579,6 +18615,9 @@ var ReactRenderer = class {
|
|
|
18579
18615
|
(_a = editor == null ? undefined : editor.contentComponent) == null || _a.setRenderer(this.id, this);
|
|
18580
18616
|
}
|
|
18581
18617
|
updateProps(props = {}) {
|
|
18618
|
+
if (this.destroyed) {
|
|
18619
|
+
return;
|
|
18620
|
+
}
|
|
18582
18621
|
this.props = {
|
|
18583
18622
|
...this.props,
|
|
18584
18623
|
...props
|
|
@@ -18587,6 +18626,7 @@ var ReactRenderer = class {
|
|
|
18587
18626
|
}
|
|
18588
18627
|
destroy() {
|
|
18589
18628
|
var _a;
|
|
18629
|
+
this.destroyed = true;
|
|
18590
18630
|
const editor = this.editor;
|
|
18591
18631
|
(_a = editor == null ? undefined : editor.contentComponent) == null || _a.removeRenderer(this.id);
|
|
18592
18632
|
try {
|
|
@@ -19761,7 +19801,7 @@ var undo = buildCommand(false, true);
|
|
|
19761
19801
|
var redo = buildCommand(true, true);
|
|
19762
19802
|
var undoNoScroll = buildCommand(false, false);
|
|
19763
19803
|
var redoNoScroll = buildCommand(true, false);
|
|
19764
|
-
// node_modules/.bun/@tiptap+extensions@3.
|
|
19804
|
+
// node_modules/.bun/@tiptap+extensions@3.15.3+aa048d05049272a7/node_modules/@tiptap/extensions/dist/index.js
|
|
19765
19805
|
var CharacterCount = Extension.create({
|
|
19766
19806
|
name: "characterCount",
|
|
19767
19807
|
addOptions() {
|
|
@@ -20105,10 +20145,10 @@ var UndoRedo = Extension.create({
|
|
|
20105
20145
|
}
|
|
20106
20146
|
});
|
|
20107
20147
|
|
|
20108
|
-
// node_modules/.bun/@tiptap+extension-character-count@3.
|
|
20148
|
+
// node_modules/.bun/@tiptap+extension-character-count@3.15.3+9f9d100532d1ad91/node_modules/@tiptap/extension-character-count/dist/index.js
|
|
20109
20149
|
var index_default = CharacterCount;
|
|
20110
20150
|
|
|
20111
|
-
// node_modules/.bun/@tiptap+extension-image@3.
|
|
20151
|
+
// node_modules/.bun/@tiptap+extension-image@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-image/dist/index.js
|
|
20112
20152
|
var inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
20113
20153
|
var Image2 = Node3.create({
|
|
20114
20154
|
name: "image",
|
|
@@ -21231,7 +21271,7 @@ function find(str, type = null, opts = null) {
|
|
|
21231
21271
|
return filtered;
|
|
21232
21272
|
}
|
|
21233
21273
|
|
|
21234
|
-
// node_modules/.bun/@tiptap+extension-link@3.
|
|
21274
|
+
// node_modules/.bun/@tiptap+extension-link@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-link/dist/index.js
|
|
21235
21275
|
var UNICODE_WHITESPACE_PATTERN = "[\x00- -\u2029 ]";
|
|
21236
21276
|
var UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN);
|
|
21237
21277
|
var UNICODE_WHITESPACE_REGEX_END = new RegExp(`${UNICODE_WHITESPACE_PATTERN}$`);
|
|
@@ -21375,7 +21415,7 @@ function pasteHandler(options) {
|
|
|
21375
21415
|
textContent += node.textContent;
|
|
21376
21416
|
});
|
|
21377
21417
|
const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find((item) => item.isLink && item.value === textContent);
|
|
21378
|
-
if (!textContent || !link || shouldAutoLink !== undefined && !shouldAutoLink(link.
|
|
21418
|
+
if (!textContent || !link || shouldAutoLink !== undefined && !shouldAutoLink(link.value)) {
|
|
21379
21419
|
return false;
|
|
21380
21420
|
}
|
|
21381
21421
|
return options.editor.commands.setMark(options.type, {
|
|
@@ -21436,7 +21476,22 @@ var Link = Mark2.create({
|
|
|
21436
21476
|
},
|
|
21437
21477
|
isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),
|
|
21438
21478
|
validate: (url) => !!url,
|
|
21439
|
-
shouldAutoLink: (url) =>
|
|
21479
|
+
shouldAutoLink: (url) => {
|
|
21480
|
+
const hasProtocol = /^[a-z][a-z0-9+.-]*:\/\//i.test(url);
|
|
21481
|
+
const hasMaybeProtocol = /^[a-z][a-z0-9+.-]*:/i.test(url);
|
|
21482
|
+
if (hasProtocol || hasMaybeProtocol && !url.includes("@")) {
|
|
21483
|
+
return true;
|
|
21484
|
+
}
|
|
21485
|
+
const urlWithoutUserinfo = url.includes("@") ? url.split("@").pop() : url;
|
|
21486
|
+
const hostname = urlWithoutUserinfo.split(/[/?#:]/)[0];
|
|
21487
|
+
if (/^\d{1,3}(\.\d{1,3}){3}$/.test(hostname)) {
|
|
21488
|
+
return false;
|
|
21489
|
+
}
|
|
21490
|
+
if (!/\./.test(hostname)) {
|
|
21491
|
+
return false;
|
|
21492
|
+
}
|
|
21493
|
+
return true;
|
|
21494
|
+
}
|
|
21440
21495
|
};
|
|
21441
21496
|
},
|
|
21442
21497
|
addAttributes() {
|
|
@@ -23594,7 +23649,7 @@ function tableEditing({ allowTableNodeSelection = false } = {}) {
|
|
|
23594
23649
|
}
|
|
23595
23650
|
});
|
|
23596
23651
|
}
|
|
23597
|
-
// node_modules/.bun/@tiptap+extension-table@3.
|
|
23652
|
+
// node_modules/.bun/@tiptap+extension-table@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-table/dist/index.js
|
|
23598
23653
|
var TableCell = Node3.create({
|
|
23599
23654
|
name: "tableCell",
|
|
23600
23655
|
addOptions() {
|
|
@@ -24139,16 +24194,16 @@ var TableKit = Extension.create({
|
|
|
24139
24194
|
}
|
|
24140
24195
|
});
|
|
24141
24196
|
|
|
24142
|
-
// node_modules/.bun/@tiptap+extension-table-cell@3.
|
|
24197
|
+
// node_modules/.bun/@tiptap+extension-table-cell@3.15.3+a85e1fcc83d8b887/node_modules/@tiptap/extension-table-cell/dist/index.js
|
|
24143
24198
|
var index_default4 = TableCell;
|
|
24144
24199
|
|
|
24145
|
-
// node_modules/.bun/@tiptap+extension-table-header@3.
|
|
24200
|
+
// node_modules/.bun/@tiptap+extension-table-header@3.15.3+a85e1fcc83d8b887/node_modules/@tiptap/extension-table-header/dist/index.js
|
|
24146
24201
|
var index_default5 = TableHeader;
|
|
24147
24202
|
|
|
24148
|
-
// node_modules/.bun/@tiptap+extension-table-row@3.
|
|
24203
|
+
// node_modules/.bun/@tiptap+extension-table-row@3.15.3+a85e1fcc83d8b887/node_modules/@tiptap/extension-table-row/dist/index.js
|
|
24149
24204
|
var index_default6 = TableRow;
|
|
24150
24205
|
|
|
24151
|
-
// node_modules/.bun/@tiptap+extension-typography@3.
|
|
24206
|
+
// node_modules/.bun/@tiptap+extension-typography@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-typography/dist/index.js
|
|
24152
24207
|
var emDash = (override) => textInputRule({
|
|
24153
24208
|
find: /--$/,
|
|
24154
24209
|
replace: override != null ? override : "—"
|
|
@@ -24338,7 +24393,7 @@ var Typography = Extension.create({
|
|
|
24338
24393
|
});
|
|
24339
24394
|
var index_default7 = Typography;
|
|
24340
24395
|
|
|
24341
|
-
// node_modules/.bun/@tiptap+core@3.
|
|
24396
|
+
// node_modules/.bun/@tiptap+core@3.15.3+2552a9caaf6753d4/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
24342
24397
|
var h = (tag, attributes) => {
|
|
24343
24398
|
if (tag === "slot") {
|
|
24344
24399
|
return 0;
|
|
@@ -24353,7 +24408,7 @@ var h = (tag, attributes) => {
|
|
|
24353
24408
|
return [tag, rest, children];
|
|
24354
24409
|
};
|
|
24355
24410
|
|
|
24356
|
-
// node_modules/.bun/@tiptap+extension-blockquote@3.
|
|
24411
|
+
// node_modules/.bun/@tiptap+extension-blockquote@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
24357
24412
|
var inputRegex2 = /^\s*>\s$/;
|
|
24358
24413
|
var Blockquote = Node3.create({
|
|
24359
24414
|
name: "blockquote",
|
|
@@ -24425,7 +24480,7 @@ ${prefix}
|
|
|
24425
24480
|
}
|
|
24426
24481
|
});
|
|
24427
24482
|
|
|
24428
|
-
// node_modules/.bun/@tiptap+extension-bold@3.
|
|
24483
|
+
// node_modules/.bun/@tiptap+extension-bold@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-bold/dist/index.js
|
|
24429
24484
|
var starInputRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/;
|
|
24430
24485
|
var starPasteRegex = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g;
|
|
24431
24486
|
var underscoreInputRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/;
|
|
@@ -24511,7 +24566,7 @@ var Bold = Mark2.create({
|
|
|
24511
24566
|
}
|
|
24512
24567
|
});
|
|
24513
24568
|
|
|
24514
|
-
// node_modules/.bun/@tiptap+extension-code@3.
|
|
24569
|
+
// node_modules/.bun/@tiptap+extension-code@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-code/dist/index.js
|
|
24515
24570
|
var inputRegex3 = /(^|[^`])`([^`]+)`(?!`)$/;
|
|
24516
24571
|
var pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;
|
|
24517
24572
|
var Code = Mark2.create({
|
|
@@ -24576,7 +24631,7 @@ var Code = Mark2.create({
|
|
|
24576
24631
|
}
|
|
24577
24632
|
});
|
|
24578
24633
|
|
|
24579
|
-
// node_modules/.bun/@tiptap+extension-code-block@3.
|
|
24634
|
+
// node_modules/.bun/@tiptap+extension-code-block@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-code-block/dist/index.js
|
|
24580
24635
|
var DEFAULT_TAB_SIZE = 4;
|
|
24581
24636
|
var backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
|
|
24582
24637
|
var tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
|
|
@@ -24892,7 +24947,7 @@ var CodeBlock = Node3.create({
|
|
|
24892
24947
|
});
|
|
24893
24948
|
var index_default8 = CodeBlock;
|
|
24894
24949
|
|
|
24895
|
-
// node_modules/.bun/@tiptap+extension-document@3.
|
|
24950
|
+
// node_modules/.bun/@tiptap+extension-document@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-document/dist/index.js
|
|
24896
24951
|
var Document = Node3.create({
|
|
24897
24952
|
name: "doc",
|
|
24898
24953
|
topNode: true,
|
|
@@ -24907,7 +24962,7 @@ var Document = Node3.create({
|
|
|
24907
24962
|
}
|
|
24908
24963
|
});
|
|
24909
24964
|
|
|
24910
|
-
// node_modules/.bun/@tiptap+extension-hard-break@3.
|
|
24965
|
+
// node_modules/.bun/@tiptap+extension-hard-break@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
24911
24966
|
var HardBreak = Node3.create({
|
|
24912
24967
|
name: "hardBreak",
|
|
24913
24968
|
markdownTokenName: "br",
|
|
@@ -24971,7 +25026,7 @@ var HardBreak = Node3.create({
|
|
|
24971
25026
|
}
|
|
24972
25027
|
});
|
|
24973
25028
|
|
|
24974
|
-
// node_modules/.bun/@tiptap+extension-heading@3.
|
|
25029
|
+
// node_modules/.bun/@tiptap+extension-heading@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-heading/dist/index.js
|
|
24975
25030
|
var Heading = Node3.create({
|
|
24976
25031
|
name: "heading",
|
|
24977
25032
|
addOptions() {
|
|
@@ -25051,7 +25106,7 @@ var Heading = Node3.create({
|
|
|
25051
25106
|
}
|
|
25052
25107
|
});
|
|
25053
25108
|
|
|
25054
|
-
// node_modules/.bun/@tiptap+extension-horizontal-rule@3.
|
|
25109
|
+
// node_modules/.bun/@tiptap+extension-horizontal-rule@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-horizontal-rule/dist/index.js
|
|
25055
25110
|
var HorizontalRule = Node3.create({
|
|
25056
25111
|
name: "horizontalRule",
|
|
25057
25112
|
addOptions() {
|
|
@@ -25127,7 +25182,7 @@ var HorizontalRule = Node3.create({
|
|
|
25127
25182
|
}
|
|
25128
25183
|
});
|
|
25129
25184
|
|
|
25130
|
-
// node_modules/.bun/@tiptap+extension-italic@3.
|
|
25185
|
+
// node_modules/.bun/@tiptap+extension-italic@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-italic/dist/index.js
|
|
25131
25186
|
var starInputRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/;
|
|
25132
25187
|
var starPasteRegex2 = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g;
|
|
25133
25188
|
var underscoreInputRegex2 = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/;
|
|
@@ -25212,7 +25267,7 @@ var Italic = Mark2.create({
|
|
|
25212
25267
|
}
|
|
25213
25268
|
});
|
|
25214
25269
|
|
|
25215
|
-
// node_modules/.bun/@tiptap+extension-list@3.
|
|
25270
|
+
// node_modules/.bun/@tiptap+extension-list@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-list/dist/index.js
|
|
25216
25271
|
var __defProp3 = Object.defineProperty;
|
|
25217
25272
|
var __export2 = (target, all) => {
|
|
25218
25273
|
for (var name in all)
|
|
@@ -26033,6 +26088,7 @@ var TaskItem = Node3.create({
|
|
|
26033
26088
|
Object.entries(HTMLAttributes).forEach(([key, value]) => {
|
|
26034
26089
|
listItem.setAttribute(key, value);
|
|
26035
26090
|
});
|
|
26091
|
+
let prevRenderedAttributeKeys = new Set(Object.keys(HTMLAttributes));
|
|
26036
26092
|
return {
|
|
26037
26093
|
dom: listItem,
|
|
26038
26094
|
contentDOM: content,
|
|
@@ -26043,6 +26099,31 @@ var TaskItem = Node3.create({
|
|
|
26043
26099
|
listItem.dataset.checked = updatedNode.attrs.checked;
|
|
26044
26100
|
checkbox.checked = updatedNode.attrs.checked;
|
|
26045
26101
|
updateA11Y(updatedNode);
|
|
26102
|
+
const extensionAttributes = editor.extensionManager.attributes;
|
|
26103
|
+
const newHTMLAttributes = getRenderedAttributes(updatedNode, extensionAttributes);
|
|
26104
|
+
const newKeys = new Set(Object.keys(newHTMLAttributes));
|
|
26105
|
+
const staticAttrs = this.options.HTMLAttributes;
|
|
26106
|
+
prevRenderedAttributeKeys.forEach((key) => {
|
|
26107
|
+
if (!newKeys.has(key)) {
|
|
26108
|
+
if (key in staticAttrs) {
|
|
26109
|
+
listItem.setAttribute(key, staticAttrs[key]);
|
|
26110
|
+
} else {
|
|
26111
|
+
listItem.removeAttribute(key);
|
|
26112
|
+
}
|
|
26113
|
+
}
|
|
26114
|
+
});
|
|
26115
|
+
Object.entries(newHTMLAttributes).forEach(([key, value]) => {
|
|
26116
|
+
if (value === null || value === undefined) {
|
|
26117
|
+
if (key in staticAttrs) {
|
|
26118
|
+
listItem.setAttribute(key, staticAttrs[key]);
|
|
26119
|
+
} else {
|
|
26120
|
+
listItem.removeAttribute(key);
|
|
26121
|
+
}
|
|
26122
|
+
} else {
|
|
26123
|
+
listItem.setAttribute(key, value);
|
|
26124
|
+
}
|
|
26125
|
+
});
|
|
26126
|
+
prevRenderedAttributeKeys = newKeys;
|
|
26046
26127
|
return true;
|
|
26047
26128
|
}
|
|
26048
26129
|
};
|
|
@@ -26204,7 +26285,7 @@ var ListKit = Extension.create({
|
|
|
26204
26285
|
}
|
|
26205
26286
|
});
|
|
26206
26287
|
|
|
26207
|
-
// node_modules/.bun/@tiptap+extension-paragraph@3.
|
|
26288
|
+
// node_modules/.bun/@tiptap+extension-paragraph@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
26208
26289
|
var Paragraph = Node3.create({
|
|
26209
26290
|
name: "paragraph",
|
|
26210
26291
|
priority: 1000,
|
|
@@ -26248,7 +26329,7 @@ var Paragraph = Node3.create({
|
|
|
26248
26329
|
}
|
|
26249
26330
|
});
|
|
26250
26331
|
|
|
26251
|
-
// node_modules/.bun/@tiptap+extension-strike@3.
|
|
26332
|
+
// node_modules/.bun/@tiptap+extension-strike@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-strike/dist/index.js
|
|
26252
26333
|
var inputRegex5 = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/;
|
|
26253
26334
|
var pasteRegex2 = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g;
|
|
26254
26335
|
var Strike = Mark2.create({
|
|
@@ -26322,7 +26403,7 @@ var Strike = Mark2.create({
|
|
|
26322
26403
|
}
|
|
26323
26404
|
});
|
|
26324
26405
|
|
|
26325
|
-
// node_modules/.bun/@tiptap+extension-text@3.
|
|
26406
|
+
// node_modules/.bun/@tiptap+extension-text@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-text/dist/index.js
|
|
26326
26407
|
var Text2 = Node3.create({
|
|
26327
26408
|
name: "text",
|
|
26328
26409
|
group: "inline",
|
|
@@ -26335,7 +26416,7 @@ var Text2 = Node3.create({
|
|
|
26335
26416
|
renderMarkdown: (node) => node.text || ""
|
|
26336
26417
|
});
|
|
26337
26418
|
|
|
26338
|
-
// node_modules/.bun/@tiptap+extension-underline@3.
|
|
26419
|
+
// node_modules/.bun/@tiptap+extension-underline@3.15.3+aa048d05049272a7/node_modules/@tiptap/extension-underline/dist/index.js
|
|
26339
26420
|
var Underline = Mark2.create({
|
|
26340
26421
|
name: "underline",
|
|
26341
26422
|
addOptions() {
|
|
@@ -26406,7 +26487,7 @@ var Underline = Mark2.create({
|
|
|
26406
26487
|
}
|
|
26407
26488
|
});
|
|
26408
26489
|
|
|
26409
|
-
// node_modules/.bun/@tiptap+starter-kit@3.
|
|
26490
|
+
// node_modules/.bun/@tiptap+starter-kit@3.15.3/node_modules/@tiptap/starter-kit/dist/index.js
|
|
26410
26491
|
var StarterKit = Extension.create({
|
|
26411
26492
|
name: "starterKit",
|
|
26412
26493
|
addExtensions() {
|
|
@@ -39229,7 +39310,7 @@ ${content.trim()}
|
|
|
39229
39310
|
}
|
|
39230
39311
|
var JsonToMarkdownConverter_default = JsonToMarkdownConverter;
|
|
39231
39312
|
|
|
39232
|
-
// node_modules/.bun/@tiptap+extension-code-block-lowlight@3.
|
|
39313
|
+
// node_modules/.bun/@tiptap+extension-code-block-lowlight@3.15.3+b67669a1d1743f75/node_modules/@tiptap/extension-code-block-lowlight/dist/index.js
|
|
39233
39314
|
function parseNodes(nodes, className = []) {
|
|
39234
39315
|
return nodes.flatMap((node) => {
|
|
39235
39316
|
const classes = [...className, ...node.properties ? node.properties.className : []];
|
|
@@ -45103,5 +45184,5 @@ export {
|
|
|
45103
45184
|
CodeBlockNodeView
|
|
45104
45185
|
};
|
|
45105
45186
|
|
|
45106
|
-
//# debugId=
|
|
45187
|
+
//# debugId=C55D38675362963664756E2164756E21
|
|
45107
45188
|
//# sourceMappingURL=index.js.map
|