generaltranslation 9.0.2 → 9.0.4

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/derive/condenseVars.js +2 -3
  3. package/dist/derive/utils/traverseHelpers.d.ts +1 -1
  4. package/dist/derive/utils/traverseHelpers.js +1 -1
  5. package/dist/derive/utils/traverseIcu.d.ts +1 -1
  6. package/dist/derive/utils/traverseIcu.js +1 -1
  7. package/dist/derive/utils/types.d.ts +1 -1
  8. package/dist/{derive-BvtWyo5B.cjs → derive-Cbl7M1SY.cjs} +7 -7
  9. package/dist/derive-Cbl7M1SY.cjs.map +1 -0
  10. package/dist/{derive-ClAsLQOX.mjs → derive-DDwuyrKI.mjs} +2 -2
  11. package/dist/derive-DDwuyrKI.mjs.map +1 -0
  12. package/dist/id.d.cts +1 -1
  13. package/dist/id.d.mts +1 -1
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/internal.cjs +4 -97
  19. package/dist/internal.cjs.map +1 -1
  20. package/dist/internal.d.cts +1 -1
  21. package/dist/internal.d.mts +1 -1
  22. package/dist/internal.mjs +3 -96
  23. package/dist/internal.mjs.map +1 -1
  24. package/dist/{runtime-WSpZppgm.mjs → runtime-DsKdTOSO.mjs} +2 -2
  25. package/dist/{runtime-WSpZppgm.mjs.map → runtime-DsKdTOSO.mjs.map} +1 -1
  26. package/dist/{runtime-wK7jzE9f.cjs → runtime-mKpF6P4Q.cjs} +2 -2
  27. package/dist/{runtime-wK7jzE9f.cjs.map → runtime-mKpF6P4Q.cjs.map} +1 -1
  28. package/dist/runtime.cjs +1 -1
  29. package/dist/runtime.d.cts +2 -2
  30. package/dist/runtime.d.mts +2 -2
  31. package/dist/runtime.d.ts +1 -1
  32. package/dist/runtime.js +3 -3
  33. package/dist/runtime.mjs +1 -1
  34. package/dist/types-dir/config.d.ts +60 -0
  35. package/dist/types-dir/config.js +1 -0
  36. package/dist/{types-CzFzXgUO.d.mts → types-iO493WgK.d.mts} +62 -3
  37. package/dist/{types-iLf0drw8.d.cts → types-wj-Dtih8.d.cts} +62 -3
  38. package/dist/types.d.cts +2 -2
  39. package/dist/types.d.mts +2 -2
  40. package/dist/types.d.ts +1 -0
  41. package/package.json +3 -4
  42. package/dist/derive/utils/printIcuAst.d.ts +0 -12
  43. package/dist/derive/utils/printIcuAst.js +0 -138
  44. package/dist/derive-BvtWyo5B.cjs.map +0 -1
  45. package/dist/derive-ClAsLQOX.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Content, CustomMapping as CustomMapping$1, CustomRegionMapping as CustomRegionMapping$1, CutoffFormatOptions as CutoffFormatOptions$1, DataFormat, DataFormat as DataFormat$1, FormatVariables as FormatVariables$1, GTProp, HTML_CONTENT_PROPS, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, I18nextMessage as I18nextMessage$1, IcuMessage, IcuMessage as IcuMessage$1, JsxChild, JsxChildren, JsxChildren as JsxChildren$1, JsxElement, LocaleProperties as LocaleProperties$1, StringContent, StringFormat as StringFormat$1, StringMessage, StringMessage as StringMessage$1, Variable, VariableType } from "@generaltranslation/format/types";
1
+ import { Content, CustomMapping, CustomMapping as CustomMapping$1, CustomRegionMapping as CustomRegionMapping$1, CutoffFormatOptions as CutoffFormatOptions$1, DataFormat, DataFormat as DataFormat$1, FormatVariables as FormatVariables$1, GTProp, HTML_CONTENT_PROPS, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, I18nextMessage as I18nextMessage$1, IcuMessage, IcuMessage as IcuMessage$1, JsxChild, JsxChildren, JsxChildren as JsxChildren$1, JsxElement, LocaleProperties as LocaleProperties$1, StringContent, StringFormat as StringFormat$1, StringMessage, StringMessage as StringMessage$1, Variable, VariableType } from "@generaltranslation/format/types";
2
2
 
3
3
  //#region src/types-dir/api/entry.d.ts
4
4
  /**
@@ -54,6 +54,65 @@ type HashMetadata = {
54
54
  dataFormat?: DataFormat;
55
55
  };
56
56
  //#endregion
57
+ //#region src/types-dir/config.d.ts
58
+ /**
59
+ * Options shared by the CLI, compiler, and runtimes under
60
+ * `files.gt.parsingFlags` in gt.config.json.
61
+ */
62
+ type GTParsingFlags = {
63
+ autoderive?: boolean | {
64
+ jsx?: boolean;
65
+ strings?: boolean;
66
+ };
67
+ includeSourceCodeContext?: boolean;
68
+ enableAutoJsxInjection?: boolean;
69
+ legacyGtReactImportSource?: boolean;
70
+ devHotReload?: boolean | {
71
+ strings?: boolean;
72
+ jsx?: boolean;
73
+ };
74
+ };
75
+ /** Configuration for generated GT translation files. */
76
+ type GTOutputFileConfig = {
77
+ output?: string;
78
+ publish?: boolean;
79
+ parsingFlags?: GTParsingFlags; /** @deprecated Use `parsingFlags.includeSourceCodeContext` instead. */
80
+ includeSourceCodeContext?: boolean;
81
+ };
82
+ /**
83
+ * File configuration is primarily consumed by the CLI. Other packages only
84
+ * inspect `files.gt`, but must still accept the complete gt.config.json shape.
85
+ */
86
+ type GTFilesConfig = {
87
+ gt?: GTOutputFileConfig;
88
+ [fileType: string]: unknown;
89
+ };
90
+ /**
91
+ * The configuration stored in gt.config.json.
92
+ *
93
+ * All settings are optional. Runtimes default `defaultLocale` to
94
+ * `libraryDefaultLocale` and `locales` to an empty list before resolving the
95
+ * effective locale set.
96
+ */
97
+ type GTConfig = {
98
+ defaultLocale?: string;
99
+ locales?: string[];
100
+ customMapping?: CustomMapping;
101
+ enableI18n?: boolean; /** Enable framework-provided locale path routing when supported. */
102
+ localeRouting?: boolean;
103
+ projectId?: string;
104
+ devApiKey?: string;
105
+ apiKey?: string;
106
+ _versionId?: string;
107
+ _branchId?: string;
108
+ cacheUrl?: string | null;
109
+ cacheExpiryTime?: number;
110
+ runtimeUrl?: string | null;
111
+ modelProvider?: string;
112
+ _disableDevHotReload?: boolean;
113
+ files?: GTFilesConfig;
114
+ };
115
+ //#endregion
57
116
  //#region src/types-dir/api/json.d.ts
