@umbraco-cms/backoffice 1.0.0-next.93a8a0e4 → 1.0.0-next.93ffdc6a

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.
@@ -1,11 +1,10 @@
1
- import { DataTypePropertyPresentationModel, TreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
1
+ import { ManifestElement, ManifestWithConditions, ManifestBase, ManifestClass, ManifestWithLoader, ClassConstructor, ManifestWithView, MetaManifestWithView, ManifestEntryPoint, ManifestKind, UmbExtensionRegistry } from '@umbraco-cms/backoffice/extension-api';
2
+ import { UmbModalHandler } from '@umbraco-cms/backoffice/modal';
3
+ import { UmbDataTypePropertyCollection } from '@umbraco-cms/backoffice/data-type';
4
+ import { TreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
2
5
  import { UmbStoreBase, UmbTreeStore, UmbItemStore } from '@umbraco-cms/backoffice/store';
3
6
  import { InterfaceLook, InterfaceColor } from '@umbraco-ui/uui-base/lib/types/index';
4
- import { ClassConstructor } from '@umbraco-cms/backoffice/models';
5
7
  import { UmbWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
6
- import { UmbModalHandler } from '@umbraco-cms/backoffice/modal';
7
- import { UmbExtensionRegistry } from '@umbraco-cms/backoffice/extensions-api';
8
- import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
9
8
 
10
9
  interface ManifestCollectionView extends ManifestElement, ManifestWithConditions<ConditionsCollectionView> {
11
10
  type: 'collectionView';
@@ -126,7 +125,7 @@ interface MetaEntityAction {
126
125
  repositoryAlias: string;
127
126
  }
128
127
  interface ConditionsEntityAction {
129
- entityType: string;
128
+ entityTypes: Array<string>;
130
129
  }
131
130
 
132
131
  /**
@@ -383,7 +382,7 @@ interface ManifestTreeItem extends ManifestElement<UmbTreeItemExtensionElement>
383
382
  conditions: ConditionsTreeItem;
384
383
  }
385
384
  interface ConditionsTreeItem {
386
- entityType: string;
385
+ entityTypes: Array<string>;
387
386
  }
388
387
 
389
388
  interface ManifestUserProfileApp extends ManifestElement {
@@ -442,144 +441,21 @@ interface ConditionsEditorViewCollection {
442
441
  workspaces: string[];
443
442
  }
444
443
 
445
- type ManifestTypes = ManifestCollectionView | ManifestDashboard | ManifestDashboardCollection | ManifestEntityAction | ManifestEntityBulkAction | ManifestEntrypoint | ManifestExternalLoginProvider | ManifestHeaderApp | ManifestHeaderAppButtonKind | ManifestHealthCheck | ManifestItemStore | ManifestMenu | ManifestMenuItem | ManifestMenuItemTreeKind | ManifestModal | ManifestPackageView | ManifestPropertyAction | ManifestPropertyEditorModel | ManifestPropertyEditorUI | ManifestRepository | ManifestSection | ManifestSectionSidebarApp | ManifestSectionSidebarAppMenuKind | ManifestSectionView | ManifestStore | ManifestTheme | ManifestTree | ManifestTreeItem | ManifestTreeStore | ManifestUserProfileApp | ManifestWorkspace | ManifestWorkspaceAction | ManifestWorkspaceEditorView | ManifestWorkspaceViewCollection | ManifestBase;
446
- type ManifestStandardTypes = ManifestTypes['type'];
447
- type ManifestTypeMap = {
448
- [Manifest in ManifestTypes as Manifest['type']]: Manifest;
449
- };
450
- type SpecificManifestTypeOrManifestBase<T extends keyof ManifestTypeMap | string> = T extends keyof ManifestTypeMap ? ManifestTypeMap[T] : ManifestBase;
451
- interface ManifestBase {
452
- /**
453
- * The type of extension such as dashboard etc...
454
- */
455
- type: string;
456
- /**
457
- * The alias of the extension, ensure it is unique
458
- */
459
- alias: string;
460
- /**
461
- * The kind of the extension, used to group extensions together
462
- *
463
- * @examples ["button"]
464
- */
465
- kind?: unknown;
466
- /**
467
- * The friendly name of the extension
468
- */
469
- name: string;
470
- /**
471
- * Extensions such as dashboards are ordered by weight with lower numbers being first in the list
472
- */
473
- weight?: number;
474
- }
475
- interface ManifestKind {
476
- type: 'kind';
477
- alias: string;
478
- matchType: string;
479
- matchKind: string;
480
- manifest: Partial<ManifestTypes>;
481
- }
482
- interface ManifestWithConditions<ConditionsType> {
483
- /**
484
- * Set the conditions for when the extension should be loaded
485
- */
486
- conditions: ConditionsType;
487
- }
488
- interface ManifestWithLoader<LoaderReturnType> extends ManifestBase {
489
- /**
490
- * @TJS-ignore
491
- */
492
- loader?: () => Promise<LoaderReturnType>;
493
- }
494
- /**
495
- * The type of extension such as dashboard etc...
496
- */
497
- interface ManifestClass<ClassType = unknown> extends ManifestWithLoader<{
498
- default: ClassConstructor<ClassType>;
499
- }> {
500
- readonly CLASS_TYPE?: ClassType;
501
- /**
502
- * The file location of the javascript file to load
503
- * @TJS-required
504
- */
505
- js?: string;
506
- /**
507
- * @TJS-ignore
508
- */
509
- className?: string;
510
- /**
511
- * @TJS-ignore
512
- */
513
- class?: ClassConstructor<ClassType>;
514
- }
515
- interface ManifestClassWithClassConstructor<T = unknown> extends ManifestClass<T> {
516
- class: ClassConstructor<T>;
517
- }
518
- interface ManifestElement<ElementType extends HTMLElement = HTMLElement> extends ManifestWithLoader<{
519
- default: ClassConstructor<ElementType>;
520
- } | Omit<object, 'default'>> {
521
- readonly ELEMENT_TYPE?: ElementType;
522
- /**
523
- * The file location of the javascript file to load
524
- *
525
- * @TJS-require
526
- */
527
- js?: string;
528
- /**
529
- * The HTML web component name to use such as 'my-dashboard'
530
- * Note it is NOT <my-dashboard></my-dashboard> but just the name
531
- */
532
- elementName?: string;
533
- /**
534
- * This contains properties specific to the type of extension
535
- */
536
- meta?: unknown;
537
- }
538
- interface ManifestWithView<ElementType extends HTMLElement = HTMLElement> extends ManifestElement<ElementType> {
539
- meta: MetaManifestWithView;
540
- }
541
- interface MetaManifestWithView {
542
- pathname: string;
543
- label: string;
544
- icon: string;
545
- }
546
- interface ManifestElementWithElementName extends ManifestElement {
547
- /**
548
- * The HTML web component name to use such as 'my-dashboard'
549
- * Note it is NOT <my-dashboard></my-dashboard> but just the name
550
- */
551
- elementName: string;
552
- }
553
- interface ManifestWithMeta extends ManifestBase {
554
- /**
555
- * This contains properties specific to the type of extension
556
- */
557
- meta: unknown;
558
- }
559
- /**
560
- * This type of extension gives full control and will simply load the specified JS file
561
- * You could have custom logic to decide which extensions to load/register by using extensionRegistry
562
- */
563
- interface ManifestEntrypoint extends ManifestBase {
564
- type: 'entryPoint';
565
- /**
566
- * The file location of the javascript file to load in the backoffice
567
- */
568
- js: string;
569
- }
444
+ type ManifestTypes = ManifestCollectionView | ManifestDashboard | ManifestDashboardCollection | ManifestEntityAction | ManifestEntityBulkAction | ManifestEntryPoint | ManifestExternalLoginProvider | ManifestHeaderApp | ManifestHeaderAppButtonKind | ManifestHealthCheck | ManifestItemStore | ManifestMenu | ManifestMenuItem | ManifestMenuItemTreeKind | ManifestModal | ManifestPackageView | ManifestPropertyAction | ManifestPropertyEditorModel | ManifestPropertyEditorUI | ManifestRepository | ManifestSection | ManifestSectionSidebarApp | ManifestSectionSidebarAppMenuKind | ManifestSectionView | ManifestStore | ManifestTheme | ManifestTree | ManifestTreeItem | ManifestTreeStore | ManifestUserProfileApp | ManifestWorkspace | ManifestWorkspaceAction | ManifestWorkspaceEditorView | ManifestWorkspaceViewCollection | ManifestBase;
570
445
 
571
446
  interface UmbDashboardExtensionElement extends HTMLElement {
572
447
  manifest?: ManifestDashboard;
573
448
  }
574
449
 
575
- interface UmbModalExtensionElement<UmbModalData extends object = object, UmbModalResult = unknown> extends HTMLElement {
450
+ interface UmbModalExtensionElement<UmbModalData extends object = object, UmbModalResult = unknown, ModalManifestType extends ManifestModal = ManifestModal> extends HTMLElement {
451
+ manifest?: ModalManifestType;
576
452
  modalHandler?: UmbModalHandler<UmbModalData, UmbModalResult>;
577
453
  data?: UmbModalData;
578
454
  }
579
455
 
580
456
  interface UmbPropertyEditorExtensionElement extends HTMLElement {
581
457
  value: unknown;
582
- config: DataTypePropertyPresentationModel[];
458
+ config?: UmbDataTypePropertyCollection;
583
459
  }
584
460
 
585
461
  interface UmbSectionExtensionElement extends HTMLElement {
@@ -590,10 +466,8 @@ interface UmbTreeItemExtensionElement extends HTMLElement {
590
466
  item?: TreeItemPresentationModel;
591
467
  }
592
468
 
593
- declare class UmbEntryPointExtensionInitializer {
594
- #private;
595
- constructor(host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry);
596
- instantiateEntryPoint(manifest: ManifestEntrypoint): Promise<void>;
597
- }
469
+ type UmbBackofficeManifestKind = ManifestKind<ManifestTypes>;
470
+ type UmbBackofficeExtensionRegistry = UmbExtensionRegistry<ManifestTypes>;
471
+ declare const umbExtensionsRegistry: UmbBackofficeExtensionRegistry;
598
472
 
599
- export { ConditionsCollectionView, ConditionsDashboard, ConditionsDashboardCollection, ConditionsEditorViewCollection, ConditionsEntityAction, ConditionsEntityBulkAction, ConditionsMenuItem, ConditionsPropertyAction, ConditionsSectionSidebarApp, ConditionsSectionView, ConditionsTreeItem, ConditionsWorkspaceAction, ConditionsWorkspaceView, HealthCheck, ManifestBase, ManifestClass, ManifestClassWithClassConstructor, ManifestCollectionView, ManifestDashboard, ManifestDashboardCollection, ManifestElement, ManifestElementWithElementName, ManifestEntityAction, ManifestEntityBulkAction, ManifestEntrypoint, ManifestExternalLoginProvider, ManifestHeaderApp, ManifestHeaderAppButtonKind, ManifestHealthCheck, ManifestItemStore, ManifestKind, ManifestMenu, ManifestMenuItem, ManifestMenuItemTreeKind, ManifestModal, ManifestPackageView, ManifestPropertyAction, ManifestPropertyEditorModel, ManifestPropertyEditorUI, ManifestRepository, ManifestSection, ManifestSectionSidebarApp, ManifestSectionSidebarAppMenuKind, ManifestSectionView, ManifestStandardTypes, ManifestStore, ManifestTheme, ManifestTree, ManifestTreeItem, ManifestTreeStore, ManifestTypeMap, ManifestTypes, ManifestUserProfileApp, ManifestWithConditions, ManifestWithLoader, ManifestWithMeta, ManifestWithView, ManifestWorkspace, ManifestWorkspaceAction, ManifestWorkspaceEditorView, ManifestWorkspaceViewCollection, MetaCollectionView, MetaDashboard, MetaDashboardCollection, MetaEditor, MetaEditorViewCollection, MetaEntityAction, MetaEntityBulkAction, MetaExternalLoginProvider, MetaHeaderApp, MetaHeaderAppButtonKind, MetaHealthCheck, MetaManifestWithView, MetaMenuItem, MetaMenuItemTreeKind, MetaPackageView, MetaPropertyEditorModel, MetaPropertyEditorUI, MetaSection, MetaSectionSidebarAppMenuKind, MetaSectionView, MetaTree, MetaUserProfileApp, MetaWorkspaceAction, PropertyEditorConfig, PropertyEditorConfigDefaultData, PropertyEditorConfigProperty, SpecificManifestTypeOrManifestBase, UmbDashboardExtensionElement, UmbEntryPointExtensionInitializer, UmbExternalLoginProviderExtensionElement, UmbMenuItemExtensionElement, UmbModalExtensionElement, UmbPropertyEditorExtensionElement, UmbSectionExtensionElement, UmbSectionSidebarAppExtensionElement, UmbSectionViewExtensionElement, UmbTreeItemExtensionElement, UmbWorkspaceEditorViewExtensionElement };
473
+ export { ConditionsCollectionView, ConditionsDashboard, ConditionsDashboardCollection, ConditionsEditorViewCollection, ConditionsEntityAction, ConditionsEntityBulkAction, ConditionsMenuItem, ConditionsPropertyAction, ConditionsSectionSidebarApp, ConditionsSectionView, ConditionsTreeItem, ConditionsWorkspaceAction, ConditionsWorkspaceView, HealthCheck, ManifestCollectionView, ManifestDashboard, ManifestDashboardCollection, ManifestEntityAction, ManifestEntityBulkAction, ManifestExternalLoginProvider, ManifestHeaderApp, ManifestHeaderAppButtonKind, ManifestHealthCheck, ManifestItemStore, ManifestMenu, ManifestMenuItem, ManifestMenuItemTreeKind, ManifestModal, ManifestPackageView, ManifestPropertyAction, ManifestPropertyEditorModel, ManifestPropertyEditorUI, ManifestRepository, ManifestSection, ManifestSectionSidebarApp, ManifestSectionSidebarAppMenuKind, ManifestSectionView, ManifestStore, ManifestTheme, ManifestTree, ManifestTreeItem, ManifestTreeStore, ManifestTypes, ManifestUserProfileApp, ManifestWorkspace, ManifestWorkspaceAction, ManifestWorkspaceEditorView, ManifestWorkspaceViewCollection, MetaCollectionView, MetaDashboard, MetaDashboardCollection, MetaEditor, MetaEditorViewCollection, MetaEntityAction, MetaEntityBulkAction, MetaExternalLoginProvider, MetaHeaderApp, MetaHeaderAppButtonKind, MetaHealthCheck, MetaMenuItem, MetaMenuItemTreeKind, MetaPackageView, MetaPropertyEditorModel, MetaPropertyEditorUI, MetaSection, MetaSectionSidebarAppMenuKind, MetaSectionView, MetaTree, MetaUserProfileApp, MetaWorkspaceAction, PropertyEditorConfig, PropertyEditorConfigDefaultData, PropertyEditorConfigProperty, UmbBackofficeExtensionRegistry, UmbBackofficeManifestKind, UmbDashboardExtensionElement, UmbExternalLoginProviderExtensionElement, UmbMenuItemExtensionElement, UmbModalExtensionElement, UmbPropertyEditorExtensionElement, UmbSectionExtensionElement, UmbSectionSidebarAppExtensionElement, UmbSectionViewExtensionElement, UmbTreeItemExtensionElement, UmbWorkspaceEditorViewExtensionElement, umbExtensionsRegistry };