Skip to content

Commit ec0c5eb

Browse files
authored
Add production manifest & update assets paths (#50)
- Generate new unique GUID. - Add production manifest where we replace `localhost` by the real domain name. - Move assets to `public` folder such that Vite bundles them.
1 parent e61283e commit ec0c5eb

9 files changed

Lines changed: 139 additions & 14 deletions

File tree

.config/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const input = {
99

1010
export default defineConfig(({ command }) => ({
1111
root: "web",
12-
base: "typst-powerpoint/",
12+
base: "/typst-powerpoint/",
1313
build: {
1414
outDir: "../build/",
1515
emptyOutDir: true,

DEV.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Then set `COMPILER_URL=http://localhost:4000/compile` before `npm run dev` so th
6666
## Usage
6767
- Enter Typst code (e.g. `$a^2 + b^2 = c^2$`) and click **Insert / Update** to place an SVG on the current slide.
6868
- Select an existing Typst-generated shape to automatically reload its source into the textbox, edit, and re-run Insert / Update to replace it in place (position preserved).
69-
- Shapes are tagged with `altTextDescription` starting `TYPST:` plus the encoded source; math font is served from `web/assets/math-font.ttf` on the same origin.
69+
- Shapes are tagged with `altTextDescription` starting `TYPST:` plus the encoded source; math font is served from `web/math-font.ttf` on the same origin.
7070
- Remote compiler: if `COMPILER_URL` is set, the add-in POSTs `{ source, format: "svg" }` (with optional bearer auth) to that endpoint and uses the returned `svg`. Local WASM is used only when `COMPILER_URL` is not configured.
7171

7272
## NPM scripts
@@ -78,4 +78,4 @@ Then set `COMPILER_URL=http://localhost:4000/compile` before `npm run dev` so th
7878
## Tips
7979
- If insertion silently fails, check the taskpane console for "Insert failed" or "WASM Load Error."
8080
- Ensure the built `pkg/typst_ppt_engine.js` and `.wasm` file stay in `web/pkg/`.
81-
- Keep the math font available at `/assets/math-font.ttf`.
81+
- Keep the math font available at `/math-font.ttf`.

web/manifest.prod.xml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<OfficeApp
3+
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
6+
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
7+
xsi:type="TaskPaneApp">
8+
9+
<Id>07cdde7e-8401-40b3-82cc-b1e7cf85e7eb</Id>
10+
<Version>1.0.0.0</Version>
11+
<ProviderName>Splines</ProviderName>
12+
<DefaultLocale>en-US</DefaultLocale>
13+
<DisplayName DefaultValue="Typst for PowerPoint" />
14+
<Description DefaultValue="Create and edit Typst equations in PowerPoint." />
15+
<IconUrl DefaultValue="https://splines.github.io/typst-powerpoint/icon-32.png" />
16+
<HighResolutionIconUrl DefaultValue="https://splines.github.io/typst-powerpoint/icon-80.png" />
17+
<SupportUrl DefaultValue="https://github.com/Splines/typst-powerpoint/issues" />
18+
19+
<Hosts>
20+
<Host Name="Presentation" />
21+
</Hosts>
22+
23+
<Requirements>
24+
<Sets DefaultMinVersion="1.1">
25+
<Set Name="SharedRuntime" MinVersion="1.1"/>
26+
</Sets>
27+
</Requirements>
28+
29+
<DefaultSettings>
30+
<SourceLocation DefaultValue="https://splines.github.io/typst-powerpoint/powerpoint.html" />
31+
</DefaultSettings>
32+
33+
<Permissions>ReadWriteDocument</Permissions>
34+
35+
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
36+
<Hosts>
37+
<Host xsi:type="Presentation">
38+
<Runtimes>
39+
<Runtime resid="Taskpane.Url" lifetime="long" />
40+
</Runtimes>
41+
42+
<DesktopFormFactor>
43+
<GetStarted>
44+
<Title resid="GetStarted.Title"/>
45+
<Description resid="GetStarted.Description"/>
46+
<LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
47+
</GetStarted>
48+
<FunctionFile resid="Taskpane.Url" />
49+
50+
<ExtensionPoint xsi:type="PrimaryCommandSurface">
51+
<OfficeTab id="TabInsert">
52+
<Group id="GrpTypstInsert">
53+
54+
<Label resid="Group.Label" />
55+
<Icon>
56+
<bt:Image size="16" resid="Icon.16x16" />
57+
<bt:Image size="32" resid="Icon.32x32" />
58+
<bt:Image size="80" resid="Icon.80x80" />
59+
</Icon>
60+
61+
<Control xsi:type="Button" id="BtnOpenPane">
62+
<Label resid="TaskpaneButton.Label" />
63+
<Supertip>
64+
<Title resid="TaskpaneButton.Label" />
65+
<Description resid="TaskpaneButton.Tooltip" />
66+
</Supertip>
67+
<Icon>
68+
<bt:Image size="16" resid="Icon.16x16" />
69+
<bt:Image size="32" resid="Icon.32x32" />
70+
<bt:Image size="80" resid="Icon.80x80" />
71+
</Icon>
72+
<Action xsi:type="ShowTaskpane">
73+
<TaskpaneId>TypstPane</TaskpaneId>
74+
<SourceLocation resid="Taskpane.Url" />
75+
</Action>
76+
</Control>
77+
78+
<Control xsi:type="Button" id="BtnGenerateFromFile">
79+
<Label resid="GenerateFromFileButton.Label" />
80+
<Supertip>
81+
<Title resid="GenerateFromFileButton.Label" />
82+
<Description resid="GenerateFromFileButton.Tooltip" />
83+
</Supertip>
84+
<Icon>
85+
<bt:Image size="16" resid="Icon.16x16" />
86+
<bt:Image size="32" resid="Icon.32x32" />
87+
<bt:Image size="80" resid="Icon.80x80" />
88+
</Icon>
89+
<Action xsi:type="ExecuteFunction">
90+
<FunctionName>generateFromFile</FunctionName>
91+
</Action>
92+
</Control>
93+
94+
</Group>
95+
</OfficeTab>
96+
</ExtensionPoint>
97+
98+
</DesktopFormFactor>
99+
</Host>
100+
</Hosts>
101+
102+
<Resources>
103+
<bt:Images>
104+
<bt:Image id="Icon.16x16" DefaultValue="https://splines.github.io/typst-powerpoint/icon-16.png" />
105+
<bt:Image id="Icon.32x32" DefaultValue="https://splines.github.io/typst-powerpoint/icon-32.png" />
106+
<bt:Image id="Icon.80x80" DefaultValue="https://splines.github.io/typst-powerpoint/icon-80.png" />
107+
</bt:Images>
108+
<bt:Urls>
109+
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://github.com/Splines/typst-powerpoint" />
110+
<bt:Url id="Taskpane.Url" DefaultValue="https://splines.github.io/typst-powerpoint/index.html" />
111+
</bt:Urls>
112+
<bt:ShortStrings>
113+
<bt:String id="GetStarted.Title" DefaultValue="Get started with Typst!" />
114+
<bt:String id="Group.Label" DefaultValue="Typst" />
115+
<bt:String id="TaskpaneButton.Label" DefaultValue="Typst Editor" />
116+
<bt:String id="GenerateFromFileButton.Label" DefaultValue="Generate from File" />
117+
</bt:ShortStrings>
118+
<bt:LongStrings>
119+
<bt:String id="GetStarted.Description" DefaultValue="This add-in allows you to create and edit Typst equations." />
120+
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Open the Typst for PowerPoint Add-in" />
121+
<bt:String id="GenerateFromFileButton.Tooltip" DefaultValue="Generate Typst formula from an external file" />
122+
</bt:LongStrings>
123+
</Resources>
124+
</VersionOverrides>
125+
</OfficeApp>

web/manifest.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
77
xsi:type="TaskPaneApp">
88

9-
<Id>e6fe8aba-4a8b-4867-9ab5-7bc4e7684810</Id>
9+
<Id>07cdde7e-8401-40b3-82cc-b1e7cf85e7eb</Id>
1010
<Version>1.0.0.0</Version>
11-
<ProviderName>Typst User</ProviderName>
11+
<ProviderName>Splines</ProviderName>
1212
<DefaultLocale>en-US</DefaultLocale>
1313
<DisplayName DefaultValue="Typst for PowerPoint" />
1414
<Description DefaultValue="Create and edit Typst equations in PowerPoint." />
15-
<IconUrl DefaultValue="https://localhost:3155/assets/icon-32.png" />
16-
<HighResolutionIconUrl DefaultValue="https://localhost:3155/assets/icon-80.png" />
17-
<SupportUrl DefaultValue="https://www.typst.app" />
15+
<IconUrl DefaultValue="https://localhost:3155/icon-32.png" />
16+
<HighResolutionIconUrl DefaultValue="https://localhost:3155/icon-80.png" />
17+
<SupportUrl DefaultValue="https://github.com/Splines/typst-powerpoint/issues" />
1818

1919
<Hosts>
2020
<Host Name="Presentation" />
@@ -101,12 +101,12 @@
101101

102102
<Resources>
103103
<bt:Images>
104-
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3155/assets/icon-16.png" />
105-
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3155/assets/icon-32.png" />
106-
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3155/assets/icon-80.png" />
104+
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3155/icon-16.png" />
105+
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3155/icon-32.png" />
106+
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3155/icon-80.png" />
107107
</bt:Images>
108108
<bt:Urls>
109-
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
109+
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://github.com/Splines/typst-powerpoint" />
110110
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3155/index.html" />
111111
</bt:Urls>
112112
<bt:ShortStrings>
@@ -117,7 +117,7 @@
117117
</bt:ShortStrings>
118118
<bt:LongStrings>
119119
<bt:String id="GetStarted.Description" DefaultValue="This add-in allows you to create and edit Typst equations." />
120-
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click into the Typst editor task pane!" />
120+
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Open the Typst for PowerPoint Add-in" />
121121
<bt:String id="GenerateFromFileButton.Tooltip" DefaultValue="Generate Typst formula from an external file" />
122122
</bt:LongStrings>
123123
</Resources>

web/src/typst.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function initCompiler() {
3838
beforeBuild: [
3939
disableDefaultFontAssets(),
4040
loadFonts([
41-
"assets/math-font.ttf",
41+
"/math-font.ttf",
4242
]),
4343
],
4444
});

0 commit comments

Comments
 (0)