@umbraco-cms/backoffice 1.0.0-next.d46c6b3e → 1.0.0-next.d4eb00d5

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,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- import { HTMLElementConstructor } from './models';
3
- import { UmbControllerHostElement } from './controller';
4
- import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from './context-api';
5
- import { UmbObserverController } from './observable-api';
2
+ import { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
3
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
4
+ import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
5
+ import { UmbObserverController } from '@umbraco-cms/backoffice/observable-api';
6
6
 
7
7
  interface ResolvedContexts {
8
8
  [key: string]: any;
@@ -1,6 +1,6 @@
1
- import { UmbControllerHostElement } from './controller';
2
- import { UmbEntityActionBase as UmbEntityActionBase$1 } from './entity-action';
3
- import { UmbFolderRepository } from './repository';
1
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
2
+ import { UmbEntityActionBase as UmbEntityActionBase$1 } from '@umbraco-cms/backoffice/entity-action';
3
+ import { UmbDetailRepository, UmbItemRepository, UmbFolderRepository } from '@umbraco-cms/backoffice/repository';
4
4
 
5
5
  interface UmbAction<RepositoryType = unknown> {
6
6
  host: UmbControllerHostElement;
@@ -39,19 +39,13 @@ declare class UmbCopyEntityAction<T extends {
39
39
  execute(): Promise<void>;
40
40
  }
41
41
 
42
- declare class UmbDeleteEntityAction<T extends {
43
- delete(unique: string): Promise<void>;
44
- requestTreeItems(uniques: Array<string>): any;
45
- }> extends UmbEntityActionBase$1<T> {
42
+ declare class UmbDeleteEntityAction<T extends UmbDetailRepository & UmbItemRepository<any>> extends UmbEntityActionBase$1<T> {
46
43
  #private;
47
44
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
48
45
  execute(): Promise<void>;
49
46
  }
50
47
 
51
- declare class UmbDeleteFolderEntityAction<T extends {
52
- deleteFolder(unique: string): Promise<void>;
53
- requestTreeItems(uniques: Array<string>): any;
54
- }> extends UmbEntityActionBase$1<T> {
48
+ declare class UmbDeleteFolderEntityAction<T extends UmbItemRepository<any> & UmbFolderRepository> extends UmbEntityActionBase$1<T> {
55
49
  #private;
56
50
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
57
51
  execute(): Promise<void>;
@@ -77,9 +71,8 @@ declare class UmbSortChildrenOfEntityAction<T extends {
77
71
  execute(): Promise<void>;
78
72
  }
79
73
 
80
- declare class UmbTrashEntityAction<T extends {
74
+ declare class UmbTrashEntityAction<T extends UmbItemRepository<any> & {
81
75
  trash(unique: Array<string>): Promise<void>;
82
- requestTreeItems(uniques: Array<string>): any;
83
76
  }> extends UmbEntityActionBase$1<T> {
84
77
  #private;
85
78
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
@@ -1,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ManifestTypes, ManifestKind, ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestElement, ManifestElementWithElementName, ManifestClass } from './extensions-registry';
3
- import { UmbContextToken } from './context-api';
4
- import { PageComponent } from './router';
5
- import { UmbControllerHostElement } from './controller';
2
+ import { ManifestTypes, ManifestKind, ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestElement, ManifestElementWithElementName, ManifestClass } from '@umbraco-cms/backoffice/extensions-registry';
3
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
4
+ import { PageComponent } from '@umbraco-cms/backoffice/router';
5
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
6
6
 
7
7
  declare class UmbExtensionRegistry {
8
8
  private _extensions;
@@ -11,6 +11,7 @@ declare class UmbExtensionRegistry {
11
11
  readonly kinds: Observable<ManifestKind[]>;
12
12
  defineKind(kind: ManifestKind): void;
13
13
  register(manifest: ManifestTypes | ManifestKind): void;
14
+ registerMany(manifests: Array<ManifestTypes>): void;
14
15
  unregister(alias: string): void;
15
16
  isRegistered(alias: string): boolean;
16
17
  private _kindsOfType;
@@ -1,17 +1,30 @@
1
1
  import { InterfaceLook, InterfaceColor } from '@umbraco-ui/uui-base/lib/types/index';
2
- import { UmbWorkspaceAction } from './workspace';
3
- import { ClassConstructor } from './models';
4
- import { UmbStoreBase, UmbTreeStore } from './store';
5
- import { UmbExtensionRegistry } from './extensions-api';
6
- import { UmbControllerHostElement } from './controller';
2
+ import { ClassConstructor } from '@umbraco-cms/backoffice/models';
3
+ import { UmbStoreBase, UmbTreeStore, UmbItemStore } from '@umbraco-cms/backoffice/store';
4
+ import { UmbExtensionRegistry } from '@umbraco-cms/backoffice/extensions-api';
5
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
7
6
 
8
7
  interface ManifestCollectionView extends ManifestElement, ManifestWithConditions<ConditionsCollectionView> {
9
8
  type: 'collectionView';
10
9
  meta: MetaCollectionView;
11
10
  }
12
11
  interface MetaCollectionView {
12
+ /**
13
+ * The friendly name of the collection view
14
+ */
13
15
  label: string;
16
+ /**
17
+ * An icon to represent the collection view
18
+ *
19
+ * @examples [
20
+ * "umb:box",
21
+ * "umb:grid"
22
+ * ]
23
+ */
14
24
  icon: string;
25
+ /**
26
+ * The URL pathname for this collection view that can be deep linked to by sharing the url
27
+ */
15
28
  pathName: string;
16
29
  }
17
30
  interface ConditionsCollectionView {
@@ -23,10 +36,33 @@ interface ManifestDashboard extends ManifestElement, ManifestWithConditions<Cond
23
36
  meta: MetaDashboard;
24
37
  }
25
38
  interface MetaDashboard {
39
+ /**
40
+ * This is the URL path for the dashboard which is used for navigating or deep linking directly to the dashboard
41
+ * https://yoursite.com/section/settings/dashboard/my-dashboard-path
42
+ *
43
+ * @example my-dashboard-path
44
+ * @examples [
45
+ * "my-dashboard-path"
46
+ * ]
47
+ */
26
48
  pathname: string;
49
+ /**
50
+ * The displayed name (label) for the tab of the dashboard
51
+ */
27
52
  label?: string;
28
53
  }
29
54
  interface ConditionsDashboard {
55
+ /**
56
+ * An array of section aliases that the dashboard should be available in
57
+ *
58
+ * @uniqueItems true
59
+ * @minItems 1
60
+ * @items.examples [
61
+ * "Umb.Section.Content",
62
+ * "Umb.Section.Settings"
63
+ * ]
64
+ *
65
+ */
30
66
  sections: string[];
31
67
  }
32
68
 
@@ -45,28 +81,76 @@ interface ConditionsDashboardCollection {
45
81
  entityType: string;
46
82
  }
47
83
 
84
+ /**
85
+ * An action to perform on an entity
86
+ * For example for content you may wish to create a new document etc
87
+ */
48
88
  interface ManifestEntityAction extends ManifestElement {
49
89
  type: 'entityAction';
50
90
  meta: MetaEntityAction;
51
91
  conditions: ConditionsEntityAction;
52
92
  }
53
93
  interface MetaEntityAction {
94
+ /**
95
+ * An icon to represent the action to be performed
96
+ *
97
+ * @examples [
98
+ * "umb:box",
99
+ * "umb:grid"
100
+ * ]
101
+ */
54
102
  icon?: string;
103
+ /**
104
+ * The friendly name of the action to perform
105
+ *
106
+ * @examples [
107
+ * "Create",
108
+ * "Create Content Template"
109
+ * ]
110
+ */
55
111
  label: string;
112
+ /**
113
+ * @TJS-ignore
114
+ */
56
115
  api: any;
116
+ /**
117
+ * The alias for the repsoitory of the entity type this action is for
118
+ * such as 'Umb.Repository.Documents'
119
+ * @examples [
120
+ * "Umb.Repository.Documents"
121
+ * ]
122
+ */
57
123
  repositoryAlias: string;
58
124
  }
59
125
  interface ConditionsEntityAction {
60
126
  entityType: string;
61
127
  }
62
128
 
129
+ /**
130
+ * An action to perform on multiple entities
131
+ * For example for content you may wish to move one or more documents in bulk
132
+ */
63
133
  interface ManifestEntityBulkAction extends ManifestElement, ManifestWithConditions<ConditionsEntityBulkAction> {
64
134
  type: 'entityBulkAction';
65
135
  meta: MetaEntityBulkAction;
66
136
  }
67
137
  interface MetaEntityBulkAction {
138
+ /**
139
+ * A friendly label for the action
140
+ */
68
141
  label: string;
142
+ /**
143
+ * @TJS-ignore
144
+ */
69
145
  api: any;
146
+ /**
147
+ * The alias for the repsoitory of the entity type this action is for
148
+ * such as 'Umb.Repository.Documents'
149
+ *
150
+ * @examples [
151
+ * "Umb.Repository.Documents"
152
+ * ]
153
+ */
70
154
  repositoryAlias: string;
71
155
  }
72
156
  interface ConditionsEntityBulkAction {
@@ -82,6 +166,10 @@ interface MetaExternalLoginProvider {
82
166
  pathname: string;
83
167
  }
84
168
 
169
+ /**
170
+ * Header apps are displayed in the top right corner of the backoffice
171
+ * The two provided header apps are the search and the user menu
172
+ */
85
173
  interface ManifestHeaderApp extends ManifestElement {
86
174
  type: 'headerApp';
87
175
  }
@@ -232,8 +320,16 @@ interface MetaMenuItemTreeKind {
232
320
  entityType?: string;
233
321
  }
234
322
 
323
+ /**
324
+ * Theme manifest for styling the backoffice of Umbraco such as dark, high contrast etc
325
+ */
235
326
  interface ManifestTheme extends ManifestWithLoader<string> {
236
327
  type: 'theme';
328
+ /**
329
+ * File location of the CSS file of the theme
330
+ *
331
+ * @examples ["themes/dark.theme.css"]
332
+ */
237
333
  css?: string;
238
334
  }
239
335
 
@@ -279,7 +375,7 @@ interface MetaWorkspaceAction {
279
375
  label?: string;
280
376
  look?: InterfaceLook;
281
377
  color?: InterfaceColor;
282
- api: ClassConstructor<UmbWorkspaceAction>;
378
+ api: ClassConstructor<any>;
283
379
  }
284
380
  interface ConditionsWorkspaceAction {
285
381
  workspaces: Array<string>;
@@ -329,18 +425,38 @@ interface ManifestStore extends ManifestClass<UmbStoreBase> {
329
425
  interface ManifestTreeStore extends ManifestClass<UmbTreeStore> {
330
426
  type: 'treeStore';
331
427
  }
428
+ interface ManifestItemStore extends ManifestClass<UmbItemStore> {
429
+ type: 'itemStore';
430
+ }
332
431
 
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;
432
+ 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 | ManifestItemStore | ManifestBase;
334
433
  type ManifestStandardTypes = ManifestTypes['type'];
335
434
  type ManifestTypeMap = {
336
435
  [Manifest in ManifestTypes as Manifest['type']]: Manifest;
337
436
  };
338
437
  type SpecificManifestTypeOrManifestBase<T extends keyof ManifestTypeMap | string> = T extends keyof ManifestTypeMap ? ManifestTypeMap[T] : ManifestBase;
339
438
  interface ManifestBase {
439
+ /**
440
+ * The type of extension such as dashboard etc...
441
+ */
340
442
  type: string;
443
+ /**
444
+ * The alias of the extension, ensure it is unique
445
+ */
341
446
  alias: string;
342
- kind?: any;
447
+ /**
448
+ * The kind of the extension, used to group extensions together
449
+ *
450
+ * @examples ["button"]
451
+ */
452
+ kind?: unknown;
453
+ /**
454
+ * The friendly name of the extension
455
+ */
343
456
  name: string;
457
+ /**
458
+ * Extensions such as dashboards are ordered by weight with lower numbers being first in the list
459
+ */
344
460
  weight?: number;
345
461
  }
346
462
  interface ManifestKind {
@@ -351,23 +467,54 @@ interface ManifestKind {
351
467
  manifest: Partial<ManifestTypes>;
352
468
  }
353
469
  interface ManifestWithConditions<ConditionsType> {
470
+ /**
471
+ * Set the conditions for when the extension should be loaded
472
+ */
354
473
  conditions: ConditionsType;
355
474
  }
356
475
  interface ManifestWithLoader<LoaderReturnType> extends ManifestBase {
476
+ /**
477
+ * @TJS-ignore
478
+ */
357
479
  loader?: () => Promise<LoaderReturnType>;
358
480
  }
481
+ /**
482
+ * The type of extension such as dashboard etc...
483
+ */
359
484
  interface ManifestClass<T = unknown> extends ManifestWithLoader<object> {
485
+ /**
486
+ * The file location of the javascript file to load
487
+ * @TJS-required
488
+ */
360
489
  js?: string;
490
+ /**
491
+ * @TJS-ignore
492
+ */
361
493
  className?: string;
494
+ /**
495
+ * @TJS-ignore
496
+ */
362
497
  class?: ClassConstructor<T>;
363
498
  }
364
499
  interface ManifestClassWithClassConstructor extends ManifestClass {
365
500
  class: ClassConstructor<unknown>;
366
501
  }
367
502
  interface ManifestElement extends ManifestWithLoader<object | HTMLElement> {
503
+ /**
504
+ * The file location of the javascript file to load
505
+ *
506
+ * @TJS-require
507
+ */
368
508
  js?: string;
509
+ /**
510
+ * The HTML web component name to use such as 'my-dashboard'
511
+ * Note it is NOT <my-dashboard></my-dashboard> but just the name
512
+ */
369
513
  elementName?: string;
370
- meta?: any;
514
+ /**
515
+ * This contains properties specific to the type of extension
516
+ */
517
+ meta?: unknown;
371
518
  }
372
519
  interface ManifestWithView extends ManifestElement {
373
520
  meta: MetaManifestWithView;
@@ -378,20 +525,34 @@ interface MetaManifestWithView {
378
525
  icon: string;
379
526
  }
380
527
  interface ManifestElementWithElementName extends ManifestElement {
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
+ */
381
532
  elementName: string;
382
533
  }
383
534
  interface ManifestWithMeta extends ManifestBase {
535
+ /**
536
+ * This contains properties specific to the type of extension
537
+ */
384
538
  meta: unknown;
385
539
  }
540
+ /**
541
+ * This type of extension gives full control and will simply load the specified JS file
542
+ * You could have custom logic to decide which extensions to load/register by using extensionRegistry
543
+ */
386
544
  interface ManifestEntrypoint extends ManifestBase {
387
- type: 'entrypoint';
545
+ type: 'entryPoint';
546
+ /**
547
+ * The file location of the javascript file to load in the backoffice
548
+ */
388
549
  js: string;
389
550
  }
390
551
 
391
552
  declare class UmbEntryPointExtensionInitializer {
392
553
  #private;
393
- constructor(rootHost: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry);
394
- instantiateEntryPoint(manifest: ManifestEntrypoint): void;
554
+ constructor(host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry);
555
+ instantiateEntryPoint(manifest: ManifestEntrypoint): Promise<void>;
395
556
  }
396
557
 
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 };
558
+ 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, 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
@@ -1,24 +1,24 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable } from 'rxjs';
3
- import * as lit_html from 'lit-html';
4
3
  import * as lit from 'lit';
5
4
  import { LitElement, TemplateResult } from 'lit';
5
+ import * as lit_html from 'lit-html';
6
6
  import { UUIModalDialogElement, UUIModalSidebarElement, UUIModalSidebarSize } from '@umbraco-ui/uui';
7
- import { UmbControllerHostElement, UmbControllerInterface } from './controller';
8
- import { UmbContextToken } from './context-api';
9
- import { Params } from './router';
10
- import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbPickerModalData as UmbPickerModalData$1 } from './modal';
11
- import { LanguageResponseModel, FolderReponseModel } from './backend-api';
12
- import { UserDetails } from './models';
7
+ import { UmbControllerHostElement, UmbControllerInterface } from '@umbraco-cms/backoffice/controller';
8
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
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, FolderReponseModel } from '@umbraco-cms/backoffice/backend-api';
12
+ import { UserDetails } from '@umbraco-cms/backoffice/models';
13
13
 
14
14
  declare class UmbSearchModalElement extends LitElement {
15
15
  #private;
16
- static styles: lit.CSSResult[];
17
16
  private _input;
18
17
  private _search;
19
18
  private _groups;
20
19
  connectedCallback(): void;
21
20
  render(): lit_html.TemplateResult<1>;
21
+ static styles: lit.CSSResult[];
22
22
  }
23
23
 
24
24
  declare global {
@@ -267,8 +267,8 @@ interface UmbExportDictionaryModalResult {
267
267
  declare const UMB_EXPORT_DICTIONARY_MODAL: UmbModalToken$1<UmbExportDictionaryModalData, UmbExportDictionaryModalResult>;
268
268
 
269
269
  interface UmbIconPickerModalData {
270
- multiple: boolean;
271
- selection: string[];
270
+ color: string | undefined;
271
+ icon: string | undefined;
272
272
  }
273
273
  interface UmbIconPickerModalResult {
274
274
  color: string | undefined;
@@ -395,6 +395,15 @@ interface UmbFolderModalResult {
395
395
  }
396
396
  declare const UMB_FOLDER_MODAL: UmbModalToken$1<UmbFolderModalData, UmbFolderModalResult>;
397
397
 
398
+ interface UmbDataTypePickerModalData {
399
+ selection?: Array<string>;
400
+ multiple?: boolean;
401
+ }
402
+ interface UmbDataTypePickerModalResult {
403
+ selection: Array<string>;
404
+ }
405
+ declare const UMB_DATA_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDataTypePickerModalData, UmbDataTypePickerModalResult>;
406
+
398
407
  interface UmbPickerModalData<T> {
399
408
  multiple: boolean;
400
409
  selection: Array<string>;
@@ -404,4 +413,4 @@ interface UmbPickerModalResult<T> {
404
413
  selection: Array<string>;
405
414
  }
406
415
 
407
- 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 };
416
+ 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 };
package/models.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EntityTreeItemResponseModel, FolderTreeItemResponseModel, PackageManifestResponseModel } from './backend-api';
1
+ import { EntityTreeItemResponseModel, FolderTreeItemResponseModel, PackageManifestResponseModel } from '@umbraco-cms/backoffice/backend-api';
2
2
 
3
3
  type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
4
4
  type ClassConstructor<T> = new (...args: any[]) => T;
package/notification.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as rxjs from 'rxjs';
2
- import { UmbContextToken } from './context-api';
2
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
3
3
 
4
4
  /**
5
5
  * @export
@@ -1,6 +1,6 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable, BehaviorSubject } from 'rxjs';
3
- import { UmbControllerInterface, UmbControllerHostElement } from './controller';
3
+ import { UmbControllerInterface, UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
4
4
 
5
5
  declare class UmbObserver<T> {
6
6
  #private;
@@ -261,6 +261,18 @@ declare function createObservablePart<R, T>(source$: Observable<T>, mappingFunct
261
261
  */
262
262
  declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (entry: T) => unknown): T[];
263
263
 
264
+ /**
265
+ * @export
266
+ * @method filterFrozenArray
267
+ * @param {Array<T>} data - RxJS Subject to use for this Observable.
268
+ * @param {(entry: T) => boolean} filterMethod - Method to filter the array.
269
+ * @description - Creates a RxJS Observable from RxJS Subject.
270
+ * @example <caption>Example remove an entry of 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>
271
+ * const newDataSet = filterFrozenArray(mySubject.getValue(), x => x.id !== "myKey");
272
+ * mySubject.next(newDataSet);
273
+ */
274
+ declare function filterFrozenArray<T>(data: T[], filterMethod: (entry: T) => boolean): T[];
275
+
264
276
  /**
265
277
  * @export
266
278
  * @method partialUpdateFrozenArray
@@ -275,4 +287,4 @@ declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (
275
287
  */
276
288
  declare function partialUpdateFrozenArray<T>(data: T[], partialEntry: Partial<T>, findMethod: (entry: T) => boolean): T[];
277
289
 
278
- export { MappingFunction, UmbArrayState, UmbBasicState, UmbBooleanState, UmbClassState, UmbDeepState, UmbNumberState, UmbObjectState, UmbObserver, UmbObserverController, UmbStringState, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
290
+ export { MappingFunction, UmbArrayState, UmbBasicState, UmbBooleanState, UmbClassState, UmbDeepState, UmbNumberState, UmbObjectState, UmbObserver, UmbObserverController, UmbStringState, appendToFrozenArray, createObservablePart, filterFrozenArray, partialUpdateFrozenArray };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-cms/backoffice",
3
- "version": "1.0.0-next.d46c6b3e",
3
+ "version": "1.0.0-next.d4eb00d5",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "umbraco",
@@ -0,0 +1,24 @@
1
+ import * as rxjs from 'rxjs';
2
+ import { UmbItemRepository } from '@umbraco-cms/backoffice/repository';
3
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
4
+ import { UmbModalToken, UmbModalContext } from '@umbraco-cms/backoffice/modal';
5
+ import { ItemResponseModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
6
+
7
+ declare class UmbPickerInputContext<ItemType extends ItemResponseModelBaseModel> {
8
+ #private;
9
+ host: UmbControllerHostElement;
10
+ modalAlias: string | UmbModalToken;
11
+ repository?: UmbItemRepository<ItemType>;
12
+ modalContext?: UmbModalContext;
13
+ selection: rxjs.Observable<string[]>;
14
+ selectedItems: rxjs.Observable<ItemType[]>;
15
+ max: number;
16
+ min: number;
17
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, modalAlias: string | UmbModalToken, getUniqueMethod?: (entry: ItemType) => string | undefined);
18
+ getSelection(): string[];
19
+ setSelection(selection: string[]): void;
20
+ openPicker(pickerData?: any): void;
21
+ requestRemoveItem(unique: string): Promise<void>;
22
+ }
23
+
24
+ export { UmbPickerInputContext };
@@ -1,4 +1,4 @@
1
- import { DataTypePropertyPresentationModel } from './backend-api';
1
+ import { DataTypePropertyPresentationModel } from '@umbraco-cms/backoffice/backend-api';
2
2
 
3
3
  interface UmbPropertyEditorElement extends HTMLElement {
4
4
  value: unknown;
package/repository.d.ts CHANGED
@@ -1,9 +1,11 @@
1
- import { ProblemDetailsModel, FolderReponseModel, CreateFolderRequestModel, UpdateFolderReponseModel, FolderModelBaseModel } from './backend-api';
2
- import { DataSourceResponse as DataSourceResponse$1 } from './repository';
1
+ import { ProblemDetailsModel, FolderReponseModel, CreateFolderRequestModel, UpdateFolderReponseModel, FolderModelBaseModel, ItemResponseModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
2
+ import { DataSourceResponse as DataSourceResponse$1, UmbDataSourceErrorResponse as UmbDataSourceErrorResponse$1 } from '@umbraco-cms/backoffice/repository';
3
3
  import { Observable } from 'rxjs';
4
4
 
5
- interface DataSourceResponse<T = undefined> {
5
+ interface DataSourceResponse<T = undefined> extends UmbDataSourceErrorResponse {
6
6
  data?: T;
7
+ }
8
+ interface UmbDataSourceErrorResponse {
7
9
  error?: ProblemDetailsModel;
8
10
  }
9
11
 
@@ -29,6 +31,18 @@ interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
29
31
  getItems(unique: Array<string>): Promise<DataSourceResponse$1<Array<ItemsType>>>;
30
32
  }
31
33
 
34
+ interface UmbItemDataSource<ItemType> {
35
+ getItems(unique: Array<string>): Promise<DataSourceResponse$1<Array<ItemType>>>;
36
+ }
37
+
38
+ interface UmbMoveDataSource {
39
+ move(unique: string, targetUnique: string): Promise<UmbDataSourceErrorResponse$1>;
40
+ }
41
+
42
+ interface UmbCopyDataSource {
43
+ copy(unique: string, targetUnique: string): Promise<DataSourceResponse$1<string>>;
44
+ }
45
+
32
46
  interface UmbRepositoryErrorResponse {
33
47
  error?: ProblemDetailsModel;
34
48
  }
@@ -58,14 +72,14 @@ interface UmbTreeRepository<ItemType = any, PagedItemType = UmbPagedData<ItemTyp
58
72
  error: ProblemDetailsModel | undefined;
59
73
  asObservable?: () => Observable<ItemType[]>;
60
74
  }>;
61
- requestTreeItems: (uniques: string[]) => Promise<{
75
+ requestItemsLegacy?: (uniques: string[]) => Promise<{
62
76
  data: Array<ItemType> | undefined;
63
77
  error: ProblemDetailsModel | undefined;
64
78
  asObservable?: () => Observable<ItemType[]>;
65
79
  }>;
66
80
  rootTreeItems: () => Promise<Observable<ItemType[]>>;
67
81
  treeItemsOf: (parentUnique: string | null) => Promise<Observable<ItemType[]>>;
68
- treeItems: (uniques: string[]) => Promise<Observable<ItemType[]>>;
82
+ itemsLegacy?: (uniques: string[]) => Promise<Observable<ItemType[]>>;
69
83
  }
70
84
 
71
85
  interface UmbFolderRepository {
@@ -90,4 +104,21 @@ interface UmbFolderRepository {
90
104
  }>;
91
105
  }
92
106
 
93
- export { DataSourceResponse, UmbDataSource, UmbDetailRepository, UmbFolderDataSource, UmbFolderRepository, UmbPagedData, UmbRepositoryErrorResponse, UmbRepositoryResponse, UmbTreeDataSource, UmbTreeRepository };
107
+ interface UmbItemRepository<ItemType extends ItemResponseModelBaseModel> {
108
+ requestItems: (uniques: string[]) => Promise<{
109
+ data?: Array<ItemType> | undefined;
110
+ error?: ProblemDetailsModel | undefined;
111
+ asObservable?: () => Observable<Array<ItemType>>;
112
+ }>;
113
+ items: (uniques: string[]) => Promise<Observable<Array<ItemType>>>;
114
+ }
115
+
116
+ interface UmbMoveRepository {
117
+ move(unique: string, targetUnique: string): Promise<UmbRepositoryErrorResponse>;
118
+ }
119
+
120
+ interface UmbCopyRepository {
121
+ copy(unique: string, targetUnique: string): Promise<UmbRepositoryResponse<string>>;
122
+ }
123
+
124
+ export { DataSourceResponse, UmbCopyDataSource, UmbCopyRepository, UmbDataSource, UmbDataSourceErrorResponse, UmbDetailRepository, UmbFolderDataSource, UmbFolderRepository, UmbItemDataSource, UmbItemRepository, UmbMoveDataSource, UmbMoveRepository, UmbPagedData, UmbRepositoryErrorResponse, UmbRepositoryResponse, UmbTreeDataSource, UmbTreeRepository };
package/resources.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { UmbNotificationOptions } from './notification';
2
- import { ProblemDetailsModel } from './backend-api';
3
- import { UmbController, UmbControllerHostElement } from './controller';
4
- import { DataSourceResponse as DataSourceResponse$1 } from './repository';
1
+ import { UmbNotificationOptions } from '@umbraco-cms/backoffice/notification';
2
+ import { ProblemDetailsModel } from '@umbraco-cms/backoffice/backend-api';
3
+ import { UmbController, UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
4
+ import { DataSourceResponse as DataSourceResponse$1 } from '@umbraco-cms/backoffice/repository';
5
5
 
6
6
  declare class UmbResourceController extends UmbController {
7
7
  #private;
@@ -38,8 +38,10 @@ declare class UmbResourceController extends UmbController {
38
38
  destroy(): void;
39
39
  }
40
40
 
41
- interface DataSourceResponse<T = undefined> {
41
+ interface DataSourceResponse<T = undefined> extends UmbDataSourceErrorResponse {
42
42
  data?: T;
43
+ }
44
+ interface UmbDataSourceErrorResponse {
43
45
  error?: ProblemDetailsModel;
44
46
  }
45
47