@bobfrankston/rmfmail 1.2.162 → 1.2.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/android-bootstrap.bundle.js.map +2 -2
- package/client/app.bundle.js +34 -18
- package/client/app.bundle.js.map +2 -2
- package/client/components/calendar-sidebar.js +45 -20
- package/client/components/calendar-sidebar.js.map +1 -1
- package/client/components/calendar-sidebar.ts +41 -16
- package/client/compose/compose.bundle.js.map +1 -1
- package/client/lib/api-client.ts +1 -1
- package/package.json +5 -5
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-service/index.d.ts +8 -0
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +172 -5
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +159 -5
- package/packages/mailx-service/package.json +1 -1
- package/packages/mailx-settings/docs/annotation-registry.md +74 -0
- package/packages/mailx-settings/package.json +1 -1
- package/packages/mailx-store/package.json +1 -1
- package/packages/mailx-store-web/package.json +1 -1
- package/packages/mailx-types/index.d.ts +8 -1
- package/packages/mailx-types/index.d.ts.map +1 -1
- package/packages/mailx-types/index.js.map +1 -1
- package/packages/mailx-types/index.ts +8 -1
- package/packages/mailx-types/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-60824 → node_modules.npmglobalize-stash-10468}/.package-lock.json +0 -0
package/client/app.bundle.js
CHANGED
|
@@ -5605,6 +5605,7 @@ function openNewEventDialog() {
|
|
|
5605
5605
|
createBtn.click();
|
|
5606
5606
|
}
|
|
5607
5607
|
});
|
|
5608
|
+
let asTextMode = false;
|
|
5608
5609
|
createBtn.addEventListener("click", async () => {
|
|
5609
5610
|
const text = ta.value.trim();
|
|
5610
5611
|
if (!text) {
|
|
@@ -5614,26 +5615,39 @@ function openNewEventDialog() {
|
|
|
5614
5615
|
createBtn.disabled = true;
|
|
5615
5616
|
cancelBtn.disabled = true;
|
|
5616
5617
|
status.textContent = "Parsing\u2026";
|
|
5617
|
-
let
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5618
|
+
let events = [];
|
|
5619
|
+
if (!asTextMode) {
|
|
5620
|
+
try {
|
|
5621
|
+
const { aiTransform: aiTransform2 } = await Promise.resolve().then(() => (init_api_client(), api_client_exports));
|
|
5622
|
+
const r = await aiTransform2({
|
|
5623
|
+
action: "extractEvent",
|
|
5624
|
+
text,
|
|
5625
|
+
nowISO: (/* @__PURE__ */ new Date()).toISOString()
|
|
5626
|
+
});
|
|
5627
|
+
events = r?.events || (r?.event ? [r.event] : []);
|
|
5628
|
+
if (events.length === 0) {
|
|
5629
|
+
status.textContent = `AI parse failed${r?.reason ? `: ${r.reason}` : ""}.`;
|
|
5630
|
+
}
|
|
5631
|
+
} catch (e) {
|
|
5632
|
+
status.textContent = `AI call failed: ${e.message}`;
|
|
5633
|
+
}
|
|
5634
|
+
if (events.length === 0) {
|
|
5635
|
+
createBtn.textContent = "Create as text";
|
|
5636
|
+
createBtn.disabled = false;
|
|
5637
|
+
cancelBtn.disabled = false;
|
|
5638
|
+
asTextMode = true;
|
|
5639
|
+
return;
|
|
5640
|
+
}
|
|
5630
5641
|
}
|
|
5631
|
-
const url = buildGoogleEventUrl(event, text);
|
|
5632
5642
|
const api = window.mailxapi;
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5643
|
+
const targets = events.length ? events : [null];
|
|
5644
|
+
for (const ev of targets) {
|
|
5645
|
+
const url = buildGoogleEventUrl(ev, text);
|
|
5646
|
+
if (api?.openExternal)
|
|
5647
|
+
api.openExternal(url);
|
|
5648
|
+
else
|
|
5649
|
+
window.open(url, "_blank");
|
|
5650
|
+
}
|
|
5637
5651
|
close();
|
|
5638
5652
|
});
|
|
5639
5653
|
}
|
|
@@ -5670,6 +5684,8 @@ function buildGoogleEventUrl(event, fallbackText) {
|
|
|
5670
5684
|
params.push(`location=${encodeURIComponent(event.location)}`);
|
|
5671
5685
|
if (event?.notes)
|
|
5672
5686
|
params.push(`details=${encodeURIComponent(event.notes)}`);
|
|
5687
|
+
if (event?.timeZone)
|
|
5688
|
+
params.push(`ctz=${encodeURIComponent(event.timeZone)}`);
|
|
5673
5689
|
return `${base}&${params.join("&")}`;
|
|
5674
5690
|
}
|
|
5675
5691
|
async function showCalendarSidebar() {
|