upgrade to v1.11.0

This commit is contained in:
Don Kirkham 2020-11-03 15:29:25 -06:00
parent bcff312786
commit 3c77c3a313
10 changed files with 17245 additions and 195 deletions

View File

@ -1,11 +1,12 @@
{ {
"@microsoft/generator-sharepoint": { "@microsoft/generator-sharepoint": {
"isCreatingSolution": true, "isCreatingSolution": true,
"environment": "onprem19", "environment": "onprem19",
"version": "1.10.0", "version": "1.11.0",
"libraryName": "word-game", "libraryName": "word-game",
"libraryId": "751649b4-2c99-4349-9d65-9a6cc7533dfa", "libraryId": "751649b4-2c99-4349-9d65-9a6cc7533dfa",
"packageManager": "npm", "packageManager": "npm",
"componentType": "webpart" "componentType": "webpart",
} "isDomainIsolated": false
}
} }

View File

@ -1,13 +1,21 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": { "solution": {
"name": "word-game-client-side-solution", "name": "word-game-client-side-solution",
"id": "751649b4-2c99-4349-9d65-9a6cc7533dfa", "id": "751649b4-2c99-4349-9d65-9a6cc7533dfa",
"version": "1.0.0.3", "version": "1.0.0.3",
"includeClientSideAssets": true, "includeClientSideAssets": true,
"skipFeatureDeployment": true "skipFeatureDeployment": true,
}, "isDomainIsolated": false,
"paths": { "developer": {
"zippedPackage": "solution/word-game.sppkg" "name": "Contoso",
} "privacyUrl": "https://contoso.com/privacy",
} "termsOfUseUrl": "https://contoso.com/terms-of-use",
"websiteUrl": "https://contoso.com/my-app",
"mpnId": "000000"
}
},
"paths": {
"zippedPackage": "solution/word-game.sppkg"
}
}

17023
samples/react-word-game/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +1,38 @@
{ {
"name": "react-word-game", "name": "react-word-game",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"main": "lib/index.js", "main": "lib/index.js",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
}, },
"scripts": { "scripts": {
"build": "gulp bundle", "build": "gulp bundle",
"clean": "gulp clean", "clean": "gulp clean",
"test": "gulp test" "test": "gulp test"
}, },
"dependencies": { "dependencies": {
"react": "15.6.2", "@microsoft/sp-core-library": "1.11.0",
"react-dom": "15.6.2", "@microsoft/sp-lodash-subset": "1.11.0",
"@types/react": "15.6.6", "@microsoft/sp-office-ui-fabric-core": "1.11.0",
"@types/react-dom": "15.5.6", "@microsoft/sp-property-pane": "1.11.0",
"@microsoft/sp-core-library": "~1.4.0", "@microsoft/sp-webpart-base": "1.11.0",
"@microsoft/sp-webpart-base": "~1.4.0", "office-ui-fabric-react": "6.214.0",
"@microsoft/sp-lodash-subset": "~1.4.0", "react": "16.8.5",
"@microsoft/sp-office-ui-fabric-core": "~1.4.0", "react-dom": "16.8.5"
"@types/webpack-env": "1.13.1", },
"@types/es6-promise": "0.0.33" "resolutions": {
}, "@types/react": "16.8.8"
"resolutions": { },
"@types/react": "15.6.6" "devDependencies": {
}, "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"devDependencies": { "@microsoft/sp-build-web": "1.11.0",
"@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-module-interfaces": "1.11.0",
"@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-tslint-rules": "1.11.0",
"@microsoft/sp-webpart-workbench": "~1.4.1", "@microsoft/sp-webpart-workbench": "1.11.0",
"gulp": "~3.9.1", "@types/chai": "3.4.34",
"@types/chai": "3.4.34", "@types/mocha": "2.2.38",
"@types/mocha": "2.2.38", "ajv": "~5.2.2",
"ajv": "~5.2.2" "gulp": "~3.9.1"
} }
} }

View File

