@umbraco-cms/backoffice 14.0.0--preview007-226f18ab → 14.0.0--preview007-bdd59f0a
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/en-us.js +8 -8
- package/dist-cms/assets/lang/en-us.ts +8 -9
- package/dist-cms/custom-elements.json +7 -18
- package/dist-cms/packages/core/modal/token/index.d.ts +0 -1
- package/dist-cms/packages/core/modal/token/index.js +0 -1
- package/dist-cms/packages/templating/components/index.d.ts +1 -1
- package/dist-cms/packages/templating/components/index.js +1 -1
- package/dist-cms/packages/templating/components/templating-item-menu/index.d.ts +1 -0
- package/dist-cms/packages/templating/components/templating-item-menu/index.js +1 -0
- package/dist-cms/packages/templating/components/{insert-menu/templating-insert-menu.element.d.ts → templating-item-menu/templating-item-menu.element.d.ts} +2 -6
- package/dist-cms/packages/templating/components/{insert-menu/templating-insert-menu.element.js → templating-item-menu/templating-item-menu.element.js} +30 -30
- package/dist-cms/packages/templating/index.d.ts +2 -0
- package/dist-cms/packages/templating/index.js +2 -0
- package/dist-cms/packages/templating/modals/index.d.ts +3 -0
- package/dist-cms/packages/templating/modals/index.js +3 -0
- package/dist-cms/packages/templating/modals/manifests.d.ts +0 -2
- package/dist-cms/packages/templating/modals/manifests.js +6 -15
- package/dist-cms/packages/templating/modals/partial-view-picker/index.d.ts +1 -0
- package/dist-cms/packages/templating/modals/partial-view-picker/index.js +1 -0
- package/dist-cms/packages/templating/modals/partial-view-picker/partial-view-picker-modal.token.d.ts +5 -0
- package/dist-cms/packages/templating/modals/partial-view-picker/partial-view-picker-modal.token.js +9 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/index.d.ts +2 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/index.js +2 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/templating-item-picker-modal.element.d.ts +16 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/templating-item-picker-modal.element.js +135 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/templating-item-picker-modal.token.d.ts +10 -0
- package/dist-cms/packages/templating/modals/templating-item-picker/templating-item-picker-modal.token.js +7 -0
- package/dist-cms/packages/templating/modals/templating-section-picker/index.d.ts +2 -0
- package/dist-cms/packages/templating/modals/templating-section-picker/index.js +2 -0
- package/dist-cms/packages/templating/modals/templating-section-picker/templating-section-picker-modal.element.d.ts +20 -0
- package/dist-cms/packages/templating/modals/{insert-section-modal/insert-section-modal.element.js → templating-section-picker/templating-section-picker-modal.element.js} +45 -39
- package/dist-cms/packages/templating/modals/templating-section-picker/templating-section-picker-modal.token.d.ts +7 -0
- package/dist-cms/packages/templating/modals/templating-section-picker/templating-section-picker-modal.token.js +7 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.element.d.ts +1 -1
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.element.js +1 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.js +27 -30
- package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +1 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.d.ts +1 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.js +1 -1
- package/dist-cms/packages/templating/types.d.ts +4 -0
- package/dist-cms/packages/templating/types.js +5 -0
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +2 -7
- package/package.json +1 -1
- package/dist-cms/packages/core/modal/token/partial-view-picker-modal.token.d.ts +0 -10
- package/dist-cms/packages/core/modal/token/partial-view-picker-modal.token.js +0 -8
- package/dist-cms/packages/templating/modals/insert-choose-type-sidebar.element.d.ts +0 -26
- package/dist-cms/packages/templating/modals/insert-choose-type-sidebar.element.js +0 -123
- package/dist-cms/packages/templating/modals/insert-section-modal/insert-section-modal.element.d.ts +0 -22
- package/dist-cms/packages/templating/modals/modal-tokens.d.ts +0 -0
- package/dist-cms/packages/templating/modals/modal-tokens.js +0 -2
- package/dist-cms/packages/templating/modals/partial-view-picker-modal.element.d.ts +0 -17
- package/dist-cms/packages/templating/modals/partial-view-picker-modal.element.js +0 -85
- /package/dist-cms/packages/templating/modals/{insert-section-modal/insert-section-input.element.d.ts → templating-section-picker/templating-section-picker-input.element.d.ts} +0 -0
- /package/dist-cms/packages/templating/modals/{insert-section-modal/insert-section-input.element.js → templating-section-picker/templating-section-picker-input.element.js} +0 -0
|
@@ -1333,24 +1333,24 @@ export default {
|
|
|
1333
1333
|
insert: 'Insert',
|
|
1334
1334
|
insertDesc: 'Choose what to insert into your template',
|
|
1335
1335
|
insertDictionaryItem: 'Dictionary item',
|
|
1336
|
-
insertDictionaryItemDesc: 'A dictionary item is a placeholder for a translatable piece of text, which
|
|
1336
|
+
insertDictionaryItemDesc: 'A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites.',
|
|
1337
1337
|
insertMacro: 'Macro',
|
|
1338
|
-
insertMacroDesc: '
|
|
1338
|
+
insertMacroDesc: 'A Macro is a configurable component which is great for reusable parts of your design, where you need the option to provide parameters, such as galleries, forms and lists.',
|
|
1339
1339
|
insertPageField: 'Value',
|
|
1340
|
-
insertPageFieldDesc: 'Displays the value of a named field from the current page, with options to modify
|
|
1340
|
+
insertPageFieldDesc: 'Displays the value of a named field from the current page, with options to modify the value or fallback to alternative values.',
|
|
1341
1341
|
insertPartialView: 'Partial view',
|
|
1342
|
-
insertPartialViewDesc: "
|
|
1342
|
+
insertPartialViewDesc: "A partial view is a separate template file which can be rendered inside another template, it's great for reusing markup or for separating complex templates into separate files.",
|
|
1343
1343
|
mastertemplate: 'Master template',
|
|
1344
1344
|
noMaster: 'No master',
|
|
1345
1345
|
renderBody: 'Render child template',
|
|
1346
|
-
renderBodyDesc: '
|
|
1346
|
+
renderBodyDesc: 'Renders the contents of a child template, by inserting a <code>@RenderBody()</code> placeholder.',
|
|
1347
1347
|
defineSection: 'Define a named section',
|
|
1348
|
-
defineSectionDesc: '
|
|
1348
|
+
defineSectionDesc: 'Defines a part of your template as a named section by wrapping it in <code>@section { ... }</code>. This can be rendered in a specific area of the parent of this template, by using <code>@RenderSection</code>.',
|
|
1349
1349
|
renderSection: 'Render a named section',
|
|
1350
|
-
renderSectionDesc: '
|
|
1350
|
+
renderSectionDesc: 'Renders a named area of a child template, by inserting a <code>@RenderSection(name)</code> placeholder. This renders an area of a child template which is wrapped in a corresponding <code>@section [name]{ ... }</code> definition.',
|
|
1351
1351
|
sectionName: 'Section Name',
|
|
1352
1352
|
sectionMandatory: 'Section is mandatory',
|
|
1353
|
-
sectionMandatoryDesc: '
|
|
1353
|
+
sectionMandatoryDesc: 'If mandatory, the child template must contain a <code>@section</code> definition, otherwise an error is shown.',
|
|
1354
1354
|
queryBuilder: 'Query builder',
|
|
1355
1355
|
itemsReturned: 'items returned, in',
|
|
1356
1356
|
iWant: 'I want',
|
|
@@ -1440,31 +1440,30 @@ export default {
|
|
|
1440
1440
|
insertDesc: 'Choose what to insert into your template',
|
|
1441
1441
|
insertDictionaryItem: 'Dictionary item',
|
|
1442
1442
|
insertDictionaryItemDesc:
|
|
1443
|
-
'A dictionary item is a placeholder for a translatable piece of text, which
|
|
1443
|
+
'A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites.',
|
|
1444
1444
|
insertMacro: 'Macro',
|
|
1445
1445
|
insertMacroDesc:
|
|
1446
|
-
'
|
|
1446
|
+
'A Macro is a configurable component which is great for reusable parts of your design, where you need the option to provide parameters, such as galleries, forms and lists.',
|
|
1447
1447
|
insertPageField: 'Value',
|
|
1448
1448
|
insertPageFieldDesc:
|
|
1449
|
-
'Displays the value of a named field from the current page, with options to modify
|
|
1449
|
+
'Displays the value of a named field from the current page, with options to modify the value or fallback to alternative values.',
|
|
1450
1450
|
insertPartialView: 'Partial view',
|
|
1451
1451
|
insertPartialViewDesc:
|
|
1452
|
-
"
|
|
1452
|
+
"A partial view is a separate template file which can be rendered inside another template, it's great for reusing markup or for separating complex templates into separate files.",
|
|
1453
1453
|
mastertemplate: 'Master template',
|
|
1454
1454
|
noMaster: 'No master',
|
|
1455
1455
|
renderBody: 'Render child template',
|
|
1456
|
-
renderBodyDesc:
|
|
1457
|
-
'\n Renders the contents of a child template, by inserting a\n <code>@RenderBody()</code> placeholder.\n ',
|
|
1456
|
+
renderBodyDesc: 'Renders the contents of a child template, by inserting a <code>@RenderBody()</code> placeholder.',
|
|
1458
1457
|
defineSection: 'Define a named section',
|
|
1459
1458
|
defineSectionDesc:
|
|
1460
|
-
'
|
|
1459
|
+
'Defines a part of your template as a named section by wrapping it in <code>@section { ... }</code>. This can be rendered in a specific area of the parent of this template, by using <code>@RenderSection</code>.',
|
|
1461
1460
|
renderSection: 'Render a named section',
|
|
1462
1461
|
renderSectionDesc:
|
|
1463
|
-
'
|
|
1462
|
+
'Renders a named area of a child template, by inserting a <code>@RenderSection(name)</code> placeholder. This renders an area of a child template which is wrapped in a corresponding <code>@section [name]{ ... }</code> definition.',
|
|
1464
1463
|
sectionName: 'Section Name',
|
|
1465
1464
|
sectionMandatory: 'Section is mandatory',
|
|
1466
1465
|
sectionMandatoryDesc:
|
|
1467
|
-
'
|
|
1466
|
+
'If mandatory, the child template must contain a <code>@section</code> definition, otherwise an error is shown.',
|
|
1468
1467
|
queryBuilder: 'Query builder',
|
|
1469
1468
|
itemsReturned: 'items returned, in',
|
|
1470
1469
|
iWant: 'I want',
|
|
@@ -9233,7 +9233,7 @@
|
|
|
9233
9233
|
},
|
|
9234
9234
|
{
|
|
9235
9235
|
"name": "umb-templating-insert-menu",
|
|
9236
|
-
"path": "./../src/packages/templating/components/
|
|
9236
|
+
"path": "./../src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts",
|
|
9237
9237
|
"attributes": [
|
|
9238
9238
|
{
|
|
9239
9239
|
"name": "value",
|
|
@@ -9272,8 +9272,8 @@
|
|
|
9272
9272
|
]
|
|
9273
9273
|
},
|
|
9274
9274
|
{
|
|
9275
|
-
"name": "umb-templating-
|
|
9276
|
-
"path": "./../src/packages/templating/modals/
|
|
9275
|
+
"name": "umb-templating-item-picker-modal",
|
|
9276
|
+
"path": "./../src/packages/templating/modals/templating-item-picker/templating-item-picker-modal.element.ts",
|
|
9277
9277
|
"properties": [
|
|
9278
9278
|
{
|
|
9279
9279
|
"name": "styles",
|
|
@@ -9284,7 +9284,7 @@
|
|
|
9284
9284
|
},
|
|
9285
9285
|
{
|
|
9286
9286
|
"name": "umb-insert-section-checkbox",
|
|
9287
|
-
"path": "./../src/packages/templating/modals/
|
|
9287
|
+
"path": "./../src/packages/templating/modals/templating-section-picker/templating-section-picker-input.element.ts",
|
|
9288
9288
|
"attributes": [
|
|
9289
9289
|
{
|
|
9290
9290
|
"name": "show-mandatory",
|
|
@@ -9344,7 +9344,7 @@
|
|
|
9344
9344
|
},
|
|
9345
9345
|
{
|
|
9346
9346
|
"name": "umb-insert-section-input",
|
|
9347
|
-
"path": "./../src/packages/templating/modals/
|
|
9347
|
+
"path": "./../src/packages/templating/modals/templating-section-picker/templating-section-picker-input.element.ts",
|
|
9348
9348
|
"attributes": [
|
|
9349
9349
|
{
|
|
9350
9350
|
"name": "show-mandatory",
|
|
@@ -9403,8 +9403,8 @@
|
|
|
9403
9403
|
]
|
|
9404
9404
|
},
|
|
9405
9405
|
{
|
|
9406
|
-
"name": "umb-templating-
|
|
9407
|
-
"path": "./../src/packages/templating/modals/
|
|
9406
|
+
"name": "umb-templating-section-picker-modal",
|
|
9407
|
+
"path": "./../src/packages/templating/modals/templating-section-picker/templating-section-picker-modal.element.ts",
|
|
9408
9408
|
"properties": [
|
|
9409
9409
|
{
|
|
9410
9410
|
"name": "checkboxes",
|
|
@@ -9431,17 +9431,6 @@
|
|
|
9431
9431
|
}
|
|
9432
9432
|
]
|
|
9433
9433
|
},
|
|
9434
|
-
{
|
|
9435
|
-
"name": "umb-partial-view-picker-modal",
|
|
9436
|
-
"path": "./../src/packages/templating/modals/partial-view-picker-modal.element.ts",
|
|
9437
|
-
"properties": [
|
|
9438
|
-
{
|
|
9439
|
-
"name": "styles",
|
|
9440
|
-
"type": "array",
|
|
9441
|
-
"default": "[\"UmbTextStyles\",null]"
|
|
9442
|
-
}
|
|
9443
|
-
]
|
|
9444
|
-
},
|
|
9445
9434
|
{
|
|
9446
9435
|
"name": "umb-partial-view-create-options-modal",
|
|
9447
9436
|
"path": "./../src/packages/templating/partial-views/entity-actions/create/options-modal/partial-view-create-options-modal.element.ts",
|
|
@@ -22,5 +22,4 @@ export * from './property-editor-ui-picker-modal.token.js';
|
|
|
22
22
|
export * from './property-settings-modal.token.js';
|
|
23
23
|
export * from './section-picker-modal.token.js';
|
|
24
24
|
export * from './template-picker-modal.token.js';
|
|
25
|
-
export * from './partial-view-picker-modal.token.js';
|
|
26
25
|
export * from './workspace-modal.token.js';
|
|
@@ -22,5 +22,4 @@ export * from './property-editor-ui-picker-modal.token.js';
|
|
|
22
22
|
export * from './property-settings-modal.token.js';
|
|
23
23
|
export * from './section-picker-modal.token.js';
|
|
24
24
|
export * from './template-picker-modal.token.js';
|
|
25
|
-
export * from './partial-view-picker-modal.token.js';
|
|
26
25
|
export * from './workspace-modal.token.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './templating-item-menu/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './templating-item-menu/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './templating-item-menu.element.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './templating-item-menu.element.js';
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { UmbModalToken } from '../../../core/modal/index.js';
|
|
1
|
+
import { type UmbTemplatingItemPickerModalValue } from '../../modals/templating-item-picker/templating-item-picker-modal.token.js';
|
|
3
2
|
import { UmbLitElement } from '../../../core/lit-element/index.js';
|
|
4
|
-
export declare const UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_MODAL: UmbModalToken<{
|
|
5
|
-
hidePartialView: boolean;
|
|
6
|
-
}, unknown>;
|
|
7
3
|
export declare class UmbTemplatingInsertMenuElement extends UmbLitElement {
|
|
8
4
|
#private;
|
|
9
5
|
value: string;
|
|
10
6
|
private _modalContext?;
|
|
11
7
|
constructor();
|
|
12
|
-
determineInsertValue(modalValue:
|
|
8
|
+
determineInsertValue(modalValue: UmbTemplatingItemPickerModalValue): Promise<void>;
|
|
13
9
|
hidePartialView: boolean;
|
|
14
10
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
11
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
@@ -15,21 +15,16 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
15
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
16
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
17
|
};
|
|
18
|
-
var _UmbTemplatingInsertMenuElement_instances, _UmbTemplatingInsertMenuElement_openModal, _UmbTemplatingInsertMenuElement_dictionaryDetailRepository, _UmbTemplatingInsertMenuElement_getDictionaryItemSnippet, _UmbTemplatingInsertMenuElement_getPartialViewSnippet, _UmbTemplatingInsertMenuElement_openChooseTypeModal, _UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar, _UmbTemplatingInsertMenuElement_openInsertDictionaryItemModal, _UmbTemplatingInsertMenuElement_dispatchInsertEvent;
|
|
19
|
-
import {
|
|
18
|
+
var _UmbTemplatingInsertMenuElement_instances, _UmbTemplatingInsertMenuElement_openModal, _UmbTemplatingInsertMenuElement_dictionaryDetailRepository, _UmbTemplatingInsertMenuElement_getDictionaryItemSnippet, _UmbTemplatingInsertMenuElement_getPartialViewSnippet, _UmbTemplatingInsertMenuElement_openChooseTypeModal, _UmbTemplatingInsertMenuElement_openInsertPageFieldSidebar, _UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar, _UmbTemplatingInsertMenuElement_openInsertDictionaryItemModal, _UmbTemplatingInsertMenuElement_dispatchInsertEvent;
|
|
19
|
+
import { UMB_PARTIAL_VIEW_PICKER_MODAL, } from '../../modals/partial-view-picker/partial-view-picker-modal.token.js';
|
|
20
|
+
import { CodeSnippetType } from '../../types.js';
|
|
21
|
+
import { UMB_TEMPLATING_ITEM_PICKER_MODAL, } from '../../modals/templating-item-picker/templating-item-picker-modal.token.js';
|
|
20
22
|
import { getInsertDictionarySnippet, getInsertPartialSnippet } from '../../utils/index.js';
|
|
21
|
-
import { CodeSnippetType } from '../../modals/insert-choose-type-sidebar.element.js';
|
|
22
23
|
import { UmbDictionaryDetailRepository } from '../../../dictionary/index.js';
|
|
23
24
|
import { customElement, property, css, html } from '../../../../external/lit/index.js';
|
|
24
25
|
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
25
|
-
import { UMB_DICTIONARY_ITEM_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT
|
|
26
|
+
import { UMB_DICTIONARY_ITEM_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT } from '../../../core/modal/index.js';
|
|
26
27
|
import { UmbLitElement } from '../../../core/lit-element/index.js';
|
|
27
|
-
export const UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_MODAL = new UmbModalToken(UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_ALIAS, {
|
|
28
|
-
modal: {
|
|
29
|
-
type: 'sidebar',
|
|
30
|
-
size: 'small',
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
28
|
let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement extends UmbLitElement {
|
|
34
29
|
constructor() {
|
|
35
30
|
super();
|
|
@@ -48,9 +43,9 @@ let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement extend
|
|
|
48
43
|
this.value = getInsertPartialSnippet(modalValue.selection?.[0] ?? '');
|
|
49
44
|
});
|
|
50
45
|
_UmbTemplatingInsertMenuElement_openChooseTypeModal.set(this, () => {
|
|
51
|
-
__classPrivateFieldSet(this, _UmbTemplatingInsertMenuElement_openModal, this._modalContext?.open(
|
|
46
|
+
__classPrivateFieldSet(this, _UmbTemplatingInsertMenuElement_openModal, this._modalContext?.open(UMB_TEMPLATING_ITEM_PICKER_MODAL, {
|
|
52
47
|
data: {
|
|
53
|
-
|
|
48
|
+
hidePartialViews: this.hidePartialView,
|
|
54
49
|
},
|
|
55
50
|
}), "f");
|
|
56
51
|
__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_openModal, "f")?.onSubmit().then((closedModal) => {
|
|
@@ -79,13 +74,26 @@ let UmbTemplatingInsertMenuElement = class UmbTemplatingInsertMenuElement extend
|
|
|
79
74
|
render() {
|
|
80
75
|
return html `
|
|
81
76
|
<uui-button-group>
|
|
82
|
-
<uui-button
|
|
83
|
-
|
|
84
|
-
@click=${__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_openChooseTypeModal, "f")}
|
|
85
|
-
label=${this.localize.term('template_insertDesc')}>
|
|
86
|
-
<uui-icon name="icon-add"></uui-icon> ${this.localize.term('template_insert')}
|
|
77
|
+
<uui-button look="secondary" @click=${__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_openChooseTypeModal, "f")} label=${this.localize.term('template_insert')}>
|
|
78
|
+
<uui-icon name="icon-add"></uui-icon>${this.localize.term('template_insert')}
|
|
87
79
|
</uui-button>
|
|
88
|
-
<umb-dropdown
|
|
80
|
+
<umb-dropdown
|
|
81
|
+
look="secondary"
|
|
82
|
+
compact
|
|
83
|
+
placement="bottom-end"
|
|
84
|
+
id="insert-button"
|
|
85
|
+
label=${this.localize.term('template_insert')}>
|
|
86
|
+
<uui-menu-item
|
|
87
|
+
class="insert-menu-item"
|
|
88
|
+
label=${this.localize.term('template_insertPageField')}
|
|
89
|
+
title=${this.localize.term('template_insertPageField')}
|
|
90
|
+
@click=${__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_instances, "m", _UmbTemplatingInsertMenuElement_openInsertPageFieldSidebar)}></uui-menu-item>
|
|
91
|
+
<uui-menu-item
|
|
92
|
+
class="insert-menu-item"
|
|
93
|
+
label=${this.localize.term('template_insertPartialView')}
|
|
94
|
+
title=${this.localize.term('template_insertPartialView')}
|
|
95
|
+
@click=${__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_instances, "m", _UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar)}>
|
|
96
|
+
</uui-menu-item>
|
|
89
97
|
<uui-menu-item
|
|
90
98
|
class="insert-menu-item"
|
|
91
99
|
label=${this.localize.term('template_insertDictionaryItem')}
|
|
@@ -103,6 +111,9 @@ _UmbTemplatingInsertMenuElement_getDictionaryItemSnippet = new WeakMap();
|
|
|
103
111
|
_UmbTemplatingInsertMenuElement_getPartialViewSnippet = new WeakMap();
|
|
104
112
|
_UmbTemplatingInsertMenuElement_openChooseTypeModal = new WeakMap();
|
|
105
113
|
_UmbTemplatingInsertMenuElement_instances = new WeakSet();
|
|
114
|
+
_UmbTemplatingInsertMenuElement_openInsertPageFieldSidebar = function _UmbTemplatingInsertMenuElement_openInsertPageFieldSidebar() {
|
|
115
|
+
//this.#openModel = this._modalContext?.open();
|
|
116
|
+
};
|
|
106
117
|
_UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar = function _UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar() {
|
|
107
118
|
__classPrivateFieldSet(this, _UmbTemplatingInsertMenuElement_openModal, this._modalContext?.open(UMB_PARTIAL_VIEW_PICKER_MODAL), "f");
|
|
108
119
|
__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_openModal, "f")?.onSubmit().then((value) => {
|
|
@@ -114,8 +125,8 @@ _UmbTemplatingInsertMenuElement_openInsertPartialViewSidebar = function _UmbTemp
|
|
|
114
125
|
_UmbTemplatingInsertMenuElement_openInsertDictionaryItemModal = function _UmbTemplatingInsertMenuElement_openInsertDictionaryItemModal() {
|
|
115
126
|
__classPrivateFieldSet(this, _UmbTemplatingInsertMenuElement_openModal, this._modalContext?.open(UMB_DICTIONARY_ITEM_PICKER_MODAL, {
|
|
116
127
|
data: {
|
|
117
|
-
pickableFilter: (item) => item.id !== null,
|
|
118
128
|
hideTreeRoot: true,
|
|
129
|
+
pickableFilter: (item) => item.id !== null,
|
|
119
130
|
},
|
|
120
131
|
}), "f");
|
|
121
132
|
__classPrivateFieldGet(this, _UmbTemplatingInsertMenuElement_openModal, "f")?.onSubmit().then((value) => {
|
|
@@ -127,17 +138,6 @@ _UmbTemplatingInsertMenuElement_openInsertDictionaryItemModal = function _UmbTem
|
|
|
127
138
|
_UmbTemplatingInsertMenuElement_dispatchInsertEvent = function _UmbTemplatingInsertMenuElement_dispatchInsertEvent() {
|
|
128
139
|
this.dispatchEvent(new CustomEvent('insert', { bubbles: false, cancelable: true, composed: false }));
|
|
129
140
|
};
|
|
130
|
-
//TODO: put this back in when partial view is implemented
|
|
131
|
-
// ${this.hidePartialView
|
|
132
|
-
// ? ''
|
|
133
|
-
// : html` <li>
|
|
134
|
-
// <uui-menu-item
|
|
135
|
-
// class="insert-menu-item"
|
|
136
|
-
// label="Partial view"
|
|
137
|
-
// title="Partial view"
|
|
138
|
-
// @click=${this.#openInsertPartialViewSidebar}>
|
|
139
|
-
// </uui-menu-item>
|
|
140
|
-
// </li>`}
|
|
141
141
|
UmbTemplatingInsertMenuElement.styles = [
|
|
142
142
|
UmbTextStyles,
|
|
143
143
|
css `
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import type { ManifestModal } from '../../core/extension-registry/index.js';
|
|
2
|
-
export declare const UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_ALIAS = "Umb.Modal.Templating.Insert.ChooseType.Sidebar";
|
|
3
|
-
export declare const UMB_MODAL_TEMPLATING_INSERT_SECTION_SIDEBAR_ALIAS = "Umb.Modal.Templating.Insert.Section.Sidebar";
|
|
4
2
|
export declare const manifests: ManifestModal[];
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { UMB_PARTIAL_VIEW_PICKER_MODAL_ALIAS } from '../../core/modal/index.js';
|
|
2
|
-
export const UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_ALIAS = 'Umb.Modal.Templating.Insert.ChooseType.Sidebar';
|
|
3
|
-
export const UMB_MODAL_TEMPLATING_INSERT_SECTION_SIDEBAR_ALIAS = 'Umb.Modal.Templating.Insert.Section.Sidebar';
|
|
4
1
|
const modals = [
|
|
5
2
|
{
|
|
6
3
|
type: 'modal',
|
|
7
|
-
alias:
|
|
8
|
-
name: '
|
|
9
|
-
js: () => import('./
|
|
4
|
+
alias: 'Umb.Modal.TemplatingItemPicker',
|
|
5
|
+
name: 'Templating Item Picker Modal',
|
|
6
|
+
js: () => import('./templating-item-picker/templating-item-picker-modal.element.js'),
|
|
10
7
|
},
|
|
11
8
|
{
|
|
12
9
|
type: 'modal',
|
|
13
|
-
alias:
|
|
14
|
-
name: '
|
|
15
|
-
js: () => import('
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: 'modal',
|
|
19
|
-
alias: UMB_MODAL_TEMPLATING_INSERT_SECTION_SIDEBAR_ALIAS,
|
|
20
|
-
name: 'Partial Insert Section Picker Modal',
|
|
21
|
-
js: () => import('./insert-section-modal/insert-section-modal.element.js'),
|
|
10
|
+
alias: 'Umb.Modal.TemplatingSectionPicker',
|
|
11
|
+
name: 'Templating Section Picker Modal',
|
|
12
|
+
js: () => import('./templating-section-picker/templating-section-picker-modal.element.js'),
|
|
22
13
|
},
|
|
23
14
|
];
|
|
24
15
|
export const manifests = [...modals];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './partial-view-picker-modal.token.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './partial-view-picker-modal.token.js';
|
package/dist-cms/packages/templating/modals/partial-view-picker/partial-view-picker-modal.token.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UmbModalToken, type UmbPickerModalValue, type UmbTreePickerModalData } from '../../../core/modal/index.js';
|
|
2
|
+
import type { UmbEntityTreeItemModel } from '../../../core/tree/index.js';
|
|
3
|
+
export type UmbPartialViewPickerModalData = UmbTreePickerModalData<UmbEntityTreeItemModel>;
|
|
4
|
+
export type UmbPartialViewPickerModalValue = UmbPickerModalValue;
|
|
5
|
+
export declare const UMB_PARTIAL_VIEW_PICKER_MODAL: UmbModalToken<UmbPartialViewPickerModalData, UmbPickerModalValue>;
|
package/dist-cms/packages/templating/modals/partial-view-picker/partial-view-picker-modal.token.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UMB_PARTIAL_VIEW_TREE_ALIAS } from '../../partial-views/tree/manifests.js';
|
|
2
|
+
import { UmbModalToken } from '../../../core/modal/index.js';
|
|
3
|
+
export const UMB_PARTIAL_VIEW_PICKER_MODAL = new UmbModalToken('Umb.Modal.TreePicker', {
|
|
4
|
+
modal: {
|
|
5
|
+
type: 'sidebar',
|
|
6
|
+
size: 'small',
|
|
7
|
+
},
|
|
8
|
+
data: { treeAlias: UMB_PARTIAL_VIEW_TREE_ALIAS, hideTreeRoot: true },
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UmbTemplatingItemPickerModalData, UmbTemplatingItemPickerModalValue } from './templating-item-picker-modal.token.js';
|
|
2
|
+
import { UmbModalBaseElement } from '../../../core/modal/index.js';
|
|
3
|
+
export declare class UmbTemplatingItemPickerModalElement extends UmbModalBaseElement<UmbTemplatingItemPickerModalData, UmbTemplatingItemPickerModalValue> {
|
|
4
|
+
#private;
|
|
5
|
+
private _close;
|
|
6
|
+
private _modalContext?;
|
|
7
|
+
constructor();
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
10
|
+
}
|
|
11
|
+
export default UmbTemplatingItemPickerModalElement;
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'umb-templating-item-picker-modal': UmbTemplatingItemPickerModalElement;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
|
+
};
|
|
18
|
+
var _UmbTemplatingItemPickerModalElement_instances, _UmbTemplatingItemPickerModalElement_openModal, _UmbTemplatingItemPickerModalElement_openInsertPartialViewSidebar, _UmbTemplatingItemPickerModalElement_openInsertDictionaryItemModal, _UmbTemplatingItemPickerModalElement_renderItems;
|
|
19
|
+
import { CodeSnippetType } from '../../types.js';
|
|
20
|
+
import { UMB_PARTIAL_VIEW_PICKER_MODAL } from '../partial-view-picker/partial-view-picker-modal.token.js';
|
|
21
|
+
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
22
|
+
import { css, html, customElement } from '../../../../external/lit/index.js';
|
|
23
|
+
import { UMB_MODAL_MANAGER_CONTEXT, UMB_DICTIONARY_ITEM_PICKER_MODAL, UmbModalBaseElement, } from '../../../core/modal/index.js';
|
|
24
|
+
let UmbTemplatingItemPickerModalElement = class UmbTemplatingItemPickerModalElement extends UmbModalBaseElement {
|
|
25
|
+
_close() {
|
|
26
|
+
this.modalContext?.reject();
|
|
27
|
+
}
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
_UmbTemplatingItemPickerModalElement_instances.add(this);
|
|
31
|
+
_UmbTemplatingItemPickerModalElement_openModal.set(this, void 0);
|
|
32
|
+
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT, (instance) => {
|
|
33
|
+
this._modalContext = instance;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return html `
|
|
38
|
+
<umb-body-layout headline=${this.localize.term('template_insert')}>
|
|
39
|
+
<uui-box> ${__classPrivateFieldGet(this, _UmbTemplatingItemPickerModalElement_instances, "m", _UmbTemplatingItemPickerModalElement_renderItems).call(this)} </uui-box>
|
|
40
|
+
<uui-button
|
|
41
|
+
slot="actions"
|
|
42
|
+
@click=${this._close}
|
|
43
|
+
look="secondary"
|
|
44
|
+
label=${this.localize.term('general_close')}></uui-button>
|
|
45
|
+
</umb-body-layout>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
_UmbTemplatingItemPickerModalElement_openModal = new WeakMap();
|
|
50
|
+
_UmbTemplatingItemPickerModalElement_instances = new WeakSet();
|
|
51
|
+
_UmbTemplatingItemPickerModalElement_openInsertPartialViewSidebar = function _UmbTemplatingItemPickerModalElement_openInsertPartialViewSidebar() {
|
|
52
|
+
__classPrivateFieldSet(this, _UmbTemplatingItemPickerModalElement_openModal, this._modalContext?.open(UMB_PARTIAL_VIEW_PICKER_MODAL), "f");
|
|
53
|
+
__classPrivateFieldGet(this, _UmbTemplatingItemPickerModalElement_openModal, "f")?.onSubmit().then((partialViewPickerModalValue) => {
|
|
54
|
+
if (partialViewPickerModalValue) {
|
|
55
|
+
this.value = {
|
|
56
|
+
type: CodeSnippetType.partialView,
|
|
57
|
+
value: partialViewPickerModalValue.selection[0],
|
|
58
|
+
};
|
|
59
|
+
this.modalContext?.submit();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
_UmbTemplatingItemPickerModalElement_openInsertDictionaryItemModal = function _UmbTemplatingItemPickerModalElement_openInsertDictionaryItemModal() {
|
|
64
|
+
__classPrivateFieldSet(this, _UmbTemplatingItemPickerModalElement_openModal, this._modalContext?.open(UMB_DICTIONARY_ITEM_PICKER_MODAL, {
|
|
65
|
+
data: {
|
|
66
|
+
hideTreeRoot: true,
|
|
67
|
+
pickableFilter: (item) => item.id !== null,
|
|
68
|
+
},
|
|
69
|
+
}), "f");
|
|
70
|
+
__classPrivateFieldGet(this, _UmbTemplatingItemPickerModalElement_openModal, "f")?.onSubmit().then((dictionaryItemPickerModalValue) => {
|
|
71
|
+
if (dictionaryItemPickerModalValue) {
|
|
72
|
+
this.value = { value: dictionaryItemPickerModalValue, type: CodeSnippetType.dictionaryItem };
|
|
73
|
+
this.modalContext?.submit();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
_UmbTemplatingItemPickerModalElement_renderItems = function _UmbTemplatingItemPickerModalElement_renderItems() {
|
|
78
|
+
return html `<div id="main">
|
|
79
|
+
<uui-button
|
|
80
|
+
@click=${() => console.log('to be continued')}
|
|
81
|
+
look="placeholder"
|
|
82
|
+
label=${this.localize.term('template_insert')}>
|
|
83
|
+
<h3><umb-localize key="template_insertPageField">Value</umb-localize> (Not implemented)</h3>
|
|
84
|
+
<p>
|
|
85
|
+
<umb-localize key="template_insertPageFieldDesc">
|
|
86
|
+
Displays the value of a named field from the current page, with options to modify the value or fallback to
|
|
87
|
+
alternative values.
|
|
88
|
+
</umb-localize>
|
|
89
|
+
</p>
|
|
90
|
+
</uui-button>
|
|
91
|
+
<uui-button
|
|
92
|
+
@click=${__classPrivateFieldGet(this, _UmbTemplatingItemPickerModalElement_instances, "m", _UmbTemplatingItemPickerModalElement_openInsertPartialViewSidebar)}
|
|
93
|
+
look="placeholder"
|
|
94
|
+
label=${this.localize.term('template_insert')}>
|
|
95
|
+
<h3><umb-localize key="template_insertPartialView">Partial view</umb-localize></h3>
|
|
96
|
+
<p>
|
|
97
|
+
<umb-localize key="template_insertPartialViewDesc">
|
|
98
|
+
A partial view is a separate template file which can be rendered inside another template, it's great for
|
|
99
|
+
reusing markup or for separating complex templates into separate files.
|
|
100
|
+
</umb-localize>
|
|
101
|
+
</p>
|
|
102
|
+
</uui-button>
|
|
103
|
+
<uui-button
|
|
104
|
+
@click=${__classPrivateFieldGet(this, _UmbTemplatingItemPickerModalElement_instances, "m", _UmbTemplatingItemPickerModalElement_openInsertDictionaryItemModal)}
|
|
105
|
+
look="placeholder"
|
|
106
|
+
label=${this.localize.term('template_insertDictionaryItem')}>
|
|
107
|
+
<h3><umb-localize key="template_insertDictionaryItem">Dictionary Item</umb-localize></h3>
|
|
108
|
+
<p>
|
|
109
|
+
<umb-localize key="template_insertDictionaryItemDesc">
|
|
110
|
+
A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs
|
|
111
|
+
for multilingual websites.
|
|
112
|
+
</umb-localize>
|
|
113
|
+
</p>
|
|
114
|
+
</uui-button>
|
|
115
|
+
</div>`;
|
|
116
|
+
};
|
|
117
|
+
UmbTemplatingItemPickerModalElement.styles = [
|
|
118
|
+
UmbTextStyles,
|
|
119
|
+
css `
|
|
120
|
+
#main uui-button:not(:last-of-type) {
|
|
121
|
+
display: block;
|
|
122
|
+
margin-bottom: var(--uui-size-space-5);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
h3,
|
|
126
|
+
p {
|
|
127
|
+
text-align: left;
|
|
128
|
+
}
|
|
129
|
+
`,
|
|
130
|
+
];
|
|
131
|
+
UmbTemplatingItemPickerModalElement = __decorate([
|
|
132
|
+
customElement('umb-templating-item-picker-modal')
|
|
133
|
+
], UmbTemplatingItemPickerModalElement);
|
|
134
|
+
export { UmbTemplatingItemPickerModalElement };
|
|
135
|
+
export default UmbTemplatingItemPickerModalElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CodeSnippetType } from '../../types.js';
|
|
2
|
+
import { type UmbDictionaryItemPickerModalValue, UmbModalToken } from '../../../core/modal/index.js';
|
|
3
|
+
export interface UmbTemplatingItemPickerModalData {
|
|
4
|
+
hidePartialViews?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type UmbTemplatingItemPickerModalValue = {
|
|
7
|
+
value: string | UmbDictionaryItemPickerModalValue;
|
|
8
|
+
type: CodeSnippetType;
|
|
9
|
+
};
|
|
10
|
+
export declare const UMB_TEMPLATING_ITEM_PICKER_MODAL: UmbModalToken<UmbTemplatingItemPickerModalData, UmbTemplatingItemPickerModalValue>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UmbTemplatingSectionPickerModalData, UmbTemplatingSectionPickerModalValue } from './templating-section-picker-modal.token.js';
|
|
2
|
+
import type { UmbInsertSectionCheckboxElement } from './templating-section-picker-input.element.js';
|
|
3
|
+
import { UmbModalBaseElement } from '../../../core/modal/index.js';
|
|
4
|
+
import './templating-section-picker-input.element.js';
|
|
5
|
+
export declare class UmbTemplatingSectionPickerModalElement extends UmbModalBaseElement<UmbTemplatingSectionPickerModalData, UmbTemplatingSectionPickerModalValue> {
|
|
6
|
+
#private;
|
|
7
|
+
checkboxes: NodeListOf<UmbInsertSectionCheckboxElement>;
|
|
8
|
+
selectedCheckbox?: UmbInsertSectionCheckboxElement | null;
|
|
9
|
+
snippet: string;
|
|
10
|
+
firstUpdated(): void;
|
|
11
|
+
snippetMethods: ((sectionName: string, isMandatory: boolean) => string)[];
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
14
|
+
}
|
|
15
|
+
export default UmbTemplatingSectionPickerModalElement;
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'umb-templating-section-picker-modal': UmbTemplatingSectionPickerModalElement;
|
|
19
|
+
}
|
|
20
|
+
}
|