|
1 | 1 | // Copyright 2024 The Chromium Authors. All rights reserved.
|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be
|
3 | 3 | // found in the LICENSE file.
|
4 |
| -/* eslint-disable rulesdir/no-imperative-dom-api */ |
5 |
| -/* eslint-disable rulesdir/no-lit-render-outside-of-view */ |
6 | 4 |
|
7 | 5 | import * as i18n from '../../core/i18n/i18n.js';
|
8 | 6 | import type * as Platform from '../../core/platform/platform.js';
|
@@ -61,15 +59,15 @@ export async function getMarkdownContent(): Promise<Marked.Marked.Token[][]> {
|
61 | 59 | return splitMarkdownAst;
|
62 | 60 | }
|
63 | 61 |
|
64 |
| -export class ReleaseNoteView extends UI.Widget.VBox { |
| 62 | +export class ReleaseNoteView extends UI.Panel.Panel { |
65 | 63 | #view: View;
|
66 | 64 |
|
67 |
| - constructor(element?: HTMLElement, view: View = (input, _output, target) => { |
68 |
| - this.registerRequiredCSS(releaseNoteViewStyles); |
| 65 | + constructor(view: View = (input, _output, target) => { |
69 | 66 | const releaseNote = input.getReleaseNote();
|
70 | 67 | const markdownContent = input.markdownContent;
|
71 | 68 | // clang-format off
|
72 | 69 | render(html`
|
| 70 | + <style>${releaseNoteViewStyles.cssText}</style> |
73 | 71 | <div class="whatsnew" jslog=${VisualLogging.section().context('release-notes')}>
|
74 | 72 | <div class="whatsnew-content">
|
75 | 73 | <div class="header">
|
@@ -104,11 +102,10 @@ export class ReleaseNoteView extends UI.Widget.VBox {
|
104 | 102 | </div>
|
105 | 103 | </div>
|
106 | 104 | </div>
|
107 |
| - `, target, {host: this}); |
| 105 | + `, target, {host: input}); |
108 | 106 | // clang-format on
|
109 | 107 | }) {
|
110 |
| - super(true, undefined, element); |
111 |
| - this.element.setAttribute('jslog', `${VisualLogging.panel().context('whats-new')}`); |
| 108 | + super('whats-new', true); |
112 | 109 | this.#view = view;
|
113 | 110 | this.requestUpdate();
|
114 | 111 | }
|
|
0 commit comments