@umbraco-cms/backoffice 1.0.0-next.b3c19406 → 1.0.0-next.b435296e

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/data-type.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { DataTypePropertyPresentationModel } from '@umbraco-cms/backoffice/backend-api';
2
+
3
+ /**
4
+ * Extends Array to add utility functions for accessing data type properties
5
+ * by alias, returning either the value or the complete DataTypePropertyPresentationModel object
6
+ */
7
+ declare class UmbDataTypePropertyCollection extends Array<DataTypePropertyPresentationModel> {
8
+ constructor(args?: Array<DataTypePropertyPresentationModel>);
9
+ getValueByAlias<T>(alias: string): T | undefined;
10
+ getByAlias(alias: string): DataTypePropertyPresentationModel | undefined;
11
+ }
12
+
13
+ export { UmbDataTypePropertyCollection };
@@ -1,6 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
- import { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
3
- import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
2
+ import { HTMLElementConstructor } from '@umbraco-cms/backoffice/extension-api';
3
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
4
4
  import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
5
5
  import { UmbObserverController } from '@umbraco-cms/backoffice/observable-api';
6
6
 
@@ -1,4 +1,4 @@
1
- import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
1
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
2
2
  import { UmbEntityActionBase as UmbEntityActionBase$1 } from '@umbraco-cms/backoffice/entity-action';
3
3
  import { UmbDetailRepository, UmbItemRepository, UmbFolderRepository } from '@umbraco-cms/backoffice/repository';
4
4
 
@@ -0,0 +1,200 @@
1
+ import { Observable } from 'rxjs';
2
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
3
+
4
+ type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
5
+ type ClassConstructor<T> = new (...args: any[]) => T;
6
+ type ManifestTypeMap<ManifestTypes extends ManifestBase> = {
7
+ [Manifest in ManifestTypes as Manifest['type']]: Manifest;
8
+ } & {
9
+ [key: string]: ManifestBase;
10
+ };
11
+ type SpecificManifestTypeOrManifestBase<ManifestTypes extends ManifestBase, T extends keyof ManifestTypeMap<ManifestTypes> | string> = T extends keyof ManifestTypeMap<ManifestTypes> ? ManifestTypeMap<ManifestTypes>[T] : ManifestBase;
12
+ interface ManifestBase {
13
+ /**
14
+ * The type of extension such as dashboard etc...
15
+ */
16
+ type: string;
17
+ /**
18
+ * The alias of the extension, ensure it is unique
19
+ */
20
+ alias: string;
21
+ /**
22
+ * The kind of the extension, used to group extensions together
23
+ *
24
+ * @examples ["button"]
25
+ */
26
+ kind?: unknown;
27
+ /**
28
+ * The friendly name of the extension
29
+ */
30
+ name: string;
31
+ /**
32
+ * Extensions such as dashboards are ordered by weight with lower numbers being first in the list
33
+ */
34
+ weight?: number;
35
+ }
36
+ interface ManifestKind<ManifestTypes> {
37
+ type: 'kind';
38
+ alias: string;
39
+ matchType: string;
40
+ matchKind: string;
41
+ manifest: Partial<ManifestTypes>;
42
+ }
43
+ interface ManifestWithConditions<ConditionsType> {
44
+ /**
45
+ * Set the conditions for when the extension should be loaded
46
+ */
47
+ conditions: ConditionsType;
48
+ }
49
+ interface ManifestWithLoader<LoaderReturnType> extends ManifestBase {
50
+ /**
51
+ * @TJS-ignore
52
+ */
53
+ loader?: () => Promise<LoaderReturnType>;
54
+ }
55
+ /**
56
+ * The type of extension such as dashboard etc...
57
+ */
58
+ interface ManifestClass<ClassType = unknown> extends ManifestWithLoader<{
59
+ default: ClassConstructor<ClassType>;
60
+ }> {
61
+ readonly CLASS_TYPE?: ClassType;
62
+ /**
63
+ * The file location of the javascript file to load
64
+ * @TJS-required
65
+ */
66
+ js?: string;
67
+ /**
68
+ * @TJS-ignore
69
+ */
70
+ className?: string;
71
+ /**
72
+ * @TJS-ignore
73
+ */
74
+ class?: ClassConstructor<ClassType>;
75
+ }
76
+ interface ManifestClassWithClassConstructor<T = unknown> extends ManifestClass<T> {
77
+ class: ClassConstructor<T>;
78
+ }
79
+ interface ManifestElement<ElementType extends HTMLElement = HTMLElement> extends ManifestWithLoader<{
80
+ default: ClassConstructor<ElementType>;
81
+ } | Omit<object, 'default'>> {
82
+ readonly ELEMENT_TYPE?: ElementType;
83
+ /**
84
+ * The file location of the javascript file to load
85
+ *
86
+ * @TJS-require
87
+ */
88
+ js?: string;
89
+ /**
90
+ * The HTML web component name to use such as 'my-dashboard'
91
+ * Note it is NOT <my-dashboard></my-dashboard> but just the name
92
+ */
93
+ elementName?: string;
94
+ /**
95
+ * This contains properties specific to the type of extension
96
+ */
97
+ meta?: unknown;
98
+ }
99
+ interface ManifestWithView<ElementType extends HTMLElement = HTMLElement> extends ManifestElement<ElementType> {
100
+ meta: MetaManifestWithView;
101
+ }
102
+ interface MetaManifestWithView {
103
+ pathname: string;
104
+ label: string;
105
+ icon: string;
106
+ }
107
+ interface ManifestElementWithElementName extends ManifestElement {
108
+ /**
109
+ * The HTML web component name to use such as 'my-dashboard'
110
+ * Note it is NOT <my-dashboard></my-dashboard> but just the name
111
+ */
112
+ elementName: string;
113
+ }
114
+ interface ManifestWithMeta extends ManifestBase {
115
+ /**
116
+ * This contains properties specific to the type of extension
117
+ */
118
+ meta: unknown;
119
+ }
120
+ /**
121
+ * This type of extension gives full control and will simply load the specified JS file
122
+ * You could have custom logic to decide which extensions to load/register by using extensionRegistry
123
+ */
124
+ interface ManifestEntryPoint extends ManifestBase {
125
+ type: 'entryPoint';
126
+ /**
127
+ * The file location of the javascript file to load in the backoffice
128
+ */
129
+ js: string;
130
+ }
131
+
132
+ declare class UmbExtensionRegistry<IncomingManifestTypes extends ManifestBase, ManifestTypes extends ManifestBase = IncomingManifestTypes | ManifestBase> {
133
+ private _extensions;
134
+ readonly extensions: Observable<ManifestTypes[]>;
135
+ private _kinds;
136
+ readonly kinds: Observable<ManifestKind<ManifestTypes>[]>;
137
+ defineKind(kind: ManifestKind<ManifestTypes>): void;
138
+ register(manifest: ManifestTypes | ManifestKind<ManifestTypes>): void;
139
+ registerMany(manifests: Array<ManifestTypes | ManifestKind<ManifestTypes>>): void;
140
+ unregister(alias: string): void;
141
+ isRegistered(alias: string): boolean;
142
+ private _kindsOfType;
143
+ private _extensionsOfType;
144
+ private _kindsOfTypes;
145
+ private _extensionsOfTypes;
146
+ getByTypeAndAlias<Key extends keyof ManifestTypeMap<ManifestTypes> | string, T extends ManifestBase = SpecificManifestTypeOrManifestBase<ManifestTypes, Key>>(type: Key, alias: string): Observable<T | undefined>;
147
+ extensionsOfType<Key extends keyof ManifestTypeMap<ManifestTypes> | string, T extends ManifestBase = SpecificManifestTypeOrManifestBase<ManifestTypes, Key>>(type: Key): Observable<T[]>;
148
+ extensionsOfTypes<ExtensionTypes extends ManifestBase = ManifestBase>(types: string[]): Observable<Array<ExtensionTypes>>;
149
+ }
150
+
151
+ declare function isManifestClassConstructorType(manifest: unknown): manifest is ManifestClassWithClassConstructor;
152
+
153
+ declare function isManifestClassableType(manifest: ManifestBase): manifest is ManifestClass;
154
+
155
+ declare function isManifestElementNameType(manifest: unknown): manifest is ManifestElementWithElementName;
156
+
157
+ declare function isManifestElementableType<ElementType extends HTMLElement = HTMLElement>(manifest: ManifestBase): manifest is ManifestElement;
158
+
159
+ type ManifestJSType<T> = ManifestWithLoader<T> & {
160
+ js: string;
161
+ };
162
+ declare function isManifestJSType<T>(manifest: ManifestBase | unknown): manifest is ManifestJSType<T>;
163
+
164
+ type ManifestLoaderType<T> = ManifestWithLoader<T> & {
165
+ loader: () => Promise<T>;
166
+ };
167
+ declare function isManifestLoaderType<T>(manifest: ManifestBase): manifest is ManifestLoaderType<T>;
168
+
169
+ declare function createExtensionElement<ElementType extends HTMLElement>(manifest: ManifestElement<ElementType>): Promise<ElementType | undefined>;
170
+
171
+ declare function hasDefaultExport<ConstructorType>(object: unknown): object is {
172
+ default: ConstructorType;
173
+ };
174
+
175
+ type UmbEntryPointOnInit = (host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry<ManifestBase>) => void;
176
+ /**
177
+ * Interface containing supported life-cycle functions for ESModule entry points
178
+ */
179
+ interface UmbEntryPointModule {
180
+ onInit: UmbEntryPointOnInit;
181
+ }
182
+
183
+ /**
184
+ * Validate if an ESModule exports a known init function called 'onInit'
185
+ */
186
+ declare function hasInitExport(obj: unknown): obj is Pick<UmbEntryPointModule, 'onInit'>;
187
+
188
+ declare function loadExtension<T = unknown>(manifest: ManifestWithLoader<T>): Promise<T | null>;
189
+
190
+ declare function createExtensionElementOrFallback(manifest: any, fallbackElementName: string): Promise<HTMLElement | undefined>;
191
+
192
+ declare function createExtensionClass<T = unknown>(manifest: ManifestClass, constructorArguments: unknown[]): Promise<T | undefined>;
193
+
194
+ declare class UmbEntryPointExtensionInitializer {
195
+ #private;
196
+ constructor(host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry<ManifestEntryPoint>);
197
+ instantiateEntryPoint(manifest: ManifestEntryPoint): Promise<void>;
198
+ }
199
+
200
+ export { ClassConstructor, HTMLElementConstructor, ManifestBase, ManifestClass, ManifestClassWithClassConstructor, ManifestElement, ManifestElementWithElementName, ManifestEntryPoint, ManifestJSType, ManifestKind, ManifestLoaderType, ManifestTypeMap, ManifestWithConditions, ManifestWithLoader, ManifestWithMeta, ManifestWithView, MetaManifestWithView, SpecificManifestTypeOrManifestBase, UmbEntryPointExtensionInitializer, UmbEntryPointModule, UmbEntryPointOnInit, UmbExtensionRegistry, createExtensionClass, createExtensionElement, createExtensionElementOrFallback, hasDefaultExport, hasInitExport, isManifestClassConstructorType, isManifestClassableType, isManifestElementNameType, isManifestElementableType, isManifestJSType, isManifestLoaderType, loadExtension };
@@ -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';
@@ -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 };
package/modal.d.ts CHANGED
@@ -4,11 +4,11 @@ import * as lit from 'lit';
4
4
  import { LitElement, TemplateResult } from 'lit';