58
117
  type JsonPrimitive = string | number | boolean | null;
59
118
  type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
@@ -552,5 +611,5 @@ type TranslationRequestConfig = {
552
611
  apiKey?: string;
553
612
  };
554
613
  //#endregion
555
- export { UploadFilesOptions as $, AwaitJobsOptions as A, OrphanedFile as B, VariableType as C, HashMetadata as Ct, VariableTransformationSuffix as D, TranslateManyEntry as Dt, TransformationPrefix as E, RuntimeTranslateManyOptions as Et, MoveMapping as F, TranslateManyResult as G, FileDataResult as H, MoveResult as I, TranslationResultReference as J, TranslationError as K, ProcessMovesOptions as L, JobResult as M, CheckJobStatusResult as N, SubmitUserEditDiff as O, TranslateOptions as Ot, JobStatus as P, FileUpload as Q, ProcessMovesResponse as R, Variable as S, JsonValue as St, Transformation as T, EntryMetadata as Tt, BranchQuery as U, FileDataQuery as V, BranchDataResult as W, PublishFileEntry as X, DownloadFileOptions as Y, PublishFilesResult as Z, Metadata as _, CheckFileTranslationsOptions as _t, DataFormat$1 as a, CreateTagResult as at, StringMessage$1 as b, JsonObject as bt, HTML_CONTENT_PROPS as c, DownloadFileBatchRequest as ct, I18nextMessage$1 as d, FileFormat as dt, UploadFilesResponse as et, IcuMessage$1 as f, FileReference as ft, LocaleProperties$1 as g, Updates as gt, JsxElement as h, EnqueueFilesResult as ht, CutoffFormatOptions$1 as i, CreateTagOptions as it, AwaitJobsResult as j, SubmitUserEditDiffsPayload as k, HtmlContentPropKeysRecord as l, DownloadFileBatchResult as lt, JsxChildren$1 as m, FileToUpload as mt, CustomMapping$1 as n, SetupProjectOptions as nt, FormatVariables$1 as o, EnqueueFilesOptions as ot, JsxChild as p, FileReferenceIds as pt, TranslationResult as q, CustomRegionMapping$1 as r, SetupProjectResult as rt, GTProp as s, DownloadFileBatchOptions as st, Content as t, SetupProjectFileReference as tt, HtmlContentPropValuesRecord as u, DownloadedFile as ut, StringContent as v, FileQuery as vt, InjectionType as w, ActionType as wt, TranslationRequestConfig as x, JsonPrimitive as xt, StringFormat$1 as y, FileQueryResult as yt, GetOrphanedFilesResult as z };
556
- //# sourceMappingURL=types-iLf0drw8.d.cts.map
614
+ export { UploadFilesOptions as $, AwaitJobsOptions as A, RuntimeTranslateManyOptions as At, OrphanedFile as B, VariableType as C, GTConfig as Ct, VariableTransformationSuffix as D, HashMetadata as Dt, TransformationPrefix as E, GTParsingFlags as Et, MoveMapping as F, TranslateManyResult as G, FileDataResult as H, MoveResult as I, TranslationResultReference as J, TranslationError as K, ProcessMovesOptions as L, JobResult as M, TranslateOptions as Mt, CheckJobStatusResult as N, SubmitUserEditDiff as O, ActionType as Ot, JobStatus as P, FileUpload as Q, ProcessMovesResponse as R, Variable as S, JsonValue as St, Transformation as T, GTOutputFileConfig as Tt, BranchQuery as U, FileDataQuery as V, BranchDataResult as W, PublishFileEntry as X, DownloadFileOptions as Y, PublishFilesResult as Z, Metadata as _, CheckFileTranslationsOptions as _t, DataFormat$1 as a, CreateTagResult as at, StringMessage$1 as b, JsonObject as bt, HTML_CONTENT_PROPS as c, DownloadFileBatchRequest as ct, I18nextMessage$1 as d, FileFormat as dt, UploadFilesResponse as et, IcuMessage$1 as f, FileReference as ft, LocaleProperties$1 as g, Updates as gt, JsxElement as h, EnqueueFilesResult as ht, CutoffFormatOptions$1 as i, CreateTagOptions as it, AwaitJobsResult as j, TranslateManyEntry as jt, SubmitUserEditDiffsPayload as k, EntryMetadata as kt, HtmlContentPropKeysRecord as l, DownloadFileBatchResult as lt, JsxChildren$1 as m, FileToUpload as mt, CustomMapping$1 as n, SetupProjectOptions as nt, FormatVariables$1 as o, EnqueueFilesOptions as ot, JsxChild as p, FileReferenceIds as pt, TranslationResult as q, CustomRegionMapping$1 as r, SetupProjectResult as rt, GTProp as s, DownloadFileBatchOptions as st, Content as t, SetupProjectFileReference as tt, HtmlContentPropValuesRecord as u, DownloadedFile as ut, StringContent as v, FileQuery as vt, InjectionType as w, GTFilesConfig as wt, TranslationRequestConfig as x, JsonPrimitive as xt, StringFormat$1 as y, FileQueryResult as yt, GetOrphanedFilesResult as z };
615
+ //# sourceMappingURL=types-wj-Dtih8.d.cts.map
package/dist/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as AwaitJobsOptions, B as OrphanedFile, C as VariableType, Ct as HashMetadata, D as VariableTransformationSuffix, Dt as TranslateManyEntry, E as TransformationPrefix, F as MoveMapping, G as TranslateManyResult, H as FileDataResult, I as MoveResult, J as TranslationResultReference, K as TranslationError, L as ProcessMovesOptions, M as JobResult, N as CheckJobStatusResult, O as SubmitUserEditDiff, P as JobStatus, Q as FileUpload, R as ProcessMovesResponse, S as Variable, St as JsonValue, T as Transformation, Tt as EntryMetadata, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _ as Metadata, _t as CheckFileTranslationsOptions, a as DataFormat, at as CreateTagResult, b as StringMessage, bt as JsonObject, c as HTML_CONTENT_PROPS, d as I18nextMessage, dt as FileFormat, f as IcuMessage, ft as FileReference, g as LocaleProperties, gt as Updates, h as JsxElement, ht as EnqueueFilesResult, i as CutoffFormatOptions, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, l as HtmlContentPropKeysRecord, lt as DownloadFileBatchResult, m as JsxChildren, mt as FileToUpload, n as CustomMapping, o as FormatVariables, ot as EnqueueFilesOptions, p as JsxChild, q as TranslationResult, r as CustomRegionMapping, s as GTProp, st as DownloadFileBatchOptions, t as Content, tt as SetupProjectFileReference, u as HtmlContentPropValuesRecord, ut as DownloadedFile, v as StringContent, w as InjectionType, wt as ActionType, x as TranslationRequestConfig, xt as JsonPrimitive, y as StringFormat, z as GetOrphanedFilesResult } from "./types-iLf0drw8.cjs";
2
- export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, CreateTagOptions, CreateTagResult, CustomMapping, CustomRegionMapping, CutoffFormatOptions, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, InjectionType, JobResult, JobStatus, JsonObject, JsonPrimitive, JsonValue, JsxChild, JsxChildren, JsxElement, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, SetupProjectFileReference, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, Updates, Variable, VariableTransformationSuffix, VariableType };
1
+ import { A as AwaitJobsOptions, B as OrphanedFile, C as VariableType, Ct as GTConfig, D as VariableTransformationSuffix, Dt as HashMetadata, E as TransformationPrefix, Et as GTParsingFlags, F as MoveMapping, G as TranslateManyResult, H as FileDataResult, I as MoveResult, J as TranslationResultReference, K as TranslationError, L as ProcessMovesOptions, M as JobResult, N as CheckJobStatusResult, O as SubmitUserEditDiff, Ot as ActionType, P as JobStatus, Q as FileUpload, R as ProcessMovesResponse, S as Variable, St as JsonValue, T as Transformation, Tt as GTOutputFileConfig, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _ as Metadata, _t as CheckFileTranslationsOptions, a as DataFormat, at as CreateTagResult, b as StringMessage, bt as JsonObject, c as HTML_CONTENT_PROPS, d as I18nextMessage, dt as FileFormat, f as IcuMessage, ft as FileReference, g as LocaleProperties, gt as Updates, h as JsxElement, ht as EnqueueFilesResult, i as CutoffFormatOptions, it as CreateTagOptions, j as AwaitJobsResult, jt as TranslateManyEntry, k as SubmitUserEditDiffsPayload, kt as EntryMetadata, l as HtmlContentPropKeysRecord, lt as DownloadFileBatchResult, m as JsxChildren, mt as FileToUpload, n as CustomMapping, o as FormatVariables, ot as EnqueueFilesOptions, p as JsxChild, q as TranslationResult, r as CustomRegionMapping, s as GTProp, st as DownloadFileBatchOptions, t as Content, tt as SetupProjectFileReference, u as HtmlContentPropValuesRecord, ut as DownloadedFile, v as StringContent, w as InjectionType, wt as GTFilesConfig, x as TranslationRequestConfig, xt as JsonPrimitive, y as StringFormat, z as GetOrphanedFilesResult } from "./types-wj-Dtih8.cjs";
2
+ export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, CreateTagOptions, CreateTagResult, CustomMapping, CustomRegionMapping, CutoffFormatOptions, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileUpload, FormatVariables, GTConfig, GTFilesConfig, GTOutputFileConfig, GTParsingFlags, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, InjectionType, JobResult, JobStatus, JsonObject, JsonPrimitive, JsonValue, JsxChild, JsxChildren, JsxElement, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, SetupProjectFileReference, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, Updates, Variable, VariableTransformationSuffix, VariableType };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as AwaitJobsOptions, B as OrphanedFile, C as VariableType, Ct as HashMetadata, D as VariableTransformationSuffix, Dt as TranslateManyEntry, E as TransformationPrefix, F as MoveMapping, G as TranslateManyResult, H as FileDataResult, I as MoveResult, J as TranslationResultReference, K as TranslationError, L as ProcessMovesOptions, M as JobResult, N as CheckJobStatusResult, O as SubmitUserEditDiff, P as JobStatus, Q as FileUpload, R as ProcessMovesResponse, S as Variable, St as JsonValue, T as Transformation, Tt as EntryMetadata, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _ as Metadata, _t as CheckFileTranslationsOptions, a as DataFormat, at as CreateTagResult, b as StringMessage, bt as JsonObject, c as HTML_CONTENT_PROPS, d as I18nextMessage, dt as FileFormat, f as IcuMessage, ft as FileReference, g as LocaleProperties, gt as Updates, h as JsxElement, ht as EnqueueFilesResult, i as CutoffFormatOptions, it as CreateTagOptions, j as AwaitJobsResult, k as SubmitUserEditDiffsPayload, l as HtmlContentPropKeysRecord, lt as DownloadFileBatchResult, m as JsxChildren, mt as FileToUpload, n as CustomMapping, o as FormatVariables, ot as EnqueueFilesOptions, p as JsxChild, q as TranslationResult, r as CustomRegionMapping, s as GTProp, st as DownloadFileBatchOptions, t as Content, tt as SetupProjectFileReference, u as HtmlContentPropValuesRecord, ut as DownloadedFile, v as StringContent, w as InjectionType, wt as ActionType, x as TranslationRequestConfig, xt as JsonPrimitive, y as StringFormat, z as GetOrphanedFilesResult } from "./types-CzFzXgUO.mjs";
2
- export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, CreateTagOptions, CreateTagResult, CustomMapping, CustomRegionMapping, CutoffFormatOptions, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, InjectionType, JobResult, JobStatus, JsonObject, JsonPrimitive, JsonValue, JsxChild, JsxChildren, JsxElement, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, SetupProjectFileReference, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, Updates, Variable, VariableTransformationSuffix, VariableType };
1
+ import { A as AwaitJobsOptions, B as OrphanedFile, C as VariableType, Ct as GTConfig, D as VariableTransformationSuffix, Dt as HashMetadata, E as TransformationPrefix, Et as GTParsingFlags, F as MoveMapping, G as TranslateManyResult, H as FileDataResult, I as MoveResult, J as TranslationResultReference, K as TranslationError, L as ProcessMovesOptions, M as JobResult, N as CheckJobStatusResult, O as SubmitUserEditDiff, Ot as ActionType, P as JobStatus, Q as FileUpload, R as ProcessMovesResponse, S as Variable, St as JsonValue, T as Transformation, Tt as GTOutputFileConfig, U as BranchQuery, V as FileDataQuery, W as BranchDataResult, X as PublishFileEntry, Y as DownloadFileOptions, Z as PublishFilesResult, _ as Metadata, _t as CheckFileTranslationsOptions, a as DataFormat, at as CreateTagResult, b as StringMessage, bt as JsonObject, c as HTML_CONTENT_PROPS, d as I18nextMessage, dt as FileFormat, f as IcuMessage, ft as FileReference, g as LocaleProperties, gt as Updates, h as JsxElement, ht as EnqueueFilesResult, i as CutoffFormatOptions, it as CreateTagOptions, j as AwaitJobsResult, jt as TranslateManyEntry, k as SubmitUserEditDiffsPayload, kt as EntryMetadata, l as HtmlContentPropKeysRecord, lt as DownloadFileBatchResult, m as JsxChildren, mt as FileToUpload, n as CustomMapping, o as FormatVariables, ot as EnqueueFilesOptions, p as JsxChild, q as TranslationResult, r as CustomRegionMapping, s as GTProp, st as DownloadFileBatchOptions, t as Content, tt as SetupProjectFileReference, u as HtmlContentPropValuesRecord, ut as DownloadedFile, v as StringContent, w as InjectionType, wt as GTFilesConfig, x as TranslationRequestConfig, xt as JsonPrimitive, y as StringFormat, z as GetOrphanedFilesResult } from "./types-iO493WgK.mjs";
2
+ export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, CreateTagOptions, CreateTagResult, CustomMapping, CustomRegionMapping, CutoffFormatOptions, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileUpload, FormatVariables, GTConfig, GTFilesConfig, GTOutputFileConfig, GTParsingFlags, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, InjectionType, JobResult, JobStatus, JsonObject, JsonPrimitive, JsonValue, JsxChild, JsxChildren, JsxElement, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, SetupProjectFileReference, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, Updates, Variable, VariableTransformationSuffix, VariableType };
package/dist/types.d.ts CHANGED
@@ -3,6 +3,7 @@ export { HTML_CONTENT_PROPS } from '@generaltranslation/format/types';
3
3
  export type { Content, CustomMapping, CustomRegionMapping, CutoffFormatOptions, DataFormat, FormatVariables, GTProp, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, JsxChild, JsxChildren, JsxElement, LocaleProperties, StringContent, StringFormat, StringMessage, Variable, VariableType, } from '@generaltranslation/format/types';
4
4
  export type { ActionType as EntryActionType, EntryMetadata, TranslateManyEntry, } from './types-dir/api/entry';
5
5
  export type { HashMetadata } from './id/types';
6
+ export type { GTConfig, GTFilesConfig, GTOutputFileConfig, GTParsingFlags, } from './types-dir/config';
6
7
  export type { JsonObject, JsonPrimitive, JsonValue, } from './types-dir/api/json';
7
8
  export type { CheckFileTranslationsOptions } from './types-dir/api/checkFileTranslations';
8
9
  export type { DownloadFileBatchOptions, DownloadFileBatchResult, } from './types-dir/api/downloadFileBatch';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "9.0.2",
3
+ "version": "9.0.4",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,6 @@
32
32
  "homepage": "https://generaltranslation.com/",
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.13.5",
35
- "intl-messageformat": "^10.7.16",
36
35
  "tsdown": "^0.21.10",
37
36
  "typescript": "^5.9.2"
38
37
  },
@@ -40,9 +39,9 @@
40
39
  "definition": "dist/index.d.cts"
41
40
  },
42
41
  "dependencies": {
43
- "@formatjs/icu-messageformat-parser": "^2.11.4",
44
42
  "@noble/hashes": "^2.2.0",
45
- "@generaltranslation/format": "0.1.2"
43
+ "@generaltranslation/icu": "0.1.0",
44
+ "@generaltranslation/format": "0.1.3"
46
45
  },
