@umbraco-cms/backoffice 14.0.0--preview004-3ccd7a3d → 14.0.0--preview004-c83185ce
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/custom-elements.json +37 -0
- package/dist-cms/packages/core/components/index.d.ts +1 -0
- package/dist-cms/packages/core/components/index.js +1 -0
- package/dist-cms/packages/core/components/input-markdown-editor/index.d.ts +1 -0
- package/dist-cms/packages/core/components/input-markdown-editor/index.js +1 -0
- package/dist-cms/packages/core/components/input-markdown-editor/input-markdown.element.d.ts +24 -0
- package/dist-cms/packages/core/components/input-markdown-editor/input-markdown.element.js +78 -0
- package/dist-cms/packages/core/property-editor/uis/markdown-editor/property-editor-ui-markdown-editor.element.d.ts +3 -1
- package/dist-cms/packages/core/property-editor/uis/markdown-editor/property-editor-ui-markdown-editor.element.js +17 -4
- package/dist-cms/packages/core/sorter/stories/test-sorter-controller.element.d.ts +2 -0
- package/dist-cms/packages/core/sorter/stories/test-sorter-controller.element.js +49 -24
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +21 -2
- package/package.json +1 -1
|
@@ -1147,6 +1147,38 @@
|
|
|
1147
1147
|
}
|
|
1148
1148
|
]
|
|
1149
1149
|
},
|
|
1150
|
+
{
|
|
1151
|
+
"name": "umb-input-markdown",
|
|
1152
|
+
"path": "./../src/packages/core/components/input-markdown-editor/input-markdown.element.ts",
|
|
1153
|
+
"attributes": [
|
|
1154
|
+
{
|
|
1155
|
+
"name": "preview",
|
|
1156
|
+
"type": "boolean | undefined"
|
|
1157
|
+
}
|
|
1158
|
+
],
|
|
1159
|
+
"properties": [
|
|
1160
|
+
{
|
|
1161
|
+
"name": "preview",
|
|
1162
|
+
"attribute": "preview",
|
|
1163
|
+
"type": "boolean | undefined"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
"name": "isCodeEditorReady",
|
|
1167
|
+
"default": "\"this.#isCodeEditorReady.asObservable()\""
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"name": "styles",
|
|
1171
|
+
"type": "array",
|
|
1172
|
+
"default": "[null]"
|
|
1173
|
+
}
|
|
1174
|
+
],
|
|
1175
|
+
"events": [
|
|
1176
|
+
{
|
|
1177
|
+
"name": "change",
|
|
1178
|
+
"description": "when the value of the input changes"
|
|
1179
|
+
}
|
|
1180
|
+
]
|
|
1181
|
+
},
|
|
1150
1182
|
{
|
|
1151
1183
|
"name": "umb-input-multi-url",
|
|
1152
1184
|
"path": "./../src/packages/core/components/input-multi-url/input-multi-url.element.ts",
|
|
@@ -3207,6 +3239,11 @@
|
|
|
3207
3239
|
"type": "array",
|
|
3208
3240
|
"default": "[\"UmbTextStyles\"]"
|
|
3209
3241
|
}
|
|
3242
|
+
],
|
|
3243
|
+
"events": [
|
|
3244
|
+
{
|
|
3245
|
+
"name": "property-value-change"
|
|
3246
|
+
}
|
|
3210
3247
|
]
|
|
3211
3248
|
},
|
|
3212
3249
|
{
|
|
@@ -15,6 +15,7 @@ export * from './input-checkbox-list/index.js';
|
|
|
15
15
|
export * from './input-color/index.js';
|
|
16
16
|
export * from './input-eye-dropper/index.js';
|
|
17
17
|
export * from './input-list-base/index.js';
|
|
18
|
+
export * from './input-markdown-editor/index.js';
|
|
18
19
|
export * from './input-multi-url/index.js';
|
|
19
20
|
export * from './input-tiny-mce/index.js';
|
|
20
21
|
export * from './input-number-range/index.js';
|
|
@@ -17,6 +17,7 @@ export * from './input-checkbox-list/index.js';
|
|
|
17
17
|
export * from './input-color/index.js';
|
|
18
18
|
export * from './input-eye-dropper/index.js';
|
|
19
19
|
export * from './input-list-base/index.js';
|
|
20
|
+
export * from './input-markdown-editor/index.js';
|
|
20
21
|
export * from './input-multi-url/index.js';
|
|
21
22
|
export * from './input-tiny-mce/index.js';
|
|
22
23
|
export * from './input-number-range/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input-markdown.element.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input-markdown.element.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UmbCodeEditorElement } from '../../../templating/code-editor/index.js';
|
|
2
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
|
+
declare const UmbInputMarkdownElement_base: (new (...args: any[]) => import("../../../../external/uui/index.js").FormControlMixinInterface) & typeof UmbLitElement;
|
|
4
|
+
/**
|
|
5
|
+
* @element umb-input-markdown
|
|
6
|
+
* @fires change - when the value of the input changes
|
|
7
|
+
*/
|
|
8
|
+
export declare class UmbInputMarkdownElement extends UmbInputMarkdownElement_base {
|
|
9
|
+
#private;
|
|
10
|
+
protected getFormElement(): undefined;
|
|
11
|
+
preview?: boolean;
|
|
12
|
+
isCodeEditorReady: import("rxjs").Observable<boolean>;
|
|
13
|
+
_codeEditor?: UmbCodeEditorElement;
|
|
14
|
+
constructor();
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
renderPreview(): import("lit-html").TemplateResult<1> | undefined;
|
|
17
|
+
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'umb-input-markdown': UmbInputMarkdownElement;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { loadCodeEditor } from '../../../templating/code-editor/index.js';
|
|
8
|
+
import { css, html, customElement, query, property } from '../../../../external/lit/index.js';
|
|
9
|
+
import { FormControlMixin } from '../../../../external/uui/index.js';
|
|
10
|
+
import { UmbBooleanState } from '../../../../libs/observable-api/index.js';
|
|
11
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* @element umb-input-markdown
|
|
14
|
+
* @fires change - when the value of the input changes
|
|
15
|
+
*/
|
|
16
|
+
export let UmbInputMarkdownElement = class UmbInputMarkdownElement extends FormControlMixin(UmbLitElement) {
|
|
17
|
+
getFormElement() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
#isCodeEditorReady;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.#isCodeEditorReady = new UmbBooleanState(false);
|
|
24
|
+
this.isCodeEditorReady = this.#isCodeEditorReady.asObservable();
|
|
25
|
+
this.#loadCodeEditor();
|
|
26
|
+
}
|
|
27
|
+
async #loadCodeEditor() {
|
|
28
|
+
try {
|
|
29
|
+
await loadCodeEditor();
|
|
30
|
+
this._codeEditor?.editor?.updateOptions({
|
|
31
|
+
lineNumbers: false,
|
|
32
|
+
minimap: false,
|
|
33
|
+
folding: false,
|
|
34
|
+
});
|
|
35
|
+
this.#isCodeEditorReady.next(true);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error(error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return html ` <div id="actions"></div>
|
|
43
|
+
<umb-code-editor language="markdown" .code=${this.value}></umb-code-editor>
|
|
44
|
+
${this.renderPreview()}`;
|
|
45
|
+
}
|
|
46
|
+
renderPreview() {
|
|
47
|
+
if (!this.preview)
|
|
48
|
+
return;
|
|
49
|
+
return html `<div>TODO Preview</div>`;
|
|
50
|
+
}
|
|
51
|
+
static { this.styles = [
|
|
52
|
+
css `
|
|
53
|
+
:host {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
}
|
|
57
|
+
#actions {
|
|
58
|
+
background-color: var(--uui-color-background-alt);
|
|
59
|
+
display: flex;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
umb-code-editor {
|
|
63
|
+
height: 200px;
|
|
64
|
+
border-radius: var(--uui-border-radius);
|
|
65
|
+
border: 1px solid var(--uui-color-divider-emphasis);
|
|
66
|
+
}
|
|
67
|
+
`,
|
|
68
|
+
]; }
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ type: Boolean })
|
|
72
|
+
], UmbInputMarkdownElement.prototype, "preview", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
query('umb-code-editor')
|
|
75
|
+
], UmbInputMarkdownElement.prototype, "_codeEditor", void 0);
|
|
76
|
+
UmbInputMarkdownElement = __decorate([
|
|
77
|
+
customElement('umb-input-markdown')
|
|
78
|
+
], UmbInputMarkdownElement);
|
|
@@ -5,8 +5,10 @@ import { UmbPropertyEditorConfigCollection } from '../../index.js';
|
|
|
5
5
|
* @element umb-property-editor-ui-markdown-editor
|
|
6
6
|
*/
|
|
7
7
|
export declare class UmbPropertyEditorUIMarkdownEditorElement extends UmbLitElement implements UmbPropertyEditorExtensionElement {
|
|
8
|
+
#private;
|
|
8
9
|
value: string;
|
|
9
|
-
|
|
10
|
+
private _preview?;
|
|
11
|
+
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
10
12
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
13
|
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
12
14
|
}
|
|
@@ -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 { html, customElement, property } from '../../../../../external/lit/index.js';
|
|
8
|
-
import { UmbTextStyles } from
|
|
7
|
+
import { html, customElement, property, state } from '../../../../../external/lit/index.js';
|
|
8
|
+
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
10
10
|
/**
|
|
11
11
|
* @element umb-property-editor-ui-markdown-editor
|
|
@@ -15,17 +15,30 @@ export let UmbPropertyEditorUIMarkdownEditorElement = class UmbPropertyEditorUIM
|
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.value = '';
|
|
17
17
|
}
|
|
18
|
+
set config(config) {
|
|
19
|
+
this._preview = config?.getValueByAlias('preview');
|
|
20
|
+
}
|
|
21
|
+
#onChange(e) {
|
|
22
|
+
this.value = e.target.value;
|
|
23
|
+
this.dispatchEvent(new CustomEvent('property-value-change'));
|
|
24
|
+
}
|
|
18
25
|
render() {
|
|
19
|
-
return html `<
|
|
26
|
+
return html `<umb-input-markdown
|
|
27
|
+
?preview=${this._preview}
|
|
28
|
+
@change=${this.#onChange}
|
|
29
|
+
.value=${this.value}></umb-input-markdown>`;
|
|
20
30
|
}
|
|
21
31
|
static { this.styles = [UmbTextStyles]; }
|
|
22
32
|
};
|
|
23
33
|
__decorate([
|
|
24
34
|
property()
|
|
25
35
|
], UmbPropertyEditorUIMarkdownEditorElement.prototype, "value", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
state()
|
|
38
|
+
], UmbPropertyEditorUIMarkdownEditorElement.prototype, "_preview", void 0);
|
|
26
39
|
__decorate([
|
|
27
40
|
property({ attribute: false })
|
|
28
|
-
], UmbPropertyEditorUIMarkdownEditorElement.prototype, "config",
|
|
41
|
+
], UmbPropertyEditorUIMarkdownEditorElement.prototype, "config", null);
|
|
29
42
|
UmbPropertyEditorUIMarkdownEditorElement = __decorate([
|
|
30
43
|
customElement('umb-property-editor-ui-markdown-editor')
|
|
31
44
|
], UmbPropertyEditorUIMarkdownEditorElement);
|
|
@@ -5,7 +5,9 @@ type SortEntryType = {
|
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
7
|
export default class UmbTestSorterControllerElement extends UmbLitElement {
|
|
8
|
+
#private;
|
|
8
9
|
sorter: UmbSorterController<SortEntryType>;
|
|
10
|
+
private vertical;
|
|
9
11
|
constructor();
|
|
10
12
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
13
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
@@ -6,13 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { UmbSorterController } from '../sorter.controller.js';
|
|
8
8
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
9
|
-
import { css, customElement, html } from '../../../../external/lit/index.js';
|
|
10
|
-
const
|
|
9
|
+
import { css, customElement, html, state } from '../../../../external/lit/index.js';
|
|
10
|
+
const SORTER_CONFIG = {
|
|
11
11
|
compareElementToModel: (element, model) => {
|
|
12
12
|
return element.getAttribute('data-sort-entry-id') === model.id;
|
|
13
13
|
},
|
|
14
14
|
querySelectModelToElement: (container, modelEntry) => {
|
|
15
|
-
return container.querySelector('data-sort-entry-id[' + modelEntry.id + ']');
|
|
15
|
+
return container.querySelector('data-sort-entry-id=[' + modelEntry.id + ']');
|
|
16
16
|
},
|
|
17
17
|
identifier: 'test-sorter',
|
|
18
18
|
itemSelector: 'li',
|
|
@@ -35,13 +35,27 @@ const model = [
|
|
|
35
35
|
let UmbTestSorterControllerElement = class UmbTestSorterControllerElement extends UmbLitElement {
|
|
36
36
|
constructor() {
|
|
37
37
|
super();
|
|
38
|
-
this.
|
|
38
|
+
this.vertical = true;
|
|
39
|
+
this.sorter = new UmbSorterController(this, {
|
|
40
|
+
...SORTER_CONFIG,
|
|
41
|
+
resolveVerticalDirection: () => {
|
|
42
|
+
this.vertical ? true : false;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
39
45
|
this.sorter.setModel(model);
|
|
40
46
|
}
|
|
47
|
+
#toggle() {
|
|
48
|
+
this.vertical = !this.vertical;
|
|
49
|
+
}
|
|
41
50
|
render() {
|
|
42
51
|
return html `
|
|
43
|
-
<
|
|
44
|
-
|
|
52
|
+
<uui-button label="Change direction" look="outline" color="positive" @click=${this.#toggle}>
|
|
53
|
+
Horizontal/Vertical
|
|
54
|
+
</uui-button>
|
|
55
|
+
<ul class="${this.vertical ? 'vertical' : 'horizontal'}">
|
|
56
|
+
${model.map((entry) => html `<li class="item" data-sort-entry-id="${entry.id}">
|
|
57
|
+
<span><uui-icon name="umb:wand"></uui-icon>${entry.value}</span>
|
|
58
|
+
</li>`)}
|
|
45
59
|
</ul>
|
|
46
60
|
`;
|
|
47
61
|
}
|
|
@@ -49,43 +63,54 @@ let UmbTestSorterControllerElement = class UmbTestSorterControllerElement extend
|
|
|
49
63
|
css `
|
|
50
64
|
:host {
|
|
51
65
|
display: block;
|
|
66
|
+
box-sizing: border-box;
|
|
52
67
|
}
|
|
53
68
|
|
|
54
69
|
ul {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 5px;
|
|
55
73
|
list-style: none;
|
|
56
74
|
padding: 0;
|
|
57
|
-
margin: 0;
|
|
75
|
+
margin: 10px 0;
|
|
58
76
|
}
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
margin: 5px;
|
|
63
|
-
background: #eee;
|
|
78
|
+
ul.horizontal {
|
|
79
|
+
flex-direction: row;
|
|
64
80
|
}
|
|
65
81
|
|
|
66
|
-
li
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
li:active {
|
|
72
|
-
background: #ccc;
|
|
82
|
+
li {
|
|
83
|
+
cursor: grab;
|
|
84
|
+
position: relative;
|
|
85
|
+
flex: 1;
|
|
86
|
+
border-radius: var(--uui-border-radius);
|
|
73
87
|
}
|
|
74
88
|
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
li span {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 5px;
|
|
93
|
+
padding: 10px;
|
|
94
|
+
background-color: rgba(0, 255, 0, 0.3);
|
|
77
95
|
}
|
|
78
96
|
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
li.--umb-sorter-placeholder span {
|
|
98
|
+
visibility: hidden;
|
|
81
99
|
}
|
|
82
100
|
|
|
83
|
-
|
|
84
|
-
|
|
101
|
+
li.--umb-sorter-placeholder::after {
|
|
102
|
+
content: '';
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 0px;
|
|
105
|
+
border-radius: var(--uui-border-radius);
|
|
106
|
+
border: 1px dashed var(--uui-color-divider-emphasis);
|
|
85
107
|
}
|
|
86
108
|
`,
|
|
87
109
|
]; }
|
|
88
110
|
};
|
|
111
|
+
__decorate([
|
|
112
|
+
state()
|
|
113
|
+
], UmbTestSorterControllerElement.prototype, "vertical", void 0);
|
|
89
114
|
UmbTestSorterControllerElement = __decorate([
|
|
90
115
|
customElement('test-my-sorter-controller')
|
|
91
116
|
], UmbTestSorterControllerElement);
|