Skip to content

Commit ff2f1e9

Browse files
committed
Add temp icon
1 parent 711b66b commit ff2f1e9

File tree

6 files changed

+85
-24
lines changed

6 files changed

+85
-24
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"@jupyterlab/filebrowser": "^3.4.0",
6161
"@jupyterlab/launcher": "^3.4.0",
6262
"@jupyterlab/mainmenu": "^3.4.0",
63+
"@jupyterlab/ui-components": "^3.4.3",
6364
"@lumino/algorithm": "^1.9.0",
6465
"@lumino/coreutils": "^1.11.0",
6566
"@lumino/messaging": "^1.10.0",

src/icons.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
import { LabIcon } from '@jupyterlab/ui-components';
3+
4+
import urdf_logo from '/style/icons/urdf_logo.svg';
5+
6+
export const urdf_icon = new LabIcon({
7+
name: 'urdf:icon/logo',
8+
svgstr: urdf_logo
9+
});

src/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { UrdfWidget } from './widget';
2424

2525
import { UrdfWidgetFactory } from './factory';
2626

27+
import { urdf_icon } from './icons';
28+
2729
// Name of the factory that creates the URDF widgets
2830
const FACTORY = 'URDF Widget Factory';
2931

@@ -78,7 +80,9 @@ const extension: JupyterFrontEndPlugin<void> = {
7880

7981
// Add widget to tracker when created
8082
widgetFactory.widgetCreated.connect((sender, widget) => {
81-
widget.title.icon = 'jp-MaterialIcon jp-ImageIcon'; // TODO change
83+
widget.title.icon = urdf_icon;
84+
widget.title.iconClass = 'jp-URDFIcon';
85+
8286
// Notify instance tracker if restore data needs to be updated
8387
widget.context.pathChanged.connect(() => {
8488
tracker.save(widget);
@@ -94,18 +98,19 @@ const extension: JupyterFrontEndPlugin<void> = {
9498
name: 'urdf',
9599
displayName: 'URDF',
96100
extensions: ['.urdf', '.xacro'],
97-
iconClass: 'jp-MaterialIcon jp-ImageIcon', // TODO change
101+
iconClass: 'jp-URDFIcon',
98102
fileFormat: 'text',
99-
contentType: 'file'
103+
contentType: 'file',
104+
icon: urdf_icon,
100105
});
101106

102107
// Add command for creating new urdf (file)
103108
commands.addCommand('urdf:create-new', {
104109
label: 'Create new URDF',
105-
iconClass: 'jp-MaterialIcon jp-Image-Icon',
110+
icon: urdf_icon,
111+
iconClass: 'jp-URDFIcon',
106112
caption: 'Create a new URDF',
107113
execute: () => {
108-
// Current Working Directory
109114
const cwd = browserFactory.defaultBrowser.model.path;
110115
commands
111116
.execute('docmanager:new-untitled', {
@@ -131,7 +136,7 @@ const extension: JupyterFrontEndPlugin<void> = {
131136
});
132137
}
133138

134-
// TODO: Add menu item if menu is available
139+
// Add menu item if menu is available
135140
if (menu) {
136141
const urdfMenu: Menu = new Menu({ commands });
137142
urdfMenu.title.label = 'URDF';

src/svg.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Jupyter Development Team.
2+
// Distributed under the terms of the Modified BSD License.
3+
4+
// including this file in a package allows for the use of import statements
5+
// with svg files. Example: `import xSvg from 'path/xSvg.svg'`
6+
7+
// for use with raw-loader in Webpack.
8+
// The svg will be imported as a raw string
9+
10+
declare module '*.svg' {
11+
const value: string;
12+
export default value;
13+
}

style/icons/urdf_logo.svg

Lines changed: 33 additions & 0 deletions
Loading

yarn.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,9 +2125,9 @@
21252125
"@types/estree" "*"
21262126

21272127
"@types/eslint@*":
2128-
version "8.4.3"
2129-
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.3.tgz#5c92815a3838b1985c90034cd85f26f59d9d0ece"
2130-
integrity sha512-YP1S7YJRMPs+7KZKDb9G63n8YejIwW9BALq7a5j2+H4yl6iOv9CB29edho+cuFRrvmJbbaH2yiVChKLJVysDGw==
2128+
version "8.4.5"
2129+
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.5.tgz#acdfb7dd36b91cc5d812d7c093811a8f3d9b31e4"
2130+
integrity sha512-dhsC09y1gpJWnK+Ff4SGvCuSnk9DaU0BJZSzOwa6GVSg65XtTugLBITDAAzRU5duGBoXBHpdR/9jHGxJjNflJQ==
21312131
dependencies:
21322132
"@types/estree" "*"
21332133
"@types/json-schema" "*"
@@ -2200,9 +2200,9 @@
22002200
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
22012201

22022202
"@types/node@*":
2203-
version "18.0.0"
2204-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
2205-
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==
2203+
version "18.0.1"
2204+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.1.tgz#e91bd73239b338557a84d1f67f7b9e0f25643870"
2205+
integrity sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==
22062206

22072207
"@types/normalize-package-data@^2.4.0":
22082208
version "2.4.1"
@@ -3248,9 +3248,9 @@ camelcase@^6.0.0:
32483248
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
32493249

32503250
caniuse-lite@^1.0.30001359:
3251-
version "1.0.30001361"
3252-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001361.tgz#ba2adb2527566fb96f3ac7c67698ae7fc495a28d"
3253-
integrity sha512-ybhCrjNtkFji1/Wto6SSJKkWk6kZgVQsDq5QI83SafsF6FXv2JB4df9eEdH6g8sdGgqTXrFLjAxqBGgYoU3azQ==
3251+
version "1.0.30001363"
3252+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz#26bec2d606924ba318235944e1193304ea7c4f15"
3253+
integrity sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==
32543254

32553255
capture-exit@^2.0.0:
32563256
version "2.0.0"
@@ -4048,9 +4048,9 @@ ee-first@1.1.1:
40484048
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
40494049

40504050
electron-to-chromium@^1.4.172:
4051-
version "1.4.176"
4052-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.176.tgz#61ab2a1de3b5072ee31881a937c08ac6780d1cfa"
4053-
integrity sha512-92JdgyRlcNDwuy75MjuFSb3clt6DGJ2IXSpg0MCjKd3JV9eSmuUAIyWiGAp/EtT0z2D4rqbYqThQLV90maH3Zw==
4051+
version "1.4.177"
4052+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.177.tgz#b6a4436eb788ca732556cd69f384b8a3c82118c5"
4053+
integrity sha512-FYPir3NSBEGexSZUEeht81oVhHfLFl6mhUKSkjHN/iB/TwEIt/WHQrqVGfTLN5gQxwJCQkIJBe05eOXjI7omgg==
40544054

40554055
emittery@^0.7.1:
40564056
version "0.7.2"
@@ -7962,9 +7962,9 @@ prr@~1.0.1:
79627962
integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==
79637963

79647964
psl@^1.1.24, psl@^1.1.28, psl@^1.1.33:
7965-
version "1.8.0"
7966-
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
7967-
integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==
7965+
version "1.9.0"
7966+
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
7967+
integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
79687968

79697969
pump@^3.0.0:
79707970
version "3.0.0"
@@ -9639,9 +9639,9 @@ uglify-js@3.4.x:
96399639
source-map "~0.6.1"
96409640

96419641
uglify-js@^3.1.4:
9642-
version "3.16.1"
9643-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.1.tgz#0e7ec928b3d0b1e1d952bce634c384fd56377317"
9644-
integrity sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ==
9642+
version "3.16.2"
9643+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.2.tgz#0481e1dbeed343ad1c2ddf3c6d42e89b7a6d4def"
9644+
integrity sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==
96459645

96469646
unbox-primitive@^1.0.2:
96479647
version "1.0.2"

0 commit comments

Comments
 (0)