@octostar/platform-api 0.2.1 → 0.2.5
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/platform-api.d.ts
CHANGED
|
@@ -162,12 +162,11 @@ export declare class OsIcon extends HTMLElement {
|
|
|
162
162
|
private root;
|
|
163
163
|
private whatFor;
|
|
164
164
|
private desktop;
|
|
165
|
-
private loadedFontAwesome;
|
|
166
165
|
constructor();
|
|
167
166
|
static get observedAttributes(): string[];
|
|
168
167
|
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
169
168
|
connectedCallback(): void;
|
|
170
|
-
|
|
169
|
+
loadFontAwesomeStyles(): void;
|
|
171
170
|
set for(value: Entity | Concept | string);
|
|
172
171
|
get for(): Entity | Concept | string;
|
|
173
172
|
render(): Promise<void>;
|
|
@@ -7,12 +7,11 @@ export declare class OsIcon extends HTMLElement {
|
|
|
7
7
|
private root;
|
|
8
8
|
private whatFor;
|
|
9
9
|
private desktop;
|
|
10
|
-
private loadedFontAwesome;
|
|
11
10
|
constructor();
|
|
12
11
|
static get observedAttributes(): string[];
|
|
13
12
|
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
14
13
|
connectedCallback(): void;
|
|
15
|
-
|
|
14
|
+
loadFontAwesomeStyles(): void;
|
|
16
15
|
set for(value: Entity | Concept | string);
|
|
17
16
|
get for(): Entity | Concept | string;
|
|
18
17
|
render(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OsIcon.d.ts","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"OsIcon.d.ts","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKpE;;;GAGG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,OAAO,CAAwC;IAEvD,OAAO,CAAC,OAAO,CAAsB;;IAQrC,MAAM,KAAK,kBAAkB,aAE5B;IAED,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAWnE,iBAAiB;IAMjB,qBAAqB;IAmBrB,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAEvC;IAED,IAAI,GAAG,IAAI,MAAM,GAAG,OAAO,GAAG,MAAM,CAEnC;IAEK,MAAM;CAeb"}
|
package/lib/components/OsIcon.js
CHANGED
|
@@ -16,18 +16,8 @@ let fontAwesomeStylesLoaded = false;
|
|
|
16
16
|
export class OsIcon extends HTMLElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
|
-
this.loadedFontAwesome = false;
|
|
20
19
|
this.root = this.attachShadow({ mode: 'open' });
|
|
21
|
-
|
|
22
|
-
if (!fontAwesomeStylesLoaded) {
|
|
23
|
-
fontAwesomeStylesLoaded = true;
|
|
24
|
-
['fontawesome', 'brands', 'solid'].forEach(style => {
|
|
25
|
-
const link = document.createElement('link');
|
|
26
|
-
link.href = `/static/assets/fontawesome/css/${style}.css`;
|
|
27
|
-
link.rel = 'stylesheet';
|
|
28
|
-
document.head.appendChild(link);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
20
|
+
this.loadFontAwesomeStyles();
|
|
31
21
|
}
|
|
32
22
|
static get observedAttributes() {
|
|
33
23
|
return ['for'];
|
|
@@ -48,18 +38,19 @@ export class OsIcon extends HTMLElement {
|
|
|
48
38
|
this.render();
|
|
49
39
|
}
|
|
50
40
|
}
|
|
51
|
-
|
|
52
|
-
// Check if Font Awesome is already loaded
|
|
53
|
-
if (
|
|
54
|
-
|
|
41
|
+
loadFontAwesomeStyles() {
|
|
42
|
+
// Check if Font Awesome CSS is already loaded globally
|
|
43
|
+
if (!fontAwesomeStylesLoaded) {
|
|
44
|
+
fontAwesomeStylesLoaded = true;
|
|
45
|
+
['fontawesome', 'brands', 'solid'].forEach(style => {
|
|
46
|
+
if (!document.querySelector(`link[href="/static/assets/fontawesome/css/${style}.css"]`)) {
|
|
47
|
+
const link = document.createElement('link');
|
|
48
|
+
link.href = `/static/assets/fontawesome/css/${style}.css`;
|
|
49
|
+
link.rel = 'stylesheet';
|
|
50
|
+
document.head.appendChild(link);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
55
53
|
}
|
|
56
|
-
this.loadedFontAwesome = true;
|
|
57
|
-
['fontawesome', 'brands', 'solid'].forEach(style => {
|
|
58
|
-
const link = document.createElement('link');
|
|
59
|
-
link.href = `/static/assets/fontawesome/css/${style}.css`;
|
|
60
|
-
link.rel = 'stylesheet';
|
|
61
|
-
this.root.appendChild(link);
|
|
62
|
-
});
|
|
63
54
|
}
|
|
64
55
|
set for(value) {
|
|
65
56
|
this.whatFor = value;
|
|
@@ -75,7 +66,8 @@ export class OsIcon extends HTMLElement {
|
|
|
75
66
|
const html = yield (this.desktop || desktopApi()).internalGetIconCode(this.whatFor);
|
|
76
67
|
this.root.innerHTML = html;
|
|
77
68
|
if (/class="fa[srb]? /.test(html)) {
|
|
78
|
-
|
|
69
|
+
// Ensure Font Awesome styles are loaded
|
|
70
|
+
this.loadFontAwesomeStyles();
|
|
79
71
|
}
|
|
80
72
|
});
|
|
81
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OsIcon.js","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OsIcon.js","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAEpC;;;G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AC,CAAC;SACJ;IACH,CAAC;IAED,IAAI,GAAG,CAAC,KAAgC;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEK,MAAM;;YACV,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,OAAO;aACR;YAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,mBAAmB,CACnE,IAAI,CAAC,OAAO,CACb,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YAE3B,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACjC,wCAAwC;gBACxC,IAAI,CAAC,qBAAqB,EAAE,CAAC;aAC9B;QACH,CAAC;KAAA;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;IAClC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAC1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octostar/platform-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Provides access to the API exposed by Octostar platform to an application run in an iframe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"octostar",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "65fa92a4264d11f6116cc1eb4f1fdb8bff9f1b57"
|
|
47
47
|
}
|