@umbraco-cms/backoffice 15.4.0-rc2 → 15.4.0

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.
@@ -4,7 +4,7 @@ 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 { css, customElement, html, map, property, state, unsafeCSS, when } from '../../../../external/lit/index.js';
7
+ import { css, customElement, html, property, repeat, state, unsafeCSS, when, } from '../../../../external/lit/index.js';
8
8
  import { loadManifestApi } from '../../../../libs/extension-api/index.js';
9
9
  import { umbExtensionsRegistry } from '../../../core/extension-registry/index.js';
10
10
  import { Editor } from '../../../../external/tiptap/index.js';
@@ -14,6 +14,11 @@ import { UmbFormControlMixin } from '../../../core/validation/index.js';
14
14
  import './tiptap-toolbar.element.js';
15
15
  import './tiptap-statusbar.element.js';
16
16
  const TIPTAP_CORE_EXTENSION_ALIAS = 'Umb.Tiptap.RichTextEssentials';
17
+ /**
18
+ * The root path for the stylesheets on the server.
19
+ * This is used to load the stylesheets from the server as a workaround until the server supports virtual paths.
20
+ */
21
+ const STYLESHEET_ROOT_PATH = '/css';
17
22
  let UmbInputTiptapElement = class UmbInputTiptapElement extends UmbFormControlMixin(UmbLitElement) {
18
23
  #stylesheets;
19
24
  set value(value) {
@@ -87,7 +92,12 @@ let UmbInputTiptapElement = class UmbInputTiptapElement extends UmbFormControlMi
87
92
  }
88
93
  const stylesheets = this.configuration?.getValueByAlias('stylesheets');
89
94
  if (stylesheets?.length) {
90
- stylesheets.forEach((x) => this.#stylesheets.add(x));
95
+ stylesheets.forEach((stylesheet) => {
96
+ const linkHref = stylesheet.startsWith('http') || stylesheet.startsWith(STYLESHEET_ROOT_PATH)
97
+ ? stylesheet
98
+ : `${STYLESHEET_ROOT_PATH}${stylesheet}`;
99
+ this.#stylesheets.add(linkHref);
100
+ });
91
101
  }
92
102
  this._toolbar = this.configuration?.getValueByAlias('toolbar') ?? [[[]]];
93
103
  this._statusbar = this.configuration?.getValueByAlias('statusbar') ?? [];
@@ -134,7 +144,7 @@ let UmbInputTiptapElement = class UmbInputTiptapElement extends UmbFormControlMi
134
144
  if (!this._styles?.length)
135
145
  return;
136
146
  return html `
137
- ${map(this.#stylesheets, (stylesheet) => html `<link rel="stylesheet" href=${stylesheet} />`)}
147
+ ${repeat(this.#stylesheets, (stylesheet) => stylesheet, (stylesheet) => html `<link rel="stylesheet" href="${stylesheet}" />`)}
138
148
  <style>
139
149
  ${this._styles.map((style) => unsafeCSS(style))}
140
150
  </style>