@clevertask/scribe 0.1.26 → 0.1.27
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/README.md +7 -1
- package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +161 -134
- package/dist/components/Menu/TableLayoutOptions.d.ts +19 -0
- package/dist/components/Menu/TableLayoutOptions.d.ts.map +1 -0
- package/dist/components/Menu/TableLayoutOptions.js +109 -0
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/resizable-table.d.ts +12 -1
- package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -1
- package/dist/components/Scribe/extension/resizable-table.js +144 -2
- package/dist/components/Scribe/extension/slashCommand/items.js +1 -1
- package/dist/components/Scribe/extension/table-layout.d.ts +26 -0
- package/dist/components/Scribe/extension/table-layout.d.ts.map +1 -0
- package/dist/components/Scribe/extension/table-layout.js +2 -0
- package/dist/components/Scribe/extension/table-sticky-header.d.ts +7 -0
- package/dist/components/Scribe/extension/table-sticky-header.d.ts.map +1 -0
- package/dist/components/Scribe/extension/table-sticky-header.js +106 -0
- package/dist/components/Scribe/index.js +2 -2
- package/dist/document-node-capabilities.d.ts.map +1 -1
- package/dist/document-node-capabilities.js +76 -68
- package/dist/{extension-BFPlsViw.js → extension-CBOxOV0e.js} +1 -1
- package/dist/{html-to-markdown-BpR-7GtJ.js → html-to-markdown-DZ83bZ9I.js} +1 -1
- package/dist/main.css +46 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -1
- package/dist/{schema-extensions-BryyErmk.js → schema-extensions-BXyGPwMf.js} +10 -9
- package/dist/schema-extensions.js +1 -1
- package/dist/schema.js +1 -1
- package/dist/{resizable-table-JZOaj_L3.js → table-layout-B3sPDpEF.js} +132 -110
- package/dist/utils/html-to-markdown.d.ts.map +1 -1
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,2 +1,144 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { I as e } from "../../../dist-xjmWZ-oh.js";
|
|
2
|
+
import { a as t, c as n, i as r, l as i, o as a, r as o, t as s } from "../../../table-layout-B3sPDpEF.js";
|
|
3
|
+
import { createStickyTableHeaderPlugin as c } from "./table-sticky-header.js";
|
|
4
|
+
import { NodeSelection as l } from "@tiptap/pm/state";
|
|
5
|
+
import { columnResizing as u, columnResizingPluginKey as d, tableEditing as f } from "@tiptap/pm/tables";
|
|
6
|
+
//#region lib/components/Scribe/extension/resizable-table.ts
|
|
7
|
+
var p = (e) => {
|
|
8
|
+
if (e.selection instanceof l && e.selection.node.type.spec.tableRole === "table") return {
|
|
9
|
+
node: e.selection.node,
|
|
10
|
+
position: e.selection.from
|
|
11
|
+
};
|
|
12
|
+
let { $from: t } = e.selection;
|
|
13
|
+
for (let e = t.depth; e > 0; e--) if (t.node(e).type.spec.tableRole === "table") return {
|
|
14
|
+
node: t.node(e),
|
|
15
|
+
position: t.before(e)
|
|
16
|
+
};
|
|
17
|
+
return null;
|
|
18
|
+
}, m = (e) => e.target?.closest?.("table")?.getAttribute("data-table-layout"), h = (e) => {
|
|
19
|
+
for (let t = e.depth; t > 0; --t) if (e.node(t).type.spec.tableRole === "table") return !0;
|
|
20
|
+
return !1;
|
|
21
|
+
}, g = (e) => h(e.$from) || h(e.$to), _ = i.extend({
|
|
22
|
+
addAttributes() {
|
|
23
|
+
return {
|
|
24
|
+
...this.parent?.(),
|
|
25
|
+
tableLayout: {
|
|
26
|
+
default: "auto",
|
|
27
|
+
parseHTML: (e) => r(e.getAttribute("data-table-layout")),
|
|
28
|
+
renderHTML: ({ tableLayout: e }) => r(e) === "auto" ? {} : { "data-table-layout": r(e) }
|
|
29
|
+
},
|
|
30
|
+
limitHeight: {
|
|
31
|
+
default: !1,
|
|
32
|
+
parseHTML: (e) => e.getAttribute("data-table-limit-height") === "true",
|
|
33
|
+
renderHTML: ({ limitHeight: e }) => e === !0 ? { "data-table-limit-height": "true" } : {}
|
|
34
|
+
},
|
|
35
|
+
stickyHeaderRow: {
|
|
36
|
+
default: !1,
|
|
37
|
+
parseHTML: (e) => e.getAttribute("data-table-sticky-header-row") === "true",
|
|
38
|
+
renderHTML: ({ stickyHeaderRow: e }) => e === !0 ? { "data-table-sticky-header-row": "true" } : {}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
renderHTML(r) {
|
|
43
|
+
let i = this.parent(r);
|
|
44
|
+
if (r.node.attrs.tableLayout === "scroll") {
|
|
45
|
+
let { width: n, colgroup: a } = t(r.node, this.options.cellMinWidth);
|
|
46
|
+
i = [
|
|
47
|
+
"table",
|
|
48
|
+
e(this.options.HTMLAttributes, r.HTMLAttributes, { style: `width: ${n}px; min-width: ${n}px` }),
|
|
49
|
+
a,
|
|
50
|
+
["tbody", 0]
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
return r.node.attrs.tableLayout !== "auto" || r.node.attrs.limitHeight || r.node.attrs.stickyHeaderRow ? [
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
class: "tableWrapper",
|
|
57
|
+
...n(r.node)
|
|
58
|
+
},
|
|
59
|
+
i
|
|
60
|
+
] : i;
|
|
61
|
+
},
|
|
62
|
+
addCommands() {
|
|
63
|
+
let e = this.parent?.();
|
|
64
|
+
return {
|
|
65
|
+
...e,
|
|
66
|
+
setTableLayout: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
67
|
+
let a = p(n);
|
|
68
|
+
return !t.isEditable || !a || !s.includes(e) ? !1 : (i && a.node.attrs.tableLayout !== e && (r.setNodeMarkup(a.position, void 0, {
|
|
69
|
+
...a.node.attrs,
|
|
70
|
+
tableLayout: e
|
|
71
|
+
}), e === "fit" && r.setMeta(d, { setHandle: -1 })), !0);
|
|
72
|
+
},
|
|
73
|
+
setTableHeightLimit: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
74
|
+
let a = p(n);
|
|
75
|
+
return !t.isEditable || !a || typeof e != "boolean" ? !1 : (i && a.node.attrs.limitHeight !== e && r.setNodeMarkup(a.position, void 0, {
|
|
76
|
+
...a.node.attrs,
|
|
77
|
+
limitHeight: e
|
|
78
|
+
}), !0);
|
|
79
|
+
},
|
|
80
|
+
setTableStickyHeaderRow: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
81
|
+
let o = p(n);
|
|
82
|
+
return !t.isEditable || !o || typeof e != "boolean" || e && !a(o.node) ? !1 : (i && o.node.attrs.stickyHeaderRow !== e && r.setNodeMarkup(o.position, void 0, {
|
|
83
|
+
...o.node.attrs,
|
|
84
|
+
stickyHeaderRow: e
|
|
85
|
+
}), !0);
|
|
86
|
+
},
|
|
87
|
+
insertTable: (t = {}) => (n) => {
|
|
88
|
+
if (g(n.state.selection)) return !1;
|
|
89
|
+
let r = e?.insertTable?.(t)(n) ?? !1;
|
|
90
|
+
if (r && n.dispatch) {
|
|
91
|
+
let e = p(n.tr);
|
|
92
|
+
e && a(e.node) && n.tr.setNodeMarkup(e.position, void 0, {
|
|
93
|
+
...e.node.attrs,
|
|
94
|
+
stickyHeaderRow: !0
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return r;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
onUpdate() {
|
|
102
|
+
if (this.editor.isEditable) return;
|
|
103
|
+
let e = d.getState(this.editor.state);
|
|
104
|
+
e && (e.activeHandle > -1 || e.dragging) && this.editor.view.dispatch(this.editor.state.tr.setMeta(d, { setHandle: -1 }));
|
|
105
|
+
},
|
|
106
|
+
addProseMirrorPlugins() {
|
|
107
|
+
let e = {
|
|
108
|
+
handleWidth: this.options.handleWidth,
|
|
109
|
+
cellMinWidth: this.options.cellMinWidth,
|
|
110
|
+
defaultCellMinWidth: this.options.cellMinWidth,
|
|
111
|
+
View: this.options.View,
|
|
112
|
+
lastColumnResizable: this.options.lastColumnResizable
|
|
113
|
+
}, t = u(e), n = t.props.handleDOMEvents, r = u({
|
|
114
|
+
...e,
|
|
115
|
+
defaultCellMinWidth: 128
|
|
116
|
+
}), i = r.props.handleDOMEvents.mousedown;
|
|
117
|
+
return t.props.handleDOMEvents = {
|
|
118
|
+
...n,
|
|
119
|
+
mousemove: (e, r) => {
|
|
120
|
+
if (m(r) === "fit") {
|
|
121
|
+
let t = d.getState(e.state);
|
|
122
|
+
return t && t.activeHandle > -1 && !t.dragging && e.dispatch(e.state.tr.setMeta(d, { setHandle: -1 })), !1;
|
|
123
|
+
}
|
|
124
|
+
return n.mousemove?.call(t, e, r);
|
|
125
|
+
},
|
|
126
|
+
mousedown: (e, a) => {
|
|
127
|
+
let o = m(a);
|
|
128
|
+
return o === "fit" ? !1 : o === "scroll" ? i.call(r, e, a) : n.mousedown?.call(t, e, a);
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
t,
|
|
132
|
+
f({ allowTableNodeSelection: this.options.allowTableNodeSelection }),
|
|
133
|
+
c()
|
|
134
|
+
];
|
|
135
|
+
},
|
|
136
|
+
addNodeView() {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}).configure({
|
|
140
|
+
resizable: !0,
|
|
141
|
+
View: o
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export { _ as ScribeTable, g as selectionHasTableAncestor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { selectionHasTableAncestor as e } from "../resizable-table.js";
|
|
2
2
|
import { CalloutIcon as t } from "../../../../icons/CalloutIcon.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/components/Scribe/extension/slashCommand/items.tsx
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TableView } from "@tiptap/extension-table";
|
|
2
|
+
import type { DOMOutputSpec, Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
3
|
+
import type { EditorView } from "@tiptap/pm/view";
|
|
4
|
+
export declare const SCRIBE_TABLE_LAYOUTS: readonly ["auto", "fit", "scroll"];
|
|
5
|
+
export type ScribeTableLayout = (typeof SCRIBE_TABLE_LAYOUTS)[number];
|
|
6
|
+
export declare const SCROLL_TABLE_COLUMN_WIDTH = 128;
|
|
7
|
+
export declare const normalizeTableLayout: (value: unknown) => ScribeTableLayout;
|
|
8
|
+
export declare const tableHasHeaderRow: (table: ProseMirrorNode) => boolean;
|
|
9
|
+
export declare const tableHasStickyHeader: (node: ProseMirrorNode) => boolean;
|
|
10
|
+
export declare const tableLayoutAttributes: (node: ProseMirrorNode) => {
|
|
11
|
+
"data-table-layout": "auto" | "fit" | "scroll";
|
|
12
|
+
"data-table-limit-height": string;
|
|
13
|
+
"data-table-sticky-header-row": string;
|
|
14
|
+
"data-table-sticky-header-active": string;
|
|
15
|
+
};
|
|
16
|
+
export declare const scrollTablePresentation: (node: ProseMirrorNode, cellMinWidth: number) => {
|
|
17
|
+
width: number;
|
|
18
|
+
colgroup: DOMOutputSpec;
|
|
19
|
+
};
|
|
20
|
+
/** Keep native column resizing, cell selection and the editable tbody intact. */
|
|
21
|
+
export declare class ScribeTableView extends TableView {
|
|
22
|
+
constructor(node: ProseMirrorNode, cellMinWidth: number, view?: EditorView);
|
|
23
|
+
update(node: ProseMirrorNode): boolean;
|
|
24
|
+
private applyLayout;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=table-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-layout.d.ts","sourceRoot":"","sources":["../../../../lib/components/Scribe/extension/table-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAI,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,iBACE,CAAC;AAEzD,eAAO,MAAM,iBAAiB,UAAW,eAAe,YAevD,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAAU,eAAe,YACM,CAAC;AAEjE,eAAO,MAAM,qBAAqB,SAAU,eAAe;;;;;CAKzD,CAAC;AAEH,eAAO,MAAM,uBAAuB,SAAU,eAAe,gBAAgB,MAAM;;cAmBvB,aAAa;CACxE,CAAC;AAEF,iFAAiF;AACjF,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,YAAY,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,EAGzE;IAED,MAAM,CAAC,IAAI,EAAE,eAAe,WAO3B;IAED,OAAO,CAAC,WAAW;CAqCpB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../../table-layout-B3sPDpEF.js";
|
|
2
|
+
export { s as SCRIBE_TABLE_LAYOUTS, r as SCROLL_TABLE_COLUMN_WIDTH, a as ScribeTableView, n as normalizeTableLayout, e as scrollTablePresentation, i as tableHasHeaderRow, o as tableHasStickyHeader, t as tableLayoutAttributes };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from "@tiptap/pm/state";
|
|
2
|
+
import type { EditorView } from "@tiptap/pm/view";
|
|
3
|
+
/** Keep native selection scrolling, with clearance for the actual pinned row. */
|
|
4
|
+
export declare const scrollSelectionBelowStickyHeader: (view: EditorView) => boolean;
|
|
5
|
+
/** Move the original header cells; no extra editable DOM or document state. */
|
|
6
|
+
export declare const createStickyTableHeaderPlugin: () => Plugin<any>;
|
|
7
|
+
//# sourceMappingURL=table-sticky-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-sticky-header.d.ts","sourceRoot":"","sources":["../../../../lib/components/Scribe/extension/table-sticky-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0FlD,iFAAiF;AACjF,eAAO,MAAM,gCAAgC,SAAU,UAAU,YAuEhE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,6BAA6B,mBAsFtC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Plugin as e } from "@tiptap/pm/state";
|
|
2
|
+
//#region lib/components/Scribe/extension/table-sticky-header.ts
|
|
3
|
+
var t = ".tableWrapper[data-table-sticky-header-active=\"true\"]", n = "--scribe-table-sticky-header-top", r = /^(auto|scroll|overlay)$/, i = (e) => {
|
|
4
|
+
if (e.parentElement) return e.parentElement;
|
|
5
|
+
let t = e.getRootNode();
|
|
6
|
+
return "host" in t ? t.host : null;
|
|
7
|
+
}, a = (e) => e.querySelector(":scope > table")?.rows[0]?.cells, o = (e) => Math.max(0, ...Array.from(a(e) ?? [], (e) => e.getBoundingClientRect().height)), s = (e) => {
|
|
8
|
+
let t = e.ownerDocument.defaultView;
|
|
9
|
+
if (!t) return null;
|
|
10
|
+
for (let n = i(e); n && n !== e.ownerDocument.body && n !== e.ownerDocument.documentElement; n = i(n)) if (r.test(t.getComputedStyle(n).overflowY) && n.scrollHeight > n.clientHeight + 1) return n;
|
|
11
|
+
return null;
|
|
12
|
+
}, c = (e, t) => {
|
|
13
|
+
let n = e.ownerDocument.defaultView, r = n.visualViewport?.offsetTop ?? 0, i = r + (n.visualViewport?.height ?? n.innerHeight);
|
|
14
|
+
if (!t) return {
|
|
15
|
+
top: r,
|
|
16
|
+
bottom: i
|
|
17
|
+
};
|
|
18
|
+
let a = t.getBoundingClientRect(), o = t.offsetHeight > 0 ? a.height / t.offsetHeight : 1, s = a.top + t.clientTop * o;
|
|
19
|
+
return {
|
|
20
|
+
top: Math.max(r, s),
|
|
21
|
+
bottom: Math.min(i, s + t.clientHeight * o)
|
|
22
|
+
};
|
|
23
|
+
}, l = (e) => {
|
|
24
|
+
let t = e.ownerDocument.defaultView?.getComputedStyle(e).scrollMarginTop;
|
|
25
|
+
return Math.max(0, Number.parseFloat(t ?? "") || 0);
|
|
26
|
+
}, u = (e) => {
|
|
27
|
+
if (e.getAttribute("data-table-limit-height") === "true") {
|
|
28
|
+
e.style.removeProperty(n);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
let t = e.querySelector(":scope > table");
|
|
32
|
+
if (!t) return;
|
|
33
|
+
let r = e.getBoundingClientRect(), i = c(e, s(e)), a = Math.max(0, t.getBoundingClientRect().bottom - r.top - o(e)), u = Math.max(0, Math.min(i.top + l(e) - r.top, a)), d = e.offsetHeight > 0 ? r.height / e.offsetHeight : 1, f = String(u / (d || 1)) + "px";
|
|
34
|
+
e.style.getPropertyValue(n) !== f && e.style.setProperty(n, f);
|
|
35
|
+
}, d = (e) => {
|
|
36
|
+
let { $head: n } = e.state.selection, r;
|
|
37
|
+
if (["cell", "header_cell"].includes(n.nodeAfter?.type.spec.tableRole ?? "")) r = n.pos;
|
|
38
|
+
else for (let e = n.depth; e > 0; e--) if (["cell", "header_cell"].includes(n.node(e).type.spec.tableRole ?? "")) {
|
|
39
|
+
r = n.before(e);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (r === void 0) return !1;
|
|
43
|
+
let i = e.nodeDOM(r), a = i?.nodeType === 1 ? i : null, d = a?.closest(t), f = a?.closest("table"), p = f?.rows[0];
|
|
44
|
+
if (!d || !p || f?.parentElement !== d) return !1;
|
|
45
|
+
let m = d.getAttribute("data-table-limit-height") === "true", h = m ? d : s(d), g = c(d, h), _ = o(d);
|
|
46
|
+
if (_ <= 0 || g.bottom <= g.top) return !1;
|
|
47
|
+
let v = g.top + (m ? 0 : l(d)) + (p.contains(a) ? 0 : _) + 5, y = e.coordsAtPos(n.pos), b = 0;
|
|
48
|
+
if (y.top < v ? b = y.top - v : y.bottom > g.bottom - 5 && (b = y.bottom - g.bottom + 5), b) {
|
|
49
|
+
if (h) {
|
|
50
|
+
let e = h.getBoundingClientRect(), t = h.offsetHeight > 0 ? e.height / h.offsetHeight : 1;
|
|
51
|
+
h.scrollTop += b / (t || 1);
|
|
52
|
+
} else d.ownerDocument.defaultView?.scrollBy(0, b);
|
|
53
|
+
u(d);
|
|
54
|
+
}
|
|
55
|
+
if (p.contains(a)) {
|
|
56
|
+
let t = d.getBoundingClientRect(), r = d.offsetWidth > 0 ? t.width / d.offsetWidth : 1, i = t.left + d.clientLeft * r + 5, a = t.left + (d.clientLeft + d.clientWidth) * r - 5, o = e.coordsAtPos(n.pos);
|
|
57
|
+
o.left < i ? d.scrollLeft += (o.left - i) / (r || 1) : o.right > a && (d.scrollLeft += (o.right - a) / (r || 1));
|
|
58
|
+
}
|
|
59
|
+
return !1;
|
|
60
|
+
}, f = () => new e({
|
|
61
|
+
props: { handleScrollToSelection: d },
|
|
62
|
+
view(e) {
|
|
63
|
+
let r = e.dom.ownerDocument.defaultView;
|
|
64
|
+
if (!r) return {};
|
|
65
|
+
let o = null, s = !1, c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), d = r.ResizeObserver ? new r.ResizeObserver(f) : null;
|
|
66
|
+
function f() {
|
|
67
|
+
s || o !== null || c.size === 0 || (o = r.requestAnimationFrame(() => {
|
|
68
|
+
o = null, p();
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
function p() {
|
|
72
|
+
let r = new Set(e.dom.querySelectorAll(t));
|
|
73
|
+
for (let e of c) r.has(e) || e.style.removeProperty(n);
|
|
74
|
+
c = r;
|
|
75
|
+
let o = /* @__PURE__ */ new Set();
|
|
76
|
+
if (c.size) {
|
|
77
|
+
for (let t = e.dom; t; t = i(t)) o.add(t);
|
|
78
|
+
for (let e of c) {
|
|
79
|
+
o.add(e);
|
|
80
|
+
for (let t of a(e) ?? []) o.add(t);
|
|
81
|
+
u(e);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (let e of l) o.has(e) || (d?.unobserve(e), l.delete(e));
|
|
85
|
+
for (let e of o) l.has(e) || (d?.observe(e), l.add(e));
|
|
86
|
+
}
|
|
87
|
+
let m = /* @__PURE__ */ new Set([e.dom.ownerDocument, e.root]);
|
|
88
|
+
for (let e of m) e.addEventListener("scroll", f, {
|
|
89
|
+
capture: !0,
|
|
90
|
+
passive: !0
|
|
91
|
+
});
|
|
92
|
+
return r.addEventListener("scroll", f, { passive: !0 }), r.addEventListener("resize", f, { passive: !0 }), r.visualViewport?.addEventListener("resize", f), r.visualViewport?.addEventListener("scroll", f), p(), {
|
|
93
|
+
update() {
|
|
94
|
+
s || p();
|
|
95
|
+
},
|
|
96
|
+
destroy() {
|
|
97
|
+
s = !0, o !== null && r.cancelAnimationFrame(o), d?.disconnect();
|
|
98
|
+
for (let e of m) e.removeEventListener("scroll", f, !0);
|
|
99
|
+
r.removeEventListener("scroll", f), r.removeEventListener("resize", f), r.visualViewport?.removeEventListener("resize", f), r.visualViewport?.removeEventListener("scroll", f);
|
|
100
|
+
for (let e of c) e.style.removeProperty(n);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { f as createStickyTableHeaderPlugin, d as scrollSelectionBelowStickyHeader };
|
|
@@ -3,8 +3,8 @@ import { o as n, t as r } from "../../dist-BiognBi4.js";
|
|
|
3
3
|
import i from "../Menu/CalloutBubbleMenu.js";
|
|
4
4
|
import a from "../Menu/LinkBubbleMenu.js";
|
|
5
5
|
import o from "../Menu/TableBubbleMenu.js";
|
|
6
|
-
import { t as s } from "../../html-to-markdown-
|
|
7
|
-
import { t as c } from "../../extension-
|
|
6
|
+
import { t as s } from "../../html-to-markdown-DZ83bZ9I.js";
|
|
7
|
+
import { t as c } from "../../extension-CBOxOV0e.js";
|
|
8
8
|
import { SuggestionItemType as l } from "./extension/slashCommand/items.js";
|
|
9
9
|
import "./extension/tableOfContents.js";
|
|
10
10
|
import "../../utils/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-node-capabilities.d.ts","sourceRoot":"","sources":["../lib/document-node-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"document-node-capabilities.d.ts","sourceRoot":"","sources":["../lib/document-node-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK/C,eAAO,MAAM,qCAAqC,YAChD,UAAU,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,CACH,CAAC;AAEX,MAAM,MAAM,gCAAgC,GAC1C,CAAC,OAAO,qCAAqC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,kCAAkC,YAC7C,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,CACJ,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhG,MAAM,MAAM,gCAAgC,GACxC;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACzD,CAAC;AAEN,MAAM,MAAM,oCAAoC,GAC5C;IACE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC,GACD;IACE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC;IAChF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAC;KAC9C,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,SAAS,oCAAoC,EAAE,CAAC;IAC9E,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG,QAAQ,CACzD,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAC7C,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,KAAK,CAAC,UAAU,SAAS,4BAA4B,cAEzC,UAAU,KACrB,UAAwB,CAAC;AAyX5B;;;;;GAKG;AACH,eAAO,MAAM,0CAA0C,WAC7C,MAAM,2BACU,SAAS,4BAA4B,EAAE,KAC9D,oCAuCF,CAAC"}
|