chrome-devtools-frontend 1.0.931927 → 1.0.932859
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/config/gni/devtools_grd_files.gni +3 -0
- package/front_end/core/i18n/locales/af.json +220 -100
- package/front_end/core/i18n/locales/am.json +220 -100
- package/front_end/core/i18n/locales/ar.json +220 -100
- package/front_end/core/i18n/locales/as.json +225 -105
- package/front_end/core/i18n/locales/az.json +220 -100
- package/front_end/core/i18n/locales/be.json +221 -101
- package/front_end/core/i18n/locales/bg.json +221 -101
- package/front_end/core/i18n/locales/bn.json +225 -105
- package/front_end/core/i18n/locales/bs.json +222 -102
- package/front_end/core/i18n/locales/ca.json +219 -99
- package/front_end/core/i18n/locales/cs.json +220 -100
- package/front_end/core/i18n/locales/cy.json +224 -104
- package/front_end/core/i18n/locales/da.json +220 -100
- package/front_end/core/i18n/locales/de.json +226 -106
- package/front_end/core/i18n/locales/el.json +220 -100
- package/front_end/core/i18n/locales/en-GB.json +219 -99
- package/front_end/core/i18n/locales/en-US.json +6 -0
- package/front_end/core/i18n/locales/en-XL.json +6 -0
- package/front_end/core/i18n/locales/es-419.json +219 -99
- package/front_end/core/i18n/locales/es.json +219 -99
- package/front_end/core/i18n/locales/et.json +219 -99
- package/front_end/core/i18n/locales/eu.json +221 -101
- package/front_end/core/i18n/locales/fa.json +224 -104
- package/front_end/core/i18n/locales/fi.json +219 -99
- package/front_end/core/i18n/locales/fil.json +219 -99
- package/front_end/core/i18n/locales/fr-CA.json +219 -99
- package/front_end/core/i18n/locales/fr.json +220 -100
- package/front_end/core/i18n/locales/gl.json +219 -99
- package/front_end/core/i18n/locales/gu.json +224 -104
- package/front_end/core/i18n/locales/he.json +219 -99
- package/front_end/core/i18n/locales/hi.json +219 -99
- package/front_end/core/i18n/locales/hr.json +219 -99
- package/front_end/core/i18n/locales/hu.json +219 -99
- package/front_end/core/i18n/locales/hy.json +219 -99
- package/front_end/core/i18n/locales/id.json +221 -101
- package/front_end/core/i18n/locales/is.json +219 -99
- package/front_end/core/i18n/locales/it.json +219 -99
- package/front_end/core/i18n/locales/ja.json +221 -101
- package/front_end/core/i18n/locales/ka.json +220 -100
- package/front_end/core/i18n/locales/kk.json +221 -101
- package/front_end/core/i18n/locales/km.json +220 -100
- package/front_end/core/i18n/locales/kn.json +226 -106
- package/front_end/core/i18n/locales/ko.json +219 -99
- package/front_end/core/i18n/locales/ky.json +222 -102
- package/front_end/core/i18n/locales/lo.json +222 -102
- package/front_end/core/i18n/locales/lt.json +219 -99
- package/front_end/core/i18n/locales/lv.json +219 -99
- package/front_end/core/i18n/locales/mk.json +220 -100
- package/front_end/core/i18n/locales/ml.json +224 -104
- package/front_end/core/i18n/locales/mn.json +219 -99
- package/front_end/core/i18n/locales/mr.json +219 -99
- package/front_end/core/i18n/locales/ms.json +219 -99
- package/front_end/core/i18n/locales/my.json +220 -100
- package/front_end/core/i18n/locales/ne.json +224 -104
- package/front_end/core/i18n/locales/nl.json +220 -100
- package/front_end/core/i18n/locales/no.json +219 -99
- package/front_end/core/i18n/locales/or.json +226 -106
- package/front_end/core/i18n/locales/pa.json +220 -100
- package/front_end/core/i18n/locales/pl.json +219 -99
- package/front_end/core/i18n/locales/pt-PT.json +221 -101
- package/front_end/core/i18n/locales/pt.json +221 -101
- package/front_end/core/i18n/locales/ro.json +219 -99
- package/front_end/core/i18n/locales/ru.json +219 -99
- package/front_end/core/i18n/locales/si.json +220 -100
- package/front_end/core/i18n/locales/sk.json +219 -99
- package/front_end/core/i18n/locales/sl.json +226 -106
- package/front_end/core/i18n/locales/sq.json +219 -99
- package/front_end/core/i18n/locales/sr-Latn.json +220 -100
- package/front_end/core/i18n/locales/sr.json +220 -100
- package/front_end/core/i18n/locales/sv.json +224 -104
- package/front_end/core/i18n/locales/sw.json +220 -100
- package/front_end/core/i18n/locales/ta.json +233 -113
- package/front_end/core/i18n/locales/te.json +222 -102
- package/front_end/core/i18n/locales/th.json +219 -99
- package/front_end/core/i18n/locales/tr.json +219 -99
- package/front_end/core/i18n/locales/uk.json +219 -99
- package/front_end/core/i18n/locales/ur.json +219 -99
- package/front_end/core/i18n/locales/uz.json +219 -99
- package/front_end/core/i18n/locales/vi.json +219 -99
- package/front_end/core/i18n/locales/zh-HK.json +229 -109
- package/front_end/core/i18n/locales/zh-TW.json +228 -108
- package/front_end/core/i18n/locales/zh.json +234 -114
- package/front_end/core/i18n/locales/zu.json +219 -99
- package/front_end/core/protocol_client/InspectorBackend.ts +0 -8
- package/front_end/core/sdk/ChildTargetManager.ts +2 -0
- package/front_end/core/sdk/Target.ts +4 -0
- package/front_end/generated/InspectorBackendCommands.js +8 -17
- package/front_end/generated/protocol-mapping.d.ts +2 -37
- package/front_end/generated/protocol-proxy-api.d.ts +2 -46
- package/front_end/generated/protocol.d.ts +6 -127
- package/front_end/models/issues_manager/CorsIssue.ts +4 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +0 -5
- package/front_end/panels/accessibility/AccessibilityStrings.ts +15 -0
- package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -2
- package/front_end/panels/security/mainView.css +2 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +21 -9
- package/front_end/panels/sources/JavaScriptBreakpointsSidebarPane.ts +14 -1
- package/front_end/panels/sources/javaScriptBreakpointsSidebarPane.css +52 -2
- package/front_end/ui/components/buttons/Button.ts +22 -6
- package/front_end/ui/components/buttons/button.css +50 -4
- package/front_end/ui/components/docs/button/basic.html +28 -0
- package/front_end/ui/components/docs/button/basic.ts +43 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +69 -0
- package/front_end/ui/components/settings/settingCheckbox.css +31 -0
- package/front_end/ui/components/settings/settings.ts +7 -0
- package/front_end/ui/components/text_editor/theme.ts +3 -0
- package/front_end/ui/legacy/SettingsUI.ts +6 -2
- package/front_end/ui/legacy/components/color_picker/spectrum.css +4 -0
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +0 -2
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -0
- package/package.json +1 -1
|
@@ -24,12 +24,62 @@
|
|
|
24
24
|
background-color: var(--color-background-elevation-1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.breakpoint-entry > .source
|
|
27
|
+
.breakpoint-entry > .decoration-and-source {
|
|
28
|
+
display: flex;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.breakpoint-entry .breakpoint {
|
|
32
|
+
content: var(--inline-breakpoint-enabled);
|
|
33
|
+
height: 12px;
|
|
34
|
+
top: 1px;
|
|
35
|
+
position: relative;
|
|
36
|
+
width: 11px;
|
|
37
|
+
margin-left: 3px;
|
|
38
|
+
margin-right: 3px;
|
|
39
|
+
|
|
40
|
+
--inline-breakpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%234285F4" stroke="%231A73E8"/></svg>');
|
|
41
|
+
--inline-breakpoint-disabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%234285F4" fill-opacity="0.2" stroke="%231A73E8"/></svg>');
|
|
42
|
+
--inline-conditional-breakpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.75489 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.75489 11.2583 6.29382 11.5 5.80138 11.5H0.5V0.5Z" fill="%23F29900" stroke="%23E37400"/><path d="M3.51074 7.75635H4.68408V9H3.51074V7.75635ZM4.68408 7.23779H3.51074V6.56104C3.51074 6.271 3.55615 6.02344 3.64697 5.81836C3.73779 5.61328 3.90039 5.39648 4.13477 5.16797L4.53027 4.77686C4.71484 4.59814 4.83936 4.4502 4.90381 4.33301C4.97119 4.21582 5.00488 4.09424 5.00488 3.96826C5.00488 3.77197 4.9375 3.62402 4.80273 3.52441C4.66797 3.4248 4.46582 3.375 4.19629 3.375C3.9502 3.375 3.69238 3.42773 3.42285 3.5332C3.15625 3.63574 2.88232 3.78955 2.60107 3.99463V2.81689C2.88818 2.65283 3.17822 2.52979 3.47119 2.44775C3.76709 2.36279 4.06299 2.32031 4.35889 2.32031C4.95068 2.32031 5.41504 2.45801 5.75195 2.7334C6.08887 3.00879 6.25732 3.38818 6.25732 3.87158C6.25732 4.09424 6.20752 4.30225 6.10791 4.49561C6.0083 4.68604 5.8208 4.91602 5.54541 5.18555L5.15869 5.56348C4.95947 5.75684 4.83203 5.91504 4.77637 6.03809C4.7207 6.16113 4.69287 6.31201 4.69287 6.49072C4.69287 6.51709 4.69141 6.54785 4.68848 6.58301C4.68848 6.61816 4.68701 6.65625 4.68408 6.69727V7.23779Z" fill="white"/></svg>');
|
|
43
|
+
--inline-conditional-breakpoint-disabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.75489 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.75489 11.2583 6.29382 11.5 5.80138 11.5H0.5V0.5Z" fill="%23F9AB00" fill-opacity="0.2" stroke="%23E37400"/><path d="M3.51074 7.75635H4.68408V9H3.51074V7.75635ZM4.68408 7.23779H3.51074V6.56104C3.51074 6.271 3.55615 6.02344 3.64697 5.81836C3.73779 5.61328 3.90039 5.39648 4.13477 5.16797L4.53027 4.77686C4.71484 4.59814 4.83936 4.4502 4.90381 4.33301C4.97119 4.21582 5.00488 4.09424 5.00488 3.96826C5.00488 3.77197 4.9375 3.62402 4.80273 3.52441C4.66797 3.4248 4.46582 3.375 4.19629 3.375C3.9502 3.375 3.69238 3.42773 3.42285 3.5332C3.15625 3.63574 2.88232 3.78955 2.60107 3.99463V2.81689C2.88818 2.65283 3.17822 2.52979 3.47119 2.44775C3.76709 2.36279 4.06299 2.32031 4.35889 2.32031C4.95068 2.32031 5.41504 2.45801 5.75195 2.7334C6.08887 3.00879 6.25732 3.38818 6.25732 3.87158C6.25732 4.09424 6.20752 4.30225 6.10791 4.49561C6.0083 4.68604 5.8208 4.91602 5.54541 5.18555L5.15869 5.56348C4.95947 5.75684 4.83203 5.91504 4.77637 6.03809C4.7207 6.16113 4.69287 6.31201 4.69287 6.49072C4.69287 6.51709 4.69141 6.54785 4.68848 6.58301C4.68848 6.61816 4.68701 6.65625 4.68408 6.69727V7.23779Z" fill="%23E37400"/></svg>');
|
|
44
|
+
--inline-logpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%23F439A0" stroke="%23D01884"/><circle cx="3" cy="6" r="1" fill="white"/><circle cx="7" cy="6" r="1" fill="white"/></svg>');
|
|
45
|
+
--inline-logpoint-disabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%23F439A0" fill-opacity="0.2" stroke="%23D01884"/><circle cx="3" cy="6" r="1" fill="%23D01884"/><circle cx="7" cy="6" r="1" fill="%23D01884"/></svg>');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.breakpoint-entry .breakpoint.disabled,
|
|
49
|
+
.breakpoints-list-deactivated .breakpoint-entry .breakpoint {
|
|
50
|
+
content: var(--inline-breakpoint-disabled);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host-context(.-theme-with-dark-background) .breakpoint-entry .breakpoint {
|
|
54
|
+
--inline-breakpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%235186EC" stroke="%231A73E8"/></svg>');
|
|
55
|
+
--inline-conditional-breakpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.75489 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.75489 11.2583 6.29382 11.5 5.80138 11.5H0.5V0.5Z" fill="%23e9a33a" stroke="%23E37400"/><path d="M3.51074 7.75635H4.68408V9H3.51074V7.75635ZM4.68408 7.23779H3.51074V6.56104C3.51074 6.271 3.55615 6.02344 3.64697 5.81836C3.73779 5.61328 3.90039 5.39648 4.13477 5.16797L4.53027 4.77686C4.71484 4.59814 4.83936 4.4502 4.90381 4.33301C4.97119 4.21582 5.00488 4.09424 5.00488 3.96826C5.00488 3.77197 4.9375 3.62402 4.80273 3.52441C4.66797 3.4248 4.46582 3.375 4.19629 3.375C3.9502 3.375 3.69238 3.42773 3.42285 3.5332C3.15625 3.63574 2.88232 3.78955 2.60107 3.99463V2.81689C2.88818 2.65283 3.17822 2.52979 3.47119 2.44775C3.76709 2.36279 4.06299 2.32031 4.35889 2.32031C4.95068 2.32031 5.41504 2.45801 5.75195 2.7334C6.08887 3.00879 6.25732 3.38818 6.25732 3.87158C6.25732 4.09424 6.20752 4.30225 6.10791 4.49561C6.0083 4.68604 5.8208 4.91602 5.54541 5.18555L5.15869 5.56348C4.95947 5.75684 4.83203 5.91504 4.77637 6.03809C4.7207 6.16113 4.69287 6.31201 4.69287 6.49072C4.69287 6.51709 4.69141 6.54785 4.68848 6.58301C4.68848 6.61816 4.68701 6.65625 4.68408 6.69727V7.23779Z" fill="white"/></svg>');
|
|
56
|
+
--inline-logpoint-enabled: url('data:image/svg+xml,<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.5 0.5H5.80139C6.29382 0.5 6.7549 0.741701 7.03503 1.14669L10.392 6L7.03503 10.8533C6.7549 11.2583 6.29382 11.5 5.80139 11.5H0.5V0.5Z" fill="%23E54D9B" stroke="%23D01884"/><circle cx="3" cy="6" r="1" fill="white"/><circle cx="7" cy="6" r="1" fill="white"/></svg>');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.breakpoint-entry .breakpoint-conditional {
|
|
60
|
+
content: var(--inline-conditional-breakpoint-enabled);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.breakpoint-entry .breakpoint-conditional.disabled,
|
|
64
|
+
.breakpoints-list-deactivated .breakpoint-entry .breakpoint-conditional {
|
|
65
|
+
content: var(--inline-conditional-breakpoint-disabled);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.breakpoint-entry .logpoint {
|
|
69
|
+
content: var(--inline-logpoint-enabled);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.breakpoint-entry .logpoint.disabled,
|
|
73
|
+
.breakpoints-list-deactivated .breakpoint-entry .logpoint {
|
|
74
|
+
content: var(--inline-logpoint-disabled);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.breakpoint-entry .source-text {
|
|
28
78
|
cursor: pointer;
|
|
29
79
|
text-overflow: ellipsis;
|
|
30
80
|
overflow: hidden;
|
|
31
81
|
white-space: nowrap;
|
|
32
|
-
margin-left:
|
|
82
|
+
margin-left: 4px;
|
|
33
83
|
}
|
|
34
84
|
|
|
35
85
|
.breakpoints-list-deactivated {
|
|
@@ -17,6 +17,7 @@ declare global {
|
|
|
17
17
|
export const enum Variant {
|
|
18
18
|
PRIMARY = 'primary',
|
|
19
19
|
SECONDARY = 'secondary',
|
|
20
|
+
TOOLBAR = 'toolbar',
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const enum Size {
|
|
@@ -24,21 +25,27 @@ export const enum Size {
|
|
|
24
25
|
MEDIUM = 'MEDIUM',
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
interface
|
|
28
|
+
interface ButtonState {
|
|
28
29
|
iconUrl?: string;
|
|
29
30
|
variant?: Variant;
|
|
30
31
|
size?: Size;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
export
|
|
34
|
-
variant: Variant
|
|
35
|
-
|
|
34
|
+
export type ButtonData = {
|
|
35
|
+
variant: Variant.TOOLBAR,
|
|
36
|
+
iconUrl: string,
|
|
37
|
+
size?: Size,
|
|
38
|
+
}|{
|
|
39
|
+
variant: Variant.PRIMARY | Variant.SECONDARY,
|
|
40
|
+
iconUrl?: string,
|
|
41
|
+
size?: Size,
|
|
42
|
+
};
|
|
36
43
|
|
|
37
44
|
export class Button extends HTMLElement {
|
|
38
45
|
static readonly litTagName = LitHtml.literal`devtools-button`;
|
|
39
46
|
private readonly shadow = this.attachShadow({mode: 'open', delegatesFocus: true});
|
|
40
47
|
private readonly boundRender = this.render.bind(this);
|
|
41
|
-
private readonly props:
|
|
48
|
+
private readonly props: ButtonState = {
|
|
42
49
|
size: Size.MEDIUM,
|
|
43
50
|
};
|
|
44
51
|
private isEmpty = true;
|
|
@@ -52,7 +59,7 @@ export class Button extends HTMLElement {
|
|
|
52
59
|
* Perfer using the .data= setter instead of setting the individual properties
|
|
53
60
|
* for increased type-safety.
|
|
54
61
|
*/
|
|
55
|
-
set data(data:
|
|
62
|
+
set data(data: ButtonData) {
|
|
56
63
|
this.props.variant = data.variant;
|
|
57
64
|
this.props.iconUrl = data.iconUrl;
|
|
58
65
|
this.props.size = data.size || Size.MEDIUM;
|
|
@@ -94,9 +101,18 @@ export class Button extends HTMLElement {
|
|
|
94
101
|
if (!this.props.variant) {
|
|
95
102
|
throw new Error('Button requires a variant to be defined');
|
|
96
103
|
}
|
|
104
|
+
if (this.props.variant === Variant.TOOLBAR) {
|
|
105
|
+
if (!this.props.iconUrl) {
|
|
106
|
+
throw new Error('Toolbar button requires an icon');
|
|
107
|
+
}
|
|
108
|
+
if (!this.isEmpty) {
|
|
109
|
+
throw new Error('Tooblar button does not accept children');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
97
112
|
const classes = {
|
|
98
113
|
primary: this.props.variant === Variant.PRIMARY,
|
|
99
114
|
secondary: this.props.variant === Variant.SECONDARY,
|
|
115
|
+
toolbar: this.props.variant === Variant.TOOLBAR,
|
|
100
116
|
'text-with-icon': Boolean(this.props.iconUrl) && !this.isEmpty,
|
|
101
117
|
'only-icon': Boolean(this.props.iconUrl) && this.isEmpty,
|
|
102
118
|
small: Boolean(this.props.size === Size.SMALL),
|
|
@@ -21,13 +21,18 @@
|
|
|
21
21
|
outline: none;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
button {
|
|
25
30
|
align-items: center;
|
|
26
31
|
border-radius: 4px;
|
|
27
32
|
display: inline-flex;
|
|
28
33
|
font-family: inherit;
|
|
29
34
|
font-size: 12px;
|
|
30
|
-
height:
|
|
35
|
+
height: 24px;
|
|
31
36
|
line-height: 14px;
|
|
32
37
|
padding: 5px 12px;
|
|
33
38
|
justify-content: center;
|
|
@@ -47,6 +52,23 @@ button:hover {
|
|
|
47
52
|
cursor: pointer;
|
|
48
53
|
}
|
|
49
54
|
|
|
55
|
+
button.toolbar {
|
|
56
|
+
background: transparent;
|
|
57
|
+
border-radius: 2px;
|
|
58
|
+
border: none;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
height: 24px;
|
|
61
|
+
width: 24px;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
padding: 0;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button.toolbar.small {
|
|
68
|
+
height: 18px;
|
|
69
|
+
width: 18px;
|
|
70
|
+
}
|
|
71
|
+
|
|
50
72
|
button.primary {
|
|
51
73
|
border: 1px solid var(--color-primary);
|
|
52
74
|
background: var(--color-primary);
|
|
@@ -86,6 +108,18 @@ button.secondary:active:focus-visible {
|
|
|
86
108
|
border: 1px solid var(--color-button-secondary-background-pressed);
|
|
87
109
|
}
|
|
88
110
|
|
|
111
|
+
button.toolbar:hover {
|
|
112
|
+
background-color: var(--color-button-secondary-background-hovering);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
button.toolbar:active {
|
|
116
|
+
background-color: var(--color-button-secondary-background-pressed);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
button.toolbar:focus-visible {
|
|
120
|
+
background-color: var(--color-background-elevation-2);
|
|
121
|
+
}
|
|
122
|
+
|
|
89
123
|
button.text-with-icon {
|
|
90
124
|
padding: 0 12px 0 4px;
|
|
91
125
|
}
|
|
@@ -103,9 +137,11 @@ button devtools-icon {
|
|
|
103
137
|
height: 19px;
|
|
104
138
|
}
|
|
105
139
|
|
|
106
|
-
button.
|
|
107
|
-
width:
|
|
108
|
-
height:
|
|
140
|
+
button.toolbar devtools-icon {
|
|
141
|
+
width: 24px;
|
|
142
|
+
height: 24px;
|
|
143
|
+
|
|
144
|
+
--icon-color: var(--color-text-primary);
|
|
109
145
|
}
|
|
110
146
|
|
|
111
147
|
button.primary devtools-icon {
|
|
@@ -115,3 +151,13 @@ button.primary devtools-icon {
|
|
|
115
151
|
button.secondary devtools-icon {
|
|
116
152
|
--icon-color: var(--color-primary);
|
|
117
153
|
}
|
|
154
|
+
|
|
155
|
+
button.small devtools-icon {
|
|
156
|
+
width: 14px;
|
|
157
|
+
height: 14px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
button.toolbar.small devtools-icon {
|
|
161
|
+
width: 18px;
|
|
162
|
+
height: 18px;
|
|
163
|
+
}
|
|
@@ -19,11 +19,39 @@
|
|
|
19
19
|
#container > * {
|
|
20
20
|
margin-right: 10px;
|
|
21
21
|
}
|
|
22
|
+
#toolbar {
|
|
23
|
+
background-color: var(--color-background);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
align-items: center;
|
|
27
|
+
border-bottom: 1px solid var(--color-details-hairline);
|
|
28
|
+
padding: 0px 5px;
|
|
29
|
+
height: 29px;
|
|
30
|
+
}
|
|
31
|
+
#small-toolbar {
|
|
32
|
+
background-color: var(--color-background);
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
align-items: center;
|
|
36
|
+
border-bottom: 1px solid var(--color-details-hairline);
|
|
37
|
+
padding: 0px 5px;
|
|
38
|
+
height: 23px;
|
|
39
|
+
}
|
|
40
|
+
.separator {
|
|
41
|
+
background-color: var(--color-details-hairline);
|
|
42
|
+
width: 1px;
|
|
43
|
+
height: 17px;
|
|
44
|
+
margin: 0px 5px;
|
|
45
|
+
}
|
|
22
46
|
</style>
|
|
23
47
|
</head>
|
|
24
48
|
<body>
|
|
25
49
|
<div id="container">
|
|
26
50
|
</div>
|
|
51
|
+
<div id="toolbar">
|
|
52
|
+
</div>
|
|
53
|
+
<div id="small-toolbar">
|
|
54
|
+
</div>
|
|
27
55
|
<script type="module" src="./basic.js"></script>
|
|
28
56
|
</body>
|
|
29
57
|
</html>
|
|
@@ -15,6 +15,14 @@ function appendButton(button: Buttons.Button.Button): void {
|
|
|
15
15
|
document.querySelector('#container')?.appendChild(button);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function appendToToolbar(element: HTMLElement): void {
|
|
19
|
+
document.querySelector('#toolbar')?.appendChild(element);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function appendToSmallToolbar(element: HTMLElement): void {
|
|
23
|
+
document.querySelector('#small-toolbar')?.appendChild(element);
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
// Primary
|
|
19
27
|
const primaryButton = new Buttons.Button.Button();
|
|
20
28
|
primaryButton.data = {
|
|
@@ -62,13 +70,13 @@ primaryIconOnlyButton.data = {
|
|
|
62
70
|
iconUrl: testIcon,
|
|
63
71
|
};
|
|
64
72
|
primaryIconOnlyButton.onclick = () => alert('clicked');
|
|
65
|
-
primaryIconOnlyButton.style.width = '
|
|
73
|
+
primaryIconOnlyButton.style.width = '24px';
|
|
66
74
|
appendButton(primaryIconOnlyButton);
|
|
67
75
|
|
|
68
76
|
// Secondary Icon Only
|
|
69
77
|
const secondaryIconOnlyButton = new Buttons.Button.Button();
|
|
70
78
|
secondaryIconOnlyButton.onclick = () => alert('clicked');
|
|
71
|
-
secondaryIconOnlyButton.style.width = '
|
|
79
|
+
secondaryIconOnlyButton.style.width = '24px';
|
|
72
80
|
secondaryIconOnlyButton.data = {
|
|
73
81
|
variant: Buttons.Button.Variant.SECONDARY,
|
|
74
82
|
iconUrl: testIcon,
|
|
@@ -96,3 +104,36 @@ smallSecondaryIconOnlyButton.data = {
|
|
|
96
104
|
size: Buttons.Button.Size.SMALL,
|
|
97
105
|
};
|
|
98
106
|
appendButton(smallSecondaryIconOnlyButton);
|
|
107
|
+
|
|
108
|
+
for (let i = 0; i < 6; i++) {
|
|
109
|
+
// Regular Toolbar Button
|
|
110
|
+
const toolbarButton = new Buttons.Button.Button();
|
|
111
|
+
toolbarButton.onclick = () => alert('clicked');
|
|
112
|
+
toolbarButton.data = {
|
|
113
|
+
variant: Buttons.Button.Variant.TOOLBAR,
|
|
114
|
+
iconUrl: testIcon,
|
|
115
|
+
};
|
|
116
|
+
appendToToolbar(toolbarButton);
|
|
117
|
+
if (i % 3 === 1) {
|
|
118
|
+
const sep = document.createElement('div');
|
|
119
|
+
sep.classList.add('separator');
|
|
120
|
+
appendToToolbar(sep);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for (let i = 0; i < 6; i++) {
|
|
125
|
+
// Small Toolbar Button
|
|
126
|
+
const smallToolbarButton = new Buttons.Button.Button();
|
|
127
|
+
smallToolbarButton.onclick = () => alert('clicked');
|
|
128
|
+
smallToolbarButton.data = {
|
|
129
|
+
variant: Buttons.Button.Variant.TOOLBAR,
|
|
130
|
+
size: Buttons.Button.Size.SMALL,
|
|
131
|
+
iconUrl: testIcon,
|
|
132
|
+
};
|
|
133
|
+
appendToSmallToolbar(smallToolbarButton);
|
|
134
|
+
if (i % 3 === 1) {
|
|
135
|
+
const sep = document.createElement('div');
|
|
136
|
+
sep.classList.add('separator');
|
|
137
|
+
appendToSmallToolbar(sep);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import type * as Common from '../../../core/common/common.js';
|
|
6
|
+
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
7
|
+
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
8
|
+
|
|
9
|
+
import settingCheckboxStyles from './settingCheckbox.css.js';
|
|
10
|
+
|
|
11
|
+
export interface SettingCheckboxData {
|
|
12
|
+
setting: Common.Settings.Setting<boolean>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A simple checkbox that is backed by a boolean setting.
|
|
17
|
+
*/
|
|
18
|
+
export class SettingCheckbox extends HTMLElement {
|
|
19
|
+
static readonly litTagName = LitHtml.literal`setting-checkbox`;
|
|
20
|
+
private readonly shadow = this.attachShadow({mode: 'open'});
|
|
21
|
+
|
|
22
|
+
private setting?: Common.Settings.Setting<boolean>;
|
|
23
|
+
private changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
|
|
24
|
+
|
|
25
|
+
connectedCallback(): void {
|
|
26
|
+
this.shadow.adoptedStyleSheets = [settingCheckboxStyles];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
set data(data: SettingCheckboxData) {
|
|
30
|
+
if (this.changeListenerDescriptor && this.setting) {
|
|
31
|
+
this.setting.removeChangeListener(this.changeListenerDescriptor.listener);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.setting = data.setting;
|
|
35
|
+
|
|
36
|
+
this.changeListenerDescriptor = this.setting.addChangeListener(() => {
|
|
37
|
+
this.render();
|
|
38
|
+
});
|
|
39
|
+
this.render();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private render(): void {
|
|
43
|
+
if (!this.setting) {
|
|
44
|
+
throw new Error('No "Setting" object provided for rendering');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
LitHtml.render(
|
|
48
|
+
LitHtml.html`
|
|
49
|
+
<p>
|
|
50
|
+
<label>
|
|
51
|
+
<input type="checkbox" ?checked=${this.setting.get()} @change="${this.checkboxChanged}" aria-label="${
|
|
52
|
+
this.setting.title()}" /> ${this.setting.title()}
|
|
53
|
+
</label>
|
|
54
|
+
</p>`,
|
|
55
|
+
this.shadow, {host: this});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private checkboxChanged(e: Event): void {
|
|
59
|
+
this.setting?.set((e.target as HTMLInputElement).checked);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
ComponentHelpers.CustomElements.defineComponent('setting-checkbox', SettingCheckbox);
|
|
64
|
+
|
|
65
|
+
declare global {
|
|
66
|
+
interface HTMLElementTagNameMap {
|
|
67
|
+
'setting-checkbox': SettingCheckbox;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
padding: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
input {
|
|
13
|
+
height: 12px;
|
|
14
|
+
width: 12px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
label {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
p {
|
|
25
|
+
margin: 12px 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Preserve look of legacy checkboxes in dark mode */
|
|
29
|
+
:host-context(.-theme-with-dark-background) input[type="checkbox"]:not(.-theme-preserve) {
|
|
30
|
+
filter: invert(80%);
|
|
31
|
+
}
|
|
@@ -7,6 +7,9 @@ import * as CM from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
|
7
7
|
export const editorTheme = CM.EditorView.theme({
|
|
8
8
|
'&.cm-editor': {
|
|
9
9
|
color: 'color: var(--color-text-primary)',
|
|
10
|
+
'&.cm-focused': {
|
|
11
|
+
outline: 'none',
|
|
12
|
+
},
|
|
10
13
|
},
|
|
11
14
|
|
|
12
15
|
'.cm-scroller': {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
import * as Common from '../../core/common/common.js';
|
|
32
32
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
33
|
+
import * as Settings from '../components/settings/settings.js';
|
|
33
34
|
|
|
34
35
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
35
36
|
import {InspectorView} from './InspectorView.js';
|
|
@@ -153,8 +154,11 @@ export const createControlForSetting = function(setting: Common.Settings.Setting
|
|
|
153
154
|
null {
|
|
154
155
|
const uiTitle = setting.title();
|
|
155
156
|
switch (setting.type()) {
|
|
156
|
-
case Common.Settings.SettingType.BOOLEAN:
|
|
157
|
-
|
|
157
|
+
case Common.Settings.SettingType.BOOLEAN: {
|
|
158
|
+
const component = new Settings.SettingCheckbox.SettingCheckbox();
|
|
159
|
+
component.data = {setting: setting as Common.Settings.Setting<boolean>};
|
|
160
|
+
return component;
|
|
161
|
+
}
|
|
158
162
|
case Common.Settings.SettingType.ENUM:
|
|
159
163
|
if (Array.isArray(setting.options())) {
|
|
160
164
|
return createSettingSelect(uiTitle, setting.options(), setting.reloadRequired(), setting, subtitle);
|
|
@@ -191,8 +191,6 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
191
191
|
|
|
192
192
|
const headerContainer = this.element.createChild('div', 'header-container');
|
|
193
193
|
this.headerTable = headerContainer.createChild('table', 'header');
|
|
194
|
-
// Hide the header table from screen readers since titles are also added to data table.
|
|
195
|
-
UI.ARIAUtils.markAsHidden(this.headerTable);
|
|
196
194
|
this.headerTableHeaders = {};
|
|
197
195
|
this.scrollContainerInternal = this.element.createChild('div', 'data-container');
|
|
198
196
|
this.dataTable = this.scrollContainerInternal.createChild('table', 'data');
|
package/package.json
CHANGED