<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
  Add-in only ("classic") XML manifest for Valoon for Outlook.

  Two things here are generated at build time by webpack.config.js and must not
  be hand-edited:

    * <Version> — the 0.0.0.0 below is a placeholder. Office requires a
      four-part version, release-please writes three-part semver into
      package.json, so the build injects "<package.json version>.0".
    * https://outlook.valoon.crucerlabs.com/ — rewritten to the production origin on a
      production build. Editing the URLs here breaks `npm run dev-server`.

  Everything else is load-bearing for Marketplace validation; see
  CONTRIBUTING.md before changing <Permissions>, <SupportUrl> or the icons.
-->
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
  <Id>05c2e1c9-3e1d-406e-9a91-e9ac64854143</Id>
  <Version>1.1.0.0</Version>
  <ProviderName>Valoon GmbH</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Valoon"/>
  <Description DefaultValue="Create a Valoon ticket from an email without leaving Outlook. The subject becomes the title and the body becomes the description."/>
  <IconUrl DefaultValue="https://outlook.valoon.crucerlabs.com/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://outlook.valoon.crucerlabs.com/assets/icon-128.png"/>
  <!-- Must resolve publicly with no authentication: Microsoft's validators
       fetch it, and a 404 fails submission. This service serves it itself. -->
  <SupportUrl DefaultValue="https://outlook.valoon.crucerlabs.com/support"/>
  <!-- No <AppDomains>: the task pane, the sign-in dialog and the API are all
       one origin, and the sign-up link opens in the system browser rather than
       navigating the pane. -->
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <!-- Mailbox 1.5 is not a conservative guess, it is the ceiling that keeps
       on-premises customers in scope: Exchange 2016, 2019 and Subscription
       Edition all top out at 1.5. Requiring more would silently exclude every
       on-premises tenant. It also covers Body.getAsync (1.3) and
       SupportsPinning (1.5).

       The Dialog API is a *separate* requirement set (DialogApi), not part of
       Mailbox, and it is deliberately not required here — some supported
       clients lack it, so the sign-in flow feature-detects it and falls back
       to an in-pane form. See src/taskpane/components/SignInGate.tsx. -->
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.5" />
    </Sets>
  </Requirements>
  <!-- Required for validation, ignored because <VersionOverrides> is present. -->
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://outlook.valoon.crucerlabs.com/taskpane.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <!-- ReadItem and nothing more. The add-in only reads the open message to
       prefill the form. Widening this forces every customer's admin to
       re-consent, so it is a deliberate decision, not a convenience. -->
  <Permissions>ReadItem</Permissions>
  <!-- Required for validation, ignored because <VersionOverrides> is present. -->
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <!-- No <MobileFormFactor>: mobile needs its own layout, and Outlook
               on Android and iOS do not support the Dialog API at all. A
               deliberate omission for this release, not an oversight. -->
          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url" />
            <!-- Read surface: the add-in turns a received email into a ticket. -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="msgReadGroup">
                  <Label resid="GroupLabel" />
                  <Control xsi:type="Button" id="msgReadOpenPaneButton">
                    <Label resid="TaskpaneButton.Label" />
                    <Supertip>
                      <Title resid="TaskpaneButton.Label" />
                      <Description resid="TaskpaneButton.Tooltip" />
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16x16" />
                      <bt:Image size="32" resid="Icon.32x32" />
                      <bt:Image size="80" resid="Icon.80x80" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url" />
                      <!-- Lets the user pin the pane open while moving between
                           messages, which is the whole point when filing
                           several emails in a row. -->
                      <SupportsPinning>true</SupportsPinning>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://outlook.valoon.crucerlabs.com/assets/icon-16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://outlook.valoon.crucerlabs.com/assets/icon-32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://outlook.valoon.crucerlabs.com/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Commands.Url" DefaultValue="https://outlook.valoon.crucerlabs.com/commands.html" />
          <bt:Url id="Taskpane.Url" DefaultValue="https://outlook.valoon.crucerlabs.com/taskpane.html" />
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="Valoon"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="Create ticket"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Create a Valoon ticket from this email."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
