@umbraco-cms/backoffice 14.0.0-2a03783e → 14.0.0-2f667994

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 (57) hide show
  1. package/dist-cms/apps/app/app.element.d.ts +11 -1
  2. package/dist-cms/apps/app/app.element.js +25 -1
  3. package/dist-cms/apps/backoffice/backoffice.element.d.ts +0 -1
  4. package/dist-cms/apps/backoffice/backoffice.element.js +3 -4
  5. package/dist-cms/assets/lang/da-dk.d.ts +3 -0
  6. package/dist-cms/assets/lang/da-dk.js +2989 -0
  7. package/dist-cms/assets/lang/da-dk.ts +3246 -0
  8. package/dist-cms/assets/lang/en-us.d.ts +3 -0
  9. package/dist-cms/assets/lang/en-us.js +2966 -0
  10. package/dist-cms/assets/lang/en-us.ts +3219 -0
  11. package/dist-cms/custom-elements.json +72 -0
  12. package/dist-cms/external/backend-api/index.js +1 -1
  13. package/dist-cms/external/tinymce/index.js +22 -22
  14. package/dist-cms/libs/controller-api/controller-host-element.mixin.d.ts +9 -3
  15. package/dist-cms/libs/element-api/element.mixin.d.ts +9 -2
  16. package/dist-cms/libs/element-api/element.mixin.js +21 -0
  17. package/dist-cms/libs/extension-api/types.d.ts +8 -0
  18. package/dist-cms/libs/localization-api/index.d.ts +3 -0
  19. package/dist-cms/libs/localization-api/index.js +3 -0
  20. package/dist-cms/libs/localization-api/localize.controller.d.ts +47 -0
  21. package/dist-cms/libs/localization-api/localize.controller.js +125 -0
  22. package/dist-cms/libs/localization-api/manager.d.ts +18 -0
  23. package/dist-cms/libs/localization-api/manager.js +40 -0
  24. package/dist-cms/libs/localization-api/registry/translation.registry.d.ts +12 -0
  25. package/dist-cms/libs/localization-api/registry/translation.registry.js +58 -0
  26. package/dist-cms/libs/observable-api/observer.controller.d.ts +2 -2
  27. package/dist-cms/libs/observable-api/observer.d.ts +7 -1
  28. package/dist-cms/packages/core/extension-registry/models/index.d.ts +3 -1
  29. package/dist-cms/packages/core/extension-registry/models/index.js +1 -0
  30. package/dist-cms/packages/core/extension-registry/models/translations.model.d.ts +41 -0
  31. package/dist-cms/packages/core/extension-registry/models/translations.model.js +1 -0
  32. package/dist-cms/packages/core/index.d.ts +1 -0
  33. package/dist-cms/packages/core/index.js +3 -0
  34. package/dist-cms/packages/core/localization/index.d.ts +1 -0
  35. package/dist-cms/packages/core/localization/index.js +1 -0
  36. package/dist-cms/packages/core/localization/localize.element.d.ts +34 -0
  37. package/dist-cms/packages/core/localization/localize.element.js +64 -0
  38. package/dist-cms/packages/core/localization/manifests.d.ts +2 -0
  39. package/dist-cms/packages/core/localization/manifests.js +23 -0
  40. package/dist-cms/packages/umbraco-news/umbraco-news-dashboard.element.js +1 -1
  41. package/dist-cms/packages/users/current-user/modals/current-user/current-user-modal.element.js +10 -6
  42. package/dist-cms/packages/users/current-user/user-profile-apps/user-profile-app-profile.element.js +7 -5
  43. package/dist-cms/packages/users/users/repository/user.repository.js +5 -1
  44. package/dist-cms/packages/users/users/workspace/user-workspace-editor.element.d.ts +1 -0
  45. package/dist-cms/packages/users/users/workspace/user-workspace-editor.element.js +51 -6
  46. package/dist-cms/packages/users/users/workspace/user-workspace.context.d.ts +1 -1
  47. package/dist-cms/packages/users/users/workspace/user-workspace.context.js +17 -0
  48. package/dist-cms/shared/auth/auth.context.d.ts +1 -0
  49. package/dist-cms/shared/auth/auth.context.js +1 -2
  50. package/dist-cms/shared/auth/auth.interface.d.ts +4 -0
  51. package/dist-cms/shared/utils/media-helper.service.js +1 -0
  52. package/dist-cms/tsconfig.build.json +15 -0
  53. package/dist-cms/tsconfig.build.tsbuildinfo +1 -0
  54. package/dist-cms/umbraco-package-schema.json +83 -3
  55. package/dist-cms/vscode-html-custom-data.json +28 -4
  56. package/package.json +5 -4
  57. package/dist-cms/tsconfig.tsbuildinfo +0 -1