47
46
  "exports": {
48
47
  ".": {
@@ -1,12 +0,0 @@
1
- import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
- /**
3
- * Local copy of FormatJS `printAST` (see the license header above). The
4
- * published printer subpath is CommonJS-only, which browsers and Vite-based
5
- * dev servers (e.g. TanStack Start) cannot load from our ESM build, and the
6
- * package's ESM variant uses extensionless relative imports that fail Node
7
- * resolution.
8
- *
9
- * Output must stay byte-identical to FormatJS `printAST` because condensed
10
- * ICU strings feed into hashing.
11
- */
12
- export declare function printIcuAst(ast: MessageFormatElement[]): string;
@@ -1,138 +0,0 @@
1
- // The code in this file is adapted from the FormatJS printer,
2
- // https://github.com/formatjs/formatjs/blob/main/packages/icu-messageformat-parser/printer.ts
3
- // (published as `@formatjs/icu-messageformat-parser/printer.js`)
4
- // And is therefore MIT licensed
5
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
6
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
7
- if (ar || !(i in from)) {
8
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
9
- ar[i] = from[i];
10
- }
11
- }
12
- return to.concat(ar || Array.prototype.slice.call(from));
13
- };
14
- /*!
15
- MIT License
16
-
17
- Copyright (c) 2023 FormatJS
18
-
19
- Permission is hereby granted, free of charge, to any person obtaining a copy
20
- of this software and associated documentation files (the "Software"), to deal
21
- in the Software without restriction, including without limitation the rights
22
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
- copies of the Software, and to permit persons to whom the Software is
24
- furnished to do so, subject to the following conditions:
25
-
26
- The above copyright notice and this permission notice shall be included in all
27
- copies or substantial portions of the Software.
28
-
29
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
- SOFTWARE.
36
- */
37
- import { SKELETON_TYPE, TYPE } from '@formatjs/icu-messageformat-parser';
38
- /**
39
- * Local copy of FormatJS `printAST` (see the license header above). The
40
- * published printer subpath is CommonJS-only, which browsers and Vite-based
41
- * dev servers (e.g. TanStack Start) cannot load from our ESM build, and the
42
- * package's ESM variant uses extensionless relative imports that fail Node
43
- * resolution.
44
- *
45
- * Output must stay byte-identical to FormatJS `printAST` because condensed
46
- * ICU strings feed into hashing.
47
- */
48
- export function printIcuAst(ast) {
49
- return doPrintAst(ast, false);
50
- }
51
- function doPrintAst(ast, isInPlural) {
52
- var printedNodes = ast.map(function (el, i) {
53
- switch (el.type) {
54
- case TYPE.literal:
55
- return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1);
56
- case TYPE.argument:
57
- return "{".concat(el.value, "}");
58
- case TYPE.date:
59
- case TYPE.time:
60
- case TYPE.number:
61
- return printSimpleFormatElement(el);
62
- case TYPE.plural:
63
- return printPluralElement(el);
64
- case TYPE.select:
65
- return printSelectElement(el);
66
- case TYPE.pound:
67
- return '#';
68
- case TYPE.tag:
69
- return printTagElement(el);
70
- }
71
- });
72
- return printedNodes.join('');
73
- }
74
- function printTagElement(el) {
75
- return "<".concat(el.value, ">").concat(printIcuAst(el.children), "</").concat(el.value, ">");
76
- }
77
- function printEscapedMessage(message) {
78
- return message.replace(/([{}](?:[\s\S]*[{}])?)/, "'$1'");
79
- }
80
- function printLiteralElement(_a, isInPlural, isFirstEl, isLastEl) {
81
- var value = _a.value;
82
- var escaped = value;
83
- // If this literal starts with a ' and it's not the 1st node, the node
84
- // before it is non-literal and the `'` needs to be re-escaped
85
- if (!isFirstEl && escaped[0] === "'") {
86
- escaped = "''".concat(escaped.slice(1));
87
- }
88
- // Same logic but for last el
89
- if (!isLastEl && escaped[escaped.length - 1] === "'") {
90
- escaped = "".concat(escaped.slice(0, escaped.length - 1), "''");
91
- }
92
- escaped = printEscapedMessage(escaped);
93
- // Upstream escapes only the first `#` (String#replace with a string
94
- // pattern); keep the quirk so output stays byte-identical
95
- return isInPlural ? escaped.replace('#', "'#'") : escaped;
96
- }
97
- function printSimpleFormatElement(el) {
98
- return "{".concat(el.value, ", ").concat(TYPE[el.type]).concat(el.style ? ", ".concat(printArgumentStyle(el.style)) : '', "}");
99
- }
100
- function printNumberSkeletonToken(token) {
101
- var stem = token.stem, options = token.options;
102
- return options.length === 0
103
- ? stem
104
- : "".concat(stem).concat(options.map(function (o) { return "/".concat(o); }).join(''));
105
- }
106
- function printArgumentStyle(style) {
107
- if (typeof style === 'string') {
108
- return printEscapedMessage(style);
109
- }
110
- else if (style.type === SKELETON_TYPE.dateTime) {
111
- return "::".concat(style.pattern);
112
- }
113
- else {
114
- return "::".concat(style.tokens.map(printNumberSkeletonToken).join(' '));
115
- }
116
- }
117
- function printSelectElement(el) {
118
- var msg = [
119
- el.value,
120
- 'select',
121
- Object.keys(el.options)
122
- .map(function (id) { return "".concat(id, "{").concat(doPrintAst(el.options[id].value, false), "}"); })
123
- .join(' '),
124
- ].join(',');
125
- return "{".concat(msg, "}");
126
- }
127
- function printPluralElement(el) {
128
- var type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal';
129
- var msg = [
130
- el.value,
131
- type,
132
- __spreadArray([
133
- el.offset ? "offset:".concat(el.offset) : ''
134
- ], Object.keys(el.options).map(function (id) { return "".concat(id, "{").concat(doPrintAst(el.options[id].value, true), "}"); }), true).filter(Boolean)
135
- .join(' '),
136
- ].join(',');
137
- return "{".concat(msg, "}");
138
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"derive-BvtWyo5B.cjs","names":["TYPE","TYPE"],"sources":["../src/utils/isSupportedFileFormatTransform.ts","../src/utils/base64.ts","../src/derive/utils/traverseIcu.ts","../src/derive/utils/constants.ts","../src/derive/utils/regex.ts","../src/derive/utils/traverseHelpers.ts","../src/derive/decodeVars.ts","../src/derive/utils/sanitizeVar.ts","../src/derive/declareVar.ts","../src/derive/derive.ts"],"sourcesContent":["import type { FileFormat } from '../types-dir/api/file';\n\nconst SUPPORTED_TRANSFORMATIONS = {\n GTJSON: ['GTJSON'],\n JSON: ['JSON'],\n PO: ['PO'],\n // POT templates can produce translated PO catalog files.\n POT: ['POT', 'PO'],\n YAML: ['YAML'],\n MDX: ['MDX'],\n MD: ['MD'],\n TS: ['TS'],\n JS: ['JS'],\n HTML: ['HTML'],\n TXT: ['TXT'],\n TWILIO_CONTENT_JSON: ['TWILIO_CONTENT_JSON'],\n} as const satisfies Record<FileFormat, FileFormat[]>;\n\n/**\n * This function checks if a file format transformation is supported during translation\n * @param from - The source file format.\n * @param to - The target file format.\n * @returns True if the transformation is supported, false otherwise\n */\nexport function isSupportedFileFormatTransform(\n from: FileFormat,\n to: FileFormat\n): boolean {\n const toFormats: FileFormat[] | undefined = SUPPORTED_TRANSFORMATIONS[from];\n return toFormats?.includes(to) ?? false;\n}\n","// Encode a string to base64\nexport function encode(data: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path.\n return Buffer.from(data, 'utf8').toString('base64');\n }\n // Browser path.\n const bytes = new TextEncoder().encode(data);\n let binary = '';\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\n// Decode a base64 string to a string\nexport function decode(base64: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path.\n return Buffer.from(base64, 'base64').toString('utf8');\n }\n // Browser path.\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return new TextDecoder().decode(bytes);\n}\n","import {\n MessageFormatElement,\n parse,\n ParserOptions,\n TYPE,\n} from '@formatjs/icu-messageformat-parser';\n\ntype TraverseIcuOptions = ParserOptions & {\n recurseIntoVisited?: boolean;\n};\n\n/**\n * Given an ICU string, traverse the AST and call the visitor function for each element that matches the type T\n * @param icu - The ICU string to traverse\n * @param shouldVisit - A function that returns true if the element should be visited\n * @param visitor - A function that is called for each element that matches the type T\n * @returns The modified AST of the ICU string.\n *\n * @note This function is a heavy operation, use sparingly\n */\nexport function traverseIcu<T extends MessageFormatElement>({\n icuString,\n shouldVisit,\n visitor,\n options: { recurseIntoVisited = true, ...otherOptions },\n}: {\n icuString: string;\n shouldVisit: (element: MessageFormatElement) => element is T;\n visitor: (element: T) => void;\n options: TraverseIcuOptions;\n}): MessageFormatElement[] {\n const ast = parse(icuString, otherOptions);\n handleChildren(ast);\n return ast;\n\n function handleChildren(children: MessageFormatElement[]): void {\n children.map(handleChild);\n }\n\n function handleChild(child: MessageFormatElement) {\n // handle select var\n let visited = false;\n if (shouldVisit(child)) {\n visitor(child);\n visited = true;\n }\n // recurse on children\n if (!visited || recurseIntoVisited) {\n if (child.type === TYPE.select || child.type === TYPE.plural) {\n Object.values(child.options)\n .map((option) => option.value)\n .map(handleChildren);\n } else if (child.type === TYPE.tag) {\n handleChildren(child.children);\n }\n }\n }\n}\n","export const VAR_IDENTIFIER = '_gt_';\nexport const VAR_NAME_IDENTIFIER = '_gt_var_name';\n","import { VAR_IDENTIFIER } from './constants';\n\n// Regex for _gt_# select\nexport const GT_INDEXED_IDENTIFIER_REGEX = new RegExp(\n `^${VAR_IDENTIFIER}\\\\d+$`\n);\n\nexport const GT_UNINDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}$`);\n","import {\n GT_INDEXED_IDENTIFIER_REGEX,\n GT_UNINDEXED_IDENTIFIER_REGEX,\n} from './regex';\nimport { GTIndexedSelectElement, GTUnindexedSelectElement } from './types';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nimport type { MessageFormatElement } from '@formatjs/icu-messageformat-parser/types.js';\n\n// Visit any _gt_# select\nexport function isGTIndexedSelectElement(\n child: MessageFormatElement\n): child is GTIndexedSelectElement {\n return (\n child.type === TYPE.select &&\n GT_INDEXED_IDENTIFIER_REGEX.test(child.value) &&\n !!child.options.other &&\n (child.options.other.value.length === 0 ||\n (child.options.other.value.length > 0 &&\n child.options.other.value[0]?.type === TYPE.literal))\n );\n}\n\n// Visit any _gt_ select\nexport function isGTUnindexedSelectElement(\n child: MessageFormatElement\n): child is GTUnindexedSelectElement {\n return (\n child.type === TYPE.select &&\n GT_UNINDEXED_IDENTIFIER_REGEX.test(child.value) &&\n !!child.options.other &&\n (child.options.other.value.length === 0 ||\n (child.options.other.value.length > 0 &&\n child.options.other.value[0]?.type === TYPE.literal))\n );\n}\n","import { traverseIcu } from './utils/traverseIcu';\nimport { VAR_IDENTIFIER } from './utils/constants';\nimport { GTUnindexedSelectElement } from './utils/types';\nimport { isGTUnindexedSelectElement } from './utils/traverseHelpers';\n\ntype Location = {\n start: number;\n end: number;\n value: string;\n};\n\n/**\n * Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()\n * @example\n * const encodedIcu = \"Hi\" + declareVar(\"Brian\") + \", my name is {name}\"\n * // 'Hi {_gt_, select, other {Brian}}, my name is {name}'\n * decodeVars(encodedIcu)\n * // 'Hi Brian, my name is {name}'\n */\nexport function decodeVars(icuString: string): string {\n // Check if the string contains _gt_\n if (!icuString.includes(VAR_IDENTIFIER)) {\n return icuString;\n }\n\n // Record the location of the variable\n const variableLocations: Location[] = [];\n function visitor(child: GTUnindexedSelectElement): void {\n variableLocations.push({\n start: child.location?.start.offset ?? 0,\n end: child.location?.end.offset ?? 0,\n value:\n child.options.other.value.length > 0\n ? child.options.other.value[0].value\n : '',\n });\n }\n\n // Find all variable identifiers.\n traverseIcu({\n icuString,\n shouldVisit: isGTUnindexedSelectElement,\n visitor,\n options: {\n recurseIntoVisited: false,\n captureLocation: true,\n },\n });\n\n // Construct output string\n let previousIndex = 0;\n const outputList = [];\n for (let i = 0; i < variableLocations.length; i++) {\n outputList.push(icuString.slice(previousIndex, variableLocations[i].start));\n outputList.push(variableLocations[i].value);\n previousIndex = variableLocations[i].end;\n }\n if (previousIndex < icuString.length) {\n outputList.push(icuString.slice(previousIndex));\n }\n const outputString = outputList.join('');\n\n return outputString;\n}\n","/**\n * Sanitizes string by escaping ICU syntax\n *\n * Sanitize arbitrary string so it does not break the following ICU message syntax:\n * {_gt_, select, other {string_here}}\n *\n * Escapes ICU special characters by:\n * 1. Doubling all single quotes (U+0027 ')\n * 2. Adding a single quote before the first special character ({}<>)\n * 3. Adding a single quote after the last special character ({}<>)\n */\nexport function sanitizeVar(string: string): string {\n // First, double all single quotes (both ASCII and Unicode).\n let result = string.replace(/'/g, \"''\");\n\n // Find first and last positions of special characters\n const specialChars = /[{}<>]/;\n const firstSpecialIndex = result.search(specialChars);\n\n if (firstSpecialIndex === -1) {\n // No special characters; return with just doubled quotes.\n return result;\n }\n\n // Find last special character position\n let lastSpecialIndex = -1;\n for (let i = result.length - 1; i >= 0; i--) {\n if (specialChars.test(result[i])) {\n lastSpecialIndex = i;\n break;\n }\n }\n\n // Insert quotes around the special character region.\n result =\n result.slice(0, firstSpecialIndex) +\n \"'\" +\n result.slice(firstSpecialIndex, lastSpecialIndex + 1) +\n \"'\" +\n result.slice(lastSpecialIndex + 1);\n\n return result;\n}\n","import { VAR_IDENTIFIER, VAR_NAME_IDENTIFIER } from './utils/constants';\nimport { sanitizeVar } from './utils/sanitizeVar';\n\n/**\n * Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).\n *\n * @example\n * function nonDerivableFunction() {\n * return Math.random();\n * }\n *\n * function derivableFunction() {\n * if (condition) {\n * return declareVar(nonDerivableFunction())\n * }\n * return 'John Doe';\n * }\n *\n * const gt = useGT();\n * gt(`My name is ${derive(derivableFunction())}`);\n *\n * @param {string | number | boolean | null | undefined} variable - The variable to sanitize.\n * @param {Object} [options] - The options for the sanitization.\n * @param {string} [options.$name] - The name of the variable.\n * @returns {string} The sanitized value.\n */\nexport function declareVar(\n variable: string | number | boolean | null | undefined,\n options?: { $name?: string }\n): string {\n // Variable section.\n const sanitizedVariable = sanitizeVar(String(variable ?? ''));\n const variableSection = ` other {${sanitizedVariable}}`;\n\n // Name section.\n let nameSection = '';\n if (options?.$name) {\n const sanitizedName = sanitizeVar(options.$name);\n nameSection = ` ${VAR_NAME_IDENTIFIER} {${sanitizedName}}`;\n }\n\n // interpolate\n return `{${VAR_IDENTIFIER}, select,${variableSection}${nameSection}}`;\n}\n","/**\n * Marks content as derivable by the GT compiler and CLI.\n *\n * Use `derive()` when a translation string or context needs content that is\n * computed from source code, but should still be discovered during extraction\n * instead of treated as a runtime interpolation variable. The CLI attempts to\n * resolve the derivable expression into every possible static value and\n * includes those values in the source content that gets translated.\n *\n * `derive()` returns its argument unchanged at runtime.\n *\n * Run `gt validate` after adding or changing `derive()` calls to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * gt(`My name is ${derive(getSubject())}`);\n * ```\n *\n * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n * @returns {T} The same content, unchanged at runtime.\n */\nexport function derive<T extends string | boolean | number | null | undefined>(\n content: T\n): T {\n return content;\n}\n"],"mappings":";;AAEA,MAAM,4BAA4B;CAChC,QAAQ,CAAC,SAAS;CAClB,MAAM,CAAC,OAAO;CACd,IAAI,CAAC,KAAK;CAEV,KAAK,CAAC,OAAO,KAAK;CAClB,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,MAAM;CACZ,IAAI,CAAC,KAAK;CACV,IAAI,CAAC,KAAK;CACV,IAAI,CAAC,KAAK;CACV,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,MAAM;CACZ,qBAAqB,CAAC,sBAAsB;CAC7C;;;;;;;AAQD,SAAgB,+BACd,MACA,IACS;AAET,QAD4C,0BAA0B,OACpD,SAAS,GAAG,IAAI;;;;AC5BpC,SAAgB,OAAO,MAAsB;AAC3C,KAAI,OAAO,WAAW,YAEpB,QAAO,OAAO,KAAK,MAAM,OAAO,CAAC,SAAS,SAAS;CAGrD,MAAM,QAAQ,IAAI,aAAa,CAAC,OAAO,KAAK;CAC5C,IAAI,SAAS;AACb,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,IAChC,WAAU,OAAO,aAAa,MA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AAe;CACrB,MAAM,oBAAoB,OAAO,OAAO,aAAa;AAErD,KAAI,sBAAsB,GAExB,QAAO;CAIT,IAAI,mBAAmB;AACvB,MAAK,IAAI,IAAI,OAAO,SAAS,GAAG,KAAK,GAAG,IACtC,KAAI,aAAa,KAAK,OAAO,GAAG,EAAE;AAChC,qBAAmB;AACnB;;AAKJ,UACE,OAAO,MAAM,GAAG,kBAAkB,GAClC,MACA,OAAO,MAAM,mBAAmB,mBAAmB,EAAE,GACrD,MACA,OAAO,MAAM,mBAAmB,EAAE;AAEpC,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;ACfT,SAAgB,WACd,UACA,SACQ;CAGR,MAAM,kBAAkB,WADE,YAAY,OAAO,YAAY,GAAG,CACR,CAAC;CAGrD,IAAI,cAAc;AAClB,KAAI,SAAS,MAEX,eAAc,IAAI,oBAAoB,IADhB,YAAY,QAAQ,MACa,CAAC;AAI1D,QAAO,IAAI,eAAe,WAAW,kBAAkB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACfrE,SAAgB,OACd,SACG;AACH,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"derive-ClAsLQOX.mjs","names":[],"sources":["../src/utils/isSupportedFileFormatTransform.ts","../src/utils/base64.ts","../src/derive/utils/traverseIcu.ts","../src/derive/utils/constants.ts","../src/derive/utils/regex.ts","../src/derive/utils/traverseHelpers.ts","../src/derive/decodeVars.ts","../src/derive/utils/sanitizeVar.ts","../src/derive/declareVar.ts","../src/derive/derive.ts"],"sourcesContent":["import type { FileFormat } from '../types-dir/api/file';\n\nconst SUPPORTED_TRANSFORMATIONS = {\n GTJSON: ['GTJSON'],\n JSON: ['JSON'],\n PO: ['PO'],\n // POT templates can produce translated PO catalog files.\n POT: ['POT', 'PO'],\n YAML: ['YAML'],\n MDX: ['MDX'],\n MD: ['MD'],\n TS: ['TS'],\n JS: ['JS'],\n HTML: ['HTML'],\n TXT: ['TXT'],\n TWILIO_CONTENT_JSON: ['TWILIO_CONTENT_JSON'],\n} as const satisfies Record<FileFormat, FileFormat[]>;\n\n/**\n * This function checks if a file format transformation is supported during translation\n * @param from - The source file format.\n * @param to - The target file format.\n * @returns True if the transformation is supported, false otherwise\n */\nexport function isSupportedFileFormatTransform(\n from: FileFormat,\n to: FileFormat\n): boolean {\n const toFormats: FileFormat[] | undefined = SUPPORTED_TRANSFORMATIONS[from];\n return toFormats?.includes(to) ?? false;\n}\n","// Encode a string to base64\nexport function encode(data: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path.\n return Buffer.from(data, 'utf8').toString('base64');\n }\n // Browser path.\n const bytes = new TextEncoder().encode(data);\n let binary = '';\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\n// Decode a base64 string to a string\nexport function decode(base64: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path.\n return Buffer.from(base64, 'base64').toString('utf8');\n }\n // Browser path.\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return new TextDecoder().decode(bytes);\n}\n","import {\n MessageFormatElement,\n parse,\n ParserOptions,\n TYPE,\n} from '@formatjs/icu-messageformat-parser';\n\ntype TraverseIcuOptions = ParserOptions & {\n recurseIntoVisited?: boolean;\n};\n\n/**\n * Given an ICU string, traverse the AST and call the visitor function for each element that matches the type T\n * @param icu - The ICU string to traverse\n * @param shouldVisit - A function that returns true if the element should be visited\n * @param visitor - A function that is called for each element that matches the type T\n * @returns The modified AST of the ICU string.\n *\n * @note This function is a heavy operation, use sparingly\n */\nexport function traverseIcu<T extends MessageFormatElement>({\n icuString,\n shouldVisit,\n visitor,\n options: { recurseIntoVisited = true, ...otherOptions },\n}: {\n icuString: string;\n shouldVisit: (element: MessageFormatElement) => element is T;\n visitor: (element: T) => void;\n options: TraverseIcuOptions;\n}): MessageFormatElement[] {\n const ast = parse(icuString, otherOptions);\n handleChildren(ast);\n return ast;\n\n function handleChildren(children: MessageFormatElement[]): void {\n children.map(handleChild);\n }\n\n function handleChild(child: MessageFormatElement) {\n // handle select var\n let visited = false;\n if (shouldVisit(child)) {\n visitor(child);\n visited = true;\n }\n // recurse on children\n if (!visited || recurseIntoVisited) {\n if (child.type === TYPE.select || child.type === TYPE.plural) {\n Object.values(child.options)\n .map((option) => option.value)\n .map(handleChildren);\n } else if (child.type === TYPE.tag) {\n handleChildren(child.children);\n }\n }\n }\n}\n","export const VAR_IDENTIFIER = '_gt_';\nexport const VAR_NAME_IDENTIFIER = '_gt_var_name';\n","import { VAR_IDENTIFIER } from './constants';\n\n// Regex for _gt_# select\nexport const GT_INDEXED_IDENTIFIER_REGEX = new RegExp(\n `^${VAR_IDENTIFIER}\\\\d+$`\n);\n\nexport const GT_UNINDEXED_IDENTIFIER_REGEX = new RegExp(`^${VAR_IDENTIFIER}$`);\n","import {\n GT_INDEXED_IDENTIFIER_REGEX,\n GT_UNINDEXED_IDENTIFIER_REGEX,\n} from './regex';\nimport { GTIndexedSelectElement, GTUnindexedSelectElement } from './types';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nimport type { MessageFormatElement } from '@formatjs/icu-messageformat-parser/types.js';\n\n// Visit any _gt_# select\nexport function isGTIndexedSelectElement(\n child: MessageFormatElement\n): child is GTIndexedSelectElement {\n return (\n child.type === TYPE.select &&\n GT_INDEXED_IDENTIFIER_REGEX.test(child.value) &&\n !!child.options.other &&\n (child.options.other.value.length === 0 ||\n (child.options.other.value.length > 0 &&\n child.options.other.value[0]?.type === TYPE.literal))\n );\n}\n\n// Visit any _gt_ select\nexport function isGTUnindexedSelectElement(\n child: MessageFormatElement\n): child is GTUnindexedSelectElement {\n return (\n child.type === TYPE.select &&\n GT_UNINDEXED_IDENTIFIER_REGEX.test(child.value) &&\n !!child.options.other &&\n (child.options.other.value.length === 0 ||\n (child.options.other.value.length > 0 &&\n child.options.other.value[0]?.type === TYPE.literal))\n );\n}\n","import { traverseIcu } from './utils/traverseIcu';\nimport { VAR_IDENTIFIER } from './utils/constants';\nimport { GTUnindexedSelectElement } from './utils/types';\nimport { isGTUnindexedSelectElement } from './utils/traverseHelpers';\n\ntype Location = {\n start: number;\n end: number;\n value: string;\n};\n\n/**\n * Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()\n * @example\n * const encodedIcu = \"Hi\" + declareVar(\"Brian\") + \", my name is {name}\"\n * // 'Hi {_gt_, select, other {Brian}}, my name is {name}'\n * decodeVars(encodedIcu)\n * // 'Hi Brian, my name is {name}'\n */\nexport function decodeVars(icuString: string): string {\n // Check if the string contains _gt_\n if (!icuString.includes(VAR_IDENTIFIER)) {\n return icuString;\n }\n\n // Record the location of the variable\n const variableLocations: Location[] = [];\n function visitor(child: GTUnindexedSelectElement): void {\n variableLocations.push({\n start: child.location?.start.offset ?? 0,\n end: child.location?.end.offset ?? 0,\n value:\n child.options.other.value.length > 0\n ? child.options.other.value[0].value\n : '',\n });\n }\n\n // Find all variable identifiers.\n traverseIcu({\n icuString,\n shouldVisit: isGTUnindexedSelectElement,\n visitor,\n options: {\n recurseIntoVisited: false,\n captureLocation: true,\n },\n });\n\n // Construct output string\n let previousIndex = 0;\n const outputList = [];\n for (let i = 0; i < variableLocations.length; i++) {\n outputList.push(icuString.slice(previousIndex, variableLocations[i].start));\n outputList.push(variableLocations[i].value);\n previousIndex = variableLocations[i].end;\n }\n if (previousIndex < icuString.length) {\n outputList.push(icuString.slice(previousIndex));\n }\n const outputString = outputList.join('');\n\n return outputString;\n}\n","/**\n * Sanitizes string by escaping ICU syntax\n *\n * Sanitize arbitrary string so it does not break the following ICU message syntax:\n * {_gt_, select, other {string_here}}\n *\n * Escapes ICU special characters by:\n * 1. Doubling all single quotes (U+0027 ')\n * 2. Adding a single quote before the first special character ({}<>)\n * 3. Adding a single quote after the last special character ({}<>)\n */\nexport function sanitizeVar(string: string): string {\n // First, double all single quotes (both ASCII and Unicode).\n let result = string.replace(/'/g, \"''\");\n\n // Find first and last positions of special characters\n const specialChars = /[{}<>]/;\n const firstSpecialIndex = result.search(specialChars);\n\n if (firstSpecialIndex === -1) {\n // No special characters; return with just doubled quotes.\n return result;\n }\n\n // Find last special character position\n let lastSpecialIndex = -1;\n for (let i = result.length - 1; i >= 0; i--) {\n if (specialChars.test(result[i])) {\n lastSpecialIndex = i;\n break;\n }\n }\n\n // Insert quotes around the special character region.\n result =\n result.slice(0, firstSpecialIndex) +\n \"'\" +\n result.slice(firstSpecialIndex, lastSpecialIndex + 1) +\n \"'\" +\n result.slice(lastSpecialIndex + 1);\n\n return result;\n}\n","import { VAR_IDENTIFIER, VAR_NAME_IDENTIFIER } from './utils/constants';\nimport { sanitizeVar } from './utils/sanitizeVar';\n\n/**\n * Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).\n *\n * @example\n * function nonDerivableFunction() {\n * return Math.random();\n * }\n *\n * function derivableFunction() {\n * if (condition) {\n * return declareVar(nonDerivableFunction())\n * }\n * return 'John Doe';\n * }\n *\n * const gt = useGT();\n * gt(`My name is ${derive(derivableFunction())}`);\n *\n * @param {string | number | boolean | null | undefined} variable - The variable to sanitize.\n * @param {Object} [options] - The options for the sanitization.\n * @param {string} [options.$name] - The name of the variable.\n * @returns {string} The sanitized value.\n */\nexport function declareVar(\n variable: string | number | boolean | null | undefined,\n options?: { $name?: string }\n): string {\n // Variable section.\n const sanitizedVariable = sanitizeVar(String(variable ?? ''));\n const variableSection = ` other {${sanitizedVariable}}`;\n\n // Name section.\n let nameSection = '';\n if (options?.$name) {\n const sanitizedName = sanitizeVar(options.$name);\n nameSection = ` ${VAR_NAME_IDENTIFIER} {${sanitizedName}}`;\n }\n\n // interpolate\n return `{${VAR_IDENTIFIER}, select,${variableSection}${nameSection}}`;\n}\n","/**\n * Marks content as derivable by the GT compiler and CLI.\n *\n * Use `derive()` when a translation string or context needs content that is\n * computed from source code, but should still be discovered during extraction\n * instead of treated as a runtime interpolation variable. The CLI attempts to\n * resolve the derivable expression into every possible static value and\n * includes those values in the source content that gets translated.\n *\n * `derive()` returns its argument unchanged at runtime.\n *\n * Run `gt validate` after adding or changing `derive()` calls to verify that\n * each derivable expression can be resolved by the CLI before translating or\n * building.\n *\n * @example\n * ```jsx\n * function getSubject() {\n * return (Math.random() > 0.5) ? \"Alice\" : \"Brian\";\n * }\n * ...\n * gt(`My name is ${derive(getSubject())}`);\n * ```\n *\n * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.\n * @returns {T} The same content, unchanged at runtime.\n */\nexport function derive<T extends string | boolean | number | null | undefined>(\n content: T\n): T {\n return content;\n}\n"],"mappings":";;AAEA,MAAM,4BAA4B;CAChC,QAAQ,CAAC,SAAS;CAClB,MAAM,CAAC,OAAO;CACd,IAAI,CAAC,KAAK;CAEV,KAAK,CAAC,OAAO,KAAK;CAClB,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,MAAM;CACZ,IAAI,CAAC,KAAK;CACV,IAAI,CAAC,KAAK;CACV,IAAI,CAAC,KAAK;CACV,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,MAAM;CACZ,qBAAqB,CAAC,sBAAsB;CAC7C;;;;;;;AAQD,SAAgB,+BACd,MACA,IACS;AAET,QAD4C,0BAA0B,OACpD,SAAS,GAAG,IAAI;;;;AC5BpC,SAAgB,OAAO,MAAsB;AAC3C,KAAI,OAAO,WAAW,YAEpB,QAAO,OAAO,KAAK,MAAM,OAAO,CAAC,SAAS,SAAS;CAGrD,MAAM,QAAQ,IAAI,aAAa,CAAC,OAAO,KAAK;CAC5C,IAAI,SAAS;AACb,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,IAChC,WAAU,OAAO,aAAa,MAAM,GAAG;AAEzC,QAAO,KAAK,OAAO;;AAIrB,SAAgB,OAAO,QAAwB;AAC7C,KAAI,OAAO,WAAW,YAEpB,QAAO,OAAO,KAAK,QAAQ,SAAS,CAAC,SAAS,OAAO;CAGvD,MAAM,SAAS,KAA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