Skip to content

Commit 3877d84

Browse files
nmetulevbeth-panx
andauthored
Fixes bundle by moving back to @FluentUI\web-components 0.22 (#1314)
* undo mgt-loader fixes * downgraded to @fluentui/[email protected] * export file-upload Co-authored-by: Beth Pan <[email protected]>
1 parent aaf6d02 commit 3877d84

File tree

5 files changed

+35
-43
lines changed

5 files changed

+35
-43
lines changed

packages/mgt-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@microsoft/microsoft-graph-client": "^2.2.1",
4141
"@microsoft/microsoft-graph-types": "^2.0.0",
4242
"@microsoft/microsoft-graph-types-beta": "^0.15.0-preview",
43-
"@fluentui/web-components": "^1.3.3",
43+
"@fluentui/web-components": "0.22.1",
4444
"office-ui-fabric-core": "11.0.0"
4545
},
4646
"publishConfig": {

packages/mgt-components/src/components/mgt-file-list/mgt-file-list.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ import { strings } from './strings';
4141
import { MgtFile } from '../mgt-file/mgt-file';
4242
import { MgtFileUploadConfig } from './mgt-file-upload/mgt-file-upload';
4343

44-
import { fluentProgressRing } from '@fluentui/web-components';
45-
import { registerFluentComponents } from '../../utils/FluentComponents';
44+
export { FluentDesignSystemProvider, FluentProgressRing } from '@fluentui/web-components';
45+
export * from './mgt-file-upload/mgt-file-upload';
4646

47-
registerFluentComponents(fluentProgressRing);
47+
// import { fluentProgressRing } from '@fluentui/web-components';
48+
// import { registerFluentComponents } from '../../utils/FluentComponents';
49+
50+
// registerFluentComponents(fluentProgressRing);
4851

4952
/**
5053
* The File List component displays a list of multiple folders and files by
@@ -573,6 +576,7 @@ export class MgtFileList extends MgtTemplatedComponent {
573576
*/
574577
protected renderFiles(): TemplateResult {
575578
return html`
579+
<fluent-design-system-provider use-defaults>
576580
<div id="file-list-wrapper" class="file-list-wrapper" dir=${this.direction}>
577581
${this.enableFileUpload ? this.renderFileUpload() : null}
578582
<ul
@@ -599,6 +603,7 @@ export class MgtFileList extends MgtTemplatedComponent {
599603
: null
600604
}
601605
</div>
606+
</fluent-design-system-provider>
602607
`;
603608
}
604609

packages/mgt-components/src/components/mgt-file-list/mgt-file-upload/mgt-file-upload.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ import {
2222
deleteSessionFile
2323
} from '../../../graph/graph.files';
2424

25-
import { registerFluentComponents } from '../../../utils/FluentComponents';
26-
import { fluentButton, fluentCheckbox, fluentProgress } from '@fluentui/web-components';
25+
export { FluentProgress, FluentButton, FluentCheckbox } from '@fluentui/web-components';
2726

28-
registerFluentComponents(fluentProgress, fluentButton, fluentCheckbox);
27+
// import { registerFluentComponents } from '../../../utils/FluentComponents';
28+
// import { fluentButton, fluentCheckbox, fluentProgress } from '@fluentui/web-components';
29+
30+
// registerFluentComponents(fluentProgress, fluentButton, fluentCheckbox);
2931

3032
/**
3133
* Upload conflict behavior status
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import { provideFluentDesignSystem } from '@fluentui/web-components';
1+
// import { provideFluentDesignSystem } from '@fluentui/web-components';
22

3-
const designSystem = provideFluentDesignSystem();
3+
// const designSystem = provideFluentDesignSystem();
44

5-
export const registerFluentComponents = (...fluentComponents) => {
6-
if (!fluentComponents || !fluentComponents.length) {
7-
return;
8-
}
5+
// export const registerFluentComponents = (...fluentComponents) => {
6+
// if (!fluentComponents || !fluentComponents.length) {
7+
// return;
8+
// }
99

10-
const registry = {
11-
register(container: any) {
12-
if (!container) {
13-
return;
14-
}
10+
// const registry = {
11+
// register(container: any) {
12+
// if (!container) {
13+
// return;
14+
// }
1515

16-
for (const component of fluentComponents) {
17-
component().register(container);
18-
}
19-
}
20-
};
16+
// for (const component of fluentComponents) {
17+
// component().register(container);
18+
// }
19+
// }
20+
// };
2121

22-
designSystem.register(registry);
23-
};
22+
// designSystem.register(registry);
23+
// };

packages/mgt/src/bundle/mgt-loader.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* -------------------------------------------------------------------------------------------
66
*/
77

8-
(async function () {
8+
(function () {
99
'use strict';
1010

1111
var rootPath = getScriptPath();
@@ -15,8 +15,6 @@
1515
window.WebComponents = window.WebComponents || {};
1616
window.WebComponents.root = rootPath + 'wc/';
1717

18-
await waitUntilReady();
19-
2018
addScript(rootPath + 'wc/webcomponents-loader.js');
2119
addScript(rootPath + 'mgt.es6.js');
2220
} else {
@@ -50,19 +48,6 @@
5048
return true;
5149
}
5250

53-
function waitUntilReady() {
54-
55-
return new Promise(function (resolve, reject) {
56-
if (document.body) {
57-
resolve();
58-
}
59-
60-
document.addEventListener('DOMContentLoaded', function () {
61-
resolve();
62-
})
63-
});
64-
};
65-
6651
function addScript(src, onload) {
6752
// TODO: support async loading
6853

@@ -73,7 +58,7 @@
7358
// tag.addEventListener("load", onload);
7459
// }
7560

76-
// document.write(tag.outerHTML);
77-
document.head.appendChild(tag);
61+
document.write(tag.outerHTML);
62+
// document.head.appendChild(tag);
7863
}
7964
})();

0 commit comments

Comments
 (0)