@oml/markdown 0.7.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/README.md +39 -0
- package/out/index.d.ts +2 -0
- package/out/index.js +4 -0
- package/out/index.js.map +1 -0
- package/out/md/index.d.ts +6 -0
- package/out/md/index.js +8 -0
- package/out/md/index.js.map +1 -0
- package/out/md/md-execution.d.ts +33 -0
- package/out/md/md-execution.js +3 -0
- package/out/md/md-execution.js.map +1 -0
- package/out/md/md-executor.d.ts +21 -0
- package/out/md/md-executor.js +498 -0
- package/out/md/md-executor.js.map +1 -0
- package/out/md/md-frontmatter.d.ts +4 -0
- package/out/md/md-frontmatter.js +48 -0
- package/out/md/md-frontmatter.js.map +1 -0
- package/out/md/md-registry.d.ts +7 -0
- package/out/md/md-registry.js +19 -0
- package/out/md/md-registry.js.map +1 -0
- package/out/md/md-runtime.d.ts +10 -0
- package/out/md/md-runtime.js +166 -0
- package/out/md/md-runtime.js.map +1 -0
- package/out/md/md-types.d.ts +40 -0
- package/out/md/md-types.js +3 -0
- package/out/md/md-types.js.map +1 -0
- package/out/md/md-yaml.d.ts +1 -0
- package/out/md/md-yaml.js +15 -0
- package/out/md/md-yaml.js.map +1 -0
- package/out/renderers/chart-renderer.d.ts +6 -0
- package/out/renderers/chart-renderer.js +392 -0
- package/out/renderers/chart-renderer.js.map +1 -0
- package/out/renderers/diagram-renderer.d.ts +7 -0
- package/out/renderers/diagram-renderer.js +2354 -0
- package/out/renderers/diagram-renderer.js.map +1 -0
- package/out/renderers/graph-renderer.d.ts +6 -0
- package/out/renderers/graph-renderer.js +1384 -0
- package/out/renderers/graph-renderer.js.map +1 -0
- package/out/renderers/index.d.ts +14 -0
- package/out/renderers/index.js +16 -0
- package/out/renderers/index.js.map +1 -0
- package/out/renderers/list-renderer.d.ts +6 -0
- package/out/renderers/list-renderer.js +252 -0
- package/out/renderers/list-renderer.js.map +1 -0
- package/out/renderers/matrix-renderer.d.ts +14 -0
- package/out/renderers/matrix-renderer.js +498 -0
- package/out/renderers/matrix-renderer.js.map +1 -0
- package/out/renderers/message-renderer.d.ts +6 -0
- package/out/renderers/message-renderer.js +14 -0
- package/out/renderers/message-renderer.js.map +1 -0
- package/out/renderers/registry.d.ts +9 -0
- package/out/renderers/registry.js +41 -0
- package/out/renderers/registry.js.map +1 -0
- package/out/renderers/renderer.d.ts +28 -0
- package/out/renderers/renderer.js +61 -0
- package/out/renderers/renderer.js.map +1 -0
- package/out/renderers/table-editor-renderer.d.ts +4 -0
- package/out/renderers/table-editor-renderer.js +9 -0
- package/out/renderers/table-editor-renderer.js.map +1 -0
- package/out/renderers/table-renderer.d.ts +95 -0
- package/out/renderers/table-renderer.js +1571 -0
- package/out/renderers/table-renderer.js.map +1 -0
- package/out/renderers/text-renderer.d.ts +7 -0
- package/out/renderers/text-renderer.js +219 -0
- package/out/renderers/text-renderer.js.map +1 -0
- package/out/renderers/tree-renderer.d.ts +4 -0
- package/out/renderers/tree-renderer.js +9 -0
- package/out/renderers/tree-renderer.js.map +1 -0
- package/out/renderers/types.d.ts +18 -0
- package/out/renderers/types.js +3 -0
- package/out/renderers/types.js.map +1 -0
- package/out/renderers/wikilink-utils.d.ts +6 -0
- package/out/renderers/wikilink-utils.js +100 -0
- package/out/renderers/wikilink-utils.js.map +1 -0
- package/out/static/browser-runtime.bundle.js +74155 -0
- package/out/static/browser-runtime.bundle.js.map +7 -0
- package/out/static/browser-runtime.d.ts +1 -0
- package/out/static/browser-runtime.js +218 -0
- package/out/static/browser-runtime.js.map +1 -0
- package/out/static/index.d.ts +1 -0
- package/out/static/index.js +3 -0
- package/out/static/index.js.map +1 -0
- package/out/static/runtime-assets.d.ts +2 -0
- package/out/static/runtime-assets.js +174 -0
- package/out/static/runtime-assets.js.map +1 -0
- package/package.json +74 -0
- package/src/index.ts +4 -0
- package/src/md/index.ts +8 -0
- package/src/md/md-execution.ts +51 -0
- package/src/md/md-executor.ts +598 -0
- package/src/md/md-frontmatter.ts +53 -0
- package/src/md/md-registry.ts +22 -0
- package/src/md/md-runtime.ts +191 -0
- package/src/md/md-types.ts +48 -0
- package/src/md/md-yaml.ts +17 -0
- package/src/renderers/chart-renderer.ts +473 -0
- package/src/renderers/diagram-renderer.ts +2520 -0
- package/src/renderers/graph-renderer.ts +1653 -0
- package/src/renderers/index.ts +16 -0
- package/src/renderers/list-renderer.ts +289 -0
- package/src/renderers/matrix-renderer.ts +616 -0
- package/src/renderers/message-renderer.ts +18 -0
- package/src/renderers/registry.ts +45 -0
- package/src/renderers/renderer.ts +84 -0
- package/src/renderers/table-editor-renderer.ts +8 -0
- package/src/renderers/table-renderer.ts +1868 -0
- package/src/renderers/text-renderer.ts +252 -0
- package/src/renderers/tree-renderer.ts +7 -0
- package/src/renderers/types.ts +22 -0
- package/src/renderers/wikilink-utils.ts +108 -0
- package/src/static/browser-runtime.ts +249 -0
- package/src/static/index.ts +3 -0
- package/src/static/runtime-assets.ts +175 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Copyright (c) 2026 Modelware. All rights reserved.
|
|
2
|
+
import { createMarkdownRendererRegistry } from '../renderers/registry.js';
|
|
3
|
+
const SUPPORTED = new Set(['table', 'tree', 'graph', 'chart', 'diagram', 'list', 'text', 'matrix', 'table-editor']);
|
|
4
|
+
function parseJsonNode(id, fallback) {
|
|
5
|
+
const node = document.getElementById(id);
|
|
6
|
+
if (!node) {
|
|
7
|
+
return fallback;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
return JSON.parse(node.textContent ?? '');
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function safeDecode(value) {
|
|
17
|
+
try {
|
|
18
|
+
return decodeURIComponent(value);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function normalizeWikiPathKey(raw) {
|
|
25
|
+
return String(raw || '')
|
|
26
|
+
.replace(/\\/g, '/')
|
|
27
|
+
.replace(/^\/+/, '')
|
|
28
|
+
.replace(/[/]+/g, '/')
|
|
29
|
+
.replace(/\.html$/i, '')
|
|
30
|
+
.replace(/^\.\//, '')
|
|
31
|
+
.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
function resolveWikiHref(iri, wikilinkIndex, iriAliasIndex) {
|
|
34
|
+
const text = String(iri || '').trim();
|
|
35
|
+
if (!text) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const alias = iriAliasIndex[text]
|
|
39
|
+
|| iriAliasIndex[text.replace(/[.,;:!?]+$/, '')]
|
|
40
|
+
|| iriAliasIndex[safeDecode(text)];
|
|
41
|
+
if (typeof alias === 'string' && alias.length > 0) {
|
|
42
|
+
return alias;
|
|
43
|
+
}
|
|
44
|
+
const hashIndex = text.indexOf('#');
|
|
45
|
+
const fragment = hashIndex >= 0 ? text.slice(hashIndex) : '';
|
|
46
|
+
const iriWithoutFragment = hashIndex >= 0 ? text.slice(0, hashIndex) : text;
|
|
47
|
+
let parsed;
|
|
48
|
+
try {
|
|
49
|
+
parsed = new URL(iriWithoutFragment);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const rawPath = safeDecode((parsed.pathname || '').replace(/^\/+/, ''));
|
|
55
|
+
const hostPath = `${(parsed.hostname || '').toLowerCase()}/${rawPath}`.replace(/^\/+/, '');
|
|
56
|
+
const candidates = [normalizeWikiPathKey(hostPath), normalizeWikiPathKey(rawPath)]
|
|
57
|
+
.filter((candidate, index, all) => candidate && all.indexOf(candidate) === index);
|
|
58
|
+
for (const candidate of candidates) {
|
|
59
|
+
const direct = wikilinkIndex[candidate];
|
|
60
|
+
if (typeof direct === 'string' && direct.length > 0) {
|
|
61
|
+
return direct + fragment;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
let bestMatch;
|
|
65
|
+
for (const candidate of candidates) {
|
|
66
|
+
for (const [key, href] of Object.entries(wikilinkIndex)) {
|
|
67
|
+
if (!candidate.endsWith('/' + key) && candidate !== key && !key.endsWith('/' + candidate)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (!bestMatch || key.length > bestMatch.key.length) {
|
|
71
|
+
bestMatch = { key, href };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (bestMatch && bestMatch.href.length > 0) {
|
|
76
|
+
return bestMatch.href + fragment;
|
|
77
|
+
}
|
|
78
|
+
if (fragment) {
|
|
79
|
+
const currentPath = normalizeWikiPathKey((window.location && window.location.pathname) || '');
|
|
80
|
+
if (currentPath && candidates.some((candidate) => candidate === currentPath)) {
|
|
81
|
+
return fragment;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
function applyWikilinks(scope, wikilinkIndex, iriAliasIndex, linkingEnabled) {
|
|
87
|
+
const links = Array.from(scope.querySelectorAll('a.wikilink[iri]'));
|
|
88
|
+
for (const link of links) {
|
|
89
|
+
const iri = link.getAttribute('iri') || '';
|
|
90
|
+
const label = link.textContent || iri;
|
|
91
|
+
if (!linkingEnabled) {
|
|
92
|
+
const span = document.createElement('span');
|
|
93
|
+
span.className = 'wikilink';
|
|
94
|
+
span.setAttribute('iri', iri);
|
|
95
|
+
span.title = iri;
|
|
96
|
+
span.textContent = label;
|
|
97
|
+
link.replaceWith(span);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const href = resolveWikiHref(iri, wikilinkIndex, iriAliasIndex);
|
|
101
|
+
if (href) {
|
|
102
|
+
link.href = href;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const span = document.createElement('span');
|
|
106
|
+
span.className = 'wikilink';
|
|
107
|
+
span.setAttribute('iri', iri);
|
|
108
|
+
span.title = iri;
|
|
109
|
+
span.textContent = label;
|
|
110
|
+
link.replaceWith(span);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function installWikilinkObserver(wikilinkIndex, iriAliasIndex, linkingEnabled) {
|
|
114
|
+
const observer = new MutationObserver((mutations) => {
|
|
115
|
+
for (const mutation of mutations) {
|
|
116
|
+
for (const added of Array.from(mutation.addedNodes)) {
|
|
117
|
+
if (!(added instanceof Element)) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (added.matches('a.wikilink[iri]')) {
|
|
121
|
+
applyWikilinks(added.parentElement ?? document, wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (added.querySelector('a.wikilink[iri]')) {
|
|
125
|
+
applyWikilinks(added, wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
131
|
+
}
|
|
132
|
+
function setupDownloadHandler() {
|
|
133
|
+
window.addEventListener('md-download-file', (event) => {
|
|
134
|
+
const detail = event.detail;
|
|
135
|
+
if (!detail || typeof detail.filename !== 'string') {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const blob = new Blob([detail.content ?? ''], { type: 'text/plain;charset=utf-8' });
|
|
139
|
+
const anchor = document.createElement('a');
|
|
140
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
141
|
+
anchor.href = objectUrl;
|
|
142
|
+
anchor.download = detail.filename;
|
|
143
|
+
anchor.style.display = 'none';
|
|
144
|
+
document.body.appendChild(anchor);
|
|
145
|
+
anchor.click();
|
|
146
|
+
anchor.remove();
|
|
147
|
+
URL.revokeObjectURL(objectUrl);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function getMdKindFromCodeElement(code) {
|
|
151
|
+
for (const className of Array.from(code.classList)) {
|
|
152
|
+
if (!className.startsWith('language-')) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const language = className.slice('language-'.length).toLowerCase();
|
|
156
|
+
if (SUPPORTED.has(language)) {
|
|
157
|
+
return language;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
async function loadResult(manifestEntry, inlineResults) {
|
|
163
|
+
if (manifestEntry.blockId && Object.prototype.hasOwnProperty.call(inlineResults, manifestEntry.blockId)) {
|
|
164
|
+
return inlineResults[manifestEntry.blockId];
|
|
165
|
+
}
|
|
166
|
+
const response = await fetch(manifestEntry.path);
|
|
167
|
+
if (!response.ok) {
|
|
168
|
+
return { status: 'error', message: `Failed to load block result: ${manifestEntry.path}` };
|
|
169
|
+
}
|
|
170
|
+
return await response.json();
|
|
171
|
+
}
|
|
172
|
+
async function applyExecutionResults() {
|
|
173
|
+
const inlineResults = parseJsonNode('oml-md-block-inline-results', {});
|
|
174
|
+
const wikilinkIndex = parseJsonNode('oml-md-wikilink-index', {});
|
|
175
|
+
const iriAliasIndex = parseJsonNode('oml-md-wikilink-iri-aliases', {});
|
|
176
|
+
const wikilinkConfig = parseJsonNode('oml-md-wikilink-config', { linkingEnabled: false });
|
|
177
|
+
const linkingEnabled = Boolean(wikilinkConfig?.linkingEnabled);
|
|
178
|
+
// Resolve wikilinks in regular markdown content (outside code-block panels).
|
|
179
|
+
applyWikilinks(document, wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
180
|
+
// Re-apply wikilinks for dynamic renderer re-renders (tables, filters, paging, etc.).
|
|
181
|
+
installWikilinkObserver(wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
182
|
+
const manifest = parseJsonNode('oml-md-block-manifest', []);
|
|
183
|
+
if (!Array.isArray(manifest) || manifest.length === 0) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const codeNodes = Array.from(document.querySelectorAll('pre > code'))
|
|
187
|
+
.filter((code) => getMdKindFromCodeElement(code) !== undefined);
|
|
188
|
+
if (codeNodes.length === 0) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const registry = createMarkdownRendererRegistry();
|
|
192
|
+
for (let index = 0; index < codeNodes.length && index < manifest.length; index += 1) {
|
|
193
|
+
const code = codeNodes[index];
|
|
194
|
+
const pre = code.parentElement;
|
|
195
|
+
if (!pre) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const result = await loadResult(manifest[index], inlineResults);
|
|
200
|
+
const panel = registry.render(result);
|
|
201
|
+
// Resolve wikilinks newly introduced by dynamic block renderers.
|
|
202
|
+
applyWikilinks(panel, wikilinkIndex, iriAliasIndex, linkingEnabled);
|
|
203
|
+
pre.replaceWith(panel);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
const panel = document.createElement('div');
|
|
207
|
+
panel.className = 'oml-md-result oml-md-result-error';
|
|
208
|
+
const message = document.createElement('div');
|
|
209
|
+
message.className = 'oml-md-result-message';
|
|
210
|
+
message.textContent = `Render error: ${error instanceof Error ? error.message : String(error)}`;
|
|
211
|
+
panel.appendChild(message);
|
|
212
|
+
pre.replaceWith(panel);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
setupDownloadHandler();
|
|
217
|
+
void applyExecutionResults();
|
|
218
|
+
//# sourceMappingURL=browser-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime.js","sourceRoot":"","sources":["../../src/static/browser-runtime.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AAKpH,SAAS,aAAa,CAAI,E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;IACL,CAAC;AACL,CAAC;AAED,oBAAoB,EAAE,CAAC;AACvB,KAAK,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runtime-assets.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/static/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const STATIC_MARKDOWN_RUNTIME_BUNDLE_FILE = "browser-runtime.bundle.js";
|
|
2
|
+
export declare const STATIC_MARKDOWN_RUNTIME_CSS = "\n.oml-md-result { margin: 1rem 0; }\n.oml-md-result-message {\n border: 1px solid #e5b567;\n background: #fff8e8;\n color: #6b4c15;\n border-radius: 8px;\n padding: 0.65rem 0.8rem;\n font-size: 0.95rem;\n}\n.oml-md-table-controls {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 0.75rem;\n margin-bottom: 0.5rem;\n flex-wrap: wrap;\n}\n.oml-md-table-controls-left,\n.oml-md-table-controls-right {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n.oml-md-table-filter,\n.oml-md-table-page-size {\n font: inherit;\n border: 1px solid #d0d7de;\n border-radius: 6px;\n padding: 0.35rem 0.55rem;\n background: #fff;\n}\n.oml-md-table-action-btn {\n font: inherit;\n border: 1px solid #d0d7de;\n border-radius: 6px;\n padding: 0.35rem 0.55rem;\n background: #fff;\n cursor: pointer;\n}\n.oml-md-table-action-btn:hover {\n background: #f6f8fa;\n}\n.oml-md-table-wrap {\n overflow: auto;\n border: 1px solid #d0d7de;\n border-radius: 8px;\n}\n.oml-md-static-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.92rem;\n}\n.oml-md-static-table thead th {\n position: sticky;\n top: 0;\n background: #f6f8fa;\n z-index: 1;\n}\n.oml-md-static-table th,\n.oml-md-static-table td {\n text-align: left;\n border-bottom: 1px solid #eaeef2;\n padding: 0.45rem 0.55rem;\n vertical-align: top;\n}\n.oml-md-static-table tbody tr:nth-child(even) {\n background: #fafbfc;\n}\n.oml-md-table-sortable {\n cursor: pointer;\n user-select: none;\n}\n.oml-md-table-pager {\n margin-top: 0.5rem;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n.oml-md-table-pager-btn {\n font: inherit;\n border: 1px solid #d0d7de;\n background: #fff;\n border-radius: 6px;\n padding: 0.2rem 0.55rem;\n cursor: pointer;\n}\n.oml-md-table-pager-btn:disabled {\n opacity: 0.45;\n cursor: default;\n}\n.oml-md-table-page-info {\n color: #57606a;\n font-size: 0.9rem;\n}\n.oml-md-tree-cell {\n display: flex;\n align-items: center;\n gap: 0.35rem;\n}\n.tree-toggle-button {\n width: 1rem;\n height: 1rem;\n padding: 0;\n line-height: 1;\n font-size: 0.85rem;\n border: 1px solid var(--vscode-editorWidget-border);\n background: var(--vscode-editor-background);\n color: var(--vscode-foreground);\n cursor: pointer;\n border-radius: 2px;\n}\n.tree-toggle-spacer {\n display: inline-block;\n width: 1rem;\n}\n\n/* Browser fallback theme values for static render (outside VS Code webview). */\n.oml-md-result .tree-filter {\n background: var(--vscode-input-background, #ffffff);\n color: var(--vscode-input-foreground, #24292f);\n border: 1px solid var(--vscode-input-border, #d0d7de);\n}\n\n.oml-md-result .tree-filter:focus {\n border-color: var(--vscode-focusBorder, #0969da);\n}\n\n.oml-md-result .table-pagesize {\n background: var(--vscode-dropdown-background, #ffffff);\n color: var(--vscode-dropdown-foreground, #24292f);\n border: 1px solid var(--vscode-dropdown-border, #d0d7de);\n}\n\n.oml-md-result .table-results-table-container {\n border: 1px solid var(--vscode-editorWidget-border, #d0d7de);\n}\n\n.oml-md-result .table-header-cell,\n.oml-md-result .table-cell,\n.oml-md-result .table-header-row > .table-header-cell:not(:last-child),\n.oml-md-result .table-row > .table-cell:not(:last-child) {\n border-color: var(--vscode-editorWidget-border, #d0d7de);\n}\n\n.oml-md-result .oml-md-static-table,\n.oml-md-result .oml-md-static-table th,\n.oml-md-result .oml-md-static-table td {\n border-color: var(--vscode-editorWidget-border, #d0d7de);\n}\n\n.oml-md-result .oml-md-static-table th:not(:last-child),\n.oml-md-result .oml-md-static-table td:not(:last-child) {\n border-right: 1px solid var(--vscode-editorWidget-border, #d0d7de);\n}\n\n/* Static fallback framing for canvas widgets (graph/diagram/chart). */\n.oml-md-result .graph-canvas-root {\n border: 1px solid var(--vscode-editorWidget-border, #b8c2cc);\n border-radius: 6px;\n background: var(--vscode-editor-background, var(--oml-static-background, #ffffff));\n}\n\n.oml-md-result .diagram-canvas-root .x6-graph,\n.oml-md-result .diagram-canvas-root .x6-graph-svg,\n.oml-md-result .diagram-canvas-root .x6-svg-stage,\n.oml-md-result .diagram-canvas-root .x6-svg,\n.oml-md-result .diagram-canvas-root svg {\n background: var(--vscode-editor-background, var(--oml-static-background, #ffffff));\n}\n";
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Copyright (c) 2026 Modelware. All rights reserved.
|
|
2
|
+
export const STATIC_MARKDOWN_RUNTIME_BUNDLE_FILE = 'browser-runtime.bundle.js';
|
|
3
|
+
export const STATIC_MARKDOWN_RUNTIME_CSS = `
|
|
4
|
+
.oml-md-result { margin: 1rem 0; }
|
|
5
|
+
.oml-md-result-message {
|
|
6
|
+
border: 1px solid #e5b567;
|
|
7
|
+
background: #fff8e8;
|
|
8
|
+
color: #6b4c15;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
padding: 0.65rem 0.8rem;
|
|
11
|
+
font-size: 0.95rem;
|
|
12
|
+
}
|
|
13
|
+
.oml-md-table-controls {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.75rem;
|
|
18
|
+
margin-bottom: 0.5rem;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
}
|
|
21
|
+
.oml-md-table-controls-left,
|
|
22
|
+
.oml-md-table-controls-right {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
.oml-md-table-filter,
|
|
28
|
+
.oml-md-table-page-size {
|
|
29
|
+
font: inherit;
|
|
30
|
+
border: 1px solid #d0d7de;
|
|
31
|
+
border-radius: 6px;
|
|
32
|
+
padding: 0.35rem 0.55rem;
|
|
33
|
+
background: #fff;
|
|
34
|
+
}
|
|
35
|
+
.oml-md-table-action-btn {
|
|
36
|
+
font: inherit;
|
|
37
|
+
border: 1px solid #d0d7de;
|
|
38
|
+
border-radius: 6px;
|
|
39
|
+
padding: 0.35rem 0.55rem;
|
|
40
|
+
background: #fff;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
.oml-md-table-action-btn:hover {
|
|
44
|
+
background: #f6f8fa;
|
|
45
|
+
}
|
|
46
|
+
.oml-md-table-wrap {
|
|
47
|
+
overflow: auto;
|
|
48
|
+
border: 1px solid #d0d7de;
|
|
49
|
+
border-radius: 8px;
|
|
50
|
+
}
|
|
51
|
+
.oml-md-static-table {
|
|
52
|
+
width: 100%;
|
|
53
|
+
border-collapse: collapse;
|
|
54
|
+
font-size: 0.92rem;
|
|
55
|
+
}
|
|
56
|
+
.oml-md-static-table thead th {
|
|
57
|
+
position: sticky;
|
|
58
|
+
top: 0;
|
|
59
|
+
background: #f6f8fa;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
}
|
|
62
|
+
.oml-md-static-table th,
|
|
63
|
+
.oml-md-static-table td {
|
|
64
|
+
text-align: left;
|
|
65
|
+
border-bottom: 1px solid #eaeef2;
|
|
66
|
+
padding: 0.45rem 0.55rem;
|
|
67
|
+
vertical-align: top;
|
|
68
|
+
}
|
|
69
|
+
.oml-md-static-table tbody tr:nth-child(even) {
|
|
70
|
+
background: #fafbfc;
|
|
71
|
+
}
|
|
72
|
+
.oml-md-table-sortable {
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
user-select: none;
|
|
75
|
+
}
|
|
76
|
+
.oml-md-table-pager {
|
|
77
|
+
margin-top: 0.5rem;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 0.5rem;
|
|
81
|
+
}
|
|
82
|
+
.oml-md-table-pager-btn {
|
|
83
|
+
font: inherit;
|
|
84
|
+
border: 1px solid #d0d7de;
|
|
85
|
+
background: #fff;
|
|
86
|
+
border-radius: 6px;
|
|
87
|
+
padding: 0.2rem 0.55rem;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.oml-md-table-pager-btn:disabled {
|
|
91
|
+
opacity: 0.45;
|
|
92
|
+
cursor: default;
|
|
93
|
+
}
|
|
94
|
+
.oml-md-table-page-info {
|
|
95
|
+
color: #57606a;
|
|
96
|
+
font-size: 0.9rem;
|
|
97
|
+
}
|
|
98
|
+
.oml-md-tree-cell {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 0.35rem;
|
|
102
|
+
}
|
|
103
|
+
.tree-toggle-button {
|
|
104
|
+
width: 1rem;
|
|
105
|
+
height: 1rem;
|
|
106
|
+
padding: 0;
|
|
107
|
+
line-height: 1;
|
|
108
|
+
font-size: 0.85rem;
|
|
109
|
+
border: 1px solid var(--vscode-editorWidget-border);
|
|
110
|
+
background: var(--vscode-editor-background);
|
|
111
|
+
color: var(--vscode-foreground);
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
border-radius: 2px;
|
|
114
|
+
}
|
|
115
|
+
.tree-toggle-spacer {
|
|
116
|
+
display: inline-block;
|
|
117
|
+
width: 1rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Browser fallback theme values for static render (outside VS Code webview). */
|
|
121
|
+
.oml-md-result .tree-filter {
|
|
122
|
+
background: var(--vscode-input-background, #ffffff);
|
|
123
|
+
color: var(--vscode-input-foreground, #24292f);
|
|
124
|
+
border: 1px solid var(--vscode-input-border, #d0d7de);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.oml-md-result .tree-filter:focus {
|
|
128
|
+
border-color: var(--vscode-focusBorder, #0969da);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.oml-md-result .table-pagesize {
|
|
132
|
+
background: var(--vscode-dropdown-background, #ffffff);
|
|
133
|
+
color: var(--vscode-dropdown-foreground, #24292f);
|
|
134
|
+
border: 1px solid var(--vscode-dropdown-border, #d0d7de);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.oml-md-result .table-results-table-container {
|
|
138
|
+
border: 1px solid var(--vscode-editorWidget-border, #d0d7de);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.oml-md-result .table-header-cell,
|
|
142
|
+
.oml-md-result .table-cell,
|
|
143
|
+
.oml-md-result .table-header-row > .table-header-cell:not(:last-child),
|
|
144
|
+
.oml-md-result .table-row > .table-cell:not(:last-child) {
|
|
145
|
+
border-color: var(--vscode-editorWidget-border, #d0d7de);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.oml-md-result .oml-md-static-table,
|
|
149
|
+
.oml-md-result .oml-md-static-table th,
|
|
150
|
+
.oml-md-result .oml-md-static-table td {
|
|
151
|
+
border-color: var(--vscode-editorWidget-border, #d0d7de);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.oml-md-result .oml-md-static-table th:not(:last-child),
|
|
155
|
+
.oml-md-result .oml-md-static-table td:not(:last-child) {
|
|
156
|
+
border-right: 1px solid var(--vscode-editorWidget-border, #d0d7de);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Static fallback framing for canvas widgets (graph/diagram/chart). */
|
|
160
|
+
.oml-md-result .graph-canvas-root {
|
|
161
|
+
border: 1px solid var(--vscode-editorWidget-border, #b8c2cc);
|
|
162
|
+
border-radius: 6px;
|
|
163
|
+
background: var(--vscode-editor-background, var(--oml-static-background, #ffffff));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.oml-md-result .diagram-canvas-root .x6-graph,
|
|
167
|
+
.oml-md-result .diagram-canvas-root .x6-graph-svg,
|
|
168
|
+
.oml-md-result .diagram-canvas-root .x6-svg-stage,
|
|
169
|
+
.oml-md-result .diagram-canvas-root .x6-svg,
|
|
170
|
+
.oml-md-result .diagram-canvas-root svg {
|
|
171
|
+
background: var(--vscode-editor-background, var(--oml-static-background, #ffffff));
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
//# sourceMappingURL=runtime-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-assets.js","sourceRoot":"","sources":["../../src/static/runtime-assets.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,CAAC,MAAM,mCAAmC,GAAG,2BAA2B,CAAC;AAE/E,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0K1C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oml/markdown",
|
|
3
|
+
"description": "Markdown runtime and execution contracts for OML",
|
|
4
|
+
"version": "0.7.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20.10.0",
|
|
8
|
+
"npm": ">=10.2.3"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"out",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"main": "./out/index.js",
|
|
15
|
+
"module": "./out/index.js",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./out/index.d.ts",
|
|
19
|
+
"default": "./out/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./md": {
|
|
22
|
+
"types": "./out/md/index.d.ts",
|
|
23
|
+
"default": "./out/md/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./static": {
|
|
26
|
+
"types": "./out/static/index.d.ts",
|
|
27
|
+
"default": "./out/static/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./renderers": {
|
|
30
|
+
"types": "./out/renderers/index.d.ts",
|
|
31
|
+
"default": "./out/renderers/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"typesVersions": {
|
|
35
|
+
"*": {
|
|
36
|
+
".": [
|
|
37
|
+
"out/index"
|
|
38
|
+
],
|
|
39
|
+
"md": [
|
|
40
|
+
"out/md/index"
|
|
41
|
+
],
|
|
42
|
+
"static": [
|
|
43
|
+
"out/static/index"
|
|
44
|
+
],
|
|
45
|
+
"renderers": [
|
|
46
|
+
"out/renderers/index"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"clean": "shx rm -fr *.tsbuildinfo out",
|
|
52
|
+
"build": "node esbuild.mjs",
|
|
53
|
+
"build:clean": "npm run clean && npm run build",
|
|
54
|
+
"test": "vitest run"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@antv/x6": "^3.1.6",
|
|
58
|
+
"@dagrejs/dagre": "^2.0.4",
|
|
59
|
+
"@oml/owl": "0.7.0",
|
|
60
|
+
"chart.js": "^4.4.0",
|
|
61
|
+
"markdown-it": "^14.1.1",
|
|
62
|
+
"reflect-metadata": "^0.2.2",
|
|
63
|
+
"yaml": "^2.8.2"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/markdown-it": "^14.1.2",
|
|
67
|
+
"esbuild": "~0.25.5",
|
|
68
|
+
"vitest": "~3.1.3"
|
|
69
|
+
},
|
|
70
|
+
"volta": {
|
|
71
|
+
"node": "20.19.2",
|
|
72
|
+
"npm": "10.8.2"
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/index.ts
ADDED
package/src/md/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright (c) 2026 Modelware. All rights reserved.
|
|
2
|
+
|
|
3
|
+
export * from './md-types.js';
|
|
4
|
+
export * from './md-execution.js';
|
|
5
|
+
export * from './md-frontmatter.js';
|
|
6
|
+
export * from './md-registry.js';
|
|
7
|
+
export * from './md-runtime.js';
|
|
8
|
+
export * from './md-executor.js';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Copyright (c) 2026 Modelware. All rights reserved.
|
|
2
|
+
|
|
3
|
+
export const MarkdownExecutionRequest = 'oml/markdown/execute';
|
|
4
|
+
|
|
5
|
+
export type MdBlockKind =
|
|
6
|
+
| 'table'
|
|
7
|
+
| 'tree'
|
|
8
|
+
| 'graph'
|
|
9
|
+
| 'chart'
|
|
10
|
+
| 'diagram'
|
|
11
|
+
| 'list'
|
|
12
|
+
| 'text'
|
|
13
|
+
| 'matrix'
|
|
14
|
+
| 'table-editor';
|
|
15
|
+
|
|
16
|
+
export interface MdExecutableBlock {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: MdBlockKind;
|
|
19
|
+
source: string;
|
|
20
|
+
meta?: string;
|
|
21
|
+
options?: Record<string, unknown>;
|
|
22
|
+
lineStart: number;
|
|
23
|
+
lineEnd: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MdExecuteBlocksParams {
|
|
27
|
+
documentUri: string;
|
|
28
|
+
modelUri?: string;
|
|
29
|
+
blocks: MdExecutableBlock[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type MdExecutionStatus = 'ok' | 'error' | 'unimplemented';
|
|
33
|
+
|
|
34
|
+
export interface MdTablePayload {
|
|
35
|
+
columns: string[];
|
|
36
|
+
rows: string[][];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface MdBlockExecutionResult {
|
|
40
|
+
blockId: string;
|
|
41
|
+
kind: MdBlockKind;
|
|
42
|
+
status: MdExecutionStatus;
|
|
43
|
+
format: 'table' | 'message';
|
|
44
|
+
payload?: MdTablePayload;
|
|
45
|
+
message?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface MdExecuteBlocksResult {
|
|
49
|
+
results: MdBlockExecutionResult[];
|
|
50
|
+
contextQuadCount?: number;
|
|
51
|
+
}
|