@umbraco-cms/backoffice 1.0.0-next.596cc732 → 1.0.0-next.5e6a5e07

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/element.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { HTMLElementConstructor } from './models';
3
- import { UmbControllerHostInterface } from './controller';
3
+ import { UmbControllerHostElement } from './controller';
4
4
  import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from './context-api';
5
5
  import { UmbObserverController } from './observable-api';
6
6
 
7
7
  interface ResolvedContexts {
8
8
  [key: string]: any;
9
9
  }
10
- declare class UmbElementMixinInterface extends UmbControllerHostInterface {
10
+ declare class UmbElementMixinInterface extends UmbControllerHostElement {
11
11
  observe<T>(source: Observable<T>, callback: (_value: T) => void, unique?: string): UmbObserverController<T>;
12
12
  provideContext<R = unknown>(alias: string | UmbContextToken<R>, instance: R): UmbContextProviderController<R>;
13
13
  consumeContext<R = unknown>(alias: string | UmbContextToken<R>, callback: UmbContextCallback<R>): UmbContextConsumerController<R>;
14
14
  consumeAllContexts(contextAliases: string[], callback: (_instances: ResolvedContexts) => void): void;
15
15
  }
16
- declare const UmbElementMixin: <T extends HTMLElementConstructor<HTMLElement>>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
16
+ declare const UmbElementMixin: <T extends HTMLElementConstructor>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
17
17
 
18
18
  export { UmbElementMixin, UmbElementMixinInterface };
@@ -1,15 +1,16 @@
1
- import { UmbControllerHostInterface } from './controller';
1
+ import { UmbControllerHostElement } from './controller';
2
2
  import { UmbEntityActionBase as UmbEntityActionBase$1 } from './entity-action';
3
+ import { UmbFolderRepository } from './repository';
3
4
 
4
5
  interface UmbAction<RepositoryType = unknown> {
5
- host: UmbControllerHostInterface;
6
+ host: UmbControllerHostElement;
6
7
  repository: RepositoryType;
7
8
  execute(): Promise<void>;
8
9
  }
9
10
  declare class UmbActionBase<RepositoryType> {
10
- host: UmbControllerHostInterface;
11
+ host: UmbControllerHostElement;
11
12
  repository?: RepositoryType;
12
- constructor(host: UmbControllerHostInterface, repositoryAlias: string);
13
+ constructor(host: UmbControllerHostElement, repositoryAlias: string);
13
14
  }
14
15
 
15
16
  interface UmbEntityAction<RepositoryType> extends UmbAction<RepositoryType> {
@@ -17,7 +18,8 @@ interface UmbEntityAction<RepositoryType> extends UmbAction<RepositoryType> {
17
18
  }
18
19
  declare class UmbEntityActionBase<RepositoryType> extends UmbActionBase<RepositoryType> {
19
20
  unique: string;
20
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
21
+ repositoryAlias: string;
22
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
21
23
  }
22
24
 
23
25
  interface UmbEntityBulkAction<RepositoryType = unknown> extends UmbAction<RepositoryType> {
@@ -26,37 +28,52 @@ interface UmbEntityBulkAction<RepositoryType = unknown> extends UmbAction<Reposi
26
28
  }
27
29
  declare class UmbEntityBulkActionBase<RepositoryType = unknown> extends UmbActionBase<RepositoryType> {
28
30
  selection: Array<string>;
29
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, selection: Array<string>);
31
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, selection: Array<string>);
30
32
  setSelection(selection: Array<string>): void;
31
33
  }
32
34
 
33
35
  declare class UmbCopyEntityAction<T extends {
34
36
  copy(): Promise<void>;
35
37
  }> extends UmbEntityActionBase$1<T> {
36
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
38
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
37
39
  execute(): Promise<void>;
38
40
  }
39
41
 
40
42
  declare class UmbDeleteEntityAction<T extends {
41
43
  delete(unique: string): Promise<void>;
42
- requestItems(uniques: Array<string>): any;
44
+ requestTreeItems(uniques: Array<string>): any;
43
45
  }> extends UmbEntityActionBase$1<T> {
44
46
  #private;
45
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
47
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
48
+ execute(): Promise<void>;
49
+ }
50
+
51
+ declare class UmbDeleteFolderEntityAction<T extends {
52
+ deleteFolder(unique: string): Promise<void>;
53
+ requestTreeItems(uniques: Array<string>): any;
54
+ }> extends UmbEntityActionBase$1<T> {
55
+ #private;
56
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
57
+ execute(): Promise<void>;
58
+ }
59
+
60
+ declare class UmbFolderUpdateEntityAction<T extends UmbFolderRepository = UmbFolderRepository> extends UmbEntityActionBase$1<T> {
61
+ #private;
62
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
46
63
  execute(): Promise<void>;
47
64
  }
