@mediafly/js-ui 47.6.0-4 → 47.6.1
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/CHANGELOG.md +4 -0
- package/lib/page-thumbnail/page-thumbnail.d.ts +9 -1
- package/lib/page-thumbnail/page-thumbnail.js +16 -9
- package/lib/page-thumbnail/page-thumbnail.js.map +1 -1
- package/lib/rich-text/rich-text.component.d.ts +0 -1
- package/lib/rich-text/rich-text.component.js +3 -17
- package/lib/rich-text/rich-text.component.js.map +1 -1
- package/lib/tsconfig.deploy.tsbuildinfo +4 -4
- package/package.json +1 -1
- package/src/components/page-thumbnail/page-thumbnail.ts +17 -8
- package/src/components/rich-text/rich-text.component.ts +3 -22
- package/tsconfig.tsbuildinfo +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare function convertPageThumbnails(storyboard: ViewerContentStoryboard): PageThumbnail[];
|
|
2
|
-
export declare function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail,
|
|
2
|
+
export declare function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail, isReact: false, maxWidth: number, maxHeight?: number): {
|
|
3
3
|
[key: string]: string;
|
|
4
4
|
};
|
|
5
|
+
export declare function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail, isReact: true, maxWidth: number, maxHeight?: number): StoryboardCSS;
|
|
5
6
|
export interface PageThumbnail {
|
|
6
7
|
height: number;
|
|
7
8
|
imageWidth: number;
|
|
@@ -11,6 +12,13 @@ export interface PageThumbnail {
|
|
|
11
12
|
url: string;
|
|
12
13
|
width: number;
|
|
13
14
|
}
|
|
15
|
+
export interface StoryboardCSS {
|
|
16
|
+
width: string;
|
|
17
|
+
height: string;
|
|
18
|
+
backgroundImage: string;
|
|
19
|
+
backgroundPosition: string;
|
|
20
|
+
backgroundSize: string;
|
|
21
|
+
}
|
|
14
22
|
export interface ViewerContentStoryboard {
|
|
15
23
|
frameHeight?: number;
|
|
16
24
|
framesets: ViewerFrameset[];
|
|
@@ -45,7 +45,7 @@ function convertPageThumbnails(storyboard) {
|
|
|
45
45
|
return pageThumbnails;
|
|
46
46
|
}
|
|
47
47
|
exports.convertPageThumbnails = convertPageThumbnails;
|
|
48
|
-
function pageThumbnailBackgroundImageStyle(pageThumbnail,
|
|
48
|
+
function pageThumbnailBackgroundImageStyle(pageThumbnail, isReact, maxWidth, maxHeight) {
|
|
49
49
|
const backgroundImageUrl = pageThumbnail.url;
|
|
50
50
|
const aspectRatio = pageThumbnail.width / pageThumbnail.height;
|
|
51
51
|
let width;
|
|
@@ -70,18 +70,25 @@ function pageThumbnailBackgroundImageStyle(pageThumbnail, camelCaseAttributes, m
|
|
|
70
70
|
const backgroundImage = `url(${backgroundImageUrl})`;
|
|
71
71
|
const backgroundPosition = `${scale * pageThumbnail.left * -1}px ${scale * pageThumbnail.top * -1}px`;
|
|
72
72
|
const backgroundSize = `${scale * pageThumbnail.imageWidth}px`;
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
'width': `${width}px`,
|
|
76
|
-
};
|
|
77
|
-
if (camelCaseAttributes) {
|
|
73
|
+
const height = scale * pageThumbnail.height;
|
|
74
|
+
if (isReact) {
|
|
78
75
|
// We love React...
|
|
79
|
-
return
|
|
76
|
+
return {
|
|
77
|
+
backgroundImage,
|
|
80
78
|
backgroundPosition,
|
|
81
|
-
backgroundSize
|
|
79
|
+
backgroundSize,
|
|
80
|
+
height: `${height}px`,
|
|
81
|
+
width: `${width}px`,
|
|
82
|
+
};
|
|
82
83
|
}
|
|
83
84
|
// ... but we must also tolerate AngularJS
|
|
84
|
-
return
|
|
85
|
+
return {
|
|
86
|
+
'background-image': backgroundImage,
|
|
87
|
+
'background-position': backgroundPosition,
|
|
88
|
+
'background-size': backgroundSize,
|
|
89
|
+
'height': `${height}px`,
|
|
90
|
+
'width': `${width}px`,
|
|
91
|
+
};
|
|
85
92
|
}
|
|
86
93
|
exports.pageThumbnailBackgroundImageStyle = pageThumbnailBackgroundImageStyle;
|
|
87
94
|
//# sourceMappingURL=page-thumbnail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-thumbnail.js","sourceRoot":"","sources":["../../src/components/page-thumbnail/page-thumbnail.ts"],"names":[],"mappings":";;;AAAA,SAAgB,qBAAqB,CAAC,UAAmC;IACxE,MAAM,cAAc,GAAoB,EAAE,CAAA;IAC1C,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACvC,mFAAmF;QACnF,IAAI,UAAkB,CAAA;QACtB,IAAI,WAAmB,CAAA;QACvB,IAAI,UAAU,CAAC,UAAU,IAAI,UAAU,CAAC,WAAW,EAAE;YAEpD,mHAAmH;YACnH,oEAAoE;YACpE,UAAU,GAAG,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAA;YACvD,WAAW,GAAG,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,OAAO,CAAA;SAEzD;aAAM,IAAI,UAAU,CAAC,OAAO,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAEjF,oHAAoH;YACpH,UAAU,GAAG,CAAC,CAAA;YACd,WAAW,GAAG,CAAC,CAAA;YACf,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACjC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;gBACzC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAA;aACrB;SAED;aAAM;YAEN,sEAAsE;YACtE,+EAA+E;YAE/E,UAAU,GAAG,CAAC,CAAA;YACd,WAAW,GAAG,CAAC,CAAA;SAEf;QAED,IAAI,QAAQ,CAAC,IAAI,EAAE;YAClB,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC5B,cAAe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Aa,CAAC,KAAK,CAAA;IAEzC,MAAM,eAAe,GAAG,OAAO,kBAAkB,GAAG,CAAA;IACpD,MAAM,kBAAkB,GAAG,GAAG,KAAK,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACrG,MAAM,cAAc,GAAG,GAAG,KAAK,GAAG,aAAa,CAAC,UAAU,IAAI,CAAA;IAE9D,MAAM,MAAM,GAAG,KAAK,GAAG,aAAa,CAAC,MAAM,CAAA;IAE3C,IAAI,OAAO,EAAE;QACZ,mBAAmB;QACnB,OAAO;YACN,eAAe;YACf,kBAAkB;YAClB,cAAc;YACd,MAAM,EAAE,GAAG,MAAM,IAAI;YACrB,KAAK,EAAE,GAAG,KAAK,IAAI;SACnB,CAAA;KACD;IAED,0CAA0C;IAC1C,OAAO;QACN,kBAAkB,EAAE,eAAe;QACnC,qBAAqB,EAAE,kBAAkB;QACzC,iBAAiB,EAAE,cAAc;QACjC,QAAQ,EAAE,GAAG,MAAM,IAAI;QACvB,OAAO,EAAE,GAAG,KAAK,IAAI;KACrB,CAAA;AACF,CAAC;AA9CD,8EA8CC"}
|
|
@@ -43,7 +43,6 @@ export default class RichTextComponentController implements ng.IComponentControl
|
|
|
43
43
|
protected setFocusInEditor: () => void;
|
|
44
44
|
private applyColor;
|
|
45
45
|
private sanitizeContents;
|
|
46
|
-
private formatToCurrentToolbarOptions;
|
|
47
46
|
private formatToDefaults;
|
|
48
47
|
private getFontFromLeaf;
|
|
49
48
|
private updateFontDisplay;
|
|
@@ -122,10 +122,8 @@ class RichTextComponentController {
|
|
|
122
122
|
const format = this.editor.getFormat(selection.index, 0);
|
|
123
123
|
// the following checks for an empty formatting
|
|
124
124
|
if (lodash_1.default.isEmpty(format)) {
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
/// this occurs when the user selects then deletes a line
|
|
128
|
-
this.formatToCurrentToolbarOptions();
|
|
125
|
+
// if format is empty then set back to default styles
|
|
126
|
+
this.formatToDefaults();
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
selectionChange(range, oldRange, source) {
|
|
@@ -140,7 +138,7 @@ class RichTextComponentController {
|
|
|
140
138
|
const format = this.editor.getFormat(range);
|
|
141
139
|
this.updateColorDisplay(range);
|
|
142
140
|
// if get format is empty we can switch to the defaults
|
|
143
|
-
if (!format.color) {
|
|
141
|
+
if (!format.color && !this.selectedColor) {
|
|
144
142
|
this.editor.format('color', this.DEFAULT_COLOR);
|
|
145
143
|
}
|
|
146
144
|
if (!format.size) {
|
|
@@ -165,18 +163,6 @@ class RichTextComponentController {
|
|
|
165
163
|
this.ngModelCtrl.$setViewValue(html);
|
|
166
164
|
this.manageValidity();
|
|
167
165
|
}
|
|
168
|
-
formatToCurrentToolbarOptions() {
|
|
169
|
-
if (this.selectedFont !== this.DEFAULT_FONT) {
|
|
170
|
-
this.editor.format('font', this.selectedFont);
|
|
171
|
-
}
|
|
172
|
-
const fontSize = jquery_1.default('#editorSize .ql-picker-label').attr('data-value');
|
|
173
|
-
if (fontSize && fontSize !== this.DEFAULT_SIZE) {
|
|
174
|
-
this.editor.format('size', fontSize);
|
|
175
|
-
}
|
|
176
|
-
if (this.selectedColor !== this.DEFAULT_COLOR) {
|
|
177
|
-
this.applyColor();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
166
|
formatToDefaults() {
|
|
181
167
|
this.updateFontDisplay(this.DEFAULT_FONT);
|
|
182
168
|
this.editor.format('color', this.DEFAULT_COLOR);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text.component.js","sourceRoot":"","sources":["../../src/components/rich-text/rich-text.component.ts"],"names":[],"mappings":";;;;;AAAA,sDAA2C;AAC3C,oDAAsB;AACtB,kDAAyB;AACzB,oDAAsB;AAGtB,8GAA8G;AAC9G,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,iBAAgD,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,IAAI,CAAC,KAAK,IAAI,gBAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBAEvC,OAAM;aACN;YACD,IAAI,gBAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAErB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBAC7B,OAAM;aACN;YAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAA;QAC3B,CAAC,CAAC,CAAA;IAEH,CAAC;CAGD;AAnPD,8CAmPC;AAGD,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE;IAC3C,QAAQ,EAAE;QACT,mBAAmB,EAAE,GAAG;QACxB,kBAAkB,EAAE,GAAG;QACvB,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,GAAG;KACZ;IACD,UAAU,EAAE,2BAA2B;IACvC,OAAO,EAAE;QACR,WAAW,EAAE,SAAS;KACtB;IACD,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC;CAC/C,CAAC,CAAA"}
|
|
@@ -1187,8 +1187,8 @@
|
|
|
1187
1187
|
"affectsGlobalScope": false
|
|
1188
1188
|
},
|
|
1189
1189
|
"../src/components/page-thumbnail/page-thumbnail.ts": {
|
|
1190
|
-
"version": "
|
|
1191
|
-
"signature": "
|
|
1190
|
+
"version": "23bbfd8b6f1093063b808be530baeb1718c4eab0f3e67c505e978cb5fa48fc88",
|
|
1191
|
+
"signature": "a03bd5e31b42792e888ef691d394694fe892b0d2f689a17716972bd688f669da",
|
|
1192
1192
|
"affectsGlobalScope": false
|
|
1193
1193
|
},
|
|
1194
1194
|
"../src/components/page-thumbnail/page-thumbnail.service.ts": {
|
|
@@ -1267,8 +1267,8 @@
|
|
|
1267
1267
|
"affectsGlobalScope": false
|
|
1268
1268
|
},
|
|
1269
1269
|
"../src/components/rich-text/rich-text.component.ts": {
|
|
1270
|
-
"version": "
|
|
1271
|
-
"signature": "
|
|
1270
|
+
"version": "c955d5d8fbd32b0c3fa9fc03ed3559c9648b73503620a163910c399c648ad320",
|
|
1271
|
+
"signature": "5d72d8ee5085468e11eee646b9322ade6ae8b9739ef3c47fee36b7242923311a",
|
|
1272
1272
|
"affectsGlobalScope": false
|
|
1273
1273
|
},
|
|
1274
1274
|
"../src/components/rich-text/index.ts": {
|
package/package.json
CHANGED
|
@@ -49,7 +49,9 @@ export function convertPageThumbnails(storyboard: ViewerContentStoryboard): Page
|
|
|
49
49
|
return pageThumbnails
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail,
|
|
52
|
+
export function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail, isReact: false, maxWidth: number, maxHeight?: number): { [key: string]: string }
|
|
53
|
+
export function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail, isReact: true, maxWidth: number, maxHeight?: number): StoryboardCSS
|
|
54
|
+
export function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail, isReact: boolean, maxWidth: number, maxHeight?: number): StoryboardCSS | { [key: string]: string } {
|
|
53
55
|
const backgroundImageUrl = pageThumbnail.url
|
|
54
56
|
const aspectRatio = pageThumbnail.width / pageThumbnail.height
|
|
55
57
|
|
|
@@ -74,27 +76,26 @@ export function pageThumbnailBackgroundImageStyle(pageThumbnail: PageThumbnail,
|
|
|
74
76
|
const backgroundPosition = `${scale * pageThumbnail.left * -1}px ${scale * pageThumbnail.top * -1}px`
|
|
75
77
|
const backgroundSize = `${scale * pageThumbnail.imageWidth}px`
|
|
76
78
|
|
|
77
|
-
const
|
|
78
|
-
'height': `${scale * pageThumbnail.height}px`,
|
|
79
|
-
'width': `${width}px`,
|
|
80
|
-
}
|
|
79
|
+
const height = scale * pageThumbnail.height
|
|
81
80
|
|
|
82
|
-
if (
|
|
81
|
+
if (isReact) {
|
|
83
82
|
// We love React...
|
|
84
83
|
return {
|
|
85
|
-
...style,
|
|
86
84
|
backgroundImage,
|
|
87
85
|
backgroundPosition,
|
|
88
86
|
backgroundSize,
|
|
87
|
+
height: `${height}px`,
|
|
88
|
+
width: `${width}px`,
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// ... but we must also tolerate AngularJS
|
|
93
93
|
return {
|
|
94
|
-
...style,
|
|
95
94
|
'background-image': backgroundImage,
|
|
96
95
|
'background-position': backgroundPosition,
|
|
97
96
|
'background-size': backgroundSize,
|
|
97
|
+
'height': `${height}px`,
|
|
98
|
+
'width': `${width}px`,
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -108,6 +109,14 @@ export interface PageThumbnail {
|
|
|
108
109
|
width: number
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
export interface StoryboardCSS {
|
|
113
|
+
width: string
|
|
114
|
+
height: string
|
|
115
|
+
backgroundImage: string
|
|
116
|
+
backgroundPosition: string
|
|
117
|
+
backgroundSize: string
|
|
118
|
+
}
|
|
119
|
+
|
|
111
120
|
// Duplicated from viewer-api-typings, which we don't want to reference in this repo
|
|
112
121
|
export interface ViewerContentStoryboard {
|
|
113
122
|
frameHeight?: number
|
|
@@ -153,10 +153,8 @@ export default class RichTextComponentController implements ng.IComponentControl
|
|
|
153
153
|
const format = this.editor.getFormat(selection.index, 0)
|
|
154
154
|
// the following checks for an empty formatting
|
|
155
155
|
if (_.isEmpty(format)) {
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
/// this occurs when the user selects then deletes a line
|
|
159
|
-
this.formatToCurrentToolbarOptions()
|
|
156
|
+
// if format is empty then set back to default styles
|
|
157
|
+
this.formatToDefaults()
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
160
|
|
|
@@ -171,10 +169,8 @@ export default class RichTextComponentController implements ng.IComponentControl
|
|
|
171
169
|
|
|
172
170
|
this.updateColorDisplay(range)
|
|
173
171
|
|
|
174
|
-
|
|
175
|
-
|
|
176
172
|
// if get format is empty we can switch to the defaults
|
|
177
|
-
if (!format.color) {
|
|
173
|
+
if (!format.color && !this.selectedColor) {
|
|
178
174
|
this.editor.format('color', this.DEFAULT_COLOR)
|
|
179
175
|
}
|
|
180
176
|
if (!format.size) {
|
|
@@ -212,21 +208,6 @@ export default class RichTextComponentController implements ng.IComponentControl
|
|
|
212
208
|
this.manageValidity()
|
|
213
209
|
}
|
|
214
210
|
|
|
215
|
-
private formatToCurrentToolbarOptions() {
|
|
216
|
-
if (this.selectedFont !== this.DEFAULT_FONT) {
|
|
217
|
-
this.editor.format('font', this.selectedFont)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const fontSize = $('#editorSize .ql-picker-label').attr('data-value')
|
|
221
|
-
if (fontSize && fontSize !== this.DEFAULT_SIZE) {
|
|
222
|
-
this.editor.format('size', fontSize)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (this.selectedColor !== this.DEFAULT_COLOR) {
|
|
226
|
-
this.applyColor()
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
211
|
private formatToDefaults() {
|
|
231
212
|
this.updateFontDisplay(this.DEFAULT_FONT)
|
|
232
213
|
this.editor.format('color', this.DEFAULT_COLOR)
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1962,8 +1962,8 @@
|
|
|
1962
1962
|
"affectsGlobalScope": false
|
|
1963
1963
|
},
|
|
1964
1964
|
"./src/components/page-thumbnail/page-thumbnail.ts": {
|
|
1965
|
-
"version": "
|
|
1966
|
-
"signature": "
|
|
1965
|
+
"version": "23bbfd8b6f1093063b808be530baeb1718c4eab0f3e67c505e978cb5fa48fc88",
|
|
1966
|
+
"signature": "a03bd5e31b42792e888ef691d394694fe892b0d2f689a17716972bd688f669da",
|
|
1967
1967
|
"affectsGlobalScope": false
|
|
1968
1968
|
},
|
|
1969
1969
|
"./src/components/page-thumbnail/page-thumbnail.service.ts": {
|
|
@@ -2017,8 +2017,8 @@
|
|
|
2017
2017
|
"affectsGlobalScope": false
|
|
2018
2018
|
},
|
|
2019
2019
|
"./src/components/rich-text/rich-text.component.ts": {
|
|
2020
|
-
"version": "
|
|
2021
|
-
"signature": "
|
|
2020
|
+
"version": "c955d5d8fbd32b0c3fa9fc03ed3559c9648b73503620a163910c399c648ad320",
|
|
2021
|
+
"signature": "5d72d8ee5085468e11eee646b9322ade6ae8b9739ef3c47fee36b7242923311a",
|
|
2022
2022
|
"affectsGlobalScope": false
|
|
2023
2023
|
},
|
|
2024
2024
|
"./src/components/rich-text/index.ts": {
|
|
@@ -2796,7 +2796,7 @@
|
|
|
2796
2796
|
"target": 2,
|
|
2797
2797
|
"inlineSourceMap": false,
|
|
2798
2798
|
"declarationMap": false,
|
|
2799
|
-
"pathsBasePath": "/Users/
|
|
2799
|
+
"pathsBasePath": "/Users/mdonegan/Mediafly/mediafly-js-ui",
|
|
2800
2800
|
"configFilePath": "./tsconfig.json"
|
|
2801
2801
|
},
|
|
2802
2802
|
"referencedMap": {
|
|
@@ -5491,7 +5491,7 @@
|
|
|
5491
5491
|
"./node_modules/fast-glob/out/index.d.ts"
|
|
5492
5492
|
],
|
|
5493
5493
|
"./node_modules/@types/uglify-js/index.d.ts": [
|
|
5494
|
-
"./node_modules/
|
|
5494
|
+
"./node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts"
|
|
5495
5495
|
],
|
|
5496
5496
|
"./node_modules/@types/webpack-sources/index.d.ts": [
|
|
5497
5497
|
"./node_modules/@types/node/index.d.ts",
|
|
@@ -5571,9 +5571,9 @@
|
|
|
5571
5571
|
"./node_modules/@types/node/index.d.ts",
|
|
5572
5572
|
"./node_modules/@types/tapable/index.d.ts",
|
|
5573
5573
|
"./node_modules/@types/uglify-js/index.d.ts",
|
|
5574
|
+
"./node_modules/@types/uglify-js/node_modules/source-map/source-map.d.ts",
|
|
5574
5575
|
"./node_modules/@types/webpack-sources/index.d.ts",
|
|
5575
|
-
"./node_modules/anymatch/index.d.ts"
|
|
5576
|
-
"./node_modules/postcss/node_modules/source-map/source-map.d.ts"
|
|
5576
|
+
"./node_modules/anymatch/index.d.ts"
|
|
5577
5577
|
],
|
|
5578
5578
|
"./node_modules/@uirouter/angularjs/lib/directives/viewDirective.d.ts": [
|
|
5579
5579
|
"./node_modules/@uirouter/angularjs/lib/directives/stateDirectives.d.ts",
|
|
@@ -6313,7 +6313,7 @@
|
|
|
6313
6313
|
"./src/app/forms/date-time-pickers/date-time-pickers.route.ts"
|
|
6314
6314
|
],
|
|
6315
6315
|
"./src/app/forms/date-tz-picker/date-tz-picker.page.ts": [
|
|
6316
|
-
"./node_modules/moment/
|
|
6316
|
+
"./node_modules/moment/moment.d.ts"
|
|
6317
6317
|
],
|
|
6318
6318
|
"./src/app/forms/date-tz-picker/index.ts": [
|
|
6319
6319
|
"./src/app/forms/date-tz-picker/date-tz-picker.page.ts",
|
|
@@ -6462,7 +6462,6 @@
|
|
|
6462
6462
|
"./src/components/dropdown/dropdown.ts"
|
|
6463
6463
|
],
|
|
6464
6464
|
"./src/components/feedback/clipboard.service.ts": [
|
|
6465
|
-
"./node_modules/clipboard/src/clipboard.d.ts",
|
|
6466
6465
|
"./src/components/feedback/feedback.component.ts",
|
|
6467
6466
|
"./src/components/feedback/feedback.service.ts"
|
|
6468
6467
|
],
|