gt-react 9.2.8 → 9.2.10-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.
- package/dist/branches/Branch.d.ts +8 -4
- package/dist/branches/Branch.d.ts.map +1 -1
- package/dist/branches/plurals/Plural.d.ts +9 -5
- package/dist/branches/plurals/Plural.d.ts.map +1 -1
- package/dist/client.cjs.min.cjs +3 -3
- package/dist/client.d.ts +36 -64
- package/dist/client.esm.min.mjs +3 -3
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.esm.min.mjs +3 -3
- package/dist/internal/addGTIdentifier.d.ts.map +1 -1
- package/dist/internal.cjs.min.cjs +1 -1
- package/dist/internal.d.ts +3 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.esm.min.mjs +1 -1
- package/dist/provider/rendering/renderDefaultChildren.d.ts +3 -10
- package/dist/provider/rendering/renderDefaultChildren.d.ts.map +1 -1
- package/dist/provider/rendering/renderTranslatedChildren.d.ts +4 -12
- package/dist/provider/rendering/renderTranslatedChildren.d.ts.map +1 -1
- package/dist/provider/rendering/renderVariable.d.ts +3 -7
- package/dist/provider/rendering/renderVariable.d.ts.map +1 -1
- package/dist/types/types.d.ts +9 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/variables/Currency.d.ts +2 -9
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/DateTime.d.ts +2 -8
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/Num.d.ts +1 -6
- package/dist/variables/Num.d.ts.map +1 -1
- package/dist/variables/Var.d.ts +4 -25
- package/dist/variables/Var.d.ts.map +1 -1
- package/dist/variables/_getVariableProps.d.ts +2 -6
- package/dist/variables/_getVariableProps.d.ts.map +1 -1
- package/dist/variables/getVariableName.d.ts +0 -1
- package/dist/variables/getVariableName.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/internal.d.ts
CHANGED
@@ -6,12 +6,12 @@ import getDictionaryEntry, { isValidDictionaryEntry } from './provider/helpers/g
|
|
6
6
|
import getEntryAndMetadata from './provider/helpers/getEntryAndMetadata';
|
7
7
|
import getVariableProps from './variables/_getVariableProps';
|
8
8
|
import isVariableObject from './provider/helpers/isVariableObject';
|
9
|
-
import getVariableName
|
9
|
+
import getVariableName from './variables/getVariableName';
|
10
10
|
import renderDefaultChildren from './provider/rendering/renderDefaultChildren';
|
11
11
|
import renderTranslatedChildren from './provider/rendering/renderTranslatedChildren';
|
12
12
|
import { defaultRenderSettings } from './provider/rendering/defaultRenderSettings';
|
13
13
|
import renderSkeleton from './provider/rendering/renderSkeleton';
|
14
|
-
import { Dictionary, RenderMethod, TranslatedChildren, TranslatedContent, TranslationError, TranslationsObject, DictionaryEntry, TranslationSuccess, TranslationLoading, Children, FlattenedDictionary, Metadata, Child, GTProp, Entry, GTTranslationError, DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions, LocalesDictionary, DictionaryContent, DictionaryObject, CustomLoader } from './types/types';
|
14
|
+
import { Dictionary, RenderMethod, TranslatedChildren, TranslatedContent, TranslationError, TranslationsObject, DictionaryEntry, TranslationSuccess, TranslationLoading, Children, FlattenedDictionary, Metadata, Child, GTProp, Entry, GTTranslationError, DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions, LocalesDictionary, DictionaryContent, DictionaryObject, CustomLoader, RenderVariable, VariableProps } from './types/types';
|
15
15
|
import { GTContextType, ClientProviderProps } from './types/providers';
|
16
|
-
export { addGTIdentifier, writeChildrenAsObjects, isVariableObject, Dictionary, flattenDictionary, getDictionaryEntry, isValidDictionaryEntry, getVariableProps, DictionaryEntry, FlattenedDictionary, GTTranslationError, Metadata, getPluralBranch, getEntryAndMetadata, getVariableName,
|
16
|
+
export { addGTIdentifier, writeChildrenAsObjects, isVariableObject, Dictionary, flattenDictionary, getDictionaryEntry, isValidDictionaryEntry, getVariableProps, DictionaryEntry, FlattenedDictionary, GTTranslationError, Metadata, getPluralBranch, getEntryAndMetadata, getVariableName, renderDefaultChildren, renderTranslatedChildren, renderSkeleton, RenderMethod, defaultRenderSettings, Children, Child, GTProp, Entry, TranslatedChildren, TranslatedContent, TranslationsObject, TranslationLoading, TranslationError, TranslationSuccess, GTContextType, ClientProviderProps, DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions, DictionaryContent, DictionaryObject, LocalesDictionary, CustomLoader, RenderVariable, VariableProps, };
|
17
17
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,sBAAsB,MAAM,mCAAmC,CAAC;AACvE,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,kBAAkB,EAAE,EACzB,sBAAsB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AACzE,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,eAAe,
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,sBAAsB,MAAM,mCAAmC,CAAC;AACvE,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,kBAAkB,EAAE,EACzB,sBAAsB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AACzE,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAC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
-
import{jsx as e}from"react/jsx-runtime";import r,{isValidElement as t}from"react";import"generaltranslation";const n=e=>`Duplicate key found in dictionary: "${e}"`;function a(e,r=""){const t={};for(const i in e)if(e.hasOwnProperty(i)){const o=r?`${r}.${i}`:i;if("object"!=typeof e[i]||null===e[i]||Array.isArray(e[i])){if(t.hasOwnProperty(o))throw new Error(n(o));t[o]=e[i]}else{const r=a(e[i],o);for(const e in r){if(t.hasOwnProperty(e))throw new Error(n(e));t[e]=r[e]}}}return t}function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}"function"==typeof SuppressedError&&SuppressedError;var o="en",l=["singular","plural","dual","zero","one","two","few","many","other"];var s=new(function(){function e(){this.cache=new Map}return e.prototype._generateKey=function(e,r,t){void 0===t&&(t={});var n=Array.isArray(r)?r.join(","):r,a=t?JSON.stringify(t,Object.keys(t).sort()):"{}";return"".concat(e,":").concat(n,":").concat(a)},e.prototype.get=function(e,r,t){void 0===t&&(t={});var n=this._generateKey(e,r,t);if(!this.cache.has(n)){var a=new Intl[e](r,t);this.cache.set(n,a)}return this.cache.get(n)},e}());function c(n,a=0){let o=a;const s=e=>{const{type:r,props:t}=e;o+=1;let n,a={id:o};try{n="function"==typeof r&&r.gtTransformation||""}catch(e){n=""}if(n){const r=n.split("-");if("translate"===r[0])throw new Error((e=>{var r;return`General Translation: Nested <T> components. The inner <T> has the id: "${null===(r=null==e?void 0:e.props)||void 0===r?void 0:r.id}".`})(e));if("variable"===r[0]&&(a.variableType=(null==r?void 0:r[1])||"variable"),"plural"===r[0]){const e=Object.entries(t).reduce(((e,[r,t])=>{var n;return n=r,l.includes(n)&&(e[r]=c(t,o)),e}),{});Object.keys(e).length&&(a.branches=e)}if("branch"===r[0]){const e=i(t,["children","branch"]),r=Object.entries(e).reduce(((e,[r,t])=>(e[r]=c(t,o),e)),{});Object.keys(r).length&&(a.branches=r)}a.transformation=r[0]}return a};function u(n){return t(n)?function(t){const{props:n}=t;if(n["data-_gt"])throw new Error((e=>`General Translation already in use on child with props: ${e.props}. This usually occurs when you nest <T> components within the same file. Remove one of the <T> components to continue.`)(t));let a=s(t),i=Object.assign(Object.assign({},n),{"data-_gt":a});if(n.children&&!a.variableType&&(i.children=p(n.children)),t.type===r.Fragment)return i["data-_gt"].transformation,e("span",Object.assign({style:{all:"unset",display:"contents"}},i));return r.cloneElement(t,i)}(n):n}function p(e){return Array.isArray(e)?r.Children.map(e,u):u(e)}return p(n)}const u={variable:"value",number:"n",datetime:"date",currency:"cost"};function p(e="variable"){return u[e]||"variable"}const d="_gt_";function f(e={},r){var t;if(e.name)return e.name;if(e["data-_gt-variable-name"])return e["data-_gt-variable-name"];return`${d}${u[r]||"value"}_${null===(t=e["data-_gt"])||void 0===t?void 0:t.id}`}const b=e=>{var r;if(!e)return"";const{type:t,props:n}=e;if(t&&"function"==typeof t){if("displayName"in t&&"string"==typeof t.displayName&&t.displayName)return t.displayName;if("name"in t&&"string"==typeof t.name&&t.name)return t.name}return t&&"string"==typeof t?t:n.href?"a":(null===(r=n["data-_gt"])||void 0===r?void 0:r.id)?`C${n["data-_gt"].id}`:"function"},v=e=>{return t=e,r.isValidElement(t)?(e=>{const{type:r,props:t}=e;let n={type:b(e),props:{}};if(t["data-_gt"]){const e=t["data-_gt"];let r=Object.assign({},e);const a=e.transformation;if("variable"===a){const r=e.variableType||"variable";return{variable:r,key:f(t,r),id:e.id}}if("plural"===a&&e.branches){n.type="Plural";let t={};Object.entries(e.branches).forEach((([e,r])=>{t[e]=y(r)})),r=Object.assign(Object.assign({},r),{branches:t})}if("branch"===a&&e.branches){n.type="Branch";let t={};Object.entries(e.branches).forEach((([e,r])=>{t[e]=y(r)})),r=Object.assign(Object.assign({},r),{branches:t})}n.props["data-_gt"]=r}return t.children&&(n.props.children=y(t.children)),n})(e):"number"==typeof e?e.toString():e;var t};function y(e){return Array.isArray(e)?e.map(v):v(e)}function h(e,r,t){let n="",a=null;return"number"==typeof e&&!a&&t&&(n=function(e,r,t){void 0===r&&(r=l),void 0===t&&(t=["en"]);var n=s.get("PluralRules",t).select(e),a=Math.abs(e);if(0===a&&r.includes("zero"))return"zero";if(1===a){if(r.includes("singular"))return"singular";if(r.includes("one"))return"one"}if("one"===n&&r.includes("singular"))return"singular";if(2===a){if(r.includes("dual"))return"dual";if(r.includes("two"))return"two"}return"two"===n&&r.includes("dual")?"dual":r.includes(n)?n:"two"===n&&r.includes("dual")?"dual":"two"===n&&r.includes("plural")?"plural":"two"===n&&r.includes("other")?"other":"few"===n&&r.includes("plural")?"plural":"few"===n&&r.includes("other")?"other":"many"===n&&r.includes("plural")?"plural":"many"===n&&r.includes("other")?"other":"other"===n&&r.includes("plural")?"plural":""}(e,Object.keys(t),r)),n&&!a&&(a=t[n]),a}function g(e){if("string"==typeof e)return!0;if(Array.isArray(e)){if("string"!=typeof(null==e?void 0:e[0]))return!1;const r=null==e?void 0:e[1];if(void 0===r)return!0;if(r&&"object"==typeof r)return!0}return!1}function m(e,t){let n=e,a=t.split(".");for(const e of a){if("object"!=typeof n||Array.isArray(n)||r.isValidElement(n))return;n=n[e]}return n}function O(e){if(Array.isArray(e)){if(1===e.length)return{entry:e[0]};if(2===e.length)return{entry:e[0],metadata:e[1]}}return{entry:e}}function j(e){var r;const t=(null===(r=e["data-_gt"])||void 0===r?void 0:r.variableType)||"variable";return{variableType:t,variableName:f(e,t),variableValue:void 0!==e.value?e.value:void 0!==e["data-_gt-unformatted-value"]?e["data-_gt-unformatted-value"]:void 0!==e.children?e.children:void 0,variableOptions:(()=>{const r=Object.assign(Object.assign({},e.currency&&{currency:e.currency}),e.options&&Object.assign({},e.options));return Object.keys(r).length?r:"string"==typeof e["data-_gt-variable-options"]?JSON.parse(e["data-_gt-variable-options"]):e["data-_gt-variable-options"]||void 0})()}}function _(e){const r=e;if(r&&"object"==typeof r&&"string"==typeof r.key){const e=Object.keys(r);if(1===e.length)return!0;if(2===e.length){if("number"==typeof r.id)return!0;if("string"==typeof r.variable)return!0}if(3===e.length&&"string"==typeof r.variable&&"number"==typeof r.id)return!0}return!1}function w(e){return e&&e.props&&e.props["data-_gt"]?e.props["data-_gt"]:null}function E({children:e,variables:t={},variablesOptions:n={},defaultLocale:a=o,renderVariable:l}){const s=e=>r.isValidElement(e)?(e=>{const o=w(e);if("variable"===(null==o?void 0:o.transformation)){let{variableName:r,variableType:i,variableValue:o,variableOptions:s}=j(e.props);return o=(()=>{if(void 0!==t[r])return t[r];if(void 0!==o)return o;if(r.startsWith(d)){const e=p(i);if(void 0!==t[e])return t[e]}})(),s=Object.assign(Object.assign({},n[r]),s),l({variableName:r,variableType:i,variableValue:o,variableOptions:s,locales:[a]})}if("plural"===(null==o?void 0:o.transformation)){const r="number"==typeof t.n?t.n:"number"==typeof e.props.n?e.props.n:e.props["data-_gt-n"];"number"==typeof r&&void 0===t.n&&(t.n=r);const n=o.branches||{};return c(h(r,[a],n)||e.props.children)}if("branch"===(null==o?void 0:o.transformation)){let r=e.props,{children:n,name:a,branch:l,"data-_gt":s}=r,u=i(r,["children","name","branch","data-_gt"]);return a=a||e.props["data-_gt-name"]||"branch",l=t[a]||l||e.props["data-_gt-branch-name"],u=o.branches||{},c(void 0!==u[l]?u[l]:n)}return e.props.children?r.cloneElement(e,Object.assign(Object.assign({},e.props),{"data-_gt":void 0,children:c(e.props.children)})):r.cloneElement(e,Object.assign(Object.assign({},e.props),{"data-_gt":void 0}))})(e):e,c=e=>Array.isArray(e)?r.Children.map(e,s):s(e);return c(e)}function A({sourceElement:e,targetElement:t,variables:n={},variablesOptions:a={},locales:i=[o],renderVariable:l}){var s;const{props:c}=e,u=c["data-_gt"],p=null==u?void 0:u.transformation;if("plural"===p){const r="number"==typeof n.n?n.n:"number"==typeof e.props.n?e.props.n:e.props["data-_gt-n"],o=h(r,i,u.branches||{})||e.props.children,s=h(r,i,t.props["data-_gt"].branches||{})||t.props.children;return"number"==typeof r&&void 0===n.n&&(n.n=r),V({source:o,target:s,variables:n,variablesOptions:a,locales:i,renderVariable:l})}if("branch"===p){let{name:r,branch:o,children:s}=c;r=r||e.props["data-_gt-name"]||"branch",o=n[r]||o||e.props["data-_gt-branch-name"];return V({source:(u.branches||{})[o]||s,target:(t.props["data-_gt"].branches||{})[o]||t.props.children,variables:n,variablesOptions:a,locales:i,renderVariable:l})}return(null==c?void 0:c.children)&&(null===(s=t.props)||void 0===s?void 0:s.children)?r.cloneElement(e,Object.assign(Object.assign({},c),{"data-_gt":void 0,children:V({source:c.children,target:t.props.children,variables:n,variablesOptions:a,locales:i,renderVariable:l})})):E({children:e,variables:n,variablesOptions:a,defaultLocale:i[0],renderVariable:l})}function V({source:t,target:n,variables:a={},variablesOptions:i={},locales:l=[o],renderVariable:s}){if(null==n&&t)return E({children:t,variables:a,variablesOptions:i,defaultLocale:l[0],renderVariable:s});if("string"==typeof n)return n;if(Array.isArray(n)&&!Array.isArray(t)&&t&&(t=[t]),Array.isArray(t)&&Array.isArray(n)){const o=t.filter((e=>{if(r.isValidElement(e)){const r=w(e);if("variable"!==(null==r?void 0:r.transformation))return!0;{let{variableName:r,variableValue:t,variableOptions:n,variableType:o}=j(e.props);void 0===a[r]&&(a[r]=t);const l=p(o);void 0===a[l]&&(a[l]=t),i[r]=Object.assign(Object.assign({},i[r]),n)}}})),c=e=>o.find((r=>{var t,n;const a=w(r);if(void 0!==(null==a?void 0:a.id)){return a.id===(null===(n=null===(t=null==e?void 0:e.props)||void 0===t?void 0:t["data-_gt"])||void 0===n?void 0:n.id)}return!1}))||o.shift();return n.map(((t,n)=>{if("string"==typeof t)return e(r.Fragment,{children:t},`string_${n}`);if(_(t)){const o=t.key,c=t.variable||"variable",u=(()=>{if(void 0!==a[t.key])return a[t.key];if(o.startsWith(d)){const e=p(c);if(void 0!==a[e])return a[e]}})();return e(r.Fragment,{children:s({variableType:c,variableName:o,variableValue:u,variableOptions:i[t.key],locales:l})},`var_${n}`)}const o=c(t);return o?e(r.Fragment,{children:A({sourceElement:o,targetElement:t,variables:a,variablesOptions:i,locales:l,renderVariable:s})},`element_${n}`):void 0}))}if(n&&"object"==typeof n&&!Array.isArray(n)){const e=_(n)?"variable":"element";if(r.isValidElement(t)){if("element"===e)return A({sourceElement:t,targetElement:n,variables:a,variablesOptions:i,locales:l,renderVariable:s});const r=w(t);if("variable"===(null==r?void 0:r.transformation)){let{variableName:e,variableValue:r,variableOptions:n}=j(t.props);void 0===a[e]&&(a[e]=r),i[e]=Object.assign(Object.assign({},i[e]),n)}}if("variable"===e){const e=n,r=e.key,t=e.variable||"variable",o=(()=>{if(void 0!==a[e.key])return a[e.key];if(r.startsWith(d)){const e=p(t);if(void 0!==a[e])return a[e]}})();return s({variableType:t,variableName:r,variableValue:o,variableOptions:i[e.key]||{},locales:l})}}return E({children:t,variables:a,variablesOptions:i,defaultLocale:l[0],renderVariable:s})}const T={method:"default",timeout:"undefined"!=typeof process&&"development"!==process.env.NODE_ENV?8e3:12e3};function k(){return""}class N extends Error{constructor(e,r){super(e),this.error=e,this.code=r,this.code=r}toTranslationError(){return{state:"error",error:this.error,code:this.code}}}export{N as GTTranslationError,c as addGTIdentifier,T as defaultRenderSettings,a as flattenDictionary,m as getDictionaryEntry,O as getEntryAndMetadata,p as getFallbackVariableName,h as getPluralBranch,f as getVariableName,j as getVariableProps,g as isValidDictionaryEntry,_ as isVariableObject,E as renderDefaultChildren,k as renderSkeleton,V as renderTranslatedChildren,y as writeChildrenAsObjects};
|
1
|
+
import e,{isValidElement as r}from"react";import"generaltranslation";import{jsx as t}from"react/jsx-runtime";const n=e=>`Duplicate key found in dictionary: "${e}"`;function a(e,r=""){const t={};for(const i in e)if(e.hasOwnProperty(i)){const o=r?`${r}.${i}`:i;if("object"!=typeof e[i]||null===e[i]||Array.isArray(e[i])){if(t.hasOwnProperty(o))throw new Error(n(o));t[o]=e[i]}else{const r=a(e[i],o);for(const e in r){if(t.hasOwnProperty(e))throw new Error(n(e));t[e]=r[e]}}}return t}function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}"function"==typeof SuppressedError&&SuppressedError;var o="en",l=["singular","plural","dual","zero","one","two","few","many","other"];var s=new(function(){function e(){this.cache=new Map}return e.prototype._generateKey=function(e,r,t){void 0===t&&(t={});var n=Array.isArray(r)?r.join(","):r,a=t?JSON.stringify(t,Object.keys(t).sort()):"{}";return"".concat(e,":").concat(n,":").concat(a)},e.prototype.get=function(e,r,t){void 0===t&&(t={});var n=this._generateKey(e,r,t);if(!this.cache.has(n)){var a=new Intl[e](r,t);this.cache.set(n,a)}return this.cache.get(n)},e}());function c(t,n=0){let a=n;const o=e=>{const{type:r,props:t}=e;a+=1;let n,o={id:a};try{n="function"==typeof r&&r.gtTransformation||""}catch(e){n=""}if(n){const r=n.split("-");if("translate"===r[0])throw new Error((e=>{var r;return`General Translation: Nested <T> components. The inner <T> has the id: "${null===(r=null==e?void 0:e.props)||void 0===r?void 0:r.id}".`})(e));if("variable"===r[0]&&(o.variableType=(null==r?void 0:r[1])||"variable"),"plural"===r[0]){const e=Object.entries(t).reduce(((e,[r,t])=>{var n;return n=r,l.includes(n)&&(e[r]=c(t,a)),e}),{});Object.keys(e).length&&(o.branches=e)}if("branch"===r[0]){const e=i(t,["children","branch"]),r=Object.entries(e).reduce(((e,[r,t])=>(e[r]=c(t,a),e)),{});Object.keys(r).length&&(o.branches=r)}o.transformation=r[0]}return o};function s(t){return r(t)?function(r){const{props:t}=r;if(t["data-_gt"])throw new Error((e=>`General Translation already in use on child with props: ${e.props}. This usually occurs when you nest <T> components within the same file. Remove one of the <T> components to continue.`)(r));let n=o(r),a=Object.assign(Object.assign({},t),{"data-_gt":n});return t.children&&!n.variableType&&(a.children=u(t.children)),r.type===e.Fragment&&(a["data-_gt"].transformation="fragment"),e.cloneElement(r,a)}(t):t}function u(r){return Array.isArray(r)?e.Children.map(r,s):s(r)}return u(t)}const u={variable:"value",number:"n",datetime:"date",currency:"cost"};function d(e={},r){var t;return`_gt_${u[r]||"value"}_${null===(t=e["data-_gt"])||void 0===t?void 0:t.id}`}const p=e=>{var r;if(!e)return"";const{type:t,props:n}=e;if(t&&"function"==typeof t){if("displayName"in t&&"string"==typeof t.displayName&&t.displayName)return t.displayName;if("name"in t&&"string"==typeof t.name&&t.name)return t.name}return t&&"string"==typeof t?t:n.href?"a":(null===(r=n["data-_gt"])||void 0===r?void 0:r.id)?`C${n["data-_gt"].id}`:"function"},f=r=>{return t=r,e.isValidElement(t)?(e=>{const{type:r,props:t}=e;let n={type:p(e),props:{}};if(t["data-_gt"]){const e=t["data-_gt"];let r=Object.assign({},e);const a=e.transformation;if("variable"===a){const r=e.variableType||"variable";return{variable:r,key:d(t,r),id:e.id}}if("plural"===a&&e.branches){n.type="Plural";let t={};Object.entries(e.branches).forEach((([e,r])=>{t[e]=b(r)})),r=Object.assign(Object.assign({},r),{branches:t})}if("branch"===a&&e.branches){n.type="Branch";let t={};Object.entries(e.branches).forEach((([e,r])=>{t[e]=b(r)})),r=Object.assign(Object.assign({},r),{branches:t})}n.props["data-_gt"]=r}return t.children&&(n.props.children=b(t.children)),n})(r):"number"==typeof r?r.toString():r;var t};function b(e){return Array.isArray(e)?e.map(f):f(e)}function h(e,r,t){let n="",a=null;return"number"==typeof e&&!a&&t&&(n=function(e,r,t){void 0===r&&(r=l),void 0===t&&(t=["en"]);var n=s.get("PluralRules",t).select(e),a=Math.abs(e);if(0===a&&r.includes("zero"))return"zero";if(1===a){if(r.includes("singular"))return"singular";if(r.includes("one"))return"one"}if("one"===n&&r.includes("singular"))return"singular";if(2===a){if(r.includes("dual"))return"dual";if(r.includes("two"))return"two"}return"two"===n&&r.includes("dual")?"dual":r.includes(n)?n:"two"===n&&r.includes("dual")?"dual":"two"===n&&r.includes("plural")?"plural":"two"===n&&r.includes("other")?"other":"few"===n&&r.includes("plural")?"plural":"few"===n&&r.includes("other")?"other":"many"===n&&r.includes("plural")?"plural":"many"===n&&r.includes("other")?"other":"other"===n&&r.includes("plural")?"plural":""}(e,Object.keys(t),r)),n&&!a&&(a=t[n]),a}function y(e){if("string"==typeof e)return!0;if(Array.isArray(e)){if("string"!=typeof(null==e?void 0:e[0]))return!1;const r=null==e?void 0:e[1];if(void 0===r)return!0;if(r&&"object"==typeof r)return!0}return!1}function v(r,t){let n=r,a=t.split(".");for(const r of a){if("object"!=typeof n||Array.isArray(n)||e.isValidElement(n))return;n=n[r]}return n}function g(e){if(Array.isArray(e)){if(1===e.length)return{entry:e[0]};if(2===e.length)return{entry:e[0],metadata:e[1]}}return{entry:e}}function m(e){var r;const t=(null===(r=e["data-_gt"])||void 0===r?void 0:r.variableType)||"variable";return{variableName:d(e,t),variableType:t,variableValue:void 0!==e.value?e.value:void 0!==e["data-_gt-unformatted-value"]?e["data-_gt-unformatted-value"]:void 0!==e.children?e.children:void 0,variableOptions:(()=>{const r=Object.assign(Object.assign({},e.currency&&{currency:e.currency}),e.options&&Object.assign({},e.options));return Object.keys(r).length?r:"string"==typeof e["data-_gt-variable-options"]?JSON.parse(e["data-_gt-variable-options"]):e["data-_gt-variable-options"]||void 0})()}}function O(e){const r=e;if(r&&"object"==typeof r&&"string"==typeof r.key){const e=Object.keys(r);if(1===e.length)return!0;if(2===e.length){if("number"==typeof r.id)return!0;if("string"==typeof r.variable)return!0}if(3===e.length&&"string"==typeof r.variable&&"number"==typeof r.id)return!0}return!1}function j(e){return e&&e.props&&e.props["data-_gt"]?e.props["data-_gt"]:null}function _({children:r,defaultLocale:t=o,renderVariable:n}){const a=r=>e.isValidElement(r)?(r=>{const a=j(r);if("variable"===(null==a?void 0:a.transformation)){const{variableType:e,variableValue:a,variableOptions:i}=m(r.props);return n({variableType:e,variableValue:a,variableOptions:i,locales:[t]})}if("plural"===(null==a?void 0:a.transformation)){const e=a.branches||{};return l(h(r.props.n,[t],e)||r.props.children)}if("branch"===(null==a?void 0:a.transformation)){let e=r.props,{children:t,name:n,branch:o,"data-_gt":s}=e,c=i(e,["children","name","branch","data-_gt"]);return n=n||r.props["data-_gt-name"]||"branch",c=a.branches||{},l(void 0!==c[o]?c[o]:t)}return"fragment"===(null==a?void 0:a.transformation)?e.createElement(r.type,{key:r.props.key,children:l(r.props.children)}):r.props.children?e.cloneElement(r,Object.assign(Object.assign({},r.props),{"data-_gt":void 0,children:l(r.props.children)})):e.cloneElement(r,Object.assign(Object.assign({},r.props),{"data-_gt":void 0}))})(r):r,l=r=>Array.isArray(r)?e.Children.map(r,a):a(r);return l(r)}function w({sourceElement:r,targetElement:t,locales:n=[o],renderVariable:a}){var i,l;const{props:s}=r,c=s["data-_gt"],u=null==c?void 0:c.transformation;if("plural"===u){const e=r.props.n;return E({source:h(e,n,c.branches||{})||r.props.children,target:h(e,n,t.props["data-_gt"].branches||{})||t.props.children,locales:n,renderVariable:a})}if("branch"===u){let{name:e,branch:i,children:o}=s;e=e||r.props["data-_gt-name"]||"branch";return E({source:(c.branches||{})[i]||o,target:(t.props["data-_gt"].branches||{})[i]||t.props.children,locales:n,renderVariable:a})}return"fragment"===u&&(null===(i=t.props)||void 0===i?void 0:i.children)?e.createElement(r.type,{key:r.props.key,children:E({source:s.children,target:t.props.children,locales:n,renderVariable:a})}):(null==s?void 0:s.children)&&(null===(l=t.props)||void 0===l?void 0:l.children)?e.cloneElement(r,Object.assign(Object.assign({},s),{"data-_gt":void 0,children:E({source:s.children,target:t.props.children,locales:n,renderVariable:a})})):_({children:r,defaultLocale:n[0],renderVariable:a})}function E({source:r,target:n,locales:a=[o],renderVariable:i}){if(null==n&&r)return _({children:r,defaultLocale:a[0],renderVariable:i});if("string"==typeof n)return n;if(Array.isArray(n)&&!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r)&&Array.isArray(n)){const o={},l={},s=r.filter((r=>{if(e.isValidElement(r)){const e=j(r);if("variable"!==(null==e?void 0:e.transformation))return!0;{let{variableName:e,variableValue:t,variableOptions:n}=m(r.props);o[e]=t,l[e]=n}}})),c=e=>s.find((r=>{var t,n;const a=j(r);if(void 0!==(null==a?void 0:a.id)){return a.id===(null===(n=null===(t=null==e?void 0:e.props)||void 0===t?void 0:t["data-_gt"])||void 0===n?void 0:n.id)}return!1}))||s.shift();return n.map(((r,n)=>{if("string"==typeof r)return t(e.Fragment,{children:r},`string_${n}`);if(O(r))return t(e.Fragment,{children:i({variableType:r.variable||"variable",variableValue:o[r.key],variableOptions:l[r.key],locales:a})},`var_${n}`);const s=c(r);return s?t(e.Fragment,{children:w({sourceElement:s,targetElement:r,locales:a,renderVariable:i})},`element_${n}`):void 0}))}if(n&&"object"==typeof n&&!Array.isArray(n)){const t=O(n)?"variable":"element";if(e.isValidElement(r)){if("element"===t)return w({sourceElement:r,targetElement:n,locales:a,renderVariable:i});const e=j(r);if("variable"===(null==e?void 0:e.transformation)){const{variableValue:e,variableOptions:t,variableType:n}=m(r.props);return i({variableType:n,variableValue:e,variableOptions:t,locales:a})}}}return _({children:r,defaultLocale:a[0],renderVariable:i})}const A={method:"default",timeout:"undefined"!=typeof process&&"development"!==process.env.NODE_ENV?8e3:12e3};function V(){return""}class T extends Error{constructor(e,r){super(e),this.error=e,this.code=r,this.code=r}toTranslationError(){return{state:"error",error:this.error,code:this.code}}}export{T as GTTranslationError,c as addGTIdentifier,A as defaultRenderSettings,a as flattenDictionary,v as getDictionaryEntry,g as getEntryAndMetadata,h as getPluralBranch,d as getVariableName,m as getVariableProps,y as isValidDictionaryEntry,O as isVariableObject,_ as renderDefaultChildren,V as renderSkeleton,E as renderTranslatedChildren,b as writeChildrenAsObjects};
|
@@ -1,15 +1,8 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
|
-
|
2
|
+
import { RenderVariable } from '../../types/types';
|
3
|
+
export default function renderDefaultChildren({ children, defaultLocale, renderVariable, }: {
|
3
4
|
children: ReactNode;
|
4
|
-
variables?: Record<string, any>;
|
5
|
-
variablesOptions?: Record<string, any>;
|
6
5
|
defaultLocale: string;
|
7
|
-
renderVariable:
|
8
|
-
variableType: 'variable' | 'number' | 'datetime' | 'currency';
|
9
|
-
variableName: string;
|
10
|
-
variableValue: any;
|
11
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
12
|
-
locales: string[];
|
13
|
-
}) => React.JSX.Element;
|
6
|
+
renderVariable: RenderVariable;
|
14
7
|
}): React.ReactNode;
|
15
8
|
//# sourceMappingURL=renderDefaultChildren.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderDefaultChildren.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderDefaultChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"renderDefaultChildren.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderDefaultChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,QAAQ,EACR,aAAoC,EACpC,cAAc,GACf,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;CAChC,GAAG,KAAK,CAAC,SAAS,CAiElB"}
|
@@ -1,17 +1,9 @@
|
|
1
|
-
import
|
2
|
-
import { TranslatedChildren } from '../../types/types';
|
3
|
-
export default function renderTranslatedChildren({ source, target,
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { RenderVariable, TranslatedChildren } from '../../types/types';
|
3
|
+
export default function renderTranslatedChildren({ source, target, locales, renderVariable, }: {
|
4
4
|
source: ReactNode;
|
5
5
|
target: TranslatedChildren;
|
6
|
-
variables?: Record<string, any>;
|
7
|
-
variablesOptions?: Record<string, any>;
|
8
6
|
locales: string[];
|
9
|
-
renderVariable:
|
10
|
-
variableType: 'variable' | 'number' | 'datetime' | 'currency';
|
11
|
-
variableName: string;
|
12
|
-
variableValue: any;
|
13
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
14
|
-
locales: string[];
|
15
|
-
}) => React.JSX.Element;
|
7
|
+
renderVariable: RenderVariable;
|
16
8
|
}): ReactNode;
|
17
9
|
//# sourceMappingURL=renderTranslatedChildren.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderTranslatedChildren.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderTranslatedChildren.tsx"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"renderTranslatedChildren.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderTranslatedChildren.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EACL,cAAc,EACd,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AA+F3B,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,MAAM,EACN,MAAM,EACN,OAAgC,EAChC,cAAc,GACf,EAAE;IACD,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,cAAc,CAAC;CAChC,GAAG,SAAS,CA6HZ"}
|
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
variableValue: any;
|
5
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
6
|
-
locales: string[];
|
7
|
-
}): React.JSX.Element;
|
1
|
+
import { RenderVariable } from '../../types/types';
|
2
|
+
declare const renderVariable: RenderVariable;
|
3
|
+
export default renderVariable;
|
8
4
|
//# sourceMappingURL=renderVariable.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderVariable.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderVariable.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"renderVariable.d.ts","sourceRoot":"","sources":["../../../src/provider/rendering/renderVariable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAA,MAAM,cAAc,EAAE,cA0BrB,CAAC;AACF,eAAe,cAAc,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
@@ -94,4 +94,13 @@ export declare class GTTranslationError extends Error {
|
|
94
94
|
constructor(error: string, code: number);
|
95
95
|
toTranslationError(): TranslationError;
|
96
96
|
}
|
97
|
+
export type VariableProps = {
|
98
|
+
variableType: 'variable' | 'number' | 'datetime' | 'currency';
|
99
|
+
variableValue: any;
|
100
|
+
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
101
|
+
variableName: string;
|
102
|
+
};
|
103
|
+
export type RenderVariable = ({ variableType, variableValue, variableOptions, locales, }: Omit<VariableProps, 'variableName'> & {
|
104
|
+
locales: string[];
|
105
|
+
}) => React.JSX.Element;
|
97
106
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;AACpC,MAAM,MAAM,QAAQ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,MAAM,aAAa,GAAG;IAC1B,YAAY,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9D,aAAa,EAAE,GAAG,CAAC;IACnB,eAAe,EAAE,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,qBAAqB,CAAC;IACvE,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,EAC5B,YAAY,EACZ,aAAa,EACb,eAAe,EACf,OAAO,GACR,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG;IACvC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAE7E;AAED,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAqCA"}
|
@@ -5,26 +5,19 @@ import React from 'react';
|
|
5
5
|
*
|
6
6
|
* @example
|
7
7
|
* ```jsx
|
8
|
-
* <Currency
|
9
|
-
* name="price"
|
10
|
-
* currency="USD"
|
11
|
-
* >
|
8
|
+
* <Currency currency="USD">
|
12
9
|
* 1000
|
13
10
|
* </Currency>
|
14
11
|
* ```
|
15
12
|
*
|
16
13
|
* @param {any} [children] - Optional content to render inside the currency component.
|
17
|
-
* @param {string} [name] - Optional name for the currency field.
|
18
|
-
* @param {any} [value] - The default value to be used.
|
19
14
|
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
20
15
|
* @param {string[]} [locales] - Optional locales to use for currency formatting. If not provided, the library default locale (en-US) is used. If wrapped in a `<GTProvider>`, the user's locale is used.
|
21
16
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
22
17
|
* @returns {JSX.Element} The formatted currency component.
|
23
18
|
*/
|
24
|
-
declare function Currency({ children,
|
19
|
+
declare function Currency({ children, currency, locales, options, }: {
|
25
20
|
children?: any;
|
26
|
-
name?: string;
|
27
|
-
value?: any;
|
28
21
|
currency?: string;
|
29
22
|
locales?: string[];
|
30
23
|
options?: Intl.NumberFormatOptions;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,QAAgB,EAChB,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACpC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsBpB;kBAhCQ,QAAQ;;;AAqCjB,eAAe,QAAQ,CAAC"}
|
@@ -6,24 +6,18 @@ import React from 'react';
|
|
6
6
|
*
|
7
7
|
* @example
|
8
8
|
* ```jsx
|
9
|
-
* <DateTime
|
10
|
-
* name="createdAt"
|
11
|
-
* >
|
9
|
+
* <DateTime>
|
12
10
|
* {new Date()}
|
13
11
|
* </DateTime>
|
14
12
|
* ```
|
15
13
|
*
|
16
14
|
* @param {any} [children] - Optional content (typically a date) to render inside the component.
|
17
|
-
* @param {string} [name="date"] - Optional name for the date field, used for metadata purposes.
|
18
|
-
* @param {string|number|Date} [value] - The default value for the date. Can be a string, number (timestamp), or `Date` object.
|
19
15
|
* @param {string[]} [locales] - Optional locales to use for date formatting. If not provided, the library default locale (en-US) is used. If wrapped in a `<GTProvider>`, the user's locale is used.
|
20
16
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
21
17
|
* @returns {JSX.Element} The formatted date or time component.
|
22
18
|
*/
|
23
|
-
declare function DateTime({ children,
|
19
|
+
declare function DateTime({ children, locales, options, }: {
|
24
20
|
children?: any;
|
25
|
-
name?: string;
|
26
|
-
value?: any;
|
27
21
|
locales?: string[];
|
28
22
|
options?: Intl.DateTimeFormatOptions;
|
29
23
|
}): React.JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C
|
1
|
+
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CACtC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA6BpB;kBArCQ,QAAQ;;;AA0CjB,eAAe,QAAQ,CAAC"}
|
package/dist/variables/Num.d.ts
CHANGED
@@ -7,7 +7,6 @@ import React from 'react';
|
|
7
7
|
* @example
|
8
8
|
* ```jsx
|
9
9
|
* <Num
|
10
|
-
* name="quantity"
|
11
10
|
* options={{ style: "decimal", maximumFractionDigits: 2 }}
|
12
11
|
* >
|
13
12
|
* 1000
|
@@ -15,15 +14,11 @@ import React from 'react';
|
|
15
14
|
* ```
|
16
15
|
*
|
17
16
|
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
18
|
-
* @param {string} [name="n"] - Optional name for the number field, used for metadata purposes.
|
19
|
-
* @param {string|number} [value] - The default value for the number. Can be a string or number. Strings will be parsed to numbers.
|
20
17
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
21
18
|
* @returns {JSX.Element} The formatted number component.
|
22
19
|
*/
|
23
|
-
declare function Num({ children,
|
20
|
+
declare function Num({ children, locales, options, }: {
|
24
21
|
children?: any;
|
25
|
-
name?: string;
|
26
|
-
value?: any;
|
27
22
|
locales?: string[];
|
28
23
|
options?: Intl.NumberFormatOptions;
|
29
24
|
}): React.JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,GAAG,CAAC,EACX,QAAQ,EACR,OAAO,EACP,OAAY,GACb,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;CACpC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkBpB;kBA1BQ,GAAG;;;AA8BZ,eAAe,GAAG,CAAC"}
|
package/dist/variables/Var.d.ts
CHANGED
@@ -6,44 +6,23 @@ import React from 'react';
|
|
6
6
|
* @example Inline usage:
|
7
7
|
* ```jsx
|
8
8
|
* function MyComponent() {
|
9
|
+
* const name = 'Archie';
|
9
10
|
* return (
|
10
|
-
* <T
|
11
|
+
* <T>
|
11
12
|
* <p>
|
12
|
-
* Hello, <Var>
|
13
|
+
* Hello, <Var> {name} </Var>!
|
13
14
|
* </p>
|
14
15
|
* </T>
|
15
16
|
* );
|
16
17
|
* }
|
17
18
|
* ```
|
18
19
|
*
|
19
|
-
* @example Dictionary Usage:
|
20
|
-
* ```jsx
|
21
|
-
* // dictionary.js
|
22
|
-
* const dictionary = {
|
23
|
-
* user: "Hello {user-name}! Your dog's name is {dog-name}",
|
24
|
-
* }
|
25
|
-
*
|
26
|
-
* // component.jsx
|
27
|
-
* function MyComponent() {
|
28
|
-
* const t = useGT();
|
29
|
-
* return (
|
30
|
-
* <p>
|
31
|
-
* { t('user', { 'user-name': 'John', 'dog-name': 'Rex' }) }
|
32
|
-
* </p>
|
33
|
-
* );
|
34
|
-
* }
|
35
|
-
* ```
|
36
|
-
*
|
37
20
|
*
|
38
21
|
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
39
|
-
* @param {string} [name] - Optional name for the variable, used for metadata purposes.
|
40
|
-
* @param {any} [value] - The default value to be displayed if `children` is not provided.
|
41
22
|
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
42
23
|
*/
|
43
|
-
declare function Var({ children
|
24
|
+
declare function Var({ children }: {
|
44
25
|
children?: any;
|
45
|
-
name?: string;
|
46
|
-
value?: any;
|
47
26
|
}): React.JSX.Element;
|
48
27
|
declare namespace Var {
|
49
28
|
var gtTransformation: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B
|
1
|
+
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAEhE;kBAFQ,GAAG;;;AAMZ,eAAe,GAAG,CAAC"}
|
@@ -1,13 +1,9 @@
|
|
1
|
+
import { VariableProps } from '../types/types';
|
1
2
|
export default function getVariableProps(props: {
|
2
3
|
'data-_gt'?: {
|
3
4
|
transformation: 'variable';
|
4
5
|
[key: string]: any;
|
5
6
|
};
|
6
7
|
[key: string]: any;
|
7
|
-
}):
|
8
|
-
variableName: string;
|
9
|
-
variableType: "number" | "variable" | "datetime" | "currency";
|
10
|
-
variableValue?: any;
|
11
|
-
variableOptions?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
12
|
-
};
|
8
|
+
}): VariableProps;
|
13
9
|
//# sourceMappingURL=_getVariableProps.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"_getVariableProps.d.ts","sourceRoot":"","sources":["../../src/variables/_getVariableProps.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"_getVariableProps.d.ts","sourceRoot":"","sources":["../../src/variables/_getVariableProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE;IAC9C,UAAU,CAAC,EAAE;QACX,cAAc,EAAE,UAAU,CAAC;QAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,aAAa,CA2BhB"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export declare function getFallbackVariableName(variableType?: string): string;
|
2
1
|
export declare const baseVariablePrefix = "_gt_";
|
3
2
|
export default function getVariableName(props: Record<string, any> | undefined, variableType: string): string;
|
4
3
|
//# sourceMappingURL=getVariableName.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getVariableName.d.ts","sourceRoot":"","sources":["../../src/variables/getVariableName.ts"],"names":[],"mappings":"AAOA,
|
1
|
+
{"version":3,"file":"getVariableName.d.ts","sourceRoot":"","sources":["../../src/variables/getVariableName.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EAC/B,YAAY,EAAE,MAAM,GACnB,MAAM,CAIR"}
|