@uniformdev/tms-sdk 19.154.1-alpha.26 → 19.154.1-alpha.27

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.mts CHANGED
@@ -16,7 +16,6 @@ type TranslationPayload = {
16
16
  id: string;
17
17
  slug: string | null | undefined;
18
18
  };
19
- overrideModifiedTargetLocale: boolean;
20
19
  };
21
20
  components: {
22
21
  [componentId: string]: ComponentTranslationPayload | undefined;
@@ -36,7 +35,7 @@ type CollectTranslationPayloadResult = {
36
35
  errorKind?: 'unknown' | 'invalid-args' | 'entity-source-locale-missing';
37
36
  errorText?: string;
38
37
  };
39
- declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocale, uniformTargetLocale, uniformReleaseId, targetLang, entity, entityType, overrideModifiedTargetLocale, }: {
38
+ declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocale, uniformTargetLocale, uniformReleaseId, targetLang, entity, entityType, }: {
40
39
  uniformProjectId: string;
41
40
  uniformSourceLocale: string;
42
41
  uniformTargetLocale: string;
@@ -44,10 +43,6 @@ declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocal
44
43
  targetLang: string;
45
44
  entity: RootComponentInstance | EntryData;
46
45
  entityType: EntityType;
47
- /**
48
- * Ignore modified content in target locales and collect all supported parameters for translation
49
- */
50
- overrideModifiedTargetLocale: boolean;
51
46
  }) => CollectTranslationPayloadResult;
52
47
 
