@umbraco-cms/backoffice 14.3.0 → 14.3.1
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/dist-cms/assets/lang/bs.js +2 -2
- package/dist-cms/assets/lang/bs.ts +2 -2
- package/dist-cms/assets/lang/cs-cz.js +2 -2
- package/dist-cms/assets/lang/cs-cz.ts +2 -2
- package/dist-cms/assets/lang/cy-gb.js +2 -2
- package/dist-cms/assets/lang/cy-gb.ts +2 -2
- package/dist-cms/assets/lang/da-dk.js +2 -2
- package/dist-cms/assets/lang/da-dk.ts +2 -2
- package/dist-cms/assets/lang/de-de.js +2 -2
- package/dist-cms/assets/lang/de-de.ts +2 -2
- package/dist-cms/assets/lang/en-us.js +2 -2
- package/dist-cms/assets/lang/en-us.ts +2 -2
- package/dist-cms/assets/lang/en.js +2 -2
- package/dist-cms/assets/lang/en.ts +2 -2
- package/dist-cms/assets/lang/es-es.js +3 -3
- package/dist-cms/assets/lang/es-es.ts +3 -3
- package/dist-cms/assets/lang/fr-fr.js +2 -2
- package/dist-cms/assets/lang/fr-fr.ts +2 -3
- package/dist-cms/assets/lang/he-il.js +1 -1
- package/dist-cms/assets/lang/he-il.ts +1 -1
- package/dist-cms/assets/lang/hr-hr.js +2 -2
- package/dist-cms/assets/lang/hr-hr.ts +2 -2
- package/dist-cms/assets/lang/it-it.js +1 -1
- package/dist-cms/assets/lang/it-it.ts +1 -1
- package/dist-cms/assets/lang/ja-jp.js +1 -1
- package/dist-cms/assets/lang/ja-jp.ts +1 -1
- package/dist-cms/assets/lang/ko-kr.js +1 -1
- package/dist-cms/assets/lang/ko-kr.ts +1 -1
- package/dist-cms/assets/lang/nb-no.js +3 -1
- package/dist-cms/assets/lang/nb-no.ts +3 -1
- package/dist-cms/assets/lang/nl-nl.js +2 -2
- package/dist-cms/assets/lang/nl-nl.ts +2 -2
- package/dist-cms/assets/lang/pl-pl.js +2 -2
- package/dist-cms/assets/lang/pl-pl.ts +2 -2
- package/dist-cms/assets/lang/pt-br.js +1 -1
- package/dist-cms/assets/lang/pt-br.ts +1 -1
- package/dist-cms/assets/lang/ru-ru.js +2 -2
- package/dist-cms/assets/lang/ru-ru.ts +2 -2
- package/dist-cms/assets/lang/tr-tr.js +2 -2
- package/dist-cms/assets/lang/tr-tr.ts +2 -2
- package/dist-cms/assets/lang/uk-ua.js +2 -2
- package/dist-cms/assets/lang/uk-ua.ts +2 -2
- package/dist-cms/assets/lang/zh-cn.js +2 -2
- package/dist-cms/assets/lang/zh-cn.ts +2 -2
- package/dist-cms/assets/lang/zh-tw.js +1 -1
- package/dist-cms/assets/lang/zh-tw.ts +1 -2
- package/dist-cms/packages/core/utils/index.d.ts +1 -0
- package/dist-cms/packages/core/utils/index.js +1 -0
- package/dist-cms/packages/core/utils/sanitize/sanitize-html.function.d.ts +6 -0
- package/dist-cms/packages/core/utils/sanitize/sanitize-html.function.js +9 -0
- package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.js +9 -5
- package/dist-cms/packages/markdown-editor/components/input-markdown-editor/input-markdown.element.js +2 -2
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DOMPurify } from '../../../../external/dompurify/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sanitize a HTML string by removing any potentially harmful content such as scripts.
|
|
4
|
+
* @param {string} html The HTML string to sanitize.
|
|
5
|
+
* @returns The sanitized HTML string.
|
|
6
|
+
*/
|
|
7
|
+
export function sanitizeHTML(html) {
|
|
8
|
+
return DOMPurify.sanitize(html);
|
|
9
|
+
}
|
package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.js
CHANGED
|
@@ -6,11 +6,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { UMB_DICTIONARY_WORKSPACE_CONTEXT } from '../dictionary-workspace.context-token.js';
|
|
8
8
|
import { UUITextareaEvent } from '../../../../external/uui/index.js';
|
|
9
|
-
import { css, html, customElement, state, repeat
|
|
9
|
+
import { css, html, customElement, state, repeat } from '../../../../external/lit/index.js';
|
|
10
10
|
import { UmbLitElement } from '../../../core/lit-element/index.js';
|
|
11
11
|
import { UmbLanguageCollectionRepository } from '../../../language/index.js';
|
|
12
12
|
import { UMB_CURRENT_USER_CONTEXT } from '../../../user/current-user/index.js';
|
|
13
|
+
import { sanitizeHTML } from '../../../core/utils/index.js';
|
|
13
14
|
let UmbWorkspaceViewDictionaryEditorElement = class UmbWorkspaceViewDictionaryEditorElement extends UmbLitElement {
|
|
15
|
+
get #dictionaryName() {
|
|
16
|
+
return typeof this._dictionary?.name !== 'undefined' ? sanitizeHTML(this._dictionary.name) : '...';
|
|
17
|
+
}
|
|
14
18
|
#languageCollectionRepository;
|
|
15
19
|
#workspaceContext;
|
|
16
20
|
#currentUserContext;
|
|
@@ -46,7 +50,7 @@ let UmbWorkspaceViewDictionaryEditorElement = class UmbWorkspaceViewDictionaryEd
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
#observeDictionary() {
|
|
49
|
-
this.observe(this.#workspaceContext
|
|
53
|
+
this.observe(this.#workspaceContext?.dictionary, (dictionary) => {
|
|
50
54
|
this._dictionary = dictionary;
|
|
51
55
|
});
|
|
52
56
|
}
|
|
@@ -64,13 +68,13 @@ let UmbWorkspaceViewDictionaryEditorElement = class UmbWorkspaceViewDictionaryEd
|
|
|
64
68
|
const target = e.composedPath()[0];
|
|
65
69
|
const translation = target.value.toString();
|
|
66
70
|
const isoCode = target.getAttribute('name');
|
|
67
|
-
this.#workspaceContext
|
|
71
|
+
this.#workspaceContext?.setPropertyValue(isoCode, translation);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
render() {
|
|
71
75
|
return html `
|
|
72
76
|
<uui-box>
|
|
73
|
-
${
|
|
77
|
+
${this.localize.term('dictionaryItem_description', this.#dictionaryName)}
|
|
74
78
|
${repeat(this._languages, (item) => item.unique, (item) => this.#renderTranslation(item))}
|
|
75
79
|
</uui-box>
|
|
76
80
|
`;
|
|
@@ -85,7 +89,7 @@ let UmbWorkspaceViewDictionaryEditorElement = class UmbWorkspaceViewDictionaryEd
|
|
|
85
89
|
name=${language.unique}
|
|
86
90
|
label="translation"
|
|
87
91
|
@change=${this.#onTextareaChange}
|
|
88
|
-
value=${
|
|
92
|
+
.value=${translation?.translation ?? ''}
|
|
89
93
|
?readonly=${this.#isReadOnly(language.unique)}></uui-textarea>
|
|
90
94
|
</umb-property-layout>`;
|
|
91
95
|
}
|
package/dist-cms/packages/markdown-editor/components/input-markdown-editor/input-markdown.element.js
CHANGED
|
@@ -9,7 +9,6 @@ import { createExtensionApi } from '../../../../libs/extension-api/index.js';
|
|
|
9
9
|
import { marked } from '../../../../external/marked/index.js';
|
|
10
10
|
import { monaco } from '../../../../external/monaco-editor/index.js';
|
|
11
11
|
import { umbExtensionsRegistry } from '../../../core/extension-registry/index.js';
|
|
12
|
-
import { DOMPurify } from '../../../../external/dompurify/index.js';
|
|
13
12
|
import { UmbChangeEvent } from '../../../core/event/index.js';
|
|
14
13
|
import { UmbLitElement } from '../../../core/lit-element/index.js';
|
|
15
14
|
import { UmbTextStyles } from '../../../core/style/index.js';
|
|
@@ -17,6 +16,7 @@ import { UMB_MODAL_MANAGER_CONTEXT } from '../../../core/modal/index.js';
|
|
|
17
16
|
import { UMB_MEDIA_PICKER_MODAL, UmbMediaUrlRepository } from '../../../media/media/index.js';
|
|
18
17
|
import { UmbCodeEditorLoadedEvent } from '../../../code-editor/index.js';
|
|
19
18
|
import { UmbFormControlMixin } from '../../../core/validation/index.js';
|
|
19
|
+
import { sanitizeHTML } from '../../../core/utils/index.js';
|
|
20
20
|
const elementName = 'umb-input-markdown';
|
|
21
21
|
/**
|
|
22
22
|
* @element umb-input-markdown
|
|
@@ -519,7 +519,7 @@ let UmbInputMarkdownElement = class UmbInputMarkdownElement extends UmbFormContr
|
|
|
519
519
|
if (!this.preview || !this.value)
|
|
520
520
|
return;
|
|
521
521
|
const markdownAsHtml = marked.parse(this.value);
|
|
522
|
-
const sanitizedHtml = markdownAsHtml ?
|
|
522
|
+
const sanitizedHtml = markdownAsHtml ? sanitizeHTML(markdownAsHtml) : '';
|
|
523
523
|
return html `<uui-scroll-container id="preview">${unsafeHTML(sanitizedHtml)}</uui-scroll-container>`;
|
|
524
524
|
}
|
|
525
525
|
static { this.styles = [
|