@kedataindo/docflow-plugins 0.0.96 → 0.0.97
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.cjs +8 -24
- package/dist/index.js +8 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -609,13 +609,10 @@ var FootnoteNode = import_core3.Node.create({
|
|
|
609
609
|
class: "docs-footnote-ref"
|
|
610
610
|
}), "1"];
|
|
611
611
|
},
|
|
612
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing.
|
|
613
|
-
// At runtime this returns a valid ProseMirror NodeView { dom, update }.
|
|
614
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
615
612
|
addNodeView() {
|
|
616
613
|
return (props) => {
|
|
617
|
-
const node = props.node
|
|
618
|
-
const attrs = node
|
|
614
|
+
const node = props.node;
|
|
615
|
+
const attrs = node.attrs;
|
|
619
616
|
const dom = document.createElement("span");
|
|
620
617
|
dom.className = "docs-footnote-ref";
|
|
621
618
|
dom.setAttribute("data-node-type", "footnote");
|
|
@@ -628,10 +625,9 @@ var FootnoteNode = import_core3.Node.create({
|
|
|
628
625
|
dom.textContent = "1";
|
|
629
626
|
return {
|
|
630
627
|
dom,
|
|
631
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
632
628
|
update(updatedNode) {
|
|
633
629
|
try {
|
|
634
|
-
const updatedAttrs = updatedNode
|
|
630
|
+
const updatedAttrs = updatedNode.attrs ?? {};
|
|
635
631
|
dom.setAttribute("data-footnote-content", String(updatedAttrs.content ?? ""));
|
|
636
632
|
if (updatedAttrs.sourceId) {
|
|
637
633
|
dom.setAttribute("data-footnote-source-id", String(updatedAttrs.sourceId));
|
|
@@ -879,9 +875,6 @@ var TocNode = import_core4.Node.create({
|
|
|
879
875
|
class: "docs-toc"
|
|
880
876
|
}), 0];
|
|
881
877
|
},
|
|
882
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
883
|
-
// (same pattern as FootnoteNode / BibliographyNode).
|
|
884
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
885
878
|
addNodeView() {
|
|
886
879
|
return (props) => {
|
|
887
880
|
const editor = props.editor;
|
|
@@ -920,9 +913,8 @@ var TocNode = import_core4.Node.create({
|
|
|
920
913
|
return {
|
|
921
914
|
dom,
|
|
922
915
|
contentDOM,
|
|
923
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
924
916
|
update(updatedNode) {
|
|
925
|
-
return updatedNode
|
|
917
|
+
return updatedNode.type.name === "toc";
|
|
926
918
|
},
|
|
927
919
|
destroy() {
|
|
928
920
|
refresh.removeEventListener("click", onRefresh);
|
|
@@ -2156,9 +2148,6 @@ var BibliographyNode = import_core6.Node.create({
|
|
|
2156
2148
|
})
|
|
2157
2149
|
];
|
|
2158
2150
|
},
|
|
2159
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
2160
|
-
// (same pattern as FootnoteNode).
|
|
2161
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2162
2151
|
addNodeView() {
|
|
2163
2152
|
return (props) => {
|
|
2164
2153
|
const editor = props.editor;
|
|
@@ -2195,9 +2184,8 @@ var BibliographyNode = import_core6.Node.create({
|
|
|
2195
2184
|
const unsubscribe = engine?.onChange(render);
|
|
2196
2185
|
return {
|
|
2197
2186
|
dom,
|
|
2198
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2199
2187
|
update(updatedNode) {
|
|
2200
|
-
return updatedNode
|
|
2188
|
+
return updatedNode.type.name === "bibliography";
|
|
2201
2189
|
},
|
|
2202
2190
|
destroy() {
|
|
2203
2191
|
unsubscribe?.();
|
|
@@ -2368,13 +2356,10 @@ var CitationNode = import_core7.Node.create({
|
|
|
2368
2356
|
""
|
|
2369
2357
|
];
|
|
2370
2358
|
},
|
|
2371
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
2372
|
-
// (same pattern as FootnoteNode).
|
|
2373
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2374
2359
|
addNodeView() {
|
|
2375
2360
|
return (props) => {
|
|
2376
2361
|
const editor = props.editor;
|
|
2377
|
-
const node = props.node
|
|
2362
|
+
const node = props.node;
|
|
2378
2363
|
const dom = document.createElement("span");
|
|
2379
2364
|
dom.className = "docs-citation";
|
|
2380
2365
|
dom.setAttribute("data-node-type", "citation");
|
|
@@ -2397,9 +2382,8 @@ var CitationNode = import_core7.Node.create({
|
|
|
2397
2382
|
const unsubscribe = engine?.onChange(render);
|
|
2398
2383
|
return {
|
|
2399
2384
|
dom,
|
|
2400
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2401
2385
|
update(updatedNode) {
|
|
2402
|
-
if (updatedNode
|
|
2386
|
+
if (updatedNode.type.name !== "citation") return false;
|
|
2403
2387
|
try {
|
|
2404
2388
|
Object.assign(node.attrs, updatedNode.attrs);
|
|
2405
2389
|
render();
|
|
@@ -3600,7 +3584,7 @@ var DropdownChipNode = import_core12.Node.create({
|
|
|
3600
3584
|
return list.length ? list : DEFAULT_STATUSES;
|
|
3601
3585
|
},
|
|
3602
3586
|
renderHTML: (attrs) => ({
|
|
3603
|
-
"data-options": (attrs.options
|
|
3587
|
+
"data-options": (Array.isArray(attrs.options) ? attrs.options : []).join("|")
|
|
3604
3588
|
})
|
|
3605
3589
|
},
|
|
3606
3590
|
selected: {
|
package/dist/index.js
CHANGED
|
@@ -499,13 +499,10 @@ var FootnoteNode = Node3.create({
|
|
|
499
499
|
class: "docs-footnote-ref"
|
|
500
500
|
}), "1"];
|
|
501
501
|
},
|
|
502
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing.
|
|
503
|
-
// At runtime this returns a valid ProseMirror NodeView { dom, update }.
|
|
504
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
505
502
|
addNodeView() {
|
|
506
503
|
return (props) => {
|
|
507
|
-
const node = props.node
|
|
508
|
-
const attrs = node
|
|
504
|
+
const node = props.node;
|
|
505
|
+
const attrs = node.attrs;
|
|
509
506
|
const dom = document.createElement("span");
|
|
510
507
|
dom.className = "docs-footnote-ref";
|
|
511
508
|
dom.setAttribute("data-node-type", "footnote");
|
|
@@ -518,10 +515,9 @@ var FootnoteNode = Node3.create({
|
|
|
518
515
|
dom.textContent = "1";
|
|
519
516
|
return {
|
|
520
517
|
dom,
|
|
521
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
522
518
|
update(updatedNode) {
|
|
523
519
|
try {
|
|
524
|
-
const updatedAttrs = updatedNode
|
|
520
|
+
const updatedAttrs = updatedNode.attrs ?? {};
|
|
525
521
|
dom.setAttribute("data-footnote-content", String(updatedAttrs.content ?? ""));
|
|
526
522
|
if (updatedAttrs.sourceId) {
|
|
527
523
|
dom.setAttribute("data-footnote-source-id", String(updatedAttrs.sourceId));
|
|
@@ -769,9 +765,6 @@ var TocNode = Node4.create({
|
|
|
769
765
|
class: "docs-toc"
|
|
770
766
|
}), 0];
|
|
771
767
|
},
|
|
772
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
773
|
-
// (same pattern as FootnoteNode / BibliographyNode).
|
|
774
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
775
768
|
addNodeView() {
|
|
776
769
|
return (props) => {
|
|
777
770
|
const editor = props.editor;
|
|
@@ -810,9 +803,8 @@ var TocNode = Node4.create({
|
|
|
810
803
|
return {
|
|
811
804
|
dom,
|
|
812
805
|
contentDOM,
|
|
813
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
814
806
|
update(updatedNode) {
|
|
815
|
-
return updatedNode
|
|
807
|
+
return updatedNode.type.name === "toc";
|
|
816
808
|
},
|
|
817
809
|
destroy() {
|
|
818
810
|
refresh.removeEventListener("click", onRefresh);
|
|
@@ -2046,9 +2038,6 @@ var BibliographyNode = Node5.create({
|
|
|
2046
2038
|
})
|
|
2047
2039
|
];
|
|
2048
2040
|
},
|
|
2049
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
2050
|
-
// (same pattern as FootnoteNode).
|
|
2051
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2052
2041
|
addNodeView() {
|
|
2053
2042
|
return (props) => {
|
|
2054
2043
|
const editor = props.editor;
|
|
@@ -2085,9 +2074,8 @@ var BibliographyNode = Node5.create({
|
|
|
2085
2074
|
const unsubscribe = engine?.onChange(render);
|
|
2086
2075
|
return {
|
|
2087
2076
|
dom,
|
|
2088
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2089
2077
|
update(updatedNode) {
|
|
2090
|
-
return updatedNode
|
|
2078
|
+
return updatedNode.type.name === "bibliography";
|
|
2091
2079
|
},
|
|
2092
2080
|
destroy() {
|
|
2093
2081
|
unsubscribe?.();
|
|
@@ -2258,13 +2246,10 @@ var CitationNode = Node6.create({
|
|
|
2258
2246
|
""
|
|
2259
2247
|
];
|
|
2260
2248
|
},
|
|
2261
|
-
// Return type cast to `any` to bypass TipTap's strict NodeViewRenderer typing
|
|
2262
|
-
// (same pattern as FootnoteNode).
|
|
2263
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2264
2249
|
addNodeView() {
|
|
2265
2250
|
return (props) => {
|
|
2266
2251
|
const editor = props.editor;
|
|
2267
|
-
const node = props.node
|
|
2252
|
+
const node = props.node;
|
|
2268
2253
|
const dom = document.createElement("span");
|
|
2269
2254
|
dom.className = "docs-citation";
|
|
2270
2255
|
dom.setAttribute("data-node-type", "citation");
|
|
@@ -2287,9 +2272,8 @@ var CitationNode = Node6.create({
|
|
|
2287
2272
|
const unsubscribe = engine?.onChange(render);
|
|
2288
2273
|
return {
|
|
2289
2274
|
dom,
|
|
2290
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2291
2275
|
update(updatedNode) {
|
|
2292
|
-
if (updatedNode
|
|
2276
|
+
if (updatedNode.type.name !== "citation") return false;
|
|
2293
2277
|
try {
|
|
2294
2278
|
Object.assign(node.attrs, updatedNode.attrs);
|
|
2295
2279
|
render();
|
|
@@ -3490,7 +3474,7 @@ var DropdownChipNode = Node7.create({
|
|
|
3490
3474
|
return list.length ? list : DEFAULT_STATUSES;
|
|
3491
3475
|
},
|
|
3492
3476
|
renderHTML: (attrs) => ({
|
|
3493
|
-
"data-options": (attrs.options
|
|
3477
|
+
"data-options": (Array.isArray(attrs.options) ? attrs.options : []).join("|")
|
|
3494
3478
|
})
|
|
3495
3479
|
},
|
|
3496
3480
|
selected: {
|