@oml/markdown 0.13.0 → 0.14.0
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/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/md/md-execution.d.ts +3 -3
- package/out/md/md-execution.js +1 -1
- package/out/md/md-execution.js.map +1 -1
- package/out/md/md-executor.js +6 -8
- package/out/md/md-executor.js.map +1 -1
- package/out/md/md-frontmatter.d.ts +1 -1
- package/out/md/md-frontmatter.js +15 -10
- package/out/md/md-frontmatter.js.map +1 -1
- package/out/md/md-runtime.js +1 -1
- package/out/md/md-runtime.js.map +1 -1
- package/out/md/md-types.d.ts +2 -2
- package/out/renderers/diagram-renderer.js +231 -12
- package/out/renderers/diagram-renderer.js.map +1 -1
- package/out/renderers/graph-renderer.js +2 -2
- package/out/renderers/graph-renderer.js.map +1 -1
- package/out/renderers/table-renderer.js +25 -10
- package/out/renderers/table-renderer.js.map +1 -1
- package/out/static/browser-runtime.bundle.js +489 -25
- package/out/static/browser-runtime.bundle.js.map +3 -3
- package/out/static/browser-runtime.js +258 -0
- package/out/static/browser-runtime.js.map +1 -1
- package/out/static/runtime-assets.d.ts +1 -1
- package/out/static/runtime-assets.js +1 -0
- package/out/static/runtime-assets.js.map +1 -1
- package/out/template/binder.d.ts +2 -0
- package/out/template/binder.js +56 -0
- package/out/template/binder.js.map +1 -0
- package/out/template/catalog.d.ts +8 -0
- package/out/template/catalog.js +26 -0
- package/out/template/catalog.js.map +1 -0
- package/out/template/compose.d.ts +7 -0
- package/out/template/compose.js +93 -0
- package/out/template/compose.js.map +1 -0
- package/out/template/definition.d.ts +3 -0
- package/out/template/definition.js +204 -0
- package/out/template/definition.js.map +1 -0
- package/out/template/engine.d.ts +8 -0
- package/out/template/engine.js +30 -0
- package/out/template/engine.js.map +1 -0
- package/out/template/index.d.ts +7 -0
- package/out/template/index.js +9 -0
- package/out/template/index.js.map +1 -0
- package/out/template/resolver.d.ts +4 -0
- package/out/template/resolver.js +58 -0
- package/out/template/resolver.js.map +1 -0
- package/out/template/types.d.ts +82 -0
- package/out/template/types.js +3 -0
- package/out/template/types.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/md/md-execution.ts +3 -3
- package/src/md/md-executor.ts +6 -9
- package/src/md/md-frontmatter.ts +15 -10
- package/src/md/md-runtime.ts +1 -1
- package/src/md/md-types.ts +2 -2
- package/src/renderers/diagram-renderer.ts +229 -12
- package/src/renderers/graph-renderer.ts +2 -2
- package/src/renderers/table-renderer.ts +26 -10
- package/src/static/browser-runtime.ts +305 -0
- package/src/static/markdown-webview.css +13 -0
- package/src/static/runtime-assets.ts +1 -0
- package/src/template/binder.ts +70 -0
- package/src/template/catalog.ts +35 -0
- package/src/template/compose.ts +107 -0
- package/src/template/definition.ts +222 -0
- package/src/template/engine.ts +45 -0
- package/src/template/index.ts +9 -0
- package/src/template/resolver.ts +75 -0
- package/src/template/types.ts +111 -0
|
@@ -68219,6 +68219,12 @@
|
|
|
68219
68219
|
container: liveCanvas,
|
|
68220
68220
|
autoResize: false,
|
|
68221
68221
|
grid: false,
|
|
68222
|
+
selecting: {
|
|
68223
|
+
enabled: true,
|
|
68224
|
+
multiple: true,
|
|
68225
|
+
// X6 native additive selection modifiers.
|
|
68226
|
+
multipleSelectionModifiers: ["meta", "ctrl"]
|
|
68227
|
+
},
|
|
68222
68228
|
panning: true,
|
|
68223
68229
|
mousewheel: {
|
|
68224
68230
|
enabled: true,
|
|
@@ -68298,7 +68304,7 @@
|
|
|
68298
68304
|
bubbles: true,
|
|
68299
68305
|
detail: {
|
|
68300
68306
|
iri,
|
|
68301
|
-
previewEnabled:
|
|
68307
|
+
previewEnabled: event.altKey,
|
|
68302
68308
|
anchorRect: {
|
|
68303
68309
|
left: rect2.left,
|
|
68304
68310
|
right: rect2.right,
|
|
@@ -69019,26 +69025,196 @@
|
|
|
69019
69025
|
zIndex: 50
|
|
69020
69026
|
});
|
|
69021
69027
|
}
|
|
69022
|
-
const
|
|
69028
|
+
const selectionTargetForNode = (node) => {
|
|
69023
69029
|
if (!isCompartmentNode(node)) {
|
|
69024
|
-
return;
|
|
69030
|
+
return node;
|
|
69025
69031
|
}
|
|
69026
69032
|
const parent = typeof node.getParent === "function" ? node.getParent() : void 0;
|
|
69027
|
-
|
|
69033
|
+
return parent ?? node;
|
|
69034
|
+
};
|
|
69035
|
+
const multiSelectedNodeIds = /* @__PURE__ */ new Set();
|
|
69036
|
+
let primarySelectedNodeId;
|
|
69037
|
+
const cssEscape = (value) => value.replace(/["\\]/g, "\\$&");
|
|
69038
|
+
const createSvgElement2 = (name) => document.createElementNS("http://www.w3.org/2000/svg", name);
|
|
69039
|
+
const clearSecondaryDecoration = (container) => {
|
|
69040
|
+
for (const node of Array.from(container.querySelectorAll("g.oml-secondary-selection"))) {
|
|
69041
|
+
node.remove();
|
|
69042
|
+
}
|
|
69043
|
+
for (const node of Array.from(container.querySelectorAll('[data-oml-multi-selected-style="1"]'))) {
|
|
69044
|
+
if (!(node instanceof SVGElement)) {
|
|
69045
|
+
continue;
|
|
69046
|
+
}
|
|
69047
|
+
node.style.removeProperty("stroke");
|
|
69048
|
+
node.style.removeProperty("stroke-width");
|
|
69049
|
+
node.removeAttribute("data-oml-multi-selected-style");
|
|
69050
|
+
}
|
|
69051
|
+
};
|
|
69052
|
+
const renderSecondaryDecoration = (container) => {
|
|
69053
|
+
clearSecondaryDecoration(container);
|
|
69054
|
+
const graphics = container;
|
|
69055
|
+
if (typeof graphics.getBBox !== "function") {
|
|
69028
69056
|
return;
|
|
69029
69057
|
}
|
|
69030
|
-
|
|
69031
|
-
|
|
69058
|
+
let bbox3;
|
|
69059
|
+
try {
|
|
69060
|
+
bbox3 = graphics.getBBox();
|
|
69061
|
+
} catch {
|
|
69062
|
+
return;
|
|
69032
69063
|
}
|
|
69033
|
-
if (
|
|
69034
|
-
|
|
69064
|
+
if (!bbox3 || bbox3.width <= 0 || bbox3.height <= 0) {
|
|
69065
|
+
return;
|
|
69035
69066
|
}
|
|
69067
|
+
const widgetMargin = 3;
|
|
69068
|
+
const handleSize = 6;
|
|
69069
|
+
const handleHalf = handleSize / 2;
|
|
69070
|
+
const x = bbox3.x - widgetMargin;
|
|
69071
|
+
const y2 = bbox3.y - widgetMargin;
|
|
69072
|
+
const width2 = bbox3.width + widgetMargin * 2;
|
|
69073
|
+
const height2 = bbox3.height + widgetMargin * 2;
|
|
69074
|
+
const group = createSvgElement2("g");
|
|
69075
|
+
group.setAttribute("class", "oml-secondary-selection");
|
|
69076
|
+
group.setAttribute("pointer-events", "none");
|
|
69077
|
+
const box = createSvgElement2("rect");
|
|
69078
|
+
box.setAttribute("x", `${x}`);
|
|
69079
|
+
box.setAttribute("y", `${y2}`);
|
|
69080
|
+
box.setAttribute("width", `${width2}`);
|
|
69081
|
+
box.setAttribute("height", `${height2}`);
|
|
69082
|
+
box.setAttribute("fill", "none");
|
|
69083
|
+
box.setAttribute("stroke", "#000");
|
|
69084
|
+
box.setAttribute("stroke-width", "1");
|
|
69085
|
+
box.setAttribute("stroke-dasharray", "4 3");
|
|
69086
|
+
group.appendChild(box);
|
|
69087
|
+
const points = [
|
|
69088
|
+
[x, y2],
|
|
69089
|
+
[x + width2 / 2, y2],
|
|
69090
|
+
[x + width2, y2],
|
|
69091
|
+
[x, y2 + height2 / 2],
|
|
69092
|
+
[x + width2, y2 + height2 / 2],
|
|
69093
|
+
[x, y2 + height2],
|
|
69094
|
+
[x + width2 / 2, y2 + height2],
|
|
69095
|
+
[x + width2, y2 + height2]
|
|
69096
|
+
];
|
|
69097
|
+
for (const [cx, cy] of points) {
|
|
69098
|
+
const handle = createSvgElement2("rect");
|
|
69099
|
+
handle.setAttribute("x", `${cx - handleHalf}`);
|
|
69100
|
+
handle.setAttribute("y", `${cy - handleHalf}`);
|
|
69101
|
+
handle.setAttribute("width", `${handleSize}`);
|
|
69102
|
+
handle.setAttribute("height", `${handleSize}`);
|
|
69103
|
+
handle.setAttribute("rx", "3");
|
|
69104
|
+
handle.setAttribute("ry", "3");
|
|
69105
|
+
handle.setAttribute("fill", "#000");
|
|
69106
|
+
handle.setAttribute("stroke", "#000");
|
|
69107
|
+
handle.setAttribute("stroke-width", "1");
|
|
69108
|
+
group.appendChild(handle);
|
|
69109
|
+
}
|
|
69110
|
+
container.appendChild(group);
|
|
69111
|
+
};
|
|
69112
|
+
const refreshPrimaryWidget = () => {
|
|
69113
|
+
if (typeof nodeTransform?.clearWidgets === "function") {
|
|
69114
|
+
nodeTransform.clearWidgets();
|
|
69115
|
+
}
|
|
69116
|
+
if (!primarySelectedNodeId || typeof nodeTransform?.createWidget !== "function") {
|
|
69117
|
+
return;
|
|
69118
|
+
}
|
|
69119
|
+
const cell = typeof graphView.getCellById === "function" ? graphView.getCellById(primarySelectedNodeId) : void 0;
|
|
69120
|
+
if (!cell) {
|
|
69121
|
+
return;
|
|
69122
|
+
}
|
|
69123
|
+
nodeTransform.createWidget(cell);
|
|
69124
|
+
};
|
|
69125
|
+
let applySelectionScheduled = false;
|
|
69126
|
+
const applyMultiSelectionClassesNow = () => {
|
|
69127
|
+
const selectedIds = new Set(multiSelectedNodeIds);
|
|
69128
|
+
const nodeContainers = Array.from(liveCanvas.querySelectorAll(".x6-cell[data-cell-id], .x6-node[data-cell-id]"));
|
|
69129
|
+
for (const element of nodeContainers) {
|
|
69130
|
+
const container = element;
|
|
69131
|
+
const id = String(container.getAttribute("data-cell-id") ?? "");
|
|
69132
|
+
const selected = selectedIds.has(id);
|
|
69133
|
+
container.classList.toggle("oml-diagram-multi-selected", selected);
|
|
69134
|
+
if (selected && id !== primarySelectedNodeId) {
|
|
69135
|
+
renderSecondaryDecoration(container);
|
|
69136
|
+
} else {
|
|
69137
|
+
clearSecondaryDecoration(container);
|
|
69138
|
+
}
|
|
69139
|
+
}
|
|
69140
|
+
for (const id of selectedIds) {
|
|
69141
|
+
const selector = `.x6-cell[data-cell-id="${cssEscape(id)}"], .x6-node[data-cell-id="${cssEscape(id)}"]`;
|
|
69142
|
+
const domMatches = Array.from(liveCanvas.querySelectorAll(selector));
|
|
69143
|
+
for (const element of domMatches) {
|
|
69144
|
+
if (element instanceof Element) {
|
|
69145
|
+
element.classList.add("oml-diagram-multi-selected");
|
|
69146
|
+
if (id !== primarySelectedNodeId) {
|
|
69147
|
+
renderSecondaryDecoration(element);
|
|
69148
|
+
} else {
|
|
69149
|
+
clearSecondaryDecoration(element);
|
|
69150
|
+
}
|
|
69151
|
+
}
|
|
69152
|
+
}
|
|
69153
|
+
const cell = typeof graphView.getCellById === "function" ? graphView.getCellById(id) : void 0;
|
|
69154
|
+
const view = cell && typeof graphView.findViewByCell === "function" ? graphView.findViewByCell(cell) : void 0;
|
|
69155
|
+
const container = view?.container;
|
|
69156
|
+
if (container instanceof Element) {
|
|
69157
|
+
container.classList.add("oml-diagram-multi-selected");
|
|
69158
|
+
if (id !== primarySelectedNodeId) {
|
|
69159
|
+
renderSecondaryDecoration(container);
|
|
69160
|
+
} else {
|
|
69161
|
+
clearSecondaryDecoration(container);
|
|
69162
|
+
}
|
|
69163
|
+
}
|
|
69164
|
+
}
|
|
69165
|
+
};
|
|
69166
|
+
const applyMultiSelectionClasses = () => {
|
|
69167
|
+
if (applySelectionScheduled) {
|
|
69168
|
+
return;
|
|
69169
|
+
}
|
|
69170
|
+
applySelectionScheduled = true;
|
|
69171
|
+
window.requestAnimationFrame(() => {
|
|
69172
|
+
window.requestAnimationFrame(() => {
|
|
69173
|
+
applySelectionScheduled = false;
|
|
69174
|
+
applyMultiSelectionClassesNow();
|
|
69175
|
+
});
|
|
69176
|
+
});
|
|
69177
|
+
};
|
|
69178
|
+
const replaceMultiSelection = (ids) => {
|
|
69179
|
+
multiSelectedNodeIds.clear();
|
|
69180
|
+
for (const id of ids) {
|
|
69181
|
+
if (!id) {
|
|
69182
|
+
continue;
|
|
69183
|
+
}
|
|
69184
|
+
multiSelectedNodeIds.add(id);
|
|
69185
|
+
}
|
|
69186
|
+
applyMultiSelectionClasses();
|
|
69187
|
+
};
|
|
69188
|
+
const clearMultiSelection = () => {
|
|
69189
|
+
multiSelectedNodeIds.clear();
|
|
69190
|
+
applyMultiSelectionClasses();
|
|
69036
69191
|
};
|
|
69037
69192
|
graphView.on("node:mousedown", ({ node, e }) => {
|
|
69193
|
+
const targetCell = selectionTargetForNode(node);
|
|
69194
|
+
if (!targetCell) {
|
|
69195
|
+
return;
|
|
69196
|
+
}
|
|
69197
|
+
const targetId = String(targetCell?.id ?? "");
|
|
69198
|
+
const additive = !!(e.metaKey || e.ctrlKey || e.shiftKey);
|
|
69199
|
+
if (additive) {
|
|
69200
|
+
if (multiSelectedNodeIds.has(targetId)) {
|
|
69201
|
+
multiSelectedNodeIds.delete(targetId);
|
|
69202
|
+
if (primarySelectedNodeId === targetId) {
|
|
69203
|
+
primarySelectedNodeId = multiSelectedNodeIds.values().next().value;
|
|
69204
|
+
}
|
|
69205
|
+
} else if (targetId) {
|
|
69206
|
+
multiSelectedNodeIds.add(targetId);
|
|
69207
|
+
primarySelectedNodeId = targetId;
|
|
69208
|
+
}
|
|
69209
|
+
} else if (targetId) {
|
|
69210
|
+
replaceMultiSelection([targetId]);
|
|
69211
|
+
primarySelectedNodeId = targetId;
|
|
69212
|
+
}
|
|
69213
|
+
applyMultiSelectionClasses();
|
|
69214
|
+
refreshPrimaryWidget();
|
|
69038
69215
|
if (!isCompartmentNode(node)) {
|
|
69039
69216
|
return;
|
|
69040
69217
|
}
|
|
69041
|
-
selectCompartmentParent(node);
|
|
69042
69218
|
e.preventDefault();
|
|
69043
69219
|
e.stopPropagation();
|
|
69044
69220
|
if (typeof e.stopImmediatePropagation === "function") {
|
|
@@ -69046,12 +69222,49 @@
|
|
|
69046
69222
|
}
|
|
69047
69223
|
});
|
|
69048
69224
|
graphView.on("node:click", ({ node, e }) => {
|
|
69049
|
-
if (
|
|
69225
|
+
if (isCompartmentNode(node)) {
|
|
69226
|
+
refreshPrimaryWidget();
|
|
69227
|
+
e.preventDefault();
|
|
69228
|
+
e.stopPropagation();
|
|
69229
|
+
if (typeof e.stopImmediatePropagation === "function") {
|
|
69230
|
+
e.stopImmediatePropagation();
|
|
69231
|
+
}
|
|
69232
|
+
}
|
|
69233
|
+
});
|
|
69234
|
+
graphView.on("node:contextmenu", ({ node, e }) => {
|
|
69235
|
+
const targetCell = selectionTargetForNode(node);
|
|
69236
|
+
const targetId = String(targetCell?.id ?? "");
|
|
69237
|
+
if (!targetId) {
|
|
69050
69238
|
return;
|
|
69051
69239
|
}
|
|
69052
|
-
|
|
69240
|
+
if (!multiSelectedNodeIds.has(targetId)) {
|
|
69241
|
+
multiSelectedNodeIds.clear();
|
|
69242
|
+
multiSelectedNodeIds.add(targetId);
|
|
69243
|
+
primarySelectedNodeId = targetId;
|
|
69244
|
+
applyMultiSelectionClasses();
|
|
69245
|
+
refreshPrimaryWidget();
|
|
69246
|
+
}
|
|
69247
|
+
const selectedIris = [...multiSelectedNodeIds];
|
|
69248
|
+
liveCanvas.dispatchEvent(new CustomEvent("md-diagram-selection-contextmenu", {
|
|
69249
|
+
bubbles: true,
|
|
69250
|
+
detail: {
|
|
69251
|
+
iri: targetId,
|
|
69252
|
+
name: displayLabelFromIri(targetId),
|
|
69253
|
+
selectedIris,
|
|
69254
|
+
clientX: e.clientX,
|
|
69255
|
+
clientY: e.clientY
|
|
69256
|
+
}
|
|
69257
|
+
}));
|
|
69053
69258
|
e.preventDefault();
|
|
69054
69259
|
e.stopPropagation();
|
|
69260
|
+
if (typeof e.stopImmediatePropagation === "function") {
|
|
69261
|
+
e.stopImmediatePropagation();
|
|
69262
|
+
}
|
|
69263
|
+
});
|
|
69264
|
+
graphView.on("blank:mousedown", () => {
|
|
69265
|
+
clearMultiSelection();
|
|
69266
|
+
primarySelectedNodeId = void 0;
|
|
69267
|
+
refreshPrimaryWidget();
|
|
69055
69268
|
});
|
|
69056
69269
|
const sidePriority = (side) => {
|
|
69057
69270
|
switch (side) {
|
|
@@ -69249,7 +69462,7 @@
|
|
|
69249
69462
|
bubbles: true,
|
|
69250
69463
|
detail: {
|
|
69251
69464
|
iri,
|
|
69252
|
-
previewEnabled: !!e &&
|
|
69465
|
+
previewEnabled: !!e && e.altKey,
|
|
69253
69466
|
anchorRect: {
|
|
69254
69467
|
left: bbox3.left,
|
|
69255
69468
|
right: bbox3.right,
|
|
@@ -71399,7 +71612,7 @@ ${serialized}`;
|
|
|
71399
71612
|
bubbles: true,
|
|
71400
71613
|
detail: {
|
|
71401
71614
|
iri,
|
|
71402
|
-
previewEnabled: !!e &&
|
|
71615
|
+
previewEnabled: !!e && e.altKey,
|
|
71403
71616
|
anchorRect: {
|
|
71404
71617
|
left: bbox3.left,
|
|
71405
71618
|
right: bbox3.right,
|
|
@@ -71438,7 +71651,7 @@ ${serialized}`;
|
|
|
71438
71651
|
detail: {
|
|
71439
71652
|
blockId,
|
|
71440
71653
|
blockSource: source,
|
|
71441
|
-
|
|
71654
|
+
contextMemberIri: iri.trim()
|
|
71442
71655
|
}
|
|
71443
71656
|
}));
|
|
71444
71657
|
return;
|
|
@@ -73534,15 +73747,17 @@ ${serialized}`;
|
|
|
73534
73747
|
cells: visibleColumnIndexes.map((columnIndex) => row.cells[columnIndex] ?? ""),
|
|
73535
73748
|
typedCells: visibleColumnIndexes.map((columnIndex) => row.typedCells?.[columnIndex])
|
|
73536
73749
|
}));
|
|
73750
|
+
const dedupeVisibleRows = hiddenColumns.size > 0 && !isTree;
|
|
73751
|
+
const visibleRows = dedupeVisibleRows ? dedupeRowsByDisplayedCells(rowsWithIndex) : rowsWithIndex;
|
|
73537
73752
|
root2.__omlAiContext = {
|
|
73538
73753
|
columns: visibleColumns.slice(),
|
|
73539
|
-
rows:
|
|
73754
|
+
rows: visibleRows.map((row) => ({
|
|
73540
73755
|
iri: (row.cells[0] ?? "").trim(),
|
|
73541
73756
|
cells: row.cells.slice()
|
|
73542
73757
|
})).filter((row) => row.iri.length > 0),
|
|
73543
73758
|
blockSource
|
|
73544
73759
|
};
|
|
73545
|
-
const columnContexts = createColumnContexts(visibleColumns,
|
|
73760
|
+
const columnContexts = createColumnContexts(visibleColumns, visibleRows);
|
|
73546
73761
|
const treeModel = isTree ? this.createTreeModel(columns, allRowsWithIndex, visibleColumnIndexes, options) : void 0;
|
|
73547
73762
|
const fullyExpandedTreeRows = isTree && treeModel ? this.flattenAllTreeRows(treeModel) : void 0;
|
|
73548
73763
|
const persistedState = blockId ? window.__omlGetPersistedTableUiState?.(blockId) : void 0;
|
|
@@ -73646,7 +73861,7 @@ ${serialized}`;
|
|
|
73646
73861
|
iconSvg.appendChild(iconPath);
|
|
73647
73862
|
downloadButton.appendChild(iconSvg);
|
|
73648
73863
|
downloadButton.addEventListener("click", () => {
|
|
73649
|
-
const sourceRows = isTree && treeModel ? this.resolveTreeSourceRows(treeModel, visibleColumns, state.expanded, state.search, blockSource, options) :
|
|
73864
|
+
const sourceRows = isTree && treeModel ? this.resolveTreeSourceRows(treeModel, visibleColumns, state.expanded, state.search, blockSource, options) : visibleRows;
|
|
73650
73865
|
if (isTree && treeModel) {
|
|
73651
73866
|
this.requestTreeJsonDownload(visibleColumns, treeModel, sourceRows);
|
|
73652
73867
|
return;
|
|
@@ -73656,7 +73871,7 @@ ${serialized}`;
|
|
|
73656
73871
|
this.requestCsvDownload(csvExport.columns, csvExport.rows);
|
|
73657
73872
|
});
|
|
73658
73873
|
controlsRight.appendChild(downloadButton);
|
|
73659
|
-
const uploadButton = this.createUploadCsvButton(visibleColumns,
|
|
73874
|
+
const uploadButton = this.createUploadCsvButton(visibleColumns, visibleRows, isTree, blockSource);
|
|
73660
73875
|
if (uploadButton) {
|
|
73661
73876
|
controlsRight.appendChild(uploadButton);
|
|
73662
73877
|
}
|
|
@@ -73703,7 +73918,7 @@ ${serialized}`;
|
|
|
73703
73918
|
if (isTree) {
|
|
73704
73919
|
return;
|
|
73705
73920
|
}
|
|
73706
|
-
const filtered = this.applyFiltersAndSorting(visibleColumns,
|
|
73921
|
+
const filtered = this.applyFiltersAndSorting(visibleColumns, visibleRows, state, blockSource, options);
|
|
73707
73922
|
const totalPages = Math.max(1, Math.ceil(filtered.length / state.pageSize));
|
|
73708
73923
|
if (state.page < totalPages - 1) {
|
|
73709
73924
|
state.page += 1;
|
|
@@ -73723,7 +73938,7 @@ ${serialized}`;
|
|
|
73723
73938
|
}
|
|
73724
73939
|
root2.appendChild(footer);
|
|
73725
73940
|
const renderPage = () => {
|
|
73726
|
-
const sourceRows = isTree && treeModel ? this.resolveTreeSourceRows(treeModel, visibleColumns, state.expanded, state.search, blockSource, options) :
|
|
73941
|
+
const sourceRows = isTree && treeModel ? this.resolveTreeSourceRows(treeModel, visibleColumns, state.expanded, state.search, blockSource, options) : visibleRows;
|
|
73727
73942
|
const filtered = isTree ? sourceRows.slice() : this.applyFiltersAndSorting(visibleColumns, sourceRows, state, blockSource, options);
|
|
73728
73943
|
const total = filtered.length;
|
|
73729
73944
|
const totalTreeRows = isTree ? fullyExpandedTreeRows?.length ?? total : total;
|
|
@@ -73767,7 +73982,7 @@ ${serialized}`;
|
|
|
73767
73982
|
state,
|
|
73768
73983
|
root: root2,
|
|
73769
73984
|
columns: visibleColumns,
|
|
73770
|
-
rows: fullyExpandedTreeRows ??
|
|
73985
|
+
rows: fullyExpandedTreeRows ?? visibleRows,
|
|
73771
73986
|
referenceCell: label,
|
|
73772
73987
|
rerender: renderPage
|
|
73773
73988
|
});
|
|
@@ -73821,7 +74036,7 @@ ${serialized}`;
|
|
|
73821
74036
|
this.onRowDoubleClick({
|
|
73822
74037
|
root: root2,
|
|
73823
74038
|
columns: visibleColumns,
|
|
73824
|
-
rows:
|
|
74039
|
+
rows: visibleRows.map((row) => ({ index: row.index, cells: row.cells.slice() })),
|
|
73825
74040
|
row: { index: rowEntry.index, cells: rowEntry.cells.slice() },
|
|
73826
74041
|
blockSource,
|
|
73827
74042
|
typeOptions: this.extractTypeOptions(blockSource)
|
|
@@ -73840,7 +74055,7 @@ ${serialized}`;
|
|
|
73840
74055
|
this.appendCustomLeftControls(controlsLeft, {
|
|
73841
74056
|
root: root2,
|
|
73842
74057
|
columns: visibleColumns,
|
|
73843
|
-
rows:
|
|
74058
|
+
rows: visibleRows.map((row) => ({ index: row.index, cells: row.cells.slice() })),
|
|
73844
74059
|
blockSource,
|
|
73845
74060
|
options,
|
|
73846
74061
|
typeOptions: this.extractTypeOptions(blockSource)
|
|
@@ -73849,7 +74064,7 @@ ${serialized}`;
|
|
|
73849
74064
|
this.scheduleInitialAutosize({
|
|
73850
74065
|
root: root2,
|
|
73851
74066
|
columns: visibleColumns,
|
|
73852
|
-
rows: fullyExpandedTreeRows ??
|
|
74067
|
+
rows: fullyExpandedTreeRows ?? visibleRows,
|
|
73853
74068
|
state,
|
|
73854
74069
|
rerender: renderPage
|
|
73855
74070
|
});
|
|
@@ -74418,6 +74633,19 @@ ${serialized}`;
|
|
|
74418
74633
|
return keys2;
|
|
74419
74634
|
}
|
|
74420
74635
|
};
|
|
74636
|
+
function dedupeRowsByDisplayedCells(rows) {
|
|
74637
|
+
const seen = /* @__PURE__ */ new Set();
|
|
74638
|
+
const deduped = [];
|
|
74639
|
+
for (const row of rows) {
|
|
74640
|
+
const key = row.cells.join("\0");
|
|
74641
|
+
if (seen.has(key)) {
|
|
74642
|
+
continue;
|
|
74643
|
+
}
|
|
74644
|
+
seen.add(key);
|
|
74645
|
+
deduped.push(row);
|
|
74646
|
+
}
|
|
74647
|
+
return deduped;
|
|
74648
|
+
}
|
|
74421
74649
|
function compileTableStylesheet(options) {
|
|
74422
74650
|
const rawStylesheet = options?.stylesheet;
|
|
74423
74651
|
if (!Array.isArray(rawStylesheet)) {
|
|
@@ -75339,6 +75567,11 @@ ${serialized}`;
|
|
|
75339
75567
|
|
|
75340
75568
|
// src/static/browser-runtime.ts
|
|
75341
75569
|
var SUPPORTED = /* @__PURE__ */ new Set(["table", "tree", "graph", "chart", "diagram", "list", "text", "matrix", "table-editor"]);
|
|
75570
|
+
var wikilinkPreviewCard;
|
|
75571
|
+
var wikilinkPreviewHideTimer;
|
|
75572
|
+
var wikilinkPreviewRequestToken = 0;
|
|
75573
|
+
var tabPreviewModifierActive = false;
|
|
75574
|
+
var activeWikilinkHover;
|
|
75342
75575
|
function parseJsonNode(id, fallback) {
|
|
75343
75576
|
const node = document.getElementById(id);
|
|
75344
75577
|
if (!node) {
|
|
@@ -75485,6 +75718,236 @@ ${serialized}`;
|
|
|
75485
75718
|
window.location.assign(href);
|
|
75486
75719
|
});
|
|
75487
75720
|
}
|
|
75721
|
+
function isHoverPreviewEnabled(event) {
|
|
75722
|
+
if (!event) {
|
|
75723
|
+
return false;
|
|
75724
|
+
}
|
|
75725
|
+
return event.altKey || tabPreviewModifierActive;
|
|
75726
|
+
}
|
|
75727
|
+
function normalizeHoverAnchorRect(value) {
|
|
75728
|
+
if (!value || typeof value !== "object") {
|
|
75729
|
+
return void 0;
|
|
75730
|
+
}
|
|
75731
|
+
const obj = value;
|
|
75732
|
+
if (typeof obj.left !== "number" || typeof obj.right !== "number" || typeof obj.top !== "number" || typeof obj.bottom !== "number" || typeof obj.width !== "number" || typeof obj.height !== "number") {
|
|
75733
|
+
return void 0;
|
|
75734
|
+
}
|
|
75735
|
+
return {
|
|
75736
|
+
left: obj.left,
|
|
75737
|
+
right: obj.right,
|
|
75738
|
+
top: obj.top,
|
|
75739
|
+
bottom: obj.bottom,
|
|
75740
|
+
width: obj.width,
|
|
75741
|
+
height: obj.height
|
|
75742
|
+
};
|
|
75743
|
+
}
|
|
75744
|
+
function ensureWikilinkPreviewCard() {
|
|
75745
|
+
if (wikilinkPreviewCard) {
|
|
75746
|
+
return wikilinkPreviewCard;
|
|
75747
|
+
}
|
|
75748
|
+
const card = document.createElement("div");
|
|
75749
|
+
card.className = "oml-wikilink-preview-card";
|
|
75750
|
+
card.style.position = "fixed";
|
|
75751
|
+
card.style.zIndex = "1200";
|
|
75752
|
+
card.style.display = "none";
|
|
75753
|
+
card.style.width = "min(640px, calc(100vw - 48px))";
|
|
75754
|
+
card.style.height = "min(480px, calc(100vh - 48px))";
|
|
75755
|
+
card.style.overflow = "hidden";
|
|
75756
|
+
card.style.padding = "0";
|
|
75757
|
+
card.style.border = "1px solid var(--vscode-editorWidget-border, #c8ccd1)";
|
|
75758
|
+
card.style.borderRadius = "10px";
|
|
75759
|
+
card.style.background = "var(--vscode-editor-background, #ffffff)";
|
|
75760
|
+
card.style.color = "var(--vscode-editor-foreground, #1f2328)";
|
|
75761
|
+
card.style.boxShadow = "0 8px 24px rgb(0 0 0 / 24%)";
|
|
75762
|
+
card.style.fontFamily = "system-ui, -apple-system, Segoe UI, Roboto, sans-serif";
|
|
75763
|
+
card.addEventListener("mouseenter", () => {
|
|
75764
|
+
if (wikilinkPreviewHideTimer !== void 0) {
|
|
75765
|
+
window.clearTimeout(wikilinkPreviewHideTimer);
|
|
75766
|
+
wikilinkPreviewHideTimer = void 0;
|
|
75767
|
+
}
|
|
75768
|
+
});
|
|
75769
|
+
document.body.appendChild(card);
|
|
75770
|
+
wikilinkPreviewCard = card;
|
|
75771
|
+
return card;
|
|
75772
|
+
}
|
|
75773
|
+
function scheduleHideWikilinkPreview() {
|
|
75774
|
+
wikilinkPreviewRequestToken += 1;
|
|
75775
|
+
if (wikilinkPreviewHideTimer !== void 0) {
|
|
75776
|
+
window.clearTimeout(wikilinkPreviewHideTimer);
|
|
75777
|
+
wikilinkPreviewHideTimer = void 0;
|
|
75778
|
+
}
|
|
75779
|
+
if (wikilinkPreviewCard) {
|
|
75780
|
+
wikilinkPreviewCard.style.display = "none";
|
|
75781
|
+
wikilinkPreviewCard.replaceChildren();
|
|
75782
|
+
}
|
|
75783
|
+
}
|
|
75784
|
+
async function scheduleIriPreview(iri, href, anchorRect) {
|
|
75785
|
+
if (wikilinkPreviewHideTimer !== void 0) {
|
|
75786
|
+
window.clearTimeout(wikilinkPreviewHideTimer);
|
|
75787
|
+
wikilinkPreviewHideTimer = void 0;
|
|
75788
|
+
}
|
|
75789
|
+
const token = ++wikilinkPreviewRequestToken;
|
|
75790
|
+
await new Promise((resolve4) => window.setTimeout(resolve4, 220));
|
|
75791
|
+
if (token !== wikilinkPreviewRequestToken) {
|
|
75792
|
+
return;
|
|
75793
|
+
}
|
|
75794
|
+
const card = ensureWikilinkPreviewCard();
|
|
75795
|
+
const iframe = document.createElement("iframe");
|
|
75796
|
+
const iframeSrc = new URL(href, window.location.href);
|
|
75797
|
+
iframeSrc.searchParams.set("_oml_preview", "1");
|
|
75798
|
+
iframe.src = iframeSrc.toString();
|
|
75799
|
+
iframe.style.width = "100%";
|
|
75800
|
+
iframe.style.height = "100%";
|
|
75801
|
+
iframe.style.border = "none";
|
|
75802
|
+
iframe.style.borderRadius = "4px";
|
|
75803
|
+
iframe.style.background = "var(--vscode-editor-background, #ffffff)";
|
|
75804
|
+
iframe.style.display = "block";
|
|
75805
|
+
iframe.addEventListener("load", () => {
|
|
75806
|
+
try {
|
|
75807
|
+
const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
|
|
75808
|
+
if (!iframeDoc) {
|
|
75809
|
+
return;
|
|
75810
|
+
}
|
|
75811
|
+
const allLinks = iframeDoc.querySelectorAll("a[download]");
|
|
75812
|
+
allLinks.forEach((link2) => link2.removeAttribute("download"));
|
|
75813
|
+
iframeDoc.addEventListener("click", (event) => {
|
|
75814
|
+
const target = event.target;
|
|
75815
|
+
if (!(target instanceof Element)) {
|
|
75816
|
+
return;
|
|
75817
|
+
}
|
|
75818
|
+
const link2 = target.closest("a[href]");
|
|
75819
|
+
if (!link2 || !(link2 instanceof HTMLAnchorElement)) {
|
|
75820
|
+
return;
|
|
75821
|
+
}
|
|
75822
|
+
const linkHref = link2.getAttribute("href");
|
|
75823
|
+
if (!linkHref) {
|
|
75824
|
+
return;
|
|
75825
|
+
}
|
|
75826
|
+
if (linkHref.startsWith("#")) {
|
|
75827
|
+
return;
|
|
75828
|
+
}
|
|
75829
|
+
event.preventDefault();
|
|
75830
|
+
event.stopPropagation();
|
|
75831
|
+
event.stopImmediatePropagation();
|
|
75832
|
+
const iframeLocation = iframe.contentWindow?.location.href;
|
|
75833
|
+
const absoluteUrl = new URL(linkHref, iframeLocation || iframe.src);
|
|
75834
|
+
absoluteUrl.searchParams.delete("_oml_preview");
|
|
75835
|
+
scheduleHideWikilinkPreview();
|
|
75836
|
+
const targetUrl = absoluteUrl.toString();
|
|
75837
|
+
window.location.assign(targetUrl);
|
|
75838
|
+
return false;
|
|
75839
|
+
}, true);
|
|
75840
|
+
} catch (error2) {
|
|
75841
|
+
console.warn("Could not access iframe content for click interception:", error2);
|
|
75842
|
+
}
|
|
75843
|
+
});
|
|
75844
|
+
card.replaceChildren(iframe);
|
|
75845
|
+
card.style.display = "block";
|
|
75846
|
+
const cardRect = card.getBoundingClientRect();
|
|
75847
|
+
const margin = 12;
|
|
75848
|
+
const left4 = Math.min(
|
|
75849
|
+
Math.max(16, anchorRect.left),
|
|
75850
|
+
Math.max(16, window.innerWidth - cardRect.width - 16)
|
|
75851
|
+
);
|
|
75852
|
+
let top4 = anchorRect.bottom + margin;
|
|
75853
|
+
if (top4 + cardRect.height > window.innerHeight - 16) {
|
|
75854
|
+
top4 = Math.max(16, window.innerHeight - cardRect.height - 16);
|
|
75855
|
+
}
|
|
75856
|
+
card.style.left = `${left4}px`;
|
|
75857
|
+
card.style.top = `${top4}px`;
|
|
75858
|
+
}
|
|
75859
|
+
function setupWikilinkHoverPreview(wikilinkIndex, iriAliasIndex, linkingEnabled) {
|
|
75860
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
75861
|
+
if (urlParams.has("_oml_preview")) {
|
|
75862
|
+
return;
|
|
75863
|
+
}
|
|
75864
|
+
document.addEventListener("click", (event) => {
|
|
75865
|
+
if (!wikilinkPreviewCard || wikilinkPreviewCard.style.display === "none") {
|
|
75866
|
+
return;
|
|
75867
|
+
}
|
|
75868
|
+
const target = event.target;
|
|
75869
|
+
if (!(target instanceof Element)) {
|
|
75870
|
+
return;
|
|
75871
|
+
}
|
|
75872
|
+
if (!target.closest(".oml-wikilink-preview-card")) {
|
|
75873
|
+
scheduleHideWikilinkPreview();
|
|
75874
|
+
activeWikilinkHover = void 0;
|
|
75875
|
+
}
|
|
75876
|
+
}, true);
|
|
75877
|
+
document.body.addEventListener("mouseover", (event) => {
|
|
75878
|
+
const target = event.target instanceof Element ? event.target : event.target instanceof Node ? event.target.parentElement : null;
|
|
75879
|
+
if (!target || target.closest(".oml-wikilink-preview-card")) {
|
|
75880
|
+
return;
|
|
75881
|
+
}
|
|
75882
|
+
const link2 = target.closest("a.wikilink[iri]");
|
|
75883
|
+
if (!link2) {
|
|
75884
|
+
return;
|
|
75885
|
+
}
|
|
75886
|
+
const iri = link2.getAttribute("iri")?.trim();
|
|
75887
|
+
const href = link2.getAttribute("href")?.trim();
|
|
75888
|
+
if (!iri || !href || href === "#") {
|
|
75889
|
+
return;
|
|
75890
|
+
}
|
|
75891
|
+
activeWikilinkHover = { link: link2, iri };
|
|
75892
|
+
if (isHoverPreviewEnabled(event)) {
|
|
75893
|
+
void scheduleIriPreview(iri, href, link2.getBoundingClientRect());
|
|
75894
|
+
}
|
|
75895
|
+
});
|
|
75896
|
+
window.addEventListener("keydown", (event) => {
|
|
75897
|
+
if (event.key === "Escape") {
|
|
75898
|
+
scheduleHideWikilinkPreview();
|
|
75899
|
+
activeWikilinkHover = void 0;
|
|
75900
|
+
return;
|
|
75901
|
+
}
|
|
75902
|
+
if (event.key === "Tab") {
|
|
75903
|
+
tabPreviewModifierActive = true;
|
|
75904
|
+
}
|
|
75905
|
+
if (!activeWikilinkHover) {
|
|
75906
|
+
return;
|
|
75907
|
+
}
|
|
75908
|
+
if (!(event.altKey || event.key === "Alt" || event.key === "Tab" && tabPreviewModifierActive)) {
|
|
75909
|
+
return;
|
|
75910
|
+
}
|
|
75911
|
+
const link2 = activeWikilinkHover.link;
|
|
75912
|
+
if (!link2.isConnected || !link2.matches(":hover")) {
|
|
75913
|
+
return;
|
|
75914
|
+
}
|
|
75915
|
+
const href = link2.getAttribute("href")?.trim();
|
|
75916
|
+
if (!href || href === "#") {
|
|
75917
|
+
return;
|
|
75918
|
+
}
|
|
75919
|
+
void scheduleIriPreview(activeWikilinkHover.iri, href, link2.getBoundingClientRect());
|
|
75920
|
+
});
|
|
75921
|
+
window.addEventListener("keyup", (event) => {
|
|
75922
|
+
if (event.key === "Tab") {
|
|
75923
|
+
tabPreviewModifierActive = false;
|
|
75924
|
+
}
|
|
75925
|
+
});
|
|
75926
|
+
window.addEventListener("blur", () => {
|
|
75927
|
+
tabPreviewModifierActive = false;
|
|
75928
|
+
});
|
|
75929
|
+
window.addEventListener("md-show-iri-hover", (event) => {
|
|
75930
|
+
if (!(event instanceof CustomEvent)) {
|
|
75931
|
+
return;
|
|
75932
|
+
}
|
|
75933
|
+
const eventTarget = event.target;
|
|
75934
|
+
if (eventTarget instanceof Element && eventTarget.closest(".oml-wikilink-preview-card")) {
|
|
75935
|
+
return;
|
|
75936
|
+
}
|
|
75937
|
+
const detail = event.detail;
|
|
75938
|
+
const iri = typeof detail?.iri === "string" ? detail.iri.trim() : "";
|
|
75939
|
+
const anchorRect = normalizeHoverAnchorRect(detail?.anchorRect);
|
|
75940
|
+
const previewEnabled = detail?.previewEnabled === true;
|
|
75941
|
+
if (!iri || !anchorRect || !previewEnabled || !linkingEnabled) {
|
|
75942
|
+
return;
|
|
75943
|
+
}
|
|
75944
|
+
const href = resolveWikiHref(iri, wikilinkIndex, iriAliasIndex);
|
|
75945
|
+
if (!href || href === "#") {
|
|
75946
|
+
return;
|
|
75947
|
+
}
|
|
75948
|
+
void scheduleIriPreview(iri, href, anchorRect);
|
|
75949
|
+
});
|
|
75950
|
+
}
|
|
75488
75951
|
function getMdKindFromCodeElement(code2) {
|
|
75489
75952
|
for (const className3 of Array.from(code2.classList)) {
|
|
75490
75953
|
if (!className3.startsWith("language-")) {
|
|
@@ -75518,6 +75981,7 @@ ${serialized}`;
|
|
|
75518
75981
|
applyWikilinks(document, wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
75519
75982
|
installWikilinkObserver(wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
75520
75983
|
setupIriNavigationHandler(wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
75984
|
+
setupWikilinkHoverPreview(wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
75521
75985
|
const manifest = parseJsonNode("oml-md-block-manifest", []);
|
|
75522
75986
|
if (!Array.isArray(manifest) || manifest.length === 0) {
|
|
75523
75987
|
return;
|
|
@@ -75591,7 +76055,7 @@ lodash-es/lodash.js:
|
|
|
75591
76055
|
(**
|
|
75592
76056
|
* @license
|
|
75593
76057
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
75594
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
76058
|
+
* Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
|
|
75595
76059
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
75596
76060
|
* Released under MIT license <https://lodash.com/license>
|
|
75597
76061
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|