@@ -8,6 +8,17 @@ export declare class UmbAppElement extends UmbLitElement {
8
8
  * @remarks This is the base URL of the Umbraco server, not the base URL of the backoffice.
9
9
  */
10
10
  serverUrl: string;
11
+ /**
12
+ * The default culture to use for localization.
13
+ *
14
+ * When the current user is resolved, the culture will be set to the user's culture.
15
+ *
16
+ * @attr
17
+ * @remarks This is the default culture to use for localization, not the current culture.
18
+ * @example "en-us"
19
+ * @example "en"
20
+ */
21
+ culture: string;
11
22
  /**
12
23
  * The base path of the backoffice.
13
24
  *
@@ -16,7 +27,6 @@ export declare class UmbAppElement extends UmbLitElement {
16
27
  backofficePath: string;
17
28
  /**
18
29
  * Bypass authentication.
19
- * @type {boolean}
20
30
  */
21
31
  bypassAuth: boolean;
22
32
  private _routes;
@@ -14,6 +14,7 @@ import { pathWithoutBasePath } from '../../shared/router/index.js';
14
14
  import { tryExecute } from '../../shared/resources/index.js';
15
15
  import { OpenAPI, RuntimeLevelModel, ServerResource } from '../../external/backend-api/index.js';
16
16
  import { contextData, umbDebugContextEventType } from '../../libs/context-api/index.js';
17
+ import { umbTranslationRegistry } from '../../libs/localization-api/index.js';
17
18
  export let UmbAppElement = class UmbAppElement extends UmbLitElement {
18
19
  #authFlow;
19
20
  #umbIconRegistry;
@@ -28,6 +29,17 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
28
29
  * @remarks This is the base URL of the Umbraco server, not the base URL of the backoffice.
29
30
  */
30
31
  this.serverUrl = window.location.origin;
32
+ /**
33
+ * The default culture to use for localization.
34
+ *
35
+ * When the current user is resolved, the culture will be set to the user's culture.
36
+ *
37
+ * @attr
38
+ * @remarks This is the default culture to use for localization, not the current culture.
39
+ * @example "en-us"
40
+ * @example "en"
41
+ */
42
+ this.culture = 'en-us';
31
43
  /**
32
44
  * The base path of the backoffice.
33
45
  *
@@ -36,7 +48,6 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
36
48
  this.backofficePath = '/umbraco';
37
49
  /**
38
50
  * Bypass authentication.
39
- * @type {boolean}
40
51
  */
41
52
  // TODO: this might not be the right solution
42
53
  this.bypassAuth = false;
@@ -64,8 +75,17 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
64
75
  }
65
76
  connectedCallback() {
66
77
  super.connectedCallback();
78
+ this.#setLanguage();
67
79
  this.#setup();
68
80
  }
81
+ #setLanguage() {
82
+ umbTranslationRegistry.loadLanguage(this.culture);
83
+ }
84
+ #listenForLanguageChange(authContext) {
85
+ this.observe(authContext.languageIsoCode, (currentLanguageIsoCode) => {
86
+ umbTranslationRegistry.loadLanguage(currentLanguageIsoCode);
87
+ }, 'languageIsoCode');
88
+ }
69
89
  async #setup() {
70
90
  if (this.serverUrl === undefined)
71
91
  throw new Error('No serverUrl provided');
@@ -142,6 +162,7 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
142
162
  OpenAPI.TOKEN = () => this.#authFlow.performWithFreshTokens();
143
163
  OpenAPI.WITH_CREDENTIALS = true;
144
164
  }
165
+ this.#listenForLanguageChange(authContext);
145
166
  authContext.isLoggedIn.next(true);
146
167
  }
147
168
  #redirect() {
@@ -226,6 +247,9 @@ export let UmbAppElement = class UmbAppElement extends UmbLitElement {
226
247
  __decorate([
227
248
  property({ type: String })
228
249
  ], UmbAppElement.prototype, "serverUrl", void 0);
250
+ __decorate([
251
+ property({ type: String, attribute: 'default-culture' })
252
+ ], UmbAppElement.prototype, "culture", void 0);
229
253
  __decorate([
230
254
  property({ type: String })
231
255
  // TODO: get from server config
@@ -1,7 +1,6 @@
1
1
  import { UmbLitElement } from '../../shared/lit-element/index.js';
2
2
  import './components/index.js';
3
3
  export declare class UmbBackofficeElement extends UmbLitElement {
4
- #private;
5
4
  constructor();
6
5
  render(): import("lit-html").TemplateResult<1>;
7
6
  static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { UmbExtensionInitializer } from './extension.controller.js';
8
7
  import { UmbBackofficeContext, UMB_BACKOFFICE_CONTEXT_TOKEN } from './backoffice.context.js';
8
+ import { UmbExtensionInitializer } from './extension.controller.js';
9
9
  import { css, html, customElement } from '../../external/lit/index.js';
10
10
  import { UUITextStyles } from '../../external/uui/index.js';
11
11
  import { umbExtensionsRegistry } from '../../packages/core/extension-registry/index.js';
@@ -28,14 +28,13 @@ const CORE_PACKAGES = [
28
28
  import('../../packages/tags/umbraco-package.js'),
29
29
  ];
30
30
  export let UmbBackofficeElement = class UmbBackofficeElement extends UmbLitElement {
31
- #extensionInitializer = new UmbExtensionInitializer(this, umbExtensionsRegistry);
32
31
  constructor() {
33
32
  super();
34
33
  this.provideContext(UMB_BACKOFFICE_CONTEXT_TOKEN, new UmbBackofficeContext());
35
34
  new UmbBundleExtensionInitializer(this, umbExtensionsRegistry);
36
35
  new UmbEntryPointExtensionInitializer(this, umbExtensionsRegistry);
37
- new UmbExtensionInitializer(this, umbExtensionsRegistry);
38
- this.#extensionInitializer.setLocalPackages(CORE_PACKAGES);
36
+ const extensionInitializer = new UmbExtensionInitializer(this, umbExtensionsRegistry);
37
+ extensionInitializer.setLocalPackages(CORE_PACKAGES);
39
38
  }
40
39
  render() {
41
40
  return html `
@@ -0,0 +1,3 @@
1
+ import type { UmbTranslationsDictionary } from '../../packages/core/extension-registry/index.js';
2
+ declare const _default: UmbTranslationsDictionary;
3
+ export default _default;