@umbraco-cms/backoffice 1.0.0-next.37dcc47c → 1.0.0-next.386e13e7
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/README.md +10 -10
- package/backend-api.d.ts +1037 -296
- package/collection.d.ts +38 -0
- package/content-type.d.ts +130 -0
- package/context-api.d.ts +116 -6
- package/{controller.d.ts → controller-api.d.ts} +7 -7
- package/custom-elements.json +9210 -0
- package/data-type.d.ts +13 -0
- package/{element.d.ts → element-api.d.ts} +9 -7
- package/entity-action.d.ts +29 -19
- package/extension-api.d.ts +668 -0
- package/extension-registry.d.ts +484 -0
- package/id.d.ts +6 -0
- package/modal.d.ts +481 -30
- package/models.d.ts +13 -71
- package/notification.d.ts +1 -1
- package/observable-api.d.ts +91 -49
- package/package.json +7 -4
- package/picker-input.d.ts +25 -0
- package/repository.d.ts +131 -40
- package/resources.d.ts +11 -15
- package/router.d.ts +370 -0
- package/section.d.ts +29 -0
- package/sorter.d.ts +103 -0
- package/store.d.ts +93 -52
- package/tree.d.ts +136 -0
- package/umbraco-package-schema.json +37834 -0
- package/utils.d.ts +29 -7
- package/variant.d.ts +21 -0
- package/vscode-html-custom-data.json +3673 -0
- package/workspace.d.ts +72 -20
- package/extensions-api.d.ts +0 -66
- package/extensions-registry.d.ts +0 -390
- package/property-editor.d.ts +0 -8
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Create an umbraco-package.json file in the root of your package.
|
|
|
40
40
|
Then create a dashboard.js file the same folder.
|
|
41
41
|
|
|
42
42
|
```javascript
|
|
43
|
-
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
|
43
|
+
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
|
44
44
|
import { UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/notification';
|
|
45
45
|
|
|
46
46
|
const template = document.createElement('template');
|
|
@@ -87,10 +87,10 @@ customElements.define('my-custom-dashboard', MyDashboardElement);
|
|
|
87
87
|
|
|
88
88
|
### TypeScript with Lit
|
|
89
89
|
|
|
90
|
-
First install Lit and Vite. This command will create a new folder called
|
|
90
|
+
First install Lit and Vite. This command will create a new folder called `my-package` which will have the Vite tooling and Lit for WebComponent development setup.
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
npm create vite@latest my-package
|
|
93
|
+
npm create vite@latest -- --template lit-ts my-package
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Go to the new folder and install the backoffice package.
|
|
@@ -100,34 +100,34 @@ cd my-package
|
|
|
100
100
|
npm install -D @umbraco-cms/backoffice
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
Then go to the element located in `src/my-element.ts` and
|
|
103
|
+
Then go to the element located in `src/my-element.ts` and replace it with the following code.
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
106
|
// src/my-element.ts
|
|
107
107
|
import { LitElement, html } from 'lit';
|
|
108
108
|
import { customElement } from 'lit/decorators.js';
|
|
109
|
-
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
|
109
|
+
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
|
110
110
|
import { UmbNotificationContext, UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/notification';
|
|
111
111
|
|
|
112
112
|
@customElement('my-element')
|
|
113
113
|
export default class MyElement extends UmbElementMixin(LitElement) {
|
|
114
|
-
|
|
114
|
+
private _notificationContext?: UmbNotificationContext;
|
|
115
115
|
|
|
116
116
|
constructor() {
|
|
117
117
|
super();
|
|
118
118
|
this.consumeContext(UMB_NOTIFICATION_CONTEXT_TOKEN, (_instance) => {
|
|
119
|
-
this
|
|
119
|
+
this._notificationContext = _instance;
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
onClick() {
|
|
124
|
-
this
|
|
124
|
+
this._notificationContext?.peek('positive', { data: { message: '#h5yr' } });
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
render() {
|
|
128
128
|
return html`
|
|
129
129
|
<uui-box headline="Welcome">
|
|
130
|
-
<p>
|
|
130
|
+
<p>A TypeScript Lit Dashboard</p>
|
|
131
131
|
<uui-button look="primary" label="Click me" @click=${() => this.onClick()}></uui-button>
|
|
132
132
|
</uui-box>
|
|
133
133
|
`;
|
|
@@ -141,7 +141,7 @@ declare global {
|
|
|
141
141
|
}
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
Finally add an umbraco-package.json file in the root of your package
|
|
144
|
+
Finally add an umbraco-package.json file in the root of your package folder `my-package`.
|
|
145
145
|
|
|
146
146
|
```json
|
|
147
147
|
{
|