This repository was archived by the owner on Dec 3, 2024. It is now read-only.
File tree 5 files changed +52
-39
lines changed
5 files changed +52
-39
lines changed Original file line number Diff line number Diff line change
1
+ declare module "*.html" {
2
+ const content : string ;
3
+ export default content ;
4
+ }
Original file line number Diff line number Diff line change
1
+ < div class ="office-js-helpers-notification ms-font-m ms-MessageBar @@CLASS ">
2
+ < style >
3
+ .office-js-helpers-notification {
4
+ position : fixed;
5
+ z-index : 2147483647 ;
6
+ top : 0 ;
7
+ left : 0 ;
8
+ right : 0 ;
9
+ width : 100% ;
10
+ padding : 0 0 10px 0 ;
11
+ }
12
+
13
+ .office-js-helpers-notification > div > div {
14
+ padding : 10px 15px ;
15
+ box-sizing : border-box;
16
+ }
17
+
18
+ .office-js-helpers-notification pre {
19
+ white-space : pre-wrap;
20
+ word-wrap : break-word;
21
+ margin : 0px ;
22
+ font-size : smaller;
23
+ }
24
+
25
+ .office-js-helpers-notification > button {
26
+ height : 52px ;
27
+ width : 40px ;
28
+ cursor : pointer;
29
+ float : right;
30
+ background : transparent;
31
+ border : 0 ;
32
+ margin-left : 10px ;
33
+ margin-right : '@@PADDING'
34
+ }
35
+ </ style >
36
+ < button >
37
+ < i class ="ms-Icon ms-Icon--Clear "> </ i >
38
+ </ button >
39
+ </ div >
Original file line number Diff line number Diff line change 3
3
import { isString , isError , isObject } from 'lodash-es' ;
4
4
import { CustomError } from '../errors/custom.error' ;
5
5
import { Utilities , PlatformType } from '../helpers/utilities' ;
6
+ import html from './message-banner.html' ;
6
7
7
8
export class UI {
8
9
/** Shows a basic notification at the top of the page
@@ -67,43 +68,7 @@ export class UI {
67
68
paddingForPersonalityMenu = '40px' ;
68
69
}
69
70
70
- const messageBannerHtml = `
71
- <div class="office-js-helpers-notification ms-font-m ms-MessageBar ${ messageBarTypeClass } ">
72
- <style>
73
- .office-js-helpers-notification {
74
- position: fixed;
75
- z-index: 2147483647;
76
- top: 0;
77
- left: 0;
78
- right: 0;
79
- width: 100%;
80
- padding: 0 0 10px 0;
81
- }
82
- .office-js-helpers-notification > div > div {
83
- padding: 10px 15px;
84
- box-sizing: border-box;
85
- }
86
- .office-js-helpers-notification pre {
87
- white-space: pre-wrap;
88
- word-wrap: break-word;
89
- margin: 0px;
90
- font-size: smaller;
91
- }
92
- .office-js-helpers-notification > button {
93
- height: 52px;
94
- width: 40px;
95
- cursor: pointer;
96
- float: right;
97
- background: transparent;
98
- border: 0;
99
- margin-left: 10px;
100
- margin-right: ${ paddingForPersonalityMenu }
101
- }
102
- </style>
103
- <button>
104
- <i class="ms-Icon ms-Icon--Clear"></i>
105
- </button>
106
- </div>` ;
71
+ const messageBannerHtml = html . replace ( '@@CLASS' , messageBarTypeClass ) . replace ( '\'@@PADDING\'' , paddingForPersonalityMenu ) ;
107
72
108
73
const existingNotifications = document . getElementsByClassName ( 'office-js-helpers-notification' ) ;
109
74
while ( existingNotifications [ 0 ] ) {
Original file line number Diff line number Diff line change 8
8
"moduleResolution" : " node" ,
9
9
"emitDecoratorMetadata" : true ,
10
10
"experimentalDecorators" : true ,
11
+ "noResolve" : false ,
11
12
"removeComments" : false ,
12
13
"allowUnusedLabels" : false ,
13
14
"noImplicitReturns" : true ,
16
17
"sourceMap" : true ,
17
18
"declaration" : true ,
18
19
"allowSyntheticDefaultImports" : true ,
20
+ "jsx" : " react" ,
19
21
"lib" : [
20
22
" dom" ,
21
23
" es2016"
22
24
],
23
25
"typeRoots" : [
24
- " node_modules/@types"
26
+ " node_modules/@types" ,
27
+ " ./global.d.ts"
25
28
]
26
29
},
27
30
"exclude" : [
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ const config = {
30
30
{
31
31
test : / ( \. h t m l ) $ / ,
32
32
loader : 'html-loader' ,
33
- exclude : / n o d e _ m o d u l e s /
33
+ options : {
34
+ exportAsEs6Default : true
35
+ }
34
36
} ,
35
37
{
36
38
test : / ( \. t s ) $ / ,
You can’t perform that action at this time.
0 commit comments