chrome-devtools-frontend 1.0.1567721 → 1.0.1568864

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.
@@ -4,8 +4,10 @@
4
4
  /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
5
 
6
6
  import '../../../ui/kit/kit.js';
7
+ import '../../../ui/legacy/legacy.js';
7
8
 
8
9
  import * as i18n from '../../../core/i18n/i18n.js';
10
+ import * as Input from '../../../ui/components/input/input.js';
9
11
  import * as Lit from '../../../ui/lit/lit.js';
10
12
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
11
13
 
@@ -25,6 +27,10 @@ const UIStrings = {
25
27
  * @example {row} propertyValue
26
28
  */
27
29
  deselectButton: 'Remove {propertyName}: {propertyValue}',
30
+ /**
31
+ * @description Label for the dense checkbox in the grid-auto-flow editor.
32
+ */
33
+ denseLabel: 'Dense',
28
34
  } as const;
29
35
  const str_ = i18n.i18n.registerUIStrings('panels/elements/components/StylePropertyEditor.ts', UIStrings);
30
36
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -89,6 +95,7 @@ export class StylePropertyEditor extends HTMLElement {
89
95
  // clang-format off
90
96
  render(html`
91
97
  <style>${stylePropertyEditorStyles}</style>
98
+ <style>${Input.checkboxStyles}</style>
92
99
  <div class="container">
93
100
  ${this.editableProperties.map(prop => this.#renderProperty(prop))}
94
101
  </div>
@@ -106,6 +113,12 @@ export class StylePropertyEditor extends HTMLElement {
106
113
  'property-value': true,
107
114
  'not-authored': notAuthored,
108
115
  });
116
+
117
+ // Special handling for grid-auto-flow with dense checkbox
118
+ if (prop.propertyName === 'grid-auto-flow') {
119
+ return this.#renderGridAutoFlowProperty(prop, shownValue, classes);
120
+ }
121
+
109
122
  return html`<div class="row">
110
123
  <div class="property">
111
124
  <span class="property-name">${prop.propertyName}</span>: <span class=${classes}>${shownValue}</span>
@@ -116,6 +129,55 @@ export class StylePropertyEditor extends HTMLElement {
116
129
  </div>`;
117
130
  }
118
131
 
132
+ #renderGridAutoFlowProperty(
133
+ prop: EditableProperty, shownValue: string|undefined,
134
+ classes: ReturnType<typeof Directives.classMap>): Lit.TemplateResult {
135
+ const authoredValue = this.#authoredProperties.get(prop.propertyName);
136
+
137
+ const isDense = authoredValue === 'dense' || authoredValue === 'row dense' || authoredValue === 'column dense';
138
+ const isRow = authoredValue === 'row' || authoredValue === 'row dense';
139
+ const isColumn = authoredValue === 'column' || authoredValue === 'column dense';
140
+
141
+ return html`<div class="row">
142
+ <div class="property">
143
+ <span class="property-name">${prop.propertyName}</span>: <span class=${classes}>${shownValue}</span>
144
+ </div>
145
+ <div class="buttons">
146
+ ${this.#renderButton('row', prop.propertyName, isRow)}
147
+ ${this.#renderButton('column', prop.propertyName, isColumn)}
148
+ <devtools-checkbox
149
+ .checked=${isDense}
150
+ @change=${(e: Event) => this.#onDenseCheckboxChange(e, isRow, isColumn)}
151
+ >
152
+ ${i18nString(UIStrings.denseLabel)}
153
+ </devtools-checkbox>
154
+ </div>
155
+ </div>`;
156
+ }
157
+
158
+ #onDenseCheckboxChange(e: Event, isRow: boolean, isColumn: boolean): void {
159
+ const checked = (e.target as HTMLInputElement).checked;
160
+ const propertyName = 'grid-auto-flow';
161
+ const currentValue = this.#authoredProperties.get(propertyName);
162
+
163
+ let newValue = '';
164
+ if (isRow) {
165
+ newValue = checked ? 'row dense' : 'row';
166
+ } else if (isColumn) {
167
+ newValue = checked ? 'column dense' : 'column';
168
+ } else {
169
+ newValue = checked ? 'dense' : '';
170
+ }
171
+
172
+ if (currentValue) {
173
+ this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
174
+ }
175
+
176
+ if (newValue) {
177
+ this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
178
+ }
179
+ }
180
+
119
181
  #renderButton(propertyValue: string, propertyName: string, selected = false): Lit.TemplateResult {
120
182
  const query = `${propertyName}: ${propertyValue}`;
121
183
  const iconInfo = this.findIcon(query, this.#computedProperties);
@@ -141,7 +203,30 @@ export class StylePropertyEditor extends HTMLElement {
141
203
  }
142
204
 
143
205
  #onButtonClick(propertyName: string, propertyValue: string, selected: boolean): void {
144
- if (selected) {
206
+ if (propertyName === 'grid-auto-flow') {
207
+ const currentValue = this.#authoredProperties.get(propertyName);
208
+ const isDense = currentValue?.includes('dense') || false;
209
+
210
+ if (selected) {
211
+ const newValue = isDense ? 'dense' : '';
212
+
213
+ if (currentValue) {
214
+ this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
215
+ }
216
+
217
+ if (newValue) {
218
+ this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
219
+ }
220
+ } else {
221
+ const newValue = isDense ? `${propertyValue} dense` : propertyValue;
222
+
223
+ if (currentValue) {
224
+ this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
225
+ }
226
+
227
+ this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
228
+ }
229
+ } else if (selected) {
145
230
  this.dispatchEvent(new PropertyDeselectedEvent(propertyName, propertyValue));
146
231
  } else {
147
232
  this.dispatchEvent(new PropertySelectedEvent(propertyName, propertyValue));
@@ -256,6 +341,13 @@ export const FlexboxEditableProperties = [
256
341
  ];
257
342
 
258
343
  export const GridEditableProperties = [
344
+ {
345
+ propertyName: 'grid-auto-flow',
346
+ propertyValues: [
347
+ 'row',
348
+ 'column',
349
+ ],
350
+ },
259
351
  {
260
352
  propertyName: 'align-content',
261
353
  propertyValues: [
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://chromium.googlesource.com/chromium/src
3
3
  Version: N/A
4
- Revision: 5dd7406e2cf875f110274e22c3bd287d32086055
4
+ Revision: cd78b67fa4902cc7cdd3a0aa6dfedf054e4b43d1
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -422,7 +422,8 @@ export class MenuItem extends HTMLElement {
422
422
  readonly #shadow = this.attachShadow({mode: 'open'});
423
423
  connectedCallback(): void {
424
424
  this.tabIndex = 0;
425
- this.setAttribute('role', 'menuitem');
425
+ this.setAttribute('role', 'option');
426
+ this.setAttribute('aria-selected', String(this.#props.selected));
426
427
  }
427
428
  #props: MenuItemData = {
428
429
  value: '',
@@ -455,6 +456,7 @@ export class MenuItem extends HTMLElement {
455
456
 
456
457
  set selected(selected: boolean) {
457
458
  this.#props.selected = selected;
459
+ this.setAttribute('aria-selected', String(selected));
458
460
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
459
461
  }
460
462
 
@@ -1766,6 +1766,8 @@ export const knownContextValues = new Set([
1766
1766
  'grid-area',
1767
1767
  'grid-auto-columns',
1768
1768
  'grid-auto-flow',
1769
+ 'grid-auto-flow-column',
1770
+ 'grid-auto-flow-row',
1769
1771
  'grid-auto-rows',
1770
1772
  'grid-column',
1771
1773
  'grid-column-end',
package/mcp/mcp.ts CHANGED
@@ -35,6 +35,7 @@ export {
35
35
  export {AgentFocus} from '../front_end/models/ai_assistance/performance/AIContext.js';
36
36
  export {DebuggerWorkspaceBinding} from '../front_end/models/bindings/DebuggerWorkspaceBinding.js';
37
37
  export {CrUXManager} from '../front_end/models/crux-manager/CrUXManager.js';
38
+ export * as Formatter from '../front_end/models/formatter/formatter.js';
38
39
  export {Issue} from '../front_end/models/issues_manager/Issue.js';
39
40
  export {
40
41
  AggregatedIssue,
package/package.json CHANGED
@@ -104,5 +104,5 @@
104
104
  "flat-cache": "6.1.12"
105
105
  }
106
106
  },
107
- "version": "1.0.1567721"
107
+ "version": "1.0.1568864"
108
108
  }