@uniformdev/tms-sdk 19.153.1-alpha.1

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.mjs ADDED
@@ -0,0 +1,566 @@
1
+ // src/collectTranslationPayload.ts
2
+ import {
3
+ bindVariables,
4
+ walkNodeTree
5
+ } from "@uniformdev/canvas";
6
+
7
+ // src/constants.ts
8
+ var TRANSLATION_PAYLOAD_SOURCE_KEY = "source";
9
+ var TRANSLATION_PAYLOAD_TARGET_KEY = "target";
10
+ var TRANSLATION_PAYLOAD_ORIGINAL_TARGET_KEY = "originalTarget";
11
+
12
+ // src/collectTranslationPayload.ts
13
+ var MERGE_TRANSLATION_ERRORS = {
14
+ unknown: "Unknown error",
15
+ "invalid-args": "Invalid arguments",
16
+ "entity-source-locale-missing": "Entity does not include specified Uniform source locale"
17
+ };
18
+ var createErrorResult = (errorKind) => {
19
+ return { errorKind, errorText: MERGE_TRANSLATION_ERRORS[errorKind] };
20
+ };
21
+ var collectTranslationPayload = ({
22
+ uniformProjectId,
23
+ uniformSourceLocale,
24
+ uniformTargetLocale,
25
+ uniformReleaseId,
26
+ targetLang,
27
+ entity,
28
+ entityType,
29
+ overrideModifiedTargetLocale
30
+ }) => {
31
+ if (!uniformSourceLocale || !uniformTargetLocale || !targetLang || !entity) {
32
+ return createErrorResult("invalid-args");
33
+ }
34
+ if (!entity._locales || !entity._locales.includes(uniformSourceLocale)) {
35
+ return createErrorResult("entity-source-locale-missing");
36
+ }
37
+ const payload = {
38
+ schemaVersion: 1,
39
+ metadata: {
40
+ uniformProjectId,
41
+ uniformSourceLocale,
42
+ uniformTargetLocale,
43
+ uniformReleaseId,
44
+ targetLang,
45
+ entityType,
46
+ entity: {
47
+ id: entity._id,
48
+ slug: entity._slug || ""
49
+ },
50
+ overrideModifiedTargetLocale
51
+ },
52
+ components: {}
53
+ };
54
+ walkNodeTree(entity, ({ node: component, type, actions }) => {
55
+ var _a;
56
+ if (!component.type || !component._id) {
57
+ actions.stopProcessingDescendants();
58
+ return;
59
+ }
60
+ const parameters = {};
61
+ const overrides = {};
62
+ const parametersOrFields = type == "component" ? component.parameters : component.fields;
63
+ Object.entries(parametersOrFields != null ? parametersOrFields : {}).forEach(([paramKey, param]) => {
64
+ var _a2, _b;
65
+ const sourceLocaleValue = (_a2 = param.locales) == null ? void 0 : _a2[uniformSourceLocale];
66
+ const targetLocaleValue = (_b = param.locales) == null ? void 0 : _b[uniformTargetLocale];
67
+ if (!canTranslateParameterValue(param, sourceLocaleValue)) {
68
+ return;
69
+ }
70
+ if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(sourceLocaleValue, targetLocaleValue)) {
71
+ return;
72
+ }
73
+ parameters[paramKey] = {
74
+ type: param.type,
75
+ locales: {
76
+ [TRANSLATION_PAYLOAD_SOURCE_KEY]: sourceLocaleValue,
77
+ [TRANSLATION_PAYLOAD_TARGET_KEY]: sourceLocaleValue,
78
+ [TRANSLATION_PAYLOAD_ORIGINAL_TARGET_KEY]: targetLocaleValue
79
+ }
80
+ };
81
+ });
82
+ Object.entries((_a = component._overrides) != null ? _a : {}).forEach(([componentId, override]) => {
83
+ var _a2;
84
+ Object.entries((_a2 = override.parameters) != null ? _a2 : {}).forEach(([paramKey, param]) => {
85
+ var _a3, _b, _c, _d, _e;
86
+ const sourceLocaleValue = (_a3 = param.locales) == null ? void 0 : _a3[uniformSourceLocale];
87
+ const targetLocaleValue = (_b = param.locales) == null ? void 0 : _b[uniformTargetLocale];
88
+ if (!canTranslateParameterValue(param, sourceLocaleValue)) {
89
+ return;
90
+ }
91
+ if (!overrideModifiedTargetLocale && !isTargetLocaleUntouched(sourceLocaleValue, targetLocaleValue)) {
92
+ return;
93
+ }
94
+ (_c = overrides[componentId]) != null ? _c : overrides[componentId] = {};
95
+ (_e = (_d = overrides[componentId]).parameters) != null ? _e : _d.parameters = {};
96
+ overrides[componentId].parameters[paramKey] = {
97
+ type: param.type,
98
+ locales: {
99
+ [TRANSLATION_PAYLOAD_SOURCE_KEY]: sourceLocaleValue,
100
+ [TRANSLATION_PAYLOAD_TARGET_KEY]: sourceLocaleValue,
101
+ [TRANSLATION_PAYLOAD_ORIGINAL_TARGET_KEY]: targetLocaleValue
102
+ }
103
+ };
104
+ });
105
+ });
106
+ const hasParameters = Object.keys(parameters).length > 0;
107
+ const hasOverrides = Object.keys(overrides).length > 0;
108
+ if (hasParameters || hasOverrides) {
109
+ payload.components[component._id] = {
110
+ type: component.type,
111
+ parameters: hasParameters ? parameters : void 0,
112
+ _overrides: hasOverrides ? overrides : void 0
113
+ };
114
+ }
115
+ });
116
+ return { payload };
117
+ };
118
+ var canTranslateParameterValue = (parameter, value) => {
119
+ if (parameter.type === "text") {
120
+ if (typeof value !== "string" || !value) {
121
+ return false;
122
+ }
123
+ if (value.trim().length === 0) {
124
+ return false;
125
+ }
126
+ const bindResult = bindVariables({
127
+ variables: {},
128
+ value,
129
+ handleBinding: () => ""
130
+ });
131
+ const valueWithoutVariables = bindResult.result;
132
+ if (!valueWithoutVariables || valueWithoutVariables.trim().length === 0) {
133
+ return false;
134
+ }
135
+ return true;
136
+ } else if (parameter.type === "richText") {
137
+ return typeof value === "object" && !!value;
138
+ }
139
+ return false;
140
+ };
141
+ var isTargetLocaleUntouched = (sourceLocaleValue, targetLocaleValue) => {
142
+ return targetLocaleValue === void 0 || targetLocaleValue === null || targetLocaleValue === "" || targetLocaleValue === sourceLocaleValue;
143
+ };
144
+
145
+ // src/mergeCompositionTranslationToUniform.ts
146
+ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE2 } from "@uniformdev/canvas";
147
+
148
+ // src/translateComposition.ts
149
+ import { CANVAS_DRAFT_STATE, walkNodeTree as walkNodeTree2 } from "@uniformdev/canvas";
150
+ import { produce } from "immer";
151
+
152
+ // src/translationHelpers.ts
153
+ import { dequal } from "dequal/lite";
154
+ var MERGE_TRANSLATION_ERRORS2 = {
155
+ unknown: "Unknown error",
156
+ "invalid-args": "Invalid arguments",
157
+ "project-id-mismatch": "Project ID mismatch",
158
+ "entity-id-mismatch": "Enity ID mismatch",
159
+ "entity-locales-mismatch": "Entity does not include required locales"
160
+ };
161
+ var createErrorResult2 = (errorKind) => {
162
+ return { updated: false, errorKind, errorText: MERGE_TRANSLATION_ERRORS2[errorKind] };
163
+ };
164
+ var processParameterTranslation = ({
165
+ uniformSourceLocale,
166
+ uniformTargetLocale,
167
+ originalParameter,
168
+ parameter,
169
+ overrideModifiedTargetLocale
170
+ }) => {
171
+ var _a, _b, _c;
172
+ if (!originalParameter.locales) {
173
+ return { updated: false };
174
+ }
175
+ const sourceValue = (_a = parameter.locales) == null ? void 0 : _a[TRANSLATION_PAYLOAD_SOURCE_KEY];
176
+ const targetValue = (_b = parameter.locales) == null ? void 0 : _b[TRANSLATION_PAYLOAD_TARGET_KEY];
177
+ const originalTargetValue = (_c = parameter.locales) == null ? void 0 : _c[TRANSLATION_PAYLOAD_ORIGINAL_TARGET_KEY];
178
+ const isSourceValueUntouched = isSameParameterValue({
179
+ parameterType: originalParameter.type,
180
+ originalValue: originalParameter.locales[uniformSourceLocale],
181
+ value: sourceValue
182
+ });
183
+ const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
184
+ parameterType: originalParameter.type,
185
+ originalValue: originalParameter.locales[uniformTargetLocale],
186
+ value: originalTargetValue
187
+ });
188
+ if (targetValue && isSourceValueUntouched && isTargetValueUntouched) {
189
+ originalParameter.locales[uniformTargetLocale] = targetValue;
190
+ return { updated: true };
191
+ }
192
+ return { updated: false };
193
+ };
194
+ var processOverrideTranslation = ({
195
+ uniformSourceLocale,
196
+ uniformTargetLocale,
197
+ originalOverride,
198
+ override,
199
+ overrideModifiedTargetLocale
200
+ }) => {
201
+ var _a;
202
+ let updated = false;
203
+ Object.entries((_a = override.parameters) != null ? _a : {}).forEach(([paramKey, parameter]) => {
204
+ var _a2, _b, _c, _d;
205
+ const originalParameter = (_a2 = originalOverride.parameters) == null ? void 0 : _a2[paramKey];
206
+ if (!originalParameter || !originalParameter.locales) {
207
+ return;
208
+ }
209
+ const sourceValue = (_b = parameter.locales) == null ? void 0 : _b[TRANSLATION_PAYLOAD_SOURCE_KEY];
210
+ const targetValue = (_c = parameter.locales) == null ? void 0 : _c[TRANSLATION_PAYLOAD_TARGET_KEY];
211
+ const originalTargetValue = (_d = parameter.locales) == null ? void 0 : _d[TRANSLATION_PAYLOAD_ORIGINAL_TARGET_KEY];
212
+ const isSourceValueUntouched = isSameParameterValue({
213
+ parameterType: originalParameter.type,
214
+ originalValue: originalParameter.locales[uniformSourceLocale],
215
+ value: sourceValue
216
+ });
217
+ const isTargetValueUntouched = overrideModifiedTargetLocale || isSameParameterValue({
218
+ parameterType: originalParameter.type,
219
+ originalValue: originalParameter.locales[uniformTargetLocale],
220
+ value: originalTargetValue
221
+ });
222
+ if (targetValue && isSourceValueUntouched && isTargetValueUntouched) {
223
+ originalParameter.locales[uniformTargetLocale] = targetValue;
224
+ updated = true;
225
+ }
226
+ });
227
+ return { updated };
228
+ };
229
+ var isSameParameterValue = ({
230
+ parameterType,
231
+ originalValue,
232
+ value
233
+ }) => {
234
+ switch (parameterType) {
235
+ case "text":
236
+ return originalValue === value || !originalValue && !value;
237
+ break;
238
+ case "richText":
239
+ return dequal(originalValue, value);
240
+ break;
241
+ default:
242
+ return originalValue === value;
243
+ }
244
+ };
245
+
246
+ // src/translateComposition.ts
247
+ var translateComposition = ({
248
+ composition,
249
+ translationPayload,
250
+ overrideModifiedTargetLocale
251
+ }) => {
252
+ var _a;
253
+ if (!composition || !composition.composition || !translationPayload) {
254
+ return createErrorResult2("invalid-args");
255
+ }
256
+ if (composition.projectId !== translationPayload.metadata.uniformProjectId) {
257
+ return createErrorResult2("project-id-mismatch");
258
+ }
259
+ if (composition.composition._id !== translationPayload.metadata.entity.id) {
260
+ return createErrorResult2("entity-id-mismatch");
261
+ }
262
+ const compositionLocales = (_a = composition.composition._locales) != null ? _a : [];
263
+ const uniformSourceLocale = translationPayload.metadata.uniformSourceLocale;
264
+ const uniformTargetLocale = translationPayload.metadata.uniformTargetLocale;
265
+ if (!compositionLocales.includes(uniformSourceLocale)) {
266
+ return createErrorResult2("entity-locales-mismatch");
267
+ }
268
+ let updated = false;
269
+ const translatedComposition = produce(composition, (draft) => {
270
+ var _a2, _b;
271
+ draft.state = CANVAS_DRAFT_STATE;
272
+ if (!compositionLocales.includes(uniformTargetLocale)) {
273
+ (_b = (_a2 = draft.composition)._locales) != null ? _b : _a2._locales = [];
274
+ draft.composition._locales.push(uniformTargetLocale);
275
+ }
276
+ walkNodeTree2(draft.composition, ({ node: component, type, actions }) => {
277
+ var _a3, _b2;
278
+ if (type !== "component") {
279
+ actions.stopProcessingDescendants();
280
+ return;
281
+ }
282
+ if (!component.type || !component._id) {
283
+ actions.stopProcessingDescendants();
284
+ return;
285
+ }
286
+ const translatedComponent = translationPayload.components[component._id];
287
+ if (!translatedComponent || component.type !== translatedComponent.type) {
288
+ return;
289
+ }
290
+ Object.entries((_a3 = translatedComponent.parameters) != null ? _a3 : {}).forEach(([paramKey, param]) => {
291
+ var _a4;
292
+ const originalParameter = (_a4 = component.parameters) == null ? void 0 : _a4[paramKey];
293
+ if (!originalParameter) {
294
+ return;
295
+ }
296
+ const result = processParameterTranslation({
297
+ uniformSourceLocale,
298
+ uniformTargetLocale,
299
+ originalParameter,
300
+ parameter: param,
301
+ overrideModifiedTargetLocale: overrideModifiedTargetLocale != null ? overrideModifiedTargetLocale : false
302
+ });
303
+ if (result.updated) {
304
+ updated = true;
305
+ }
306
+ });
307
+ Object.entries((_b2 = translatedComponent._overrides) != null ? _b2 : {}).forEach(([componentId, override]) => {
308
+ var _a4;
309
+ const originalOverride = (_a4 = component._overrides) == null ? void 0 : _a4[componentId];
310
+ if (!originalOverride) {
311
+ return;
312
+ }
313
+ const result = processOverrideTranslation({
314
+ uniformSourceLocale,
315
+ uniformTargetLocale,
316
+ originalOverride,
317
+ override,
318
+ overrideModifiedTargetLocale
319
+ });
320
+ if (result.updated) {
321
+ updated = true;
322
+ }
323
+ });
324
+ });
325
+ });
326
+ return { result: translatedComposition, updated };
327
+ };
328
+
329
+ // src/mergeCompositionTranslationToUniform.ts
330
+ var mergeCompositionTranslationToUniform = async ({
331
+ canvasClient,
332
+ translationPayload,
333
+ getCurrentComposition = defaultGetCurrentComposition,
334
+ onMissingComposition,
335
+ onCompositionTranslationResult,
336
+ updateComposition = defaultUpdateComposition
337
+ }) => {
338
+ if (!translationPayload) {
339
+ return { translationMerged: false };
340
+ }
341
+ const entityId = translationPayload.metadata.entity.id;
342
+ const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
343
+ if ((translationPayload == null ? void 0 : translationPayload.metadata.entityType) !== "composition") {
344
+ return { translationMerged: false, entityId };
345
+ }
346
+ const composition = await getCurrentComposition({
347
+ canvasClient,
348
+ translationPayload
349
+ });
350
+ if (!composition) {
351
+ await (onMissingComposition == null ? void 0 : onMissingComposition({
352
+ translationPayload
353
+ }));
354
+ return { translationMerged: false, entityId };
355
+ }
356
+ let translationResult = translateComposition({
357
+ composition,
358
+ translationPayload,
359
+ overrideModifiedTargetLocale
360
+ });
361
+ if (onCompositionTranslationResult) {
362
+ translationResult = await onCompositionTranslationResult(translationResult);
363
+ }
364
+ const { updated, errorKind, result: translatedComposition } = translationResult;
365
+ if (translatedComposition && updated && !errorKind) {
366
+ const translationMerged = await updateComposition({
367
+ canvasClient,
368
+ translationPayload,
369
+ composition: translatedComposition
370
+ });
371
+ return { translationMerged, entityId };
372
+ }
373
+ return { translationMerged: false, entityId };
374
+ };
375
+ var defaultGetCurrentComposition = async ({
376
+ canvasClient,
377
+ translationPayload
378
+ }) => {
379
+ const compositionId = translationPayload.metadata.entity.id;
380
+ const releaseId = translationPayload.metadata.uniformReleaseId;
381
+ const currentComposition = await canvasClient.getCompositionById({
382
+ compositionId,
383
+ releaseId: releaseId ? releaseId : void 0,
384
+ withComponentIDs: true,
385
+ skipDataResolution: true,
386
+ skipOverridesResolution: true,
387
+ skipPatternResolution: true,
388
+ state: CANVAS_DRAFT_STATE2
389
+ });
390
+ return currentComposition;
391
+ };
392
+ var defaultUpdateComposition = async ({
393
+ canvasClient,
394
+ composition
395
+ }) => {
396
+ await canvasClient.updateComposition(composition);
397
+ return true;
398
+ };
399
+
400
+ // src/mergeEntryTranslationToUniform.ts
401
+ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE4 } from "@uniformdev/canvas";
402
+
403
+ // src/translateEntry.ts
404
+ import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, walkNodeTree as walkNodeTree3 } from "@uniformdev/canvas";
405
+ import { produce as produce2 } from "immer";
406
+ var translateEntry = ({
407
+ entry,
408
+ translationPayload,
409
+ overrideModifiedTargetLocale
410
+ }) => {
411
+ var _a;
412
+ if (!entry || !translationPayload) {
413
+ return createErrorResult2("invalid-args");
414
+ }
415
+ if (entry.projectId !== translationPayload.metadata.uniformProjectId) {
416
+ return createErrorResult2("project-id-mismatch");
417
+ }
418
+ if ((entry == null ? void 0 : entry.entry._id) !== translationPayload.metadata.entity.id) {
419
+ return createErrorResult2("entity-id-mismatch");
420
+ }
421
+ const entryLocales = (_a = entry.entry._locales) != null ? _a : [];
422
+ const uniformSourceLocale = translationPayload.metadata.uniformSourceLocale;
423
+ const uniformTargetLocale = translationPayload.metadata.uniformTargetLocale;
424
+ if (!entryLocales.includes(uniformSourceLocale)) {
425
+ return createErrorResult2("entity-locales-mismatch");
426
+ }
427
+ let updated = false;
428
+ const translatedEntry = produce2(entry, (draft) => {
429
+ var _a2, _b;
430
+ draft.state = CANVAS_DRAFT_STATE3;
431
+ if (!entryLocales.includes(uniformTargetLocale)) {
432
+ (_b = (_a2 = draft.entry)._locales) != null ? _b : _a2._locales = [];
433
+ draft.entry._locales.push(uniformTargetLocale);
434
+ }
435
+ walkNodeTree3(draft.entry, ({ node: component, type, actions }) => {
436
+ var _a3, _b2;
437
+ if (type !== "entry") {
438
+ actions.stopProcessingDescendants();
439
+ return;
440
+ }
441
+ if (!component.type || !component._id) {
442
+ actions.stopProcessingDescendants();
443
+ return;
444
+ }
445
+ const translatedComponent = translationPayload.components[component._id];
446
+ if (!translatedComponent || component.type !== translatedComponent.type) {
447
+ return;
448
+ }
449
+ Object.entries((_a3 = translatedComponent.parameters) != null ? _a3 : {}).forEach(([paramKey, parameter]) => {
450
+ var _a4;
451
+ const originalParameter = (_a4 = component.fields) == null ? void 0 : _a4[paramKey];
452
+ if (!originalParameter) {
453
+ return;
454
+ }
455
+ const result = processParameterTranslation({
456
+ uniformSourceLocale,
457
+ uniformTargetLocale,
458
+ originalParameter,
459
+ parameter,
460
+ overrideModifiedTargetLocale
461
+ });
462
+ if (result.updated) {
463
+ updated = true;
464
+ }
465
+ });
466
+ Object.entries((_b2 = translatedComponent._overrides) != null ? _b2 : {}).forEach(([componentId, override]) => {
467
+ var _a4;
468
+ const originalOverride = (_a4 = component._overrides) == null ? void 0 : _a4[componentId];
469
+ if (!originalOverride) {
470
+ return;
471
+ }
472
+ const result = processOverrideTranslation({
473
+ uniformSourceLocale,
474
+ uniformTargetLocale,
475
+ originalOverride,
476
+ override,
477
+ overrideModifiedTargetLocale
478
+ });
479
+ if (result.updated) {
480
+ updated = true;
481
+ }
482
+ });
483
+ });
484
+ });
485
+ return { result: translatedEntry, updated };
486
+ };
487
+
488
+ // src/mergeEntryTranslationToUniform.ts
489
+ var mergeEntryTranslationToUniform = async ({
490
+ contentClient,
491
+ translationPayload,
492
+ getCurrentEntry = defaultGetCurrentEntry,
493
+ onMissingEntry,
494
+ onEntryTranslationResult,
495
+ updateEntry = defaultUpdateEntry
496
+ }) => {
497
+ if (!translationPayload) {
498
+ return { translationMerged: false };
499
+ }
500
+ const entityId = translationPayload.metadata.entity.id;
501
+ const overrideModifiedTargetLocale = translationPayload.metadata.overrideModifiedTargetLocale;
502
+ if ((translationPayload == null ? void 0 : translationPayload.metadata.entityType) !== "entry") {
503
+ return { translationMerged: false, entityId };
504
+ }
505
+ const entry = await getCurrentEntry({
506
+ contentClient,
507
+ translationPayload
508
+ });
509
+ if (!entry) {
510
+ await (onMissingEntry == null ? void 0 : onMissingEntry({
511
+ translationPayload
512
+ }));
513
+ return { translationMerged: false, entityId };
514
+ }
515
+ let translationResult = translateEntry({
516
+ entry,
517
+ translationPayload,
518
+ overrideModifiedTargetLocale
519
+ });
520
+ if (onEntryTranslationResult) {
521
+ translationResult = await onEntryTranslationResult(translationResult);
522
+ }
523
+ const { updated, errorKind, result: translatedEntry } = translationResult;
524
+ if (translatedEntry && updated && !errorKind) {
525
+ const translationMerged = await updateEntry({
526
+ contentClient,
527
+ translationPayload,
528
+ entry: translatedEntry
529
+ });
530
+ return { translationMerged, entityId };
531
+ }
532
+ return { translationMerged: false, entityId };
533
+ };
534
+ var defaultGetCurrentEntry = async ({
535
+ contentClient,
536
+ translationPayload
537
+ }) => {
538
+ const entryId = translationPayload.metadata.entity.id;
539
+ const releaseId = translationPayload.metadata.uniformReleaseId;
540
+ const entriesResponse = await contentClient.getEntries({
541
+ entryIDs: [entryId],
542
+ releaseId: releaseId ? releaseId : void 0,
543
+ limit: 1,
544
+ withComponentIDs: true,
545
+ skipDataResolution: true,
546
+ skipOverridesResolution: true,
547
+ skipPatternResolution: true,
548
+ state: CANVAS_DRAFT_STATE4
549
+ });
550
+ const currentEntry = entriesResponse.entries.at(0);
551
+ return currentEntry ? currentEntry : void 0;
552
+ };
553
+ var defaultUpdateEntry = async ({
554
+ contentClient,
555
+ entry
556
+ }) => {
557
+ await contentClient.upsertEntry(entry);
558
+ return true;
559
+ };
560
+ export {
561
+ collectTranslationPayload,
562
+ mergeCompositionTranslationToUniform,
563
+ mergeEntryTranslationToUniform,
564
+ translateComposition,
565
+ translateEntry
566
+ };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@uniformdev/tms-sdk",
3
+ "version": "19.153.1-alpha.1+f8537157ec",
4
+ "description": "Uniform Translation Management System SDK",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.esm.js",
8
+ "exports": {
9
+ "import": {
10
+ "types": "./dist/index.d.mts",
11
+ "node": "./dist/index.mjs",
12
+ "default": "./dist/index.esm.js"
13
+ },
14
+ "require": "./dist/index.js"
15
+ },
16
+ "types": "./dist/index.d.ts",
17
+ "sideEffects": false,
18
+ "scripts": {
19
+ "build": "run-s build:ts",
20
+ "build:ts": "tsup",
21
+ "dev": "run-s dev:ts",
22
+ "dev:ts": "tsup --watch",
23
+ "clean": "rimraf dist",
24
+ "test": "jest --maxWorkers=1",
25
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
26
+ "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
27
+ "document": "api-extractor run --local"
28
+ },
29
+ "files": [
30
+ "/dist"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@uniformdev/canvas": "19.153.1-alpha.1+f8537157ec",
37
+ "dequal": "2.0.3",
38
+ "immer": "10.0.4",
39
+ "uuid": "9.0.1"
40
+ },
41
+ "devDependencies": {
42
+ "@types/uuid": "9.0.4"
43
+ },
44
+ "gitHead": "f8537157ec48cfc9eeeafb95a733eb987e246427"
45
+ }