5
5
  import * as lit_html from 'lit-html';
6
6
  import { UUIModalDialogElement, UUIModalSidebarElement, UUIModalSidebarSize } from '@umbraco-ui/uui';
7
- import { UmbControllerHostElement, UmbControllerInterface } from '@umbraco-cms/backoffice/controller';
7
+ import { UmbControllerHostElement, UmbControllerInterface } from '@umbraco-cms/backoffice/controller-api';
8
8
  import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
9
9
  import { Params } from '@umbraco-cms/backoffice/router';
10
- import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbPickerModalData as UmbPickerModalData$1 } from '@umbraco-cms/backoffice/modal';
11
- import { LanguageResponseModel, UserResponseModel, FolderReponseModel } from '@umbraco-cms/backoffice/backend-api';
10
+ import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbTreePickerModalData as UmbTreePickerModalData$1, UmbPickerModalResult as UmbPickerModalResult$1, UmbPickerModalData as UmbPickerModalData$1 } from '@umbraco-cms/backoffice/modal';
11
+ import { DocumentTreeItemResponseModel, EntityTreeItemResponseModel, LanguageResponseModel, ContentTreeItemResponseModel, UserResponseModel, FolderReponseModel, FolderTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
12
12
 
13
13
  declare class UmbSearchModalElement extends LitElement {
14
14
  #private;
@@ -26,38 +26,36 @@ declare global {
26
26
  }
27
27
  }
28
28
 
29
- declare class UmbModalToken<Data extends object = object, Result = unknown> {
29
+ declare class UmbModalToken<ModalDataType extends object = object, ModalResultType = unknown> {
30
30
  protected alias: string;
31
31
  protected defaultConfig?: UmbModalConfig | undefined;
32
- protected _desc?: string | undefined;
32
+ protected defaultData?: ModalDataType | undefined;
33
33
  /**
34
34
  * Get the data type of the token's data.
35
35
  *
36
36
  * @public
37
- * @type {Data}
37
+ * @type {ModalDataType}
38
38
  * @memberOf UmbModalToken
39
39
  * @example `typeof MyModal.TYPE`
40
40
  * @returns undefined
41
41
  */
42
- readonly DATA: Data;
42
+ readonly DATA: ModalDataType;
43
43
  /**
44
44
  * Get the result type of the token
45
45
  *
46
46
  * @public
47
- * @type {Result}
47
+ * @type {ModalResultType}
48
48
  * @memberOf UmbModalToken
49
49
  * @example `typeof MyModal.RESULT`
50
50
  * @returns undefined
51
51
  */
52
- readonly RESULT: Result;
52
+ readonly RESULT: ModalResultType;
53
53
  /**
54
54
  * @param alias Unique identifier for the token,
55
55
  * @param defaultConfig Default configuration for the modal,
56
- * @param _desc Description for the token,
57
- * used only for debugging purposes,
58
- * it should but does not need to be unique
56
+ * @param defaultData Default data for the modal,
59
57
  */
60
- constructor(alias: string, defaultConfig?: UmbModalConfig | undefined, _desc?: string | undefined);
58
+ constructor(alias: string, defaultConfig?: UmbModalConfig | undefined, defaultData?: ModalDataType | undefined);
61
59
  /**
62
60
  * This method must always return the unique alias of the token since that
63
61
  * will be used to look up the token in the injector.
@@ -66,6 +64,7 @@ declare class UmbModalToken<Data extends object = object, Result = unknown> {
66
64
  */
67
65
  toString(): string;
68
66
  getDefaultConfig(): UmbModalConfig | undefined;
67
+ getDefaultData(): ModalDataType | undefined;
69
68
  }
70
69
 
71
70
  /**
@@ -207,23 +206,13 @@ interface UmbContextDebuggerModalData {
207
206
  }
208
207
  declare const UMB_CONTEXT_DEBUGGER_MODAL: UmbModalToken$1<UmbContextDebuggerModalData, unknown>;
209
208
 
210
- interface UmbDocumentPickerModalData {
211
- multiple?: boolean;
212
- selection?: Array<string | null>;
213
- }
214
- interface UmbDocumentPickerModalResult {
215
- selection: Array<string | null>;
216
- }
217
- declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbDocumentPickerModalResult>;
209
+ type UmbDocumentPickerModalData = UmbTreePickerModalData$1<DocumentTreeItemResponseModel>;
210
+ type UmbDocumentPickerModalResult = UmbPickerModalResult$1;
211
+ declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbPickerModalResult$1>;
218
212
 
219
- interface UmbDocumentTypePickerModalData {
220
- multiple?: boolean;
221
- selection?: Array<string>;
222
- }
223
- interface UmbDocumentTypePickerModalResult {
224
- selection: Array<string | null>;
225
- }
226
- declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult>;
213
+ type UmbDocumentTypePickerModalData = UmbTreePickerModalData$1<EntityTreeItemResponseModel>;
214
+ type UmbDocumentTypePickerModalResult = UmbPickerModalResult$1;
215
+ declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbPickerModalResult$1>;
227
216
 
228
217
  declare enum OEmbedStatus {
229
218
  NotSupported = 0,
@@ -288,11 +277,11 @@ declare const UMB_INVITE_USER_MODAL: UmbModalToken$1<object, unknown>;
288
277
 
289
278
  interface UmbLanguagePickerModalData {
290
279
  multiple?: boolean;
291
- selection?: Array<string>;
280
+ selection?: Array<string | null>;
292
281
  filter?: (language: LanguageResponseModel) => boolean;
293
282
  }
294
283
  interface UmbLanguagePickerModalResult {
295
- selection: Array<string>;
284
+ selection: Array<string | null>;
296
285
  }
297
286
  declare const UMB_LANGUAGE_PICKER_MODAL: UmbModalToken$1<UmbLanguagePickerModalData, UmbLanguagePickerModalResult>;
298
287
 
@@ -322,14 +311,9 @@ interface UmbLinkPickerConfig {
322
311
  }
323
312
  declare const UMB_LINK_PICKER_MODAL: UmbModalToken$1<UmbLinkPickerModalData, UmbLinkPickerModalResult>;
324
313
 
325
- interface UmbMediaPickerModalData {
326
- multiple?: boolean;
327
- selection: Array<string>;
328
- }
329
- interface UmbMediaPickerModalResult {
330
- selection: Array<string | null>;
331
- }
332
- declare const UMB_MEDIA_PICKER_MODAL: UmbModalToken$1<UmbMediaPickerModalData, UmbMediaPickerModalResult>;
314
+ type UmbMediaTreePickerModalData = UmbTreePickerModalData$1<ContentTreeItemResponseModel>;
315
+ type UmbMediaTreePickerModalResult = UmbPickerModalResult$1;
316
+ declare const UMB_MEDIA_TREE_PICKER_MODAL: UmbModalToken$1<UmbMediaTreePickerModalData, UmbPickerModalResult$1>;
333
317
 
334
318
  interface UmbPropertyEditorUIPickerModalData {
335
319
  selection?: Array<string>;
@@ -359,9 +343,12 @@ declare const UMB_SEARCH_MODAL: UmbModalToken$1<object, unknown>;
359
343
 
360
344
  interface UmbSectionPickerModalData {
361
345
  multiple: boolean;
362
- selection: string[];
346
+ selection: Array<string | null>;
363
347
  }
364
- declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, unknown>;
348
+ interface UmbSectionPickerModalResult {
349
+ selection: Array<string | null>;
350
+ }
351
+ declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, UmbSectionPickerModalResult>;
365
352
 
366
353
  interface UmbTemplateModalData {
367
354
  id: string;
@@ -372,20 +359,15 @@ interface UmbTemplateModalResult {
372
359
  }
373
360
  declare const UMB_TEMPLATE_MODAL: UmbModalToken$1<UmbTemplateModalData, UmbTemplateModalResult>;
374
361
 
375
- interface UmbTemplatePickerModalData {
376
- multiple: boolean;
377
- selection: Array<string | null>;
378
- }
379
- interface UmbTemplatePickerModalResult {
380
- selection: Array<string | null>;
381
- }
382
- declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbTemplatePickerModalResult>;
362
+ type UmbTemplatePickerModalData = UmbTreePickerModalData$1<EntityTreeItemResponseModel>;
363
+ type UmbTemplatePickerModalResult = UmbPickerModalResult$1;
364
+ declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbPickerModalResult$1>;
383
365
 
384
366
  declare const UMB_USER_GROUP_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<any>, unknown>;
385
367
 
386
368
  type UmbUserPickerModalData = UmbPickerModalData$1<UserResponseModel>;
387
369
  interface UmbUserPickerModalResult {
388
- selection: Array<string>;
370
+ selection: Array<string | null>;
389
371
  }
390
372
  declare const UMB_USER_PICKER_MODAL: UmbModalToken$1<UmbUserPickerModalData, UmbUserPickerModalResult>;
391
373
 
@@ -398,22 +380,41 @@ interface UmbFolderModalResult {
398
380
  }
399
381
  declare const UMB_FOLDER_MODAL: UmbModalToken$1<UmbFolderModalData, UmbFolderModalResult>;
400
382
 
401
- interface UmbDataTypePickerModalData {
402
- selection?: Array<string | null>;
403
- multiple?: boolean;
383
+ interface UmbPartialViewPickerModalData {
384
+ multiple: boolean;
385
+ selection: string[];
404
386
  }
405
- interface UmbDataTypePickerModalResult {
406
- selection: Array<string | null>;
387
+ interface UmbPartialViewPickerModalResult {
388
+ selection: Array<string | null> | undefined;
407
389
  }
408
- declare const UMB_DATA_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDataTypePickerModalData, UmbDataTypePickerModalResult>;
390
+ declare const UMB_PARTIAL_VIEW_PICKER_MODAL_ALIAS = "Umb.Modal.PartialViewPicker";
391
+ declare const UMB_PARTIAL_VIEW_PICKER_MODAL: UmbModalToken$1<UmbPartialViewPickerModalData, UmbPartialViewPickerModalResult>;
409
392
 
410
- interface UmbPickerModalData<T> {
393
+ interface UmbDictionaryItemPickerModalData {
411
394
  multiple: boolean;
395
+ selection: string[];
396
+ }
397
+ interface UmbDictionaryItemPickerModalResult {
412
398
  selection: Array<string | null>;
413
- filter?: (item: T) => boolean;
399
+ }
400
+ declare const UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS = "Umb.Modal.DictionaryItemPicker";
401
+ declare const UMB_DICTIONARY_ITEM_PICKER_MODAL: UmbModalToken$1<UmbDictionaryItemPickerModalData, UmbDictionaryItemPickerModalResult>;
402
+
403
+ type UmbDataTypePickerModalData = UmbTreePickerModalData$1<FolderTreeItemResponseModel>;
404
+ type UmbDataTypePickerModalResult = UmbPickerModalResult$1;
405
+ declare const UMB_DATA_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDataTypePickerModalData, UmbPickerModalResult$1>;
406
+
407
+ interface UmbPickerModalData<ItemType> {
408
+ multiple?: boolean;
409
+ selection?: Array<string | null>;
410
+ filter?: (item: ItemType) => boolean;
411
+ pickableFilter?: (item: ItemType) => boolean;
414
412
  }
415
413
  interface UmbPickerModalResult {
416
414
  selection: Array<string | null>;
417
415
  }
416
+ interface UmbTreePickerModalData<TreeItemType> extends UmbPickerModalData<TreeItemType> {
417
+ treeAlias?: string;
418
+ }
418
419
 
419
- export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DATA_TYPE_PICKER_MODAL, UMB_DOCUMENT_PICKER_MODAL, UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_FOLDER_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_TEMPLATE_MODAL, UMB_TEMPLATE_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDataTypePickerModalData, UmbDataTypePickerModalResult, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbFolderModalData, UmbFolderModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaPickerModalData, UmbMediaPickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData, UmbTemplateModalData, UmbTemplateModalResult, UmbTemplatePickerModalData, UmbTemplatePickerModalResult, UmbUserPickerModalData, UmbUserPickerModalResult };
420
+ export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DATA_TYPE_PICKER_MODAL, UMB_DICTIONARY_ITEM_PICKER_MODAL, UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS, UMB_DOCUMENT_PICKER_MODAL, UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_FOLDER_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_TREE_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PARTIAL_VIEW_PICKER_MODAL, UMB_PARTIAL_VIEW_PICKER_MODAL_ALIAS, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_TEMPLATE_MODAL, UMB_TEMPLATE_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDataTypePickerModalData, UmbDataTypePickerModalResult, UmbDictionaryItemPickerModalData, UmbDictionaryItemPickerModalResult, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbFolderModalData, UmbFolderModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaTreePickerModalData, UmbMediaTreePickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPartialViewPickerModalData, UmbPartialViewPickerModalResult, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData, UmbSectionPickerModalResult, UmbTemplateModalData, UmbTemplateModalResult, UmbTemplatePickerModalData, UmbTemplatePickerModalResult, UmbTreePickerModalData, UmbUserPickerModalData, UmbUserPickerModalResult };
package/models.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
2
- type ClassConstructor<T> = new (...args: any[]) => T;
3
1
  /** Tried to find a common base of our entities — used by Entity Workspace Context */
4
2
  type UmbEntityBase = {
5
3
  id?: string;
@@ -9,5 +7,11 @@ interface UmbSwatchDetails {
9
7
  label: string;
10
8
  value: string;
11
9
  }
10
+ interface ServertimeOffset {
11
+ /**
12
+ * offset in minutes relative to UTC
13
+ */
14
+ offset: number;
15
+ }
12
16
 
13
- export { ClassConstructor, HTMLElementConstructor, UmbEntityBase, UmbSwatchDetails };
17
+ export { ServertimeOffset, UmbEntityBase, UmbSwatchDetails };