This repository was archived by the owner on Sep 21, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +2091
-141
lines changed
packages/devtools-components Expand file tree Collapse file tree 8 files changed +2091
-141
lines changed Original file line number Diff line number Diff line change 66 "scripts" : {
77 "copy-assets" : " node bin/copy-assets" ,
88 "license-check" : " devtools-license-check" ,
9- "storybook" : " start-storybook -p 9002 -c .storybook" ,
9+ "storybook" : " start-storybook -p 9002 -c .storybook -s ./src " ,
1010 "test" : " jest"
1111 },
1212 "author" : " Jason Laster" ,
1515 "prop-types" : " ^15.6.0" ,
1616 "react" : " ^16.2.0" ,
1717 "react-dom" : " ^16.2.0" ,
18- "react-dom-factories" : " ^1.0.2" ,
19- "svg-inline-loader" : " ^0.8.0" ,
20- "svg-inline-react" : " ^3.0.0"
18+ "react-dom-factories" : " ^1.0.2"
2119 },
2220 "devDependencies" : {
2321 "@storybook/react" : " ^3.3.14" ,
2422 "babel-jest" : " ^22.4.1" ,
2523 "babel-plugin-transform-es2015-modules-commonjs" : " ^6.26.0" ,
2624 "babel-preset-react" : " ^6.24.1" ,
25+ "devtools-launchpad" : " ^0.0.117" ,
2726 "devtools-license-check" : " ^0.5.1" ,
2827 "enzyme" : " ^3.3.0" ,
2928 "enzyme-adapter-react-16" : " ^1.1.1" ,
5251 " node_modules/(?!devtools-)"
5352 ],
5453 "moduleNameMapper" : {
55- "\\ .css$" : " <rootDir>/tests/__mocks__/styleMock.js" ,
56- "\\ .svg$" : " <rootDir>/tests/__mocks__/svgMock.js"
54+ "\\ .css$" : " <rootDir>/tests/__mocks__/styleMock.js"
5755 }
5856 }
5957}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -389,9 +389,9 @@ describe("Tree", () => {
389389
390390 getTreeNodes ( wrapper ) . forEach ( n => {
391391 if ( "ABECDMN" . split ( "" ) . includes ( getSanitizedNodeText ( n ) ) ) {
392- expect ( n . find ( "i .arrow.expanded" ) . exists ( ) ) . toBe ( true ) ;
392+ expect ( n . find ( "img .arrow.expanded" ) . exists ( ) ) . toBe ( true ) ;
393393 } else {
394- expect ( n . find ( "i .arrow" ) . exists ( ) ) . toBe ( false ) ;
394+ expect ( n . find ( "img .arrow" ) . exists ( ) ) . toBe ( false ) ;
395395 }
396396 } ) ;
397397 } ) ;
@@ -401,7 +401,7 @@ describe("Tree", () => {
401401 expect ( formatTree ( wrapper ) ) . toMatchSnapshot ( ) ;
402402
403403 getTreeNodes ( wrapper ) . forEach ( n => {
404- const arrow = n . find ( "i .arrow" ) ;
404+ const arrow = n . find ( "img .arrow" ) ;
405405 expect ( arrow . exists ( ) ) . toBe ( true ) ;
406406 expect ( arrow . hasClass ( "expanded" ) ) . toBe ( false ) ;
407407 } ) ;
@@ -462,7 +462,7 @@ function formatTree(wrapper) {
462462 . map ( ( node ) => {
463463 const level = ( node . prop ( "aria-level" ) || 1 ) - 1 ;
464464 const indentStr = "| " . repeat ( level ) ;
465- const arrow = node . find ( "i .arrow" ) ;
465+ const arrow = node . find ( "img .arrow" ) ;
466466 let arrowStr = " " ;
467467 if ( arrow . exists ( ) ) {
468468 arrowStr = arrow . hasClass ( "expanded" ) ? "▼ " : "▶︎ " ;
Original file line number Diff line number Diff line change 5757 cursor : default;
5858}
5959
60- .tree .tree-node .focused {
61- color : white;
62- background-color : var (--theme-selection-background , # 0a84ff );
63- }
64-
65- .tree-node .focused .arrow svg {
66- fill : currentColor;
67- }
68-
69- .tree-node : hover img {
70- background-color : var (--theme-content-color3 );
71- }
72-
73- .arrow svg {
74- fill : var (--theme-splitter-color , # 9B9B9B );
75- transition : transform 0.125s ease;
76- width : 10px ;
77- margin-inline-end : 5px ;
60+ .tree-node img .arrow {
61+ mask : url (/images/arrow.svg) no-repeat;
62+ mask-size : 100% ;
63+ width : 9px ;
64+ height : 9px ;
65+ margin-inline-start : 1px ;
66+ margin-inline-end : 4px ;
67+ background-color : var (--theme-splitter-color , # 9B9B9B );
7868 transform : rotate (-90deg );
69+ transition : transform 0.125s ease;
70+ align-self : center;
7971}
8072
81- html [dir = "rtl" ] .arrow svg ,
82- .arrow svg : dir (rtl ),
83- .arrow svg : -moz-locale-dir (rtl ) {
73+ html [dir = "rtl" ] .tree-node img .arrow {
8474 transform : rotate (90deg );
8575}
8676
87- .arrow .expanded .expanded svg {
77+ .tree-node img . arrow .expanded .expanded {
8878 transform : rotate (0deg );
79+ }
80+
81+ .tree .tree-node .focused {
82+ color : white;
83+ background-color : var (--theme-selection-background , # 0a84ff );
84+ }
85+
86+ .tree-node .focused img .arrow {
87+ background-color : currentColor;
8988}
Original file line number Diff line number Diff line change 33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
55import React from "react" ;
6- const { Component, createFactory, createElement } = React ;
6+ const { Component, createFactory } = React ;
77import dom from "react-dom-factories" ;
88import PropTypes from "prop-types" ;
9- import InlineSVG from "svg-inline-react" ;
10- import svgArrow from "./images/arrow.svg" ;
119
1210require ( "./tree.css" ) ;
1311
@@ -37,9 +35,8 @@ class ArrowExpander extends Component {
3735 if ( expanded ) {
3836 classNames . push ( "expanded" ) ;
3937 }
40- return createElement ( InlineSVG , {
38+ return dom . img ( {
4139 className : classNames . join ( " " ) ,
42- src : svgArrow
4340 } ) ;
4441 }
4542}
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ const webpackConfig = {
3232 }
3333} ;
3434
35- const extra = { } ;
35+ const extra = {
36+ disablePostCSS : true ,
37+ } ;
3638webpackConfig . plugins = [ ] ;
3739if ( ! isDevelopment ( ) ) {
3840 extra . excludeMap = {
You can’t perform that action at this time.
0 commit comments