chrome-devtools-frontend 1.0.945579 → 1.0.946920
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/all_devtools_files.gni +0 -7
- package/config/gni/devtools_grd_files.gni +3 -39
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -22
- package/front_end/core/i18n/locales/en-US.json +33 -27
- package/front_end/core/i18n/locales/en-XL.json +33 -27
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSProperty.ts +16 -9
- package/front_end/core/sdk/sdk-meta.ts +20 -8
- package/front_end/devtools_compatibility.js +1 -8
- package/front_end/entrypoints/devtools_app/devtools_app.js +3 -0
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -2
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
- package/front_end/entrypoints/js_app/js_app.js +3 -0
- package/front_end/entrypoints/js_app/js_app.json +1 -2
- package/front_end/entrypoints/main/MainImpl.ts +0 -6
- package/front_end/entrypoints/ndb_app/ndb_app.js +3 -0
- package/front_end/entrypoints/ndb_app/ndb_app.json +1 -2
- package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
- package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
- package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
- package/front_end/entrypoints/node_app/node_app.ts +81 -0
- package/front_end/entrypoints/shell/shell.js +18 -1
- package/front_end/entrypoints/worker_app/worker_app.js +3 -0
- package/front_end/entrypoints/worker_app/worker_app.json +1 -2
- package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
- package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
- package/front_end/models/text_utils/TextUtils.ts +1 -2
- package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
- package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
- package/front_end/panels/elements/elementsTreeOutline.css +0 -13
- package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
- package/front_end/panels/network/NetworkConfigView.ts +10 -0
- package/front_end/panels/network/NetworkItemView.ts +10 -1
- package/front_end/panels/network/networkConfigView.css +5 -0
- package/front_end/panels/profiler/heapProfiler.css +2 -5
- package/front_end/panels/profiler/profilesPanel.css +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +6 -4
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
- package/front_end/panels/sources/DebuggerPlugin.ts +7 -3
- package/front_end/panels/sources/sourcesView.css +0 -130
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +9 -9
- package/front_end/ui/components/buttons/Button.ts +17 -0
- package/front_end/ui/components/buttons/button.css +31 -0
- package/front_end/ui/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/components/docs/button/basic.ts +42 -0
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +0 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +5 -2
- package/front_end/ui/components/text_editor/config.ts +3 -3
- package/front_end/ui/components/text_editor/javascript.ts +28 -10
- package/front_end/ui/components/text_editor/theme.ts +1 -0
- package/front_end/ui/legacy/InspectorView.ts +10 -0
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
- package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -0
- package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
- package/front_end/ui/legacy/legacy-legacy.ts +0 -6
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/legacy/tabbedPane.css +1 -1
- package/package.json +1 -1
- package/scripts/check_gn.js +1 -1
- package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
- package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
- package/scripts/hosted_mode/server.js +17 -2
- package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
- package/front_end/entrypoints/node_app/node_app.js +0 -13
- package/front_end/entrypoints/node_app/node_app.json +0 -4
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
- package/front_end/entrypoints/node_main/node_main.ts +0 -11
- package/front_end/entrypoints/shell/shell-meta-files.ts +0 -22
- package/front_end/entrypoints/shell/shell.json +0 -5
- package/front_end/ui/legacy/TextEditor.ts +0 -82
- package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
- package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
- package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
- package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
- package/front_end/ui/legacy/components/text_editor/module.json +0 -7
- package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
- package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{$ as cursorSubwordForward,_ as cursorSubwordBackward,A as java,a$ as ViewPlugin,a0 as indentLess,a1 as indentMore,a2 as insertNewlineAndIndent,a3 as selectMatchingBracket,a4 as selectSubwordBackward,a5 as selectSubwordForward,a6 as standardKeymap,a7 as toggleComment,a8 as codeFolding,a9 as foldGutter,a_ as scrollPastEnd,aa as foldKeymap,aA as selectNextOccurrence,aB as Annotation,ab as gutter,aC as AnnotationType,ac as GutterMarker,aD as ChangeDesc,ad as gutters,aE as ChangeSet,ae as lineNumberMarkers,aF as Compartment,af as lineNumbers,aG as EditorState,ag as HighlightStyle,aH as Facet,ah as highlightTree,aI as SelectionRange,ai as Tag,aJ as StateEffect,aj as history,aK as StateEffectType,ak as historyKeymap,aL as StateField,al as redo,aM as Transaction,am as redoSelection,aN as StreamLanguage,an as undo,aO as StringStream,ao as undoSelection,aP as Line,ap as css,aQ as Text,aq as html,ar as javascript,aR as
|
|
1
|
+
export{$ as cursorSubwordForward,_ as cursorSubwordBackward,A as java,a$ as ViewPlugin,a0 as indentLess,a1 as indentMore,a2 as insertNewlineAndIndent,a3 as selectMatchingBracket,a4 as selectSubwordBackward,a5 as selectSubwordForward,a6 as standardKeymap,a7 as toggleComment,a8 as codeFolding,a9 as foldGutter,a_ as scrollPastEnd,aa as foldKeymap,aA as selectNextOccurrence,aB as Annotation,ab as gutter,aC as AnnotationType,ac as GutterMarker,aD as ChangeDesc,ad as gutters,aE as ChangeSet,ae as lineNumberMarkers,aF as Compartment,af as lineNumbers,aG as EditorState,ag as HighlightStyle,aH as Facet,ah as highlightTree,aI as SelectionRange,ai as Tag,aJ as StateEffect,aj as history,aK as StateEffectType,ak as historyKeymap,aL as StateField,al as redo,aM as Transaction,am as redoSelection,aN as StreamLanguage,an as undo,aO as StringStream,ao as undoSelection,aP as Line,ap as css,aQ as Text,aq as html,ar as javascript,aR as repositionTooltips,as as ensureSyntaxTree,aS as showTooltip,at as indentOnInput,aT as tooltips,aU as Decoration,au as indentUnit,av as bracketMatching,aV as drawSelection,aW as EditorView,aw as showPanel,ax as Range,aX as highlightSpecialChars,aY as MatchDecorator,ay as RangeSet,az as RangeSetBuilder,aZ as placeholder,B as json,b0 as ViewUpdate,b1 as WidgetType,b2 as TreeCursor,b3 as StyleModule,D as markdown,e as LanguageSupport,F as php,g as NodeType,G as python,h as NodeSet,H as shell,I as wast,j as Language,J as xml,K as acceptCompletion,k as syntaxTree,L as LRParser,m as EditorSelection,M as autocompletion,N as NodeProp,n as Prec,O as closeCompletion,o as keymap,P as Parser,Q as completeAnyWord,R as CompletionContext,S as currentCompletions,T as Tree,t as tags,U as ifNotIn,V as selectedCompletion,W as startCompletion,x as clojure,X as closeBrackets,Y as closeBracketsKeymap,y as coffeescript,z as cpp,Z as cursorMatchingBracket}from"./chunk/codemirror.js";
|
|
2
2
|
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@codemirror/autocomplete": "0.19.
|
|
6
|
+
"@codemirror/autocomplete": "0.19.9",
|
|
7
7
|
"@codemirror/closebrackets": "0.19.0",
|
|
8
8
|
"@codemirror/commands": "0.19.5",
|
|
9
9
|
"@codemirror/comment": "0.19.0",
|
|
10
|
-
"@codemirror/fold": "0.19.
|
|
11
|
-
"@codemirror/gutter": "0.19.
|
|
10
|
+
"@codemirror/fold": "0.19.2",
|
|
11
|
+
"@codemirror/gutter": "0.19.7",
|
|
12
12
|
"@codemirror/highlight": "0.19.6",
|
|
13
13
|
"@codemirror/history": "0.19.0",
|
|
14
14
|
"@codemirror/lang-cpp": "0.19.1",
|
|
15
15
|
"@codemirror/lang-css": "0.19.3",
|
|
16
|
-
"@codemirror/lang-html": "0.19.
|
|
16
|
+
"@codemirror/lang-html": "0.19.4",
|
|
17
17
|
"@codemirror/lang-java": "0.19.1",
|
|
18
18
|
"@codemirror/lang-javascript": "0.19.3",
|
|
19
19
|
"@codemirror/lang-json": "0.19.1",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"@codemirror/lang-python": "0.19.2",
|
|
23
23
|
"@codemirror/lang-wast": "0.19.0",
|
|
24
24
|
"@codemirror/lang-xml": "0.19.2",
|
|
25
|
-
"@codemirror/language": "0.19.
|
|
25
|
+
"@codemirror/language": "0.19.6",
|
|
26
26
|
"@codemirror/legacy-modes": "0.19.0",
|
|
27
27
|
"@codemirror/matchbrackets": "0.19.3",
|
|
28
28
|
"@codemirror/panel": "0.19.0",
|
|
29
29
|
"@codemirror/rangeset": "0.19.2",
|
|
30
|
-
"@codemirror/search": "0.19.
|
|
31
|
-
"@codemirror/state": "0.19.
|
|
30
|
+
"@codemirror/search": "0.19.3",
|
|
31
|
+
"@codemirror/state": "0.19.6",
|
|
32
32
|
"@codemirror/stream-parser": "0.19.2",
|
|
33
33
|
"@codemirror/text": "0.19.5",
|
|
34
34
|
"@codemirror/tooltip": "0.19.10",
|
|
35
|
-
"@codemirror/view": "0.19.
|
|
36
|
-
"@lezer/common": "0.15.
|
|
35
|
+
"@codemirror/view": "0.19.23",
|
|
36
|
+
"@lezer/common": "0.15.10",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
38
38
|
"rollup-plugin-dts": "^4.0.0",
|
|
39
39
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -33,6 +33,7 @@ interface ButtonState {
|
|
|
33
33
|
size?: Size;
|
|
34
34
|
disabled: boolean;
|
|
35
35
|
active: boolean;
|
|
36
|
+
spinner?: boolean;
|
|
36
37
|
type: ButtonType;
|
|
37
38
|
value?: string;
|
|
38
39
|
}
|
|
@@ -43,6 +44,7 @@ export type ButtonData = {
|
|
|
43
44
|
size?: Size,
|
|
44
45
|
disabled?: boolean,
|
|
45
46
|
active?: boolean,
|
|
47
|
+
spinner?: boolean,
|
|
46
48
|
type?: ButtonType,
|
|
47
49
|
value?: string,
|
|
48
50
|
}|{
|
|
@@ -51,6 +53,7 @@ export type ButtonData = {
|
|
|
51
53
|
size?: Size,
|
|
52
54
|
disabled?: boolean,
|
|
53
55
|
active?: boolean,
|
|
56
|
+
spinner?: boolean,
|
|
54
57
|
type?: ButtonType,
|
|
55
58
|
value?: string,
|
|
56
59
|
};
|
|
@@ -74,6 +77,7 @@ export class Button extends HTMLElement {
|
|
|
74
77
|
size: Size.MEDIUM,
|
|
75
78
|
disabled: false,
|
|
76
79
|
active: false,
|
|
80
|
+
spinner: false,
|
|
77
81
|
type: 'button',
|
|
78
82
|
};
|
|
79
83
|
#isEmpty = true;
|
|
@@ -94,6 +98,7 @@ export class Button extends HTMLElement {
|
|
|
94
98
|
this.#props.iconUrl = data.iconUrl;
|
|
95
99
|
this.#props.size = data.size || Size.MEDIUM;
|
|
96
100
|
this.#props.active = Boolean(data.active);
|
|
101
|
+
this.#props.spinner = Boolean(data.spinner);
|
|
97
102
|
this.#props.type = data.type || 'button';
|
|
98
103
|
this.setDisabledProperty(data.disabled || false);
|
|
99
104
|
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
@@ -129,6 +134,11 @@ export class Button extends HTMLElement {
|
|
|
129
134
|
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
130
135
|
}
|
|
131
136
|
|
|
137
|
+
set spinner(spinner: boolean) {
|
|
138
|
+
this.#props.spinner = spinner;
|
|
139
|
+
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
140
|
+
}
|
|
141
|
+
|
|
132
142
|
private setDisabledProperty(disabled: boolean): void {
|
|
133
143
|
this.#props.disabled = disabled;
|
|
134
144
|
this.toggleAttribute('disabled', disabled);
|
|
@@ -189,6 +199,12 @@ export class Button extends HTMLElement {
|
|
|
189
199
|
small: Boolean(this.#props.size === Size.SMALL),
|
|
190
200
|
active: this.#props.active,
|
|
191
201
|
};
|
|
202
|
+
const spinnerClasses = {
|
|
203
|
+
primary: this.#props.variant === Variant.PRIMARY,
|
|
204
|
+
secondary: this.#props.variant === Variant.SECONDARY,
|
|
205
|
+
disabled: Boolean(this.#props.disabled),
|
|
206
|
+
'spinner-component': true,
|
|
207
|
+
};
|
|
192
208
|
// clang-format off
|
|
193
209
|
LitHtml.render(
|
|
194
210
|
LitHtml.html`
|
|
@@ -200,6 +216,7 @@ export class Button extends HTMLElement {
|
|
|
200
216
|
} as IconButton.Icon.IconData}
|
|
201
217
|
>
|
|
202
218
|
</${IconButton.Icon.Icon.litTagName}>` : ''}
|
|
219
|
+
${this.#props.spinner ? LitHtml.html`<span class=${LitHtml.Directives.classMap(spinnerClasses)}></span>` : ''}
|
|
203
220
|
<slot @slotchange=${this.onSlotChange}></slot>
|
|
204
221
|
</button>
|
|
205
222
|
`, this.#shadow, {host: this});
|
|
@@ -201,3 +201,34 @@ button.primary:disabled devtools-icon {
|
|
|
201
201
|
button.secondary:disabled devtools-icon {
|
|
202
202
|
--icon-color: var(--color-text-disabled);
|
|
203
203
|
}
|
|
204
|
+
|
|
205
|
+
.spinner-component.secondary {
|
|
206
|
+
border: 2px solid var(--color-primary);
|
|
207
|
+
border-right-color: transparent;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.spinner-component.disabled {
|
|
211
|
+
border: 2px solid var(--color-text-disabled);
|
|
212
|
+
border-right-color: transparent;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.spinner-component {
|
|
216
|
+
display: block;
|
|
217
|
+
width: 12px;
|
|
218
|
+
height: 12px;
|
|
219
|
+
border-radius: 6px;
|
|
220
|
+
border: 2px solid var(--color-background);
|
|
221
|
+
animation: spinner-animation 1s linear infinite;
|
|
222
|
+
border-right-color: transparent;
|
|
223
|
+
margin-right: 6px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@keyframes spinner-animation {
|
|
227
|
+
from {
|
|
228
|
+
transform: rotate(0);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
to {
|
|
232
|
+
transform: rotate(360deg);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -832,6 +832,15 @@ export class DataGrid extends HTMLElement {
|
|
|
832
832
|
}
|
|
833
833
|
this.scrollToBottomIfRequired();
|
|
834
834
|
this.engageResizeObserver();
|
|
835
|
+
if (this.#hasRenderedAtLeastOnce) {
|
|
836
|
+
// We may have had a cell's width change on a re-render, or it may have
|
|
837
|
+
// been hidden entirely, so we need to ensure that the resize handlers are
|
|
838
|
+
// re-positioned correctly if so.
|
|
839
|
+
|
|
840
|
+
// We don't have to do this on first render as it will fire when the resize observer is engaged.
|
|
841
|
+
this.alignScrollHandlers();
|
|
842
|
+
}
|
|
843
|
+
|
|
835
844
|
this.#isRendering = false;
|
|
836
845
|
this.#hasRenderedAtLeastOnce = true;
|
|
837
846
|
|
|
@@ -42,6 +42,16 @@ forcedActive.innerText = 'Forced active';
|
|
|
42
42
|
forcedActive.onclick = () => alert('clicked');
|
|
43
43
|
appendButton(forcedActive);
|
|
44
44
|
|
|
45
|
+
// Primary (forced spinner)
|
|
46
|
+
const forcedSpinner = new Buttons.Button.Button();
|
|
47
|
+
forcedSpinner.data = {
|
|
48
|
+
variant: Buttons.Button.Variant.PRIMARY,
|
|
49
|
+
spinner: true,
|
|
50
|
+
};
|
|
51
|
+
forcedSpinner.innerText = 'Forced spinner';
|
|
52
|
+
forcedSpinner.onclick = () => alert('clicked');
|
|
53
|
+
appendButton(forcedSpinner);
|
|
54
|
+
|
|
45
55
|
// Secondary
|
|
46
56
|
const secondaryButton = new Buttons.Button.Button();
|
|
47
57
|
secondaryButton.innerText = 'Click me';
|
|
@@ -51,6 +61,16 @@ secondaryButton.data = {
|
|
|
51
61
|
};
|
|
52
62
|
appendButton(secondaryButton);
|
|
53
63
|
|
|
64
|
+
// Secondary spinner
|
|
65
|
+
const secondarySpinnerButton = new Buttons.Button.Button();
|
|
66
|
+
secondarySpinnerButton.innerText = 'Click me';
|
|
67
|
+
secondarySpinnerButton.onclick = () => alert('clicked');
|
|
68
|
+
secondarySpinnerButton.data = {
|
|
69
|
+
variant: Buttons.Button.Variant.SECONDARY,
|
|
70
|
+
spinner: true,
|
|
71
|
+
};
|
|
72
|
+
appendButton(secondarySpinnerButton);
|
|
73
|
+
|
|
54
74
|
// Primary
|
|
55
75
|
const disabledPrimaryButtons = new Buttons.Button.Button();
|
|
56
76
|
disabledPrimaryButtons.data = {
|
|
@@ -61,6 +81,17 @@ disabledPrimaryButtons.innerText = 'Cannot click me';
|
|
|
61
81
|
disabledPrimaryButtons.onclick = () => alert('clicked');
|
|
62
82
|
appendButton(disabledPrimaryButtons);
|
|
63
83
|
|
|
84
|
+
// Primary spinner
|
|
85
|
+
const disabledSpinnerPrimaryButtons = new Buttons.Button.Button();
|
|
86
|
+
disabledSpinnerPrimaryButtons.data = {
|
|
87
|
+
variant: Buttons.Button.Variant.PRIMARY,
|
|
88
|
+
disabled: true,
|
|
89
|
+
spinner: true,
|
|
90
|
+
};
|
|
91
|
+
disabledSpinnerPrimaryButtons.innerText = 'Cannot click me';
|
|
92
|
+
disabledSpinnerPrimaryButtons.onclick = () => alert('clicked');
|
|
93
|
+
appendButton(disabledSpinnerPrimaryButtons);
|
|
94
|
+
|
|
64
95
|
// Secondary
|
|
65
96
|
const disabledSecondaryButton = new Buttons.Button.Button();
|
|
66
97
|
disabledSecondaryButton.innerText = 'Cannot click me';
|
|
@@ -71,6 +102,17 @@ disabledSecondaryButton.data = {
|
|
|
71
102
|
};
|
|
72
103
|
appendButton(disabledSecondaryButton);
|
|
73
104
|
|
|
105
|
+
// Secondary spinner
|
|
106
|
+
const disabledSpinnerSecondaryButton = new Buttons.Button.Button();
|
|
107
|
+
disabledSpinnerSecondaryButton.innerText = 'Cannot click me';
|
|
108
|
+
disabledSpinnerSecondaryButton.onclick = () => alert('clicked');
|
|
109
|
+
disabledSpinnerSecondaryButton.data = {
|
|
110
|
+
variant: Buttons.Button.Variant.SECONDARY,
|
|
111
|
+
disabled: true,
|
|
112
|
+
spinner: true,
|
|
113
|
+
};
|
|
114
|
+
appendButton(disabledSpinnerSecondaryButton);
|
|
115
|
+
|
|
74
116
|
// Primary Icon
|
|
75
117
|
const primaryIconButton = new Buttons.Button.Button();
|
|
76
118
|
primaryIconButton.innerText = 'Click me';
|
|
@@ -16,7 +16,6 @@ import {Endianness} from './ValueInterpreterDisplayUtils.js';
|
|
|
16
16
|
import type {TypeToggleEvent, ValueInterpreterSettingsData} from './ValueInterpreterSettings.js';
|
|
17
17
|
|
|
18
18
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
19
|
-
import inspectorCommonStyles from '../../legacy/inspectorCommon.css.js';
|
|
20
19
|
|
|
21
20
|
const UIStrings = {
|
|
22
21
|
/**
|
|
@@ -74,13 +73,6 @@ export class LinearMemoryValueInterpreter extends HTMLElement {
|
|
|
74
73
|
#memoryLength = 0;
|
|
75
74
|
#showSettings = false;
|
|
76
75
|
|
|
77
|
-
constructor() {
|
|
78
|
-
super();
|
|
79
|
-
this.#shadow.adoptedStyleSheets = [
|
|
80
|
-
inspectorCommonStyles,
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
76
|
connectedCallback(): void {
|
|
85
77
|
this.#shadow.adoptedStyleSheets = [linearMemoryValueInterpreterStyles];
|
|
86
78
|
}
|
|
@@ -28,7 +28,7 @@ export class TextEditor extends HTMLElement {
|
|
|
28
28
|
#pendingState: CodeMirror.EditorState|undefined;
|
|
29
29
|
#lastScrollPos = {left: 0, top: 0};
|
|
30
30
|
#resizeTimeout = -1;
|
|
31
|
-
#
|
|
31
|
+
#resizeListener = (): void => {
|
|
32
32
|
if (this.#resizeTimeout < 0) {
|
|
33
33
|
this.#resizeTimeout = window.setTimeout(() => {
|
|
34
34
|
this.#resizeTimeout = -1;
|
|
@@ -37,7 +37,8 @@ export class TextEditor extends HTMLElement {
|
|
|
37
37
|
}
|
|
38
38
|
}, 50);
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
|
+
#devtoolsResizeObserver = new ResizeObserver(this.#resizeListener);
|
|
41
42
|
|
|
42
43
|
constructor(pendingState?: CodeMirror.EditorState) {
|
|
43
44
|
super();
|
|
@@ -104,6 +105,7 @@ export class TextEditor extends HTMLElement {
|
|
|
104
105
|
if (this.#activeEditor) {
|
|
105
106
|
this.#pendingState = this.#activeEditor.state;
|
|
106
107
|
this.#devtoolsResizeObserver.disconnect();
|
|
108
|
+
window.removeEventListener('resize', this.#resizeListener);
|
|
107
109
|
this.#activeEditor.destroy();
|
|
108
110
|
this.#activeEditor = undefined;
|
|
109
111
|
this.ensureSettingListeners();
|
|
@@ -148,6 +150,7 @@ export class TextEditor extends HTMLElement {
|
|
|
148
150
|
if (devtoolsElement) {
|
|
149
151
|
this.#devtoolsResizeObserver.observe(devtoolsElement);
|
|
150
152
|
}
|
|
153
|
+
window.addEventListener('resize', this.#resizeListener);
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
revealPosition(selection: CodeMirror.EditorSelection, highlight: boolean = true): void {
|
|
@@ -63,7 +63,7 @@ export class DynamicSetting<T> {
|
|
|
63
63
|
static none: readonly DynamicSetting<unknown>[] = [];
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', CM.keymap.of([{
|
|
66
|
+
export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', [], CM.keymap.of([{
|
|
67
67
|
key: 'Tab',
|
|
68
68
|
run: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentMore(view) : false,
|
|
69
69
|
shift: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentLess(view) : false,
|
|
@@ -85,7 +85,7 @@ export function guessIndent(doc: CM.Text): string {
|
|
|
85
85
|
let scanned = 0;
|
|
86
86
|
for (let cur = doc.iterLines(1, Math.min(doc.lines + 1, LINES_TO_SCAN_FOR_INDENTATION_GUESSING)); !cur.next().done;) {
|
|
87
87
|
let space = (/^\s*/.exec(cur.value) as string[])[0];
|
|
88
|
-
if (space.length === cur.value.length || !space.length) {
|
|
88
|
+
if (space.length === cur.value.length || !space.length || cur.value[space.length] === '*') {
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
91
|
if (space[0] === '\t') {
|
|
@@ -324,7 +324,7 @@ export const showCompletionHint = CM.ViewPlugin.fromClass(class {
|
|
|
324
324
|
if (pos !== lineBefore.to) {
|
|
325
325
|
return null;
|
|
326
326
|
}
|
|
327
|
-
const wordBefore =
|
|
327
|
+
const wordBefore = /#?[\w$]+$/.exec(lineBefore.text);
|
|
328
328
|
if (wordBefore && !label.startsWith(wordBefore[0])) {
|
|
329
329
|
return null;
|
|
330
330
|
}
|
|
@@ -15,6 +15,23 @@ export function completion(): CodeMirror.Extension {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export async function completeInContext(
|
|
19
|
+
textBefore: string, query: string, force: boolean = false): Promise<UI.SuggestBox.Suggestions> {
|
|
20
|
+
const state = CodeMirror.EditorState.create({
|
|
21
|
+
doc: textBefore,
|
|
22
|
+
selection: {anchor: textBefore.length},
|
|
23
|
+
extensions: CodeMirror.javascript.javascriptLanguage,
|
|
24
|
+
});
|
|
25
|
+
const result = await javascriptCompletionSource(new CodeMirror.CompletionContext(state, textBefore.length, force));
|
|
26
|
+
return result ?
|
|
27
|
+
result.options.filter((o): boolean => o.label.startsWith(query)).map((o): UI.SuggestBox.Suggestion => ({
|
|
28
|
+
text: o.label,
|
|
29
|
+
priority: 100 + (o.boost || 0),
|
|
30
|
+
isSecondary: o.type === 'secondary',
|
|
31
|
+
})) :
|
|
32
|
+
[];
|
|
33
|
+
}
|
|
34
|
+
|
|
18
35
|
class CompletionSet {
|
|
19
36
|
constructor(
|
|
20
37
|
readonly completions: CodeMirror.Completion[] = [],
|
|
@@ -35,10 +52,10 @@ class CompletionSet {
|
|
|
35
52
|
}
|
|
36
53
|
|
|
37
54
|
const javascriptKeywords = [
|
|
38
|
-
'async',
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
55
|
+
'async', 'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete',
|
|
56
|
+
'do', 'else', 'export', 'extends', 'false', 'finally', 'for', 'function', 'if', 'import', 'in',
|
|
57
|
+
'instanceof', 'let', 'new', 'null', 'of', 'return', 'static', 'super', 'switch', 'this', 'throw',
|
|
58
|
+
'true', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield',
|
|
42
59
|
];
|
|
43
60
|
const consoleBuiltinFunctions = [
|
|
44
61
|
'clear',
|
|
@@ -101,7 +118,7 @@ export function getQueryType(tree: CodeMirror.Tree, pos: number, doc: CodeMirror
|
|
|
101
118
|
return null;
|
|
102
119
|
}
|
|
103
120
|
|
|
104
|
-
if (node.name === 'PropertyName') {
|
|
121
|
+
if (node.name === 'PropertyName' || node.name === 'PrivatePropertyName') {
|
|
105
122
|
return parent?.name !== 'MemberExpression' ? null :
|
|
106
123
|
{type: QueryType.PropertyName, from: node.from, relatedNode: parent};
|
|
107
124
|
}
|
|
@@ -172,7 +189,7 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
|
|
|
172
189
|
return {
|
|
173
190
|
from: query.from ?? cx.pos,
|
|
174
191
|
options: result.completions,
|
|
175
|
-
span:
|
|
192
|
+
span: /^#?[\w\P{ASCII}]*/u,
|
|
176
193
|
};
|
|
177
194
|
}
|
|
178
195
|
|
|
@@ -306,13 +323,14 @@ async function completePropertiesInner(
|
|
|
306
323
|
object = await evaluateExpression(context, toPrototype + '.prototype', 'completion');
|
|
307
324
|
}
|
|
308
325
|
|
|
309
|
-
const functionType = expression === '
|
|
310
|
-
const otherType = expression === '
|
|
326
|
+
const functionType = expression === 'globalThis' ? 'function' : 'method';
|
|
327
|
+
const otherType = expression === 'globalThis' ? 'variable' : 'property';
|
|
311
328
|
if (object && (object.type === 'object' || object.type === 'function')) {
|
|
312
329
|
const properties = await object.getAllProperties(false, false);
|
|
313
330
|
const isFunction = object.type === 'function';
|
|
314
331
|
for (const prop of properties.properties || []) {
|
|
315
|
-
if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller'))
|
|
332
|
+
if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller')) &&
|
|
333
|
+
(!prop.private || expression === 'this')) {
|
|
316
334
|
const label = quoted ? quoted + prop.name + quoted : prop.name;
|
|
317
335
|
const completion: CodeMirror.Completion = {
|
|
318
336
|
label,
|
|
@@ -365,7 +383,7 @@ async function completeExpressionGlobal(): Promise<CompletionSet> {
|
|
|
365
383
|
}
|
|
366
384
|
const result = baseCompletions.copy();
|
|
367
385
|
|
|
368
|
-
const fetchNames = completePropertiesInner('
|
|
386
|
+
const fetchNames = completePropertiesInner('globalThis', context).then(fromWindow => {
|
|
369
387
|
return context.globalLexicalScopeNames().then(globals => {
|
|
370
388
|
for (const option of fromWindow.completions) {
|
|
371
389
|
result.add(option);
|
|
@@ -107,6 +107,14 @@ const UIStrings = {
|
|
|
107
107
|
*@description The aria label for the drawer.
|
|
108
108
|
*/
|
|
109
109
|
drawer: 'Tool drawer',
|
|
110
|
+
/**
|
|
111
|
+
*@description The aria label for the drawer shown.
|
|
112
|
+
*/
|
|
113
|
+
drawerShown: 'Drawer shown',
|
|
114
|
+
/**
|
|
115
|
+
*@description The aria label for the drawer hidden.
|
|
116
|
+
*/
|
|
117
|
+
drawerHidden: 'Drawer hidden',
|
|
110
118
|
};
|
|
111
119
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/InspectorView.ts', UIStrings);
|
|
112
120
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -312,6 +320,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
312
320
|
this.focusRestorer = null;
|
|
313
321
|
}
|
|
314
322
|
this.emitDrawerChangeEvent(true);
|
|
323
|
+
ARIAUtils.alert(i18nString(UIStrings.drawerShown));
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
drawerVisible(): boolean {
|
|
@@ -328,6 +337,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
328
337
|
this.drawerSplitWidget.hideSidebar(true);
|
|
329
338
|
|
|
330
339
|
this.emitDrawerChangeEvent(false);
|
|
340
|
+
ARIAUtils.alert(i18nString(UIStrings.drawerHidden));
|
|
331
341
|
}
|
|
332
342
|
|
|
333
343
|
setDrawerMinimized(minimized: boolean): void {
|
|
@@ -276,10 +276,10 @@ export class Editor<T> {
|
|
|
276
276
|
this.element = document.createElement('div');
|
|
277
277
|
this.element.classList.add('editor-container');
|
|
278
278
|
this.element.addEventListener('keydown', onKeyDown.bind(null, isEscKey, this.cancelClicked.bind(this)), false);
|
|
279
|
-
this.element.addEventListener(
|
|
280
|
-
'keydown', onKeyDown.bind(null, event => event.key === 'Enter', this.commitClicked.bind(this)), false);
|
|
281
279
|
|
|
282
280
|
this.contentElementInternal = this.element.createChild('div', 'editor-content');
|
|
281
|
+
this.contentElementInternal.addEventListener(
|
|
282
|
+
'keydown', onKeyDown.bind(null, event => event.key === 'Enter', this.commitClicked.bind(this)), false);
|
|
283
283
|
|
|
284
284
|
const buttonsRow = this.element.createChild('div', 'editor-buttons');
|
|
285
285
|
this.commitButton = createTextButton('', this.commitClicked.bind(this), '', true /* primary */);
|
|
@@ -37,10 +37,10 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
37
37
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
38
38
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
39
39
|
import * as IconButton from '../../../components/icon_button/icon_button.js';
|
|
40
|
+
import * as TextEditor from '../../../components/text_editor/text_editor.js';
|
|
40
41
|
import * as UI from '../../legacy.js';
|
|
41
42
|
|
|
42
43
|
import {CustomPreviewComponent} from './CustomPreviewComponent.js';
|
|
43
|
-
import {JavaScriptAutocomplete} from './JavaScriptAutocomplete.js';
|
|
44
44
|
import {JavaScriptREPL} from './JavaScriptREPL.js';
|
|
45
45
|
import {createSpansForNodeTitle, RemoteObjectPreviewFormatter} from './RemoteObjectPreviewFormatter.js';
|
|
46
46
|
import objectValueStyles from './objectValue.css.js';
|
|
@@ -1513,8 +1513,7 @@ export class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1513
1513
|
export class ObjectPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
1514
1514
|
constructor() {
|
|
1515
1515
|
super();
|
|
1516
|
-
|
|
1517
|
-
this.initialize(javaScriptAutocomplete.completionsForTextInCurrentContext.bind(javaScriptAutocomplete));
|
|
1516
|
+
this.initialize(TextEditor.JavaScript.completeInContext);
|
|
1518
1517
|
}
|
|
1519
1518
|
}
|
|
1520
1519
|
|
|
@@ -12,14 +12,6 @@ ObjectUI = ObjectUI || {};
|
|
|
12
12
|
/** @constructor */
|
|
13
13
|
ObjectUI.CustomPreviewComponent = ObjectUIModule.CustomPreviewComponent.CustomPreviewComponent;
|
|
14
14
|
|
|
15
|
-
/** @constructor */
|
|
16
|
-
ObjectUI.JavaScriptAutocomplete = ObjectUIModule.JavaScriptAutocomplete.JavaScriptAutocomplete;
|
|
17
|
-
|
|
18
|
-
/** @constructor */
|
|
19
|
-
ObjectUI.JavaScriptAutocompleteConfig = ObjectUIModule.JavaScriptAutocomplete.JavaScriptAutocompleteConfig;
|
|
20
|
-
|
|
21
|
-
ObjectUI.javaScriptAutocomplete = ObjectUIModule.javaScriptAutocomplete;
|
|
22
|
-
|
|
23
15
|
/** @constructor */
|
|
24
16
|
ObjectUI.JavaScriptREPL = ObjectUIModule.JavaScriptREPL.JavaScriptREPL;
|
|
25
17
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as CustomPreviewComponent from './CustomPreviewComponent.js';
|
|
6
|
-
import * as JavaScriptAutocomplete from './JavaScriptAutocomplete.js';
|
|
7
6
|
import * as JavaScriptREPL from './JavaScriptREPL.js';
|
|
8
7
|
import * as ObjectPopoverHelper from './ObjectPopoverHelper.js';
|
|
9
8
|
import * as ObjectPropertiesSection from './ObjectPropertiesSection.js';
|
|
@@ -11,11 +10,8 @@ import * as RemoteObjectPreviewFormatter from './RemoteObjectPreviewFormatter.js
|
|
|
11
10
|
|
|
12
11
|
export {
|
|
13
12
|
CustomPreviewComponent,
|
|
14
|
-
JavaScriptAutocomplete,
|
|
15
13
|
JavaScriptREPL,
|
|
16
14
|
ObjectPopoverHelper,
|
|
17
15
|
ObjectPropertiesSection,
|
|
18
16
|
RemoteObjectPreviewFormatter,
|
|
19
17
|
};
|
|
20
|
-
|
|
21
|
-
export const javaScriptAutocomplete = JavaScriptAutocomplete.JavaScriptAutocomplete.instance();
|
|
@@ -229,6 +229,9 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
229
229
|
},
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
|
+
':host-context(.pretty-printed) & .cm-lineNumbers .cm-gutterElement': {
|
|
233
|
+
color: 'var(--legacy-accent-color)',
|
|
234
|
+
},
|
|
232
235
|
}),
|
|
233
236
|
CodeMirror.EditorView.domEventHandlers({
|
|
234
237
|
focus: () => this.onFocus(),
|