Skip to content

[Word] (citation mgmt) Add unified manifest support #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions Samples/word-citation-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ products:
- office-word
- office
- m365
- office-teams
languages:
- javascript
extensions:
Expand Down Expand Up @@ -37,9 +38,17 @@ The sample uses the [@orcid/bibtexParseJs](https://github.com/ORCID/bibtexParseJ

## Prerequisites

- Office connected to a Microsoft 365 subscription (including Office on the web).
- [Node.js](https://nodejs.org/) version 16 or greater.
- [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) version 8 or greater.
- (Optional) If you want to run the web server on localhost, install a recent version of [npm](https://www.npmjs.com/get-npm) and [Node.js](https://nodejs.org) on your computer. To check if you've already installed these tools, from a command prompt, run the following commands.

```console
node -v
npm -v
```

- (Optional) If you want to deploy the sample with the unified manifest for Microsoft 365 to Microsoft Azure, you'll need the following:
- An Azure subscription.
- [Visual Studio Code](https://code.visualstudio.com/).
- [Microsoft 365 Agents Toolkit extension for Visual Studio Code](https://learn.microsoft.com/microsoftteams/platform/toolkit/install-teams-toolkit).

## Solution

Expand All @@ -52,6 +61,7 @@ The sample uses the [@orcid/bibtexParseJs](https://github.com/ORCID/bibtexParseJ
| Version | Date | Comments |
|----------|------|----------|
| 1.0 | 11-28-2023 | Initial release |
| 1.1 | 5-13-2025 | Convert to the unified manifest for Microsoft 365 |

## Run the sample

Expand All @@ -74,6 +84,12 @@ The sample uses the [@orcid/bibtexParseJs](https://github.com/ORCID/bibtexParseJ

1. If the add-in task pane isn't already open in Word, go to the Home tab and choose the **Show Task Pane** button in the ribbon to open it.

1. To stop the web server and uninstall the add-in from Word, run the following command.

```console
npm stop
```

## Try it out

1. In the "Bibliography sources" section of the add-in UI, select the **Choose File** button. Navigate to the local location of your .bib file then open the file.
Expand Down
4 changes: 3 additions & 1 deletion Samples/word-citation-management/assets/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"creationDateTime": "2023-11-28",
"updateDateTime": "2023-11-28",
"products": [
"Office"
"Office",
"Teams",
"TeamsToolkit"
],
"metadata": [
{
Expand Down
15 changes: 15 additions & 0 deletions Samples/word-citation-management/env/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file includes environment variables that will be committed to git by default.

# Built-in environment variables
TEAMSFX_ENV=dev
APP_NAME_SUFFIX=dev

# Updating AZURE_SUBSCRIPTION_ID or AZURE_RESOURCE_GROUP_NAME after provision may also require an update to RESOURCE_SUFFIX, because some services require a globally unique name across subscriptions/resource groups.
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP_NAME=
RESOURCE_SUFFIX=

# Generated during provision, you can also add your own variables.
AZURE_STATIC_WEB_APPS_RESOURCE_ID=
ADDIN_DOMAIN=
ADDIN_ENDPOINT=
26 changes: 26 additions & 0 deletions Samples/word-citation-management/infra/azure.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@maxLength(20)
@minLength(4)
param resourceBaseName string
param staticWebAppSku string

param staticWebAppName string = resourceBaseName

// Azure Static Web Apps that hosts your static web site
resource swa 'Microsoft.Web/staticSites@2022-09-01' = {
name: staticWebAppName
// SWA do not need location setting
location: 'centralus'
sku: {
name: staticWebAppSku
tier: staticWebAppSku
}
properties: {}
}


var siteDomain = swa.properties.defaultHostname

// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output AZURE_STATIC_WEB_APPS_RESOURCE_ID string = swa.id
output ADDIN_DOMAIN string = siteDomain
output ADDIN_ENDPOINT string = 'https://${siteDomain}'
12 changes: 12 additions & 0 deletions Samples/word-citation-management/infra/azure.parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceBaseName": {
"value": "tab${{RESOURCE_SUFFIX}}"
},
"staticWebAppSku": {
"value": "Free"
}
}
}
215 changes: 215 additions & 0 deletions Samples/word-citation-management/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"manifestVersion": "devPreview",
"version": "1.0.1.0",
"id": "26FEC3DD-D707-4BF5-9AA7-576131C096EC",
"localizationInfo": {
"defaultLanguageTag": "en-us"
},
"developer": {
"name": "Contoso",
"websiteUrl": "https://www.contoso.com/help",
"privacyUrl": "https://www.contoso.com/help",
"termsOfUseUrl": "https://www.contoso.com/help"
},
"name": {
"short": "Citation manager - sample",
"full": "Citation manager - sample"
},
"description": {
"short": "A template to get started with citation management.",
"full": "A template to get started with citation management."
},
"icons": {
"outline": "assets/icon-32.png",
"color": "assets/icon-64.png"
},
"accentColor": "#230201",
"validDomains": [
"https://www.contoso.com",
"https://localhost:3000"
],
"showLoadingIndicator": false,
"isFullScreen": false,
"defaultBlockUntilAdminAction": false,
"authorization": {
"permissions": {
"resourceSpecific": [
{
"name": "Document.ReadWrite.User",
"type": "Delegated"
}
]
}
},
"extensions": [
{
"requirements": {
"scopes": [
"document"
]
},
"runtimes": [
{
"requirements": {
"capabilities": [
{
"name": "Taskpane",
"minVersion": "1.1"
}
],
"scopes": [
"document"
],
"formFactors": [
"desktop"
]
},
"id": "runtime_1",
"type": "general",
"code": {
"page": "https://localhost:3000/taskpane.html",
"script": "https://localhost:3000/taskpane.js"
},
"lifetime": "short"
},
{
"requirements": {
"capabilities": [
{
"name": "AddinCommands",
"minVersion": "1.1"
}
]
},
"id": "runtime_2",
"type": "general",
"code": {
"page": "https://localhost:3000/taskpane.html",
"script": "https://localhost:3000/taskpane.js"
},
"lifetime": "short",
"actions": [
{
"id": "ButtonId1_1",
"type": "openPage",
"pinnable": false,
"view": "ButtonId1",
"multiselect": false,
"supportsNoItemContext": false
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something's gone wrong here. The "capabilities" asks for AddinCommands 1.1. But the "actions.type" is "openPage" which is for task panes, not add-in commands. Also, the two URLs in "code" are for a task pane. There's no add-in command in this sample and you've already got a runtime for the task pane, just above this one, so I think this should just be deleted.

Copy link
Collaborator Author

@ElizabethSamuel-MSFT ElizabethSamuel-MSFT May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I thought this was for the ribbon button, so when you click on it, it opens the task pane...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I thought this was for the ribbon button, so when you click on it, it opens the task pane...

Based on what I see in the original XML manifest, this add-in has only one button and that is a "Show Task Pane" button. But the JSON manifest has two runtime objects in the "runtimes" array. The first one looks correct to be the runtime for the task pane. But this second one seems to have no purpose, and it's an odd mixture of values that are appropriate for a Show Task Pane button and values that are appropriate for a function command button.

],
"getStartedMessages": [
{
"requirements": {
"capabilities": [
{
"name": "Taskpane",
"minVersion": "1.1"
}
],
"scopes": [
"document"
],
"formFactors": [
"desktop"
]
},
"title": "Get started with your sample add-in!",
"description": "Your sample add-in loaded successfully. Go to the HOME tab and click the 'Show Task Pane' button to get started.",
"learnMoreUrl": "https://go.microsoft.com/fwlink/?LinkId=276812"
}
],
"ribbons": [
{
"requirements": {
"capabilities": [
{
"name": "AddinCommands",
"minVersion": "1.1"
}
],
"scopes": [
"document"
],
"formFactors": [
"desktop"
]
},
"contexts": [
"default"
],
"tabs": [
{
"builtInTabId": "TabHome",
"groups": [
{
"id": "CommandsGroup",
"label": "Commands Group",
"icons": [
{
"size": 16,
"url": "https://localhost:3000/assets/icon-16.png"
},
{
"size": 32,
"url": "https://localhost:3000/assets/icon-32.png"
},
{
"size": 80,
"url": "https://localhost:3000/assets/icon-80.png"
}
],
"controls": [
{
"id": "TaskpaneButton",
"type": "button",
"label": "Show Task Pane",
"icons": [
{
"size": 16,
"url": "https://localhost:3000/assets/icon-16.png"
},
{
"size": 32,
"url": "https://localhost:3000/assets/icon-32.png"
},
{
"size": 80,
"url": "https://localhost:3000/assets/icon-80.png"
}
],
"supertip": {
"title": "Show Task Pane",
"description": "Click to show a task pane."
},
"actionId": "ButtonId1_1",
"overriddenByRibbonApi": false,
"enabled": true
}
]
}
]
}
]
}
],
"alternates": [
{
"alternateIcons": {
"icon": {
"size": 32,
"url": "https://localhost:3000/assets/icon-32.png"
},
"highResolutionIcon": {
"size": 64,
"url": "https://localhost:3000/assets/icon-64.png"
}
}
}
]
}
]
}
Loading