|
@@ -7,8 +7,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
|
|
|
import { IDebugger } from '../../tokens';
|
|
|
|
|
|
-import { BreakpointsModel } from './model';
|
|
|
-
|
|
|
/**
|
|
|
* The body for a Breakpoints Panel.
|
|
|
*/
|
|
@@ -18,7 +16,7 @@ export class BreakpointsBody extends ReactWidget {
|
|
|
*
|
|
|
* @param model The model for the breakpoints.
|
|
|
*/
|
|
|
- constructor(model: BreakpointsModel) {
|
|
|
+ constructor(model: IDebugger.UI.IBreakpoints) {
|
|
|
super();
|
|
|
this._model = model;
|
|
|
this.addClass('jp-DebuggerBreakpoints-body');
|
|
@@ -31,7 +29,7 @@ export class BreakpointsBody extends ReactWidget {
|
|
|
return <BreakpointsComponent model={this._model} />;
|
|
|
}
|
|
|
|
|
|
- private _model: BreakpointsModel;
|
|
|
+ private _model: IDebugger.UI.IBreakpoints;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -43,7 +41,7 @@ export class BreakpointsBody extends ReactWidget {
|
|
|
const BreakpointsComponent = ({
|
|
|
model
|
|
|
}: {
|
|
|
- model: BreakpointsModel;
|
|
|
+ model: IDebugger.UI.IBreakpoints;
|
|
|
}): JSX.Element => {
|
|
|
const [breakpoints, setBreakpoints] = useState(
|
|
|
Array.from(model.breakpoints.entries())
|
|
@@ -51,13 +49,13 @@ const BreakpointsComponent = ({
|
|
|
|
|
|
useEffect(() => {
|
|
|
const updateBreakpoints = (
|
|
|
- _: BreakpointsModel,
|
|
|
+ _: IDebugger.UI.IBreakpoints,
|
|
|
updates: IDebugger.IBreakpoint[]
|
|
|
): void => {
|
|
|
setBreakpoints(Array.from(model.breakpoints.entries()));
|
|
|
};
|
|
|
|
|
|
- const restoreBreakpoints = (_: BreakpointsModel): void => {
|
|
|
+ const restoreBreakpoints = (_: IDebugger.UI.IBreakpoints): void => {
|
|
|
setBreakpoints(Array.from(model.breakpoints.entries()));
|
|
|
};
|
|
|
|
|
@@ -95,7 +93,7 @@ const BreakpointCellComponent = ({
|
|
|
model
|
|
|
}: {
|
|
|
breakpoints: IDebugger.IBreakpoint[];
|
|
|
- model: BreakpointsModel;
|
|
|
+ model: IDebugger.UI.IBreakpoints;
|
|
|
}): JSX.Element => {
|
|
|
return (
|
|
|
<>
|
|
@@ -126,7 +124,7 @@ const BreakpointComponent = ({
|
|
|
model
|
|
|
}: {
|
|
|
breakpoint: IDebugger.IBreakpoint;
|
|
|
- model: BreakpointsModel;
|
|
|
+ model: IDebugger.UI.IBreakpoints;
|
|
|
}): JSX.Element => {
|
|
|
const moveToEndFirstCharIfSlash = (breakpointSourcePath: string): string => {
|
|
|
return breakpointSourcePath[0] === '/'
|