Skip to content

Commit 463e816

Browse files
committed
Restructure the code to have modals self contained with it's own bundle identity
1 parent 92bcd34 commit 463e816

File tree

6 files changed

+55
-45
lines changed

6 files changed

+55
-45
lines changed

src/Our.Umbraco.UiExamples.v14/public/umbraco-package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "My Package Name",
2+
"name": "Umbraco UI Examples",
33
"version": "0.1.0",
44
"extensions": [
55
{
66
"type": "bundle",
7-
"alias": "My.Package.Bundle",
7+
"alias": "example.ui.bundle",
88
"name": "Example.UI",
99
"js": "/App_Plugins/Example.UI/manifest.js"
1010
}
Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
22

33
export const manifests: Array<ManifestTypes> = [
4-
{
5-
"type": "section",
6-
"name": "Example UI Dashboard",
7-
"alias": "example.ui.section",
8-
"weight": 900,
9-
"meta": {
10-
"label": "Example UI",
11-
"pathname": "example-ui"
12-
}
13-
},
4+
{
5+
"type": "section",
6+
"name": "Example UI Dashboard",
7+
"alias": "example.ui.section",
8+
"weight": 900,
9+
"meta": {
10+
"label": "Example UI",
11+
"pathname": "example-ui"
12+
}
13+
},
1414
{
1515
"type": "dashboard",
1616
"alias": "example.ui.dashboard",
1717
"name": "Example UI Dashboard",
18-
"element": () => import("./scripts/dashboards/welcome-dashboard.ts"),
18+
"element": () => import("./scripts/dashboards/welcome-dashboard.ts"),
1919
"weight": -1,
2020
"meta": {
2121
"label": "Welcome Dashboard",
@@ -29,26 +29,15 @@ export const manifests: Array<ManifestTypes> = [
2929
]
3030
},
3131
{
32-
"type": "dashboard",
33-
"alias": "example.ui.dashboard.modals",
34-
"name": "Modals",
35-
"element": () => import("./scripts/dashboards/custom-modals-dashboard.ts"),
36-
"weight": -1,
37-
"meta": {
38-
"label": "Modals",
39-
"pathname": "modals"
40-
},
41-
"conditions": [
42-
{
43-
"alias": "Umb.Condition.SectionAlias",
44-
"match": "example.ui.section"
45-
}
46-
]
32+
"type": "bundle",
33+
"alias": "example.ui.modals",
34+
"name": "Example.UI - Modals",
35+
"js": () => import("./scripts/modals/manifest.ts")
4736
},
4837
{
4938
"type": "sectionView",
5039
"alias": "example.ui.dashboard.section.boxlayout",
51-
"element": () => import("./scripts/sections/box-layout-section.ts"),
40+
"element": () => import("./scripts/sections/box-layout-section.ts"),
5241
"name": "Box Layout",
5342
"meta": {
5443
"label": "Box Layout",
@@ -61,17 +50,5 @@ export const manifests: Array<ManifestTypes> = [
6150
"match": "example.ui.section"
6251
}
6352
]
64-
},
65-
{
66-
"type": "modal",
67-
"alias": "My.Dialog",
68-
"name": "My Dialog",
69-
"element": () => import("./scripts/modals/custom-dialog.ts"),
70-
},
71-
{
72-
"type": "modal",
73-
"alias": "My.Sidebar",
74-
"name": "My Sidebar Modal",
75-
"element": () => import("./scripts/modals/custom-sidebar.ts"),
7653
}
7754
]

src/Our.Umbraco.UiExamples.v14/src/scripts/modals/custom-dialog.token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type MyModalValue = {
88
myData: string;
99
}
1010

11-
export const MY_DIALOG_TOKEN = new UmbModalToken<MyModalData, MyModalValue>('My.Dialog', {
11+
export const MY_DIALOG_TOKEN = new UmbModalToken<MyModalData, MyModalValue>('example.ui.modals.dialog', {
1212
modal: {
1313
type: 'dialog',
1414
size: 'small'

src/Our.Umbraco.UiExamples.v14/src/scripts/dashboards/custom-modals-dashboard.ts renamed to src/Our.Umbraco.UiExamples.v14/src/scripts/modals/custom-modals-dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LitElement, css, html } from 'lit'
22
import { customElement, property } from 'lit/decorators.js'
3-
import { MY_DIALOG_TOKEN } from '../modals/custom-dialog.token';
4-
import { MY_SIDEBAR_TOKEN } from '../modals/custom-sidebar.token';
3+
import { MY_DIALOG_TOKEN } from './custom-dialog.token';
4+
import { MY_SIDEBAR_TOKEN } from './custom-sidebar.token';
55
import { UMB_MODAL_MANAGER_CONTEXT, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CONFIRM_MODAL, UMB_CODE_EDITOR_MODAL } from '@umbraco-cms/backoffice/modal';
66
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
77

src/Our.Umbraco.UiExamples.v14/src/scripts/modals/custom-sidebar.token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type MySidebarValue = {
99
myText: string;
1010
}
1111

12-
export const MY_SIDEBAR_TOKEN = new UmbModalToken<MySidebarData, MySidebarValue>('My.Sidebar', {
12+
export const MY_SIDEBAR_TOKEN = new UmbModalToken<MySidebarData, MySidebarValue>('example.ui.modals.sidebar', {
1313
modal: {
1414
type: 'sidebar',
1515
size: 'large'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
2+
3+
export const manifests: Array<ManifestTypes> = [
4+
{
5+
"type": "dashboard",
6+
"alias": "example.ui.modals.dashboard",
7+
"name": "Modals",
8+
"element": () => import("./custom-modals-dashboard.ts"),
9+
"weight": -1,
10+
"meta": {
11+
"label": "Modals",
12+
"pathname": "modals"
13+
},
14+
"conditions": [
15+
{
16+
"alias": "Umb.Condition.SectionAlias",
17+
"match": "example.ui.section"
18+
}
19+
]
20+
},
21+
{
22+
"type": "modal",
23+
"alias": "example.ui.modals.dialog",
24+
"name": "My Dialog",
25+
"element": () => import("./custom-dialog.ts"),
26+
},
27+
{
28+
"type": "modal",
29+
"alias": "example.ui.modals.sidebar",
30+
"name": "My Sidebar Modal",
31+
"element": () => import("./custom-sidebar.ts"),
32+
}
33+
]

0 commit comments

Comments
 (0)