Discover what Office Add-ins can do for you today!
7 | 21 |22 |
23 |
Modify the source files, then click Run.
24 | 28 |├── .azure-devops
├── build.yml
├── cleanup.yml
├── devcerts.yml
├── edgewebview.yml
├── full-pipeline.yml
├── install.yml
├── lint.yml
└── test.yml
├── .eslintrc.json
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ └── bug_report.md
└── pull_request_template.md
├── .gitignore
├── .npmrc
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── assets
├── icon-128.png
├── icon-16.png
├── icon-32.png
├── icon-64.png
├── icon-80.png
└── logo-filled.png
├── babel.config.json
├── convertToSingleHost.js
├── manifest.excel.xml
├── manifest.onenote.xml
├── manifest.outlook.xml
├── manifest.powerpoint.xml
├── manifest.project.xml
├── manifest.word.xml
├── manifest.xml
├── package-lock.json
├── package.json
├── src
├── commands
│ ├── commands.html
│ └── commands.ts
└── taskpane
│ ├── app
│ ├── app.component.html
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── excel.app.component.ts
│ ├── onenote.app.component.ts
│ ├── outlook.app.component.ts
│ ├── powerpoint.app.component.ts
│ ├── project.app.component.ts
│ └── word.app.component.ts
│ ├── taskpane.css
│ ├── taskpane.html
│ └── taskpane.ts
├── test
├── end-to-end
│ ├── src
│ │ ├── test-helpers.ts
│ │ ├── test-taskpane.html
│ │ ├── test-taskpane.ts
│ │ ├── test.app.component.ts
│ │ ├── test.app.module.ts
│ │ ├── test.excel.app.component.ts
│ │ ├── test.powerpoint.app.compontent.ts
│ │ └── test.word.app.component.ts
│ ├── test-manifest.xml
│ ├── ui-test.ts
│ └── webpack.config.js
└── unit
│ ├── excel.test.ts
│ ├── powerpoint.test.ts
│ └── word.test.ts
├── tsconfig.json
└── webpack.config.js
/.azure-devops/build.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - task: Npm@1
3 | displayName: 'Build'
4 | inputs:
5 | command: custom
6 | customCommand: 'run build'
7 |
--------------------------------------------------------------------------------
/.azure-devops/cleanup.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
3 | displayName: "Cleanup"
4 |
--------------------------------------------------------------------------------
/.azure-devops/devcerts.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - script: |
3 | echo Install Office-AddinDev-Certs at machine level
4 | call npx office-addin-dev-certs install --machine
5 |
6 | displayName: 'Install add-in dev cert'
7 |
--------------------------------------------------------------------------------
/.azure-devops/edgewebview.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - script: |
3 | echo Enable EdgeWebView Loopback
4 | call npx office-addin-dev-settings appcontainer EdgeWebView --loopback --yes
5 |
6 | echo Set Edge WebView Registry Settings
7 |
8 | set PATH1="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646"
9 |
10 | reg add %PATH1% /f /v DisplayName /t REG_SZ /d "@{Microsoft.Win32WebViewHost_10.0.19041.423_neutral_neutral_cw5n1h2txyewy?ms-resource://Windows.Win32WebViewHost/resources/DisplayName}"
11 | reg add %PATH1% /f /v Moniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy"
12 |
13 | set PATH2="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646\Children\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646-3829197285-1050560373-949424154-522343454"
14 |
15 | reg add %PATH2% /f /v DisplayName /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy/123"
16 | reg add %PATH2% /f /v Moniker /t REG_SZ /d "123"
17 | reg add %PATH2% /f /v ParentMoniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy"
18 |
19 | displayName: 'Enable Edge WebView'
20 |
--------------------------------------------------------------------------------
/.azure-devops/full-pipeline.yml:
--------------------------------------------------------------------------------
1 | # Build a general Node.js project with npm.
2 | # Add steps that analyze code, save build artifacts, deploy, and more:
3 | # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
4 |
5 | jobs:
6 | - job: Windows_10_Latest
7 | pool:
8 | name: OE-OfficeClientApps
9 | steps:
10 | - template: ./install.yml
11 | - template: ./lint.yml
12 | - template: ./build.yml
13 | - template: ./devcerts.yml
14 | - template: ./edgewebview.yml
15 | - template: ./test.yml
16 | parameters:
17 | webView: "edge-chromium"
18 |
19 | - job: WebView_EdgeLegacy
20 | pool:
21 | name: OE-OfficeClientApps
22 | steps:
23 | - template: ./install.yml
24 | - template: ./lint.yml
25 | - template: ./build.yml
26 | - template: ./devcerts.yml
27 | - template: ./edgewebview.yml
28 | - template: ./test.yml
29 | parameters:
30 | webView: "edge-legacy"
31 |
32 | - job: Mac
33 | pool:
34 | name: OPX Mac Dogfood Pool
35 | steps:
36 | - template: ./install.yml
37 | - template: ./lint.yml
38 | - template: ./build.yml
39 | - template: ./test.yml
40 | - template: ./cleanup.yml
41 |
--------------------------------------------------------------------------------
/.azure-devops/install.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - task: Npm@1
3 | displayName: 'Install'
4 |
--------------------------------------------------------------------------------
/.azure-devops/lint.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - task: Npm@1
3 | displayName: 'Lint'
4 | inputs:
5 | command: custom
6 | customCommand: 'run lint'
7 |
--------------------------------------------------------------------------------
/.azure-devops/test.yml:
--------------------------------------------------------------------------------
1 | parameters:
2 | - name: webView
3 | type: string
4 | default: "edge-chromium"
5 |
6 | steps:
7 | - task: CmdLine@2
8 | inputs:
9 | script: |
10 | echo Setting WebView Type: ${{ parameters.webView }}
11 | call npx office-addin-dev-settings webview manifest.xml ${{ parameters.webView }}
12 | call npx office-addin-dev-settings webview test/end-to-end/test-manifest.xml ${{ parameters.webView }}
13 |
14 | echo Running Tests
15 | npm run test
16 |
17 | echo Done running tests
18 | displayName: 'Run Tests'
19 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "office-addins"
4 | ],
5 | "extends": [
6 | "plugin:office-addins/recommended"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @OfficeDev/office-platform-devx
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: needs triage
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Prerequisites
11 |
12 | Please answer the following questions before submitting an issue.
13 | **YOU MAY DELETE THE PREREQUISITES SECTION.**
14 | - [ ] I am running the latest version of Node and the tools
15 | - [ ] I checked the documentation and found no answer
16 | - [ ] I checked to make sure that this issue has not already been filed
17 |
18 |
19 | # Expected behavior
20 |
21 | Please describe the behavior you were expecting
22 |
23 |
24 | # Current behavior
25 |
26 | Please provide information about the failure. What is the current behavior? If it is not a bug, please submit your idea to the [Microsoft Tech Community Ideas forum](https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform), so that it gets added to our feature roadmap.
27 |
28 |
29 | ## Steps to Reproduce
30 |
31 | Please provide detailed steps for reproducing the issue.
32 |
33 | 1. step 1
34 | 2. step 2
35 | 3. you get it...
36 |
37 |
38 | ## Context
39 |
40 | Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
41 |
42 | * Operating System:
43 | * Node version:
44 | * Office version:
45 | * Tool version:
46 |
47 | ## Failure Logs
48 |
49 | Please include any relevant log snippets, screenshots or code samples here.
50 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | Thank you for your pull request! Please provide the following information.
2 |
3 | ---
4 |
5 | **Change Description**:
6 |
7 | Describe what the PR is about.
8 |
9 | 1. **Do these changes impact any *npm scripts* commands (in package.json)?** (e.g., running 'npm run start')
10 | If Yes, briefly describe what is impacted.
11 |
12 |
13 | 2. **Do these changes impact *VS Code debugging* options (launch.json)?**
14 | If Yes, briefly describe what is impacted.
15 |
16 |
17 | 3. **Do these changes impact *template output*?** (e.g., add/remove file, update file location, update file contents)
18 | If Yes, briefly describe what is impacted.
19 |
20 |
21 | 4. **Do these changes impact *documentation*?** (e.g., a tutorial on https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)
22 | If Yes, briefly describe what is impacted.
23 |
24 |
25 | If you answered yes to any of these please do the following:
26 | > Include 'Rick-Kirkham' in the review
27 | > Make sure the README file is correct
28 |
29 | **Validation/testing performed**:
30 |
31 | Describe manual testing done.
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build output
2 | dist/
3 |
4 | # Node modules folder
5 | node_modules/
6 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
2 | registry=https://registry.npmjs.org/
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4 |
5 | // List of extensions which should be recommended for users of this workspace.
6 | "recommendations": [
7 | "ms-edgedevtools.vscode-edge-devtools",
8 | "msoffice.microsoft-office-add-in-debugger",
9 | "dbaeumer.vscode-eslint",
10 | "esbenp.prettier-vscode"
11 | ],
12 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
13 | "unwantedRecommendations": []
14 | }
15 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Debug UI Tests",
9 | "type": "node",
10 | "request": "launch",
11 | "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12 | "args": [
13 | "-u",
14 | "bdd",
15 | "--timeout",
16 | "999999",
17 | "--colors",
18 | "${workspaceFolder}/test/end-to-end",
19 | "-r",
20 | "ts-node/register",
21 | "${workspaceFolder}/test/end-to-end/*.ts"
22 | ],
23 | "internalConsoleOptions": "openOnSessionStart",
24 | "runtimeArgs": ["--preserve-symlinks"]
25 | },
26 | {
27 | "name": "Debug Unit Tests",
28 | "type": "node",
29 | "request": "launch",
30 | "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
31 | "args": [
32 | "-u",
33 | "bdd",
34 | "--timeout",
35 | "999999",
36 | "--colors",
37 | "${workspaceFolder}/test/unit",
38 | "-r",
39 | "ts-node/register",
40 | "${workspaceFolder}/test/unit/*.test.ts"
41 | ],
42 | "internalConsoleOptions": "openOnSessionStart",
43 | "runtimeArgs": ["--preserve-symlinks"]
44 | },
45 | {
46 | "name": "Excel Desktop (Edge Chromium)",
47 | "type": "msedge",
48 | "request": "attach",
49 | "port": 9229,
50 | "timeout": 600000,
51 | "webRoot": "${workspaceRoot}",
52 | "preLaunchTask": "Debug: Excel Desktop",
53 | "postDebugTask": "Stop Debug"
54 | },
55 | {
56 | "name": "Excel Desktop (Edge Legacy)",
57 | "type": "office-addin",
58 | "request": "attach",
59 | "url": "https://localhost:3000/taskpane.html?_host_Info=Excel$Win32$16.01$en-US$$$$0",
60 | "port": 9222,
61 | "timeout": 600000,
62 | "webRoot": "${workspaceRoot}",
63 | "preLaunchTask": "Debug: Excel Desktop",
64 | "postDebugTask": "Stop Debug"
65 | },
66 | {
67 | "name": "Outlook Desktop (Edge Chromium)",
68 | "type": "msedge",
69 | "request": "attach",
70 | "port": 9229,
71 | "timeout": 600000,
72 | "webRoot": "${workspaceRoot}",
73 | "preLaunchTask": "Debug: Outlook Desktop",
74 | "postDebugTask": "Stop Debug"
75 | },
76 | {
77 | "name": "Outlook Desktop (Edge Legacy)",
78 | "type": "office-addin",
79 | "request": "attach",
80 | "url": "https://localhost:3000/taskpane.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0",
81 | "port": 9222,
82 | "timeout": 600000,
83 | "webRoot": "${workspaceRoot}",
84 | "preLaunchTask": "Debug: Outlook Desktop",
85 | "postDebugTask": "Stop Debug"
86 | },
87 | {
88 | "name": "PowerPoint Desktop (Edge Chromium)",
89 | "type": "msedge",
90 | "request": "attach",
91 | "port": 9229,
92 | "timeout": 600000,
93 | "webRoot": "${workspaceRoot}",
94 | "preLaunchTask": "Debug: PowerPoint Desktop",
95 | "postDebugTask": "Stop Debug"
96 | },
97 | {
98 | "name": "PowerPoint Desktop (Edge Legacy)",
99 | "type": "office-addin",
100 | "request": "attach",
101 | "url": "https://localhost:3000/taskpane.html?_host_Info=PowerPoint$Win32$16.01$en-US$$$$0",
102 | "port": 9222,
103 | "timeout": 600000,
104 | "webRoot": "${workspaceRoot}",
105 | "preLaunchTask": "Debug: PowerPoint Desktop",
106 | "postDebugTask": "Stop Debug"
107 | },
108 | {
109 | "name": "Word Desktop (Edge Chromium)",
110 | "type": "msedge",
111 | "request": "attach",
112 | "port": 9229,
113 | "timeout": 600000,
114 | "webRoot": "${workspaceRoot}",
115 | "preLaunchTask": "Debug: Word Desktop",
116 | "postDebugTask": "Stop Debug"
117 | },
118 | {
119 | "name": "Word Desktop (Edge Legacy)",
120 | "type": "office-addin",
121 | "request": "attach",
122 | "url": "https://localhost:3000/taskpane.html?_host_Info=Word$Win32$16.01$en-US$$$$0",
123 | "port": 9222,
124 | "timeout": 600000,
125 | "webRoot": "${workspaceRoot}",
126 | "preLaunchTask": "Debug: Word Desktop",
127 | "postDebugTask": "Stop Debug"
128 | }
129 | ]
130 | }
131 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.validate": [
3 | "javascript",
4 | "javascriptreact",
5 | "typescript"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "Build (Development)",
8 | "type": "npm",
9 | "script": "build:dev",
10 | "group": {
11 | "kind": "build",
12 | "isDefault": true
13 | },
14 | "presentation": {
15 | "clear": true,
16 | "panel": "shared",
17 | "showReuseMessage": false
18 | }
19 | },
20 | {
21 | "label": "Build (Production)",
22 | "type": "npm",
23 | "script": "build",
24 | "group": "build",
25 | "presentation": {
26 | "clear": true,
27 | "panel": "shared",
28 | "showReuseMessage": false
29 | }
30 | },
31 | {
32 | "label": "Debug: Excel Desktop",
33 | "type": "npm",
34 | "script": "start:desktop -- --app excel",
35 | "presentation": {
36 | "clear": true,
37 | "panel": "dedicated",
38 | },
39 | "problemMatcher": []
40 | },
41 | {
42 | "label": "Debug: Outlook Desktop",
43 | "type": "npm",
44 | "script": "start:desktop -- --app outlook",
45 | "presentation": {
46 | "clear": true,
47 | "panel": "dedicated",
48 | },
49 | "problemMatcher": []
50 | },
51 | {
52 | "label": "Debug: PowerPoint Desktop",
53 | "type": "npm",
54 | "script": "start:desktop -- --app powerpoint",
55 | "presentation": {
56 | "clear": true,
57 | "panel": "dedicated",
58 | },
59 | "problemMatcher": []
60 | },
61 | {
62 | "label": "Debug: Word Desktop",
63 | "type": "npm",
64 | "script": "start:desktop -- --app word",
65 | "presentation": {
66 | "clear": true,
67 | "panel": "dedicated",
68 | },
69 | "problemMatcher": []
70 | },
71 | {
72 | "label": "Dev Server",
73 | "type": "npm",
74 | "script": "dev-server",
75 | "presentation": {
76 | "clear": true,
77 | "panel": "dedicated"
78 | },
79 | "problemMatcher": []
80 | },
81 | {
82 | "label": "Install",
83 | "type": "npm",
84 | "script": "install",
85 | "presentation": {
86 | "clear": true,
87 | "panel": "shared",
88 | "showReuseMessage": false
89 | },
90 | "problemMatcher": []
91 | },
92 | {
93 | "label": "Lint: Check for problems",
94 | "type": "npm",
95 | "script": "lint",
96 | "problemMatcher": [
97 | "$eslint-stylish"
98 | ]
99 | },
100 | {
101 | "label": "Lint: Fix all auto-fixable problems",
102 | "type": "npm",
103 | "script": "lint:fix",
104 | "problemMatcher": [
105 | "$eslint-stylish"
106 | ]
107 | },
108 | {
109 | "label": "Stop Debug",
110 | "type": "npm",
111 | "script": "stop",
112 | "presentation": {
113 | "clear": true,
114 | "panel": "shared",
115 | "showReuseMessage": false
116 | },
117 | "problemMatcher": []
118 | },
119 | {
120 | "label": "Watch",
121 | "type": "npm",
122 | "script": "watch",
123 | "presentation": {
124 | "clear": true,
125 | "panel": "dedicated"
126 | },
127 | "problemMatcher": []
128 | },
129 | ]
130 | }
131 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribute to this code sample
2 |
3 | Thank you for your interest in this sample! Your contributions and improvements will help the developer community.
4 |
5 | ## Ways to contribute
6 |
7 | There are several ways you can contribute to this sample: providing better code comments, fixing open issues, and adding new features.
8 |
9 | ### Provide better code comments
10 |
11 | Code comments make code samples even better by helping developers learn to use the code correctly in their own applications. If you spot a class, method, or section of code that you think could use better descriptions, then create a pull request with your code comments.
12 |
13 |
14 | In general, we want our code comments to follow these guidelines:
15 |
16 | - Any code that has associated documentation displayed in an IDE (such as IntelliSense, or JavaDocs) has code comments.
17 | - Classes, methods, parameters, and return values have clear descriptions.
18 | - Exceptions and errors are documented.
19 | - Remarks exist for anything special or notable about the code.
20 | - Sections of code that have complex algorithms have appropriate comments describing what they do.
21 | - Code added from Stack Overflow, or any other source, is clearly attributed.
22 |
23 | ### Fix open issues
24 |
25 | Sometimes we get a lot of issues, and it can be hard to keep up. If you have a solution to an open issue that hasn't been addressed, fix the issue and then submit a pull request.
26 |
27 | ### Add a new feature
28 |
29 | New features are great! Be sure to check with the repository admin first to be sure the feature fits the intent of the sample. Start by opening an issue in the repository that proposes and describes the feature. The repository admin will respond and may ask for more information. If the admin agrees to the new feature, create the feature and submit a pull request.
30 |
31 | ## Contribution guidelines
32 |
33 | We have some guidelines to help maintain a healthy repo and code for everyone.
34 |
35 | ### The Contribution License Agreement
36 |
37 | For most contributions, we ask you to sign a Contribution License Agreement (CLA). This will happen when you submit a pull request. Microsoft will send a link to the CLA to sign via email. Once you sign the CLA, your pull request can proceed. Read the CLA carefully, because you may need to have your employer sign it.
38 |
39 | ### Code contribution checklist
40 |
41 | Be sure to satisfy all of the requirements in the following list before submitting a pull request:
42 |
43 | - Follow the code style that is appropriate for the platform and language in this repo. For example, Android code follows the style conventions found in the [Code Style for Contributors guide](https://source.android.com/source/code-style.html).
44 | - Test your code.
45 | - Test the UI thoroughly to be sure your change hasn't broken anything.
46 | - Keep the size of your code change reasonable. If the repository owner cannot review your code change in 4 hours or less, your pull request may not be reviewed and approved quickly.
47 | - Avoid unnecessary changes. The reviewer will check differences between your code and the original code. Whitespace changes are called out along with your code. Be sure your changes will help improve the content.
48 |
49 | ### Submit a pull request to the master branch
50 |
51 | When you're finished with your work and are ready to have it merged into the master repository, follow these steps. Note: pull requests are typically reviewed within 10 business days. If your pull request is accepted you will be credited for your submission.
52 |
53 | 1. Submit your pull request against the master branch.
54 | 2. Sign the CLA, if you haven't already done so.
55 | 3. One of the repo admins will process your pull request, including performing a code review. If there are questions, discussions, or change requests in the pull request, be sure to respond.
56 | 4. When the repo admins are satisfied, they will accept and merge the pull request.
57 |
58 | Congratulations, you have successfully contributed to the sample!
59 |
60 | ## FAQ
61 |
62 | ### Where do I get a Contributor's License Agreement?
63 |
64 | If your pull request requires one, you'll automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA).
65 |
66 | As a community member, you must sign the CLA before you can contribute large submissions to this project. You only need complete and submit the CLA document once. Carefully review the document. You may be required to have your employer sign the document.
67 |
68 | ### What happens with my contributions?
69 |
70 | When you submit your changes via a pull request, our team will be notified and will review your pull request. You'll receive notifications about your pull request from GitHub; you may also be notified by someone from our team if we need more information. We reserve the right to edit your submission for legal, style, clarity, or other issues.
71 |
72 | ### Who approves pull requests?
73 |
74 | The admin of the repository approves pull requests.
75 |
76 | ### How soon will I get a response about my change request or issue?
77 |
78 | We typically review pull requests and respond to issues within 10 business days.
79 |
80 | ## More resources
81 |
82 | - To learn more about Markdown, see [Daring Fireball](http://daringfireball.net/).
83 | - To learn more about using Git and GitHub, check out the [GitHub Help section](http://help.github.com/).
84 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Office Add-in TaskPane
2 |
3 | MIT License
4 |
5 | Copyright (c) Microsoft Corporation. All rights reserved.
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | We don't have the resources to support an Angular option in Yo Office, so this repo is being archived.
2 |
3 | # Office-Addin-TaskPane-Angular
4 |
5 | This repository contains the source code used by the [Yo Office generator](https://github.com/OfficeDev/generator-office) when you create a new Office Add-in that appears in the task pane. You can also use this repository as a sample to base your own project from if you choose not to use the generator.
6 |
7 | *Note that current versions of Angular do not support IE (Internet Explorer). This means that versions of office that use the IE version of the web view will not work with and Angular base Office Add-in
8 |
9 | ## TypeScript
10 |
11 | This template is written using [TypeScript](http://www.typescriptlang.org/). For the JavaScript version of this template, go to [Office-Addin-TaskPane-Angular-JS](https://github.com/OfficeDev/Office-Addin-TaskPane-Angular-JS).
12 |
13 | ## Debugging
14 |
15 | This template supports debugging using any of the following techniques:
16 |
17 | - [Use a browser's developer tools](https://docs.microsoft.com/office/dev/add-ins/testing/debug-add-ins-in-office-online)
18 | - [Attach a debugger from the task pane](https://docs.microsoft.com/office/dev/add-ins/testing/attach-debugger-from-task-pane)
19 |
20 | ## Questions and comments
21 |
22 | We'd love to get your feedback about this sample. You can send your feedback to us in the *Issues* section of this repository.
23 |
24 | Questions about Office Add-ins development in general should be posted to [Microsoft Q&A](https://docs.microsoft.com/answers/questions/185087/questions-about-office-add-ins.html). If your question is about the Office JavaScript APIs, make sure it's tagged with [office-js-dev].
25 |
26 | ## Join the Microsoft 365 Developer Program
27 | Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform.
28 | - [Free developer sandbox](https://developer.microsoft.com/microsoft-365/dev-program#Subscription) Get a free, renewable 90-day Microsoft 365 E5 developer subscription.
29 | - [Sample data packs](https://developer.microsoft.com/microsoft-365/dev-program#Sample) Automatically configure your sandbox by installing user data and content to help you build your solutions.
30 | - [Access to experts](https://developer.microsoft.com/microsoft-365/dev-program#Experts) Access community events to learn from Microsoft 365 experts.
31 | - [Personalized recommendations](https://developer.microsoft.com/microsoft-365/dev-program#Recommendations) Find developer resources quickly from your personalized dashboard.
32 |
33 | ## Additional resources
34 |
35 | * [Office Add-ins documentation](https://docs.microsoft.com/office/dev/add-ins/overview/office-add-ins)
36 | * More Office Add-ins samples at [OfficeDev on Github](https://github.com/officedev)
37 |
38 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
39 |
40 | ## Copyright
41 |
42 | Copyright (c) 2021 Microsoft Corporation. All rights reserved.
43 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/assets/icon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/icon-128.png
--------------------------------------------------------------------------------
/assets/icon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/icon-16.png
--------------------------------------------------------------------------------
/assets/icon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/icon-32.png
--------------------------------------------------------------------------------
/assets/icon-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/icon-64.png
--------------------------------------------------------------------------------
/assets/icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/icon-80.png
--------------------------------------------------------------------------------
/assets/logo-filled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-Addin-TaskPane-Angular/752e903c1a063560a18b1b17473c834c8fdb3867/assets/logo-filled.png
--------------------------------------------------------------------------------
/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-typescript"]
3 | }
--------------------------------------------------------------------------------
/convertToSingleHost.js:
--------------------------------------------------------------------------------
1 | /* global require, process, console */
2 |
3 | const convertTest = process.argv[3] === "convert-test";
4 | const fs = require("fs");
5 | const host = process.argv[2];
6 | const hosts = ["excel", "onenote", "outlook", "powerpoint", "project", "word"];
7 | const path = require("path");
8 | const util = require("util");
9 | const testPackages = [
10 | "@types/mocha",
11 | "@types/node",
12 | "current-processes",
13 | "mocha",
14 | "office-addin-mock",
15 | "office-addin-test-helpers",
16 | "office-addin-test-server",
17 | "ts-node",
18 | ];
19 | const readFileAsync = util.promisify(fs.readFile);
20 | const unlinkFileAsync = util.promisify(fs.unlink);
21 | const writeFileAsync = util.promisify(fs.writeFile);
22 |
23 | async function modifyProjectForSingleHost(host) {
24 | if (!host) {
25 | throw new Error("The host was not provided.");
26 | }
27 | if (!hosts.includes(host)) {
28 | throw new Error(`'${host}' is not a supported host.`);
29 | }
30 | await convertProjectToSingleHost(host);
31 | await updatePackageJsonForSingleHost(host);
32 | if (!convertTest) {
33 | await updateLaunchJsonFile();
34 | }
35 | }
36 |
37 | async function convertProjectToSingleHost(host) {
38 | // copy host-specific manifest over manifest.xml
39 | const manifestContent = await readFileAsync(`./manifest.${host}.xml`, "utf8");
40 | await writeFileAsync(`./manifest.xml`, manifestContent);
41 |
42 | // copy over host-specific taskpane code to taskpane.ts
43 | const srcContent = await readFileAsync(`./src/taskpane/app/${host}.app.component.ts`, "utf8");
44 | await writeFileAsync(`./src/taskpane/app/app.component.ts`, srcContent);
45 |
46 | // delete all test files by default for now - eventually we want to convert the tests by default
47 | if (convertTest && (host === "excel" || host === "word")) {
48 | // copy over host-specific taskpane test code to test-taskpane.ts
49 | const testTaskpaneContent = await readFileAsync(`./test/src/test.${host}.app.component.ts`, "utf8");
50 | const updatedTestTaskpaneContent = testTaskpaneContent.replace(
51 | `../../src/taskpane/app/${host}.app.component`,
52 | `../../src/taskpane/app/app.component`
53 | );
54 | await writeFileAsync(`./test/src/test.app.component.ts`, updatedTestTaskpaneContent);
55 |
56 | // update ui-test.ts to only run against specified host
57 | const testContent = await readFileAsync(`./test/ui-test.ts`, "utf8");
58 | const updatedTestContent = testContent.replace(`const hosts = ["Excel", "Word"]`, `const hosts = ["${host == "excel" ? "Excel" : "Word"}"]`);
59 | await writeFileAsync(`./test/ui-test.ts`, updatedTestContent);
60 |
61 | // delete all host-specific test files after converting to single host
62 | hosts.forEach(async function (host) {
63 | if (host == "excel" || host == "word") {
64 | await unlinkFileAsync(`./test/src/test.${host}.app.component.ts`);
65 | }
66 | });
67 | } else {
68 | deleteFolder(path.resolve(`./test`));
69 | }
70 |
71 | // delete all host-specific files
72 | hosts.forEach(async function (host) {
73 | await unlinkFileAsync(`./manifest.${host}.xml`);
74 | await unlinkFileAsync(`./src/taskpane/app/${host}.app.component.ts`);
75 | });
76 |
77 | // delete the .github folder
78 | deleteFolder(path.resolve(`./.github`));
79 |
80 | // delete CI/CD pipeline files
81 | deleteFolder(path.resolve(`./.azure-devops`));
82 |
83 | // delete repo support files
84 | await deleteSupportFiles();
85 | }
86 |
87 | async function updatePackageJsonForSingleHost(host) {
88 | // update package.json to reflect selected host
89 | const packageJson = `./package.json`;
90 | const data = await readFileAsync(packageJson, "utf8");
91 | let content = JSON.parse(data);
92 |
93 | // update 'config' section in package.json to use selected host
94 | content.config["app_to_debug"] = host;
95 |
96 | // remove 'engines' section
97 | delete content.engines;
98 |
99 | // update sideload and unload scripts to use selected host.
100 | ["sideload", "unload"].forEach((key) => {
101 | content.scripts[key] = content.scripts[`${key}:${host}`];
102 | });
103 |
104 | // remove scripts that are unrelated to the selected host
105 | Object.keys(content.scripts).forEach(function (key) {
106 | if (
107 | key.startsWith("sideload:") ||
108 | key.startsWith("unload:") ||
109 | key === "convert-to-single-host" ||
110 | key === "start:desktop:outlook"
111 | ) {
112 | delete content.scripts[key];
113 | }
114 | });
115 |
116 | if (!convertTest) {
117 | // remove test-related scripts
118 | Object.keys(content.scripts).forEach(function (key) {
119 | if (key.includes("test")) {
120 | delete content.scripts[key];
121 | }
122 | });
123 |
124 | // remove test-related packages
125 | Object.keys(content.devDependencies).forEach(function (key) {
126 | if (testPackages.includes(key)) {
127 | delete content.devDependencies[key];
128 | }
129 | });
130 | }
131 |
132 | // write updated json to file
133 | await writeFileAsync(packageJson, JSON.stringify(content, null, 2));
134 | }
135 |
136 | async function updateLaunchJsonFile() {
137 | // remove 'Debug Tests' configuration from launch.json
138 | const launchJson = `.vscode/launch.json`;
139 | const launchJsonContent = await readFileAsync(launchJson, "utf8");
140 | const regex = /(.+{\r?\n.*"name": "Debug (?:UI|Unit) Tests",\r?\n(?:.*\r?\n)*?.*},.*\r?\n)/gm;
141 | const updatedContent = launchJsonContent.replace(regex, "");
142 | await writeFileAsync(launchJson, updatedContent);
143 | }
144 |
145 | function deleteFolder(folder) {
146 | try {
147 | if (fs.existsSync(folder)) {
148 | fs.readdirSync(folder).forEach(function (file) {
149 | const curPath = `${folder}/${file}`;
150 |
151 | if (fs.lstatSync(curPath).isDirectory()) {
152 | deleteFolder(curPath);
153 | } else {
154 | fs.unlinkSync(curPath);
155 | }
156 | });
157 | fs.rmdirSync(folder);
158 | }
159 | } catch (err) {
160 | throw new Error(`Unable to delete folder "${folder}".\n${err}`);
161 | }
162 | }
163 |
164 | async function deleteSupportFiles() {
165 | await unlinkFileAsync("CONTRIBUTING.md");
166 | await unlinkFileAsync("LICENSE");
167 | await unlinkFileAsync("README.md");
168 | await unlinkFileAsync("SECURITY.md");
169 | await unlinkFileAsync("./convertToSingleHost.js");
170 | await unlinkFileAsync(".npmrc");
171 | await unlinkFileAsync("package-lock.json");
172 | }
173 |
174 | /**
175 | * Modify the project so that it only supports a single host.
176 | * @param host The host to support.
177 | */
178 | modifyProjectForSingleHost(host).catch((err) => {
179 | console.error(`Error: ${err instanceof Error ? err.message : err}`);
180 | process.exitCode = 1;
181 | });
182 |
--------------------------------------------------------------------------------
/manifest.excel.xml:
--------------------------------------------------------------------------------
1 |
2 |
Modify the source files, then click Run.
24 | 28 |