gt-react 10.5.0 → 10.6.0-alpha.0

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 (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/client.cjs.min.cjs +3 -3
  3. package/dist/client.d.ts +9 -4
  4. package/dist/client.esm.min.mjs +3 -3
  5. package/dist/dictionaries/collectUntranslatedEntries.d.ts +17 -0
  6. package/dist/dictionaries/collectUntranslatedEntries.d.ts.map +1 -0
  7. package/dist/dictionaries/getDictionaryEntry.d.ts.map +1 -1
  8. package/dist/dictionaries/getSubtree.d.ts +18 -0
  9. package/dist/dictionaries/getSubtree.d.ts.map +1 -0
  10. package/dist/dictionaries/indexDict.d.ts +15 -0
  11. package/dist/dictionaries/indexDict.d.ts.map +1 -0
  12. package/dist/dictionaries/injectAndMerge.d.ts +9 -0
  13. package/dist/dictionaries/injectAndMerge.d.ts.map +1 -0
  14. package/dist/dictionaries/injectEntry.d.ts +18 -0
  15. package/dist/dictionaries/injectEntry.d.ts.map +1 -0
  16. package/dist/dictionaries/injectFallbacks.d.ts +17 -0
  17. package/dist/dictionaries/injectFallbacks.d.ts.map +1 -0
  18. package/dist/dictionaries/injectHashes.d.ts +11 -0
  19. package/dist/dictionaries/injectHashes.d.ts.map +1 -0
  20. package/dist/dictionaries/injectTranslations.d.ts +20 -0
  21. package/dist/dictionaries/injectTranslations.d.ts.map +1 -0
  22. package/dist/dictionaries/isDictionaryEntry.d.ts +8 -0
  23. package/dist/dictionaries/isDictionaryEntry.d.ts.map +1 -0
  24. package/dist/dictionaries/mergeDictionaries.d.ts.map +1 -1
  25. package/dist/dictionaries/stripMetadataFromEntries.d.ts +6 -0
  26. package/dist/dictionaries/stripMetadataFromEntries.d.ts.map +1 -0
  27. package/dist/index.cjs.min.cjs +3 -3
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.esm.min.mjs +3 -3
  30. package/dist/internal/flattenDictionary.d.ts.map +1 -1
  31. package/dist/internal.cjs.min.cjs +3 -3
  32. package/dist/internal.d.ts +10 -1
  33. package/dist/internal.d.ts.map +1 -1
  34. package/dist/internal.esm.min.mjs +3 -3
  35. package/dist/provider/ClientProvider.d.ts +1 -1
  36. package/dist/provider/ClientProvider.d.ts.map +1 -1
  37. package/dist/provider/GTProvider.d.ts.map +1 -1
  38. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts +2 -4
  39. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts.map +1 -1
  40. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts +4 -0
  41. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts.map +1 -0
  42. package/dist/provider/hooks/useLoadDictionary.d.ts +8 -2
  43. package/dist/provider/hooks/useLoadDictionary.d.ts.map +1 -1
  44. package/dist/translation/hooks/useTranslations.d.ts +4 -1
  45. package/dist/translation/hooks/useTranslations.d.ts.map +1 -1
  46. package/dist/types/config.d.ts +1 -0
  47. package/dist/types/config.d.ts.map +1 -1
  48. package/dist/types/context.d.ts +2 -1
  49. package/dist/types/context.d.ts.map +1 -1
  50. package/dist/types/types.d.ts +3 -2
  51. package/dist/types/types.d.ts.map +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import { Dictionary } from '../types/types';
2
+ /**
3
+ * @description Collects all untranslated entries from a dictionary
4
+ * @param dictionary - The dictionary to collect untranslated entries from
5
+ * @param translationsDictionary - The translated dictionary to compare against
6
+ * @param id - The id of the dictionary to collect untranslated entries from
7
+ * @returns An array of untranslated entries
8
+ */
9
+ export declare function collectUntranslatedEntries(dictionary: Dictionary, translationsDictionary: Dictionary, id?: string): {
10
+ source: string;
11
+ metadata: {
12
+ $id: string;
13
+ $context?: string;
14
+ $_hash: string;
15
+ };
16
+ }[];
17
+ //# sourceMappingURL=collectUntranslatedEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectUntranslatedEntries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/collectUntranslatedEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,EAAE,GAAE,MAAW,GACd;IACD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,CAgCF"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,CAgB1B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EACrD,UAAU,EAAE,CAAC,EACb,EAAE,EAAE,MAAM,GACT,UAAU,GAAG,eAAe,GAAG,SAAS,CAU1C"}
1
+ {"version":3,"file":"getDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,CAgB1B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EACrD,UAAU,EAAE,CAAC,EACb,EAAE,EAAE,MAAM,GACT,UAAU,GAAG,eAAe,GAAG,SAAS,CAU1C"}
@@ -0,0 +1,18 @@
1
+ import { Dictionary, DictionaryEntry } from '../types/types';
2
+ export declare function getSubtree<T extends Dictionary>({ dictionary, id, }: {
3
+ dictionary: T;
4
+ id: string;
5
+ }): Dictionary | DictionaryEntry | undefined;
6
+ /**
7
+ * @description A function that gets a subtree from a dictionary
8
+ * @param dictionary - new dictionary to get the subtree from
9
+ * @param id - id of the subtree to get
10
+ * @param sourceDictionary - source dictionary to model off of
11
+ * @returns
12
+ */
13
+ export declare function getSubtreeWithCreation<T extends Dictionary>({ dictionary, id, sourceDictionary, }: {
14
+ dictionary: T;
15
+ id: string;
16
+ sourceDictionary: T;
17
+ }): Dictionary | DictionaryEntry | undefined;
18
+ //# sourceMappingURL=getSubtree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSubtree.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getSubtree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,EAC/C,UAAU,EACV,EAAE,GACH,EAAE;IACD,UAAU,EAAE,CAAC,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAW3C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,UAAU,EAAE,EAC3D,UAAU,EACV,EAAE,EACF,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,CAAC,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,CAAC,CAAC;CACrB,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAoB3C"}
@@ -0,0 +1,15 @@
1
+ import { Dictionary, DictionaryEntry } from '../types/types';
2
+ /**
3
+ * @description A function that gets a value from a dictionary, only one level
4
+ * @param dictionary - dictionary to get the value from
5
+ * @param id - id of the value to get
6
+ */
7
+ export declare function get(dictionary: Dictionary, id: string | number): DictionaryEntry | Dictionary;
8
+ /**
9
+ * @description A function that sets a value in a dictionary
10
+ * @param dictionary - dictionary to set the value in
11
+ * @param id - id of the value to set
12
+ * @param value - value to set
13
+ */
14
+ export declare function set(dictionary: Dictionary, id: string | number, value: Dictionary | DictionaryEntry): void;
15
+ //# sourceMappingURL=indexDict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexDict.d.ts","sourceRoot":"","sources":["../../src/dictionaries/indexDict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,gCAQ9D;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CACjB,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,KAAK,EAAE,UAAU,GAAG,eAAe,QAOpC"}
@@ -0,0 +1,9 @@
1
+ import { Dictionary } from '../types/types';
2
+ /**
3
+ * @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id
4
+ * @param dictionary - The dictionary to inject the subtree into
5
+ * @param subtree - The subtree to inject into the dictionary
6
+ * @param id - The id of the subtree to inject into the dictionary
7
+ */
8
+ export declare function injectAndMerge(dictionary: Dictionary, subtree: Dictionary, id: string): Dictionary;
9
+ //# sourceMappingURL=injectAndMerge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectAndMerge.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectAndMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAO7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,EACnB,EAAE,EAAE,MAAM,cAgBX"}
@@ -0,0 +1,18 @@
1
+ import { Dictionary, DictionaryEntry, TranslatedChildren } from '../types/types';
2
+ /**
3
+ * @description Injects an entry into a translations object
4
+ * @param translations - The translations object to inject the entry into
5
+ * @param entry - The entry to inject
6
+ * @param hash - The hash of the entry
7
+ * @param sourceDictionary - The source dictionary to model the new dictionary after
8
+ */
9
+ export declare function injectEntry(dictionaryEntry: DictionaryEntry, dictionary: Dictionary | DictionaryEntry, id: string, sourceDictionary: Dictionary | DictionaryEntry): DictionaryEntry | undefined;
10
+ /**
11
+ * @description Merge results into a dictionary
12
+ * @param dictionary - The dictionary to merge the results into
13
+ * @param results - The results to merge into the dictionary
14
+ * @param sourceDictionary - The source dictionary to model the new dictionary after
15
+ * @returns The merged dictionary
16
+ */
17
+ export declare function mergeResultsIntoDictionary(dictionary: Dictionary, results: [string, TranslatedChildren][], sourceDictionary: Dictionary): Dictionary;
18
+ //# sourceMappingURL=injectEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAYxB;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,GAAG,eAAe,EACxC,EAAE,EAAE,MAAM,EACV,gBAAgB,EAAE,UAAU,GAAG,eAAe,+BAiC/C;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,EACvC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAKZ"}
@@ -0,0 +1,17 @@
1
+ import { Dictionary } from '../types/types';
2
+ /**
3
+ * @description Injects fallbacks into a dictionary
4
+ * @param dictionary - The dictionary to inject translations into
5
+ * @param translationsDictionary - The translations to inject into the dictionary
6
+ * @param translations - The translations to inject into the dictionary
7
+ * @param id - The id of the dictionary to inject translations into
8
+ */
9
+ export declare function injectFallbacks(dictionary: Dictionary, translationsDictionary: Dictionary, missingTranslations: {
10
+ source: string;
11
+ metadata: {
12
+ $id: string;
13
+ $context?: string;
14
+ $_hash: string;
15
+ };
16
+ }[], prefixToRemove?: string): Dictionary;
17
+ //# sourceMappingURL=injectFallbacks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectFallbacks.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectFallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAO5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,cAuB5B"}
@@ -0,0 +1,11 @@
1
+ import { Dictionary } from '../types/types';
2
+ /**
3
+ * @description Given a dictionary, adds hashes to all dictionary entries
4
+ * @param dictionary - The dictionary to add hashes to
5
+ * @param id - The starting point of dictionary (if subtree)
6
+ */
7
+ export declare function injectHashes(dictionary: Dictionary, id?: string): {
8
+ dictionary: Dictionary;
9
+ updateDictionary: boolean;
10
+ };
11
+ //# sourceMappingURL=injectHashes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectHashes.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectHashes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,EAAE,GAAE,MAAW,GACd;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAwBvD"}
@@ -0,0 +1,20 @@
1
+ import { Dictionary, Translations } from '../types/types';
2
+ /**
3
+ * @description Injects translations into a dictionary
4
+ * @param dictionary - The dictionary to inject translations into
5
+ * @param translationsDictionary - The translations to inject into the dictionary
6
+ * @param translations - The translations to inject into the dictionary
7
+ * @param id - The id of the dictionary to inject translations into
8
+ */
9
+ export declare function injectTranslations(dictionary: Dictionary, translationsDictionary: Dictionary, translations: Translations, missingTranslations: {
10
+ source: string;
11
+ metadata: {
12
+ $id: string;
13
+ $context?: string;
14
+ $_hash: string;
15
+ };
16
+ }[], prefixToRemove?: string): {
17
+ dictionary: Dictionary;
18
+ updateDictionary: boolean;
19
+ };
20
+ //# sourceMappingURL=injectTranslations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injectTranslations.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO1D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,GAC1B;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CA8BvD"}
@@ -0,0 +1,8 @@
1
+ import { Dictionary, DictionaryEntry } from '../types/types';
2
+ /**
3
+ * Type guard function that checks if a value is a DictionaryEntry
4
+ * @param value - The value to check
5
+ * @returns true if the value is a DictionaryEntry, false otherwise
6
+ */
7
+ export declare function isDictionaryEntry(value: Dictionary | DictionaryEntry | undefined): value is DictionaryEntry;
8
+ //# sourceMappingURL=isDictionaryEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/isDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,GAC9C,KAAK,IAAI,eAAe,CAoC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/mergeDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,uBAAuB,EAAE,UAAU,EACnC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAkCZ"}
1
+ {"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/mergeDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAU7D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,uBAAuB,EAAE,UAAU,EACnC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAiDZ"}
@@ -0,0 +1,6 @@
1
+ import { Dictionary } from '../types/types';
2
+ /**
3
+ * @description Iterate over tree and remove metadata leaving just the entry
4
+ */
5
+ export declare function stripMetadataFromEntries(dictionary: Dictionary): Dictionary;
6
+ //# sourceMappingURL=stripMetadataFromEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripMetadataFromEntries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/stripMetadataFromEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAc3E"}