@spfx-extensions/package 1.4.13 → 1.4.14
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/.npmignore +16 -0
- package/.nvmrc +1 -0
- package/config/config.json +27 -0
- package/config/deploy-azure-storage.json +7 -0
- package/config/package-solution.json +51 -0
- package/config/sass.json +3 -0
- package/config/serve.json +18 -0
- package/config/write-manifests.json +4 -0
- package/dist/8d1029da-85e6-48cc-aaaf-37a5bbc0b9be.manifest.json +2 -2
- package/dist/d6ca1fc2-0591-4c6d-8a25-cae3262c017b.manifest.json +2 -2
- package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/Extension_8d1029da-85e6-48cc-aaaf-37a5bbc0b9be.xml +1 -1
- package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/WebPart_d6ca1fc2-0591-4c6d-8a25-cae3262c017b.xml +1 -1
- package/dist/debug/AppManifest.xml +1 -1
- package/dist/debug/ClientSideAssets/{spfx-extension-application-customizer_a8132780a6e1626ca4ef.js → spfx-extension-application-customizer_f0f5307fc5a53d9f1bf3.js} +1 -1
- package/dist/{spfx-extension-loader_d2e5154cdd7a4b34af83.js → debug/ClientSideAssets/spfx-extension-loader_ac0f2df65ce1ce6e1f32.js} +1 -1
- package/dist/{spfx-extensionloader-web-part_e4f8ad9f3b2be2ee380e.js → debug/ClientSideAssets/spfx-extensionloader-web-part_ba2f54e9a51ea6f42f14.js} +1 -1
- package/dist/debug/ClientSideAssets.xml +1 -1
- package/dist/debug/ClientSideAssets.xml.config.xml +1 -1
- package/dist/debug/_rels/ClientSideAssets.xml.rels +1 -1
- package/dist/debug/feature_83e13c11-682e-4eaa-9ae0-74617ca28f96.xml +1 -1
- package/dist/debug/feature_83e13c11-682e-4eaa-9ae0-74617ca28f96.xml.config.xml +1 -1
- package/dist/deploy/sp-fx-extensions.sppkg +0 -0
- package/dist/{spfx-extension-application-customizer_a8132780a6e1626ca4ef.js → spfx-extension-application-customizer_f0f5307fc5a53d9f1bf3.js} +1 -1
- package/dist/{debug/ClientSideAssets/spfx-extension-loader_d2e5154cdd7a4b34af83.js → spfx-extension-loader_ac0f2df65ce1ce6e1f32.js} +1 -1
- package/dist/{debug/ClientSideAssets/spfx-extensionloader-web-part_e4f8ad9f3b2be2ee380e.js → spfx-extensionloader-web-part_ba2f54e9a51ea6f42f14.js} +1 -1
- package/gulpfile.js +202 -0
- package/package.json +12 -2
- package/sharepoint/assets/ClientSideInstance.xml +9 -0
- package/sharepoint/assets/elements.xml +9 -0
- package/src/@types/globals.d.ts +15 -0
- package/src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.manifest.json +17 -0
- package/src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.ts +52 -0
- package/src/extensions/spfxExtension/loc/en-us.js +5 -0
- package/src/extensions/spfxExtension/loc/myStrings.d.ts +8 -0
- package/src/index.ts +1 -0
- package/src/services/initCoreService.ts +46 -0
- package/src/utilities/constants.ts +4 -0
- package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json +35 -0
- package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.module.scss +185 -0
- package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.module.scss.ts +24 -0
- package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.ts +573 -0
- package/src/webparts/spfxExtensionloader/assets/welcome-dark.png +0 -0
- package/src/webparts/spfxExtensionloader/assets/welcome-light.png +0 -0
- package/src/webparts/spfxExtensionloader/loc/en-us.js +16 -0
- package/src/webparts/spfxExtensionloader/loc/mystrings.d.ts +19 -0
- package/teams/3be36e80-4431-4b52-99c5-0a339b4e696e_color.png +0 -0
- package/teams/3be36e80-4431-4b52-99c5-0a339b4e696e_outline.png +0 -0
- package/tsconfig.json +25 -0
package/gulpfile.js
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const build = require("@microsoft/sp-build-web");
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const isProd = process.argv.indexOf("--ship") > -1;
|
|
7
|
+
const changeNameArg = "--change-name";
|
|
8
|
+
const argvJoined = process.argv.join(" ");
|
|
9
|
+
const changeNameArgIndex = argvJoined.indexOf(changeNameArg);
|
|
10
|
+
const shouldChangeName = changeNameArgIndex > -1;
|
|
11
|
+
const newNameStart = changeNameArgIndex + changeNameArg.length + 1;
|
|
12
|
+
const hasMoreArgsAfterName =
|
|
13
|
+
argvJoined.substring(newNameStart).indexOf("--") > -1;
|
|
14
|
+
let newName = "";
|
|
15
|
+
if (shouldChangeName) {
|
|
16
|
+
if (hasMoreArgsAfterName > -1) {
|
|
17
|
+
newName = argvJoined.substring(
|
|
18
|
+
newNameStart,
|
|
19
|
+
argvJoined.length - hasMoreArgsAfterName - changeNameArg.length - 1
|
|
20
|
+
);
|
|
21
|
+
} else {
|
|
22
|
+
newName = argvJoined.substring(newNameStart);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
build.addSuppression(
|
|
27
|
+
`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const projectSolutionPackage = fs.readFileSync(
|
|
31
|
+
"./config/package-solution.json",
|
|
32
|
+
{ encoding: "utf8" }
|
|
33
|
+
);
|
|
34
|
+
const projectPackage = fs.readFileSync("./package.json", { encoding: "utf8" });
|
|
35
|
+
const projectPackageJson = JSON.parse(projectPackage);
|
|
36
|
+
const projectSolutionPackageJson = JSON.parse(projectSolutionPackage);
|
|
37
|
+
const projectVersion = `${projectPackageJson.version}.0`;
|
|
38
|
+
console.log("Project Version:", projectVersion);
|
|
39
|
+
projectSolutionPackageJson.solution.version = projectVersion;
|
|
40
|
+
projectSolutionPackageJson.solution.features[0].version = projectVersion;
|
|
41
|
+
|
|
42
|
+
fs.writeFileSync(
|
|
43
|
+
"./config/package-solution.json",
|
|
44
|
+
JSON.stringify(projectSolutionPackageJson, null, 2)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (newName) {
|
|
48
|
+
const jsonPath =
|
|
49
|
+
"./src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json";
|
|
50
|
+
const webpartData = fs.readFileSync(jsonPath, { encoding: "utf8" });
|
|
51
|
+
const webpartDataJson = JSON.parse(webpartData);
|
|
52
|
+
const oldName = webpartDataJson.preconfiguredEntries[0].title.default;
|
|
53
|
+
console.log("Old Webpart Name:", oldName);
|
|
54
|
+
console.log("New Webpart Name:", newName);
|
|
55
|
+
webpartDataJson.preconfiguredEntries[0].title.default = newName;
|
|
56
|
+
fs.writeFileSync(
|
|
57
|
+
jsonPath,
|
|
58
|
+
JSON.stringify(webpartDataJson, null, 2)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// build.addSuppression(
|
|
63
|
+
// `Warning - [webpack] No webpack config has been provided. Create a webpack.config.js file or call webpack.setConfig({ configPath: null }) in your gulpfile.`
|
|
64
|
+
// );
|
|
65
|
+
// build.webpack.setConfig({
|
|
66
|
+
// configPath: "./webpack.config.js"
|
|
67
|
+
// })
|
|
68
|
+
|
|
69
|
+
build.tscCmd.executeTask = function () {
|
|
70
|
+
console.log("Overriding tscCmd.executeTask");
|
|
71
|
+
spawnSync("npx", ["tsc", "--build", "--verbose"], {
|
|
72
|
+
shell: true,
|
|
73
|
+
stdio: "inherit",
|
|
74
|
+
cwd: path.resolve(__dirname),
|
|
75
|
+
});
|
|
76
|
+
return Promise.resolve();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
build.configureWebpack.mergeConfig({
|
|
80
|
+
//https://github.com/SharePoint/sp-dev-docs/issues/10205
|
|
81
|
+
// generateCssClassName: (name) => {
|
|
82
|
+
// return name;
|
|
83
|
+
// },
|
|
84
|
+
additionalConfiguration: (generatedConfiguration) => {
|
|
85
|
+
// generatedConfiguration.optimization.usedExports = true;
|
|
86
|
+
//generatedConfiguration.resolve.extensions.push(".ts");
|
|
87
|
+
generatedConfiguration.output.chunkFilename = "[name]_[contenthash].js";
|
|
88
|
+
generatedConfiguration.output.environment = {
|
|
89
|
+
arrowFunction: true,
|
|
90
|
+
const: true,
|
|
91
|
+
optionalChaining: true,
|
|
92
|
+
module: true,
|
|
93
|
+
templateLiteral: true,
|
|
94
|
+
destructuring: true,
|
|
95
|
+
dynamicImport: true,
|
|
96
|
+
globalThis: true,
|
|
97
|
+
forOf: true,
|
|
98
|
+
};
|
|
99
|
+
generatedConfiguration.optimization.splitChunks = {
|
|
100
|
+
cacheGroups: {
|
|
101
|
+
defaultVendors: false,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
// const sourceMapLoaderIndex = generatedConfiguration.module.rules.findIndex(
|
|
105
|
+
// (l) => l.use && l.use?.loader?.indexOf("source-map-loader") > -1
|
|
106
|
+
// );
|
|
107
|
+
// if (sourceMapLoaderIndex > -1) {
|
|
108
|
+
// generatedConfiguration.module.rules.splice(sourceMapLoaderIndex, 1);
|
|
109
|
+
// generatedConfiguration.module.rules.push({
|
|
110
|
+
// test: /\.js$/,
|
|
111
|
+
// enforce: "pre",
|
|
112
|
+
// use: [
|
|
113
|
+
// {
|
|
114
|
+
// loader: "source-map-loader",
|
|
115
|
+
// options: {
|
|
116
|
+
// filterSourceMappingUrl: (url, resourcePath) => {
|
|
117
|
+
// const includeSourceMap =
|
|
118
|
+
// resourcePath.indexOf("node_modules") === -1 ||
|
|
119
|
+
// url.indexOf("__spfxCore.js") > -1 ||
|
|
120
|
+
// url.indexOf("@spfx-extensions/core") > -1 ||
|
|
121
|
+
// resourcePath.indexOf("@spfx-extensions/core") > -1;
|
|
122
|
+
// return includeSourceMap;
|
|
123
|
+
// },
|
|
124
|
+
// },
|
|
125
|
+
// },
|
|
126
|
+
// ],
|
|
127
|
+
// });
|
|
128
|
+
// }
|
|
129
|
+
|
|
130
|
+
generatedConfiguration.module.rules.push({
|
|
131
|
+
test: /__spfxCore\.js$/,
|
|
132
|
+
generator: {
|
|
133
|
+
filename: "spfx-extension-core[ext]?v=[hash]",
|
|
134
|
+
},
|
|
135
|
+
type: "asset/resource",
|
|
136
|
+
});
|
|
137
|
+
generatedConfiguration.module.rules.push({
|
|
138
|
+
test: /__spfxCoreConfigurator\.js$/,
|
|
139
|
+
generator: {
|
|
140
|
+
filename: "spfx-extension-coreconfigurator[ext]?v=[hash]",
|
|
141
|
+
},
|
|
142
|
+
type: "asset/resource",
|
|
143
|
+
});
|
|
144
|
+
generatedConfiguration.module.rules.push({
|
|
145
|
+
test: /__spfxWrapperClassic\.js$/,
|
|
146
|
+
generator: {
|
|
147
|
+
filename: "spfx-extension-wrapper[ext]?v=[hash]",
|
|
148
|
+
},
|
|
149
|
+
type: "asset/resource",
|
|
150
|
+
});
|
|
151
|
+
// generatedConfiguration.module.rules.push({
|
|
152
|
+
// test: /__spfxCore\.js\.map$/,
|
|
153
|
+
// generator: {
|
|
154
|
+
// filename: "spfx-extension-core.js[ext]?[hash]",
|
|
155
|
+
// },
|
|
156
|
+
// type: "asset/resource",
|
|
157
|
+
// });
|
|
158
|
+
generatedConfiguration.resolve.alias["__spfxCore.js"] =
|
|
159
|
+
"@spfx-extensions/core/spfxCoreEntry";
|
|
160
|
+
generatedConfiguration.resolve.alias["__spfxCoreConfigurator.js"] =
|
|
161
|
+
"@spfx-extensions/core/configurator";
|
|
162
|
+
generatedConfiguration.resolve.alias["__spfxWrapperClassic.js"] =
|
|
163
|
+
"@spfx-extensions/core/classicWrapper";
|
|
164
|
+
// generatedConfiguration.resolve.alias["__spfxCore.js.map"] =
|
|
165
|
+
// "@spfx-extensions/core/spfxCoreEntryMap";
|
|
166
|
+
// generatedConfiguration.resolve.alias.push({
|
|
167
|
+
|
|
168
|
+
// })
|
|
169
|
+
// generatedConfiguration.experiments = {
|
|
170
|
+
// outputModule: true,
|
|
171
|
+
// };
|
|
172
|
+
// generatedConfiguration.output.libraryTarget = "commonjs-module";
|
|
173
|
+
// generatedConfiguration.output.library = {
|
|
174
|
+
// type: "commonjs-module",
|
|
175
|
+
// };
|
|
176
|
+
const definePlugin = generatedConfiguration.plugins.find(
|
|
177
|
+
(p) => p.definitions
|
|
178
|
+
);
|
|
179
|
+
if (definePlugin) {
|
|
180
|
+
const date = new Date().toISOString();
|
|
181
|
+
console.log("Adding BUILD_DATE to define plugin:", date);
|
|
182
|
+
definePlugin.definitions["BUILD_DATE"] = JSON.stringify(date);
|
|
183
|
+
definePlugin.definitions["ISDEBUG"] = JSON.stringify(
|
|
184
|
+
isProd ? false : true
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
console.error("No define plugin found in webpack configuration.");
|
|
188
|
+
}
|
|
189
|
+
return generatedConfiguration;
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
var getTasks = build.rig.getTasks;
|
|
194
|
+
build.rig.getTasks = function () {
|
|
195
|
+
var result = getTasks.call(build.rig);
|
|
196
|
+
|
|
197
|
+
result.set("serve", result.get("serve-deprecated"));
|
|
198
|
+
|
|
199
|
+
return result;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
build.initialize(require("gulp"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spfx-extensions/package",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.14",
|
|
4
4
|
"author": "SPWizard01",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,17 @@
|
|
|
21
21
|
"test": "gulp test"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"config",
|
|
26
|
+
"sharepoint",
|
|
27
|
+
"src",
|
|
28
|
+
"teams",
|
|
29
|
+
".npmignore",
|
|
30
|
+
".nvmrc",
|
|
31
|
+
"gulpfile.js",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"README.md",
|
|
34
|
+
"tsconfig.json"
|
|
25
35
|
],
|
|
26
36
|
"dependencies": {
|
|
27
37
|
"@microsoft/decorators": "^1.21.1",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
|
|
3
|
+
<ClientSideComponentInstance
|
|
4
|
+
Title="SpFxExtensionsCustomizer"
|
|
5
|
+
Location="ClientSideExtension.ApplicationCustomizer"
|
|
6
|
+
ComponentId="8d1029da-85e6-48cc-aaaf-37a5bbc0b9be"
|
|
7
|
+
Properties="">
|
|
8
|
+
</ClientSideComponentInstance>
|
|
9
|
+
</Elements>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
|
|
3
|
+
<CustomAction
|
|
4
|
+
Title="SpFxExtensionsCustomizer"
|
|
5
|
+
Location="ClientSideExtension.ApplicationCustomizer"
|
|
6
|
+
ClientSideComponentId="8d1029da-85e6-48cc-aaaf-37a5bbc0b9be"
|
|
7
|
+
ClientSideComponentProperties="">
|
|
8
|
+
</CustomAction>
|
|
9
|
+
</Elements>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const BUILD_DATE: string;
|
|
2
|
+
declare const ISDEBUG: boolean;
|
|
3
|
+
declare module "__spfxCore.js" {
|
|
4
|
+
const content: string;
|
|
5
|
+
export default content;
|
|
6
|
+
}
|
|
7
|
+
declare module "__spfxCoreConfigurator.js" {
|
|
8
|
+
const content: string;
|
|
9
|
+
export default content;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module "__spfxWrapperClassic.js" {
|
|
13
|
+
const content: string;
|
|
14
|
+
export default content;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json",
|
|
3
|
+
|
|
4
|
+
"id": "8d1029da-85e6-48cc-aaaf-37a5bbc0b9be",
|
|
5
|
+
"alias": "SpfxExtensionApplicationCustomizer",
|
|
6
|
+
"componentType": "Extension",
|
|
7
|
+
"extensionType": "ApplicationCustomizer",
|
|
8
|
+
|
|
9
|
+
// The "*" signifies that the version should be taken from the package.json
|
|
10
|
+
"version": "*",
|
|
11
|
+
"manifestVersion": 2,
|
|
12
|
+
|
|
13
|
+
// If true, the component can only be installed on sites where Custom Script is allowed.
|
|
14
|
+
// Components that allow authors to embed arbitrary script code should set this to true.
|
|
15
|
+
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
|
|
16
|
+
"requiresCustomScript": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseApplicationCustomizer,
|
|
3
|
+
PlaceholderProvider
|
|
4
|
+
} from '@microsoft/sp-application-base';
|
|
5
|
+
//import * as strings from 'SpfxExtensionApplicationCustomizerStrings';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* If your command set uses the ClientSideComponentProperties JSON input,
|
|
9
|
+
* it will be deserialized into the BaseExtension.properties object.
|
|
10
|
+
* You can define an interface to describe it.
|
|
11
|
+
*/
|
|
12
|
+
export interface ISpfxExtensionApplicationCustomizerProperties {
|
|
13
|
+
// This is an example; replace with your own property
|
|
14
|
+
_noProps: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A Custom Action which can be run during execution of a Client Side Application */
|
|
18
|
+
export default class SpfxExtensionApplicationCustomizer
|
|
19
|
+
extends BaseApplicationCustomizer<ISpfxExtensionApplicationCustomizerProperties> {
|
|
20
|
+
|
|
21
|
+
public async onInit(): Promise<void> {
|
|
22
|
+
const { initCore } = await import(/* webpackChunkName: "spfx-extension-loader" */"../../services/initCoreService");
|
|
23
|
+
//init core then do stuff
|
|
24
|
+
await initCore(
|
|
25
|
+
"SharePoint",
|
|
26
|
+
this.context.placeholderProvider,
|
|
27
|
+
this
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
protected async onPlaceholdersChanged(placeholderProvider: PlaceholderProvider) {
|
|
31
|
+
const { initCore } = await import(/* webpackChunkName: "spfx-extension-loader" */"../../services/initCoreService");
|
|
32
|
+
// this fires before onInit
|
|
33
|
+
await initCore(
|
|
34
|
+
"SharePoint",
|
|
35
|
+
this.context.placeholderProvider,
|
|
36
|
+
this
|
|
37
|
+
);
|
|
38
|
+
window.__SPFxExtensions.Apps.forEach((app) => {
|
|
39
|
+
app.instances.forEach((instance) => {
|
|
40
|
+
instance.executeListeners("onPlaceholdersChanged", placeholderProvider)
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
protected onDispose(): void {
|
|
46
|
+
window.__SPFxExtensions?.Apps?.forEach((app) => {
|
|
47
|
+
app.instances.forEach((instance) => {
|
|
48
|
+
instance.executeListeners("onAppCustomizerDisposed", undefined);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// A file is required to be in the root of the /src directory by the TypeScript compiler
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CompatibleEnvironmentType,
|
|
3
|
+
} from "@spfx-extensions/core";
|
|
4
|
+
import { PlaceholderProvider } from "@microsoft/sp-application-base";
|
|
5
|
+
import { ISPEventObserver } from "@microsoft/sp-core-library";
|
|
6
|
+
import { SPFXPREFIX } from "../utilities/constants";
|
|
7
|
+
import { loadCoreForSPFxOrClassic } from "@spfx-extensions/core/spfxLoader"
|
|
8
|
+
import coreUrl from "__spfxCore.js";
|
|
9
|
+
import configuratorUrl from "__spfxCoreConfigurator.js";
|
|
10
|
+
import wrapperUrl from "__spfxWrapperClassic.js";
|
|
11
|
+
|
|
12
|
+
let placeHolderResolved = false;
|
|
13
|
+
let corePromise: Promise<void> | undefined = undefined;
|
|
14
|
+
|
|
15
|
+
async function getSuggestedCoreUrl() {
|
|
16
|
+
return Promise.resolve({ coreUrl, configuratorUrl, wrapperUrl });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function initCore(
|
|
20
|
+
envType: CompatibleEnvironmentType,
|
|
21
|
+
placeHolderProvider?: PlaceholderProvider,
|
|
22
|
+
eventObserver?: ISPEventObserver
|
|
23
|
+
) {
|
|
24
|
+
if (!corePromise) {
|
|
25
|
+
const buildDate = BUILD_DATE;
|
|
26
|
+
console.info(SPFXPREFIX, "Initializing Core from SPFx Built:", buildDate);
|
|
27
|
+
corePromise = loadCoreForSPFxOrClassic(getSuggestedCoreUrl, envType, true);
|
|
28
|
+
}
|
|
29
|
+
await corePromise;
|
|
30
|
+
|
|
31
|
+
//only repopulate if these were not initialized through modern context
|
|
32
|
+
if (window.__SPFxExtensions.Utils && !window.__SPFxExtensions.Utils.initializedThroughSPFX) {
|
|
33
|
+
window.__SPFxExtensions.Utils.environmentType = envType;
|
|
34
|
+
window.__SPFxExtensions.Utils.initializedThroughSPFX = true;
|
|
35
|
+
}
|
|
36
|
+
//resolve once, i.e. modern webpart was loaded before app customizer
|
|
37
|
+
if (!placeHolderResolved && placeHolderProvider && eventObserver) {
|
|
38
|
+
placeHolderResolved = true;
|
|
39
|
+
window.__SPFxExtensions.Utils.placeHolderResolver({
|
|
40
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
placeHolderProvider: placeHolderProvider as any,
|
|
42
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
eventObserver: eventObserver as any,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const SELECT_WEBPART = "Select one of these web parts for this column.";
|
|
2
|
+
export const EDIT_PAGE_AND_SELECT_WEBPART = "Edit page and select webpart.";
|
|
3
|
+
export const APP_BUTTON_LABEL = "Webpart that loads an app of your choice.";
|
|
4
|
+
export const SPFXPREFIX = "[SPFxExtensions]";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
|
|
3
|
+
"id": "d6ca1fc2-0591-4c6d-8a25-cae3262c017b",
|
|
4
|
+
"alias": "SpfxExtensionloaderWebPart",
|
|
5
|
+
"componentType": "WebPart",
|
|
6
|
+
"version": "*",
|
|
7
|
+
"manifestVersion": 2,
|
|
8
|
+
"requiresCustomScript": false,
|
|
9
|
+
"supportedHosts": [
|
|
10
|
+
"SharePointWebPart",
|
|
11
|
+
"TeamsPersonalApp",
|
|
12
|
+
"TeamsTab",
|
|
13
|
+
"SharePointFullPage"
|
|
14
|
+
],
|
|
15
|
+
"supportsThemeVariants": true,
|
|
16
|
+
"supportsFullBleed": true,
|
|
17
|
+
"preconfiguredEntries": [
|
|
18
|
+
{
|
|
19
|
+
"groupId": "5c03119e-3074-46fd-976b-c60198311f70",
|
|
20
|
+
"group": {
|
|
21
|
+
"default": "Advanced"
|
|
22
|
+
},
|
|
23
|
+
"title": {
|
|
24
|
+
"default": "SPFx Extension Loader"
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"default": "Allows you to add a custom developed app"
|
|
28
|
+
},
|
|
29
|
+
"officeFabricIconFontName": "Page",
|
|
30
|
+
"properties": {
|
|
31
|
+
"description": "Select an app to load from the dropdown below"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
|
|
2
|
+
|
|
3
|
+
.spfxExtensionloader {
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
padding: 1em;
|
|
6
|
+
color: "[theme:bodyText, default: #323130]";
|
|
7
|
+
color: var(--bodyText);
|
|
8
|
+
&.teams {
|
|
9
|
+
font-family: $ms-font-family-fallbacks;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.welcome {
|
|
14
|
+
text-align: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.welcomeImage {
|
|
18
|
+
width: 100%;
|
|
19
|
+
max-width: 420px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.links {
|
|
23
|
+
a {
|
|
24
|
+
text-decoration: none;
|
|
25
|
+
color: "[theme:link, default:#03787c]";
|
|
26
|
+
color: var(--link); // note: CSS Custom Properties support is limited to modern browsers only
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
text-decoration: underline;
|
|
30
|
+
color: "[theme:linkHovered, default: #014446]";
|
|
31
|
+
color: var(--linkHovered); // note: CSS Custom Properties support is limited to modern browsers only
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.SPFxExtensionApp {
|
|
37
|
+
.loader {
|
|
38
|
+
width: 28px;
|
|
39
|
+
height: 28px;
|
|
40
|
+
border: 2px solid #003755;
|
|
41
|
+
border-bottom-color: #009fda;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
animation: rotation 1s linear infinite;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes rotation {
|
|
49
|
+
0% {
|
|
50
|
+
transform: rotate(0deg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
100% {
|
|
54
|
+
transform: rotate(360deg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.buttonLoader {
|
|
59
|
+
height: 80px;
|
|
60
|
+
width: 120px;
|
|
61
|
+
border: none;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.shimmerShine {
|
|
68
|
+
height: 80px;
|
|
69
|
+
width: 120px;
|
|
70
|
+
border: none;
|
|
71
|
+
background: #f6f7f8;
|
|
72
|
+
background-image: linear-gradient(
|
|
73
|
+
to right,
|
|
74
|
+
#f6f7f8 0%,
|
|
75
|
+
#edeef1 20%,
|
|
76
|
+
#f6f7f8 40%,
|
|
77
|
+
#f6f7f8 100%
|
|
78
|
+
);
|
|
79
|
+
background-repeat: no-repeat;
|
|
80
|
+
background-size: 200px 80px;
|
|
81
|
+
display: block;
|
|
82
|
+
position: relative;
|
|
83
|
+
|
|
84
|
+
-webkit-animation-duration: 1s;
|
|
85
|
+
-webkit-animation-fill-mode: forwards;
|
|
86
|
+
-webkit-animation-iteration-count: infinite;
|
|
87
|
+
-webkit-animation-name: placeholderShimmer;
|
|
88
|
+
-webkit-animation-timing-function: linear;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@-webkit-keyframes placeholderShimmer {
|
|
92
|
+
0% {
|
|
93
|
+
background-position: -80px 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
100% {
|
|
97
|
+
background-position: 120px 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes placeholderShimmer {
|
|
102
|
+
0% {
|
|
103
|
+
background-position: -80px 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
100% {
|
|
107
|
+
background-position: 120px 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
.applicationListSection {
|
|
111
|
+
text-align: center;
|
|
112
|
+
min-height: 320px;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
display: -ms-flexbox;
|
|
115
|
+
display: flex;
|
|
116
|
+
-ms-flex-direction: column;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.header {
|
|
122
|
+
color: #242424;
|
|
123
|
+
font-weight: 600;
|
|
124
|
+
letter-spacing: 1px;
|
|
125
|
+
line-height: 32px;
|
|
126
|
+
padding: 0 12px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.icon {
|
|
130
|
+
font-size: 28px;
|
|
131
|
+
height: 28px;
|
|
132
|
+
line-height: 28px;
|
|
133
|
+
min-width: 28px;
|
|
134
|
+
width: 28px;
|
|
135
|
+
font-style: normal;
|
|
136
|
+
> svg {
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: auto;
|
|
139
|
+
}
|
|
140
|
+
> img {
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: auto;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.iconFont {
|
|
147
|
+
background-color: #f6f7f8;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.appButtonsContainer {
|
|
151
|
+
display: flex;
|
|
152
|
+
height: 100%;
|
|
153
|
+
flex-wrap: wrap;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
align-items: center;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.appButtonsWrapper {
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 100%;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
display: -ms-flexbox;
|
|
163
|
+
display: flex;
|
|
164
|
+
-ms-flex-direction: column;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
-ms-flex-pack: start;
|
|
167
|
+
justify-content: flex-start;
|
|
168
|
+
-ms-flex-align: center;
|
|
169
|
+
align-items: center;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.appButton {
|
|
173
|
+
height: 80px;
|
|
174
|
+
width: 120px;
|
|
175
|
+
border: none;
|
|
176
|
+
background-color: unset;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
align-items: center;
|
|
180
|
+
padding-top: 14px;
|
|
181
|
+
&:hover {
|
|
182
|
+
background-color: #c8e3fa;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
require("./SpfxExtensionloaderWebPart.module.css");
|
|
3
|
+
const styles = {
|
|
4
|
+
spfxExtensionloader: 'spfxExtensionloader_be4e0fd1',
|
|
5
|
+
teams: 'teams_be4e0fd1',
|
|
6
|
+
welcome: 'welcome_be4e0fd1',
|
|
7
|
+
welcomeImage: 'welcomeImage_be4e0fd1',
|
|
8
|
+
links: 'links_be4e0fd1',
|
|
9
|
+
SPFxExtensionApp: 'SPFxExtensionApp_be4e0fd1',
|
|
10
|
+
loader: 'loader_be4e0fd1',
|
|
11
|
+
rotation: 'rotation_be4e0fd1',
|
|
12
|
+
buttonLoader: 'buttonLoader_be4e0fd1',
|
|
13
|
+
shimmerShine: 'shimmerShine_be4e0fd1',
|
|
14
|
+
placeholderShimmer: 'placeholderShimmer_be4e0fd1',
|
|
15
|
+
applicationListSection: 'applicationListSection_be4e0fd1',
|
|
16
|
+
header: 'header_be4e0fd1',
|
|
17
|
+
icon: 'icon_be4e0fd1',
|
|
18
|
+
iconFont: 'iconFont_be4e0fd1',
|
|
19
|
+
appButtonsContainer: 'appButtonsContainer_be4e0fd1',
|
|
20
|
+
appButtonsWrapper: 'appButtonsWrapper_be4e0fd1',
|
|
21
|
+
appButton: 'appButton_be4e0fd1'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default styles;
|