48
65
 
49
66
  declare class UmbMoveEntityAction<T extends {
50
67
  move(): Promise<void>;
51
68
  }> extends UmbEntityActionBase$1<T> {
52
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
69
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
53
70
  execute(): Promise<void>;
54
71
  }
55
72
 
56
73
  declare class UmbSortChildrenOfEntityAction<T extends {
57
74
  sortChildrenOf(): Promise<void>;
58
75
  }> extends UmbEntityActionBase$1<T> {
59
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
76
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
60
77
  execute(): Promise<void>;
61
78
  }
62
79
 
@@ -65,8 +82,8 @@ declare class UmbTrashEntityAction<T extends {
65
82
  requestTreeItems(uniques: Array<string>): any;
66
83
  }> extends UmbEntityActionBase$1<T> {
67
84
  #private;
68
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
85
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
69
86
  execute(): Promise<void>;
70
87
  }
71
88
 
72
- export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
89
+ export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbDeleteFolderEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbFolderUpdateEntityAction, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ManifestTypes, ManifestKind, ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestElement, ManifestElementWithElementName, ManifestClass } from './extensions-registry';
3
3
  import { UmbContextToken } from './context-api';
4
- import { UmbControllerHostInterface } from './controller';
4
+ import { UmbControllerHostElement } from './controller';
5
5
 
