@microsoft/generator-sharepoint 1.13.1 → 1.14.0

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.
Files changed (94) hide show
  1. package/lib/common/BaseGenerator.d.ts +2 -2
  2. package/lib/common/BaseGenerator.d.ts.map +1 -1
  3. package/lib/common/PackageSolutionJsonManager.d.ts +6 -0
  4. package/lib/common/PackageSolutionJsonManager.d.ts.map +1 -1
  5. package/lib/common/PackageSolutionJsonManager.js +57 -16
  6. package/lib/common/dependency/adaptiveCardExtension/firstParty.json +6 -6
  7. package/lib/common/dependency/adaptiveCardExtension/firstPartyPlusBeta.json +6 -6
  8. package/lib/common/dependency/applicationCustomizer.json +2 -2
  9. package/lib/common/dependency/applicationCustomizerPlusBeta.json +2 -2
  10. package/lib/common/dependency/commandSet.json +2 -2
  11. package/lib/common/dependency/commandSetPlusBeta.json +2 -2
  12. package/lib/common/dependency/extension/firstParty.json +5 -5
  13. package/lib/common/dependency/extension/firstPartyPlusBeta.json +5 -5
  14. package/lib/common/dependency/fieldCustomizer.json +1 -1
  15. package/lib/common/dependency/fieldCustomizerPlusBeta.json +1 -1
  16. package/lib/common/dependency/library/firstParty.json +3 -3
  17. package/lib/common/dependency/library/firstPartyPlusBeta.json +3 -3
  18. package/lib/common/dependency/searchQueryModifier.json +1 -1
  19. package/lib/common/dependency/searchQueryModifierPlusBeta.json +1 -1
  20. package/lib/common/dependency/webpart/firstParty.json +8 -8
  21. package/lib/common/dependency/webpart/firstPartyPlusBeta.json +8 -8
  22. package/lib/generators/adaptiveCardExtension/index.d.ts +2 -2
  23. package/lib/generators/adaptiveCardExtension/index.d.ts.map +1 -1
  24. package/lib/generators/adaptiveCardExtension/index.js +4 -1
  25. package/lib/generators/adaptiveCardExtension/templates/base/loc/en-us.js +5 -8
  26. package/lib/generators/adaptiveCardExtension/templates/base/loc/mystring.d.ts +1 -4
  27. package/lib/generators/adaptiveCardExtension/templates/basicCardView/CardView.ts +2 -1
  28. package/lib/generators/adaptiveCardExtension/templates/imageCardView/CardView.ts +2 -1
  29. package/lib/generators/adaptiveCardExtension/templates/manifestTemplate/baseTemplate/{componentClassName}.manifest.json +1 -3
  30. package/lib/generators/adaptiveCardExtension/templates/none/quickView/QuickView.ts +0 -2
  31. package/lib/generators/adaptiveCardExtension/templates/none/quickView/template/QuickViewTemplate.json +0 -5
  32. package/lib/generators/adaptiveCardExtension/templates/none/{componentClassName}.ts +1 -14
  33. package/lib/generators/adaptiveCardExtension/templates/none/{componentName}PropertyPane.ts +0 -8
  34. package/lib/generators/adaptiveCardExtension/templates/primaryTextCardView/CardView.ts +2 -1
  35. package/lib/generators/app/index.js +22 -5
  36. package/lib/generators/applicationCustomizer/index.d.ts +2 -2
  37. package/lib/generators/applicationCustomizer/index.d.ts.map +1 -1
  38. package/lib/generators/applicationCustomizer/index.js +1 -1
  39. package/lib/generators/applicationCustomizer/templates/none/{componentClassName}.ts +0 -2
  40. package/lib/generators/commandSet/index.d.ts +2 -2
  41. package/lib/generators/commandSet/index.d.ts.map +1 -1
  42. package/lib/generators/commandSet/index.js +1 -1
  43. package/lib/generators/commandSet/templates/none/{componentClassName}.ts +0 -4
  44. package/lib/generators/component/BaseComponentGenerator.d.ts +8 -4
  45. package/lib/generators/component/BaseComponentGenerator.d.ts.map +1 -1
  46. package/lib/generators/component/BaseComponentGenerator.js +22 -22
  47. package/lib/generators/component/index.d.ts.map +1 -1
  48. package/lib/generators/extension/BaseExtensionGenerator.d.ts +2 -1
  49. package/lib/generators/extension/BaseExtensionGenerator.d.ts.map +1 -1
  50. package/lib/generators/extension/BaseExtensionGenerator.js +25 -0
  51. package/lib/generators/fieldCustomizer/index.d.ts +2 -2
  52. package/lib/generators/fieldCustomizer/index.d.ts.map +1 -1
  53. package/lib/generators/fieldCustomizer/index.js +12 -2
  54. package/lib/generators/fieldCustomizer/templates/{base/loc → loc}/en-us.js +0 -0
  55. package/lib/generators/fieldCustomizer/templates/{base/loc → loc}/myStrings.d.ts +0 -0
  56. package/lib/generators/fieldCustomizer/templates/minimal/loc/en-us.js +4 -0
  57. package/lib/generators/fieldCustomizer/templates/minimal/loc/myStrings.d.ts +7 -0
  58. package/lib/generators/fieldCustomizer/templates/minimal/{componentClassName}.module.scss +3 -0
  59. package/lib/generators/fieldCustomizer/templates/minimal/{componentClassName}.ts +29 -0
  60. package/lib/generators/fieldCustomizer/templates/none/{componentClassName}.ts +0 -4
  61. package/lib/generators/fieldCustomizer/templates/react/components/{componentName}.tsx +0 -4
  62. package/lib/generators/fieldCustomizer/templates/react/{componentClassName}.ts +0 -4
  63. package/lib/generators/library/index.d.ts +2 -2
  64. package/lib/generators/library/index.d.ts.map +1 -1
  65. package/lib/generators/library/index.js +1 -1
  66. package/lib/generators/searchQueryModifier/index.d.ts +2 -2
  67. package/lib/generators/searchQueryModifier/index.d.ts.map +1 -1
  68. package/lib/generators/searchQueryModifier/index.js +1 -1
  69. package/lib/generators/searchQueryModifier/templates/none/{componentClassName}.ts +0 -3
  70. package/lib/generators/solution/index.d.ts +1 -0
  71. package/lib/generators/solution/index.d.ts.map +1 -1
  72. package/lib/generators/solution/index.js +18 -58
  73. package/lib/generators/solution/templates/base/.vscode/launch.json +1 -5
  74. package/lib/generators/webpart/index.d.ts +2 -2
  75. package/lib/generators/webpart/index.d.ts.map +1 -1
  76. package/lib/generators/webpart/index.js +13 -5
  77. package/lib/generators/webpart/templates/assets/welcome-dark.png +0 -0
  78. package/lib/generators/webpart/templates/assets/welcome-light.png +0 -0
  79. package/lib/generators/webpart/templates/loc/en-us.js +11 -0
  80. package/lib/generators/webpart/templates/{base/loc → loc}/mystrings.d.ts +4 -0
  81. package/lib/generators/webpart/templates/minimal/loc/en-us.js +4 -0
  82. package/lib/generators/webpart/templates/minimal/loc/mystrings.d.ts +7 -0
  83. package/lib/generators/webpart/templates/minimal/{componentClassName}.module.scss +3 -0
  84. package/lib/generators/webpart/templates/minimal/{componentClassName}.ts +22 -0
  85. package/lib/generators/webpart/templates/none/{componentClassName}.module.scss +22 -62
  86. package/lib/generators/webpart/templates/none/{componentClassName}.ts +57 -14
  87. package/lib/generators/webpart/templates/react/components/I{componentName}Props.ts +4 -0
  88. package/lib/generators/webpart/templates/react/components/{componentName}.module.scss +23 -63
  89. package/lib/generators/webpart/templates/react/components/{componentName}.tsx +31 -13
  90. package/lib/generators/webpart/templates/react/{componentClassName}.ts +38 -1
  91. package/package.json +3 -3
  92. package/lib/generators/solution/templates/base/.vscode/extensions.json +0 -5
  93. package/lib/generators/webpart/templates/base/loc/en-us.js +0 -7
  94. package/lib/generators/webpart/templates/officeAddin/initial.outlookManifest.xml +0 -91
