@umbraco-cms/backoffice 1.0.0-next.37dcc47c → 1.0.0-next.596cc732

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 CHANGED
@@ -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 "my-package". Choose "lit" and "typescript" when prompted.
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,7 +100,7 @@ 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 add the following code.
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
@@ -111,23 +111,24 @@ import { UmbNotificationContext, UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco
111
111
 
112
112
  @customElement('my-element')
113
113
  export default class MyElement extends UmbElementMixin(LitElement) {
114
- #notificationContext?: UmbNotificationContext;
114
+
115
+ private _notificationContext?: UmbNotificationContext;
115
116
 
116
117
  constructor() {
117
118
  super();
118
119
  this.consumeContext(UMB_NOTIFICATION_CONTEXT_TOKEN, (_instance) => {
119
- this.#notificationContext = _instance;
120
+ this._notificationContext = _instance;
120
121
  });
121
122
  }
122
123
 
123
124
  onClick() {
124
- this.#notificationContext?.peek('positive', { data: { message: '#h5yr' } });
125
+ this._notificationContext?.peek('positive', { data: { message: '#h5yr' } });
125
126
  }
126
127
 
127
128
  render() {
128
129
  return html`
129
130
  <uui-box headline="Welcome">
130
- <p>TS dashboard</p>
131
+ <p>A TypeScript Lit Dashboard</p>
131
132
  <uui-button look="primary" label="Click me" @click=${() => this.onClick()}></uui-button>
132
133
  </uui-box>
133
134
  `;
@@ -141,7 +142,7 @@ declare global {
141
142
  }
142
143
  ```
143
144
 
144
- Finally add an umbraco-package.json file in the root of your package.
145
+ Finally add an umbraco-package.json file in the root of your package folder `my-package`.
145
146
 
146
147
  ```json
147
148
  {