@sheet-i18n/react-client 1.0.3 → 1.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.
package/dist/index.js CHANGED
@@ -153,20 +153,20 @@ function useTranslation({
153
153
  i18nStore
154
154
  );
155
155
  const t = (id, values, opts, _descriptor) => {
156
- var _a;
156
+ var _a, _b, _c, _d;
157
157
  const descriptor = __spreadProps(__spreadValues({}, _descriptor != null ? _descriptor : {}), {
158
158
  id,
159
159
  defaultMessage: (_a = _descriptor == null ? void 0 : _descriptor.defaultMessage) != null ? _a : id
160
160
  });
161
- return intlInstance ? intlInstance.$t(descriptor, values, opts) : id;
161
+ return (_d = (_c = (_b = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _b.call(intlInstance, descriptor, values, opts)) != null ? _c : id) != null ? _d : "";
162
162
  };
163
163
  t.dynamic = (id, values, opts, _descriptor) => {
164
- var _a;
164
+ var _a, _b, _c, _d;
165
165
  const descriptor = __spreadProps(__spreadValues({}, _descriptor != null ? _descriptor : {}), {
166
166
  id,
167
167
  defaultMessage: (_a = _descriptor == null ? void 0 : _descriptor.defaultMessage) != null ? _a : id
168
168
  });
169
- return intlInstance ? intlInstance.$t(descriptor, values, opts) : id;
169
+ return (_d = (_c = (_b = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _b.call(intlInstance, descriptor, values, opts)) != null ? _c : id) != null ? _d : "";
170
170
  };
171
171
  return { t };
172
172
  }
@@ -201,8 +201,8 @@ function getTranslation({
201
201
  });
202
202
  return new Promise((resolve) => {
203
203
  intlInitPromise.then((intlInstance) => {
204
- var _a2, _b;
205
- resolve((_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id);
204
+ var _a2, _b, _c;
205
+ resolve((_c = (_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id) != null ? _c : "");
206
206
  });
207
207
  });
208
208
  };
@@ -214,8 +214,8 @@ function getTranslation({
214
214
  });
215
215
  return new Promise((resolve) => {
216
216
  intlInitPromise.then((intlInstance) => {
217
- var _a2, _b;
218
- resolve((_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id);
217
+ var _a2, _b, _c;
218
+ resolve((_c = (_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id) != null ? _c : "");
219
219
  });
220
220
  });
221
221
  };
package/dist/index.mjs CHANGED
@@ -130,20 +130,20 @@ function useTranslation({
130
130
  i18nStore
131
131
  );
132
132
  const t = (id, values, opts, _descriptor) => {
133
- var _a;
133
+ var _a, _b, _c, _d;
134
134
  const descriptor = __spreadProps(__spreadValues({}, _descriptor != null ? _descriptor : {}), {
135
135
  id,
136
136
  defaultMessage: (_a = _descriptor == null ? void 0 : _descriptor.defaultMessage) != null ? _a : id
137
137
  });
138
- return intlInstance ? intlInstance.$t(descriptor, values, opts) : id;
138
+ return (_d = (_c = (_b = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _b.call(intlInstance, descriptor, values, opts)) != null ? _c : id) != null ? _d : "";
139
139
  };
140
140
  t.dynamic = (id, values, opts, _descriptor) => {
141
- var _a;
141
+ var _a, _b, _c, _d;
142
142
  const descriptor = __spreadProps(__spreadValues({}, _descriptor != null ? _descriptor : {}), {
143
143
  id,
144
144
  defaultMessage: (_a = _descriptor == null ? void 0 : _descriptor.defaultMessage) != null ? _a : id
145
145
  });
146
- return intlInstance ? intlInstance.$t(descriptor, values, opts) : id;
146
+ return (_d = (_c = (_b = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _b.call(intlInstance, descriptor, values, opts)) != null ? _c : id) != null ? _d : "";
147
147
  };
148
148
  return { t };
149
149
  }
@@ -178,8 +178,8 @@ function getTranslation({
178
178
  });
179
179
  return new Promise((resolve) => {
180
180
  intlInitPromise.then((intlInstance) => {
181
- var _a2, _b;
182
- resolve((_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id);
181
+ var _a2, _b, _c;
182
+ resolve((_c = (_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id) != null ? _c : "");
183
183
  });
184
184
  });
185
185
  };
@@ -191,8 +191,8 @@ function getTranslation({
191
191
  });
192
192
  return new Promise((resolve) => {
193
193
  intlInitPromise.then((intlInstance) => {
194
- var _a2, _b;
195
- resolve((_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id);
194
+ var _a2, _b, _c;
195
+ resolve((_c = (_b = (_a2 = intlInstance == null ? void 0 : intlInstance.$t) == null ? void 0 : _a2.call(intlInstance, descriptor, values, opts)) != null ? _b : id) != null ? _c : "");
196
196
  });
197
197
  });
198
198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheet-i18n/react-client",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "a client package for react modules used by sheet-i18n",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -27,14 +27,14 @@
27
27
  "dependencies": {
28
28
  "react": "^18.2.0",
29
29
  "react-intl": "^7.0.4",
30
- "@sheet-i18n/shared-utils": "1.3.4",
31
- "@sheet-i18n/errors": "1.3.4",
32
- "@sheet-i18n/react-core": "1.0.2"
30
+ "@sheet-i18n/shared-utils": "1.3.5",
31
+ "@sheet-i18n/errors": "1.3.5",
32
+ "@sheet-i18n/react-core": "1.0.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/react": "^19.0.2",
36
36
  "@types/react-dom": "^19.0.2",
37
- "@sheet-i18n/typescript-config": "1.3.4"
37
+ "@sheet-i18n/typescript-config": "1.3.5"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup",