@umbraco-cms/backoffice 14.0.0-1c3e1277 → 14.0.0-1ebba150
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 +94 -35
- package/dist-cms/external/uui/index.js +210 -702
- package/dist-cms/mocks/data/template.data.d.ts +5 -23
- package/dist-cms/mocks/data/template.data.js +44 -21
- package/dist-cms/mocks/handlers/template.handlers.js +4 -0
- package/dist-cms/packages/core/components/button-with-dropdown/button-with-dropdown.element.d.ts +2 -0
- package/dist-cms/packages/core/components/button-with-dropdown/button-with-dropdown.element.js +4 -4
- package/dist-cms/packages/core/components/code-block/code-block.element.d.ts +6 -1
- package/dist-cms/packages/core/components/code-block/code-block.element.js +93 -19
- package/dist-cms/packages/core/components/index.d.ts +1 -0
- package/dist-cms/packages/core/components/index.js +1 -1
- package/dist-cms/packages/core/modal/token/dictionary-item-picker-modal.token.d.ts +0 -1
- package/dist-cms/packages/core/modal/token/dictionary-item-picker-modal.token.js +1 -2
- package/dist-cms/packages/core/tree/tree.context.js +8 -11
- package/dist-cms/packages/templating/components/insert-menu/templating-insert-menu.element.js +3 -31
- package/dist-cms/packages/templating/modals/insert-choose-type-sidebar.element.d.ts +2 -4
- package/dist-cms/packages/templating/modals/insert-choose-type-sidebar.element.js +5 -27
- package/dist-cms/packages/templating/modals/insert-section-modal/insert-section-input.element.js +1 -0
- package/dist-cms/packages/templating/modals/insert-section-modal/insert-section-modal.element.js +5 -4
- package/dist-cms/packages/templating/modals/manifests.d.ts +0 -1
- package/dist-cms/packages/templating/modals/manifests.js +0 -7
- package/dist-cms/packages/templating/templates/components/alias-input/alias-input.js +1 -1
- package/dist-cms/packages/templating/templates/index.d.ts +2 -0
- package/dist-cms/packages/templating/templates/index.js +2 -0
- package/dist-cms/packages/templating/templates/manifests.d.ts +1 -1
- package/dist-cms/packages/templating/templates/manifests.js +2 -0
- package/dist-cms/packages/templating/templates/modals/manifests.d.ts +3 -0
- package/dist-cms/packages/templating/templates/modals/manifests.js +10 -0
- package/dist-cms/packages/templating/templates/modals/modal-tokens.d.ts +3 -0
- package/dist-cms/packages/templating/templates/modals/modal-tokens.js +6 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder-filter.element.d.ts +24 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder-filter.element.js +156 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +28 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +277 -0
- package/dist-cms/packages/templating/templates/repository/sources/template.query-builder.server.data.d.ts +33 -0
- package/dist-cms/packages/templating/templates/repository/sources/template.query-builder.server.data.js +37 -0
- package/dist-cms/packages/templating/templates/repository/template.repository.d.ts +11 -7
- package/dist-cms/packages/templating/templates/repository/template.repository.js +28 -14
- package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.js +21 -3
- package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +2 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.d.ts +1 -0
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.js +2 -1
- package/dist-cms/tinymce/langs/nb_NO.js +62 -62
- package/dist-cms/tinymce/langs/uz.js +406 -0
- package/dist-cms/tsconfig.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +40 -7
- package/package.json +3 -3
- package/dist-cms/packages/templating/modals/insert-value-sidebar.element.d.ts +0 -19
- package/dist-cms/packages/templating/modals/insert-value-sidebar.element.js +0 -135
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
import { UmbEntityData } from './entity.data.js';
|
|
2
|
-
import { EntityTreeItemResponseModel, PagedEntityTreeItemResponseModel, TemplateResponseModel, TemplateScaffoldResponseModel, CreateTemplateRequestModel, TemplateItemResponseModel } from '../../external/backend-api/index.js';
|
|
2
|
+
import { EntityTreeItemResponseModel, PagedEntityTreeItemResponseModel, TemplateResponseModel, TemplateScaffoldResponseModel, CreateTemplateRequestModel, TemplateItemResponseModel, TemplateQuerySettingsResponseModel, TemplateQueryResultResponseModel } from '../../external/backend-api/index.js';
|
|
3
3
|
type TemplateDBItem = TemplateResponseModel & EntityTreeItemResponseModel;
|
|
4
4
|
export declare const data: Array<TemplateDBItem>;
|
|
5
5
|
export declare const createTemplateScaffold: (masterTemplateAlias: string) => string;
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
properties: {
|
|
9
|
-
alias: string;
|
|
10
|
-
type: string;
|
|
11
|
-
}[];
|
|
12
|
-
operators: {
|
|
13
|
-
operator: string;
|
|
14
|
-
applicableTypes: string[];
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
6
|
+
export declare const templateQueryResult: TemplateQueryResultResponseModel;
|
|
7
|
+
export declare const templateQuerySettings: TemplateQuerySettingsResponseModel;
|
|
17
8
|
declare class UmbTemplateData extends UmbEntityData<TemplateDBItem> {
|
|
18
9
|
constructor();
|
|
19
10
|
getById(id: string): TemplateResponseModel | undefined;
|
|
20
11
|
getItemById(id: string): TemplateItemResponseModel | null;
|
|
21
12
|
getScaffold(masterTemplateId?: string | null): TemplateScaffoldResponseModel;
|
|
22
13
|
getItems(ids: string[]): TemplateItemResponseModel[];
|
|
23
|
-
getTemplateQuerySettings: () =>
|
|
24
|
-
|
|
25
|
-
properties: {
|
|
26
|
-
alias: string;
|
|
27
|
-
type: string;
|
|
28
|
-
}[];
|
|
29
|
-
operators: {
|
|
30
|
-
operator: string;
|
|
31
|
-
applicableTypes: string[];
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
14
|
+
getTemplateQuerySettings: () => TemplateQuerySettingsResponseModel;
|
|
15
|
+
getTemplateQueryResult: () => TemplateQueryResultResponseModel;
|
|
34
16
|
create(templateData: CreateTemplateRequestModel): {
|
|
35
17
|
name?: string | undefined;
|
|
36
18
|
alias?: string | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UmbEntityData } from './entity.data.js';
|
|
2
2
|
import { createEntityTreeItem } from './utils.js';
|
|
3
3
|
import { UmbId } from '../../packages/core/id/index.js';
|
|
4
|
+
import { TemplateQueryPropertyTypeModel, OperatorModel, } from '../../external/backend-api/index.js';
|
|
4
5
|
const createTemplate = (dbItem) => {
|
|
5
6
|
return {
|
|
6
7
|
$type: '',
|
|
@@ -87,58 +88,79 @@ export const createTemplateScaffold = (masterTemplateAlias) => {
|
|
|
87
88
|
Layout = ${masterTemplateAlias};
|
|
88
89
|
}`;
|
|
89
90
|
};
|
|
91
|
+
//prettier-ignore
|
|
92
|
+
const templateQueryExpressions = [
|
|
93
|
+
`Umbraco.ContentAtRoot().FirstOrDefault()
|
|
94
|
+
.ChildrenOfType("docTypeWithTemplate")
|
|
95
|
+
.Where(x => x.IsVisible())`,
|
|
96
|
+
`Umbraco.Content(Guid.Parse("0b3498dc-255a-4d62-aa4f-ef7bff333544"))
|
|
97
|
+
.ChildrenOfType("docTypeWithTemplate")
|
|
98
|
+
.Where(x => x.IsVisible())`,
|
|
99
|
+
`Umbraco.ContentAtRoot().FirstOrDefault()
|
|
100
|
+
.ChildrenOfType("docTypeWithTemplate")
|
|
101
|
+
.Where(x => (x.Id != -6))
|
|
102
|
+
.Where(x => x.IsVisible())
|
|
103
|
+
.OrderBy(x => x.UpdateDate)`,
|
|
104
|
+
];
|
|
105
|
+
const randomIndex = () => Math.floor(Math.random() * 3);
|
|
106
|
+
export const templateQueryResult = {
|
|
107
|
+
queryExpression: templateQueryExpressions[randomIndex()],
|
|
108
|
+
sampleResults: [],
|
|
109
|
+
resultCount: 0,
|
|
110
|
+
executionTime: 0,
|
|
111
|
+
};
|
|
90
112
|
export const templateQuerySettings = {
|
|
91
|
-
contentTypeAliases: [],
|
|
113
|
+
contentTypeAliases: ['docTypeWithTemplate', 'propertyTypeWithTemplate', 'somethingElse'],
|
|
92
114
|
properties: [
|
|
93
115
|
{
|
|
94
116
|
alias: 'Id',
|
|
95
|
-
type:
|
|
117
|
+
type: TemplateQueryPropertyTypeModel.INTEGER,
|
|
96
118
|
},
|
|
97
119
|
{
|
|
98
120
|
alias: 'Name',
|
|
99
|
-
type:
|
|
121
|
+
type: TemplateQueryPropertyTypeModel.STRING,
|
|
100
122
|
},
|
|
101
123
|
{
|
|
102
124
|
alias: 'CreateDate',
|
|
103
|
-
type:
|
|
125
|
+
type: TemplateQueryPropertyTypeModel.DATE_TIME,
|
|
104
126
|
},
|
|
105
127
|
{
|
|
106
128
|
alias: 'UpdateDate',
|
|
107
|
-
type:
|
|
129
|
+
type: TemplateQueryPropertyTypeModel.DATE_TIME,
|
|
108
130
|
},
|
|
109
131
|
],
|
|
110
132
|
operators: [
|
|
111
133
|
{
|
|
112
|
-
operator:
|
|
113
|
-
applicableTypes: [
|
|
134
|
+
operator: OperatorModel.EQUALS,
|
|
135
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.STRING],
|
|
114
136
|
},
|
|
115
137
|
{
|
|
116
|
-
operator:
|
|
117
|
-
applicableTypes: [
|
|
138
|
+
operator: OperatorModel.NOT_EQUALS,
|
|
139
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.STRING],
|
|
118
140
|
},
|
|
119
141
|
{
|
|
120
|
-
operator:
|
|
121
|
-
applicableTypes: [
|
|
142
|
+
operator: OperatorModel.LESS_THAN,
|
|
143
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.DATE_TIME],
|
|
122
144
|
},
|
|
123
145
|
{
|
|
124
|
-
operator:
|
|
125
|
-
applicableTypes: [
|
|
146
|
+
operator: OperatorModel.GREATER_THAN_EQUAL_TO,
|
|
147
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.DATE_TIME],
|
|
126
148
|
},
|
|
127
149
|
{
|
|
128
|
-
operator:
|
|
129
|
-
applicableTypes: [
|
|
150
|
+
operator: OperatorModel.GREATER_THAN,
|
|
151
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.DATE_TIME],
|
|
130
152
|
},
|
|
131
153
|
{
|
|
132
|
-
operator:
|
|
133
|
-
applicableTypes: [
|
|
154
|
+
operator: OperatorModel.GREATER_THAN_EQUAL_TO,
|
|
155
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.INTEGER, TemplateQueryPropertyTypeModel.DATE_TIME],
|
|
134
156
|
},
|
|
135
157
|
{
|
|
136
|
-
operator:
|
|
137
|
-
applicableTypes: [
|
|
158
|
+
operator: OperatorModel.CONTAINS,
|
|
159
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.STRING],
|
|
138
160
|
},
|
|
139
161
|
{
|
|
140
|
-
operator:
|
|
141
|
-
applicableTypes: [
|
|
162
|
+
operator: OperatorModel.NOT_CONTAINS,
|
|
163
|
+
applicableTypes: [TemplateQueryPropertyTypeModel.STRING],
|
|
142
164
|
},
|
|
143
165
|
],
|
|
144
166
|
};
|
|
@@ -147,6 +169,7 @@ class UmbTemplateData extends UmbEntityData {
|
|
|
147
169
|
constructor() {
|
|
148
170
|
super(data);
|
|
149
171
|
this.getTemplateQuerySettings = () => templateQuerySettings;
|
|
172
|
+
this.getTemplateQueryResult = () => templateQueryResult;
|
|
150
173
|
}
|
|
151
174
|
getById(id) {
|
|
152
175
|
const item = this.data.find((item) => item.id === id);
|
|
@@ -39,6 +39,10 @@ export const handlers = [
|
|
|
39
39
|
const response = umbTemplateData.getTemplateQuerySettings();
|
|
40
40
|
return res(ctx.status(200), ctx.json(response));
|
|
41
41
|
}),
|
|
42
|
+
rest.post(umbracoPath('/template/query/execute'), (req, res, ctx) => {
|
|
43
|
+
const response = umbTemplateData.getTemplateQueryResult();
|
|
44
|
+
return res(ctx.status(200), ctx.json(response));
|
|
45
|
+
}),
|
|
42
46
|
rest.get(umbracoPath('/template/:id'), (req, res, ctx) => {
|
|
43
47
|
const id = req.params.id;
|
|
44
48
|
if (!id)
|
package/dist-cms/packages/core/components/button-with-dropdown/button-with-dropdown.element.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare class UmbButtonWithDropdownElement extends LitElement {
|
|
|
10
10
|
compact: boolean;
|
|
11
11
|
symbolExpand: UUISymbolExpandElement;
|
|
12
12
|
popover: UUIPopoverElement;
|
|
13
|
+
openPopover(): void;
|
|
14
|
+
closePopover(): void;
|
|
13
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
16
|
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
15
17
|
}
|
package/dist-cms/packages/core/components/button-with-dropdown/button-with-dropdown.element.js
CHANGED
|
@@ -18,22 +18,22 @@ export let UmbButtonWithDropdownElement = class UmbButtonWithDropdownElement ext
|
|
|
18
18
|
this.placement = 'bottom-start';
|
|
19
19
|
this.compact = false;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
openPopover() {
|
|
22
22
|
this.open = true;
|
|
23
23
|
this.popover.open = true;
|
|
24
24
|
this.symbolExpand.open = true;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
closePopover() {
|
|
27
27
|
this.open = false;
|
|
28
28
|
this.popover.open = false;
|
|
29
29
|
this.symbolExpand.open = false;
|
|
30
30
|
}
|
|
31
31
|
#togglePopover() {
|
|
32
|
-
this.open ? this
|
|
32
|
+
this.open ? this.closePopover() : this.openPopover();
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
return html `
|
|
36
|
-
<uui-popover placement=${this.placement} id="popover" @close=${this
|
|
36
|
+
<uui-popover placement=${this.placement} id="popover" @close=${this.closePopover}>
|
|
37
37
|
<uui-button
|
|
38
38
|
slot="trigger"
|
|
39
39
|
.look=${this.look}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { LitElement } from '../../../../external/lit/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* A simple styled box for showing code-based error messages.
|
|
3
|
+
* A simple styled box for showing code-based error messages or blocks od code.
|
|
4
4
|
* @slot the full message
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export declare class UmbCodeBlockElement extends LitElement {
|
|
8
|
+
language: string;
|
|
9
|
+
copy: boolean;
|
|
10
|
+
nodes: NodeListOf<ChildNode>;
|
|
11
|
+
copyState: 'idle' | 'success';
|
|
12
|
+
copyCode(): Promise<void>;
|
|
8
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
9
14
|
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
10
15
|
}
|
|
@@ -5,54 +5,128 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { UUITextStyles } from '../../../../external/uui/index.js';
|
|
8
|
-
import { css, html, LitElement, customElement } from '../../../../external/lit/index.js';
|
|
8
|
+
import { css, html, LitElement, customElement, property, queryAssignedNodes, state, } from '../../../../external/lit/index.js';
|
|
9
|
+
//TODO consider adding a highlight prop to the code block, that could spin up/access monaco instance and highlight the code
|
|
9
10
|
/**
|
|
10
|
-
* A simple styled box for showing code-based error messages.
|
|
11
|
+
* A simple styled box for showing code-based error messages or blocks od code.
|
|
11
12
|
* @slot the full message
|
|
12
13
|
*
|
|
13
14
|
*/
|
|
14
15
|
export let UmbCodeBlockElement = class UmbCodeBlockElement extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.language = '';
|
|
19
|
+
this.copy = false;
|
|
20
|
+
this.copyState = 'idle';
|
|
21
|
+
}
|
|
22
|
+
async copyCode() {
|
|
23
|
+
const text = this.textContent;
|
|
24
|
+
if (text) {
|
|
25
|
+
await navigator.clipboard.writeText(text);
|
|
26
|
+
this.copyState = 'success';
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
this.copyState = 'idle';
|
|
29
|
+
}, 2000);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
15
32
|
render() {
|
|
16
|
-
return html
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
return html `
|
|
34
|
+
${this.language
|
|
35
|
+
? html `<div id="header">
|
|
36
|
+
<span id="lang">${this.language}</span> ${this.copy
|
|
37
|
+
? html `<button @click=${this.copyCode}>
|
|
38
|
+
${this.copyState === 'idle'
|
|
39
|
+
? html `<uui-icon name="copy"></uui-icon>Copy`
|
|
40
|
+
: html `<uui-icon name="check"></uui-icon>Copied!`}
|
|
41
|
+
</button>`
|
|
42
|
+
: ''}
|
|
43
|
+
</div>`
|
|
44
|
+
: ''}
|
|
45
|
+
<pre style="${this.language ? 'border-top: 1px solid var(--uui-color-divider-emphasis);' : ''}">
|
|
46
|
+
<uui-scroll-container>
|
|
19
47
|
<code>
|
|
20
48
|
<slot></slot>
|
|
21
49
|
</code>
|
|
50
|
+
</uui-scroll-container>
|
|
22
51
|
</pre>
|
|
23
|
-
|
|
24
|
-
</div> `;
|
|
52
|
+
`;
|
|
25
53
|
}
|
|
26
54
|
static { this.styles = [
|
|
27
55
|
UUITextStyles,
|
|
28
56
|
css `
|
|
29
57
|
:host {
|
|
30
58
|
display: block;
|
|
31
|
-
font-family: monospace;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
#container {
|
|
35
59
|
border: 1px solid var(--uui-color-divider-emphasis);
|
|
36
|
-
color: var(--uui-color-text-alt);
|
|
37
|
-
background-color: var(--uui-color-divider-standalone);
|
|
38
|
-
padding: var(--uui-size-space-2);
|
|
39
60
|
border-radius: var(--uui-border-radius);
|
|
40
|
-
line-height: var(--uui-size-10);
|
|
41
61
|
}
|
|
42
|
-
|
|
62
|
+
|
|
63
|
+
uui-scroll-container {
|
|
43
64
|
max-height: 500px;
|
|
44
65
|
overflow-y: auto;
|
|
45
66
|
overflow-wrap: anywhere;
|
|
46
67
|
}
|
|
68
|
+
|
|
47
69
|
pre {
|
|
48
|
-
|
|
70
|
+
font-family: monospace;
|
|
71
|
+
background-color: var(--uui-color-surface-alt);
|
|
72
|
+
color: #303033;
|
|
73
|
+
display: block;
|
|
74
|
+
font-family: Lato, Helvetica Neue, Helvetica, Arial, sans-serif;
|
|
75
|
+
margin: 0;
|
|
76
|
+
overflow-x: auto;
|
|
77
|
+
padding: 9.5px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
pre,
|
|
81
|
+
code {
|
|
82
|
+
word-wrap: normal;
|
|
49
83
|
white-space: pre-line;
|
|
50
|
-
|
|
51
|
-
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#header {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
background-color: var(--uui-color-surface-alt);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#lang {
|
|
94
|
+
margin-left: 16px;
|
|
95
|
+
font-weight: bold;
|
|
96
|
+
text-transform: uppercase;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
button {
|
|
100
|
+
font-family: inherit;
|
|
101
|
+
padding: 6px 16px;
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
border: none;
|
|
104
|
+
border-left: 1px solid var(--uui-color-divider-emphasis);
|
|
105
|
+
border-radius: 0;
|
|
106
|
+
color: #000;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
gap: 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
button:hover {
|
|
113
|
+
background-color: var(--uui-color-surface-emphasis);
|
|
52
114
|
}
|
|
53
115
|
`,
|
|
54
116
|
]; }
|
|
55
117
|
};
|
|
118
|
+
__decorate([
|
|
119
|
+
property()
|
|
120
|
+
], UmbCodeBlockElement.prototype, "language", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Boolean })
|
|
123
|
+
], UmbCodeBlockElement.prototype, "copy", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
queryAssignedNodes()
|
|
126
|
+
], UmbCodeBlockElement.prototype, "nodes", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
state()
|
|
129
|
+
], UmbCodeBlockElement.prototype, "copyState", void 0);
|
|
56
130
|
UmbCodeBlockElement = __decorate([
|
|
57
131
|
customElement('umb-code-block')
|
|
58
132
|
], UmbCodeBlockElement);
|
|
@@ -2,6 +2,7 @@ export * from './backoffice-modal-container/backoffice-modal-container.element.j
|
|
|
2
2
|
export * from './backoffice-notification-container/backoffice-notification-container.element.js';
|
|
3
3
|
export * from './body-layout/body-layout.element.js';
|
|
4
4
|
export * from './button-with-dropdown/button-with-dropdown.element.js';
|
|
5
|
+
export * from './code-block/index.js';
|
|
5
6
|
export * from './data-type/index.js';
|
|
6
7
|
export * from './input-date/index.js';
|
|
7
8
|
export * from './dropdown/index.js';
|
|
@@ -4,7 +4,7 @@ export * from './backoffice-modal-container/backoffice-modal-container.element.j
|
|
|
4
4
|
export * from './backoffice-notification-container/backoffice-notification-container.element.js';
|
|
5
5
|
export * from './body-layout/body-layout.element.js';
|
|
6
6
|
export * from './button-with-dropdown/button-with-dropdown.element.js'; // TODO: delete this and change usage to umb-dropdown
|
|
7
|
-
|
|
7
|
+
export * from './code-block/index.js';
|
|
8
8
|
export * from './data-type/index.js';
|
|
9
9
|
export * from './input-date/index.js';
|
|
10
10
|
export * from './dropdown/index.js';
|
|
@@ -2,5 +2,4 @@ import type { EntityTreeItemResponseModel } from '../../../../external/backend-a
|
|
|
2
2
|
import { UmbModalToken, UmbPickerModalResult, UmbTreePickerModalData } from '../index.js';
|
|
3
3
|
export type UmbDictionaryItemPickerModalData = UmbTreePickerModalData<EntityTreeItemResponseModel>;
|
|
4
4
|
export type UmbDictionaryItemPickerModalResult = UmbPickerModalResult;
|
|
5
|
-
export declare const UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS = "Umb.Modal.DictionaryItemPicker";
|
|
6
5
|
export declare const UMB_DICTIONARY_ITEM_PICKER_MODAL: UmbModalToken<UmbDictionaryItemPickerModalData, UmbPickerModalResult>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UmbModalToken } from '../index.js';
|
|
2
|
-
export const
|
|
3
|
-
export const UMB_DICTIONARY_ITEM_PICKER_MODAL = new UmbModalToken(UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS, {
|
|
2
|
+
export const UMB_DICTIONARY_ITEM_PICKER_MODAL = new UmbModalToken('Umb.Modal.TreePicker', {
|
|
4
3
|
type: 'sidebar',
|
|
5
4
|
size: 'small',
|
|
6
5
|
}, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { map } from '../../../external/rxjs/index.js';
|
|
2
1
|
import { umbExtensionsRegistry } from '../extension-registry/index.js';
|
|
3
2
|
import { UmbBooleanState } from '../../../libs/observable-api/index.js';
|
|
4
3
|
import { UmbBaseController } from '../../../libs/controller-api/index.js';
|
|
@@ -36,9 +35,7 @@ export class UmbTreeContextBase extends UmbBaseController {
|
|
|
36
35
|
if (this.#treeAlias === treeAlias)
|
|
37
36
|
return;
|
|
38
37
|
this.#treeAlias = treeAlias;
|
|
39
|
-
|
|
40
|
-
this.#observeTreeManifest();
|
|
41
|
-
}
|
|
38
|
+
this.#observeTreeManifest();
|
|
42
39
|
}
|
|
43
40
|
getTreeAlias() {
|
|
44
41
|
return this.#treeAlias;
|
|
@@ -94,13 +91,13 @@ export class UmbTreeContextBase extends UmbBaseController {
|
|
|
94
91
|
return this.repository.treeItemsOf(parentUnique);
|
|
95
92
|
}
|
|
96
93
|
#observeTreeManifest() {
|
|
97
|
-
this
|
|
98
|
-
.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
94
|
+
if (this.#treeAlias) {
|
|
95
|
+
this.observe(umbExtensionsRegistry.getByTypeAndAlias('tree', this.#treeAlias), async (treeManifest) => {
|
|
96
|
+
if (!treeManifest)
|
|
97
|
+
return;
|
|
98
|
+
this.#observeRepository(treeManifest);
|
|
99
|
+
}, '_observeTreeManifest');
|
|
100
|
+
}
|
|
104
101
|
}
|
|
105
102
|
#observeRepository(treeManifest) {
|
|
106
103
|
const repositoryAlias = treeManifest.meta.repositoryAlias;
|
package/dist-cms/packages/templating/components/insert-menu/templating-insert-menu.element.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_ALIAS } from '../../modals/manifests.js';
|
|
8
8
|
import { UmbDictionaryRepository } from '../../../translation/dictionary/repository/dictionary.repository.js';
|
|
9
9
|
import { getInsertDictionarySnippet, getInsertPartialSnippet } from '../../utils.js';
|
|
10
|
-
import { CodeSnippetType
|
|
10
|
+
import { CodeSnippetType } from '../../modals/insert-choose-type-sidebar.element.js';
|
|
11
11
|
import { customElement, property, css, html } from '../../../../external/lit/index.js';
|
|
12
12
|
import { UUITextStyles } from '../../../../external/uui/index.js';
|
|
13
13
|
import { UMB_DICTIONARY_ITEM_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT_TOKEN, UMB_PARTIAL_VIEW_PICKER_MODAL, UmbModalToken, } from '../../../core/modal/index.js';
|
|
@@ -30,10 +30,6 @@ export let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement
|
|
|
30
30
|
const { data } = await this.#dictionaryRepository.requestById(id);
|
|
31
31
|
this.value = getInsertDictionarySnippet(data?.name ?? '');
|
|
32
32
|
};
|
|
33
|
-
this.#getUmbracoFieldValueSnippet = async (value) => {
|
|
34
|
-
this.value = value;
|
|
35
|
-
this.#dispatchInsertEvent();
|
|
36
|
-
};
|
|
37
33
|
this.#getPartialViewSnippet = async (modalResult) => {
|
|
38
34
|
this.value = getInsertPartialSnippet(modalResult.selection?.[0] ?? '');
|
|
39
35
|
};
|
|
@@ -53,10 +49,6 @@ export let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement
|
|
|
53
49
|
async determineInsertValue(modalResult) {
|
|
54
50
|
const { type, value } = modalResult;
|
|
55
51
|
switch (type) {
|
|
56
|
-
case CodeSnippetType.umbracoField: {
|
|
57
|
-
this.#getUmbracoFieldValueSnippet(value);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
52
|
case CodeSnippetType.partialView: {
|
|
61
53
|
this.#getPartialViewSnippet(value);
|
|
62
54
|
break;
|
|
@@ -72,16 +64,8 @@ export let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement
|
|
|
72
64
|
}
|
|
73
65
|
}
|
|
74
66
|
#getDictionaryItemSnippet;
|
|
75
|
-
#getUmbracoFieldValueSnippet;
|
|
76
67
|
#getPartialViewSnippet;
|
|
77
68
|
#openChooseTypeModal;
|
|
78
|
-
#openInsertValueSidebar() {
|
|
79
|
-
this.#openModal = this._modalContext?.open(UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_MODAL);
|
|
80
|
-
this.#openModal?.onSubmit().then((value) => {
|
|
81
|
-
this.value = value;
|
|
82
|
-
this.#dispatchInsertEvent();
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
69
|
#openInsertPartialViewSidebar() {
|
|
86
70
|
this.#openModal = this._modalContext?.open(UMB_PARTIAL_VIEW_PICKER_MODAL);
|
|
87
71
|
this.#openModal?.onSubmit().then((value) => {
|
|
@@ -106,7 +90,7 @@ export let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement
|
|
|
106
90
|
render() {
|
|
107
91
|
return html `
|
|
108
92
|
<uui-button-group>
|
|
109
|
-
<uui-button look="secondary" @click=${this.#openChooseTypeModal}>
|
|
93
|
+
<uui-button look="secondary" @click=${this.#openChooseTypeModal} label="Choose value to insert">
|
|
110
94
|
<uui-icon name="umb:add"></uui-icon>Insert</uui-button
|
|
111
95
|
>
|
|
112
96
|
<umb-button-with-dropdown
|
|
@@ -116,18 +100,6 @@ export let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement
|
|
|
116
100
|
id="insert-button"
|
|
117
101
|
label="open insert menu">
|
|
118
102
|
<ul id="insert-menu" slot="dropdown">
|
|
119
|
-
<!--
|
|
120
|
-
TODO: uncomment when insert value has endpoint and is properly implemented
|
|
121
|
-
<li>
|
|
122
|
-
<uui-menu-item
|
|
123
|
-
class="insert-menu-item"
|
|
124
|
-
target="_blank"
|
|
125
|
-
label="Value"
|
|
126
|
-
title="Value"
|
|
127
|
-
>
|
|
128
|
-
</uui-menu-item>
|
|
129
|
-
</li> -->
|
|
130
|
-
|
|
131
103
|
<li>
|
|
132
104
|
<uui-menu-item
|
|
133
105
|
class="insert-menu-item"
|
|
@@ -200,7 +172,7 @@ __decorate([
|
|
|
200
172
|
property()
|
|
201
173
|
], UmbTemplatingInsertMenuElement.prototype, "value", void 0);
|
|
202
174
|
__decorate([
|
|
203
|
-
property()
|
|
175
|
+
property({ type: Boolean })
|
|
204
176
|
], UmbTemplatingInsertMenuElement.prototype, "hidePartialView", void 0);
|
|
205
177
|
UmbTemplatingInsertMenuElement = __decorate([
|
|
206
178
|
customElement('umb-templating-insert-menu')
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { UmbModalBaseElement } from '../../../shared/modal/index.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare const UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_MODAL: UmbModalToken<object, unknown>;
|
|
2
|
+
import { UmbDictionaryItemPickerModalResult } from '../../core/modal/index.js';
|
|
4
3
|
export interface ChooseInsertTypeModalData {
|
|
5
4
|
hidePartialViews?: boolean;
|
|
6
5
|
}
|
|
7
6
|
export declare enum CodeSnippetType {
|
|
8
7
|
partialView = "partialView",
|
|
9
|
-
umbracoField = "umbracoField",
|
|
10
8
|
dictionaryItem = "dictionaryItem",
|
|
11
9
|
macro = "macro"
|
|
12
10
|
}
|
|
@@ -20,7 +18,7 @@ export default class UmbChooseInsertTypeModalElement extends UmbModalBaseElement
|
|
|
20
18
|
private _modalContext?;
|
|
21
19
|
constructor();
|
|
22
20
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
|
-
static styles: import("@lit/reactive-element/css-tag
|
|
21
|
+
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
24
22
|
}
|
|
25
23
|
declare global {
|
|
26
24
|
interface HTMLElementTagNameMap {
|
|
@@ -4,19 +4,13 @@ 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 { UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_ALIAS } from './manifests.js';
|
|
8
7
|
import { UUITextStyles } from '../../../external/uui/index.js';
|
|
9
8
|
import { css, html, customElement } from '../../../external/lit/index.js';
|
|
10
9
|
import { UmbModalBaseElement } from '../../../shared/modal/index.js';
|
|
11
|
-
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN,
|
|
12
|
-
export const UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_MODAL = new UmbModalToken(UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_ALIAS, {
|
|
13
|
-
type: 'sidebar',
|
|
14
|
-
size: 'small',
|
|
15
|
-
});
|
|
10
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN, UMB_PARTIAL_VIEW_PICKER_MODAL, UMB_DICTIONARY_ITEM_PICKER_MODAL, } from '../../core/modal/index.js';
|
|
16
11
|
export var CodeSnippetType;
|
|
17
12
|
(function (CodeSnippetType) {
|
|
18
13
|
CodeSnippetType["partialView"] = "partialView";
|
|
19
|
-
CodeSnippetType["umbracoField"] = "umbracoField";
|
|
20
14
|
CodeSnippetType["dictionaryItem"] = "dictionaryItem";
|
|
21
15
|
CodeSnippetType["macro"] = "macro";
|
|
22
16
|
})(CodeSnippetType || (CodeSnippetType = {}));
|
|
@@ -31,13 +25,6 @@ let UmbChooseInsertTypeModalElement = class UmbChooseInsertTypeModalElement exte
|
|
|
31
25
|
});
|
|
32
26
|
}
|
|
33
27
|
#openModal;
|
|
34
|
-
#openInsertValueSidebar() {
|
|
35
|
-
this.#openModal = this._modalContext?.open(UMB_MODAL_TEMPLATING_INSERT_FIELD_SIDEBAR_MODAL);
|
|
36
|
-
this.#openModal?.onSubmit().then((chosenValue) => {
|
|
37
|
-
if (chosenValue)
|
|
38
|
-
this.modalContext?.submit({ value: chosenValue, type: CodeSnippetType.umbracoField });
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
28
|
#openInsertPartialViewSidebar() {
|
|
42
29
|
this.#openModal = this._modalContext?.open(UMB_PARTIAL_VIEW_PICKER_MODAL);
|
|
43
30
|
this.#openModal?.onSubmit().then((partialViewPickerModalResult) => {
|
|
@@ -57,16 +44,6 @@ let UmbChooseInsertTypeModalElement = class UmbChooseInsertTypeModalElement exte
|
|
|
57
44
|
this.modalContext?.submit({ value: dictionaryItemPickerModalResult, type: CodeSnippetType.dictionaryItem });
|
|
58
45
|
});
|
|
59
46
|
}
|
|
60
|
-
//TODO: insert this when we have insert value implemented
|
|
61
|
-
#renderInsertValueButton() {
|
|
62
|
-
return html `<uui-button @click=${this.#openInsertValueSidebar} look="placeholder" label="Insert value"
|
|
63
|
-
><h3>Value</h3>
|
|
64
|
-
<p>
|
|
65
|
-
Displays the value of a named field from the current page, with options to modify the value or fallback to
|
|
66
|
-
alternative values.
|
|
67
|
-
</p></uui-button
|
|
68
|
-
>`;
|
|
69
|
-
}
|
|
70
47
|
//TODO: insert this when we have partial views
|
|
71
48
|
#renderInsertPartialViewButton() {
|
|
72
49
|
return html `${this.data?.hidePartialViews
|
|
@@ -94,7 +71,7 @@ let UmbChooseInsertTypeModalElement = class UmbChooseInsertTypeModalElement exte
|
|
|
94
71
|
</uui-box>
|
|
95
72
|
</div>
|
|
96
73
|
<div slot="actions">
|
|
97
|
-
<uui-button @click=${this._close} look="secondary">Close</uui-button>
|
|
74
|
+
<uui-button @click=${this._close} look="secondary" label="Close">Close</uui-button>
|
|
98
75
|
</div>
|
|
99
76
|
</umb-body-layout>
|
|
100
77
|
`;
|
|
@@ -110,8 +87,9 @@ let UmbChooseInsertTypeModalElement = class UmbChooseInsertTypeModalElement exte
|
|
|
110
87
|
|
|
111
88
|
#main {
|
|
112
89
|
box-sizing: border-box;
|
|
113
|
-
|
|
114
|
-
|
|
90
|
+
height: calc(
|
|
91
|
+
100dvh - var(--umb-header-layout-height) - var(--umb-footer-layout-height) - 2 * var(--uui-size-layout-1)
|
|
92
|
+
);
|
|
115
93
|
}
|
|
116
94
|
|
|
117
95
|
#main uui-button:not(:last-of-type) {
|
package/dist-cms/packages/templating/modals/insert-section-modal/insert-section-input.element.js
CHANGED
|
@@ -52,6 +52,7 @@ export let UmbInsertSectionCheckboxElement = class UmbInsertSectionCheckboxEleme
|
|
|
52
52
|
<uui-input
|
|
53
53
|
required
|
|
54
54
|
placeholder="Enter section name"
|
|
55
|
+
label="Section name"
|
|
55
56
|
id="section-name-input"></uui-input> </uui-form-layout-item
|
|
56
57
|
>${this.showMandatory
|
|
57
58
|
? html `<p slot="if-checked">
|
package/dist-cms/packages/templating/modals/insert-section-modal/insert-section-modal.element.js
CHANGED
|
@@ -91,8 +91,8 @@ let UmbTemplatingInsertSectionModalElement = class UmbTemplatingInsertSectionMod
|
|
|
91
91
|
</uui-box>
|
|
92
92
|
</div>
|
|
93
93
|
<div slot="actions">
|
|
94
|
-
<uui-button @click=${this.#close} look="secondary">Close</uui-button>
|
|
95
|
-
<uui-button @click=${this.#submit} look="primary" color="positive">Submit</uui-button>
|
|
94
|
+
<uui-button @click=${this.#close} look="secondary" label="Close">Close</uui-button>
|
|
95
|
+
<uui-button @click=${this.#submit} look="primary" color="positive" label="Submit">Submit</uui-button>
|
|
96
96
|
</div>
|
|
97
97
|
</umb-body-layout>
|
|
98
98
|
`;
|
|
@@ -108,8 +108,9 @@ let UmbTemplatingInsertSectionModalElement = class UmbTemplatingInsertSectionMod
|
|
|
108
108
|
|
|
109
109
|
#main {
|
|
110
110
|
box-sizing: border-box;
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
height: calc(
|
|
112
|
+
100dvh - var(--umb-header-layout-height) - var(--umb-footer-layout-height) - 2 * var(--uui-size-layout-1)
|
|
113
|
+
);
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
#main umb-insert-section-checkbox:not(:last-of-type) {
|