6
6
  declare class UmbExtensionRegistry {
7
7
  private _extensions;
@@ -28,7 +28,7 @@ declare function hasDefaultExport<ConstructorType>(object: unknown): object is {
28
28
  default: ConstructorType;
29
29
  };
30
30
 
31
- type UmbEntrypointOnInit = (host: UmbControllerHostInterface, extensionRegistry: UmbExtensionRegistry) => void;
31
+ type UmbEntrypointOnInit = (host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry) => void;
32
32
  /**
33
33
  * Interface containing supported life-cycle functions for ESModule entrypoints
34
34
  */
@@ -3,7 +3,7 @@ import { UmbWorkspaceAction } from './workspace';
3
3
  import { ClassConstructor } from './models';
4
4
  import { UmbStoreBase, UmbTreeStore } from './store';
5
5
  import { UmbExtensionRegistry } from './extensions-api';
6
- import { UmbControllerHostInterface } from './controller';
6
+ import { UmbControllerHostElement } from './controller';
7
7
 
8
8
  interface ManifestCollectionView extends ManifestElement, ManifestWithConditions<ConditionsCollectionView> {
9
9
  type: 'collectionView';
@@ -253,11 +253,11 @@ interface ConditionsTreeItem {
253
253
  entityType: string;
254
254
  }
255
255
 
256
- interface ManifestUserDashboard extends ManifestElement {
257
- type: 'userDashboard';
258
- meta: MetaUserDashboard;
256
+ interface ManifestUserProfileApp extends ManifestElement {
257
+ type: 'userProfileApp';
258
+ meta: MetaUserProfileApp;
259
259
  }
260
- interface MetaUserDashboard {
260
+ interface MetaUserProfileApp {
261
261
  label: string;
262
262
  pathname: string;
263
263
  }
@@ -330,7 +330,7 @@ interface ManifestTreeStore extends ManifestClass<UmbTreeStore> {
330
330
  type: 'treeStore';
331
331
  }
332
332
 
333
- type ManifestTypes = ManifestCollectionView | ManifestDashboard | ManifestDashboardCollection | ManifestEntityAction | ManifestEntityBulkAction | ManifestEntrypoint | ManifestExternalLoginProvider | ManifestHeaderApp | ManifestHeaderAppButtonKind | ManifestHealthCheck | ManifestPackageView | ManifestPropertyAction | ManifestPropertyEditorModel | ManifestPropertyEditorUI | ManifestRepository | ManifestSection | ManifestSectionSidebarApp | ManifestSectionSidebarAppMenuKind | ManifestSectionView | ManifestMenu | ManifestMenuItem | ManifestMenuItemTreeKind | ManifestTheme | ManifestTree | ManifestTreeItem | ManifestUserDashboard | ManifestWorkspace | ManifestWorkspaceAction | ManifestWorkspaceView | ManifestWorkspaceViewCollection | ManifestModal | ManifestStore | ManifestTreeStore | ManifestBase;
333
+ type ManifestTypes = ManifestCollectionView | ManifestDashboard | ManifestDashboardCollection | ManifestEntityAction | ManifestEntityBulkAction | ManifestEntrypoint | ManifestExternalLoginProvider | ManifestHeaderApp | ManifestHeaderAppButtonKind | ManifestHealthCheck | ManifestPackageView | ManifestPropertyAction | ManifestPropertyEditorModel | ManifestPropertyEditorUI | ManifestRepository | ManifestSection | ManifestSectionSidebarApp | ManifestSectionSidebarAppMenuKind | ManifestSectionView | ManifestMenu | ManifestMenuItem | ManifestMenuItemTreeKind | ManifestTheme | ManifestTree | ManifestTreeItem | ManifestUserProfileApp | ManifestWorkspace | ManifestWorkspaceAction | ManifestWorkspaceView | ManifestWorkspaceViewCollection | ManifestModal | ManifestStore | ManifestTreeStore | ManifestBase;
334
334
  type ManifestStandardTypes = ManifestTypes['type'];
335
335
  type ManifestTypeMap = {
336
336
  [Manifest in ManifestTypes as Manifest['type']]: Manifest;
@@ -390,8 +390,8 @@ interface ManifestEntrypoint extends ManifestBase {
390
390
 
391
391
  declare class UmbEntryPointExtensionInitializer {
392
392
  #private;
393
- constructor(rootHost: UmbControllerHostInterface, extensionRegistry: UmbExtensionRegistry);
393
+ constructor(rootHost: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry);
394
394
  instantiateEntryPoint(manifest: ManifestEntrypoint): void;
395
395
  }
396
396
 
397
- 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, ManifestKind, ManifestMenu, ManifestMenuItem, ManifestMenuItemTreeKind, ManifestModal, ManifestPackageView, ManifestPropertyAction, ManifestPropertyEditorModel, ManifestPropertyEditorUI, ManifestRepository, ManifestSection, ManifestSectionSidebarApp, ManifestSectionSidebarAppMenuKind, ManifestSectionView, ManifestStandardTypes, ManifestStore, ManifestTheme, ManifestTree, ManifestTreeItem, ManifestTreeStore, ManifestTypeMap, ManifestTypes, ManifestUserDashboard, ManifestWithConditions, ManifestWithLoader, ManifestWithMeta, ManifestWithView, ManifestWorkspace, ManifestWorkspaceAction, ManifestWorkspaceView, ManifestWorkspaceViewCollection, MetaCollectionView, MetaDashboard, MetaDashboardCollection, MetaEditor, MetaEditorViewCollection, MetaEntityAction, MetaEntityBulkAction, MetaExternalLoginProvider, MetaHeaderApp, MetaHeaderAppButtonKind, MetaHealthCheck, MetaManifestWithView, MetaMenuItem, MetaMenuItemTreeKind, MetaPackageView, MetaPropertyEditorModel, MetaPropertyEditorUI, MetaSection, MetaSectionSidebarAppMenuKind, MetaSectionView, MetaTree, MetaUserDashboard, MetaWorkspaceAction, MetaWorkspaceView, PropertyEditorConfig, PropertyEditorConfigDefaultData, PropertyEditorConfigProperty, SpecificManifestTypeOrManifestBase, UmbEntryPointExtensionInitializer };
397
+ 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, 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, ManifestWorkspaceView, ManifestWorkspaceViewCollection, MetaCollectionView, MetaDashboard, MetaDashboardCollection, MetaEditor, MetaEditorViewCollection, MetaEntityAction, MetaEntityBulkAction, MetaExternalLoginProvider, MetaHeaderApp, MetaHeaderAppButtonKind, MetaHealthCheck, MetaManifestWithView, MetaMenuItem, MetaMenuItemTreeKind, MetaPackageView, MetaPropertyEditorModel, MetaPropertyEditorUI, MetaSection, MetaSectionSidebarAppMenuKind, MetaSectionView, MetaTree, MetaUserProfileApp, MetaWorkspaceAction, MetaWorkspaceView, PropertyEditorConfig, PropertyEditorConfigDefaultData, PropertyEditorConfigProperty, SpecificManifestTypeOrManifestBase, UmbEntryPointExtensionInitializer };
package/modal.d.ts CHANGED
@@ -4,10 +4,10 @@ import * as lit_html from 'lit-html';
4
4
  import * as lit from 'lit';
5
5
  import { LitElement, TemplateResult } from 'lit';
6
6
  import { UUIModalDialogElement, UUIModalSidebarElement, UUIModalSidebarSize } from '@umbraco-ui/uui';
7
- import { UmbControllerHostInterface as UmbControllerHostInterface$1 } from './controller';
7
+ import { UmbControllerHostElement, UmbControllerInterface } from './controller';
8
8
  import { UmbContextToken } from './context-api';
9
9
  import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbPickerModalData as UmbPickerModalData$1 } from './modal';
10
- import { LanguageResponseModel } from './backend-api';
10
+ import { LanguageResponseModel, FolderReponseModel } from './backend-api';
11
11
  import { UserDetails } from './models';
12
12
 
13
13
  declare class UmbSearchModalElement extends LitElement {
@@ -89,7 +89,7 @@ declare class UmbModalHandlerClass<ModalData extends object = object, ModalResul
89
89
  key: string;
90
90
  type: UmbModalType;
91
91
  size: UUIModalSidebarSize;
92
- constructor(host: UmbControllerHostInterface$1, modalAlias: string | UmbModalToken<ModalData, ModalResult>, data?: ModalData, config?: UmbModalConfig);
92
+ constructor(host: UmbControllerHostElement, modalAlias: string | UmbModalToken<ModalData, ModalResult>, data?: ModalData, config?: UmbModalConfig);
93
93
  private submit;
94
94
  reject(): void;
95
95
  onSubmit(): Promise<ModalResult>;
@@ -103,9 +103,9 @@ interface UmbModalConfig {
103
103
  }
104
104
  declare class UmbModalContext {
105
105
  #private;
106
- host: UmbControllerHostInterface$1;
107
- readonly modals: rxjs.Observable<UmbModalHandler<object, any>[]>;
108
- constructor(host: UmbControllerHostInterface$1);
106
+ host: UmbControllerHostElement;
107
+ readonly modals: rxjs.Observable<UmbModalHandler[]>;
108
+ constructor(host: UmbControllerHostElement);
109
109
  search(): UmbModalHandler<any, any>;
110
110
  /**
111
111
  * Opens a modal or sidebar modal
@@ -466,30 +466,10 @@ declare class UmbModalRouteRegistration<UmbModalTokenData extends object = objec
466
466
  routeSetup(modalContext: UmbModalContext, params: Params): UmbModalHandler<UmbModalTokenData, UmbModalTokenResult> | null;
467
467
  }
468
468
 
469
- interface UmbControllerInterface {
470
- get unique(): string | undefined;
471
- hostConnected(): void;
472
- hostDisconnected(): void;
473
- destroy(): void;
474
- }
475
-
476
- declare class UmbControllerHostInterface extends HTMLElement {
477
- hasController(controller: UmbControllerInterface): boolean;
478
- getControllers(filterMethod: (ctrl: UmbControllerInterface) => boolean): UmbControllerInterface[];
479
- addController(controller: UmbControllerInterface): void;
480
- removeController(controller: UmbControllerInterface): void;
481
- }
482
- declare global {
483
- interface HTMLElement {
484
- connectedCallback(): void;
485
- disconnectedCallback(): void;
486
- }
487
- }
488
-
489
469
  declare class UmbModalRouteRegistrationController<D extends object = object, R = any> extends UmbModalRouteRegistration<D, R> implements UmbControllerInterface {
490
470
  #private;
491
471
  get unique(): undefined;
492
- constructor(host: UmbControllerHostInterface, alias: UmbModalToken$1<D, R> | string, path: string, uniqueParts?: Map<string, string | undefined> | null, modalConfig?: UmbModalConfig$1);
472
+ constructor(host: UmbControllerHostElement, alias: UmbModalToken$1<D, R> | string, path: string, uniqueParts?: Map<string, string | undefined> | null, modalConfig?: UmbModalConfig$1);
493
473
  setUniqueIdentifier(identifier: string, value: string | undefined): void;
494
474
  private _registererModal;
495
475
  hostConnected(): void;
@@ -498,7 +478,7 @@ declare class UmbModalRouteRegistrationController<D extends object = object, R =
498
478
  }
499
479
 
500
480
  interface UmbAllowedDocumentTypesModalData {
501
- key: string | null;
481
+ id: string | null;
502
482
  }
503
483
  interface UmbAllowedDocumentTypesModalResult {
504
484
  documentTypeKey: string;
@@ -546,6 +526,15 @@ interface UmbDocumentPickerModalResult {
546
526
  }
547
527
  declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbDocumentPickerModalResult>;
548
528
 
529
+ interface UmbDocumentTypePickerModalData {
530
+ multiple?: boolean;
531
+ selection?: Array<string>;
532
+ }
533
+ interface UmbDocumentTypePickerModalResult {
534
+ selection: Array<string>;
535
+ }
536
+ declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult>;
537
+
549
538
  declare enum OEmbedStatus {
550
539
  NotSupported = 0,
551
540
  Error = 1,
@@ -600,8 +589,8 @@ interface UmbImportDictionaryModalData {
600
589
  unique: string | null;
601
590
  }
602
591
  interface UmbImportDictionaryModalResult {
603
- fileName?: string;
604
- parentKey?: string;
592
+ temporaryFileId?: string;
593
+ parentId?: string;
605
594
  }
606
595
  declare const UMB_IMPORT_DICTIONARY_MODAL: UmbModalToken$1<UmbImportDictionaryModalData, UmbImportDictionaryModalResult>;
607
596
 
@@ -684,10 +673,37 @@ interface UmbSectionPickerModalData {
684
673
  }
685
674
  declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, unknown>;
686
675
 
676
+ interface UmbTemplateModalData {
677
+ id: string;
678
+ language?: 'razor' | 'typescript' | 'javascript' | 'css' | 'markdown' | 'json' | 'html';
679
+ }
680
+ interface UmbTemplateModalResult {
681
+ id: string;
682
+ }
683
+ declare const UMB_TEMPLATE_MODAL: UmbModalToken$1<UmbTemplateModalData, UmbTemplateModalResult>;
684
+
685
+ interface UmbTemplatePickerModalData {
686
+ multiple: boolean;
687
+ selection: string[];
688
+ }
689
+ interface UmbTemplatePickerModalResult {
690
+ selection: string[] | undefined;
691
+ }
692
+ declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbTemplatePickerModalResult>;
693
+
687
694
  declare const UMB_USER_GROUP_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
688
695
 
689
696
  declare const UMB_USER_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
690
697
 
698
+ interface UmbFolderModalData {
699
+ repositoryAlias: string;
700
+ unique?: string;
701
+ }
702
+ interface UmbFolderModalResult {
703
+ folder: FolderReponseModel;
704
+ }
705
+ declare const UMB_FOLDER_MODAL: UmbModalToken$1<UmbFolderModalData, UmbFolderModalResult>;
706
+
691
707
  interface UmbPickerModalData<T> {
692
708
  multiple: boolean;
693
709
  selection: Array<string>;
@@ -697,4 +713,4 @@ interface UmbPickerModalResult<T> {
697
713
  selection: Array<string>;
698
714
  }
699
715
 
700
- 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_DOCUMENT_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_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_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, 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 };
716
+ 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_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, 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 };
package/models.d.ts CHANGED
@@ -3,13 +3,18 @@ import { EntityTreeItemResponseModel, FolderTreeItemResponseModel, PackageManife
3
3
  type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
4
4
  type ClassConstructor<T> = new (...args: any[]) => T;
5
5
  interface Entity {
6
- key: string;
6
+ id: string;
7
7
  name: string;
8
8
  icon: string;
9
9
  type: string;
10
10
  hasChildren: boolean;
11
- parentKey: string | null;
11
+ parentId: string | null;
12
12
  }
13
+ /** Tried to find a common base of our entities — used by Entity Workspace Context */
14
+ type BaseEntity = {
15
+ id?: string;
16
+ name?: string;
17
+ };
13
18
  interface UserEntity extends Entity {
14
19
  type: 'user';
15
20
  }
@@ -38,23 +43,23 @@ interface UserGroupDetails extends UserGroupEntity {
38
43
  permissions: Array<string>;
39
44
  }
40
45
  interface MemberTypeDetails extends EntityTreeItemResponseModel {
41
- key: string;
46
+ id: string;
42
47
  alias: string;
43
48
  properties: [];
44
49
  }
45
50
  interface MediaTypeDetails extends FolderTreeItemResponseModel {
46
- key: string;
51
+ id: string;
47
52
  alias: string;
48
53
  properties: [];
49
54
  }
50
55
  interface MemberGroupDetails extends EntityTreeItemResponseModel {
51
- key: string;
56
+ id: string;
52
57
  }
53
58
  interface MemberDetails extends EntityTreeItemResponseModel {
54
- key: string;
59
+ id: string;
55
60
  }
56
61
  interface DocumentBlueprintDetails {
57
- key: string;
62
+ id: string;
58
63
  name: string;
59
64
  type: 'document-blueprint';
60
65
  properties: Array<any>;
@@ -72,4 +77,4 @@ type UmbPackageWithMigrationStatus = UmbPackage & {
72
77
  hasPendingMigrations: boolean;
73
78
  };
74
79
 
75
- export { ClassConstructor, DocumentBlueprintDetails, Entity, HTMLElementConstructor, MediaTypeDetails, MemberDetails, MemberGroupDetails, MemberTypeDetails, PackageManifestResponse, SwatchDetails, UmbPackage, UmbPackageWithMigrationStatus, UserDetails, UserEntity, UserGroupDetails, UserGroupEntity, UserStatus };
80
+ export { BaseEntity, ClassConstructor, DocumentBlueprintDetails, Entity, HTMLElementConstructor, MediaTypeDetails, MemberDetails, MemberGroupDetails, MemberTypeDetails, PackageManifestResponse, SwatchDetails, UmbPackage, UmbPackageWithMigrationStatus, UserDetails, UserEntity, UserGroupDetails, UserGroupEntity, UserStatus };
@@ -1,6 +1,6 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable, BehaviorSubject } from 'rxjs';
3
- import { UmbControllerInterface, UmbControllerHostInterface } from './controller';
3
+ import { UmbControllerInterface, UmbControllerHostElement } from './controller';
4
4
 
5
5
  declare class UmbObserver<T> {
6
6
  #private;
@@ -13,7 +13,7 @@ declare class UmbObserver<T> {
13
13
  declare class UmbObserverController<T = unknown> extends UmbObserver<T> implements UmbControllerInterface {
14
14
  _alias?: string;
15
15
  get unique(): string | undefined;
16
- constructor(host: UmbControllerHostInterface, source: Observable<T>, callback: (_value: T) => void, alias?: string);
16
+ constructor(host: UmbControllerHostElement, source: Observable<T>, callback: (_value: T) => void, alias?: string);
17
17
  }
18
18
 
19
19
  /**
@@ -98,19 +98,33 @@ declare class DeepState<T> extends BehaviorSubject<T> {
98
98
  * The ArrayState provides methods to append data when the data is an Object.
99
99
  */
100
100
  declare class ArrayState<T> extends DeepState<T[]> {
101
- private _getUnique?;
102
- constructor(initialData: T[], _getUnique?: ((entry: T) => unknown) | undefined);
101
+ #private;
102
+ constructor(initialData: T[], getUniqueMethod?: (entry: T) => unknown);
103
+ /**
104
+ * @method sortBy
105
+ * @param {(a: T, b: T) => number} sortMethod - A method to be used for sorting everytime data is set.
106
+ * @description - A sort method to this Subject.
107
+ * @example <caption>Example add sort method</caption>
108
+ * const data = [
109
+ * { key: 1, value: 'foo'},
110
+ * { key: 2, value: 'bar'}
111
+ * ];
112
+ * const myState = new ArrayState(data, (x) => x.key);
113
+ * myState.sortBy((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0));
114
+ */
115
+ sortBy(sortMethod?: (a: T, b: T) => number): this;
116
+ next(value: T[]): void;
103
117
  /**
104
118
  * @method remove
105
119
  * @param {unknown[]} uniques - The unique values to remove.
106
120
  * @return {ArrayState<T>} Reference to it self.
107
121
  * @description - Remove some new data of this Subject.
108
- * @example <caption>Example remove entry with key '1' and '2'</caption>
122
+ * @example <caption>Example remove entry with id '1' and '2'</caption>
109
123
  * const data = [
110
- * { key: 1, value: 'foo'},
111
- * { key: 2, value: 'bar'}
124
+ * { id: 1, value: 'foo'},
125
+ * { id: 2, value: 'bar'}
112
126
  * ];
113
- * const myState = new ArrayState(data, (x) => x.key);
127
+ * const myState = new ArrayState(data, (x) => x.id);
114
128
  * myState.remove([1, 2]);
115
129
  */
116
130
  remove(uniques: unknown[]): this;
@@ -119,12 +133,12 @@ declare class ArrayState<T> extends DeepState<T[]> {
119
133
  * @param {unknown} unique - The unique value to remove.
120
134
  * @return {ArrayState<T>} Reference to it self.
121
135
  * @description - Remove some new data of this Subject.
122
- * @example <caption>Example remove entry with key '1'</caption>
136
+ * @example <caption>Example remove entry with id '1'</caption>
123
137
  * const data = [
124
- * { key: 1, value: 'foo'},
125
- * { key: 2, value: 'bar'}
138
+ * { id: 1, value: 'foo'},
139
+ * { id: 2, value: 'bar'}
126
140
  * ];
127
- * const myState = new ArrayState(data, (x) => x.key);
141
+ * const myState = new ArrayState(data, (x) => x.id);
128
142
  * myState.removeOne(1);
129
143
  */
130
144
  removeOne(unique: unknown): this;
@@ -181,6 +195,21 @@ declare class ArrayState<T> extends DeepState<T[]> {
181
195
  * ]);
182
196
  */
183
197
  append(entries: T[]): this;
198
+ /**
199
+ * @method updateOne
200
+ * @param {unknown} unique - Unique value to find entry to update.
201
+ * @param {Partial<T>} entry - new data to be added in this Subject.
202
+ * @return {ArrayState<T>} Reference to it self.
203
+ * @description - Update a item with some new data, requires the ArrayState to be constructed with a getUnique method.
204
+ * @example <caption>Example append some data.</caption>
205
+ * const data = [
206
+ * { key: 1, value: 'foo'},
207
+ * { key: 2, value: 'bar'}
208
+ * ];
209
+ * const myState = new ArrayState(data, (x) => x.key);
210
+ * myState.updateOne(2, {value: 'updated-bar'});
211
+ */
212
+ updateOne(unique: unknown, entry: Partial<T>): this;
184
213
  }
185
214
 
186
215
  /**
@@ -226,8 +255,8 @@ declare function createObservablePart<R, T>(source$: Observable<T>, mappingFunct
226
255
  * @param {(previousResult: R, currentResult: R) => boolean} [memoizationFunction] - Method to Compare if the data has changed. Should return true when data is different.
227
256
  * @description - Creates a RxJS Observable from RxJS Subject.
228
257
  * @example <caption>Example append new entry for a ArrayState or a part of DeepState/ObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
229
- * const entry = {key: 'myKey', value: 'myValue'};
230
- * const newDataSet = appendToFrozenArray(mySubject.getValue(), entry, x => x.key === key);
258
+ * const entry = {id: 'myKey', value: 'myValue'};
259
+ * const newDataSet = appendToFrozenArray(mySubject.getValue(), entry, x => x.id === id);
231
260
  * mySubject.next(newDataSet);
232
261
  */
233
262
  declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (entry: T) => unknown): T[];
@@ -246,4 +275,4 @@ declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (
246
275
  */
247
276
  declare function partialUpdateFrozenArray<T>(data: T[], partialEntry: Partial<T>, findMethod: (entry: T) => boolean): T[];
248
277
 
249
- export { ArrayState, BasicState, BooleanState, ClassState, DeepState, NumberState, ObjectState, StringState, UmbObserver, UmbObserverController, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
278
+ export { ArrayState, BasicState, BooleanState, ClassState, DeepState, MappingFunction, NumberState, ObjectState, StringState, UmbObserver, UmbObserverController, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-cms/backoffice",
3
- "version": "1.0.0-next.596cc732",
3
+ "version": "1.0.0-next.5e6a5e07",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "umbraco",
package/repository.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ProblemDetailsModel } from './backend-api';
1
+ import { ProblemDetailsModel, FolderReponseModel, CreateFolderRequestModel, UpdateFolderReponseModel, FolderModelBaseModel } from './backend-api';
2
2
  import { DataSourceResponse as DataSourceResponse$1 } from './repository';
3
3
  import { Observable } from 'rxjs';
4
4
 
@@ -7,12 +7,20 @@ interface DataSourceResponse<T = undefined> {
7
7
  error?: ProblemDetailsModel;
8
8
  }
9
9
 
10
- interface UmbDataSource<T> {
11
- createScaffold(parentKey: string | null): Promise<DataSourceResponse$1<T>>;
12
- get(key: string): Promise<DataSourceResponse$1<T>>;
13
- insert(data: T): Promise<DataSourceResponse$1<T>>;
14
- update(data: T): Promise<DataSourceResponse$1<T>>;
15
- delete(key: string): Promise<DataSourceResponse$1<T>>;
10
+ interface UmbDataSource<CreateRequestType, UpdateRequestType, ResponseType> {
11
+ createScaffold(parentId: string | null): Promise<DataSourceResponse$1<ResponseType>>;
12
+ get(unique: string): Promise<DataSourceResponse$1<ResponseType>>;
13
+ insert(data: CreateRequestType): Promise<any>;
14
+ update(unique: string, data: UpdateRequestType): Promise<DataSourceResponse$1<ResponseType>>;
15
+ delete(unique: string): Promise<DataSourceResponse$1>;
16
+ }
17
+
18
+ interface UmbFolderDataSource {
19
+ createScaffold(parentId: string | null): Promise<DataSourceResponse<FolderReponseModel>>;
20
+ get(unique: string): Promise<DataSourceResponse<FolderReponseModel>>;
21
+ insert(data: CreateFolderRequestModel): Promise<DataSourceResponse<string>>;
22
+ update(unique: string, data: CreateFolderRequestModel): Promise<DataSourceResponse<UpdateFolderReponseModel>>;
23
+ delete(unique: string): Promise<DataSourceResponse>;
16
24
  }
17
25
 
18
26
  interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
@@ -22,11 +30,11 @@ interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
22
30
  }
23
31
 
24
32
  interface UmbDetailRepository<DetailType> {
25
- createScaffold(parentKey: string | null): Promise<{
33
+ createScaffold(parentId: string | null): Promise<{
26
34
  data?: DetailType;
27
35
  error?: ProblemDetailsModel;
28
36
  }>;
29
- requestByKey(key: string): Promise<{
37
+ requestById(id: string): Promise<{
30
38
  data?: DetailType;
31
39
  error?: ProblemDetailsModel;
32
40
  }>;
@@ -36,7 +44,7 @@ interface UmbDetailRepository<DetailType> {
36
44
  save(data: DetailType): Promise<{
37
45
  error?: ProblemDetailsModel;
38
46
  }>;
39
- delete(key: string): Promise<{
47
+ delete(id: string): Promise<{
40
48
  error?: ProblemDetailsModel;
41
49
  }>;
42
50
  }
@@ -66,4 +74,26 @@ interface UmbTreeRepository<ItemType = any, PagedItemType = UmbPagedData<ItemTyp
66
74
  treeItems: (uniques: string[]) => Promise<Observable<ItemType[]>>;
67
75
  }
68
76
 
69
- export { DataSourceResponse, UmbDataSource, UmbDetailRepository, UmbPagedData, UmbTreeDataSource, UmbTreeRepository };
77
+ interface UmbFolderRepository {
78
+ createFolderScaffold(parentId: string | null): Promise<{
79
+ data?: FolderReponseModel;
80
+ error?: ProblemDetailsModel;
81
+ }>;
82
+ createFolder(folderRequest: CreateFolderRequestModel): Promise<{
83
+ data?: string;
84
+ error?: ProblemDetailsModel;
85
+ }>;
86
+ requestFolder(unique: string): Promise<{
87
+ data?: FolderReponseModel;
88
+ error?: ProblemDetailsModel;
89
+ }>;
90
+ updateFolder(unique: string, folder: FolderModelBaseModel): Promise<{
91
+ data?: UpdateFolderReponseModel;
92
+ error?: ProblemDetailsModel;
93
+ }>;
94
+ deleteFolder(id: string): Promise<{
95
+ error?: ProblemDetailsModel;
96
+ }>;
97
+ }
98
+
99
+ export { DataSourceResponse, UmbDataSource, UmbDetailRepository, UmbFolderDataSource, UmbFolderRepository, UmbPagedData, UmbTreeDataSource, UmbTreeRepository };
package/resources.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { UmbNotificationOptions } from './notification';
2
2
  import { ProblemDetailsModel } from './backend-api';
3
- import { UmbController, UmbControllerHostInterface } from './controller';
3
+ import { UmbController, UmbControllerHostElement } from './controller';
4
4
  import { DataSourceResponse as DataSourceResponse$1 } from './repository';
5
5
 
6
6
  declare class UmbResourceController extends UmbController {
7
7
  #private;
8
- constructor(host: UmbControllerHostInterface, promise: Promise<any>, alias?: string);
8
+ constructor(host: UmbControllerHostElement, promise: Promise<any>, alias?: string);
9
9
  hostConnected(): void;
10
10
  hostDisconnected(): void;
11
11
  /**
@@ -45,6 +45,6 @@ interface DataSourceResponse<T = undefined> {
45
45
 
46
46
  declare function tryExecute<T>(promise: Promise<T>): Promise<DataSourceResponse<T>>;
47
47
 
48
- declare function tryExecuteAndNotify<T>(host: UmbControllerHostInterface, resource: Promise<T>, options?: UmbNotificationOptions<any>): Promise<DataSourceResponse<T>>;
48
+ declare function tryExecuteAndNotify<T>(host: UmbControllerHostElement, resource: Promise<T>, options?: UmbNotificationOptions<any>): Promise<DataSourceResponse<T>>;
49
49
 
50
50
  export { UmbResourceController, tryExecute, tryExecuteAndNotify };
package/router.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { UmbContextToken } from './context-api';
2
- import { UmbControllerHostInterface } from './controller';
2
+ import { UmbControllerHostElement } from './controller';
3
3
  import { UmbModalRouteRegistration } from './modal';
4
4
 
5
5
  interface UmbRouteLocation {
@@ -12,7 +12,7 @@ interface UmbRouteLocation {
12
12
  declare class UmbRouteContext {
13
13
  #private;
14
14
  private _onGotModals;
15
- constructor(host: UmbControllerHostInterface, _onGotModals: (contextRoutes: any) => void);
15
+ constructor(host: UmbControllerHostElement, _onGotModals: (contextRoutes: any) => void);
16
16
  registerModal(registration: UmbModalRouteRegistration): UmbModalRouteRegistration<object, any>;
17
17
  unregisterModal(registrationToken: ReturnType<typeof this$1.registerModal>): void;
18
18
  _internal_routerGotBasePath(routerBasePath: string): void;