@momentumcms/admin 0.5.8 → 0.5.10

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.
Files changed (24) hide show
  1. package/fesm2022/{momentumcms-admin-array-field.component-Co0_3wwq.mjs → momentumcms-admin-array-field.component-CfbBjPVd.mjs} +2 -2
  2. package/fesm2022/{momentumcms-admin-array-field.component-Co0_3wwq.mjs.map → momentumcms-admin-array-field.component-CfbBjPVd.mjs.map} +1 -1
  3. package/fesm2022/{momentumcms-admin-blocks-field.component-Dr0N35Nz.mjs → momentumcms-admin-blocks-field.component-QZ8tLEg6.mjs} +2 -2
  4. package/fesm2022/{momentumcms-admin-blocks-field.component-Dr0N35Nz.mjs.map → momentumcms-admin-blocks-field.component-QZ8tLEg6.mjs.map} +1 -1
  5. package/fesm2022/{momentumcms-admin-collapsible-field.component-C1GobKo0.mjs → momentumcms-admin-collapsible-field.component-BclQc85b.mjs} +2 -2
  6. package/fesm2022/{momentumcms-admin-collapsible-field.component-C1GobKo0.mjs.map → momentumcms-admin-collapsible-field.component-BclQc85b.mjs.map} +1 -1
  7. package/fesm2022/{momentumcms-admin-global-edit.page-C-e4_QKx.mjs → momentumcms-admin-global-edit.page-BrSh7EBY.mjs} +2 -2
  8. package/fesm2022/{momentumcms-admin-global-edit.page-C-e4_QKx.mjs.map → momentumcms-admin-global-edit.page-BrSh7EBY.mjs.map} +1 -1
  9. package/fesm2022/{momentumcms-admin-group-field.component-NdX_GSNQ.mjs → momentumcms-admin-group-field.component-BmWE2N0v.mjs} +2 -2
  10. package/fesm2022/{momentumcms-admin-group-field.component-NdX_GSNQ.mjs.map → momentumcms-admin-group-field.component-BmWE2N0v.mjs.map} +1 -1
  11. package/fesm2022/{momentumcms-admin-momentumcms-admin-D56RXzt0.mjs → momentumcms-admin-momentumcms-admin-BKepTX-n.mjs} +67 -56
  12. package/fesm2022/momentumcms-admin-momentumcms-admin-BKepTX-n.mjs.map +1 -0
  13. package/fesm2022/{momentumcms-admin-relationship-field.component-Cy9BsTBY.mjs → momentumcms-admin-relationship-field.component-DQySS2uK.mjs} +2 -2
  14. package/fesm2022/{momentumcms-admin-relationship-field.component-Cy9BsTBY.mjs.map → momentumcms-admin-relationship-field.component-DQySS2uK.mjs.map} +1 -1
  15. package/fesm2022/{momentumcms-admin-rich-text-field.component-s47cVU85.mjs → momentumcms-admin-rich-text-field.component-BtPq7BWT.mjs} +2 -2
  16. package/fesm2022/{momentumcms-admin-rich-text-field.component-s47cVU85.mjs.map → momentumcms-admin-rich-text-field.component-BtPq7BWT.mjs.map} +1 -1
  17. package/fesm2022/{momentumcms-admin-row-field.component-VJvSx9YM.mjs → momentumcms-admin-row-field.component-CDU2ukTM.mjs} +2 -2
  18. package/fesm2022/{momentumcms-admin-row-field.component-VJvSx9YM.mjs.map → momentumcms-admin-row-field.component-CDU2ukTM.mjs.map} +1 -1
  19. package/fesm2022/{momentumcms-admin-tabs-field.component-C_iReaEt.mjs → momentumcms-admin-tabs-field.component-Dj65PyBW.mjs} +2 -2
  20. package/fesm2022/{momentumcms-admin-tabs-field.component-C_iReaEt.mjs.map → momentumcms-admin-tabs-field.component-Dj65PyBW.mjs.map} +1 -1
  21. package/fesm2022/momentumcms-admin.mjs +1 -1
  22. package/package.json +1 -1
  23. package/types/momentumcms-admin.d.ts +5 -4
  24. package/fesm2022/momentumcms-admin-momentumcms-admin-D56RXzt0.mjs.map +0 -1
