Bug 1541563 - Sync 131 - refactor: specialize svg to breakpointsvg r=loganfsmyth

Differential Revision: https://phabricator.services.mozilla.com/D25989

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-04-05 17:33:02 +00:00
parent 2405ab5a37
commit c2880f865d
7 changed files with 32 additions and 20 deletions

View File

@ -175,7 +175,6 @@ ImmutableJS
Fennec
v59
tabIndex
react-inlinesvg
findClosestScope
findClosestFunction
paren

View File

@ -15,7 +15,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -36,7 +36,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -57,7 +57,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -78,7 +78,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -99,7 +99,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -120,7 +120,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -141,7 +141,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}

View File

@ -0,0 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
import React from "react";
const BREAKPOINT_SVG =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 15" width="60" height="15"><path d="M53.07.5H1.5c-.54 0-1 .46-1 1v12c0 .54.46 1 1 1h51.57c.58 0 1.15-.26 1.53-.7l4.7-6.3-4.7-6.3c-.38-.44-.95-.7-1.53-.7z"/></svg>';
const COLUMN_MARKER_SVG =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 13" width="11" height="13"><path d="M5.07.5H1.5c-.54 0-1 .46-1 1v10c0 .54.46 1 1 1h3.57c.58 0 1.15-.26 1.53-.7l3.7-5.3-3.7-5.3C6.22.76 5.65.5 5.07.5z"/></svg>';
type Props = {
column: boolean
};
export default function BreakpointSvg({ column }: Props) {
const svg = column ? COLUMN_MARKER_SVG : BREAKPOINT_SVG;
/* eslint-disable react/no-danger */
return <span dangerouslySetInnerHTML={{ __html: svg }} />;
}

View File

@ -72,7 +72,6 @@
"react-aria-components": "^0.0.4",
"react-dom": "16.4.1",
"react-immutable-proptypes": "^2.1.0",
"react-inlinesvg": "^0.8.1",
"react-redux": "^5.0.7",
"react-transition-group": "^2.2.1",
"reselect": "^4.0.0",

View File

@ -7,7 +7,7 @@
import React, { PureComponent } from "react";
import ReactDOM from "react-dom";
import classnames from "classnames";
import Svg from "../shared/Svg";
import BreakpointSvg from "../shared/BreakpointSvg";
import { getDocument, toEditorLine } from "../../utils/editor";
import { getSelectedLocation } from "../../utils/source-maps";
@ -20,7 +20,7 @@ import type { EditorItemActions } from "./menus/editor";
import type { Source, Breakpoint as BreakpointType } from "../../types";
const breakpointSvg = document.createElement("div");
ReactDOM.render(<Svg name="breakpoint" />, breakpointSvg);
ReactDOM.render(<BreakpointSvg column={false} />, breakpointSvg);
type Props = {
breakpoint: BreakpointType,

View File

@ -7,7 +7,7 @@ import React, { PureComponent } from "react";
import ReactDOM from "react-dom";
import classnames from "classnames";
import { getDocument } from "../../utils/editor";
import Svg from "../shared/Svg";
import BreakpointSvg from "../shared/BreakpointSvg";
import { showMenu } from "devtools-contextmenu";
import { breakpointItems, createBreakpointItems } from "./menus/breakpoints";
@ -28,7 +28,7 @@ type Props = {
};
const breakpointImg = document.createElement("button");
ReactDOM.render(<Svg name={"column-marker"} />, breakpointImg);
ReactDOM.render(<BreakpointSvg column={true} />, breakpointImg);
function makeBookmark({ breakpoint }, { onClick, onContextMenu }) {
const bp = breakpointImg.cloneNode(true);

View File

@ -9158,13 +9158,6 @@ react-immutable-proptypes@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-immutable-proptypes/-/react-immutable-proptypes-2.1.0.tgz#023d6f39bb15c97c071e9e60d00d136eac5fa0b4"
react-inlinesvg@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/react-inlinesvg/-/react-inlinesvg-0.8.1.tgz#d981da38985d2cd0b83628eaf918ca4834f02b5d"
dependencies:
httpplease "^0.16.4"
once "^1.4.0"
react-inspector@^2.2.2:
version "2.3.0"
resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-2.3.0.tgz#fc9c1d38ab687fc0d190dcaf133ae40158968fc8"