@eventcatalog/core 2.31.3 → 2.31.4
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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-KYLVZEB2.js → chunk-C3M26NRD.js} +1 -1
- package/dist/{chunk-4EXYGKM6.js → chunk-H5QIDJHP.js} +1 -1
- package/dist/{chunk-34ONBQTK.js → chunk-W5HUNIMM.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/enterprise/custom-documentation/pages/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +2 -115
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-C3M26NRD.js";
|
|
4
|
+
import "../chunk-W5HUNIMM.js";
|
|
5
|
+
import "../chunk-H5QIDJHP.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-UKJ7F5WR.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-C3M26NRD.js";
|
|
10
|
+
import "./chunk-W5HUNIMM.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-7SI5EVOX.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H5QIDJHP.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogProEnabled
|
|
@@ -223,7 +223,7 @@ const badges = doc?.badges || [];
|
|
|
223
223
|
let observerPaused = false;
|
|
224
224
|
|
|
225
225
|
// Function to highlight a TOC item
|
|
226
|
-
function highlightTocItem(id) {
|
|
226
|
+
function highlightTocItem(id: string) {
|
|
227
227
|
// Remove active class from all links
|
|
228
228
|
document.querySelectorAll('.active-toc-item').forEach((link) => {
|
|
229
229
|
link.classList.remove('active-toc-item', 'text-purple-600', 'font-light');
|
|
@@ -268,126 +268,13 @@ const pagefindAttributes =
|
|
|
268
268
|
if (document.getElementsByClassName('mermaid').length > 0) {
|
|
269
269
|
renderDiagrams(graphs);
|
|
270
270
|
}
|
|
271
|
-
|
|
272
|
-
// Set up TOC highlighting and scrolling
|
|
273
|
-
setupTOCHighlighting();
|
|
274
271
|
});
|
|
275
272
|
|
|
276
|
-
/**
|
|
277
|
-
* Setup TOC highlighting and scrolling
|
|
278
|
-
*/
|
|
279
|
-
function setupTOCHighlighting() {
|
|
280
|
-
// Check if there's a sidebar with navigation
|
|
281
|
-
const sidebarNav = document.querySelector('aside nav');
|
|
282
|
-
if (!sidebarNav) return;
|
|
283
|
-
|
|
284
|
-
const observerOptions = {
|
|
285
|
-
rootMargin: '0px 0px -40% 0px',
|
|
286
|
-
threshold: 0.1,
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
// Flag to temporarily disable observer after click
|
|
290
|
-
let observerPaused = false;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Highlights a TOC item and scrolls it into view
|
|
294
|
-
* @param {string} id - The ID of the heading to highlight in the TOC
|
|
295
|
-
*/
|
|
296
|
-
function highlightTocItem(id) {
|
|
297
|
-
// Remove active class from all links
|
|
298
|
-
document.querySelectorAll('.active-toc-item').forEach((link) => {
|
|
299
|
-
link.classList.remove('active-toc-item', 'text-primary-600', 'font-medium');
|
|
300
|
-
link.classList.add('text-gray-400');
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
// Add active class to current link
|
|
304
|
-
const tocLink = document.querySelector(`aside nav a[href="#${id}"]`);
|
|
305
|
-
if (tocLink) {
|
|
306
|
-
tocLink.classList.add('active-toc-item', 'text-primary-600', 'font-medium');
|
|
307
|
-
tocLink.classList.remove('text-gray-400');
|
|
308
|
-
|
|
309
|
-
// Scroll the highlighted item into view with a small delay to ensure DOM updates first
|
|
310
|
-
setTimeout(() => {
|
|
311
|
-
tocLink.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
|
312
|
-
}, 10);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// Set up the intersection observer for scrolling
|
|
317
|
-
const observer = new IntersectionObserver((entries) => {
|
|
318
|
-
// If observer is paused, don't process entries
|
|
319
|
-
if (observerPaused) return;
|
|
320
|
-
|
|
321
|
-
entries.forEach((entry) => {
|
|
322
|
-
try {
|
|
323
|
-
const id = entry.target.getAttribute('id');
|
|
324
|
-
if (entry.isIntersecting && id) {
|
|
325
|
-
highlightTocItem(id);
|
|
326
|
-
}
|
|
327
|
-
} catch (entryError) {
|
|
328
|
-
console.error('Error processing intersection entry:', entryError);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}, observerOptions);
|
|
332
|
-
|
|
333
|
-
// Find all headings in the content area
|
|
334
|
-
const prose = document.querySelector('.prose');
|
|
335
|
-
if (!prose) return;
|
|
336
|
-
|
|
337
|
-
// First try to find headings with IDs
|
|
338
|
-
const headings = prose.querySelectorAll('h1[id], h2[id], h3[id]');
|
|
339
|
-
|
|
340
|
-
if (headings.length > 0) {
|
|
341
|
-
headings.forEach((heading) => {
|
|
342
|
-
observer.observe(heading);
|
|
343
|
-
});
|
|
344
|
-
} else {
|
|
345
|
-
// Fallback: If no headings with IDs found, attach IDs to them
|
|
346
|
-
const allHeadings = prose.querySelectorAll('h1, h2, h3');
|
|
347
|
-
|
|
348
|
-
allHeadings.forEach((heading) => {
|
|
349
|
-
// Only add ID if it doesn't exist
|
|
350
|
-
if (!heading.id) {
|
|
351
|
-
const text = heading.textContent || '';
|
|
352
|
-
const slug = text
|
|
353
|
-
.toLowerCase()
|
|
354
|
-
.replace(/[^\w\s-]/g, '')
|
|
355
|
-
.replace(/\s+/g, '-');
|
|
356
|
-
heading.id = slug;
|
|
357
|
-
}
|
|
358
|
-
observer.observe(heading);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
// Add click event listeners to all TOC links
|
|
363
|
-
const tocLinks = document.querySelectorAll('aside nav a[href^="#"]');
|
|
364
|
-
tocLinks.forEach((link) => {
|
|
365
|
-
link.addEventListener('click', (e) => {
|
|
366
|
-
// Get the ID from the href attribute
|
|
367
|
-
const hrefAttr = link.getAttribute('href');
|
|
368
|
-
if (!hrefAttr) return;
|
|
369
|
-
|
|
370
|
-
const id = hrefAttr.substring(1);
|
|
371
|
-
|
|
372
|
-
// Highlight the clicked item
|
|
373
|
-
highlightTocItem(id);
|
|
374
|
-
|
|
375
|
-
// Temporarily pause the observer to prevent immediate highlighting changes
|
|
376
|
-
observerPaused = true;
|
|
377
|
-
|
|
378
|
-
// Resume the observer after a delay
|
|
379
|
-
setTimeout(() => {
|
|
380
|
-
observerPaused = false;
|
|
381
|
-
}, 500);
|
|
382
|
-
});
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
273
|
/**
|
|
387
274
|
* Renders mermaid diagrams in the page
|
|
388
275
|
* @param {HTMLCollectionOf<HTMLElement>} graphs - The collection of mermaid graph elements
|
|
389
276
|
*/
|
|
390
|
-
async function renderDiagrams(graphs) {
|
|
277
|
+
async function renderDiagrams(graphs: any) {
|
|
391
278
|
const { default: mermaid } = await import('mermaid');
|
|
392
279
|
|
|
393
280
|
if (window.eventcatalog.mermaid) {
|
|
@@ -395,7 +282,7 @@ const pagefindAttributes =
|
|
|
395
282
|
const { iconPacks = [] } = window.eventcatalog.mermaid ?? {};
|
|
396
283
|
|
|
397
284
|
if (iconPacks.length > 0) {
|
|
398
|
-
const iconPacksToRegister = iconPacks.map((name) => {
|
|
285
|
+
const iconPacksToRegister = iconPacks.map((name: any) => {
|
|
399
286
|
return {
|
|
400
287
|
name,
|
|
401
288
|
icons,
|