@openremote/or-icon 1.0.3 → 1.2.0-snapshot.20240512155407
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/dist/umd/index.bundle.js +50 -463
- package/dist/umd/index.bundle.js.LICENSE.txt +17 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +49 -0
- package/lib/index.js.map +1 -0
- package/lib/or-icon-set.d.ts +9 -0
- package/lib/or-icon-set.js +1 -0
- package/lib/or-icon-set.js.map +1 -0
- package/mdi-font-copy.js +17 -0
- package/mdi-iconset-generator.js +35 -0
- package/package.json +17 -13
- package/.project +0 -17
- package/.settings/org.eclipse.buildship.core.prefs +0 -2
- package/LICENSE.txt +0 -2359
- package/dist/index.d.ts +0 -16
- package/dist/index.js +0 -86
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2019 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2021 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
|
+
import { AssetDescriptor } from "@openremote/model";
|
|
3
|
+
import OrIconSet from "./or-icon-set";
|
|
4
|
+
export { OrIconSet };
|
|
5
|
+
export declare class IconSetAddedEvent extends CustomEvent<void> {
|
|
6
|
+
static readonly NAME = "or-iconset-added";
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
export interface HTMLElementEventMap {
|
|
11
|
+
[IconSetAddedEvent.NAME]: IconSetAddedEvent;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface IconSet {
|
|
15
|
+
getIconTemplate: (icon: string) => TemplateResult;
|
|
16
|
+
onAdd?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function createSvgIconSet(size: number, icons: {
|
|
19
|
+
[name: string]: string;
|
|
20
|
+
}): IconSet;
|
|
21
|
+
export declare function createMdiIconSet(managerUrl: string): IconSet;
|
|
22
|
+
declare class ORIconSets {
|
|
23
|
+
private _icons;
|
|
24
|
+
private _defaultIconSet?;
|
|
25
|
+
addIconSet(name: string, iconSet: IconSet): void;
|
|
26
|
+
getIconSet(name: string): IconSet;
|
|
27
|
+
getIconTemplate(icon: string | undefined): TemplateResult;
|
|
28
|
+
}
|
|
29
|
+
export declare const IconSets: ORIconSets;
|
|
30
|
+
export declare function getAssetDescriptorIconTemplate(descriptor: AssetDescriptor | undefined, fallbackColor?: string | undefined, fallbackIcon?: string | undefined, overrideColor?: string | undefined, overrideIcon?: string | undefined): TemplateResult;
|
|
31
|
+
export declare class OrIcon extends LitElement {
|
|
32
|
+
static get styles(): import("lit").CSSResult[];
|
|
33
|
+
icon?: string;
|
|
34
|
+
protected _iconTemplate?: TemplateResult;
|
|
35
|
+
protected _handler: (evt: Event) => void;
|
|
36
|
+
protected render(): TemplateResult;
|
|
37
|
+
disconnectedCallback(): void;
|
|
38
|
+
protected shouldUpdate(changedProperties: PropertyValues): boolean;
|
|
39
|
+
protected _updateIcon(): void;
|
|
40
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __decorate=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};import{css,html,LitElement,unsafeCSS}from"lit";import{unsafeSVG}from"lit/directives/unsafe-svg.js";import{customElement,property,state}from"lit/decorators.js";import{AssetModelUtil}from"@openremote/model";import OrIconSet from"./or-icon-set";export{OrIconSet};const mdiFontStyle=require("@mdi/font/css/materialdesignicons.min.css");export class IconSetAddedEvent extends CustomEvent{constructor(){super(IconSetAddedEvent.NAME,{bubbles:!0,composed:!0})}}IconSetAddedEvent.NAME="or-iconset-added";export function createSvgIconSet(t,e){return{getIconTemplate:o=>{const n=e[o];return n?html`
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
viewBox="0 0 ${t} ${t}" preserveAspectRatio="xMidYMid meet" focusable="false">
|
|
4
|
+
${unsafeSVG(n.startsWith("<")?n:'<path xmlns="http://www.w3.org/2000/svg" d="'+n+'" />')}
|
|
5
|
+
</svg>
|
|
6
|
+
`:html``},onAdd:void 0}}export function createMdiIconSet(t){return{getIconTemplate:t=>html`<span style="font-family: 'Material Design Icons';" class="mdi-${t}"></span>`,onAdd(){const e=document.createElement("style");e.id="mdiFontStyle",e.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+t+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+t+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+t+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+t+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+t+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(e)}}}class ORIconSets{constructor(){this._icons={}}addIconSet(t,e){this._icons[t]=e,this._defaultIconSet||(this._defaultIconSet=e),e.onAdd&&e.onAdd(),window.dispatchEvent(new IconSetAddedEvent)}getIconSet(t){return this._icons[t]}getIconTemplate(t){if(!t)return html``;const e=(t||"").split(":"),o=e.pop(),n=e.pop();let r=this._defaultIconSet;return n&&(r=this.getIconSet(n)),o&&r?r.getIconTemplate(o):html``}}export const IconSets=new ORIconSets;export function getAssetDescriptorIconTemplate(t,e,o,n,r){const i=n||AssetModelUtil.getAssetDescriptorColour(t,e);let s=r||AssetModelUtil.getAssetDescriptorIcon(t,o);return s||(s=AssetModelUtil.getAssetDescriptorIcon("ThingAsset")),html`<or-icon style="--or-icon-fill: ${i?"#"+i:"unset"}" icon="${s}"></or-icon>`}let OrIcon=class extends LitElement{constructor(){super(...arguments),this._handler=t=>{this._updateIcon()}}static get styles(){return[css`
|
|
7
|
+
:host {
|
|
8
|
+
--internal-or-icon-width: var(--or-icon-width, 24px);
|
|
9
|
+
--internal-or-icon-height: var(--or-icon-height, 24px);
|
|
10
|
+
--internal-or-icon-fill: var(--or-icon-fill, currentColor);
|
|
11
|
+
--internal-or-icon-stroke: var(--or-icon-fill, none);
|
|
12
|
+
--internal-or-icon-stroke-width: var(--or-icon-stroke-width, 0);
|
|
13
|
+
|
|
14
|
+
display: inline-block;
|
|
15
|
+
color: var(--internal-or-icon-fill);
|
|
16
|
+
fill: var(--internal-or-icon-fill);
|
|
17
|
+
stroke: var(--internal-or-icon-stroke);
|
|
18
|
+
stroke-width: var(--internal-or-icon-stroke-width);
|
|
19
|
+
vertical-align: text-bottom;
|
|
20
|
+
font-weight: normal;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-size: var(--internal-or-icon-width);
|
|
23
|
+
line-height: 1;
|
|
24
|
+
letter-spacing: normal;
|
|
25
|
+
text-transform: none;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
word-wrap: normal;
|
|
28
|
+
direction: ltr;
|
|
29
|
+
/* Support for all WebKit browsers. */
|
|
30
|
+
-webkit-font-smoothing: antialiased;
|
|
31
|
+
/* Support for Safari and Chrome. */
|
|
32
|
+
text-rendering: optimizeLegibility;
|
|
33
|
+
/* Support for Firefox. */
|
|
34
|
+
-moz-osx-font-smoothing: grayscale;
|
|
35
|
+
/* Support for IE. */
|
|
36
|
+
font-feature-settings: 'liga';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([hidden]) {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
svg {
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
display: block;
|
|
46
|
+
width: var(--internal-or-icon-width);
|
|
47
|
+
height: var(--internal-or-icon-height);
|
|
48
|
+
}
|
|
49
|
+
`,css`${unsafeCSS(mdiFontStyle)}`]}render(){return this._iconTemplate||html``}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(IconSetAddedEvent.NAME,this._handler)}shouldUpdate(t){return t.has("icon")&&this._updateIcon(),!0}_updateIcon(){this._iconTemplate=void 0,window.removeEventListener(IconSetAddedEvent.NAME,this._handler),this._iconTemplate=IconSets.getIconTemplate(this.icon),this.icon&&!this._iconTemplate&&window.addEventListener(IconSetAddedEvent.NAME,this._handler)}};__decorate([property({type:String,reflect:!0})],OrIcon.prototype,"icon",void 0),__decorate([state()],OrIcon.prototype,"_iconTemplate",void 0),OrIcon=__decorate([customElement("or-icon")],OrIcon);export{OrIcon};
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,SAAS,EAAC,MAAM,KAAK,CAAC;AACrF,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAkB,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,SAAS,EA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;IAWS,MAAM;QACZ,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAA,EAAE,CAAC;IACxC,CAAC;IAED,oBAAoB;QAChB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;IAES,YAAY,CAAC,iBAAiC;QACpD,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,WAAW;QACjB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzD,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACnC,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnE,CAAC;IACL,CAAC;CACJ,CAAA;AAlCG;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oCAC1B;AAGJ;IADT,KAAK,EAAE;6CACiC;AAzDhC,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAwFlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const orIconSet={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};export default orIconSet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or-icon-set.js","sourceRoot":"","sources":["../src/or-icon-set.ts"],"names":[],"mappings":"AACA,MAAM,SAAS,GAAG;IACd,IAAI,EAAE,EAAE;IACR,KAAK,EAAE;QACH,MAAM,EAAE,0lDAA0lD;QAClmD,YAAY,EAAE,+7CAA+7C;QAC78C,QAAQ,EAAE,kXAAkX;KAC/X;CACJ,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/mdi-font-copy.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Script for copying @mdi/font files into dist dir
|
|
2
|
+
var fs = require("fs");
|
|
3
|
+
var path = require("path");
|
|
4
|
+
|
|
5
|
+
if (!fs.existsSync("dist")) {
|
|
6
|
+
fs.mkdirSync("dist");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let fontDir = path.join(path.dirname(require.resolve("@mdi/font/package.json")), "fonts");
|
|
10
|
+
let cssDir = path.join(path.dirname(require.resolve("@mdi/font/package.json")), "css");
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync("dist/Material Design Icons")) {
|
|
13
|
+
fs.mkdirSync("dist/Material Design Icons", {recursive: true});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fs.cpSync(fontDir, "./dist/Material Design Icons/fonts", {recursive: true});
|
|
17
|
+
fs.cpSync(cssDir, "./dist/Material Design Icons/css", {recursive: true});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Script for collating mdi svg icons (@mdi/svg) into a single JSON file
|
|
2
|
+
var fs = require('fs');
|
|
3
|
+
var path = require("path");
|
|
4
|
+
var xpath = require('xpath');
|
|
5
|
+
var dom = require('xmldom').DOMParser;
|
|
6
|
+
|
|
7
|
+
if (!fs.existsSync("src")){
|
|
8
|
+
fs.mkdirSync("src");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let mdiSvgDir = path.join(path.dirname(require.resolve("@mdi/svg/package.json")), "svg");
|
|
12
|
+
if (!fs.existsSync("dist")) {
|
|
13
|
+
fs.mkdirSync("dist");
|
|
14
|
+
}
|
|
15
|
+
let mdiStream = fs.createWriteStream("./dist/mdi-icons.json" ,{flags: "w+"});
|
|
16
|
+
mdiStream.write("{\"size\":24,\"icons\":{");
|
|
17
|
+
|
|
18
|
+
let files = fs.readdirSync(mdiSvgDir).sort();
|
|
19
|
+
|
|
20
|
+
for (let i=0; i<files.length; i++) {
|
|
21
|
+
|
|
22
|
+
let file = files[i];
|
|
23
|
+
let fullPath = path.join(mdiSvgDir, file);
|
|
24
|
+
let data = fs.readFileSync(fullPath, "utf8");
|
|
25
|
+
let svg = new dom().parseFromString(data);
|
|
26
|
+
let select = xpath.useNamespaces({"svg": "http://www.w3.org/2000/svg"});
|
|
27
|
+
let pathAttrs = select("//svg:path/@d", svg);
|
|
28
|
+
let pathData = pathAttrs[0].value;
|
|
29
|
+
let name = file.substr(0, file.length-4);
|
|
30
|
+
//name = name.replace(/-([\w])/g, function (g) { return g[1].toUpperCase(); });
|
|
31
|
+
mdiStream.write("\"" + name + "\":\"" + pathData + "\"" + (i < files.length-1 ? "," : ""));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
mdiStream.write("}}");
|
|
35
|
+
mdiStream.close();
|
package/package.json
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-icon",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.2.0-snapshot.20240512155407",
|
|
4
4
|
"description": "Icon component for displaying an icon from an icon set",
|
|
5
5
|
"main": "dist/umd/index.bundle.js",
|
|
6
|
-
"module": "
|
|
7
|
-
"
|
|
6
|
+
"module": "lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./*": "./lib/*.js"
|
|
10
|
+
},
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
8
12
|
"scripts": {
|
|
13
|
+
"copyMdiFont": "node mdi-font-copy.js",
|
|
9
14
|
"build": "npx tsc -b",
|
|
10
15
|
"test": "echo \"No tests\" && exit 0",
|
|
11
|
-
"prepublishOnly": "npx
|
|
16
|
+
"prepublishOnly": "npx webpack"
|
|
12
17
|
},
|
|
13
18
|
"author": "OpenRemote",
|
|
14
19
|
"license": "AGPL-3.0-or-later",
|
|
15
20
|
"dependencies": {
|
|
16
|
-
"
|
|
21
|
+
"@mdi/font": "latest",
|
|
22
|
+
"lit": "^2.0.2"
|
|
17
23
|
},
|
|
18
24
|
"devDependencies": {
|
|
19
|
-
"terser-webpack-plugin": "^2.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"webpack": "^
|
|
23
|
-
"webpack-cli": "^3.3.9"
|
|
25
|
+
"terser-webpack-plugin": "^5.2.5",
|
|
26
|
+
"typescript": "^5.3.3",
|
|
27
|
+
"webpack": "^5.90.1",
|
|
28
|
+
"webpack-cli": "^5.1.4"
|
|
24
29
|
},
|
|
25
30
|
"publishConfig": {
|
|
26
31
|
"access": "public"
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/.project
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<projectDescription>
|
|
3
|
-
<name>or-icon</name>
|
|
4
|
-
<comment>Project or-icon created by Buildship.</comment>
|
|
5
|
-
<projects>
|
|
6
|
-
</projects>
|
|
7
|
-
<buildSpec>
|
|
8
|
-
<buildCommand>
|
|
9
|
-
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
</buildSpec>
|
|
14
|
-
<natures>
|
|
15
|
-
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
-
</natures>
|
|
17
|
-
</projectDescription>
|