@umbraco-cms/backoffice 14.0.0--preview004-2834a107 → 14.0.0--preview004-27d9edfc
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 +27 -7
- package/dist-cms/mocks/data/data-type.data.js +1 -1
- package/dist-cms/packages/core/components/input-tiny-mce/input-tiny-mce.element.d.ts +1 -0
- package/dist-cms/packages/core/components/input-tiny-mce/input-tiny-mce.element.js +61 -2
- package/dist-cms/packages/core/modal/common/link-picker/link-picker-modal.element.d.ts +2 -0
- package/dist-cms/packages/core/modal/common/link-picker/link-picker-modal.element.js +81 -39
- package/dist-cms/packages/core/property-editor/schemas/Umbraco.RichText.js +1 -1
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/dimensions/property-editor-ui-tiny-mce-dimensions-configuration.element.js +13 -3
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/manifests.js +4 -4
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.d.ts +6 -0
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.js +46 -5
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.js +6 -6
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/manifests.js +1 -1
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.js +2 -2
- package/dist-cms/packages/templating/stylesheets/repository/sources/stylesheet.server.data.d.ts +6 -0
- package/dist-cms/packages/templating/stylesheets/repository/sources/stylesheet.server.data.js +8 -0
- package/dist-cms/packages/templating/stylesheets/repository/stylesheet.repository.d.ts +2 -1
- package/dist-cms/packages/templating/stylesheets/repository/stylesheet.repository.js +3 -0
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +2 -2
- package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-workspace-view-code-editor.element.d.ts +1 -1
- package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-workspace-view-code-editor.element.js +3 -4
- package/dist-cms/packages/templating/stylesheets/workspace/views/rich-text-editor/stylesheet-workspace-view-rich-text-editor-rule.element.js +2 -2
- package/dist-cms/packages/templating/stylesheets/workspace/views/rich-text-editor/stylesheet-workspace-view-rich-text-editor-style-sidebar.element.js +2 -2
- package/dist-cms/packages/templating/stylesheets/workspace/views/rich-text-editor/stylesheet-workspace-view-rich-text-editor.element.d.ts +1 -1
- package/dist-cms/packages/templating/stylesheets/workspace/views/rich-text-editor/stylesheet-workspace-view-rich-text-editor.element.js +3 -4
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +9 -5
- package/package.json +1 -1
|
@@ -2428,6 +2428,16 @@
|
|
|
2428
2428
|
"name": "umb-link-picker-modal",
|
|
2429
2429
|
"path": "./../src/packages/core/modal/common/link-picker/link-picker-modal.element.ts",
|
|
2430
2430
|
"properties": [
|
|
2431
|
+
{
|
|
2432
|
+
"name": "documentExpand",
|
|
2433
|
+
"type": "boolean",
|
|
2434
|
+
"default": "false"
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
"name": "mediaExpanded",
|
|
2438
|
+
"type": "boolean",
|
|
2439
|
+
"default": "false"
|
|
2440
|
+
},
|
|
2431
2441
|
{
|
|
2432
2442
|
"name": "styles",
|
|
2433
2443
|
"type": "array",
|
|
@@ -3864,11 +3874,21 @@
|
|
|
3864
3874
|
"type": "never[]",
|
|
3865
3875
|
"default": "[]"
|
|
3866
3876
|
},
|
|
3877
|
+
{
|
|
3878
|
+
"name": "stylesheetList",
|
|
3879
|
+
"type": "array",
|
|
3880
|
+
"default": "[]"
|
|
3881
|
+
},
|
|
3867
3882
|
{
|
|
3868
3883
|
"name": "styles",
|
|
3869
3884
|
"type": "array",
|
|
3870
3885
|
"default": "[\"UmbTextStyles\",null]"
|
|
3871
3886
|
}
|
|
3887
|
+
],
|
|
3888
|
+
"events": [
|
|
3889
|
+
{
|
|
3890
|
+
"name": "property-value-change"
|
|
3891
|
+
}
|
|
3872
3892
|
]
|
|
3873
3893
|
},
|
|
3874
3894
|
{
|
|
@@ -7588,7 +7608,7 @@
|
|
|
7588
7608
|
{
|
|
7589
7609
|
"name": "styles",
|
|
7590
7610
|
"type": "array",
|
|
7591
|
-
"default": "[\"
|
|
7611
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
7592
7612
|
}
|
|
7593
7613
|
]
|
|
7594
7614
|
},
|
|
@@ -7620,8 +7640,8 @@
|
|
|
7620
7640
|
"properties": [
|
|
7621
7641
|
{
|
|
7622
7642
|
"name": "styles",
|
|
7623
|
-
"type": "
|
|
7624
|
-
"default": "[\"
|
|
7643
|
+
"type": "array",
|
|
7644
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
7625
7645
|
}
|
|
7626
7646
|
]
|
|
7627
7647
|
},
|
|
@@ -7642,7 +7662,7 @@
|
|
|
7642
7662
|
{
|
|
7643
7663
|
"name": "styles",
|
|
7644
7664
|
"type": "array",
|
|
7645
|
-
"default": "[\"
|
|
7665
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
7646
7666
|
}
|
|
7647
7667
|
]
|
|
7648
7668
|
},
|
|
@@ -7653,7 +7673,7 @@
|
|
|
7653
7673
|
{
|
|
7654
7674
|
"name": "styles",
|
|
7655
7675
|
"type": "array",
|
|
7656
|
-
"default": "[\"
|
|
7676
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
7657
7677
|
}
|
|
7658
7678
|
]
|
|
7659
7679
|
},
|
|
@@ -7673,8 +7693,8 @@
|
|
|
7673
7693
|
},
|
|
7674
7694
|
{
|
|
7675
7695
|
"name": "styles",
|
|
7676
|
-
"type": "
|
|
7677
|
-
"default": "[\"
|
|
7696
|
+
"type": "array",
|
|
7697
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
7678
7698
|
}
|
|
7679
7699
|
]
|
|
7680
7700
|
},
|
|
@@ -507,7 +507,7 @@ export const data = [
|
|
|
507
507
|
name: 'Rich Text Editor',
|
|
508
508
|
id: 'dt-richTextEditor',
|
|
509
509
|
parentId: null,
|
|
510
|
-
propertyEditorAlias: 'Umbraco.
|
|
510
|
+
propertyEditorAlias: 'Umbraco.RichText',
|
|
511
511
|
propertyEditorUiAlias: 'Umb.PropertyEditorUi.TinyMCE',
|
|
512
512
|
values: [
|
|
513
513
|
{
|
|
@@ -11,6 +11,7 @@ export declare class UmbInputTinyMceElement extends UmbInputTinyMceElement_base
|
|
|
11
11
|
constructor();
|
|
12
12
|
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): Promise<void>;
|
|
13
13
|
disconnectedCallback(): void;
|
|
14
|
+
getFormatStyles(stylesheetPath: Array<string>): Promise<any[]>;
|
|
14
15
|
/**
|
|
15
16
|
* Nothing rendered by default - TinyMCE initialisation creates
|
|
16
17
|
* a target div and binds the RTE to that element
|
|
@@ -16,6 +16,8 @@ import { css, customElement, html, property, query, state, } from '../../../../e
|
|
|
16
16
|
import { firstValueFrom } from '../../../../external/rxjs/index.js';
|
|
17
17
|
import { UmbMediaHelper } from '../../../../shared/utils/index.js';
|
|
18
18
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
19
|
+
import { UMB_APP } from '../../../../apps/app/index.js';
|
|
20
|
+
import { UmbStylesheetRepository } from '../../../templating/stylesheets/index.js';
|
|
19
21
|
// TODO => integrate macro picker, update stylesheet fetch when backend CLI exists (ref tinymce.service.js in existing backoffice)
|
|
20
22
|
export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormControlMixin(UmbLitElement) {
|
|
21
23
|
#mediaHelper;
|
|
@@ -23,6 +25,8 @@ export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormCon
|
|
|
23
25
|
#auth;
|
|
24
26
|
#plugins;
|
|
25
27
|
#editorRef;
|
|
28
|
+
#stylesheetRepository;
|
|
29
|
+
#serverUrl;
|
|
26
30
|
getFormElement() {
|
|
27
31
|
return this._editorElement?.querySelector('iframe') ?? undefined;
|
|
28
32
|
}
|
|
@@ -32,6 +36,10 @@ export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormCon
|
|
|
32
36
|
this.#mediaHelper = new UmbMediaHelper();
|
|
33
37
|
this.#plugins = [];
|
|
34
38
|
this.#editorRef = null;
|
|
39
|
+
this.consumeContext(UMB_APP, (instance) => {
|
|
40
|
+
this.#serverUrl = instance.getServerUrl();
|
|
41
|
+
});
|
|
42
|
+
this.#stylesheetRepository = new UmbStylesheetRepository(this);
|
|
35
43
|
// TODO => this breaks tests, removing for now will ignore user language
|
|
36
44
|
// and fall back to tinymce default language
|
|
37
45
|
// this.consumeContext(UMB_AUTH, (instance) => {
|
|
@@ -72,6 +80,54 @@ export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormCon
|
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
}
|
|
83
|
+
async getFormatStyles(stylesheetPath) {
|
|
84
|
+
const rules = [];
|
|
85
|
+
stylesheetPath.forEach((path) => {
|
|
86
|
+
//TODO => Legacy path?
|
|
87
|
+
/**
|
|
88
|
+
* if (val.indexOf(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/") === 0) {
|
|
89
|
+
// current format (full path to stylesheet)
|
|
90
|
+
stylesheets.push(val);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// legacy format (stylesheet name only) - must prefix with stylesheet folder and postfix with ".css"
|
|
94
|
+
stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + val + ".css");
|
|
95
|
+
}
|
|
96
|
+
*/
|
|
97
|
+
this.#stylesheetRepository?.getStylesheetRules(path).then(({ data }) => {
|
|
98
|
+
data?.rules?.forEach((rule) => {
|
|
99
|
+
const r = {
|
|
100
|
+
title: rule.name,
|
|
101
|
+
};
|
|
102
|
+
if (!rule.selector)
|
|
103
|
+
return;
|
|
104
|
+
if (rule.selector.startsWith('.')) {
|
|
105
|
+
r.inline = 'span';
|
|
106
|
+
r.classes = rule.selector.substring(1);
|
|
107
|
+
}
|
|
108
|
+
else if (rule.selector.startsWith('#')) {
|
|
109
|
+
r.inline = 'span';
|
|
110
|
+
r.attributes = { id: rule.selector.substring(1) };
|
|
111
|
+
}
|
|
112
|
+
else if (rule.selector.includes('.')) {
|
|
113
|
+
const [block, ...classes] = rule.selector.split('.');
|
|
114
|
+
r.block = block;
|
|
115
|
+
r.classes = classes.join(' ').replace(/\./g, ' ');
|
|
116
|
+
}
|
|
117
|
+
else if (rule.selector.includes('#')) {
|
|
118
|
+
const [block, id] = rule.selector.split('#');
|
|
119
|
+
r.block = block;
|
|
120
|
+
r.classes = id;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
r.block = rule.selector;
|
|
124
|
+
}
|
|
125
|
+
rules.push(r);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
return rules;
|
|
130
|
+
}
|
|
75
131
|
async #setTinyConfig() {
|
|
76
132
|
// create an object by merging the configuration onto the fallback config
|
|
77
133
|
// TODO: Seems like a too tight coupling between DataTypeConfigCollection and TinyMceConfig, I would love it begin more explicit what we take from DataTypeConfigCollection and parse on, but I understand that this gives some flexibility. Is this flexibility on purpose?
|
|
@@ -79,6 +135,9 @@ export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormCon
|
|
|
79
135
|
...defaultFallbackConfig,
|
|
80
136
|
...(this.configuration ? this.configuration?.toObject() : {}),
|
|
81
137
|
};
|
|
138
|
+
// Map the stylesheets with server url
|
|
139
|
+
const stylesheets = configurationOptions.stylesheets.map((stylesheetPath) => `${this.#serverUrl}/css/${stylesheetPath.replace(/\\/g, '/')}`);
|
|
140
|
+
const styleFormats = await this.getFormatStyles(configurationOptions.stylesheets);
|
|
82
141
|
// no auto resize when a fixed height is set
|
|
83
142
|
if (!configurationOptions.dimensions?.height) {
|
|
84
143
|
configurationOptions.plugins ??= [];
|
|
@@ -104,13 +163,13 @@ export let UmbInputTinyMceElement = class UmbInputTinyMceElement extends FormCon
|
|
|
104
163
|
// extend with configuration values
|
|
105
164
|
this._tinyConfig = {
|
|
106
165
|
...this._tinyConfig,
|
|
107
|
-
content_css:
|
|
166
|
+
content_css: stylesheets,
|
|
167
|
+
style_formats: styleFormats || defaultStyleFormats,
|
|
108
168
|
extended_valid_elements: defaultExtendedValidElements,
|
|
109
169
|
height: configurationOptions.height ?? 500,
|
|
110
170
|
invalid_elements: configurationOptions.invalidElements,
|
|
111
171
|
plugins: configurationOptions.plugins.map((x) => x.name),
|
|
112
172
|
toolbar: configurationOptions.toolbar.join(' '),
|
|
113
|
-
style_formats: defaultStyleFormats,
|
|
114
173
|
valid_elements: configurationOptions.validElements,
|
|
115
174
|
width: configurationOptions.width,
|
|
116
175
|
};
|
|
@@ -4,6 +4,8 @@ export declare class UmbLinkPickerModalElement extends UmbModalBaseElement<UmbLi
|
|
|
4
4
|
_index: number | null;
|
|
5
5
|
_link: UmbLinkPickerLink;
|
|
6
6
|
_layout: UmbLinkPickerConfig;
|
|
7
|
+
documentExpand: boolean;
|
|
8
|
+
mediaExpanded: boolean;
|
|
7
9
|
private _linkInput;
|
|
8
10
|
private _linkQueryInput?;
|
|
9
11
|
private _linkTitleInput;
|
|
@@ -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, html, nothing, customElement, query, state } from '../../../../../external/lit/index.js';
|
|
7
|
+
import { css, html, nothing, customElement, query, state, styleMap } from '../../../../../external/lit/index.js';
|
|
8
8
|
import { UmbModalBaseElement, } from '../../index.js';
|
|
9
9
|
import { buildUdi, getKeyFromUdi } from '../../../../../shared/utils/index.js';
|
|
10
10
|
export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends UmbModalBaseElement {
|
|
@@ -25,6 +25,8 @@ export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends U
|
|
|
25
25
|
hideAnchor: false,
|
|
26
26
|
ignoreUserStartNodes: false,
|
|
27
27
|
};
|
|
28
|
+
this.documentExpand = false;
|
|
29
|
+
this.mediaExpanded = false;
|
|
28
30
|
}
|
|
29
31
|
connectedCallback() {
|
|
30
32
|
super.connectedCallback();
|
|
@@ -41,20 +43,33 @@ export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends U
|
|
|
41
43
|
if (!this._linkQueryInput)
|
|
42
44
|
return;
|
|
43
45
|
const query = this._linkQueryInput.value;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
if (query.startsWith('#') || query.startsWith('?')) {
|
|
47
|
+
this._link.queryString = query;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (query.includes('=')) {
|
|
51
|
+
this._link.queryString = `?${query}`;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this._link.queryString = `#${query}`;
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
_handleSelectionChange(e, entityType) {
|
|
48
58
|
//TODO: Update icon, published, trashed
|
|
49
59
|
e.stopPropagation();
|
|
50
60
|
const element = e.target;
|
|
51
61
|
const selectedKey = element.selection[element.selection.length - 1];
|
|
52
|
-
if (!selectedKey)
|
|
62
|
+
if (!selectedKey) {
|
|
63
|
+
this._link.url = '';
|
|
64
|
+
this._link.udi = undefined;
|
|
65
|
+
this._selectedKey = undefined;
|
|
66
|
+
this.requestUpdate();
|
|
53
67
|
return;
|
|
68
|
+
}
|
|
54
69
|
const udi = buildUdi(entityType, selectedKey);
|
|
55
70
|
this._selectedKey = selectedKey;
|
|
56
71
|
this._link.udi = udi;
|
|
57
|
-
this._link.url = udi;
|
|
72
|
+
this._link.url = udi;
|
|
58
73
|
this.requestUpdate();
|
|
59
74
|
}
|
|
60
75
|
_submit() {
|
|
@@ -69,21 +84,21 @@ export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends U
|
|
|
69
84
|
<uui-box>
|
|
70
85
|
<div class="url-link">${this._renderLinkUrlInput()} ${this._renderAnchorInput()}</div>
|
|
71
86
|
|
|
72
|
-
<uui-label for="link-title-input"
|
|
87
|
+
<uui-label for="link-title-input">${this.localize.term('defaultdialogs_nodeNameLinkPicker')}</uui-label>
|
|
73
88
|
<uui-input
|
|
74
89
|
id="link-title-input"
|
|
75
|
-
placeholder
|
|
76
|
-
label
|
|
90
|
+
placeholder=${this.localize.term('defaultdialogs_nodeNameLinkPicker')}
|
|
91
|
+
label=${this.localize.term('defaultdialogs_nodeNameLinkPicker')}
|
|
77
92
|
@input=${() => (this._link.name = this._linkTitleInput.value)}
|
|
78
93
|
.value="${this._link.name ?? ''}"></uui-input>
|
|
79
94
|
|
|
80
|
-
<uui-label
|
|
95
|
+
<uui-label>${this.localize.term('content_target')}</uui-label>
|
|
81
96
|
<uui-toggle
|
|
82
97
|
id="#target-toggle"
|
|
83
|
-
label
|
|
98
|
+
label=${this.localize.term('defaultdialogs_openInNewWindow')}
|
|
84
99
|
.checked="${this._link.target === '_blank' ? true : false}"
|
|
85
100
|
@change="${(e) => e.target.checked ? (this._link.target = '_blank') : (this._link.target = '')}">
|
|
86
|
-
|
|
101
|
+
${this.localize.term('defaultdialogs_openInNewWindow')}
|
|
87
102
|
</uui-toggle>
|
|
88
103
|
|
|
89
104
|
<hr />
|
|
@@ -91,57 +106,78 @@ export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends U
|
|
|
91
106
|
${this._renderTrees()}
|
|
92
107
|
</uui-box>
|
|
93
108
|
<div slot="actions">
|
|
94
|
-
<uui-button label
|
|
95
|
-
<uui-button
|
|
109
|
+
<uui-button label=${this.localize.term('general_close')} @click=${this._close}></uui-button>
|
|
110
|
+
<uui-button
|
|
111
|
+
label=${this.localize.term('general_submit')}
|
|
112
|
+
look="primary"
|
|
113
|
+
color="positive"
|
|
114
|
+
@click=${this._submit}></uui-button>
|
|
96
115
|
</div>
|
|
97
116
|
</umb-body-layout>
|
|
98
117
|
`;
|
|
99
118
|
}
|
|
100
119
|
_renderLinkUrlInput() {
|
|
101
120
|
return html `<span>
|
|
102
|
-
<uui-label for="link-input"
|
|
121
|
+
<uui-label for="link-input">${this.localize.term('defaultdialogs_link')}</uui-label>
|
|
103
122
|
<uui-input
|
|
104
123
|
id="link-input"
|
|
105
|
-
placeholder
|
|
106
|
-
label
|
|
124
|
+
placeholder=${this.localize.term('general_url')}
|
|
125
|
+
label=${this.localize.term('general_url')}
|
|
107
126
|
.value="${this._link.udi ?? this._link.url ?? ''}"
|
|
108
127
|
@input=${() => (this._link.url = this._linkInput.value)}
|
|
109
|
-
|
|
128
|
+
?disabled="${this._link.udi ? true : false}"></uui-input>
|
|
110
129
|
</span>`;
|
|
111
130
|
}
|
|
112
131
|
_renderAnchorInput() {
|
|
113
132
|
if (this._layout.hideAnchor)
|
|
114
133
|
return nothing;
|
|
115
134
|
return html `<span>
|
|
116
|
-
<uui-label for="anchor-input"
|
|
135
|
+
<uui-label for="anchor-input">${this.localize.term('defaultdialogs_anchorLinkPicker')}</uui-label>
|
|
117
136
|
<uui-input
|
|
118
137
|
id="anchor-input"
|
|
119
|
-
placeholder
|
|
120
|
-
label
|
|
138
|
+
placeholder=${this.localize.term('placeholders_anchor')}
|
|
139
|
+
label=${this.localize.term('placeholders_anchor')}
|
|
121
140
|
@input=${this._handleQueryString}
|
|
122
141
|
.value="${this._link.queryString ?? ''}"></uui-input>
|
|
123
142
|
</span>`;
|
|
124
143
|
}
|
|
125
144
|
_renderTrees() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
//TODO: Make search work
|
|
146
|
+
return html `
|
|
147
|
+
<uui-symbol-expand
|
|
148
|
+
id="document-expand"
|
|
149
|
+
@click=${() => (this.documentExpand = !this.documentExpand)}
|
|
150
|
+
.open=${!this.documentExpand}></uui-symbol-expand>
|
|
151
|
+
<uui-label for="document-expand">${this.localize.term('defaultdialogs_linkToPage')}</uui-label>
|
|
152
|
+
<div style="${styleMap({ display: !this.documentExpand ? 'block' : 'none' })}">
|
|
153
|
+
<uui-input
|
|
154
|
+
id="search-input"
|
|
155
|
+
placeholder=${this.localize.term('placeholders_search')}
|
|
156
|
+
label=${this.localize.term('placeholders_search')}></uui-input>
|
|
157
|
+
<umb-tree
|
|
158
|
+
?hide-tree-root=${true}
|
|
159
|
+
?multiple=${false}
|
|
160
|
+
alias="Umb.Tree.Documents"
|
|
161
|
+
@selection-change=${(event) => this._handleSelectionChange(event, 'document')}
|
|
162
|
+
.selection=${[this._selectedKey ?? '']}
|
|
163
|
+
selectable></umb-tree>
|
|
164
|
+
</div>
|
|
135
165
|
<hr />
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
166
|
+
<uui-symbol-expand
|
|
167
|
+
id="media-expand"
|
|
168
|
+
@click=${() => (this.mediaExpanded = !this.mediaExpanded)}
|
|
169
|
+
.open=${!this.mediaExpanded}></uui-symbol-expand>
|
|
170
|
+
<uui-label for="media-expand">${this.localize.term('defaultdialogs_linkToMedia')}</uui-label>
|
|
171
|
+
<div style="${styleMap({ display: !this.mediaExpanded ? 'block' : 'none' })}">
|
|
172
|
+
<umb-tree
|
|
173
|
+
?hide-tree-root=${true}
|
|
174
|
+
?multiple=${false}
|
|
175
|
+
alias="Umb.Tree.Media"
|
|
176
|
+
@selection-change=${(event) => this._handleSelectionChange(event, 'media')}
|
|
177
|
+
.selection=${[this._selectedKey ?? '']}
|
|
178
|
+
selectable></umb-tree>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
145
181
|
}
|
|
146
182
|
static { this.styles = [
|
|
147
183
|
css `
|
|
@@ -157,7 +193,7 @@ export let UmbLinkPickerModalElement = class UmbLinkPickerModalElement extends U
|
|
|
157
193
|
width: 100%;
|
|
158
194
|
}
|
|
159
195
|
|
|
160
|
-
uui-input,
|
|
196
|
+
uui-input:not(#search-input),
|
|
161
197
|
uui-label {
|
|
162
198
|
margin-bottom: var(--uui-size-space-6);
|
|
163
199
|
}
|
|
@@ -188,6 +224,12 @@ __decorate([
|
|
|
188
224
|
__decorate([
|
|
189
225
|
state()
|
|
190
226
|
], UmbLinkPickerModalElement.prototype, "_layout", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
state()
|
|
229
|
+
], UmbLinkPickerModalElement.prototype, "documentExpand", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
state()
|
|
232
|
+
], UmbLinkPickerModalElement.prototype, "mediaExpanded", void 0);
|
|
191
233
|
__decorate([
|
|
192
234
|
query('#link-input')
|
|
193
235
|
], UmbLinkPickerModalElement.prototype, "_linkInput", void 0);
|
|
@@ -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 { UmbTextStyles } from
|
|
7
|
+
import { UmbTextStyles } from '../../../../../../../shared/style/index.js';
|
|
8
8
|
import { customElement, html, property } from '../../../../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../../../shared/lit-element/index.js';
|
|
10
10
|
/**
|
|
@@ -16,8 +16,18 @@ export let UmbPropertyEditorUITinyMceDimensionsConfigurationElement = class UmbP
|
|
|
16
16
|
this.value = {};
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return html `<uui-input
|
|
20
|
-
|
|
19
|
+
return html `<uui-input
|
|
20
|
+
type="number"
|
|
21
|
+
label=${this.localize.term('general_width')}
|
|
22
|
+
placeholder=${this.localize.term('general_width')}
|
|
23
|
+
.value=${this.value?.width}></uui-input>
|
|
24
|
+
x
|
|
25
|
+
<uui-input
|
|
26
|
+
type="number"
|
|
27
|
+
label=${this.localize.term('general_height')}
|
|
28
|
+
placeholder=${this.localize.term('general_height')}
|
|
29
|
+
.value=${this.value?.height}></uui-input>
|
|
30
|
+
pixels`;
|
|
21
31
|
}
|
|
22
32
|
static { this.styles = [UmbTextStyles]; }
|
|
23
33
|
};
|
|
@@ -6,7 +6,7 @@ const configurationManifests = [
|
|
|
6
6
|
loader: () => import('./toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.js'),
|
|
7
7
|
meta: {
|
|
8
8
|
label: 'TinyMCE Toolbar Configuration',
|
|
9
|
-
propertyEditorSchemaAlias: 'Umbraco.
|
|
9
|
+
propertyEditorSchemaAlias: 'Umbraco.RichText.Configuration',
|
|
10
10
|
icon: 'umb:autofill',
|
|
11
11
|
group: 'common',
|
|
12
12
|
},
|
|
@@ -18,7 +18,7 @@ const configurationManifests = [
|
|
|
18
18
|
loader: () => import('./stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.js'),
|
|
19
19
|
meta: {
|
|
20
20
|
label: 'TinyMCE Stylesheets Configuration',
|
|
21
|
-
propertyEditorSchemaAlias: 'Umbraco.
|
|
21
|
+
propertyEditorSchemaAlias: 'Umbraco.RichText.Configuration',
|
|
22
22
|
icon: 'umb:autofill',
|
|
23
23
|
group: 'common',
|
|
24
24
|
},
|
|
@@ -30,7 +30,7 @@ const configurationManifests = [
|
|
|
30
30
|
loader: () => import('./dimensions/property-editor-ui-tiny-mce-dimensions-configuration.element.js'),
|
|
31
31
|
meta: {
|
|
32
32
|
label: 'TinyMCE Dimensions Configuration',
|
|
33
|
-
propertyEditorSchemaAlias: 'Umbraco.
|
|
33
|
+
propertyEditorSchemaAlias: 'Umbraco.RichText.Configuration',
|
|
34
34
|
icon: 'umb:autofill',
|
|
35
35
|
group: 'common',
|
|
36
36
|
},
|
|
@@ -42,7 +42,7 @@ const configurationManifests = [
|
|
|
42
42
|
loader: () => import('./max-image-size/property-editor-ui-tiny-mce-maximagesize-configuration.element.js'),
|
|
43
43
|
meta: {
|
|
44
44
|
label: 'TinyMCE Max Image Size Configuration',
|
|
45
|
-
propertyEditorSchemaAlias: 'Umbraco.
|
|
45
|
+
propertyEditorSchemaAlias: 'Umbraco.RichText.Configuration',
|
|
46
46
|
icon: 'umb:autofill',
|
|
47
47
|
group: 'common',
|
|
48
48
|
},
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { UmbLitElement } from '../../../../../../../shared/lit-element/index.js';
|
|
2
|
+
import { StylesheetOverviewResponseModel } from '../../../../../../../external/backend-api/index.js';
|
|
2
3
|
/**
|
|
3
4
|
* @element umb-property-editor-ui-tiny-mce-stylesheets-configuration
|
|
4
5
|
*/
|
|
5
6
|
export declare class UmbPropertyEditorUITinyMceStylesheetsConfigurationElement extends UmbLitElement {
|
|
7
|
+
#private;
|
|
6
8
|
value: string[];
|
|
7
9
|
config: never[];
|
|
10
|
+
stylesheetList: Array<StylesheetOverviewResponseModel & Partial<{
|
|
11
|
+
selected: boolean;
|
|
12
|
+
}>>;
|
|
13
|
+
constructor();
|
|
8
14
|
render(): import("lit-html").TemplateResult<1>;
|
|
9
15
|
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
10
16
|
}
|
|
@@ -4,21 +4,59 @@ 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 { UmbTextStyles } from
|
|
8
|
-
import { css, customElement, html, property } from '../../../../../../../external/lit/index.js';
|
|
7
|
+
import { UmbTextStyles } from '../../../../../../../shared/style/index.js';
|
|
8
|
+
import { css, customElement, html, property, state } from '../../../../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../../../shared/lit-element/index.js';
|
|
10
|
+
import { UmbStylesheetRepository } from '../../../../../../templating/stylesheets/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* @element umb-property-editor-ui-tiny-mce-stylesheets-configuration
|
|
12
13
|
*/
|
|
13
14
|
export let UmbPropertyEditorUITinyMceStylesheetsConfigurationElement = class UmbPropertyEditorUITinyMceStylesheetsConfigurationElement extends UmbLitElement {
|
|
15
|
+
#repository;
|
|
14
16
|
constructor() {
|
|
15
|
-
super(
|
|
17
|
+
super();
|
|
16
18
|
this.value = [];
|
|
17
19
|
this.config = [];
|
|
20
|
+
this.stylesheetList = [];
|
|
21
|
+
this.#repository = new UmbStylesheetRepository(this);
|
|
22
|
+
this.#getAllStylesheets();
|
|
23
|
+
}
|
|
24
|
+
async #getAllStylesheets() {
|
|
25
|
+
const { data } = await this.#repository.getAll();
|
|
26
|
+
if (!data)
|
|
27
|
+
return;
|
|
28
|
+
const styles = data.items;
|
|
29
|
+
this.stylesheetList = styles.map((stylesheet) => ({
|
|
30
|
+
...stylesheet,
|
|
31
|
+
selected: this.value?.some((path) => path === stylesheet.path),
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
#onChange(event) {
|
|
35
|
+
const checkbox = event.target;
|
|
36
|
+
if (checkbox.checked) {
|
|
37
|
+
if (this.value) {
|
|
38
|
+
this.value = [...this.value, checkbox.value];
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.value = [checkbox.value];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.value = this.value.filter((v) => v !== checkbox.value);
|
|
46
|
+
}
|
|
47
|
+
this.dispatchEvent(new CustomEvent('property-value-change'));
|
|
18
48
|
}
|
|
19
49
|
render() {
|
|
20
50
|
return html `<ul>
|
|
21
|
-
${this.
|
|
51
|
+
${this.stylesheetList.map((stylesheet) => html `<li>
|
|
52
|
+
<uui-checkbox
|
|
53
|
+
.label=${stylesheet.name}
|
|
54
|
+
.value=${stylesheet.path ?? ''}
|
|
55
|
+
@change=${this.#onChange}
|
|
56
|
+
?checked=${stylesheet.selected}>
|
|
57
|
+
${stylesheet.name}
|
|
58
|
+
</uui-checkbox>
|
|
59
|
+
</li>`)}
|
|
22
60
|
</ul>`;
|
|
23
61
|
}
|
|
24
62
|
static { this.styles = [
|
|
@@ -33,11 +71,14 @@ export let UmbPropertyEditorUITinyMceStylesheetsConfigurationElement = class Umb
|
|
|
33
71
|
]; }
|
|
34
72
|
};
|
|
35
73
|
__decorate([
|
|
36
|
-
property()
|
|
74
|
+
property({ type: Array })
|
|
37
75
|
], UmbPropertyEditorUITinyMceStylesheetsConfigurationElement.prototype, "value", void 0);
|
|
38
76
|
__decorate([
|
|
39
77
|
property({ type: Array, attribute: false })
|
|
40
78
|
], UmbPropertyEditorUITinyMceStylesheetsConfigurationElement.prototype, "config", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
state()
|
|
81
|
+
], UmbPropertyEditorUITinyMceStylesheetsConfigurationElement.prototype, "stylesheetList", void 0);
|
|
41
82
|
UmbPropertyEditorUITinyMceStylesheetsConfigurationElement = __decorate([
|
|
42
83
|
customElement('umb-property-editor-ui-tiny-mce-stylesheets-configuration')
|
|
43
84
|
], UmbPropertyEditorUITinyMceStylesheetsConfigurationElement);
|
|
@@ -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 { UmbTextStyles } from
|
|
7
|
+
import { UmbTextStyles } from '../../../../../../../shared/style/index.js';
|
|
8
8
|
import { customElement, css, html, property, map, state } from '../../../../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../../../shared/lit-element/index.js';
|
|
10
10
|
import { umbExtensionsRegistry } from '../../../../../extension-registry/index.js';
|
|
@@ -89,11 +89,11 @@ export let UmbPropertyEditorUITinyMceToolbarConfigurationElement = class UmbProp
|
|
|
89
89
|
render() {
|
|
90
90
|
return html `<ul>
|
|
91
91
|
${map(this._toolbarConfig, (v) => html `<li>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
<uui-checkbox label=${v.label} value=${v.alias} ?checked=${v.selected} @change=${this.onChange}>
|
|
93
|
+
<uui-icon .svg=${tinyIconSet?.icons[v.icon ?? 'alignjustify']}></uui-icon>
|
|
94
|
+
${v.label}
|
|
95
|
+
</uui-checkbox>
|
|
96
|
+
</li>`)}
|
|
97
97
|
</ul>`;
|
|
98
98
|
}
|
|
99
99
|
static { this.styles = [
|
|
@@ -6,7 +6,7 @@ const manifest = {
|
|
|
6
6
|
loader: () => import('./property-editor-ui-tiny-mce.element.js'),
|
|
7
7
|
meta: {
|
|
8
8
|
label: 'Rich Text Editor',
|
|
9
|
-
propertyEditorSchemaAlias: 'Umbraco.
|
|
9
|
+
propertyEditorSchemaAlias: 'Umbraco.RichText',
|
|
10
10
|
icon: 'umb:browser-window',
|
|
11
11
|
group: 'richText',
|
|
12
12
|
settings: {
|