@medusajs/cloud 0.0.0-stage → 2.22.7-preview-20261113084204

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.
@@ -0,0 +1,524 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const adminSdk = require("@medusajs/admin-sdk");
4
+ const icons = require("@medusajs/icons");
5
+ const ui = require("@medusajs/ui");
6
+ const react = require("react");
7
+ const reactRouterDom = require("react-router-dom");
8
+ const DOMPurify = require("dompurify");
9
+ const hooks = require("@medusajs/dashboard/hooks");
10
+ const reactQuery = require("@tanstack/react-query");
11
+ const Medusa = require("@medusajs/js-sdk");
12
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
+ const DOMPurify__default = /* @__PURE__ */ _interopDefault(DOMPurify);
14
+ const Medusa__default = /* @__PURE__ */ _interopDefault(Medusa);
15
+ DOMPurify__default.default.addHook("afterSanitizeAttributes", (node) => {
16
+ if (node.tagName === "A" && node.hasAttribute("href")) {
17
+ node.setAttribute("target", "_blank");
18
+ node.setAttribute("rel", "noopener noreferrer");
19
+ }
20
+ });
21
+ const sanitizeHtml = (html) => DOMPurify__default.default.sanitize(html, { USE_PROFILES: { html: true } });
22
+ const contentClassName = [
23
+ "txt-small text-ui-fg-subtle flex flex-col gap-y-4",
24
+ "[&_h1]:txt-compact-large-plus [&_h2]:txt-compact-medium-plus [&_h3]:txt-compact-small-plus [&_h4]:txt-compact-small-plus",
25
+ "[&_h1]:text-ui-fg-base [&_h2]:text-ui-fg-base [&_h3]:text-ui-fg-base [&_h4]:text-ui-fg-base [&_strong]:text-ui-fg-base [&_b]:text-ui-fg-base",
26
+ "[&_a]:text-ui-fg-interactive [&_a:hover]:text-ui-fg-interactive-hover",
27
+ "[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-5 [&_ol]:pl-5 [&_li+li]:mt-2",
28
+ "[&_blockquote]:border-ui-border-strong [&_blockquote]:border-l-2 [&_blockquote]:pl-3",
29
+ "[&_code]:txt-compact-xsmall [&_code]:bg-ui-bg-subtle [&_code]:rounded [&_code]:px-1 [&_code]:font-mono",
30
+ "[&_pre]:bg-ui-contrast-bg-base [&_pre]:text-ui-contrast-fg-primary [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:p-3",
31
+ "[&_pre_code]:bg-transparent [&_pre_code]:p-0",
32
+ "[&_img]:shadow-borders-base [&_img]:max-w-full [&_img]:rounded-lg",
33
+ "[&_hr]:border-ui-border-base"
34
+ ].join(" ");
35
+ const AnnouncementDetails = ({
36
+ announcement,
37
+ onBack
38
+ }) => {
39
+ const html = react.useMemo(
40
+ () => sanitizeHtml(announcement.content ?? ""),
41
+ [announcement.content]
42
+ );
43
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
44
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Drawer.Header, { children: [
45
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-x-2", children: [
46
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(
47
+ ui.IconButton,
48
+ {
49
+ size: "2xsmall",
50
+ variant: "transparent",
51
+ className: "-ml-1",
52
+ onClick: onBack,
53
+ "aria-label": "Back to all announcements",
54
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUturnLeft, { className: "text-ui-fg-muted" })
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { level: "h2", children: announcement.title }) })
58
+ ] }),
59
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Description, { className: "sr-only", children: announcement.subtitle ?? announcement.title })
60
+ ] }),
61
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Drawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto p-6", children: [
62
+ announcement.image_url && /* @__PURE__ */ jsxRuntime.jsx(
63
+ "img",
64
+ {
65
+ src: announcement.image_url,
66
+ alt: "",
67
+ className: "shadow-borders-base aspect-video w-full rounded-lg object-cover"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsxRuntime.jsx(
71
+ "div",
72
+ {
73
+ className: contentClassName,
74
+ dangerouslySetInnerHTML: { __html: html }
75
+ }
76
+ )
77
+ ] }),
78
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Drawer.Footer, { children: [
79
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "secondary", size: "small", children: "Close" }) }),
80
+ announcement.link_url && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
81
+ "a",
82
+ {
83
+ href: announcement.link_url,
84
+ target: "_blank",
85
+ rel: "noopener noreferrer",
86
+ children: [
87
+ "Learn more",
88
+ /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUpRightOnBox, {})
89
+ ]
90
+ }
91
+ ) })
92
+ ] })
93
+ ] });
94
+ };
95
+ const backendUrl = __BACKEND_URL__ ?? "/";
96
+ const authType = __AUTH_TYPE__ ?? "session";
97
+ const jwtTokenStorageKey = __JWT_TOKEN_STORAGE_KEY__ || void 0;
98
+ const sdk = new Medusa__default.default({
99
+ baseUrl: backendUrl,
100
+ auth: {
101
+ type: authType,
102
+ jwtTokenStorageKey
103
+ }
104
+ });
105
+ const cloudAnnouncementsQueryKey = ["cloud", "announcements"];
106
+ const useCloudAnnouncements = () => {
107
+ const { hasPermission } = hooks.usePermissions();
108
+ const { data, ...rest } = reactQuery.useQuery({
109
+ queryKey: cloudAnnouncementsQueryKey,
110
+ queryFn: async () => sdk.client.fetch(
111
+ "/admin/cloud/announcements"
112
+ ),
113
+ staleTime: 10 * 60 * 1e3,
114
+ refetchOnWindowFocus: false,
115
+ retry: false,
116
+ enabled: hasPermission("cloud_announcement:read")
117
+ });
118
+ return { announcements: data?.announcements ?? [], ...rest };
119
+ };
120
+ const normalizePath = (path) => path.replace(/\/+$/, "") || "/";
121
+ const getAnnouncementForPath = (pathname, announcements, { dismissedIds, since }) => {
122
+ const path = normalizePath(pathname);
123
+ const pending = announcements.filter(
124
+ (announcement) => !dismissedIds.includes(announcement.id) && (!announcement.published_at || Date.parse(announcement.published_at) > Date.parse(since))
125
+ );
126
+ return pending.find(
127
+ (announcement) => announcement.admin_path && normalizePath(announcement.admin_path) === path
128
+ ) ?? pending.find((announcement) => !announcement.admin_path);
129
+ };
130
+ const LAST_SEEN_KEY = "medusa_cloud_announcements_last_seen_at";
131
+ const DISMISSED_KEY = "medusa_cloud_dismissed_announcement_ids";
132
+ const SINCE_KEY = "medusa_cloud_announcements_since";
133
+ const read = (key) => {
134
+ try {
135
+ return localStorage.getItem(key);
136
+ } catch {
137
+ return null;
138
+ }
139
+ };
140
+ const write = (key, value) => {
141
+ try {
142
+ localStorage.setItem(key, value);
143
+ } catch {
144
+ }
145
+ };
146
+ const getAnnouncementsSince = () => {
147
+ const stored = read(SINCE_KEY);
148
+ if (stored) {
149
+ return stored;
150
+ }
151
+ const now = (/* @__PURE__ */ new Date()).toISOString();
152
+ write(SINCE_KEY, now);
153
+ return now;
154
+ };
155
+ const getLastSeenAt = () => read(LAST_SEEN_KEY) ?? getAnnouncementsSince();
156
+ const setLastSeenAt = (value) => write(LAST_SEEN_KEY, value);
157
+ const getDismissedAnnouncementIds = () => {
158
+ try {
159
+ const value = JSON.parse(read(DISMISSED_KEY) ?? "[]");
160
+ return Array.isArray(value) ? value : [];
161
+ } catch {
162
+ return [];
163
+ }
164
+ };
165
+ const addDismissedAnnouncementId = (id) => write(DISMISSED_KEY, JSON.stringify([...getDismissedAnnouncementIds(), id]));
166
+ const CloudAnnouncementCardWidget = () => {
167
+ const { announcements } = useCloudAnnouncements();
168
+ const { pathname } = reactRouterDom.useLocation();
169
+ const [dismissedId, setDismissedId] = react.useState(null);
170
+ const [details, setDetails] = react.useState(null);
171
+ const announcement = react.useMemo(
172
+ () => getAnnouncementForPath(pathname, announcements, {
173
+ dismissedIds: getDismissedAnnouncementIds(),
174
+ since: getAnnouncementsSince()
175
+ }),
176
+ [pathname, announcements]
177
+ );
178
+ const dismiss = (announcement2) => {
179
+ addDismissedAnnouncementId(announcement2.id);
180
+ setDismissedId(announcement2.id);
181
+ };
182
+ const viewDetails = (announcement2) => {
183
+ dismiss(announcement2);
184
+ setDetails(announcement2);
185
+ };
186
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
187
+ announcement && announcement.id !== dismissedId && /* @__PURE__ */ jsxRuntime.jsxs(
188
+ ui.Container,
189
+ {
190
+ role: "status",
191
+ "aria-live": "polite",
192
+ onKeyDown: (event) => event.key === "Escape" && dismiss(announcement),
193
+ className: "animate-in fade-in-0 slide-in-from-bottom-2 overflow-hidden p-0 duration-150",
194
+ children: [
195
+ announcement.image_url && /* @__PURE__ */ jsxRuntime.jsx(
196
+ "img",
197
+ {
198
+ src: announcement.image_url,
199
+ alt: "",
200
+ className: "h-24 w-full border-b object-cover"
201
+ }
202
+ ),
203
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-1 p-3", children: [
204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-2", children: [
205
+ /* @__PURE__ */ jsxRuntime.jsx(
206
+ ui.Text,
207
+ {
208
+ size: "small",
209
+ leading: "compact",
210
+ weight: "plus",
211
+ className: "line-clamp-2 flex-1",
212
+ children: announcement.title
213
+ }
214
+ ),
215
+ /* @__PURE__ */ jsxRuntime.jsx(
216
+ ui.IconButton,
217
+ {
218
+ size: "2xsmall",
219
+ variant: "transparent",
220
+ className: "text-ui-fg-muted -mr-1 shrink-0",
221
+ onClick: () => dismiss(announcement),
222
+ "aria-label": "Dismiss",
223
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.XMark, {})
224
+ }
225
+ )
226
+ ] }),
227
+ announcement.subtitle && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle line-clamp-3", children: announcement.subtitle }),
228
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex empty:hidden", children: announcement.content ? /* @__PURE__ */ jsxRuntime.jsx(
229
+ ui.Button,
230
+ {
231
+ size: "small",
232
+ className: "flex-1",
233
+ onClick: () => viewDetails(announcement),
234
+ children: "View details"
235
+ }
236
+ ) : announcement.link_url && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", className: "flex-1", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
237
+ "a",
238
+ {
239
+ href: announcement.link_url,
240
+ target: "_blank",
241
+ rel: "noopener noreferrer",
242
+ onClick: () => dismiss(announcement),
243
+ children: "Learn more"
244
+ }
245
+ ) }) })
246
+ ] })
247
+ ]
248
+ }
249
+ ),
250
+ /* @__PURE__ */ jsxRuntime.jsx(
251
+ ui.Drawer,
252
+ {
253
+ open: !!details,
254
+ onOpenChange: (open) => !open && setDetails(null),
255
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Content, { children: details && /* @__PURE__ */ jsxRuntime.jsx(AnnouncementDetails, { announcement: details }) })
256
+ }
257
+ )
258
+ ] });
259
+ };
260
+ adminSdk.defineWidgetConfig({
261
+ zone: "sidebar.settings.before"
262
+ });
263
+ const publishedAt = (announcement) => announcement.published_at ? Date.parse(announcement.published_at) : 0;
264
+ const formatDate = (value) => value ? new Date(value).toLocaleDateString(void 0, {
265
+ year: "numeric",
266
+ month: "short",
267
+ day: "numeric"
268
+ }) : null;
269
+ const CloudAnnouncementsWidget = () => {
270
+ const { announcements } = useCloudAnnouncements();
271
+ const [open, setOpen] = react.useState(false);
272
+ const [details, setDetails] = react.useState(null);
273
+ const [lastSeenAt, setLastSeenAtState] = react.useState(getLastSeenAt);
274
+ const latest = announcements[0];
275
+ const isUnread = (announcement) => publishedAt(announcement) > (lastSeenAt ? Date.parse(lastSeenAt) : 0);
276
+ const hasUnread = announcements.some(isUnread);
277
+ const markSeen = () => {
278
+ if (latest?.published_at) {
279
+ setLastSeenAt(latest.published_at);
280
+ }
281
+ };
282
+ const handleOpenChange = (shouldOpen) => {
283
+ setOpen(shouldOpen);
284
+ if (shouldOpen) {
285
+ setDetails(null);
286
+ markSeen();
287
+ } else {
288
+ setLastSeenAtState(getLastSeenAt());
289
+ }
290
+ };
291
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.Drawer, { open, onOpenChange: handleOpenChange, children: [
292
+ !!announcements.length && /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
293
+ ui.IconButton,
294
+ {
295
+ variant: "transparent",
296
+ size: "small",
297
+ className: "text-ui-fg-muted hover:text-ui-fg-subtle relative",
298
+ "aria-label": "What's new in Medusa Cloud",
299
+ children: [
300
+ /* @__PURE__ */ jsxRuntime.jsx(icons.Megaphone, {}),
301
+ hasUnread && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-ui-tag-blue-icon absolute right-1 top-1 size-1.5 rounded-full" })
302
+ ]
303
+ }
304
+ ) }),
305
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Content, { children: details ? /* @__PURE__ */ jsxRuntime.jsx(
306
+ AnnouncementDetails,
307
+ {
308
+ announcement: details,
309
+ onBack: () => setDetails(null)
310
+ }
311
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
312
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Drawer.Header, { children: [
313
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "What's new" }) }),
314
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Description, { className: "sr-only", children: "The latest announcements from Medusa Cloud" })
315
+ ] }),
316
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Drawer.Body, { className: "overflow-y-auto px-0 py-0", children: announcements.map((announcement) => /* @__PURE__ */ jsxRuntime.jsx(
317
+ AnnouncementItem,
318
+ {
319
+ announcement,
320
+ unread: isUnread(announcement),
321
+ onViewDetails: () => setDetails(announcement)
322
+ },
323
+ announcement.id
324
+ )) })
325
+ ] }) })
326
+ ] });
327
+ };
328
+ const AnnouncementItem = ({
329
+ announcement,
330
+ unread,
331
+ onViewDetails
332
+ }) => {
333
+ const date = formatDate(announcement.published_at);
334
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-3 border-b p-6", children: [
335
+ announcement.image_url && /* @__PURE__ */ jsxRuntime.jsx(
336
+ "img",
337
+ {
338
+ src: announcement.image_url,
339
+ alt: "",
340
+ className: "aspect-video w-full rounded-md object-cover"
341
+ }
342
+ ),
343
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-1", children: [
344
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
345
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", weight: "plus", children: announcement.title }),
346
+ unread && /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { size: "2xsmall", color: "blue", children: "New" })
347
+ ] }),
348
+ announcement.subtitle && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: announcement.subtitle })
349
+ ] }),
350
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
351
+ date && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "xsmall", className: "text-ui-fg-muted", children: date }),
352
+ announcement.content ? /* @__PURE__ */ jsxRuntime.jsxs(
353
+ "button",
354
+ {
355
+ type: "button",
356
+ onClick: onViewDetails,
357
+ className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover txt-compact-small-plus flex items-center gap-x-1",
358
+ children: [
359
+ "View details",
360
+ /* @__PURE__ */ jsxRuntime.jsx(icons.SidebarRight, {})
361
+ ]
362
+ }
363
+ ) : announcement.link_url && /* @__PURE__ */ jsxRuntime.jsxs(
364
+ "a",
365
+ {
366
+ href: announcement.link_url,
367
+ target: "_blank",
368
+ rel: "noopener noreferrer",
369
+ className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover txt-compact-small-plus flex items-center gap-x-1",
370
+ children: [
371
+ "Learn more",
372
+ /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUpRightOnBox, {})
373
+ ]
374
+ }
375
+ )
376
+ ] })
377
+ ] });
378
+ };
379
+ adminSdk.defineWidgetConfig({
380
+ zone: "topbar"
381
+ });
382
+ const cloudAnnouncementPreferencesQueryKey = [
383
+ "cloud",
384
+ "announcement-preferences"
385
+ ];
386
+ const useCloudAnnouncementPreferences = () => {
387
+ const { data, ...rest } = reactQuery.useQuery({
388
+ queryKey: cloudAnnouncementPreferencesQueryKey,
389
+ queryFn: async () => sdk.client.fetch(
390
+ "/admin/cloud/announcement-preferences"
391
+ )
392
+ });
393
+ return { preferences: data?.announcement_preferences, ...rest };
394
+ };
395
+ const useUpdateCloudAnnouncementPreferences = () => {
396
+ const queryClient = reactQuery.useQueryClient();
397
+ return reactQuery.useMutation({
398
+ mutationFn: async (body) => sdk.client.fetch(
399
+ "/admin/cloud/announcement-preferences",
400
+ { method: "POST", body }
401
+ ),
402
+ onSuccess: (data) => {
403
+ queryClient.setQueryData(cloudAnnouncementPreferencesQueryKey, data);
404
+ queryClient.invalidateQueries({ queryKey: cloudAnnouncementsQueryKey });
405
+ }
406
+ });
407
+ };
408
+ const categories = [
409
+ {
410
+ id: "security",
411
+ label: "Security updates",
412
+ description: "Security advisories and incidents that affect your app."
413
+ },
414
+ {
415
+ id: "feature",
416
+ label: "Feature announcements",
417
+ description: "New Medusa features and releases."
418
+ },
419
+ {
420
+ id: "cloud",
421
+ label: "Cloud announcements",
422
+ description: "Medusa Cloud features and tips shown on admin pages."
423
+ }
424
+ ];
425
+ const AnnouncementSettingsPage = () => {
426
+ const { preferences } = useCloudAnnouncementPreferences();
427
+ const { mutate, isPending } = useUpdateCloudAnnouncementPreferences();
428
+ const { hasPermission } = hooks.usePermissions();
429
+ const canUpdate = hasPermission("cloud_announcement:update");
430
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.Container, { className: "divide-y p-0", children: [
431
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-6 py-4", children: [
432
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Announcements" }),
433
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose the announcements your team sees in the admin." })
434
+ ] }),
435
+ categories.map(({ id, label, description }) => /* @__PURE__ */ jsxRuntime.jsxs(
436
+ "div",
437
+ {
438
+ className: "flex items-center justify-between gap-x-4 px-6 py-4",
439
+ children: [
440
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
441
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: id, size: "small", weight: "plus", children: label }),
442
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: description })
443
+ ] }),
444
+ /* @__PURE__ */ jsxRuntime.jsx(
445
+ ui.Switch,
446
+ {
447
+ id,
448
+ checked: preferences?.[id] ?? false,
449
+ disabled: !preferences || isPending || !canUpdate,
450
+ onCheckedChange: (checked) => mutate(
451
+ { [id]: checked },
452
+ {
453
+ onSuccess: () => ui.toast.success(
454
+ `${label} ${checked ? "enabled" : "disabled"}`
455
+ ),
456
+ onError: (error) => ui.toast.error(error.message)
457
+ }
458
+ )
459
+ }
460
+ )
461
+ ]
462
+ },
463
+ id
464
+ ))
465
+ ] });
466
+ };
467
+ const config = adminSdk.defineRouteConfig({
468
+ label: "Announcements",
469
+ permissions: ["cloud_announcement:read"]
470
+ });
471
+ const widgetModule = { widgets: [
472
+ {
473
+ Component: CloudAnnouncementCardWidget,
474
+ zone: ["sidebar.settings.before"],
475
+ widgetId: "Widget-4920"
476
+ },
477
+ {
478
+ Component: CloudAnnouncementsWidget,
479
+ zone: ["topbar"],
480
+ widgetId: "Widget-8087"
481
+ }
482
+ ] };
483
+ const routeModule = {
484
+ routes: [
485
+ {
486
+ Component: AnnouncementSettingsPage,
487
+ path: "/settings/announcements",
488
+ handle: { label: config.label, translationNs: config.translationNs, permissions: config.permissions }
489
+ }
490
+ ]
491
+ };
492
+ const menuItemModule = {
493
+ menuItems: [
494
+ {
495
+ label: config.label,
496
+ icon: void 0,
497
+ path: "/settings/announcements",
498
+ nested: void 0,
499
+ rank: void 0,
500
+ translationNs: void 0,
501
+ permissions: config.permissions
502
+ }
503
+ ]
504
+ };
505
+ const formModule = { customFields: {} };
506
+ const displayModule = {
507
+ displays: {}
508
+ };
509
+ const i18nModule = { resources: {} };
510
+ const cellRendererModule = {};
511
+ const layoutModule = { layouts: [] };
512
+ const searchEntityModule = {};
513
+ const plugin = {
514
+ widgetModule,
515
+ routeModule,
516
+ menuItemModule,
517
+ formModule,
518
+ displayModule,
519
+ i18nModule,
520
+ cellRendererModule,
521
+ layoutModule,
522
+ searchEntityModule
523
+ };
524
+ module.exports = plugin;