53
48
  declare const getCompositionForTranslation: ({ canvasClient, compositionId, releaseId, state, }: {
@@ -113,16 +108,14 @@ declare const mergeTranslationToUniform: ({ canvasClient, contentClient, transla
113
108
  entityId?: string | undefined;
114
109
  }>;
115
110
 
116
- declare const translateComposition: ({ composition, translationPayload, overrideModifiedTargetLocale, }: {
111
+ declare const translateComposition: ({ composition, translationPayload, }: {
117
112
  composition: CompositionGetResponse;
118
113
  translationPayload: TranslationPayload;
119
- overrideModifiedTargetLocale: boolean;
120
114
  }) => EntityTranslationResult<CompositionGetResponse>;
121
115
 
122
- declare const translateEntry: ({ entry, translationPayload, overrideModifiedTargetLocale, }: {
116
+ declare const translateEntry: ({ entry, translationPayload, }: {
123
117
  entry: Entry;
124
118
  translationPayload: TranslationPayload;
125
- overrideModifiedTargetLocale: boolean;
126
119
  }) => EntityTranslationResult<Entry>;
127
120
 
128
121
  export { type CollectTranslationPayloadResult, type ComponentTranslationPayload, type EntityTranslationResult, type EntityType, type MaybePromise, type MergeCompositionTranslationToUniformOptions, type MergeEntryTranslationToUniformOptions, type MergeTranslationToUniformOptions, type TranslationPayload, collectTranslationPayload, getCompositionForTranslation, getEntryForTranslation, mergeCompositionTranslationToUniform, mergeEntryTranslationToUniform, mergeTranslationToUniform, translateComposition, translateEntry };
package/dist/index.d.ts CHANGED
@@ -16,7 +16,6 @@ type TranslationPayload = {
16
16
  id: string;
17
17
  slug: string | null | undefined;
18
18
  };
19
- overrideModifiedTargetLocale: boolean;
20
19
  };
21
20
  components: {
22
21
  [componentId: string]: ComponentTranslationPayload | undefined;
@@ -36,7 +35,7 @@ type CollectTranslationPayloadResult = {
36
35
  errorKind?: 'unknown' | 'invalid-args' | 'entity-source-locale-missing';
37
36
  errorText?: string;
38
37
  };
39
- declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocale, uniformTargetLocale, uniformReleaseId, targetLang, entity, entityType, overrideModifiedTargetLocale, }: {
38
+ declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocale, uniformTargetLocale, uniformReleaseId, targetLang, entity, entityType, }: {
40
39
  uniformProjectId: string;
41
40
  uniformSourceLocale: string;
42
41
  uniformTargetLocale: string;
@@ -44,10 +43,6 @@ declare const collectTranslationPayload: ({ uniformProjectId, uniformSourceLocal
44
43
  targetLang: string;
45
44
  entity: RootComponentInstance | EntryData;
46
45
  entityType: EntityType;
47
- /**
48
- * Ignore modified content in target locales and collect all supported parameters for translation
49
- */
50
- overrideModifiedTargetLocale: boolean;
51
46
  }) => CollectTranslationPayloadResult;
52
47
 
53
48
  declare const getCompositionForTranslation: ({ canvasClient, compositionId, releaseId, state, }: {
@@ -113,16 +108,14 @@ declare const mergeTranslationToUniform: ({ canvasClient, contentClient, transla
113
108
  entityId?: string | undefined;
114
109
  }>;
115
110
 
116
- declare const translateComposition: ({ composition, translationPayload, overrideModifiedTargetLocale, }: {
111
+ declare const translateComposition: ({ composition, translationPayload, }: {
117
112
  composition: CompositionGetResponse;
118
113
  translationPayload: TranslationPayload;
119
- overrideModifiedTargetLocale: boolean;
120
114
  }) => EntityTranslationResult<CompositionGetResponse>;
121
115
 
122
- declare const translateEntry: ({ entry, translationPayload, overrideModifiedTargetLocale, }: {
116
+ declare const translateEntry: ({ entry, translationPayload, }: {
123
117
  entry: Entry;
124
118
  translationPayload: TranslationPayload;
125
- overrideModifiedTargetLocale: boolean;
126
119
  }) => EntityTranslationResult<Entry>;
127
120
 
128
121
  export { type CollectTranslationPayloadResult, type ComponentTranslationPayload, type EntityTranslationResult, type EntityType, type MaybePromise, type MergeCompositionTranslationToUniformOptions, type MergeEntryTranslationToUniformOptions, type MergeTranslationToUniformOptions, type TranslationPayload, collectTranslationPayload, getCompositionForTranslation, getEntryForTranslation, mergeCompositionTranslationToUniform, mergeEntryTranslationToUniform, mergeTranslationToUniform, translateComposition, translateEntry };
package/dist/index.esm.js CHANGED
@@ -33,7 +33,6 @@ var createErrorResult = (errorKind) => {
33
33
  var processComponentTranslation = ({
34
34
  uniformSourceLocale,
35
35
  uniformTargetLocale,
36
- overrideModifiedTargetLocale,
37
36
  originalNode,
38
37
  translatedComponent
39
38
  }) => {
@@ -53,7 +52,6 @@ var processComponentTranslation = ({
53
52
  const result = processParameterTranslation({
54
53
  uniformSourceLocale,
55
54
  uniformTargetLocale,
56
- overrideModifiedTargetLocale,
57
55
  originalParameter,
58
56
  parameter
59
57
  });
@@ -70,7 +68,6 @@ var processComponentTranslation = ({
70
68
  const result = processOverrideTranslation({
71
69
  uniformSourceLocale,
72
70
  uniformTargetLocale,
73
- overrideModifiedTargetLocale,
74
71
  originalOverride,
75
72
  override
76
73
  });
@@ -83,7 +80,6 @@ var processComponentTranslation = ({
83
80
  var processParameterTranslation = ({
84
81
  uniformSourceLocale,
85
82
  uniformTargetLocale,
86
- overrideModifiedTargetLocale,
87
83
  originalParameter,
88
84
  parameter
89
85
  }) => {
@@ -102,7 +98,7 @@ var processParameterTranslation = ({
102
98
  left: originalParameter.locales[uniformSourceLocale],
103
99
  right: sourceValue
104
100
  });
105
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
101
+ const isTargetValueUntouched = isSameParameterValue({
106
102
  parameterType: originalParameter.type,
107
103
  left: originalParameter.locales[uniformTargetLocale],
108
104
  right: originalTargetValue
@@ -116,7 +112,6 @@ var processParameterTranslation = ({
116
112
  var processOverrideTranslation = ({
117
113
  uniformSourceLocale,
118
114
  uniformTargetLocale,
119
- overrideModifiedTargetLocale,
120
115
  originalOverride,
121
116
  override
122
117
  }) => {
@@ -139,7 +134,7 @@ var processOverrideTranslation = ({
139
134
  left: originalParameter.locales[uniformSourceLocale],
140
135
  right: sourceValue
141
136
  });
142
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
137
+ const isTargetValueUntouched = isSameParameterValue({
143
138
  parameterType: originalParameter.type,
144
139
  left: originalParameter.locales[uniformTargetLocale],
145
140
  right: originalTargetValue
@@ -178,7 +173,6 @@ var processOverrideTranslation = ({
178
173
  const { updated: isComponentUpdated } = processComponentTranslation({
179
174
  uniformSourceLocale,
180
175
  uniformTargetLocale,
181
- overrideModifiedTargetLocale,
182
176
  originalNode: originalComponent,
183
177
  translatedComponent: component
184
178
  });
@@ -236,8 +230,7 @@ var collectTranslationPayload = ({
236
230
  uniformReleaseId,
237
231
  targetLang,
238
232
  entity,
239
- entityType,
240
- overrideModifiedTargetLocale
233
+ entityType
241
234
  }) => {
242
235
  if (!uniformSourceLocale || !uniformTargetLocale || !targetLang || !entity) {
243
236
  return createErrorResult2("invalid-args");
@@ -257,8 +250,7 @@ var collectTranslationPayload = ({
257
250
  entity: {
258
251
  id: entity._id,
259
252
  slug: entity._slug || ""
260
- },
261
- overrideModifiedTargetLocale
253
+ }
262
254
  },
263
255
  components: {}
264
256
  };
@@ -270,7 +262,6 @@ var collectTranslationPayload = ({
270
262
  const { _id, type, parameters, _overrides } = collectFromNode({
271
263
  uniformSourceLocale,
272
264
  uniformTargetLocale,
273
- overrideModifiedTargetLocale,
274
265
  node,
275
266
  deep: false
276
267
  });
@@ -288,7 +279,6 @@ var collectTranslationPayload = ({
288
279
  var collectFromNode = ({
289
280
  uniformSourceLocale,
290
281
  uniformTargetLocale,
291
- overrideModifiedTargetLocale,
292
282
  node,
293
283
  deep
294
284
  }) => {
@@ -305,7 +295,7 @@ var collectFromNode = ({
305
295
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
306
296
  return;
307
297
  }
308
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
298
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
309
299
  return;
310
300
  }
311
301
  collectedParameters[paramKey] = {
@@ -327,7 +317,6 @@ var collectFromNode = ({
327
317
  const collectedNode = collectFromNode({
328
318
  uniformSourceLocale,
329
319
  uniformTargetLocale,
330
- overrideModifiedTargetLocale,
331
320
  node: slotComponent,
332
321
  deep: true
333
322
  });
@@ -348,7 +337,7 @@ var collectFromNode = ({
348
337
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
349
338
  return;
350
339
  }
351
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
340
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
352
341
  return;
353
342
  }
354
343
  (_c2 = collectedOverrides[overrideKey]) != null ? _c2 : collectedOverrides[overrideKey] = {};
@@ -371,7 +360,6 @@ var collectFromNode = ({
371
360
  const collectedNode = collectFromNode({
372
361
  uniformSourceLocale,
373
362
  uniformTargetLocale,
374
- overrideModifiedTargetLocale,
375
363
  node: slotComponent,
376
364
  // keep tree structure for `Slot Sections`
377
365
  // to store whole `override` content in scope of current component
@@ -496,8 +484,7 @@ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, walkNodeTree as walkNodeTree
496
484
  import { produce } from "immer";
497
485
  var translateComposition = ({
498
486
  composition,
499
- translationPayload,
500
- overrideModifiedTargetLocale
487
+ translationPayload
501
488
  }) => {
502
489
  var _a;
503
490
  if (!composition || !composition.composition || !translationPayload) {
@@ -539,7 +526,6 @@ var translateComposition = ({
539
526
  const { updated: isComponentUpdated } = processComponentTranslation({
540
527
  uniformSourceLocale,
541
528
  uniformTargetLocale,
542
- overrideModifiedTargetLocale,
543
529
  originalNode: component,
544
530
  translatedComponent
545
531
  });
@@ -564,7 +550,6 @@ var mergeCompositionTranslationToUniform = async ({
564
550
  }
565
551
  const entityType = translationPayload.metadata.entityType;
566
552
  const entityId = translationPayload.metadata.entity.id;
567
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
568
553
  if (entityType !== "composition" && entityType !== "componentPattern") {
569
554
  return { translationMerged: false, entityId };
570
555
  }
@@ -580,8 +565,7 @@ var mergeCompositionTranslationToUniform = async ({
580
565
  }
581
566
  const translationResult = translateComposition({
582
567
  composition,
583
- translationPayload,
584
- overrideModifiedTargetLocale
568
+ translationPayload
585
569
  });
586
570
  const { updated, errorKind, errorText, result: translatedComposition } = translationResult;
587
571
  if (translatedComposition && updated && !errorKind) {
@@ -626,8 +610,7 @@ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE5, walkNodeTree as walkNodeTree
626
610
  import { produce as produce2 } from "immer";
627
611
  var translateEntry = ({
628
612
  entry,
629
- translationPayload,
630
- overrideModifiedTargetLocale
613
+ translationPayload
631
614
  }) => {
632
615
  var _a;
633
616
  if (!entry || !translationPayload) {
@@ -669,7 +652,6 @@ var translateEntry = ({
669
652
  const { updated: isComponentUpdated } = processComponentTranslation({
670
653
  uniformSourceLocale,
671
654
  uniformTargetLocale,
672
- overrideModifiedTargetLocale,
673
655
  originalNode: component,
674
656
  translatedComponent
675
657
  });
@@ -694,7 +676,6 @@ var mergeEntryTranslationToUniform = async ({
694
676
  }
695
677
  const entityType = translationPayload.metadata.entityType;
696
678
  const entityId = translationPayload.metadata.entity.id;
697
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
698
679
  if (entityType !== "entry" && entityType !== "entryPattern") {
699
680
  return { translationMerged: false, entityId };
700
681
  }
@@ -710,8 +691,7 @@ var mergeEntryTranslationToUniform = async ({
710
691
  }
711
692
  const translationResult = translateEntry({
712
693
  entry,
713
- translationPayload,
714
- overrideModifiedTargetLocale
694
+ translationPayload
715
695
  });
716
696
  const { updated, errorKind, errorText, result: translatedEntry } = translationResult;
717
697
  if (translatedEntry && updated && !errorKind) {
package/dist/index.js CHANGED
@@ -61,7 +61,6 @@ var createErrorResult = (errorKind) => {
61
61
  var processComponentTranslation = ({
62
62
  uniformSourceLocale,
63
63
  uniformTargetLocale,
64
- overrideModifiedTargetLocale,
65
64
  originalNode,
66
65
  translatedComponent
67
66
  }) => {
@@ -81,7 +80,6 @@ var processComponentTranslation = ({
81
80
  const result = processParameterTranslation({
82
81
  uniformSourceLocale,
83
82
  uniformTargetLocale,
84
- overrideModifiedTargetLocale,
85
83
  originalParameter,
86
84
  parameter
87
85
  });
@@ -98,7 +96,6 @@ var processComponentTranslation = ({
98
96
  const result = processOverrideTranslation({
99
97
  uniformSourceLocale,
100
98
  uniformTargetLocale,
101
- overrideModifiedTargetLocale,
102
99
  originalOverride,
103
100
  override
104
101
  });
@@ -111,7 +108,6 @@ var processComponentTranslation = ({
111
108
  var processParameterTranslation = ({
112
109
  uniformSourceLocale,
113
110
  uniformTargetLocale,
114
- overrideModifiedTargetLocale,
115
111
  originalParameter,
116
112
  parameter
117
113
  }) => {
@@ -130,7 +126,7 @@ var processParameterTranslation = ({
130
126
  left: originalParameter.locales[uniformSourceLocale],
131
127
  right: sourceValue
132
128
  });
133
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
129
+ const isTargetValueUntouched = isSameParameterValue({
134
130
  parameterType: originalParameter.type,
135
131
  left: originalParameter.locales[uniformTargetLocale],
136
132
  right: originalTargetValue
@@ -144,7 +140,6 @@ var processParameterTranslation = ({
144
140
  var processOverrideTranslation = ({
145
141
  uniformSourceLocale,
146
142
  uniformTargetLocale,
147
- overrideModifiedTargetLocale,
148
143
  originalOverride,
149
144
  override
150
145
  }) => {
@@ -167,7 +162,7 @@ var processOverrideTranslation = ({
167
162
  left: originalParameter.locales[uniformSourceLocale],
168
163
  right: sourceValue
169
164
  });
170
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
165
+ const isTargetValueUntouched = isSameParameterValue({
171
166
  parameterType: originalParameter.type,
172
167
  left: originalParameter.locales[uniformTargetLocale],
173
168
  right: originalTargetValue
@@ -206,7 +201,6 @@ var processOverrideTranslation = ({
206
201
  const { updated: isComponentUpdated } = processComponentTranslation({
207
202
  uniformSourceLocale,
208
203
  uniformTargetLocale,
209
- overrideModifiedTargetLocale,
210
204
  originalNode: originalComponent,
211
205
  translatedComponent: component
212
206
  });
@@ -264,8 +258,7 @@ var collectTranslationPayload = ({
264
258
  uniformReleaseId,
265
259
  targetLang,
266
260
  entity,
267
- entityType,
268
- overrideModifiedTargetLocale
261
+ entityType
269
262
  }) => {
270
263
  if (!uniformSourceLocale || !uniformTargetLocale || !targetLang || !entity) {
271
264
  return createErrorResult2("invalid-args");
@@ -285,8 +278,7 @@ var collectTranslationPayload = ({
285
278
  entity: {
286
279
  id: entity._id,
287
280
  slug: entity._slug || ""
288
- },
289
- overrideModifiedTargetLocale
281
+ }
290
282
  },
291
283
  components: {}
292
284
  };
@@ -298,7 +290,6 @@ var collectTranslationPayload = ({
298
290
  const { _id, type, parameters, _overrides } = collectFromNode({
299
291
  uniformSourceLocale,
300
292
  uniformTargetLocale,
301
- overrideModifiedTargetLocale,
302
293
  node,
303
294
  deep: false
304
295
  });
@@ -316,7 +307,6 @@ var collectTranslationPayload = ({
316
307
  var collectFromNode = ({
317
308
  uniformSourceLocale,
318
309
  uniformTargetLocale,
319
- overrideModifiedTargetLocale,
320
310
  node,
321
311
  deep
322
312
  }) => {
@@ -333,7 +323,7 @@ var collectFromNode = ({
333
323
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
334
324
  return;
335
325
  }
336
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
326
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
337
327
  return;
338
328
  }
339
329
  collectedParameters[paramKey] = {
@@ -355,7 +345,6 @@ var collectFromNode = ({
355
345
  const collectedNode = collectFromNode({
356
346
  uniformSourceLocale,
357
347
  uniformTargetLocale,
358
- overrideModifiedTargetLocale,
359
348
  node: slotComponent,
360
349
  deep: true
361
350
  });
@@ -376,7 +365,7 @@ var collectFromNode = ({
376
365
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
377
366
  return;
378
367
  }
379
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
368
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
380
369
  return;
381
370
  }
382
371
  (_c2 = collectedOverrides[overrideKey]) != null ? _c2 : collectedOverrides[overrideKey] = {};
@@ -399,7 +388,6 @@ var collectFromNode = ({
399
388
  const collectedNode = collectFromNode({
400
389
  uniformSourceLocale,
401
390
  uniformTargetLocale,
402
- overrideModifiedTargetLocale,
403
391
  node: slotComponent,
404
392
  // keep tree structure for `Slot Sections`
405
393
  // to store whole `override` content in scope of current component
@@ -524,8 +512,7 @@ var import_canvas5 = require("@uniformdev/canvas");
524
512
  var import_immer = require("immer");
525
513
  var translateComposition = ({
526
514
  composition,
527
- translationPayload,
528
- overrideModifiedTargetLocale
515
+ translationPayload
529
516
  }) => {
530
517
  var _a;
531
518
  if (!composition || !composition.composition || !translationPayload) {
@@ -567,7 +554,6 @@ var translateComposition = ({
567
554
  const { updated: isComponentUpdated } = processComponentTranslation({
568
555
  uniformSourceLocale,
569
556
  uniformTargetLocale,
570
- overrideModifiedTargetLocale,
571
557
  originalNode: component,
572
558
  translatedComponent
573
559
  });
@@ -592,7 +578,6 @@ var mergeCompositionTranslationToUniform = async ({
592
578
  }
593
579
  const entityType = translationPayload.metadata.entityType;
594
580
  const entityId = translationPayload.metadata.entity.id;
595
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
596
581
  if (entityType !== "composition" && entityType !== "componentPattern") {
597
582
  return { translationMerged: false, entityId };
598
583
  }
@@ -608,8 +593,7 @@ var mergeCompositionTranslationToUniform = async ({
608
593
  }
609
594
  const translationResult = translateComposition({
610
595
  composition,
611
- translationPayload,
612
- overrideModifiedTargetLocale
596
+ translationPayload
613
597
  });
614
598
  const { updated, errorKind, errorText, result: translatedComposition } = translationResult;
615
599
  if (translatedComposition && updated && !errorKind) {
@@ -654,8 +638,7 @@ var import_canvas7 = require("@uniformdev/canvas");
654
638
  var import_immer2 = require("immer");
655
639
  var translateEntry = ({
656
640
  entry,
657
- translationPayload,
658
- overrideModifiedTargetLocale
641
+ translationPayload
659
642
  }) => {
660
643
  var _a;
661
644
  if (!entry || !translationPayload) {
@@ -697,7 +680,6 @@ var translateEntry = ({
697
680
  const { updated: isComponentUpdated } = processComponentTranslation({
698
681
  uniformSourceLocale,
699
682
  uniformTargetLocale,
700
- overrideModifiedTargetLocale,
701
683
  originalNode: component,
702
684
  translatedComponent
703
685
  });
@@ -722,7 +704,6 @@ var mergeEntryTranslationToUniform = async ({
722
704
  }
723
705
  const entityType = translationPayload.metadata.entityType;
724
706
  const entityId = translationPayload.metadata.entity.id;
725
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
726
707
  if (entityType !== "entry" && entityType !== "entryPattern") {
727
708
  return { translationMerged: false, entityId };
728
709
  }
@@ -738,8 +719,7 @@ var mergeEntryTranslationToUniform = async ({
738
719
  }
739
720
  const translationResult = translateEntry({
740
721
  entry,
741
- translationPayload,
742
- overrideModifiedTargetLocale
722
+ translationPayload
743
723
  });
744
724
  const { updated, errorKind, errorText, result: translatedEntry } = translationResult;
745
725
  if (translatedEntry && updated && !errorKind) {
package/dist/index.mjs CHANGED
@@ -33,7 +33,6 @@ var createErrorResult = (errorKind) => {
33
33
  var processComponentTranslation = ({
34
34
  uniformSourceLocale,
35
35
  uniformTargetLocale,
36
- overrideModifiedTargetLocale,
37
36
  originalNode,
38
37
  translatedComponent
39
38
  }) => {
@@ -53,7 +52,6 @@ var processComponentTranslation = ({
53
52
  const result = processParameterTranslation({
54
53
  uniformSourceLocale,
55
54
  uniformTargetLocale,
56
- overrideModifiedTargetLocale,
57
55
  originalParameter,
58
56
  parameter
59
57
  });
@@ -70,7 +68,6 @@ var processComponentTranslation = ({
70
68
  const result = processOverrideTranslation({
71
69
  uniformSourceLocale,
72
70
  uniformTargetLocale,
73
- overrideModifiedTargetLocale,
74
71
  originalOverride,
75
72
  override
76
73
  });
@@ -83,7 +80,6 @@ var processComponentTranslation = ({
83
80
  var processParameterTranslation = ({
84
81
  uniformSourceLocale,
85
82
  uniformTargetLocale,
86
- overrideModifiedTargetLocale,
87
83
  originalParameter,
88
84
  parameter
89
85
  }) => {
@@ -102,7 +98,7 @@ var processParameterTranslation = ({
102
98
  left: originalParameter.locales[uniformSourceLocale],
103
99
  right: sourceValue
104
100
  });
105
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
101
+ const isTargetValueUntouched = isSameParameterValue({
106
102
  parameterType: originalParameter.type,
107
103
  left: originalParameter.locales[uniformTargetLocale],
108
104
  right: originalTargetValue
@@ -116,7 +112,6 @@ var processParameterTranslation = ({
116
112
  var processOverrideTranslation = ({
117
113
  uniformSourceLocale,
118
114
  uniformTargetLocale,
119
- overrideModifiedTargetLocale,
120
115
  originalOverride,
121
116
  override
122
117
  }) => {
@@ -139,7 +134,7 @@ var processOverrideTranslation = ({
139
134
  left: originalParameter.locales[uniformSourceLocale],
140
135
  right: sourceValue
141
136
  });
142
- const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
137
+ const isTargetValueUntouched = isSameParameterValue({
143
138
  parameterType: originalParameter.type,
144
139
  left: originalParameter.locales[uniformTargetLocale],
145
140
  right: originalTargetValue
@@ -178,7 +173,6 @@ var processOverrideTranslation = ({
178
173
  const { updated: isComponentUpdated } = processComponentTranslation({
179
174
  uniformSourceLocale,
180
175
  uniformTargetLocale,
181
- overrideModifiedTargetLocale,
182
176
  originalNode: originalComponent,
183
177
  translatedComponent: component
184
178
  });
@@ -236,8 +230,7 @@ var collectTranslationPayload = ({
236
230
  uniformReleaseId,
237
231
  targetLang,
238
232
  entity,
239
- entityType,
240
- overrideModifiedTargetLocale
233
+ entityType
241
234
  }) => {
242
235
  if (!uniformSourceLocale || !uniformTargetLocale || !targetLang || !entity) {
243
236
  return createErrorResult2("invalid-args");
@@ -257,8 +250,7 @@ var collectTranslationPayload = ({
257
250
  entity: {
258
251
  id: entity._id,
259
252
  slug: entity._slug || ""
260
- },
261
- overrideModifiedTargetLocale
253
+ }
262
254
  },
263
255
  components: {}
264
256
  };
@@ -270,7 +262,6 @@ var collectTranslationPayload = ({
270
262
  const { _id, type, parameters, _overrides } = collectFromNode({
271
263
  uniformSourceLocale,
272
264
  uniformTargetLocale,
273
- overrideModifiedTargetLocale,
274
265
  node,
275
266
  deep: false
276
267
  });
@@ -288,7 +279,6 @@ var collectTranslationPayload = ({
288
279
  var collectFromNode = ({
289
280
  uniformSourceLocale,
290
281
  uniformTargetLocale,
291
- overrideModifiedTargetLocale,
292
282
  node,
293
283
  deep
294
284
  }) => {
@@ -305,7 +295,7 @@ var collectFromNode = ({
305
295
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
306
296
  return;
307
297
  }
308
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
298
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
309
299
  return;
310
300
  }
311
301
  collectedParameters[paramKey] = {
@@ -327,7 +317,6 @@ var collectFromNode = ({
327
317
  const collectedNode = collectFromNode({
328
318
  uniformSourceLocale,
329
319
  uniformTargetLocale,
330
- overrideModifiedTargetLocale,
331
320
  node: slotComponent,
332
321
  deep: true
333
322
  });
@@ -348,7 +337,7 @@ var collectFromNode = ({
348
337
  if (!canTranslateParameterValue(param, sourceLocaleValue)) {
349
338
  return;
350
339
  }
351
- if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
340
+ if (!isTargetLocaleUntouched(param.type, sourceLocaleValue, targetLocaleValue)) {
352
341
  return;
353
342
  }
354
343
  (_c2 = collectedOverrides[overrideKey]) != null ? _c2 : collectedOverrides[overrideKey] = {};
@@ -371,7 +360,6 @@ var collectFromNode = ({
371
360
  const collectedNode = collectFromNode({
372
361
  uniformSourceLocale,
373
362
  uniformTargetLocale,
374
- overrideModifiedTargetLocale,
375
363
  node: slotComponent,
376
364
  // keep tree structure for `Slot Sections`
377
365
  // to store whole `override` content in scope of current component
@@ -496,8 +484,7 @@ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, walkNodeTree as walkNodeTree
496
484
  import { produce } from "immer";
497
485
  var translateComposition = ({
498
486
  composition,
499
- translationPayload,
500
- overrideModifiedTargetLocale
487
+ translationPayload
501
488
  }) => {
502
489
  var _a;
503
490
  if (!composition || !composition.composition || !translationPayload) {
@@ -539,7 +526,6 @@ var translateComposition = ({
539
526
  const { updated: isComponentUpdated } = processComponentTranslation({
540
527
  uniformSourceLocale,
541
528
  uniformTargetLocale,
542
- overrideModifiedTargetLocale,
543
529
  originalNode: component,
544
530
  translatedComponent
545
531
  });
@@ -564,7 +550,6 @@ var mergeCompositionTranslationToUniform = async ({
564
550
  }
565
551
  const entityType = translationPayload.metadata.entityType;
566
552
  const entityId = translationPayload.metadata.entity.id;
567
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
568
553
  if (entityType !== "composition" && entityType !== "componentPattern") {
569
554
  return { translationMerged: false, entityId };
570
555
  }
@@ -580,8 +565,7 @@ var mergeCompositionTranslationToUniform = async ({
580
565
  }
581
566
  const translationResult = translateComposition({
582
567
  composition,
583
- translationPayload,
584
- overrideModifiedTargetLocale
568
+ translationPayload
585
569
  });
586
570
  const { updated, errorKind, errorText, result: translatedComposition } = translationResult;
587
571
  if (translatedComposition && updated && !errorKind) {
@@ -626,8 +610,7 @@ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE5, walkNodeTree as walkNodeTree
626
610
  import { produce as produce2 } from "immer";
627
611
  var translateEntry = ({
628
612
  entry,
629
- translationPayload,
630
- overrideModifiedTargetLocale
613
+ translationPayload
631
614
  }) => {
632
615
  var _a;
633
616
  if (!entry || !translationPayload) {
@@ -669,7 +652,6 @@ var translateEntry = ({
669
652
  const { updated: isComponentUpdated } = processComponentTranslation({
670
653
  uniformSourceLocale,
671
654
  uniformTargetLocale,
672
- overrideModifiedTargetLocale,
673
655
  originalNode: component,
674
656
  translatedComponent
675
657
  });
@@ -694,7 +676,6 @@ var mergeEntryTranslationToUniform = async ({
694
676
  }
695
677
  const entityType = translationPayload.metadata.entityType;
696
678
  const entityId = translationPayload.metadata.entity.id;
697
- const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
698
679
  if (entityType !== "entry" && entityType !== "entryPattern") {
699
680
  return { translationMerged: false, entityId };
700
681
  }
@@ -710,8 +691,7 @@ var mergeEntryTranslationToUniform = async ({
710
691
  }
711
692
  const translationResult = translateEntry({
712
693
  entry,
713
- translationPayload,
714
- overrideModifiedTargetLocale
694
+ translationPayload
715
695
  });
716
696
  const { updated, errorKind, errorText, result: translatedEntry } = translationResult;
717
697
  if (translatedEntry && updated && !errorKind) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/tms-sdk",
3
- "version": "19.154.1-alpha.26+791f903a70",
3
+ "version": "19.154.1-alpha.27+38c3908d9d",
4
4
  "description": "Uniform Translation Management System SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -33,13 +33,11 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@uniformdev/canvas": "19.154.1-alpha.26+791f903a70",
37
- "@uniformdev/richtext": "19.154.1-alpha.26+791f903a70",
36
+ "@uniformdev/canvas": "19.154.1-alpha.27+38c3908d9d",
37
+ "@uniformdev/mesh-sdk": "19.154.1-alpha.27+38c3908d9d",
38
+ "@uniformdev/richtext": "19.154.1-alpha.27+38c3908d9d",
38
39
  "dequal": "2.0.3",
39
40
  "immer": "10.0.4"
40
41
  },
41
- "devDependencies": {
42
- "@uniformdev/mesh-sdk": "19.154.1-alpha.26+791f903a70"
43
- },
44
- "gitHead": "791f903a7000c4e5402004190fad51d8cb2b13d5"
42
+ "gitHead": "38c3908d9d966e4b12cf7ecdc5831ff03c529917"
45
43
  }