@umbraco-cms/backoffice 14.0.0--preview004-3f36df26 → 14.0.0--preview004-03cd3c35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist-cms/apps/app/app.element.js +6 -6
  2. package/dist-cms/libs/class-api/class.mixin.d.ts +1 -3
  3. package/dist-cms/libs/controller-api/controller.class.d.ts +2 -6
  4. package/dist-cms/libs/observable-api/basic-state.d.ts +45 -3
  5. package/dist-cms/libs/observable-api/basic-state.js +56 -6
  6. package/dist-cms/libs/observable-api/boolean-state.d.ts +2 -2
  7. package/dist-cms/libs/observable-api/boolean-state.js +2 -2
  8. package/dist-cms/libs/observable-api/class-state.d.ts +4 -4
  9. package/dist-cms/libs/observable-api/class-state.js +6 -6
  10. package/dist-cms/libs/observable-api/create-observable-part.function.d.ts +1 -1
  11. package/dist-cms/libs/observable-api/create-observable-part.function.js +2 -2
  12. package/dist-cms/libs/observable-api/deep-state.d.ts +3 -3
  13. package/dist-cms/libs/observable-api/deep-state.js +5 -5
  14. package/dist-cms/libs/observable-api/number-state.d.ts +1 -1
  15. package/dist-cms/libs/observable-api/number-state.js +1 -1
  16. package/dist-cms/libs/observable-api/object-state.js +1 -1
  17. package/dist-cms/libs/observable-api/string-state.d.ts +1 -1
  18. package/dist-cms/libs/observable-api/string-state.js +1 -1
  19. package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +2 -2
  20. package/dist-cms/packages/core/workspace/workspace-context/entity-manager-controller.js +1 -1
  21. package/dist-cms/packages/core/workspace/workspace-property/workspace-property.context.js +1 -1
  22. package/dist-cms/packages/core/workspace/workspace-split-view/workspace-split-view.context.js +1 -1
  23. package/dist-cms/packages/dictionary/dictionary/workspace/dictionary-workspace.context.js +1 -1
  24. package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +1 -1
  25. package/dist-cms/packages/health-check/views/health-check-group-box-overview.element.js +5 -3
  26. package/dist-cms/packages/health-check/views/health-check-group.element.js +10 -8
  27. package/dist-cms/packages/log-viewer/workspace/logviewer.context.js +19 -19
  28. package/dist-cms/packages/media/media/workspace/media-workspace.context.js +1 -1
  29. package/dist-cms/packages/media/media-types/workspace/media-type-workspace.context.js +1 -1
  30. package/dist-cms/packages/members/member-groups/workspace/member-group-workspace.context.js +1 -1
  31. package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.js +1 -1
  32. package/dist-cms/packages/members/members/member.detail.store.js +2 -2
  33. package/dist-cms/packages/packages/package/repository/server-extension.controller.js +3 -12
  34. package/dist-cms/packages/settings/data-types/workspace/data-type-workspace.context.js +1 -1
  35. package/dist-cms/packages/settings/languages/workspace/language/language-workspace.context.js +1 -1
  36. package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.context.js +1 -1
  37. package/dist-cms/packages/templating/code-editor/code-editor.element.js +2 -2
  38. package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.js +4 -4
  39. package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.js +4 -4
  40. package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +5 -5
  41. package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +7 -7
  42. package/dist-cms/packages/user/current-user/user-profile-apps/user-profile-app-themes.element.js +9 -9
  43. package/dist-cms/packages/user/user/workspace/user-workspace.context.js +1 -1
  44. package/dist-cms/packages/user/user-group/workspace/user-group-workspace.context.js +1 -1
  45. package/dist-cms/shared/auth/auth.context.d.ts +4 -4
  46. package/dist-cms/shared/auth/auth.context.js +12 -6
  47. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  48. package/package.json +1 -1
@@ -77,9 +77,9 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
77
77
  // just in case the user language is not the default language.
78
78
  // We **need** to do this because the default language (typically en-us) holds all the fallback keys for all the other languages.
79
79
  // This way we can ensure that the document language is always loaded first and subsequently registered as the fallback language.
80
- umbLocalizationRegistry.isDefaultLoaded.subscribe((isDefaultLoaded) => {
80
+ this.observe(umbLocalizationRegistry.isDefaultLoaded, (isDefaultLoaded) => {
81
81
  if (!this.#authContext) {
82
- throw new Error('[Fatal] AuthContext requested before it was initialised');
82
+ throw new Error('[Fatal] AuthContext requested before it was initialized');
83
83
  }
84
84
  if (!isDefaultLoaded)
85
85
  return;
@@ -114,7 +114,7 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
114
114
  catch (error) {
115
115
  // If the auth flow fails, there is most likely something wrong with the connection to the backend server
116
116
  // and we should redirect to the error page
117
- let errorMsg = 'An error occured while trying to initialise the connection to the Umbraco server (check console for details)';
117
+ let errorMsg = 'An error occurred while trying to initialize the connection to the Umbraco server (check console for details)';
118
118
  // Get the type of the error and check http status codes
119
119
  if (error instanceof Error) {
120
120
  // If the error is a "TypeError" it means that the server is not reachable
@@ -158,7 +158,7 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
158
158
  async #setAuthStatus() {
159
159
  if (this.bypassAuth === false) {
160
160
  if (!this.#authContext) {
161
- throw new Error('[Fatal] AuthContext requested before it was initialised');
161
+ throw new Error('[Fatal] AuthContext requested before it was initialized');
162
162
  }
163
163
  // Get service configuration from authentication server
164
164
  await this.#authContext.setInitialState();
@@ -168,10 +168,10 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
168
168
  }
169
169
  this.#listenForLanguageChange();
170
170
  if (this.#authContext?.isAuthorized()) {
171
- this.#authContext.isLoggedIn.next(true);
171
+ this.#authContext?.setLoggedIn(true);
172
172
  }
173
173
  else {
174
- this.#authContext?.isLoggedIn.next(false);
174
+ this.#authContext?.setLoggedIn(false);
175
175
  }
176
176
  }
177
177
  #redirect() {
@@ -7,9 +7,7 @@ import { UmbObserverController } from '../observable-api/index.js';
7
7
  type UmbClassMixinConstructor = new (host: UmbControllerHost, controllerAlias: UmbControllerAlias) => UmbClassMixinDeclaration;
8
8
  declare class UmbClassMixinDeclaration implements UmbClassMixinInterface {
9
9
  _host: UmbControllerHost;
10
- observe<T>(source: Observable<T> | {
11
- asObservable: () => Observable<T>;
12
- }, callback: (_value: T) => void, controllerAlias?: UmbControllerAlias): UmbObserverController<T>;
10
+ observe<T>(source: Observable<T>, callback: (_value: T) => void, controllerAlias?: UmbControllerAlias): UmbObserverController<T>;
13
11
  provideContext<BaseType = unknown, ResultType extends BaseType = BaseType, InstanceType extends ResultType = ResultType>(alias: string | UmbContextToken<BaseType, ResultType>, instance: InstanceType): UmbContextProviderController<BaseType, ResultType, InstanceType>;
14
12
  consumeContext<BaseType = unknown, ResultType extends BaseType = BaseType>(alias: string | UmbContextToken<BaseType, ResultType>, callback: UmbContextCallback<ResultType>): UmbContextConsumerController<BaseType, ResultType>;
15
13
  hasController(controller: UmbController): boolean;
@@ -2,9 +2,7 @@ import { UmbControllerHost } from './controller-host.interface.js';
2
2
  import { UmbController } from './controller.interface.js';
3
3
  declare const UmbBaseController_base: (new (host: UmbControllerHost, controllerAlias: import("./controller-alias.type.js").UmbControllerAlias) => {
4
4
  _host: UmbControllerHost;
5
- observe<T>(source: import("rxjs").Observable<T> | {
6
- asObservable: () => import("rxjs").Observable<T>;
7
- }, callback: (_value: T) => void, controllerAlias?: import("./controller-alias.type.js").UmbControllerAlias): import("../observable-api/observer.controller.js").UmbObserverController<T>;
5
+ observe<T>(source: import("rxjs").Observable<T>, callback: (_value: T) => void, controllerAlias?: import("./controller-alias.type.js").UmbControllerAlias): import("../observable-api/observer.controller.js").UmbObserverController<T>;
8
6
  provideContext<BaseType = unknown, ResultType extends BaseType = BaseType, InstanceType_1 extends ResultType = ResultType>(alias: string | import("../context-api/index.js").UmbContextToken<BaseType, ResultType>, instance: InstanceType_1): import("../context-api/index.js").UmbContextProviderController<BaseType, ResultType, InstanceType_1>;
9
7
  consumeContext<BaseType_1 = unknown, ResultType_1 extends BaseType_1 = BaseType_1>(alias: string | import("../context-api/index.js").UmbContextToken<BaseType_1, ResultType_1>, callback: import("../context-api/index.js").UmbContextCallback<ResultType_1>): import("../context-api/index.js").UmbContextConsumerController<BaseType_1, ResultType_1>;
10
8
  hasController(controller: UmbController): boolean;
@@ -19,9 +17,7 @@ declare const UmbBaseController_base: (new (host: UmbControllerHost, controllerA
19
17
  destroy(): void;
20
18
  }) & {
21
19
  _host: UmbControllerHost;
22
- observe<T>(source: import("rxjs").Observable<T> | {
23
- asObservable: () => import("rxjs").Observable<T>;
24
- }, callback: (_value: T) => void, controllerAlias?: import("./controller-alias.type.js").UmbControllerAlias): import("../observable-api/observer.controller.js").UmbObserverController<T>;
20
+ observe<T>(source: import("rxjs").Observable<T>, callback: (_value: T) => void, controllerAlias?: import("./controller-alias.type.js").UmbControllerAlias): import("../observable-api/observer.controller.js").UmbObserverController<T>;
25
21
  provideContext<BaseType = unknown, ResultType extends BaseType = BaseType, InstanceType_1 extends ResultType = ResultType>(alias: string | import("../context-api/index.js").UmbContextToken<BaseType, ResultType>, instance: InstanceType_1): import("../context-api/index.js").UmbContextProviderController<BaseType, ResultType, InstanceType_1>;
26
22
  consumeContext<BaseType_1 = unknown, ResultType_1 extends BaseType_1 = BaseType_1>(alias: string | import("../context-api/index.js").UmbContextToken<BaseType_1, ResultType_1>, callback: import("../context-api/index.js").UmbContextCallback<ResultType_1>): import("../context-api/index.js").UmbContextConsumerController<BaseType_1, ResultType_1>;
27
23
  hasController(controller: UmbController): boolean;
@@ -2,10 +2,52 @@ import { BehaviorSubject } from '../../external/rxjs/index.js';
2
2
  /**
3
3
  * @export
4
4
  * @class UmbBasicState
5
- * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
5
+ * @description - State ensures the data is unique, not updating any Observes unless there is an actual change of the value using `===`.
7
6
  */
8
- export declare class UmbBasicState<T> extends BehaviorSubject<T> {
7
+ export declare class UmbBasicState<T> {
8
+ protected _subject: BehaviorSubject<T>;
9
9
  constructor(initialData: T);
10
+ /**
11
+ * @method asObservable
12
+ * @return {Observable} Observable that the State casts to.
13
+ * @description - Creates a new Observable with this State as the source. Observe this to subscribe to its value and future changes.
14
+ * @example <caption>Example observe the data of a state</caption>
15
+ * const myState = new UmbArrayState('Hello world');
16
+ *
17
+ * this.observe(myState, (latestStateValue) => console.log("Value is: ", latestStateValue));
18
+ */
19
+ asObservable(): ReturnType<BehaviorSubject<T>['asObservable']>;
20
+ /**
21
+ * @property value
22
+ * @description - Holds the current data of this state.
23
+ * @example <caption>Example retrieve the current data of a state</caption>
24
+ * const myState = new UmbArrayState('Hello world');
25
+ * console.log("Value is: ", myState.getValue());
26
+ */
27
+ get value(): BehaviorSubject<T>['value'];
28
+ /**
29
+ * @method getValue
30
+ * @return {T} The current data of this state.
31
+ * @description - Provides the current data of this state.
32
+ * @example <caption>Example retrieve the current data of a state</caption>
33
+ * const myState = new UmbArrayState('Hello world');
34
+ * console.log("Value is: ", myState.value);
35
+ */
36
+ getValue(): ReturnType<BehaviorSubject<T>['getValue']>;
37
+ /**
38
+ * @method destroy
39
+ * @description - Destroys this state and completes all observations made to it.
40
+ */
41
+ destroy(): void;
42
+ /**
43
+ * @method next
44
+ * @param {T} data - The next set of data for this state to hold.
45
+ * @description - Set the data of this state, if data is different than current this will trigger observations to update.
46
+ * @example <caption>Example retrieve the current data of a state</caption>
47
+ * const myState = new UmbArrayState('Good morning');
48
+ * // myState.value is equal 'Good morning'.
49
+ * myState.next('Goodnight')
50
+ * // myState.value is equal 'Goodnight'.
51
+ */
10
52
  next(newData: T): void;
11
53
  }
@@ -2,16 +2,66 @@ import { BehaviorSubject } from '../../external/rxjs/index.js';
2
2
  /**
3
3
  * @export
4
4
  * @class UmbBasicState
5
- * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
5
+ * @description - State ensures the data is unique, not updating any Observes unless there is an actual change of the value using `===`.
7
6
  */
8
- export class UmbBasicState extends BehaviorSubject {
7
+ export class UmbBasicState {
9
8
  constructor(initialData) {
10
- super(initialData);
9
+ this._subject = new BehaviorSubject(initialData);
11
10
  }
11
+ /**
12
+ * @method asObservable
13
+ * @return {Observable} Observable that the State casts to.
14
+ * @description - Creates a new Observable with this State as the source. Observe this to subscribe to its value and future changes.
15
+ * @example <caption>Example observe the data of a state</caption>
16
+ * const myState = new UmbArrayState('Hello world');
17
+ *
18
+ * this.observe(myState, (latestStateValue) => console.log("Value is: ", latestStateValue));
19
+ */
20
+ asObservable() {
21
+ return this._subject.asObservable();
22
+ }
23
+ /**
24
+ * @property value
25
+ * @description - Holds the current data of this state.
26
+ * @example <caption>Example retrieve the current data of a state</caption>
27
+ * const myState = new UmbArrayState('Hello world');
28
+ * console.log("Value is: ", myState.getValue());
29
+ */
30
+ get value() {
31
+ return this._subject.value;
32
+ }
33
+ ;
34
+ /**
35
+ * @method getValue
36
+ * @return {T} The current data of this state.
37
+ * @description - Provides the current data of this state.
38
+ * @example <caption>Example retrieve the current data of a state</caption>
39
+ * const myState = new UmbArrayState('Hello world');
40
+ * console.log("Value is: ", myState.value);
41
+ */
42
+ getValue() {
43
+ return this._subject.getValue();
44
+ }
45
+ /**
46
+ * @method destroy
47
+ * @description - Destroys this state and completes all observations made to it.
48
+ */
49
+ destroy() {
50
+ this._subject.complete();
51
+ }
52
+ /**
53
+ * @method next
54
+ * @param {T} data - The next set of data for this state to hold.
55
+ * @description - Set the data of this state, if data is different than current this will trigger observations to update.
56
+ * @example <caption>Example retrieve the current data of a state</caption>
57
+ * const myState = new UmbArrayState('Good morning');
58
+ * // myState.value is equal 'Good morning'.
59
+ * myState.next('Goodnight')
60
+ * // myState.value is equal 'Goodnight'.
61
+ */
12
62
  next(newData) {
13
- if (newData !== this.getValue()) {
14
- super.next(newData);
63
+ if (newData !== this._subject.getValue()) {
64
+ this._subject.next(newData);
15
65
  }
16
66
  }
17
67
  }
@@ -2,8 +2,8 @@ import { UmbBasicState } from './basic-state.js';
2
2
  /**
3
3
  * @export
4
4
  * @class UmbBooleanState
5
- * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
5
+ * @extends {UmbBasicState<T>}
6
+ * @description - This state ensures the data is unique, not updating any Observes unless there is an actual change of the value.
7
7
  */
8
8
  export declare class UmbBooleanState<T> extends UmbBasicState<T | boolean> {
9
9
  constructor(initialData: T | boolean);
@@ -2,8 +2,8 @@ import { UmbBasicState } from './basic-state.js';
2
2
  /**
3
3
  * @export
4
4
  * @class UmbBooleanState
5
- * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
5
+ * @extends {UmbBasicState<T>}
6
+ * @description - This state ensures the data is unique, not updating any Observes unless there is an actual change of the value.
7
7
  */
8
8
  export class UmbBooleanState extends UmbBasicState {
9
9
  constructor(initialData) {
@@ -1,14 +1,14 @@
1
- import { BehaviorSubject } from '../../external/rxjs/index.js';
1
+ import { UmbBasicState } from "./basic-state.js";
2
2
  export interface UmbClassStateData {
3
3
  equal(otherClass: this | undefined): boolean;
4
4
  }
5
5
  /**
6
6
  * @export
7
7
  * @class UmbClassState
8
- * @extends {BehaviorSubject<T>}
9
- * @description - A RxJS BehaviorSubject which can hold class instance which has a equal method to compare in coming instances for changes.
8
+ * @extends {UmbBasicState<T>}
9
+ * @description - This state can hold class instance which has a equal method to compare in coming instances for changes.
10
10
  */
11
- export declare class UmbClassState<T extends UmbClassStateData | undefined> extends BehaviorSubject<T> {
11
+ export declare class UmbClassState<T extends UmbClassStateData | undefined> extends UmbBasicState<T> {
12
12
  constructor(initialData: T);
13
13
  next(newData: T): void;
14
14
  }
@@ -1,18 +1,18 @@
1
- import { BehaviorSubject } from '../../external/rxjs/index.js';
1
+ import { UmbBasicState } from "./basic-state.js";
2
2
  /**
3
3
  * @export
4
4
  * @class UmbClassState
5
- * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject which can hold class instance which has a equal method to compare in coming instances for changes.
5
+ * @extends {UmbBasicState<T>}
6
+ * @description - This state can hold class instance which has a equal method to compare in coming instances for changes.
7
7
  */
8
- export class UmbClassState extends BehaviorSubject {
8
+ export class UmbClassState extends UmbBasicState {
9
9
  constructor(initialData) {
10
10
  super(initialData);
11
11
  }
12
12
  next(newData) {
13
- const oldValue = this.getValue();
13
+ const oldValue = this._subject.getValue();
14
14
  if (newData && oldValue?.equal(newData))
15
15
  return;
16
- super.next(newData);
16
+ this._subject.next(newData);
17
17
  }
18
18
  }
@@ -11,4 +11,4 @@ import { Observable } from '../../external/rxjs/index.js';
11
11
  * @example <caption>Example create a Observable for part of the data Subject.</caption>
12
12
  * public readonly myPart = CreateObservablePart(this._data, (data) => data.myPart);
13
13
  */
14
- export declare function createObservablePart<R, T>(source$: Observable<T>, mappingFunction: MappingFunction<T, R>, memoizationFunction?: MemoizationFunction<R>): Observable<R>;
14
+ export declare function createObservablePart<R, T>(source: Observable<T>, mappingFunction: MappingFunction<T, R>, memoizationFunction?: MemoizationFunction<R>): Observable<R>;
@@ -10,6 +10,6 @@ import { distinctUntilChanged, map, shareReplay } from '../../external/rxjs/inde
10
10
  * @example <caption>Example create a Observable for part of the data Subject.</caption>
11
11
  * public readonly myPart = CreateObservablePart(this._data, (data) => data.myPart);
12
12
  */
13
- export function createObservablePart(source$, mappingFunction, memoizationFunction) {
14
- return source$.pipe(map(mappingFunction), distinctUntilChanged(memoizationFunction || defaultMemoization), shareReplay(1));
13
+ export function createObservablePart(source, mappingFunction, memoizationFunction) {
14
+ return source.pipe(map(mappingFunction), distinctUntilChanged(memoizationFunction || defaultMemoization), shareReplay(1));
15
15
  }
@@ -1,6 +1,6 @@
1
+ import { UmbBasicState } from './basic-state.js';
1
2
  import type { MappingFunction } from './mapping-function.js';
2
3
  import type { MemoizationFunction } from './memoization-function.js';
3
- import { BehaviorSubject } from '../../external/rxjs/index.js';
4
4
  /**
5
5
  * @export
6
6
  * @class UmbDeepState
@@ -8,8 +8,8 @@ import { BehaviorSubject } from '../../external/rxjs/index.js';
8
8
  * @description - A RxJS BehaviorSubject which deepFreezes the data to ensure its not manipulated from any implementations.
9
9
  * Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.
10
10
  */
11
- export declare class UmbDeepState<T> extends BehaviorSubject<T> {
11
+ export declare class UmbDeepState<T> extends UmbBasicState<T> {
12
12
  constructor(initialData: T);
13
- asObservablePart<ReturnType>(mappingFunction: MappingFunction<T, ReturnType>, memoizationFunction?: MemoizationFunction<ReturnType>): import("rxjs/internal/Observable.js").Observable<ReturnType>;
13
+ asObservablePart<ReturnType>(mappingFunction: MappingFunction<T, ReturnType>, memoizationFunction?: MemoizationFunction<ReturnType>): import("rxjs").Observable<ReturnType>;
14
14
  next(newData: T): void;
15
15
  }
@@ -1,7 +1,7 @@
1
+ import { UmbBasicState } from './basic-state.js';
1
2
  import { createObservablePart } from './create-observable-part.function.js';
2
3
  import { deepFreeze } from './deep-freeze.function.js';
3
4
  import { naiveObjectComparison } from './naive-object-comparison.js';
4
- import { BehaviorSubject } from '../../external/rxjs/index.js';
5
5
  /**
6
6
  * @export
7
7
  * @class UmbDeepState
@@ -9,18 +9,18 @@ import { BehaviorSubject } from '../../external/rxjs/index.js';
9
9
  * @description - A RxJS BehaviorSubject which deepFreezes the data to ensure its not manipulated from any implementations.
10
10
  * Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.
11
11
  */
12
- export class UmbDeepState extends BehaviorSubject {
12
+ export class UmbDeepState extends UmbBasicState {
13
13
  constructor(initialData) {
14
14
  super(deepFreeze(initialData));
15
15
  }
16
16
  asObservablePart(mappingFunction, memoizationFunction) {
17
- return createObservablePart(this, mappingFunction, memoizationFunction);
17
+ return createObservablePart(this._subject, mappingFunction, memoizationFunction);
18
18
  }
19
19
  next(newData) {
20
20
  const frozenData = deepFreeze(newData);
21
21
  // Only update data if its different than current data.
22
- if (!naiveObjectComparison(frozenData, this.getValue())) {
23
- super.next(frozenData);
22
+ if (!naiveObjectComparison(frozenData, this._subject.getValue())) {
23
+ this._subject.next(frozenData);
24
24
  }
25
25
  }
26
26
  }
@@ -3,7 +3,7 @@ import { UmbBasicState } from './basic-state.js';
3
3
  * @export
4
4
  * @class UmbNumberState
5
5
  * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
6
+ * @description - State holding data of number, this ensures the data is unique, not updating any Observes unless there is an actual change of the value bu using `===`.
7
7
  */
8
8
  export declare class UmbNumberState<T> extends UmbBasicState<T | number> {
9
9
  constructor(initialData: T | number);
@@ -3,7 +3,7 @@ import { UmbBasicState } from './basic-state.js';
3
3
  * @export
4
4
  * @class UmbNumberState
5
5
  * @extends {BehaviorSubject<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
6
+ * @description - State holding data of number, this ensures the data is unique, not updating any Observes unless there is an actual change of the value bu using `===`.
7
7
  */
8
8
  export class UmbNumberState extends UmbBasicState {
9
9
  constructor(initialData) {
@@ -20,7 +20,7 @@ export class UmbObjectState extends UmbDeepState {
20
20
  * myState.update({value: 'myNewValue'});
21
21
  */
22
22
  update(partialData) {
23
- this.next({ ...this.getValue(), ...partialData });
23
+ this.next({ ...this._subject.getValue(), ...partialData });
24
24
  return this;
25
25
  }
26
26
  }
@@ -3,7 +3,7 @@ import { UmbBasicState } from './basic-state.js';
3
3
  * @export
4
4
  * @class UmbStringState
5
5
  * @extends {UmbBasicState<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
6
+ * @description - A state holding string data, this ensures the data is unique, not updating any Observes unless there is an actual change of the value, by using `===`.
7
7
  */
8
8
  export declare class UmbStringState<T> extends UmbBasicState<T | string> {
9
9
  constructor(initialData: T | string);
@@ -3,7 +3,7 @@ import { UmbBasicState } from './basic-state.js';
3
3
  * @export
4
4
  * @class UmbStringState
5
5
  * @extends {UmbBasicState<T>}
6
- * @description - A RxJS BehaviorSubject this Subject ensures the data is unique, not updating any Observes unless there is an actual change of the value.
6
+ * @description - A state holding string data, this ensures the data is unique, not updating any Observes unless there is an actual change of the value, by using `===`.
7
7
  */
8
8
  export class UmbStringState extends UmbBasicState {
9
9
  constructor(initialData) {
@@ -331,7 +331,7 @@ export class UmbContentTypePropertyStructureManager {
331
331
  }
332
332
  destroy() {
333
333
  this._reset();
334
- this.#contentTypes.complete();
335
- this.#containers.complete();
334
+ this.#contentTypes.destroy();
335
+ this.#containers.destroy();
336
336
  }
337
337
  }
@@ -54,7 +54,7 @@ export class UmbEntityWorkspaceManager {
54
54
  });
55
55
  };
56
56
  this.destroy = () => {
57
- this.state.unsubscribe();
57
+ this.state.destroy();
58
58
  };
59
59
  this._host = host;
60
60
  this._entityType = entityType;
@@ -103,7 +103,7 @@ export class UmbWorkspacePropertyContext extends UmbBaseController {
103
103
  this.setValue(null); // TODO: We should get the default value from Property Editor maybe even later the DocumentType, as that would hold the default value for the property.
104
104
  }
105
105
  destroy() {
106
- this.#data.unsubscribe();
106
+ this.#data.destroy();
107
107
  this._providerController.destroy(); // This would also be handled by the controller host, but if someone wanted to replace/remove this context without the host being destroyed. Then we have clean up out selfs here.
108
108
  }
109
109
  }
@@ -20,7 +20,7 @@ export class UmbWorkspaceSplitViewContext extends UmbBaseController {
20
20
  this.#workspaceContext = context;
21
21
  this._observeVariant();
22
22
  });
23
- this.observe(this.#index, () => {
23
+ this.observe(this.index, () => {
24
24
  this._observeVariant();
25
25
  });
26
26
  this.provideContext(UMB_WORKSPACE_SPLIT_VIEW_CONTEXT, this);
@@ -73,7 +73,7 @@ export class UmbDictionaryWorkspaceContext extends UmbWorkspaceContext {
73
73
  this.saveComplete(data);
74
74
  }
75
75
  destroy() {
76
- this.#data.complete();
76
+ this.#data.destroy();
77
77
  }
78
78
  }
79
79
  export const UMB_DICTIONARY_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'dictionary-item');
@@ -165,7 +165,7 @@ export class UmbDocumentWorkspaceContext extends UmbWorkspaceContext {
165
165
  return new UmbDocumentVariantContext(host, this, variantId);
166
166
  }
167
167
  destroy() {
168
- this.#currentData.complete();
168
+ this.#currentData.destroy();
169
169
  this.structure.destroy();
170
170
  super.destroy();
171
171
  }
@@ -19,9 +19,11 @@ export let UmbHealthCheckGroupBoxOverviewElement = class UmbHealthCheckGroupBoxO
19
19
  if (!this._healthCheckContext || !this.manifest?.meta.label)
20
20
  return;
21
21
  this._api = this._healthCheckContext?.apis.get(this.manifest?.meta.label);
22
- this._api?.results.subscribe((results) => {
23
- this._keyResults = results;
24
- });
22
+ if (this._api) {
23
+ this.observe(this._api.results, (results) => {
24
+ this._keyResults = results;
25
+ }, '_observeApiResults');
26
+ }
25
27
  });
26
28
  }
27
29
  render() {
@@ -17,14 +17,16 @@ export let UmbDashboardHealthCheckGroupElement = class UmbDashboardHealthCheckGr
17
17
  this.consumeContext(UMB_HEALTHCHECK_DASHBOARD_CONTEXT_TOKEN, (instance) => {
18
18
  this._healthCheckContext = instance;
19
19
  this._api = this._healthCheckContext?.apis.get(this.groupName);
20
- this._api?.getGroupChecks(this.groupName);
21
- this._api?.checks.subscribe((group) => {
22
- this._checks = group?.checks;
23
- this._group = group;
24
- });
25
- this._api?.results.subscribe((results) => {
26
- this._idResults = results?.checks;
27
- });
20
+ if (this._api) {
21
+ this._api.getGroupChecks(this.groupName);
22
+ this.observe(this._api.checks, (group) => {
23
+ this._checks = group?.checks;
24
+ this._group = group;
25
+ });
26
+ this.observe(this._api.results, (results) => {
27
+ this._idResults = results?.checks;
28
+ });
29
+ }
28
30
  });
29
31
  }
30
32
  async _buttonHandler() {
@@ -1,5 +1,5 @@
1
1
  import { UmbLogViewerRepository } from '../repository/log-viewer.repository.js';
2
- import { UmbBasicState, UmbArrayState, createObservablePart, UmbDeepState, UmbObjectState, UmbStringState, } from '../../../libs/observable-api/index.js';
2
+ import { UmbBasicState, UmbArrayState, UmbObjectState, UmbStringState, } from '../../../libs/observable-api/index.js';
3
3
  import { DirectionModel, LogLevelModel, } from '../../../external/backend-api/index.js';
4
4
  import { UmbBaseController } from '../../../libs/controller-api/index.js';
5
5
  import { UmbContextToken } from '../../../libs/context-api/index.js';
@@ -52,30 +52,30 @@ export class UmbLogViewerWorkspaceContext extends UmbBaseController {
52
52
  endDate: this.today,
53
53
  };
54
54
  this.#savedSearches = new UmbObjectState(undefined);
55
- this.savedSearches = createObservablePart(this.#savedSearches, (data) => data?.items);
56
- this.#logCount = new UmbDeepState(null);
57
- this.logCount = createObservablePart(this.#logCount, (data) => data);
58
- this.#dateRange = new UmbDeepState(this.defaultDateRange);
59
- this.dateRange = createObservablePart(this.#dateRange, (data) => data);
60
- this.#loggers = new UmbDeepState(null);
61
- this.loggers = createObservablePart(this.#loggers, (data) => data?.items);
55
+ this.savedSearches = this.#savedSearches.asObservablePart((data) => data?.items);
56
+ this.#logCount = new UmbObjectState(null);
57
+ this.logCount = this.#logCount.asObservable();
58
+ this.#dateRange = new UmbObjectState(this.defaultDateRange);
59
+ this.dateRange = this.#dateRange.asObservable();
60
+ this.#loggers = new UmbObjectState(null);
61
+ this.loggers = this.#loggers.asObservablePart((data) => data?.items);
62
62
  this.#canShowLogs = new UmbBasicState(null);
63
- this.canShowLogs = createObservablePart(this.#canShowLogs, (data) => data);
63
+ this.canShowLogs = this.#canShowLogs.asObservable();
64
64
  this.#isLoadingLogs = new UmbBasicState(null);
65
- this.isLoadingLogs = createObservablePart(this.#isLoadingLogs, (data) => data);
65
+ this.isLoadingLogs = this.#isLoadingLogs.asObservable();
66
66
  this.#filterExpression = new UmbStringState('');
67
- this.filterExpression = createObservablePart(this.#filterExpression, (data) => data);
68
- this.#messageTemplates = new UmbDeepState(null);
69
- this.messageTemplates = createObservablePart(this.#messageTemplates, (data) => data);
67
+ this.filterExpression = this.#filterExpression.asObservable();
68
+ this.#messageTemplates = new UmbObjectState(null);
69
+ this.messageTemplates = this.#messageTemplates.asObservable();
70
70
  this.#logLevelsFilter = new UmbArrayState([]);
71
- this.logLevelsFilter = createObservablePart(this.#logLevelsFilter, (data) => data);
72
- this.#logs = new UmbDeepState(null);
73
- this.logs = createObservablePart(this.#logs, (data) => data?.items);
74
- this.logsTotal = createObservablePart(this.#logs, (data) => data?.total);
71
+ this.logLevelsFilter = this.#logLevelsFilter.asObservable();
72
+ this.#logs = new UmbObjectState(null);
73
+ this.logs = this.#logs.asObservablePart((data) => data?.items);
74
+ this.logsTotal = this.#logs.asObservablePart((data) => data?.total);
75
75
  this.#polling = new UmbObjectState({ enabled: false, interval: 2000 });
76
- this.polling = createObservablePart(this.#polling, (data) => data);
76
+ this.polling = this.#polling.asObservable();
77
77
  this.#sortingDirection = new UmbBasicState(DirectionModel.ASCENDING);
78
- this.sortingDirection = createObservablePart(this.#sortingDirection, (data) => data);
78
+ this.sortingDirection = this.#sortingDirection.asObservable();
79
79
  this.#intervalID = null;
80
80
  this.currentPage = 1;
81
81
  this.onChangeState = () => {
@@ -63,7 +63,7 @@ export class UmbMediaWorkspaceContext extends UmbWorkspaceContext {
63
63
  await this.repository.delete(id);
64
64
  }
65
65
  destroy() {
66
- this.#data.complete();
66
+ this.#data.destroy();
67
67
  }
68
68
  }
69
69
  export const UMB_MEDIA_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'media');
@@ -58,7 +58,7 @@ export class UmbMediaTypeWorkspaceContext extends UmbWorkspaceContext {
58
58
  this.saveComplete(this.#data.value);
59
59
  }
60
60
  destroy() {
61
- this.#data.complete();
61
+ this.#data.destroy();
62
62
  }
63
63
  }
64
64
  export const UMB_MEDIA_TYPE_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'media-type');
@@ -47,7 +47,7 @@ export class UmbMemberGroupWorkspaceContext extends UmbWorkspaceContext {
47
47
  this.setIsNew(true);
48
48
  }
49
49
  destroy() {
50
- this.#data.complete();
50
+ this.#data.destroy();
51
51
  }
52
52
  }
53
53
  export const UMB_MEMBER_GROUP_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'member-group');
@@ -56,7 +56,7 @@ export class UmbMemberTypeWorkspaceContext extends UmbWorkspaceContext {
56
56
  await this.repository.delete(id);
57
57
  }
58
58
  destroy() {
59
- this.#data.complete();
59
+ this.#data.destroy();
60
60
  }
61
61
  }
62
62
  export const UMB_MEMBER_TYPE_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'member-type');
@@ -1,6 +1,6 @@
1
1
  import { umbMemberData } from '../../../mocks/data/member.data.js';
2
2
  import { UmbContextToken } from '../../../libs/context-api/index.js';
3
- import { UmbArrayState, createObservablePart } from '../../../libs/observable-api/index.js';
3
+ import { UmbArrayState } from '../../../libs/observable-api/index.js';
4
4
  import { UmbStoreBase } from '../../core/store/index.js';
5
5
  /**
6
6
  * @export
@@ -33,7 +33,7 @@ export class UmbMemberStore extends UmbStoreBase {
33
33
  if (member) {
34
34
  this._data.appendOne(member);
35
35
  }
36
- return createObservablePart(this._data, (members) => members.find((member) => member.id === id));
36
+ return this._data.asObservablePart((members) => members.find((member) => member.id === id));
37
37
  }
38
38
  async save(member) {
39
39
  return null;