@ -1,26 +1,34 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
"id": "e33f043c-3d0d-4873-a5aa-3dd37f70d3bd", "id": "e33f043c-3d0d-4873-a5aa-3dd37f70d3bd",
"alias": "WordGameWebPart", "alias": "WordGameWebPart",
"componentType": "WebPart", "componentType": "WebPart",
// The "*" signifies that the version should be taken from the package.json
// The "*" signifies that the version should be taken from the package.json "version": "*",
"version": "*", "manifestVersion": 2,
"manifestVersion": 2, "supportedHosts": [
"SharePointWebPart"
// If true, the component can only be installed on sites where Custom Script is allowed. ],
// Components that allow authors to embed arbitrary script code should set this to true. // If true, the component can only be installed on sites where Custom Script is allowed.
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f // Components that allow authors to embed arbitrary script code should set this to true.
"requiresCustomScript": false, // https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
"requiresCustomScript": false,
"preconfiguredEntries": [{ "preconfiguredEntries": [
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other {
"group": { "default": "Other" }, "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
"title": { "default": "WordGame" }, "group": {
"description": { "default": "A fun game where you unscramble the words before the time runs out" }, "default": "Other"
"officeFabricIconFontName": "TextField", },
"properties": { "title": {
"description": "WordGame" "default": "WordGame"
} },
}] "description": {
} "default": "A fun game where you unscramble the words before the time runs out"
},
"officeFabricIconFontName": "TextField",
"properties": {
"description": "WordGame"
}
}
]
}

View File

@ -2,78 +2,79 @@ import * as React from 'react';
import * as ReactDom from 'react-dom'; import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library'; import { Version } from '@microsoft/sp-core-library';
import { import {
BaseClientSideWebPart, BaseClientSideWebPart
IPropertyPaneConfiguration,
PropertyPaneTextField,
PropertyPaneCheckbox
} from '@microsoft/sp-webpart-base'; } from '@microsoft/sp-webpart-base';
import {
IPropertyPaneConfiguration,
PropertyPaneTextField,
PropertyPaneCheckbox
} from "@microsoft/sp-property-pane";
import WordGame from './components/WordGame'; import WordGame from './components/WordGame';
import { IWordGameProps } from './components/IWordGameProps'; import { IWordGameProps } from './components/IWordGameProps';
export interface IWordGameWebPartProps { export interface IWordGameWebPartProps {
gameTitle: string; gameTitle: string;
enableHighScores: boolean; enableHighScores: boolean;
} }
export default class WordGameWebPart extends BaseClientSideWebPart<IWordGameWebPartProps> { export default class WordGameWebPart extends BaseClientSideWebPart<IWordGameWebPartProps> {
public render(): void { public render(): void {
if (!this.properties.gameTitle) { if (!this.properties.gameTitle) {
this.properties.gameTitle = 'Word Game'; this.properties.gameTitle = 'Word Game';
} }
if (this.properties.enableHighScores === undefined) { if (this.properties.enableHighScores === undefined) {
this.properties.enableHighScores = true; this.properties.enableHighScores = true;
} }
const element: React.ReactElement<IWordGameProps> = React.createElement( const element: React.ReactElement<IWordGameProps> = React.createElement(
WordGame, WordGame,
{ {
description: this.properties.gameTitle, description: this.properties.gameTitle,
enableHighScores: this.properties.enableHighScores, enableHighScores: this.properties.enableHighScores,
context: this.context context: this.context
} }
); );
ReactDom.render(element, this.domElement); ReactDom.render(element, this.domElement);
} }
protected onDispose(): void { protected onDispose(): void {
ReactDom.unmountComponentAtNode(this.domElement); ReactDom.unmountComponentAtNode(this.domElement);
} }
protected get dataVersion(): Version { protected get dataVersion(): Version {
return Version.parse('1.0'); return Version.parse('1.0');
} }
// only refresh render after applying settings pane // only refresh render after applying settings pane
protected get disableReactivePropertyChanges(): boolean { protected get disableReactivePropertyChanges(): boolean {
return true; return true;
} }
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return { return {
pages: [ pages: [
{ {
header: { header: {
description: 'Configure Word Game Settings' description: 'Configure Word Game Settings'
}, },
groups: [ groups: [
{ {
groupName: 'Main', groupName: 'Main',
groupFields: [ groupFields: [
PropertyPaneCheckbox('enableHighScores', { PropertyPaneCheckbox('enableHighScores', {
text: 'Enable High Scores' text: 'Enable High Scores'
}), }),
PropertyPaneTextField('gameTitle', { PropertyPaneTextField('gameTitle', {
label: 'Game Title' label: 'Game Title'
}) })
] ]
} }
] ]
} }
] ]
}; };
} }
} }