@@ -5,21 +5,39 @@ import { escape } from '@microsoft/sp-lodash-subset';
5
5
 
6
6
  export default class <%= componentName %> extends React.Component<I<%= componentName %>Props, {}> {
7
7
  public render(): React.ReactElement<I<%= componentName %>Props> {
8
+ const {
9
+ description,
10
+ isDarkTheme,
11
+ environmentMessage,
12
+ hasTeamsContext,
13
+ userDisplayName
14
+ } = this.props;
15
+
8
16
  return (
9
- <div className={ styles.<%= componentNameCamelCase %> }>
10
- <div className={ styles.container }>
11
- <div className={ styles.row }>
12
- <div className={ styles.column }>
13
- <span className={ styles.title }>Welcome to SharePoint!</span>
14
- <p className={ styles.subTitle }>Customize SharePoint experiences using Web Parts.</p>
15
- <p className={ styles.description }>{escape(this.props.description)}</p>
16
- <a href="https://aka.ms/spfx" className={ styles.button }>
17
- <span className={ styles.label }>Learn more</span>
18
- </a>
19
- </div>
20
- </div>
17
+ <section className={`${styles.<%= componentNameCamelCase %>} ${hasTeamsContext ? styles.teams : ''}`}>
18
+ <div className={styles.welcome}>
19
+ <img alt="" src={isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png')} className={styles.welcomeImage} />
20
+ <h2>Well done, {escape(userDisplayName)}!</h2>
21
+ <div>{environmentMessage}</div>
22
+ <div>Web part property value: <strong>{escape(description)}</strong></div>
23
+ </div>
24
+ <div>
25
+ <h3>Welcome to SharePoint Framework!</h3>
26
+ <p>
27
+ The SharePoint Framework (SPFx) is a extensibility model for Microsoft Viva, Microsoft Teams and SharePoint. It's the easiest way to extend Microsoft 365 with automatic Single Sign On, automatic hosting and industry standard tooling.
28
+ </p>
29
+ <h4>Learn more about SPFx development:</h4>
30
+ <ul className={styles.links}>
31
+ <li><a href="https://aka.ms/spfx" target="_blank">SharePoint Framework Overview</a></li>
32
+ <li><a href="https://aka.ms/spfx-yeoman-graph" target="_blank">Use Microsoft Graph in your solution</a></li>
33
+ <li><a href="https://aka.ms/spfx-yeoman-teams" target="_blank">Build for Microsoft Teams using SharePoint Framework</a></li>
34
+ <li><a href="https://aka.ms/spfx-yeoman-viva" target="_blank">Build for Microsoft Viva Connections using SharePoint Framework</a></li>
35
+ <li><a href="https://aka.ms/spfx-yeoman-store" target="_blank">Publish SharePoint Framework applications to the marketplace</a></li>
36
+ <li><a href="https://aka.ms/spfx-yeoman-api" target="_blank">SharePoint Framework API reference</a></li>
37
+ <li><a href="https://aka.ms/m365pnp" target="_blank">Microsoft 365 Developer Community</a></li>
38
+ </ul>
21
39
  </div>
22
- </div>
40
+ </section>
23
41
  );
24
42
  }
25
43
  }
@@ -6,6 +6,7 @@ import {
6
6
  PropertyPaneTextField
7
7
  } from '@microsoft/sp-property-pane';
8
8
  import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
9
+ import { IReadonlyTheme } from '@microsoft/sp-component-base';
9
10
 
10
11
  import * as strings from '<%= componentStrings %>';
11
12
  import <%= componentName %> from './components/<%= componentName %>';
@@ -17,17 +18,53 @@ export interface I<%= componentClassName %>Props {
17
18
 
18
19
  export default class <%= componentClassName %> extends BaseClientSideWebPart<I<%= componentClassName %>Props> {
19
20
 
21
+ private _isDarkTheme: boolean = false;
22
+ private _environmentMessage: string = '';
23
+
24
+ protected onInit(): Promise<void> {
25
+ this._environmentMessage = this._getEnvironmentMessage();
26
+
27
+ return super.onInit();
28
+ }
29
+
20
30
  public render(): void {
21
31
  const element: React.ReactElement<I<%= componentName %>Props> = React.createElement(
22
32
  <%= componentName %>,
23
33
  {
24
- description: this.properties.description
34
+ description: this.properties.description,
35
+ isDarkTheme: this._isDarkTheme,
36
+ environmentMessage: this._environmentMessage,
37
+ hasTeamsContext: !!this.context.sdks.microsoftTeams,
38
+ userDisplayName: this.context.pageContext.user.displayName
25
39
  }
26
40
  );
27
41
 
28
42
  ReactDom.render(element, this.domElement);
29
43
  }
30
44
 
45
+ private _getEnvironmentMessage(): string {
46
+ if (!!this.context.sdks.microsoftTeams) { // running in Teams
47
+ return this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentTeams : strings.AppTeamsTabEnvironment;
48
+ }
49
+
50
+ return this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentSharePoint : strings.AppSharePointEnvironment;
51
+ }
52
+
53
+ protected onThemeChanged(currentTheme: IReadonlyTheme | undefined): void {
54
+ if (!currentTheme) {
55
+ return;
56
+ }
57
+
58
+ this._isDarkTheme = !!currentTheme.isInverted;
59
+ const {
60
+ semanticColors
61
+ } = currentTheme;
62
+ this.domElement.style.setProperty('--bodyText', semanticColors.bodyText);
63
+ this.domElement.style.setProperty('--link', semanticColors.link);
64
+ this.domElement.style.setProperty('--linkHovered', semanticColors.linkHovered);
65
+
66
+ }
67
+
31
68
  protected onDispose(): void {
32
69
  ReactDom.unmountComponentAtNode(this.domElement);
33
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/generator-sharepoint",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "description": "Yeoman generator for the SharePoint Framework",
5
5
  "scripts": {},
6
6
  "engines": {
@@ -13,8 +13,8 @@
13
13
  "homepage": "http://aka.ms/spfx",
14
14
  "main": "lib/generators/app/index.js",
15
15
  "dependencies": {
16
- "@microsoft/spfx-heft-plugins": "1.13.1",
17
- "@rushstack/node-core-library": "3.40.0",
16
+ "@microsoft/spfx-heft-plugins": "1.14.0",
17
+ "@rushstack/node-core-library": "3.45.0",
18
18
  "colors": "~1.2.1",
19
19
  "lodash": "4.17.21",
20
20
  "update-notifier": "5.1.0",
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "msjsdiag.debugger-for-chrome"
4
- ]
5
- }
@@ -1,7 +0,0 @@
1
- define([], function() {
2
- return {
3
- "PropertyPaneDescription": "Description",
4
- "BasicGroupName": "Group Name",
5
- "DescriptionFieldLabel": "Description Field"
6
- }
7
- });
@@ -1,91 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
5
- xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
6
- xsi:type="MailApp">
7
- <Id><%= componentId %></Id>
8
- <Version>1.0.0.0</Version>
9
- <ProviderName>SPFx Provider</ProviderName>
10
- <DefaultLocale>en-US</DefaultLocale>
11
- <DisplayName DefaultValue="SPFx template"/>
12
- <Description DefaultValue="A template to get started with a SPFx Outlook addin."/>
13
- <IconUrl DefaultValue="https://cdn.graph.office.net/prod/media/shared/addin-icon.png"/>
14
- <HighResolutionIconUrl DefaultValue="https://cdn.graph.office.net/prod/media/shared/addin-icon.png"/>
15
- <SupportUrl DefaultValue="https://localhost:4321/help"/>
16
- <AppDomains>
17
- <AppDomain>https://login.microsoftonline.com</AppDomain>
18
- <AppDomain>https://login.windows.net</AppDomain>
19
- </AppDomains>
20
- <Hosts>
21
- <Host Name="Mailbox" />
22
- </Hosts>
23
- <Requirements>
24
- <Sets>
25
- <Set Name="Mailbox" MinVersion="1.4" />
26
- <Set Name="SharePointHostedAddin" MinVersion="1.1" />
27
- </Sets>
28
- </Requirements>
29
- <FormSettings>
30
- <Form xsi:type="ItemRead">
31
- <DesktopSettings>
32
- <SourceLocation DefaultValue="https://_SharePointTenantUrl_/_layouts/15/outlookhostedapp.aspx?componentId=<%= componentId %>&amp;isConfigureMode=true"/>
33
- <RequestedHeight>250</RequestedHeight>
34
- </DesktopSettings>
35
- </Form>
36
- </FormSettings>
37
- <Permissions>ReadWriteMailbox</Permissions>
38
- <Rule xsi:type="RuleCollection" Mode="Or">
39
- <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
40
- </Rule>
41
- <DisableEntityHighlighting>false</DisableEntityHighlighting>
42
- <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
43
- <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
44
- <Hosts>
45
- <Host xsi:type="MailHost">
46
- <DesktopFormFactor>
47
- <ExtensionPoint xsi:type="MessageReadCommandSurface">
48
- <OfficeTab id="TabDefault">
49
- <Group id="msgReadGroup">
50
- <Label resid="GroupLabel" />
51
- <Control xsi:type="Button" id="msgReadOpenPaneButton">
52
- <Label resid="TaskpaneButton.Label" />
53
- <Supertip>
54
- <Title resid="TaskpaneButton.Label" />
55
- <Description resid="TaskpaneButton.Tooltip" />
56
- </Supertip>
57
- <Icon>
58
- <bt:Image size="16" resid="Icon.16x16" />
59
- <bt:Image size="32" resid="Icon.32x32" />
60
- <bt:Image size="80" resid="Icon.80x80" />
61
- </Icon>
62
- <Action xsi:type="ShowTaskpane">
63
- <SourceLocation resid="Taskpane.Url" />
64
- </Action>
65
- </Control>
66
- </Group>
67
- </OfficeTab>
68
- </ExtensionPoint>
69
- </DesktopFormFactor>
70
- </Host>
71
- </Hosts>
72
- <Resources>
73
- <bt:Images>
74
- <bt:Image id="Icon.16x16" DefaultValue="https://cdn.graph.office.net/prod/media/shared/addin-icon.png"/>
75
- <bt:Image id="Icon.32x32" DefaultValue="https://cdn.graph.office.net/prod/media/shared/addin-icon.png"/>
76
- <bt:Image id="Icon.80x80" DefaultValue="https://cdn.graph.office.net/prod/media/shared/addin-icon.png"/>
77
- </bt:Images>
78
- <bt:Urls>
79
- <bt:Url id="Taskpane.Url" DefaultValue="https://_SharePointTenantUrl_/_layouts/15/outlookhostedapp.aspx?componentId=<%= componentId %>&amp;isConfigureMode=true" />
80
- </bt:Urls>
81
- <bt:ShortStrings>
82
- <bt:String id="GroupLabel" DefaultValue="Add-in groupLabel"/>
83
- <bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/>
84
- </bt:ShortStrings>
85
- <bt:LongStrings>
86
- <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens taskpane."/>
87
- </bt:LongStrings>
88
- </Resources>
89
- </VersionOverrides>
90
- </VersionOverrides>
91
- </OfficeApp>