@@ -4,14 +4,15 @@ import { DOCUMENT, isPlatformBrowser, isPlatformServer, NgComponentOutlet, DateP
4
4
  import { Router, NavigationEnd, ActivatedRoute, RouterOutlet, RouterLink } from '@angular/router';
5
5
  import { HttpClient, HttpContextToken, HttpResponse, HttpErrorResponse, HttpRequest, HttpEventType, HttpParams } from '@angular/common/http';
6
6
  import { firstValueFrom, tap, catchError, throwError, Subject, finalize, Observable, of, filter, take, combineLatest } from 'rxjs';
7
+ import { provideIcons, NgIcon } from '@ng-icons/core';
8
+ import * as heroOutline from '@ng-icons/heroicons/outline';
9
+ import { heroFilm, heroMusicalNote, heroDocumentText, heroArchiveBox, heroPhoto, heroDocument, heroCloudArrowUp, heroXMark, heroEye, heroPencilSquare, heroArrowDownTray, heroTrash, heroChevronRight, heroChevronDown, heroChevronUp, heroPlus } from '@ng-icons/heroicons/outline';
7
10
  import { ToastService, ConfirmationService, DIALOG_DATA, Dialog, DialogHeader, DialogTitle, DialogContent, DialogFooter, DialogClose, Button, Badge, Skeleton, DialogService, Card, CardHeader, CardContent, Separator, Progress, CardFooter, Spinner, Alert, Breadcrumbs, BreadcrumbItem, BreadcrumbSeparator, FieldDisplay, Sidebar, SidebarNav, SidebarNavItem, SidebarSection, Avatar, AvatarFallback, DropdownMenu, DropdownMenuItem, DropdownSeparator, DropdownLabel, DropdownTrigger, SidebarService, SidebarTrigger, ToastContainer, Input, McmsFormField, DialogRef, DataTable, Label, Select, CardTitle, CardDescription, Textarea, Pagination, SearchInput, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandGroup, CommandItem, CommandEmpty, Checkbox } from '@momentumcms/ui';
8
11
  import { map } from 'rxjs/operators';
9
12
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
10
13
  import * as i1 from '@angular/cdk/a11y';
11
14
  import { LiveAnnouncer, A11yModule } from '@angular/cdk/a11y';
12
15
  import { flattenDataFields, humanizeFieldName, isUploadCollection, getSoftDeleteField, hasVersionDrafts } from '@momentumcms/core';
13
- import { NgIcon, provideIcons } from '@ng-icons/core';
14
- import { heroFilm, heroMusicalNote, heroDocumentText, heroArchiveBox, heroPhoto, heroDocument, heroCloudArrowUp, heroXMark, heroCursorArrowRays, heroMap, heroMagnifyingGlass, heroPuzzlePiece, heroCog6Tooth, heroChartBarSquare, heroChevronUpDown, heroBolt, heroFolder, heroUsers, heroNewspaper, heroSquares2x2, heroEye, heroPencilSquare, heroArrowDownTray, heroTrash, heroChevronRight, heroChevronDown, heroChevronUp, heroPlus } from '@ng-icons/heroicons/outline';
15
16
  import { required, validate, applyEach, apply, email, min, max, minLength, maxLength, form, submit } from '@angular/forms/signals';
16
17
  import { moveItemInArray, CdkDropList, CdkDrag, CdkDragPlaceholder } from '@angular/cdk/drag-drop';
17
18
 
@@ -537,6 +538,24 @@ const setupGuard = async () => {
537
538
  return true;
538
539
  };
539
540
 
541
+ /**
542
+ * Central Icon Provider for the Admin UI
543
+ *
544
+ * Provides ALL heroicons/outline so that any collection, global, or plugin route
545
+ * can reference any `hero*` icon name without manual registration.
546
+ *
547
+ * This is provided at the admin route level via `momentumAdminRoutes()`,
548
+ * making icons available to the entire admin shell and all child components.
549
+ */
550
+ /**
551
+ * Provides all Heroicons outline icons to the admin UI.
552
+ * Called once at the admin route level — individual components
553
+ * do NOT need their own `provideIcons()` for sidebar/navigation icons.
554
+ */
555
+ function provideAdminIcons() {
556
+ return provideIcons(heroOutline);
557
+ }
558
+
540
559
  /**
541
560
  * Collection Access Service
542
561
  *
@@ -1105,6 +1124,7 @@ function momentumAdminRoutes(configOrOptions) {
1105
1124
  path: basePath,
1106
1125
  loadComponent: () => Promise.resolve().then(function () { return adminShell_component; }).then((m) => m.AdminShellComponent),
1107
1126
  data: routeData,
1127
+ providers: [provideAdminIcons()],
1108
1128
  canActivate: [authGuard],
1109
1129
  children: [
1110
1130
  // Dashboard (default route) — swappable via AdminComponentRegistry
@@ -1173,7 +1193,7 @@ function momentumAdminRoutes(configOrOptions) {
1173
1193
  loadComponent: () => Promise.resolve().then(function () { return adminPageResolver_component; }).then((m) => m.AdminPageResolver),
1174
1194
  data: {
1175
1195
  adminPageKey: 'global-edit',
1176
- adminPageFallback: () => import('./momentumcms-admin-global-edit.page-C-e4_QKx.mjs').then((m) => m.GlobalEditPage),
1196
+ adminPageFallback: () => import('./momentumcms-admin-global-edit.page-BrSh7EBY.mjs').then((m) => m.GlobalEditPage),
1177
1197
  },
1178
1198
  canDeactivate: [unsavedChangesGuard],
1179
1199
  },
@@ -8050,10 +8070,34 @@ class AdminSidebarWidget {
8050
8070
  }, ...(ngDevMode ? [{ debugName: "pluginRouteGroups" }] : []));
8051
8071
  /** Collection icon names by slug */
8052
8072
  collectionIcons = {
8073
+ // Content
8053
8074
  posts: 'heroNewspaper',
8054
- users: 'heroUsers',
8055
- media: 'heroPhoto',
8075
+ articles: 'heroNewspaper',
8056
8076
  pages: 'heroDocument',
8077
+ media: 'heroPhoto',
8078
+ // People
8079
+ users: 'heroUsers',
8080
+ 'auth-user': 'heroUsers',
8081
+ 'auth-session': 'heroBolt',
8082
+ 'auth-account': 'heroUsers',
8083
+ 'auth-api-keys': 'heroBolt',
8084
+ 'auth-verification': 'heroBolt',
8085
+ // System
8086
+ settings: 'heroCog6Tooth',
8087
+ 'site-settings': 'heroCog6Tooth',
8088
+ categories: 'heroFolder',
8089
+ tags: 'heroFolder',
8090
+ // Plugins
8091
+ products: 'heroChartBarSquare',
8092
+ 'email-templates': 'heroDocumentText',
8093
+ forms: 'heroPuzzlePiece',
8094
+ 'form-submissions': 'heroDocumentText',
8095
+ redirects: 'heroMap',
8096
+ 'tracking-rules': 'heroCursorArrowRays',
8097
+ 'queue-jobs': 'heroBolt',
8098
+ 'cron-schedules': 'heroBolt',
8099
+ 'otel-snapshots': 'heroChartBarSquare',
8100
+ events: 'heroChartBarSquare',
8057
8101
  default: 'heroFolder',
8058
8102
  };
8059
8103
  /**
@@ -8069,10 +8113,12 @@ class AdminSidebarWidget {
8069
8113
  return `${this.collectionsBasePath()}/${collection.slug}`;
8070
8114
  }
8071
8115
  /**
8072
- * Get icon name for a collection based on its slug.
8116
+ * Get icon name for a collection checks admin.icon first, then slug mapping, then default.
8073
8117
  */
8074
8118
  getCollectionIcon(collection) {
8075
- return this.collectionIcons[collection.slug] || this.collectionIcons['default'];
8119
+ return (collection.admin?.icon ||
8120
+ this.collectionIcons[collection.slug] ||
8121
+ this.collectionIcons['default']);
8076
8122
  }
8077
8123
  /**
8078
8124
  * Get display label for a global.
@@ -8106,25 +8152,7 @@ class AdminSidebarWidget {
8106
8152
  this.signOut.emit();
8107
8153
  }
8108
8154
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdminSidebarWidget, deps: [], target: i0.ɵɵFactoryTarget.Component });
8109
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdminSidebarWidget, isStandalone: true, selector: "mcms-admin-sidebar", inputs: { branding: { classPropertyName: "branding", publicName: "branding", isSignal: true, isRequired: false, transformFunction: null }, collections: { classPropertyName: "collections", publicName: "collections", isSignal: true, isRequired: false, transformFunction: null }, globals: { classPropertyName: "globals", publicName: "globals", isSignal: true, isRequired: false, transformFunction: null }, pluginRoutes: { classPropertyName: "pluginRoutes", publicName: "pluginRoutes", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, basePath: { classPropertyName: "basePath", publicName: "basePath", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { signOut: "signOut" }, host: { classAttribute: "shrink-0" }, providers: [
8110
- provideIcons({
8111
- heroSquares2x2,
8112
- heroNewspaper,
8113
- heroUsers,
8114
- heroPhoto,
8115
- heroDocument,
8116
- heroFolder,
8117
- heroBolt,
8118
- heroChevronUpDown,
8119
- heroChartBarSquare,
8120
- heroDocumentText,
8121
- heroCog6Tooth,
8122
- heroPuzzlePiece,
8123
- heroMagnifyingGlass,
8124
- heroMap,
8125
- heroCursorArrowRays,
8126
- }),
8127
- ], ngImport: i0, template: `
8155
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdminSidebarWidget, isStandalone: true, selector: "mcms-admin-sidebar", inputs: { branding: { classPropertyName: "branding", publicName: "branding", isSignal: true, isRequired: false, transformFunction: null }, collections: { classPropertyName: "collections", publicName: "collections", isSignal: true, isRequired: false, transformFunction: null }, globals: { classPropertyName: "globals", publicName: "globals", isSignal: true, isRequired: false, transformFunction: null }, pluginRoutes: { classPropertyName: "pluginRoutes", publicName: "pluginRoutes", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, basePath: { classPropertyName: "basePath", publicName: "basePath", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { signOut: "signOut" }, host: { classAttribute: "shrink-0" }, ngImport: i0, template: `
8128
8156
  <mcms-sidebar [collapsed]="collapsed()" [width]="width()">
8129
8157
  <!-- Header -->
8130
8158
  <div mcmsSidebarHeader>
@@ -8192,7 +8220,7 @@ class AdminSidebarWidget {
8192
8220
  <mcms-sidebar-nav-item
8193
8221
  [label]="getGlobalLabel(global)"
8194
8222
  [href]="basePath() + '/globals/' + global.slug"
8195
- icon="heroCog6Tooth"
8223
+ [icon]="global.admin?.icon || 'heroCog6Tooth'"
8196
8224
  />
8197
8225
  }
8198
8226
  </mcms-sidebar-section>
@@ -8281,25 +8309,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
8281
8309
  NgIcon,
8282
8310
  AdminSlotOutlet,
8283
8311
  ],
8284
- providers: [
8285
- provideIcons({
8286
- heroSquares2x2,
8287
- heroNewspaper,
8288
- heroUsers,
8289
- heroPhoto,
8290
- heroDocument,
8291
- heroFolder,
8292
- heroBolt,
8293
- heroChevronUpDown,
8294
- heroChartBarSquare,
8295
- heroDocumentText,
8296
- heroCog6Tooth,
8297
- heroPuzzlePiece,
8298
- heroMagnifyingGlass,
8299
- heroMap,
8300
- heroCursorArrowRays,
8301
- }),
8302
- ],
8312
+ // Icons are provided at the admin route level via provideAdminIcons() —
8313
+ // no per-component provideIcons() needed. Any heroicons/outline name works.
8303
8314
  host: {
8304
8315
  class: 'shrink-0',
8305
8316
  },
@@ -8372,7 +8383,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
8372
8383
  <mcms-sidebar-nav-item
8373
8384
  [label]="getGlobalLabel(global)"
8374
8385
  [href]="basePath() + '/globals/' + global.slug"
8375
- icon="heroCog6Tooth"
8386
+ [icon]="global.admin?.icon || 'heroCog6Tooth'"
8376
8387
  />
8377
8388
  }
8378
8389
  </mcms-sidebar-section>
@@ -14799,18 +14810,18 @@ function provideMomentumFieldRenderers() {
14799
14810
  registry.register('checkbox', () => Promise.resolve().then(function () { return checkboxField_component; }).then((m) => m.CheckboxFieldRenderer));
14800
14811
  registry.register('date', () => Promise.resolve().then(function () { return dateField_component; }).then((m) => m.DateFieldRenderer));
14801
14812
  registry.register('upload', () => Promise.resolve().then(function () { return uploadField_component; }).then((m) => m.UploadFieldRenderer));
14802
- registry.register('richText', () => import('./momentumcms-admin-rich-text-field.component-s47cVU85.mjs').then((m) => m.RichTextFieldRenderer));
14813
+ registry.register('richText', () => import('./momentumcms-admin-rich-text-field.component-BtPq7BWT.mjs').then((m) => m.RichTextFieldRenderer));
14803
14814
  // Layout field renderers (support nested field rendering)
14804
- registry.register('group', () => import('./momentumcms-admin-group-field.component-NdX_GSNQ.mjs').then((m) => m.GroupFieldRenderer));
14805
- registry.register('array', () => import('./momentumcms-admin-array-field.component-Co0_3wwq.mjs').then((m) => m.ArrayFieldRenderer));
14806
- registry.register('blocks', () => import('./momentumcms-admin-blocks-field.component-Dr0N35Nz.mjs').then((m) => m.BlocksFieldRenderer));
14815
+ registry.register('group', () => import('./momentumcms-admin-group-field.component-BmWE2N0v.mjs').then((m) => m.GroupFieldRenderer));
14816
+ registry.register('array', () => import('./momentumcms-admin-array-field.component-CfbBjPVd.mjs').then((m) => m.ArrayFieldRenderer));
14817
+ registry.register('blocks', () => import('./momentumcms-admin-blocks-field.component-QZ8tLEg6.mjs').then((m) => m.BlocksFieldRenderer));
14807
14818
  // Visual block editor variant (blocks field with admin.editor === 'visual')
14808
14819
  registry.register('blocks-visual', () => Promise.resolve().then(function () { return visualBlockEditor_component; }).then((m) => m.VisualBlockEditorComponent));
14809
- registry.register('relationship', () => import('./momentumcms-admin-relationship-field.component-Cy9BsTBY.mjs').then((m) => m.RelationshipFieldRenderer));
14820
+ registry.register('relationship', () => import('./momentumcms-admin-relationship-field.component-DQySS2uK.mjs').then((m) => m.RelationshipFieldRenderer));
14810
14821
  // Layout-only renderers (tabs, collapsible, row)
14811
- registry.register('tabs', () => import('./momentumcms-admin-tabs-field.component-C_iReaEt.mjs').then((m) => m.TabsFieldRenderer));
14812
- registry.register('collapsible', () => import('./momentumcms-admin-collapsible-field.component-C1GobKo0.mjs').then((m) => m.CollapsibleFieldRenderer));
14813
- registry.register('row', () => import('./momentumcms-admin-row-field.component-VJvSx9YM.mjs').then((m) => m.RowFieldRenderer));
14822
+ registry.register('tabs', () => import('./momentumcms-admin-tabs-field.component-Dj65PyBW.mjs').then((m) => m.TabsFieldRenderer));
14823
+ registry.register('collapsible', () => import('./momentumcms-admin-collapsible-field.component-BclQc85b.mjs').then((m) => m.CollapsibleFieldRenderer));
14824
+ registry.register('row', () => import('./momentumcms-admin-row-field.component-CDU2ukTM.mjs').then((m) => m.RowFieldRenderer));
14814
14825
  };
14815
14826
  },
14816
14827
  },
@@ -16688,4 +16699,4 @@ var uploadField_component = /*#__PURE__*/Object.freeze({
16688
16699
  */
16689
16700
 
16690
16701
  export { UploadService as $, AdminComponentRegistry as A, BlockEditDialog as B, CheckboxFieldRenderer as C, DashboardPage as D, EntityFormWidget as E, FieldRenderer as F, ForgotPasswordPage as G, LoginPage as H, MOMENTUM_API_CONTEXT as I, McmsThemeService as J, MediaLibraryPage as K, LivePreviewComponent as L, MOMENTUM_API as M, MediaPickerDialog as N, MediaPreviewComponent as O, MomentumApiService as P, MomentumAuthService as Q, NumberFieldRenderer as R, PublishControlsWidget as S, ResetPasswordFormComponent as T, ResetPasswordPage as U, SHEET_QUERY_PARAMS as V, SKIP_AUTO_TOAST as W, SelectFieldRenderer as X, SetupPage as Y, TextFieldRenderer as Z, UploadFieldRenderer as _, getFieldNodeState as a, VersionHistoryWidget as a0, VersionService as a1, VisualBlockEditorComponent as a2, adminGuard as a3, authGuard as a4, collectionAccessGuard as a5, crudToastInterceptor as a6, guestGuard as a7, injectHasAnyRole as a8, injectHasRole as a9, injectIsAdmin as aa, injectIsAuthenticated as ab, injectMomentumAPI as ac, injectTypedMomentumAPI as ad, injectUser as ae, injectUserRole as af, injectVersionService as ag, momentumAdminRoutes as ah, provideAdminComponent as ai, provideAdminSlot as aj, provideFieldRenderer as ak, provideMomentumAPI as al, provideMomentumFieldRenderers as am, registerConfigComponents as an, setupGuard as ao, unsavedChangesGuard as ap, getSubNode as b, getFieldDefaultValue as c, EntitySheetService as d, getTitleField as e, AdminPageResolver as f, getGlobalsFromRouteData as g, AdminShellComponent as h, isRecord as i, AdminSidebarWidget as j, AdminSlotOutlet as k, AdminSlotRegistry as l, BlockInserterComponent as m, normalizeBlockDefaults as n, BlockWrapperComponent as o, CollectionAccessService as p, CollectionCardWidget as q, CollectionEditPage as r, CollectionListPage as s, CollectionViewPage as t, DateFieldRenderer as u, EntityListWidget as v, EntityViewWidget as w, FeedbackService as x, FieldRendererRegistry as y, ForgotPasswordFormComponent as z };
16691
- //# sourceMappingURL=momentumcms-admin-momentumcms-admin-D56RXzt0.mjs.map
16702
+ //# sourceMappingURL=momentumcms-admin-momentumcms-admin-BKepTX-n.mjs.map