View File

@ -1,10 +1,10 @@
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss'; @import "~office-ui-fabric-react/dist/sass/References.scss";
// WORDGAME STYLES // WORDGAME STYLES
:global .wordGameCustom{ :global .wordGameCustom {
input[type="text"],
input[type=text], select { select {
width: 100%; width: 100%;
padding: 12px 20px; padding: 12px 20px;
margin: 8px 0; margin: 8px 0;
@ -13,11 +13,11 @@
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
} }
button, button,
input[type=submit] { input[type="submit"] {
width: 100%; width: 100%;
background-color: #4CAF50; background-color: #4caf50;
color: white; color: white;
padding: 14px 20px; padding: 14px 20px;
margin: 8px 0; margin: 8px 0;
@ -25,38 +25,38 @@
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
} }
input[type=submit]:hover { input[type="submit"]:hover {
background-color: #45a049; background-color: #45a049;
} }
div { div {
border-radius: 5px; border-radius: 5px;
background-color: white; background-color: white;
padding: 20px; padding: 20px;
} }
.greyButton{ .greyButton {
background-color: grey; background-color: grey;
} }
.blueButton{ .blueButton {
width: unset; width: unset;
background-color: #007bff; background-color: #007bff;
} }
.currentWord{ .currentWord {
color: #007bff; color: #007bff;
font-size: 3rem; font-size: 3rem;
} }
.timer{ .timer {
font-size: 16pt; font-size: 16pt;
color: gray; color: gray;
font-weight: 600; font-weight: 600;
} }
.gameReview{ .gameReview {
text-align: left; text-align: left;
width: 250px; width: 250px;
margin-left: auto; margin-left: auto;
@ -66,53 +66,48 @@
border-color: #c3e6cb; border-color: #c3e6cb;
font-size: 16px; font-size: 16px;
} }
ul{ ul {
margin-top: 5px; margin-top: 5px;
} }
.toast{ .toast {
position: absolute; position: absolute;
top: 5px; top: 5px;
right: 5px; right: 5px;
} }
.toastMiniGreen{ .toastMiniGreen {
color: rgb(103, 181, 89); color: rgb(103, 181, 89);
} }
.toastMiniRed{ .toastMiniRed {
color: red; color: red;
} }
.toastGreen{ .toastGreen {
color: #155724; color: #155724;
background-color: #d4edda; background-color: #d4edda;
border-color: #c3e6cb; border-color: #c3e6cb;
padding: 11px; padding: 11px;
} }
.toastRed{ .toastRed {
color: #721c24; color: #721c24;
background-color: #f8d7da; background-color: #f8d7da;
border-color: #f5c6cb; border-color: #f5c6cb;
padding: 11px; padding: 11px;
} }
.numAnswersTip{ .numAnswersTip {
padding-top: 3px; padding-top: 3px;
padding-bottom: 3px; padding-bottom: 3px;
color: gray; color: gray;
} }
} }
// OFFICE STYLES // OFFICE STYLES
.wordGame { .wordGame {
.container { .container {
max-width: 700px; max-width: 700px;
margin: 0px auto; margin: 0px auto;
@ -163,7 +158,8 @@
// Basic Button // Basic Button
outline: transparent; outline: transparent;
position: relative; position: relative;
font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; font-family: "Segoe UI WestEuropean", "Segoe UI", -apple-system,
BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
font-size: $ms-font-size-m; font-size: $ms-font-size-m;
font-weight: $ms-font-weight-regular; font-weight: $ms-font-weight-regular;
@ -183,4 +179,4 @@
display: inline-block; display: inline-block;
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

View File

@ -1,26 +1,39 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"jsx": "react", "jsx": "react",
"declaration": true, "declaration": true,
"sourceMap": true, "sourceMap": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"typeRoots": [ "outDir": "lib",
"./node_modules/@types", "inlineSources": false,
"./node_modules/@microsoft" "strictNullChecks": false,
], "noUnusedLocals": false,
"types": [ "typeRoots": [
"es6-promise", "./node_modules/@types",
"webpack-env" "./node_modules/@microsoft"
], ],
"lib": [ "types": [
"es5", "es6-promise",
"dom", "webpack-env"
"es2015.collection" ],
] "lib": [
} "es5",
} "dom",
"es2015.collection"
],
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": [
"node_modules",
"lib"
],
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json",
}
}