@eventcatalog/core 2.49.2 → 2.49.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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.49.2";
40
+ var version = "2.49.4";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-PX4SAAXL.js";
4
- import "../chunk-MOHJFKGI.js";
3
+ } from "../chunk-6H5JZTNU.js";
4
+ import "../chunk-ZIKL7B6R.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.49.2";
109
+ var version = "2.49.4";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-LOP5GRVK.js";
4
- import "../chunk-PX4SAAXL.js";
5
- import "../chunk-MOHJFKGI.js";
3
+ } from "../chunk-POF6LP6N.js";
4
+ import "../chunk-6H5JZTNU.js";
5
+ import "../chunk-ZIKL7B6R.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-MOHJFKGI.js";
3
+ } from "./chunk-ZIKL7B6R.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-PX4SAAXL.js";
3
+ } from "./chunk-6H5JZTNU.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.49.2";
2
+ var version = "2.49.4";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.49.2";
28
+ var version = "2.49.4";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-MOHJFKGI.js";
3
+ } from "./chunk-ZIKL7B6R.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.49.2";
160
+ var version = "2.49.4";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-XE6PFSH5.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-LOP5GRVK.js";
10
- import "./chunk-PX4SAAXL.js";
9
+ } from "./chunk-POF6LP6N.js";
10
+ import "./chunk-6H5JZTNU.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-LDBRNJIL.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-MOHJFKGI.js";
18
+ } from "./chunk-ZIKL7B6R.js";
19
19
  import {
20
20
  isAuthEnabled,
21
21
  isBackstagePluginEnabled,
@@ -79,11 +79,7 @@ export default defineConfig({
79
79
  config.output !== 'server' && pagefind(),
80
80
  config.output !== 'server' && compress && (await import("astro-compress")).default({
81
81
  Logger: 0,
82
- Exclude: [
83
- (File) =>
84
- // Fix for https://github.com/event-catalog/eventcatalog/issues/1600
85
- File.includes("TreeView"),
86
- ],
82
+ CSS: false,
87
83
  }),
88
84
  ].filter(Boolean),
89
85
  vite: {
@@ -1,6 +1,5 @@
1
- import { Button } from '@headlessui/react';
2
1
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
3
- import { Copy, FileText, MessageCircleQuestion, ChevronDownIcon, ExternalLink } from 'lucide-react';
2
+ import { Copy, FileText, MessageCircleQuestion, ChevronDownIcon, ExternalLink, PenSquareIcon } from 'lucide-react';
4
3
  import React, { useState, isValidElement } from 'react';
5
4
  import type { Schema } from '@utils/collections/schemas';
6
5
  import { buildUrl } from '@utils/url-builder';
@@ -47,10 +46,12 @@ export function CopyPageMenu({
47
46
  schemas,
48
47
  chatQuery,
49
48
  chatEnabled = false,
49
+ editUrl,
50
50
  }: {
51
51
  schemas: Schema[];
52
52
  chatQuery?: string;
53
53
  chatEnabled: boolean;
54
+ editUrl: string;
54
55
  }) {
55
56
  const [buttonText, setButtonText] = useState('Copy page');
56
57
 
@@ -136,6 +137,20 @@ export function CopyPageMenu({
136
137
  <MenuItemContent icon={Copy} title="Copy page" description="Copy page as Markdown for LLMs" />
137
138
  </DropdownMenu.Item>
138
139
 
140
+ {editUrl && (
141
+ <DropdownMenu.Item
142
+ className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
143
+ onSelect={() => window.open(editUrl, '_blank')}
144
+ >
145
+ <MenuItemContent
146
+ icon={PenSquareIcon}
147
+ title="Edit page"
148
+ description="Edit the contents of this page"
149
+ external={true}
150
+ />
151
+ </DropdownMenu.Item>
152
+ )}
153
+
139
154
  {schemas.map((schema) => {
140
155
  const title =
141
156
  schema.format === 'asyncapi'
@@ -166,6 +181,7 @@ export function CopyPageMenu({
166
181
  </DropdownMenu.Item>
167
182
  );
168
183
  })}
184
+
169
185
  <DropdownMenu.Item
170
186
  className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
171
187
  onSelect={() => window.open(markdownUrl, '_blank')}
@@ -105,6 +105,7 @@ const baseSchema = z.object({
105
105
  ])
106
106
  .optional(),
107
107
  hidden: z.boolean().optional(),
108
+ editUrl: z.string().optional(),
108
109
  resourceGroups: z
109
110
  .array(
110
111
  z.object({
@@ -30,7 +30,7 @@ import {
30
30
  MagnifyingGlassIcon,
31
31
  } from '@heroicons/react/24/outline';
32
32
  import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
33
- import { Box, Boxes } from 'lucide-react';
33
+ import { Box, Boxes, SquarePenIcon } from 'lucide-react';
34
34
  import type { CollectionTypes } from '@types';
35
35
 
36
36
  import { render } from 'astro:content';
@@ -38,7 +38,7 @@ import type { CollectionEntry } from 'astro:content';
38
38
 
39
39
  import { getIcon } from '@utils/badges';
40
40
  import { getDeprecatedDetails } from '@utils/collections/util';
41
- import { buildUrl } from '@utils/url-builder';
41
+ import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
42
42
  import { getSchemasFromResource } from '@utils/collections/schemas';
43
43
  import { isEventCatalogChatEnabled, isMarkdownDownloadEnabled } from '@utils/feature';
44
44
 
@@ -57,6 +57,8 @@ const { Content } = await render(props);
57
57
 
58
58
  const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
59
59
  const contentBadges = props.data.badges || [];
60
+ const editUrl =
61
+ props.data.editUrl || (config.editUrl && props?.filePath ? buildEditUrlForResource(config.editUrl, props?.filePath) : '');
60
62
 
61
63
  const getContentBadges = () =>
62
64
  contentBadges.map((badge: any) => ({
@@ -218,6 +220,7 @@ nodeGraphs.push({
218
220
  schemas={schemasForResource}
219
221
  chatQuery={generatePromptForResource(props)}
220
222
  chatEnabled={isEventCatalogChatEnabled()}
223
+ editUrl={editUrl}
221
224
  />
222
225
  </div>
223
226
  )
@@ -362,6 +365,20 @@ nodeGraphs.push({
362
365
  }
363
366
  </div>
364
367
  <Footer />
368
+ <!-- Add edit this page button with icon and text-->
369
+ <div class="flex justify-end">
370
+ <!-- Built with EventCatalog -->
371
+ {
372
+ editUrl && (
373
+ <div class="flex justify-end">
374
+ <a href={editUrl} class="text-sm text-gray-700 hover:text-gray-700 border border-gray-200 rounded-md p-2">
375
+ <SquarePenIcon className="w-4 h-4 inline-block mr-1" />
376
+ Edit this page
377
+ </a>
378
+ </div>
379
+ )
380
+ }
381
+ </div>
365
382
  </div>
366
383
  <aside class="hidden lg:block sticky top-0 pb-10 w-96 overflow-y-auto py-2" data-pagefind-ignore>
367
384
  <!-- @ts-ignore -->
@@ -42,3 +42,9 @@ export const buildUrlWithParams = (baseUrl: string, params: Record<string, strin
42
42
 
43
43
  return `${buildUrl(baseUrl)}?${queryString}`;
44
44
  };
45
+
46
+ export const buildEditUrlForResource = (editUrl: string, filePath: string) => {
47
+ // filepath may have ../ or ./ in it, so we need to remove it
48
+ const cleanFilePath = filePath.replace(/^\.\.?\//g, '');
49
+ return `${editUrl}/${cleanFilePath}`;
50
+ };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.49.2",
9
+ "version": "2.49.4",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },