sanity-plugin-transifex 1.1.2 → 2.0.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/index.d.ts +10 -15
- package/dist/sanity-plugin-transifex.cjs.development.js +64 -302
- package/dist/sanity-plugin-transifex.cjs.development.js.map +1 -1
- package/dist/sanity-plugin-transifex.cjs.production.min.js +1 -1
- package/dist/sanity-plugin-transifex.cjs.production.min.js.map +1 -1
- package/dist/sanity-plugin-transifex.esm.js +50 -292
- package/dist/sanity-plugin-transifex.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +21 -30
- package/src/transifexAdapter.ts +1 -0
- package/dist/helpers.d.ts +0 -5
- package/src/helpers.ts +0 -114
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { TranslationsTab } from 'sanity-translations-tab';
|
|
2
|
-
import { BaseDocumentDeserializer, BaseDocumentSerializer, BaseDocumentMerger, defaultStopTypes, customSerializers } from 'sanity-naive-html-serializer';
|
|
1
|
+
import { TranslationsTab, findLatestDraft, BaseDocumentDeserializer, BaseDocumentSerializer, BaseDocumentMerger, defaultStopTypes, customSerializers, Adapter } from 'sanity-translations-tab';
|
|
3
2
|
import { TransifexAdapter } from './transifexAdapter';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
adapter: import("sanity-translations-tab").Adapter;
|
|
14
|
-
secretsNamespace: string;
|
|
15
|
-
};
|
|
16
|
-
export { TranslationsTab, BaseDocumentDeserializer, BaseDocumentSerializer, BaseDocumentMerger, defaultStopTypes, customSerializers, TransifexAdapter, defaultDocumentLevelConfig, defaultFieldLevelConfig, };
|
|
3
|
+
interface ConfigOptions {
|
|
4
|
+
adapter: Adapter;
|
|
5
|
+
secretsNamespace: string | null;
|
|
6
|
+
exportForTranslation: (id: string) => Promise<Record<string, any>>;
|
|
7
|
+
importTranslation: (id: string, localeId: string, doc: string) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
declare const defaultDocumentLevelConfig: ConfigOptions;
|
|
10
|
+
declare const defaultFieldLevelConfig: ConfigOptions;
|
|
11
|
+
export { TranslationsTab, findLatestDraft, BaseDocumentDeserializer, BaseDocumentSerializer, BaseDocumentMerger, defaultStopTypes, customSerializers, TransifexAdapter, defaultDocumentLevelConfig, defaultFieldLevelConfig, };
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
var sanityTranslationsTab = require('sanity-translations-tab');
|
|
8
|
-
var sanityNaiveHtmlSerializer = require('sanity-naive-html-serializer');
|
|
9
|
-
var sanityClient = _interopDefault(require('part:@sanity/base/client'));
|
|
10
6
|
|
|
11
7
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
12
8
|
try {
|
|
@@ -44,6 +40,24 @@ function _asyncToGenerator(fn) {
|
|
|
44
40
|
};
|
|
45
41
|
}
|
|
46
42
|
|
|
43
|
+
function _extends() {
|
|
44
|
+
_extends = Object.assign || function (target) {
|
|
45
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
46
|
+
var source = arguments[i];
|
|
47
|
+
|
|
48
|
+
for (var key in source) {
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
50
|
+
target[key] = source[key];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return target;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return _extends.apply(this, arguments);
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
function createCommonjsModule(fn, module) {
|
|
48
62
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
49
63
|
}
|
|
@@ -136,9 +150,9 @@ var runtime = (function (exports) {
|
|
|
136
150
|
// This is a polyfill for %IteratorPrototype% for environments that
|
|
137
151
|
// don't natively support it.
|
|
138
152
|
var IteratorPrototype = {};
|
|
139
|
-
IteratorPrototype
|
|
153
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
140
154
|
return this;
|
|
141
|
-
};
|
|
155
|
+
});
|
|
142
156
|
|
|
143
157
|
var getProto = Object.getPrototypeOf;
|
|
144
158
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
@@ -152,8 +166,9 @@ var runtime = (function (exports) {
|
|
|
152
166
|
|
|
153
167
|
var Gp = GeneratorFunctionPrototype.prototype =
|
|
154
168
|
Generator.prototype = Object.create(IteratorPrototype);
|
|
155
|
-
GeneratorFunction.prototype =
|
|
156
|
-
|
|
169
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
170
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
171
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
157
172
|
GeneratorFunction.displayName = define(
|
|
158
173
|
GeneratorFunctionPrototype,
|
|
159
174
|
toStringTagSymbol,
|
|
@@ -267,9 +282,9 @@ var runtime = (function (exports) {
|
|
|
267
282
|
}
|
|
268
283
|
|
|
269
284
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
270
|
-
AsyncIterator.prototype
|
|
285
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
271
286
|
return this;
|
|
272
|
-
};
|
|
287
|
+
});
|
|
273
288
|
exports.AsyncIterator = AsyncIterator;
|
|
274
289
|
|
|
275
290
|
// Note that simple async functions are implemented on top of
|
|
@@ -462,13 +477,13 @@ var runtime = (function (exports) {
|
|
|
462
477
|
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
463
478
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
464
479
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
465
|
-
Gp
|
|
480
|
+
define(Gp, iteratorSymbol, function() {
|
|
466
481
|
return this;
|
|
467
|
-
};
|
|
482
|
+
});
|
|
468
483
|
|
|
469
|
-
Gp
|
|
484
|
+
define(Gp, "toString", function() {
|
|
470
485
|
return "[object Generator]";
|
|
471
|
-
};
|
|
486
|
+
});
|
|
472
487
|
|
|
473
488
|
function pushTryEntry(locs) {
|
|
474
489
|
var entry = { tryLoc: locs[0] };
|
|
@@ -787,14 +802,19 @@ try {
|
|
|
787
802
|
} catch (accidentalStrictMode) {
|
|
788
803
|
// This module should not be running in strict mode, so the above
|
|
789
804
|
// assignment should always work unless something is misconfigured. Just
|
|
790
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
805
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
806
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
791
807
|
// strict mode using a global Function call. This could conceivably fail
|
|
792
808
|
// if a Content Security Policy forbids using Function, but in that case
|
|
793
809
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
794
810
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
795
811
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
796
812
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
797
|
-
|
|
813
|
+
if (typeof globalThis === "object") {
|
|
814
|
+
globalThis.regeneratorRuntime = runtime;
|
|
815
|
+
} else {
|
|
816
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
817
|
+
}
|
|
798
818
|
}
|
|
799
819
|
});
|
|
800
820
|
|
|
@@ -880,14 +900,13 @@ var getTranslationTask = /*#__PURE__*/function () {
|
|
|
880
900
|
if (res.ok) {
|
|
881
901
|
return res.json();
|
|
882
902
|
} //normal -- just means that this task doesn't exist yet.
|
|
883
|
-
else
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
903
|
+
else if (res.status === 404) {
|
|
904
|
+
return {
|
|
905
|
+
data: []
|
|
906
|
+
};
|
|
907
|
+
} else {
|
|
908
|
+
throw Error("Failed to retrieve tasks from Transifex. Status: " + res.status);
|
|
909
|
+
}
|
|
891
910
|
}).then(function (res) {
|
|
892
911
|
return {
|
|
893
912
|
taskId: projOrgSlug(secrets) + ":r:" + documentId,
|
|
@@ -1109,6 +1128,7 @@ var getTranslation = /*#__PURE__*/function () {
|
|
|
1109
1128
|
if (res.redirected) {
|
|
1110
1129
|
return resolve(handleFileDownload(res.url));
|
|
1111
1130
|
} else {
|
|
1131
|
+
console.log('no redirected, try again');
|
|
1112
1132
|
return res.json();
|
|
1113
1133
|
}
|
|
1114
1134
|
});
|
|
@@ -1158,314 +1178,56 @@ var TransifexAdapter = {
|
|
|
1158
1178
|
getTranslation: getTranslation
|
|
1159
1179
|
};
|
|
1160
1180
|
|
|
1161
|
-
var
|
|
1162
|
-
apiVersion: '2021-03-25'
|
|
1163
|
-
}); //document fetch
|
|
1164
|
-
|
|
1165
|
-
var findLatestDraft = function findLatestDraft(documentId) {
|
|
1166
|
-
//eliminates i18n versions
|
|
1167
|
-
var query = "*[_id == $id || _id == $draftId]";
|
|
1168
|
-
var params = {
|
|
1169
|
-
id: "" + documentId,
|
|
1170
|
-
draftId: "drafts." + documentId
|
|
1171
|
-
};
|
|
1172
|
-
return client.fetch(query, params).then(function (docs) {
|
|
1173
|
-
var _docs$find;
|
|
1174
|
-
|
|
1175
|
-
return (_docs$find = docs.find(function (doc) {
|
|
1176
|
-
return doc._id.includes('draft');
|
|
1177
|
-
})) != null ? _docs$find : docs[0];
|
|
1178
|
-
});
|
|
1179
|
-
}; //revision fetch
|
|
1180
|
-
|
|
1181
|
-
var findDocumentAtRevision = /*#__PURE__*/function () {
|
|
1182
|
-
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(documentId, rev) {
|
|
1183
|
-
var dataset, baseUrl, url, revisionDoc;
|
|
1184
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1185
|
-
while (1) {
|
|
1186
|
-
switch (_context.prev = _context.next) {
|
|
1187
|
-
case 0:
|
|
1188
|
-
dataset = client.config().dataset;
|
|
1189
|
-
baseUrl = "/data/history/" + dataset + "/documents/" + documentId + "?revision=" + rev;
|
|
1190
|
-
url = client.getUrl(baseUrl);
|
|
1191
|
-
_context.next = 5;
|
|
1192
|
-
return fetch(url, {
|
|
1193
|
-
credentials: 'include'
|
|
1194
|
-
}).then(function (req) {
|
|
1195
|
-
return req.json();
|
|
1196
|
-
}).then(function (req) {
|
|
1197
|
-
return req.documents[0];
|
|
1198
|
-
});
|
|
1199
|
-
|
|
1200
|
-
case 5:
|
|
1201
|
-
revisionDoc = _context.sent;
|
|
1202
|
-
|
|
1203
|
-
if (!(!revisionDoc || revisionDoc._rev !== rev)) {
|
|
1204
|
-
_context.next = 12;
|
|
1205
|
-
break;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
baseUrl = "/data/history/" + dataset + "/documents/drafts." + documentId + "?revision=" + rev;
|
|
1209
|
-
url = client.getUrl(baseUrl);
|
|
1210
|
-
_context.next = 11;
|
|
1211
|
-
return fetch(url, {
|
|
1212
|
-
credentials: 'include'
|
|
1213
|
-
}).then(function (req) {
|
|
1214
|
-
return req.json();
|
|
1215
|
-
}).then(function (req) {
|
|
1216
|
-
return req.documents[0];
|
|
1217
|
-
});
|
|
1218
|
-
|
|
1219
|
-
case 11:
|
|
1220
|
-
revisionDoc = _context.sent;
|
|
1221
|
-
|
|
1222
|
-
case 12:
|
|
1223
|
-
return _context.abrupt("return", revisionDoc);
|
|
1224
|
-
|
|
1225
|
-
case 13:
|
|
1226
|
-
case "end":
|
|
1227
|
-
return _context.stop();
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}, _callee);
|
|
1231
|
-
}));
|
|
1232
|
-
|
|
1233
|
-
return function findDocumentAtRevision(_x, _x2) {
|
|
1234
|
-
return _ref.apply(this, arguments);
|
|
1235
|
-
};
|
|
1236
|
-
}(); //document-level patch
|
|
1237
|
-
|
|
1238
|
-
var documentLevelPatch = /*#__PURE__*/function () {
|
|
1239
|
-
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(documentId, translatedFields, localeId) {
|
|
1240
|
-
var baseDoc, merged, targetId, i18nDoc, cleanedMerge;
|
|
1241
|
-
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1242
|
-
while (1) {
|
|
1243
|
-
switch (_context2.prev = _context2.next) {
|
|
1244
|
-
case 0:
|
|
1245
|
-
if (!translatedFields._rev) {
|
|
1246
|
-
_context2.next = 6;
|
|
1247
|
-
break;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
_context2.next = 3;
|
|
1251
|
-
return findDocumentAtRevision(documentId, translatedFields._rev);
|
|
1252
|
-
|
|
1253
|
-
case 3:
|
|
1254
|
-
baseDoc = _context2.sent;
|
|
1255
|
-
_context2.next = 9;
|
|
1256
|
-
break;
|
|
1257
|
-
|
|
1258
|
-
case 6:
|
|
1259
|
-
_context2.next = 8;
|
|
1260
|
-
return findLatestDraft(documentId);
|
|
1261
|
-
|
|
1262
|
-
case 8:
|
|
1263
|
-
baseDoc = _context2.sent;
|
|
1264
|
-
|
|
1265
|
-
case 9:
|
|
1266
|
-
merged = sanityNaiveHtmlSerializer.BaseDocumentMerger.documentLevelMerge(translatedFields, baseDoc);
|
|
1267
|
-
targetId = "i18n." + documentId + "." + localeId;
|
|
1268
|
-
_context2.next = 13;
|
|
1269
|
-
return findLatestDraft(targetId);
|
|
1270
|
-
|
|
1271
|
-
case 13:
|
|
1272
|
-
i18nDoc = _context2.sent;
|
|
1273
|
-
|
|
1274
|
-
if (i18nDoc) {
|
|
1275
|
-
cleanedMerge = {}; //don't overwrite any existing values on the i18n doc
|
|
1276
|
-
|
|
1277
|
-
Object.entries(merged).forEach(function (_ref3) {
|
|
1278
|
-
var key = _ref3[0],
|
|
1279
|
-
value = _ref3[1];
|
|
1280
|
-
|
|
1281
|
-
if (Object.keys(translatedFields).includes(key) && !['_id', '_rev', '_updatedAt'].includes(key)) {
|
|
1282
|
-
cleanedMerge[key] = value;
|
|
1283
|
-
}
|
|
1284
|
-
});
|
|
1285
|
-
client.transaction() //@ts-ignore
|
|
1286
|
-
.patch(i18nDoc._id, function (p) {
|
|
1287
|
-
return p.set(cleanedMerge);
|
|
1288
|
-
}).commit();
|
|
1289
|
-
} else {
|
|
1290
|
-
merged._id = "drafts." + targetId; //account for legacy implementations of i18n plugin lang
|
|
1291
|
-
|
|
1292
|
-
if (baseDoc._lang) {
|
|
1293
|
-
merged._lang = localeId;
|
|
1294
|
-
} else if (baseDoc.__i18n_lang) {
|
|
1295
|
-
merged.__i18n_lang = localeId;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
client.create(merged);
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
case 15:
|
|
1302
|
-
case "end":
|
|
1303
|
-
return _context2.stop();
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
}, _callee2);
|
|
1307
|
-
}));
|
|
1308
|
-
|
|
1309
|
-
return function documentLevelPatch(_x3, _x4, _x5) {
|
|
1310
|
-
return _ref2.apply(this, arguments);
|
|
1311
|
-
};
|
|
1312
|
-
}(); //field level patch
|
|
1313
|
-
|
|
1314
|
-
var fieldLevelPatch = /*#__PURE__*/function () {
|
|
1315
|
-
var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(documentId, translatedFields, localeId) {
|
|
1316
|
-
var baseDoc, merged;
|
|
1317
|
-
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1318
|
-
while (1) {
|
|
1319
|
-
switch (_context3.prev = _context3.next) {
|
|
1320
|
-
case 0:
|
|
1321
|
-
if (!translatedFields._rev) {
|
|
1322
|
-
_context3.next = 6;
|
|
1323
|
-
break;
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
_context3.next = 3;
|
|
1327
|
-
return findDocumentAtRevision(documentId, translatedFields._rev);
|
|
1328
|
-
|
|
1329
|
-
case 3:
|
|
1330
|
-
baseDoc = _context3.sent;
|
|
1331
|
-
_context3.next = 9;
|
|
1332
|
-
break;
|
|
1333
|
-
|
|
1334
|
-
case 6:
|
|
1335
|
-
_context3.next = 8;
|
|
1336
|
-
return findLatestDraft(documentId);
|
|
1337
|
-
|
|
1338
|
-
case 8:
|
|
1339
|
-
baseDoc = _context3.sent;
|
|
1340
|
-
|
|
1341
|
-
case 9:
|
|
1342
|
-
merged = sanityNaiveHtmlSerializer.BaseDocumentMerger.fieldLevelMerge(translatedFields, baseDoc, localeId, 'en');
|
|
1343
|
-
client.patch(baseDoc._id).set(merged).commit();
|
|
1344
|
-
|
|
1345
|
-
case 11:
|
|
1346
|
-
case "end":
|
|
1347
|
-
return _context3.stop();
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
}, _callee3);
|
|
1351
|
-
}));
|
|
1352
|
-
|
|
1353
|
-
return function fieldLevelPatch(_x6, _x7, _x8) {
|
|
1354
|
-
return _ref4.apply(this, arguments);
|
|
1355
|
-
};
|
|
1356
|
-
}();
|
|
1357
|
-
|
|
1358
|
-
var defaultDocumentLevelConfig = {
|
|
1359
|
-
exportForTranslation: /*#__PURE__*/function () {
|
|
1360
|
-
var _exportForTranslation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(id) {
|
|
1361
|
-
var doc, serialized;
|
|
1362
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1363
|
-
while (1) {
|
|
1364
|
-
switch (_context.prev = _context.next) {
|
|
1365
|
-
case 0:
|
|
1366
|
-
_context.next = 2;
|
|
1367
|
-
return findLatestDraft(id);
|
|
1368
|
-
|
|
1369
|
-
case 2:
|
|
1370
|
-
doc = _context.sent;
|
|
1371
|
-
serialized = sanityNaiveHtmlSerializer.BaseDocumentSerializer.serializeDocument(doc, 'document');
|
|
1372
|
-
serialized.name = id;
|
|
1373
|
-
return _context.abrupt("return", serialized);
|
|
1374
|
-
|
|
1375
|
-
case 6:
|
|
1376
|
-
case "end":
|
|
1377
|
-
return _context.stop();
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
}, _callee);
|
|
1381
|
-
}));
|
|
1382
|
-
|
|
1383
|
-
function exportForTranslation(_x) {
|
|
1384
|
-
return _exportForTranslation.apply(this, arguments);
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
return exportForTranslation;
|
|
1388
|
-
}(),
|
|
1389
|
-
importTranslation: function importTranslation(id, localeId, document) {
|
|
1390
|
-
var deserialized = sanityNaiveHtmlSerializer.BaseDocumentDeserializer.deserializeDocument(document);
|
|
1391
|
-
documentLevelPatch(id, deserialized, localeId);
|
|
1392
|
-
},
|
|
1181
|
+
var defaultDocumentLevelConfig = /*#__PURE__*/_extends({}, sanityTranslationsTab.baseDocumentLevelConfig, {
|
|
1393
1182
|
adapter: TransifexAdapter,
|
|
1394
1183
|
secretsNamespace: 'transifex'
|
|
1395
|
-
};
|
|
1396
|
-
var defaultFieldLevelConfig = {
|
|
1397
|
-
exportForTranslation: /*#__PURE__*/function () {
|
|
1398
|
-
var _exportForTranslation2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(id) {
|
|
1399
|
-
var doc, serialized;
|
|
1400
|
-
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1401
|
-
while (1) {
|
|
1402
|
-
switch (_context2.prev = _context2.next) {
|
|
1403
|
-
case 0:
|
|
1404
|
-
_context2.next = 2;
|
|
1405
|
-
return findLatestDraft(id);
|
|
1406
|
-
|
|
1407
|
-
case 2:
|
|
1408
|
-
doc = _context2.sent;
|
|
1409
|
-
serialized = sanityNaiveHtmlSerializer.BaseDocumentSerializer.serializeDocument(doc, 'field');
|
|
1410
|
-
serialized.name = id;
|
|
1411
|
-
return _context2.abrupt("return", serialized);
|
|
1412
|
-
|
|
1413
|
-
case 6:
|
|
1414
|
-
case "end":
|
|
1415
|
-
return _context2.stop();
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
}, _callee2);
|
|
1419
|
-
}));
|
|
1420
|
-
|
|
1421
|
-
function exportForTranslation(_x2) {
|
|
1422
|
-
return _exportForTranslation2.apply(this, arguments);
|
|
1423
|
-
}
|
|
1184
|
+
});
|
|
1424
1185
|
|
|
1425
|
-
|
|
1426
|
-
}(),
|
|
1427
|
-
importTranslation: function importTranslation(id, localeId, document) {
|
|
1428
|
-
var deserialized = sanityNaiveHtmlSerializer.BaseDocumentDeserializer.deserializeDocument(document);
|
|
1429
|
-
fieldLevelPatch(id, deserialized, localeId);
|
|
1430
|
-
},
|
|
1186
|
+
var defaultFieldLevelConfig = /*#__PURE__*/_extends({}, sanityTranslationsTab.baseFieldLevelConfig, {
|
|
1431
1187
|
adapter: TransifexAdapter,
|
|
1432
1188
|
secretsNamespace: 'transifex'
|
|
1433
|
-
};
|
|
1189
|
+
});
|
|
1434
1190
|
|
|
1435
|
-
Object.defineProperty(exports, '
|
|
1191
|
+
Object.defineProperty(exports, 'BaseDocumentDeserializer', {
|
|
1436
1192
|
enumerable: true,
|
|
1437
1193
|
get: function () {
|
|
1438
|
-
return sanityTranslationsTab.
|
|
1194
|
+
return sanityTranslationsTab.BaseDocumentDeserializer;
|
|
1439
1195
|
}
|
|
1440
1196
|
});
|
|
1441
|
-
Object.defineProperty(exports, '
|
|
1197
|
+
Object.defineProperty(exports, 'BaseDocumentMerger', {
|
|
1442
1198
|
enumerable: true,
|
|
1443
1199
|
get: function () {
|
|
1444
|
-
return
|
|
1200
|
+
return sanityTranslationsTab.BaseDocumentMerger;
|
|
1445
1201
|
}
|
|
1446
1202
|
});
|
|
1447
|
-
Object.defineProperty(exports, '
|
|
1203
|
+
Object.defineProperty(exports, 'BaseDocumentSerializer', {
|
|
1448
1204
|
enumerable: true,
|
|
1449
1205
|
get: function () {
|
|
1450
|
-
return
|
|
1206
|
+
return sanityTranslationsTab.BaseDocumentSerializer;
|
|
1451
1207
|
}
|
|
1452
1208
|
});
|
|
1453
|
-
Object.defineProperty(exports, '
|
|
1209
|
+
Object.defineProperty(exports, 'TranslationsTab', {
|
|
1454
1210
|
enumerable: true,
|
|
1455
1211
|
get: function () {
|
|
1456
|
-
return
|
|
1212
|
+
return sanityTranslationsTab.TranslationsTab;
|
|
1457
1213
|
}
|
|
1458
1214
|
});
|
|
1459
1215
|
Object.defineProperty(exports, 'customSerializers', {
|
|
1460
1216
|
enumerable: true,
|
|
1461
1217
|
get: function () {
|
|
1462
|
-
return
|
|
1218
|
+
return sanityTranslationsTab.customSerializers;
|
|
1463
1219
|
}
|
|
1464
1220
|
});
|
|
1465
1221
|
Object.defineProperty(exports, 'defaultStopTypes', {
|
|
1466
1222
|
enumerable: true,
|
|
1467
1223
|
get: function () {
|
|
1468
|
-
return
|
|
1224
|
+
return sanityTranslationsTab.defaultStopTypes;
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
Object.defineProperty(exports, 'findLatestDraft', {
|
|
1228
|
+
enumerable: true,
|
|
1229
|
+
get: function () {
|
|
1230
|
+
return sanityTranslationsTab.findLatestDraft;
|
|
1469
1231
|
}
|
|
1470
1232
|
});
|
|
1471
1233
|
exports.TransifexAdapter = TransifexAdapter;
|