@fluid-topics/ft-reader-context 2.0.32 → 2.0.34

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.
@@ -311,6 +311,7 @@ export class FtReaderStateManager {
311
311
  return targetUrl;
312
312
  }
313
313
  sendDocumentOnDemandTranslateEvent(destinationLanguage) {
314
+ var _a;
314
315
  const { editorMode, apiIntegrationIdentifier, apiIntegrationAppVersion } = ftAppInfoStore.getState();
315
316
  const state = this.store.getState();
316
317
  const map = state.map;
@@ -320,6 +321,11 @@ export class FtReaderStateManager {
320
321
  }
321
322
  try {
322
323
  const document = this.analyticsEventsService.convertMapToAnalyticsDocument(map);
324
+ // Use untranslated title for source language analytics
325
+ const documentWithOriginalTitle = {
326
+ ...document,
327
+ title: (_a = map.untranslatedTitle) !== null && _a !== void 0 ? _a : map.title,
328
+ };
323
329
  this.analyticsEventsService.sendDocumentOnDemandTranslateEvent({
324
330
  name: "DOCUMENT__ON_DEMAND_TRANSLATE",
325
331
  offline: false,
@@ -328,7 +334,7 @@ export class FtReaderStateManager {
328
334
  sourceLanguage: this.parseLanguageToAnalyticsFormat(map.lang),
329
335
  destinationLanguage: this.parseLanguageToAnalyticsFormat(destinationLanguage.code),
330
336
  profileId,
331
- document,
337
+ document: documentWithOriginalTitle,
332
338
  translationOrigin: FtAnalyticsTranslationOrigin.AI,
333
339
  });
334
340
  }
@@ -337,6 +343,7 @@ export class FtReaderStateManager {
337
343
  }
338
344
  }
339
345
  sendTopicAiTranslateEvent(destinationLanguage, tocNode) {
346
+ var _a;
340
347
  const { editorMode, apiIntegrationIdentifier, apiIntegrationAppVersion } = ftAppInfoStore.getState();
341
348
  const state = this.store.getState();
342
349
  const map = state.map;
@@ -351,6 +358,11 @@ export class FtReaderStateManager {
351
358
  return;
352
359
  }
353
360
  const document = this.analyticsEventsService.convertMapToAnalyticsDocument(map);
361
+ // Use untranslated titles for source language analytics
362
+ const documentWithOriginalTitle = {
363
+ ...document,
364
+ title: (_a = map.untranslatedTitle) !== null && _a !== void 0 ? _a : map.title,
365
+ };
354
366
  this.analyticsEventsService.sendTopicAiTranslateEvent({
355
367
  name: "TOPIC__AI_TRANSLATE",
356
368
  offline: false,
@@ -358,11 +370,14 @@ export class FtReaderStateManager {
358
370
  appVersion: apiIntegrationAppVersion,
359
371
  sourceLanguage: this.parseLanguageToAnalyticsFormat(map.lang),
360
372
  destinationLanguage: this.parseLanguageToAnalyticsFormat(destinationLanguage),
361
- breadcrumb: breadcrumb.map((item) => ({
362
- tocId: item.tocId,
363
- title: item.title,
364
- })),
365
- document,
373
+ breadcrumb: breadcrumb.map((item) => {
374
+ var _a;
375
+ return ({
376
+ tocId: item.tocId,
377
+ title: (_a = item.untranslatedTitle) !== null && _a !== void 0 ? _a : item.title,
378
+ });
379
+ }),
380
+ document: documentWithOriginalTitle,
366
381
  profileId,
367
382
  });
368
383
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-context",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "description": "Context block for integrated reader components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "2.0.32",
23
- "@fluid-topics/ft-wc-utils": "2.0.32",
24
- "@reduxjs/toolkit": "^1.6.2",
22
+ "@fluid-topics/ft-app-context": "2.0.34",
23
+ "@fluid-topics/ft-wc-utils": "2.0.34",
25
24
  "lit": "3.1.0"
26
25
  },
27
26
  "devDependencies": {
28
27
  "@fluid-topics/public-api": "1.0.123"
29
28
  },
30
- "gitHead": "7b9fd05cccbb50a04b9639b26e2d958ca494c83e"
29
+ "gitHead": "4d4baba1c07ce52b8763655aaeacc33a9c4ac9b8"
31
30
  }