Skip to content

Commit

Permalink
support on compose
Browse files Browse the repository at this point in the history
  • Loading branch information
wandyezj committed Sep 16, 2024
1 parent b23d3dc commit 8391fa5
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 31 deletions.
37 changes: 32 additions & 5 deletions docs/sideload.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sideload

[Sideload Add-Ins for testing](https://learn.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing)
[Sideload Add-Ins for testing][sideload-docs]

For outlook web use:
https://outlook.live.com/mail/0/inclientstore
Expand All @@ -14,15 +14,42 @@ Download the production manifest:

If you are using a managed account, there is an IT setting that can disable loading from the store and a setting that can disable sideloading. If you can't access the store you might still be able to sideload.

## Testing

### Setup manifest share
## Setup manifest share

As administrator run:
> .\scripts\create-manifest-share.cmd
### Copy over manifests
## Copy over manifests

This copies over the latest manifests to the manifest share.

> npm run share
> npm run share
## Load the local manifest

Basic manifests are located in the [manifests folder](../manifests/)

Follow: [Sideload Add-Ins for testing][sideload-docs]

Load

- `local.xml` for Word, Excel, PowerPoint.
- `local.outlook.xml` for Outlook.

Click the `[Local]` Ribbon Tab to view the local version.

### Sideloading Outlook Web

[Install Teams Toolkit cli](https://www.npmjs.com/package/@microsoft/teamsapp-cli)

> npm install -g @microsoft/teamsapp-cli
[Install the Manifest](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-cli?pivots=version-three#teamsapp-install)

> teamsapp install --xml-path manifest.xml
Where `manifest.xml` is the path to the manifest.


[sideload-docs]: https://learn.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing
72 changes: 65 additions & 7 deletions manifests/local.outlook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<Id>01000000-1000-0000-0000-000000007357</Id>
<Version>1.0.1.0</Version>
<Version>2.0.1.0</Version>
<ProviderName>wandyezj</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="(local) Build" />
Expand Down Expand Up @@ -51,11 +51,69 @@
<DesktopFormFactor>
<!-- MessageReadCommandSurface when reading an email,
Compose is when replying to an email -->


<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="GroupExtensionId">
<OfficeTab id="Compose.TabDefaultId">
<Group id="Compose.GroupExtensionId">
<Label resid="GroupExtension.Label" />
<Control xsi:type="Button" id="Compose.ButtonEditId">
<Label resid="ButtonEdit.Label" />
<Supertip>
<Title resid="ButtonEdit.Label" />
<Description resid="ButtonEdit.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Edit.16x16" />
<bt:Image size="32" resid="Icon.Edit.32x32" />
<bt:Image size="80" resid="Icon.Edit.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneEdit.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="Compose.ButtonRunId">
<Label resid="ButtonRun.Label" />
<Supertip>
<Title resid="ButtonRun.Label" />
<Description resid="ButtonRun.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Run.16x16" />
<bt:Image size="32" resid="Icon.Run.32x32" />
<bt:Image size="80" resid="Icon.Run.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRun.Url" />
</Action>
</Control>
</Group>
<Group id="Compose.GroupHelpId">
<Label resid="GroupHelp.Label" />
<Control xsi:type="Button" id="Compose.ButtonHelpId">
<Label resid="ButtonHelp.Label" />
<Supertip>
<Title resid="ButtonHelp.Label" />
<Description resid="ButtonHelp.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Help.16x16" />
<bt:Image size="32" resid="Icon.Help.32x32" />
<bt:Image size="80" resid="Icon.Help.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneHelp.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>

<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="Read.TabDefaultId">
<Group id="Read.GroupExtensionId">
<Label resid="GroupExtension.Label" />
<Control xsi:type="Button" id="ButtonEditId">
<Control xsi:type="Button" id="Read.ButtonEditId">
<Label resid="ButtonEdit.Label" />
<Supertip>
<Title resid="ButtonEdit.Label" />
Expand All @@ -70,7 +128,7 @@
<SourceLocation resid="TaskpaneEdit.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="ButtonRunId">
<Control xsi:type="Button" id="Read.ButtonRunId">
<Label resid="ButtonRun.Label" />
<Supertip>
<Title resid="ButtonRun.Label" />
Expand All @@ -86,9 +144,9 @@
</Action>
</Control>
</Group>
<Group id="GroupHelpId">
<Group id="Read.GroupHelpId">
<Label resid="GroupHelp.Label" />
<Control xsi:type="Button" id="ButtonHelpId">
<Control xsi:type="Button" id="Read.ButtonHelpId">
<Label resid="ButtonHelp.Label" />
<Supertip>
<Title resid="ButtonHelp.Label" />
Expand Down
72 changes: 65 additions & 7 deletions manifests/production.outlook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<Id>01000000-1000-0000-0000-000000007357</Id>
<Version>1.0.0.0</Version>
<Version>2.0.0.0</Version>
<ProviderName>wandyezj</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Build" />
Expand Down Expand Up @@ -51,11 +51,69 @@
<DesktopFormFactor>
<!-- MessageReadCommandSurface when reading an email,
Compose is when replying to an email -->


<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="GroupExtensionId">
<OfficeTab id="Compose.TabDefaultId">
<Group id="Compose.GroupExtensionId">
<Label resid="GroupExtension.Label" />
<Control xsi:type="Button" id="Compose.ButtonEditId">
<Label resid="ButtonEdit.Label" />
<Supertip>
<Title resid="ButtonEdit.Label" />
<Description resid="ButtonEdit.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Edit.16x16" />
<bt:Image size="32" resid="Icon.Edit.32x32" />
<bt:Image size="80" resid="Icon.Edit.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneEdit.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="Compose.ButtonRunId">
<Label resid="ButtonRun.Label" />
<Supertip>
<Title resid="ButtonRun.Label" />
<Description resid="ButtonRun.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Run.16x16" />
<bt:Image size="32" resid="Icon.Run.32x32" />
<bt:Image size="80" resid="Icon.Run.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRun.Url" />
</Action>
</Control>
</Group>
<Group id="Compose.GroupHelpId">
<Label resid="GroupHelp.Label" />
<Control xsi:type="Button" id="Compose.ButtonHelpId">
<Label resid="ButtonHelp.Label" />
<Supertip>
<Title resid="ButtonHelp.Label" />
<Description resid="ButtonHelp.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.Help.16x16" />
<bt:Image size="32" resid="Icon.Help.32x32" />
<bt:Image size="80" resid="Icon.Help.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneHelp.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>

<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="Read.TabDefaultId">
<Group id="Read.GroupExtensionId">
<Label resid="GroupExtension.Label" />
<Control xsi:type="Button" id="ButtonEditId">
<Control xsi:type="Button" id="Read.ButtonEditId">
<Label resid="ButtonEdit.Label" />
<Supertip>
<Title resid="ButtonEdit.Label" />
Expand All @@ -70,7 +128,7 @@
<SourceLocation resid="TaskpaneEdit.Url" />
</Action>
</Control>
<Control xsi:type="Button" id="ButtonRunId">
<Control xsi:type="Button" id="Read.ButtonRunId">
<Label resid="ButtonRun.Label" />
<Supertip>
<Title resid="ButtonRun.Label" />
Expand All @@ -86,9 +144,9 @@
</Action>
</Control>
</Group>
<Group id="GroupHelpId">
<Group id="Read.GroupHelpId">
<Label resid="GroupHelp.Label" />
<Control xsi:type="Button" id="ButtonHelpId">
<Control xsi:type="Button" id="Read.ButtonHelpId">
<Label resid="ButtonHelp.Label" />
<Supertip>
<Title resid="ButtonHelp.Label" />
Expand Down
5 changes: 3 additions & 2 deletions manifests/template.outlook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<Id>01000000-1000-0000-0000-000000007357</Id>
<Version>1.0.1.0</Version>
<Version>2.0.1.0</Version>
<ProviderName>wandyezj</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="(local) Build" />
Expand Down Expand Up @@ -53,7 +53,7 @@
Compose is when replying to an email -->
<!-- Section:(ExtensionPoint) - Start -->
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<OfficeTab id="TabDefaultId">
<Group id="GroupExtensionId">
<Label resid="GroupExtension.Label" />
<Control xsi:type="Button" id="ButtonEditId">
Expand Down Expand Up @@ -108,6 +108,7 @@
</OfficeTab>
</ExtensionPoint>
<!-- Section:(ExtensionPoint) - End -->
<!-- Duplicate:(ExtensionPoint) Replace:(MessageComposeCommandSurface,MessageComposeCommandSurface) -->
<!-- Duplicate:(ExtensionPoint) Replace:(MessageComposeCommandSurface,MessageReadCommandSurface) -->
</DesktopFormFactor>
</Host>
Expand Down
38 changes: 28 additions & 10 deletions scripts/make-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,38 @@ function localhost(data) {
function localhostOutlook(data) {
const sectionExtensionPoint = "ExtensionPoint";
const duplicate = getSectionContents(sectionExtensionPoint, data);
data = removeSection(sectionExtensionPoint, data);

// Read
let extensionPointRead = duplicate.replace("MessageComposeCommandSurface", "MessageReadCommandSurface");
// Replace Ids with unique equivalent
// Create new section and update ids
function createSection(extensionPointName, prefixId) {
let extensionPointSection = duplicate.replace("MessageComposeCommandSurface", extensionPointName);
// Replace Ids with unique equivalent

const findId = / id="(?<value>.*Id)"/;
const findIdsGlobal = / id="(?<value>.*Id)"/g;
let matches = extensionPointSection.match(findIdsGlobal);

matches.forEach((value) => {
//console.log(value);
const id = value.match(findId).groups["value"];
//console.log(id);
extensionPointSection = extensionPointSection.replace(id, `${prefixId}.${id}`);
});

const findIds = / id="(?<value>.*Id)"/g;
let matches = extensionPointRead.match(findIds);
matches.forEach((value) => {
console.log(value);
});
return extensionPointSection;
}

[`id="TabDefault"`, `id="GroupExtensionId"`, `id="ButtonEditId"`, `id="ButtonRunId"`, `id="ButtonHelpId"`];
// Compose
const extensionPointCompose = createSection("MessageComposeCommandSurface", "Compose");
data = data.replaceAll(
"<!-- Duplicate:(ExtensionPoint) Replace:(MessageComposeCommandSurface,MessageComposeCommandSurface) -->",
extensionPointCompose
);

// Read
const extensionPointRead = createSection("MessageReadCommandSurface", "Read");
data = data.replaceAll(
" <!-- Duplicate:(ExtensionPoint) Replace:(MessageComposeCommandSurface,MessageReadCommandSurface) -->",
"<!-- Duplicate:(ExtensionPoint) Replace:(MessageComposeCommandSurface,MessageReadCommandSurface) -->",
extensionPointRead
);

Expand All @@ -150,6 +167,7 @@ function production(data) {
);

data = data.replaceAll("<Version>1.0.1.0</Version>", "<Version>1.0.0.0</Version>");
data = data.replaceAll("<Version>2.0.1.0</Version>", "<Version>2.0.0.0</Version>");

return clean(data);
}
Expand Down

0 comments on commit 8391fa5

Please sign in to comment.