@vizij/node-graph-authoring 0.0.5 → 0.1.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/README.md +0 -1
- package/dist/{chunk-XYPRZPXJ.js → chunk-6WQOBROM.js} +32 -412
- package/dist/cli/reportIr.cjs +24 -301
- package/dist/cli/reportIr.js +1 -1
- package/dist/index.cjs +33 -422
- package/dist/index.d.cts +2 -13
- package/dist/index.d.ts +2 -13
- package/dist/index.js +1 -11
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/state.ts
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
SELF_BINDING_ID,
|
|
4
|
+
cloneDeepSafe
|
|
5
5
|
} from "@vizij/utils";
|
|
6
6
|
var VECTOR_ANIMATABLE_TYPES = /* @__PURE__ */ new Set(["vector2", "vector3", "euler", "rgb"]);
|
|
7
7
|
function deriveComponentValueType(component) {
|
|
@@ -41,9 +41,6 @@ function bindingTargetFromInput(input) {
|
|
|
41
41
|
valueType: "scalar"
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
var DEFAULT_INPUT_RANGE = { min: -1, max: 1 };
|
|
45
|
-
var DEFAULT_INPUT_ANCHOR = 0;
|
|
46
|
-
var EPSILON = 1e-6;
|
|
47
44
|
var LEGACY_SLOT_PATTERN = /^slot_(\d+)$/i;
|
|
48
45
|
var ALIAS_SANITIZE_PATTERN = /[^A-Za-z0-9_]+/g;
|
|
49
46
|
var PRIMARY_SLOT_ID = "s1";
|
|
@@ -119,131 +116,11 @@ function rewriteLegacyExpression(expression, replacements) {
|
|
|
119
116
|
return `s${digits}`;
|
|
120
117
|
});
|
|
121
118
|
}
|
|
122
|
-
function clamp(value, min, max) {
|
|
123
|
-
return Math.min(max, Math.max(min, value));
|
|
124
|
-
}
|
|
125
|
-
function isFiniteNumber(value) {
|
|
126
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
127
|
-
}
|
|
128
|
-
function deriveOutputDefaults(target) {
|
|
129
|
-
const { min, max } = target.range;
|
|
130
|
-
const anchor = clamp(target.defaultValue, min, max);
|
|
131
|
-
return {
|
|
132
|
-
outLow: min,
|
|
133
|
-
outAnchor: anchor,
|
|
134
|
-
outHigh: max
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function deriveInputDefaults() {
|
|
138
|
-
return {
|
|
139
|
-
inLow: DEFAULT_INPUT_RANGE.min,
|
|
140
|
-
inAnchor: DEFAULT_INPUT_ANCHOR,
|
|
141
|
-
inHigh: DEFAULT_INPUT_RANGE.max
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function migrateLegacyRemap(legacy, target) {
|
|
145
|
-
const inputDefaults = deriveInputDefaults();
|
|
146
|
-
const outputDefaults = deriveOutputDefaults(target);
|
|
147
|
-
const defaults = {
|
|
148
|
-
inLow: inputDefaults.inLow,
|
|
149
|
-
inAnchor: inputDefaults.inAnchor,
|
|
150
|
-
inHigh: inputDefaults.inHigh,
|
|
151
|
-
outLow: outputDefaults.outLow,
|
|
152
|
-
outAnchor: outputDefaults.outAnchor,
|
|
153
|
-
outHigh: outputDefaults.outHigh
|
|
154
|
-
};
|
|
155
|
-
if ("inLow" in legacy && "inHigh" in legacy && "outLow" in legacy && "outHigh" in legacy) {
|
|
156
|
-
const inLow2 = isFiniteNumber(legacy.inLow) ? legacy.inLow : defaults.inLow;
|
|
157
|
-
const inAnchor2 = isFiniteNumber(legacy.inAnchor) ? legacy.inAnchor : defaults.inAnchor;
|
|
158
|
-
const inHigh2 = isFiniteNumber(legacy.inHigh) ? legacy.inHigh : defaults.inHigh;
|
|
159
|
-
let outLow = isFiniteNumber(legacy.outLow) ? legacy.outLow : defaults.outLow;
|
|
160
|
-
let outHigh = isFiniteNumber(legacy.outHigh) ? legacy.outHigh : defaults.outHigh;
|
|
161
|
-
if (outLow > outHigh) {
|
|
162
|
-
const low = outHigh;
|
|
163
|
-
const high = outLow;
|
|
164
|
-
outLow = low;
|
|
165
|
-
outHigh = high;
|
|
166
|
-
}
|
|
167
|
-
const outAnchor2 = clamp(
|
|
168
|
-
isFiniteNumber(legacy.outAnchor) ? legacy.outAnchor : defaults.outAnchor,
|
|
169
|
-
outLow,
|
|
170
|
-
outHigh
|
|
171
|
-
);
|
|
172
|
-
return {
|
|
173
|
-
inLow: inLow2,
|
|
174
|
-
inAnchor: inAnchor2,
|
|
175
|
-
inHigh: inHigh2,
|
|
176
|
-
outLow,
|
|
177
|
-
outAnchor: outAnchor2,
|
|
178
|
-
outHigh
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
const legacyTyped = legacy;
|
|
182
|
-
const inLow = isFiniteNumber(legacyTyped.inMin) ? legacyTyped.inMin : defaults.inLow;
|
|
183
|
-
const inHigh = isFiniteNumber(legacyTyped.inMax) ? legacyTyped.inMax : defaults.inHigh;
|
|
184
|
-
const inAnchor = (inLow + inHigh) / 2;
|
|
185
|
-
const legacyOutMid = isFiniteNumber(legacyTyped.outMin) && isFiniteNumber(legacyTyped.outMax) ? (legacyTyped.outMin + legacyTyped.outMax) / 2 : defaults.outAnchor;
|
|
186
|
-
const outAnchor = clamp(legacyOutMid, defaults.outLow, defaults.outHigh);
|
|
187
|
-
return {
|
|
188
|
-
inLow,
|
|
189
|
-
inAnchor,
|
|
190
|
-
inHigh,
|
|
191
|
-
outLow: defaults.outLow,
|
|
192
|
-
outAnchor,
|
|
193
|
-
outHigh: defaults.outHigh
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function normalizeRemap(remap, target) {
|
|
197
|
-
if (!remap) {
|
|
198
|
-
return createDefaultRemap(target);
|
|
199
|
-
}
|
|
200
|
-
return migrateLegacyRemap(remap, target);
|
|
201
|
-
}
|
|
202
|
-
function cloneRemap(remap) {
|
|
203
|
-
return cloneRemapSettings(remap);
|
|
204
|
-
}
|
|
205
119
|
function cloneBindingMetadata(metadata) {
|
|
206
120
|
if (!metadata) {
|
|
207
121
|
return void 0;
|
|
208
122
|
}
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
function sanitizeRemap(remap, target) {
|
|
212
|
-
const normalized = normalizeRemap(remap, target);
|
|
213
|
-
const outputDefaults = deriveOutputDefaults(target);
|
|
214
|
-
if (!Number.isFinite(normalized.outLow)) {
|
|
215
|
-
normalized.outLow = outputDefaults.outLow;
|
|
216
|
-
}
|
|
217
|
-
if (!Number.isFinite(normalized.outHigh)) {
|
|
218
|
-
normalized.outHigh = outputDefaults.outHigh;
|
|
219
|
-
}
|
|
220
|
-
if (!Number.isFinite(normalized.outAnchor)) {
|
|
221
|
-
normalized.outAnchor = outputDefaults.outAnchor;
|
|
222
|
-
}
|
|
223
|
-
if (normalized.outLow > normalized.outHigh) {
|
|
224
|
-
const low = normalized.outHigh;
|
|
225
|
-
const high = normalized.outLow;
|
|
226
|
-
normalized.outLow = low;
|
|
227
|
-
normalized.outHigh = high;
|
|
228
|
-
}
|
|
229
|
-
normalized.outAnchor = clamp(
|
|
230
|
-
normalized.outAnchor,
|
|
231
|
-
normalized.outLow,
|
|
232
|
-
normalized.outHigh
|
|
233
|
-
);
|
|
234
|
-
return normalized;
|
|
235
|
-
}
|
|
236
|
-
function createDefaultRemap(target) {
|
|
237
|
-
const inputDefaults = deriveInputDefaults();
|
|
238
|
-
const outputDefaults = deriveOutputDefaults(target);
|
|
239
|
-
return {
|
|
240
|
-
inLow: inputDefaults.inLow,
|
|
241
|
-
inAnchor: inputDefaults.inAnchor,
|
|
242
|
-
inHigh: inputDefaults.inHigh,
|
|
243
|
-
outLow: outputDefaults.outLow,
|
|
244
|
-
outAnchor: outputDefaults.outAnchor,
|
|
245
|
-
outHigh: outputDefaults.outHigh
|
|
246
|
-
};
|
|
123
|
+
return cloneDeepSafe(metadata);
|
|
247
124
|
}
|
|
248
125
|
function createDefaultBindings(components) {
|
|
249
126
|
const bindings = {};
|
|
@@ -253,21 +130,18 @@ function createDefaultBindings(components) {
|
|
|
253
130
|
return bindings;
|
|
254
131
|
}
|
|
255
132
|
function createDefaultBinding(component) {
|
|
256
|
-
const remap = createDefaultRemap(component);
|
|
257
133
|
const valueType = getTargetValueType(component);
|
|
258
134
|
const slots = [
|
|
259
135
|
{
|
|
260
136
|
id: PRIMARY_SLOT_ID,
|
|
261
137
|
alias: PRIMARY_SLOT_ALIAS,
|
|
262
138
|
inputId: null,
|
|
263
|
-
remap: cloneRemap(remap),
|
|
264
139
|
valueType
|
|
265
140
|
}
|
|
266
141
|
];
|
|
267
142
|
return {
|
|
268
143
|
targetId: component.id,
|
|
269
144
|
inputId: null,
|
|
270
|
-
remap,
|
|
271
145
|
slots,
|
|
272
146
|
expression: buildCanonicalExpressionFromSlots(slots)
|
|
273
147
|
};
|
|
@@ -293,7 +167,6 @@ function createDefaultParentBinding(component) {
|
|
|
293
167
|
};
|
|
294
168
|
}
|
|
295
169
|
function ensurePrimarySlot(binding, target) {
|
|
296
|
-
const normalizedBindingRemap = sanitizeRemap(binding.remap, target);
|
|
297
170
|
const targetValueType = getTargetValueType(target);
|
|
298
171
|
const aliasReplacements = /* @__PURE__ */ new Map();
|
|
299
172
|
const sourceSlots = Array.isArray(binding.slots) && binding.slots.length > 0 ? binding.slots : [
|
|
@@ -301,7 +174,6 @@ function ensurePrimarySlot(binding, target) {
|
|
|
301
174
|
id: PRIMARY_SLOT_ID,
|
|
302
175
|
alias: PRIMARY_SLOT_ALIAS,
|
|
303
176
|
inputId: binding.inputId ?? null,
|
|
304
|
-
remap: cloneRemap(normalizedBindingRemap),
|
|
305
177
|
valueType: targetValueType
|
|
306
178
|
}
|
|
307
179
|
];
|
|
@@ -316,8 +188,6 @@ function ensurePrimarySlot(binding, target) {
|
|
|
316
188
|
if (replaced && replaced !== normalizedAlias) {
|
|
317
189
|
aliasReplacements.set(replaced, normalizedAlias);
|
|
318
190
|
}
|
|
319
|
-
const slotRemapSource = slot.remap ?? (index === 0 ? normalizedBindingRemap : createDefaultRemap(target));
|
|
320
|
-
const normalizedSlotRemap = sanitizeRemap(slotRemapSource, target);
|
|
321
191
|
const inputId = slot.inputId !== void 0 && slot.inputId !== null ? slot.inputId : index === 0 ? binding.inputId ?? null : null;
|
|
322
192
|
const slotValueType = sanitizeSlotValueType(
|
|
323
193
|
slot.valueType,
|
|
@@ -327,13 +197,11 @@ function ensurePrimarySlot(binding, target) {
|
|
|
327
197
|
id: normalizedId,
|
|
328
198
|
alias: normalizedAlias,
|
|
329
199
|
inputId,
|
|
330
|
-
remap: cloneRemap(normalizedSlotRemap),
|
|
331
200
|
valueType: slotValueType
|
|
332
201
|
};
|
|
333
202
|
}
|
|
334
203
|
);
|
|
335
204
|
const primary = normalizedSlots[0];
|
|
336
|
-
const primaryRemap = sanitizeRemap(primary.remap, target);
|
|
337
205
|
const primaryInputId = primary.inputId === SELF_BINDING_ID ? SELF_BINDING_ID : primary.inputId ?? binding.inputId ?? null;
|
|
338
206
|
const primaryAlias = primaryInputId === SELF_BINDING_ID ? "self" : primary.alias || PRIMARY_SLOT_ALIAS;
|
|
339
207
|
normalizedSlots[0] = {
|
|
@@ -341,16 +209,13 @@ function ensurePrimarySlot(binding, target) {
|
|
|
341
209
|
id: primary.id || PRIMARY_SLOT_ID,
|
|
342
210
|
alias: primaryAlias,
|
|
343
211
|
inputId: primaryInputId,
|
|
344
|
-
remap: cloneRemap(primaryRemap),
|
|
345
212
|
valueType: sanitizeSlotValueType(primary.valueType, targetValueType)
|
|
346
213
|
};
|
|
347
214
|
normalizedSlots.slice(1).forEach((slot, index) => {
|
|
348
|
-
const slotRemap = sanitizeRemap(slot.remap, target);
|
|
349
215
|
normalizedSlots[index + 1] = {
|
|
350
216
|
...slot,
|
|
351
217
|
id: slot.id || defaultSlotId(index + 1),
|
|
352
218
|
alias: slot.alias || defaultSlotId(index + 1),
|
|
353
|
-
remap: cloneRemap(slotRemap),
|
|
354
219
|
valueType: sanitizeSlotValueType(slot.valueType, targetValueType)
|
|
355
220
|
};
|
|
356
221
|
});
|
|
@@ -365,7 +230,6 @@ function ensurePrimarySlot(binding, target) {
|
|
|
365
230
|
const normalizedBinding = {
|
|
366
231
|
...binding,
|
|
367
232
|
inputId: normalizedSlots[0].inputId ?? null,
|
|
368
|
-
remap: cloneRemap(primaryRemap),
|
|
369
233
|
slots: normalizedSlots,
|
|
370
234
|
expression
|
|
371
235
|
};
|
|
@@ -392,14 +256,13 @@ function addBindingSlot(binding, target) {
|
|
|
392
256
|
const nextIndex = base.slots.length + 1;
|
|
393
257
|
const slotId = defaultSlotId(nextIndex - 1);
|
|
394
258
|
const alias = slotId;
|
|
395
|
-
const remap = createDefaultRemap(target);
|
|
396
259
|
const nextSlots = [
|
|
397
260
|
...base.slots,
|
|
398
261
|
{
|
|
399
262
|
id: slotId,
|
|
400
263
|
alias,
|
|
401
264
|
inputId: null,
|
|
402
|
-
|
|
265
|
+
valueType: getTargetValueType(target)
|
|
403
266
|
}
|
|
404
267
|
];
|
|
405
268
|
return ensurePrimarySlot(
|
|
@@ -513,50 +376,6 @@ function updateBindingExpression(binding, target, expression) {
|
|
|
513
376
|
expression: trimmed.length > 0 ? trimmed : canonicalExpression
|
|
514
377
|
};
|
|
515
378
|
}
|
|
516
|
-
function updateBindingSlotRemap(binding, target, slotId, field, value) {
|
|
517
|
-
const base = ensurePrimarySlot(binding, target);
|
|
518
|
-
const existingExpression = typeof base.expression === "string" ? base.expression.trim() : "";
|
|
519
|
-
const canonicalBefore = buildCanonicalExpressionFromSlots(base.slots);
|
|
520
|
-
const expressionWasDefault = expressionMatchesAliasOnly(existingExpression, base.slots) || expressionsEquivalent(existingExpression, canonicalBefore);
|
|
521
|
-
const nextSlots = base.slots.map((slot) => {
|
|
522
|
-
if (slot.id !== slotId) {
|
|
523
|
-
return slot;
|
|
524
|
-
}
|
|
525
|
-
const updatedRemap = {
|
|
526
|
-
...slot.remap,
|
|
527
|
-
[field]: value
|
|
528
|
-
};
|
|
529
|
-
const sanitized = sanitizeRemap(updatedRemap, target);
|
|
530
|
-
return {
|
|
531
|
-
...slot,
|
|
532
|
-
remap: cloneRemap(sanitized)
|
|
533
|
-
};
|
|
534
|
-
});
|
|
535
|
-
const updated = ensurePrimarySlot(
|
|
536
|
-
{
|
|
537
|
-
...base,
|
|
538
|
-
slots: nextSlots
|
|
539
|
-
},
|
|
540
|
-
target
|
|
541
|
-
);
|
|
542
|
-
if (updated.slots[0]?.id === slotId) {
|
|
543
|
-
updated.remap = {
|
|
544
|
-
...updated.remap,
|
|
545
|
-
[field]: value
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
if (!expressionWasDefault) {
|
|
549
|
-
return updated;
|
|
550
|
-
}
|
|
551
|
-
const canonicalAfter = buildCanonicalExpressionFromSlots(updated.slots);
|
|
552
|
-
if (expressionsEquivalent(updated.expression ?? "", canonicalAfter)) {
|
|
553
|
-
return updated;
|
|
554
|
-
}
|
|
555
|
-
return {
|
|
556
|
-
...updated,
|
|
557
|
-
expression: canonicalAfter
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
379
|
function updateBindingWithInput(binding, target, input, slotId = PRIMARY_SLOT_ID) {
|
|
561
380
|
const base = ensurePrimarySlot(binding, target);
|
|
562
381
|
const existingExpression = typeof base.expression === "string" ? base.expression.trim() : "";
|
|
@@ -564,39 +383,27 @@ function updateBindingWithInput(binding, target, input, slotId = PRIMARY_SLOT_ID
|
|
|
564
383
|
const expressionWasDefault = expressionMatchesAliasOnly(existingExpression, base.slots) || expressionsEquivalent(existingExpression, canonicalBefore);
|
|
565
384
|
const slotIndex = base.slots.findIndex((slot) => slot.id === slotId);
|
|
566
385
|
const effectiveIndex = slotIndex >= 0 ? slotIndex : base.slots.length;
|
|
567
|
-
const slots = base.slots.map((slot) => ({
|
|
568
|
-
...slot,
|
|
569
|
-
remap: cloneRemap(slot.remap)
|
|
570
|
-
}));
|
|
386
|
+
const slots = base.slots.map((slot) => ({ ...slot }));
|
|
571
387
|
if (slotIndex === -1) {
|
|
572
388
|
const alias = slotId === PRIMARY_SLOT_ID && slots.length === 0 ? PRIMARY_SLOT_ALIAS : slotId;
|
|
573
389
|
slots.push({
|
|
574
390
|
id: slotId,
|
|
575
391
|
alias,
|
|
576
392
|
inputId: null,
|
|
577
|
-
|
|
393
|
+
valueType: getTargetValueType(target)
|
|
578
394
|
});
|
|
579
395
|
}
|
|
580
396
|
const currentSlot = slots[effectiveIndex];
|
|
581
397
|
let nextBinding;
|
|
582
398
|
if (!input) {
|
|
583
|
-
const normalizedSlotRemap = sanitizeRemap(currentSlot.remap, target);
|
|
584
|
-
const updatedRemap = {
|
|
585
|
-
...normalizedSlotRemap,
|
|
586
|
-
inLow: DEFAULT_INPUT_RANGE.min,
|
|
587
|
-
inAnchor: DEFAULT_INPUT_ANCHOR,
|
|
588
|
-
inHigh: DEFAULT_INPUT_RANGE.max
|
|
589
|
-
};
|
|
590
399
|
slots[effectiveIndex] = {
|
|
591
400
|
...currentSlot,
|
|
592
|
-
inputId: null
|
|
593
|
-
remap: cloneRemap(updatedRemap)
|
|
401
|
+
inputId: null
|
|
594
402
|
};
|
|
595
403
|
if (effectiveIndex === 0) {
|
|
596
404
|
nextBinding = {
|
|
597
405
|
...base,
|
|
598
406
|
inputId: null,
|
|
599
|
-
remap: cloneRemap(updatedRemap),
|
|
600
407
|
slots
|
|
601
408
|
};
|
|
602
409
|
} else {
|
|
@@ -606,24 +413,14 @@ function updateBindingWithInput(binding, target, input, slotId = PRIMARY_SLOT_ID
|
|
|
606
413
|
};
|
|
607
414
|
}
|
|
608
415
|
} else {
|
|
609
|
-
const normalizedRemap = sanitizeRemap(currentSlot.remap, target);
|
|
610
|
-
const updatedRemap = {
|
|
611
|
-
...normalizedRemap,
|
|
612
|
-
inLow: input.range.min,
|
|
613
|
-
inAnchor: clamp(input.defaultValue, input.range.min, input.range.max),
|
|
614
|
-
inHigh: input.range.max,
|
|
615
|
-
...deriveOutputDefaults(target)
|
|
616
|
-
};
|
|
617
416
|
slots[effectiveIndex] = {
|
|
618
417
|
...currentSlot,
|
|
619
|
-
inputId: input.id
|
|
620
|
-
remap: cloneRemap(updatedRemap)
|
|
418
|
+
inputId: input.id
|
|
621
419
|
};
|
|
622
420
|
if (effectiveIndex === 0) {
|
|
623
421
|
nextBinding = {
|
|
624
422
|
...base,
|
|
625
423
|
inputId: input.id,
|
|
626
|
-
remap: cloneRemap(updatedRemap),
|
|
627
424
|
slots
|
|
628
425
|
};
|
|
629
426
|
} else {
|
|
@@ -645,26 +442,6 @@ function updateBindingWithInput(binding, target, input, slotId = PRIMARY_SLOT_ID
|
|
|
645
442
|
expression: canonicalAfter
|
|
646
443
|
};
|
|
647
444
|
}
|
|
648
|
-
function remapValue(value, remap) {
|
|
649
|
-
const { inLow, inAnchor, inHigh, outLow, outAnchor, outHigh } = remap;
|
|
650
|
-
if (Number.isNaN(value)) {
|
|
651
|
-
return outAnchor;
|
|
652
|
-
}
|
|
653
|
-
if (value <= inAnchor) {
|
|
654
|
-
const span2 = inAnchor - inLow;
|
|
655
|
-
if (Math.abs(span2) < EPSILON) {
|
|
656
|
-
return outLow;
|
|
657
|
-
}
|
|
658
|
-
const t2 = (value - inLow) / span2;
|
|
659
|
-
return outLow + t2 * (outAnchor - outLow);
|
|
660
|
-
}
|
|
661
|
-
const span = inHigh - inAnchor;
|
|
662
|
-
if (Math.abs(span) < EPSILON) {
|
|
663
|
-
return outHigh;
|
|
664
|
-
}
|
|
665
|
-
const t = (value - inAnchor) / span;
|
|
666
|
-
return outAnchor + t * (outHigh - outAnchor);
|
|
667
|
-
}
|
|
668
445
|
function reconcileBindings(previous, components) {
|
|
669
446
|
const next = {};
|
|
670
447
|
components.forEach((component) => {
|
|
@@ -682,12 +459,10 @@ function reconcileBindings(previous, components) {
|
|
|
682
459
|
if (replaced && replaced !== normalizedAlias) {
|
|
683
460
|
aliasReplacements.set(replaced, normalizedAlias);
|
|
684
461
|
}
|
|
685
|
-
const slotRemap = sanitizeRemap(slot.remap, component);
|
|
686
462
|
return {
|
|
687
463
|
...slot,
|
|
688
464
|
id: normalizedId,
|
|
689
|
-
alias: normalizedAlias
|
|
690
|
-
remap: cloneRemap(slotRemap)
|
|
465
|
+
alias: normalizedAlias
|
|
691
466
|
};
|
|
692
467
|
});
|
|
693
468
|
const primary = slots[0];
|
|
@@ -697,7 +472,6 @@ function reconcileBindings(previous, components) {
|
|
|
697
472
|
...ensured,
|
|
698
473
|
targetId: component.id,
|
|
699
474
|
inputId: primary.inputId ?? null,
|
|
700
|
-
remap: cloneRemap(primary.remap),
|
|
701
475
|
slots,
|
|
702
476
|
expression
|
|
703
477
|
};
|
|
@@ -710,11 +484,7 @@ function reconcileBindings(previous, components) {
|
|
|
710
484
|
function bindingToDefinition(binding) {
|
|
711
485
|
const definition = {
|
|
712
486
|
inputId: binding.inputId ?? null,
|
|
713
|
-
|
|
714
|
-
slots: binding.slots.map((slot) => ({
|
|
715
|
-
...slot,
|
|
716
|
-
remap: cloneRemap(slot.remap)
|
|
717
|
-
})),
|
|
487
|
+
slots: binding.slots.map((slot) => ({ ...slot })),
|
|
718
488
|
expression: binding.expression,
|
|
719
489
|
metadata: cloneBindingMetadata(binding.metadata)
|
|
720
490
|
};
|
|
@@ -727,46 +497,12 @@ function bindingFromDefinition(target, definition) {
|
|
|
727
497
|
const binding = {
|
|
728
498
|
targetId: target.id,
|
|
729
499
|
inputId: definition.inputId ?? null,
|
|
730
|
-
|
|
731
|
-
slots: definition.slots.map((slot) => ({
|
|
732
|
-
...slot,
|
|
733
|
-
remap: cloneRemap(slot.remap)
|
|
734
|
-
})),
|
|
500
|
+
slots: definition.slots.map((slot) => ({ ...slot })),
|
|
735
501
|
expression: definition.expression,
|
|
736
502
|
metadata: cloneBindingMetadata(definition.metadata)
|
|
737
503
|
};
|
|
738
504
|
return ensureBindingStructure(binding, target);
|
|
739
505
|
}
|
|
740
|
-
function sanitizeLiteral(value) {
|
|
741
|
-
if (!Number.isFinite(value)) {
|
|
742
|
-
return 0;
|
|
743
|
-
}
|
|
744
|
-
if (Object.is(value, -0)) {
|
|
745
|
-
return 0;
|
|
746
|
-
}
|
|
747
|
-
return value;
|
|
748
|
-
}
|
|
749
|
-
function formatVectorLiteral(values) {
|
|
750
|
-
return `vec(${values.map((value) => sanitizeLiteral(value)).join(", ")})`;
|
|
751
|
-
}
|
|
752
|
-
function buildPiecewiseRemapExpression(alias, remap) {
|
|
753
|
-
const sanitizedAlias = alias && alias.trim().length > 0 ? alias.trim() : PRIMARY_SLOT_ALIAS;
|
|
754
|
-
const inputBreakpoints = [remap.inLow, remap.inAnchor, remap.inHigh];
|
|
755
|
-
const outputBreakpoints = [remap.outLow, remap.outAnchor, remap.outHigh];
|
|
756
|
-
return `piecewise_remap(${sanitizedAlias}, ${formatVectorLiteral(
|
|
757
|
-
inputBreakpoints
|
|
758
|
-
)}, ${formatVectorLiteral(outputBreakpoints)})`;
|
|
759
|
-
}
|
|
760
|
-
function isSelfAlias(alias) {
|
|
761
|
-
return alias.trim().toLowerCase() === "self";
|
|
762
|
-
}
|
|
763
|
-
function buildDefaultSlotExpression(alias, inputId, remap) {
|
|
764
|
-
const sanitizedAlias = alias && alias.trim().length > 0 ? alias.trim() : PRIMARY_SLOT_ALIAS;
|
|
765
|
-
if (inputId === SELF_BINDING_ID || isSelfAlias(sanitizedAlias)) {
|
|
766
|
-
return sanitizedAlias;
|
|
767
|
-
}
|
|
768
|
-
return buildPiecewiseRemapExpression(sanitizedAlias, remap);
|
|
769
|
-
}
|
|
770
506
|
function normalizeSlotAliasForExpression(slot, index) {
|
|
771
507
|
if (slot.alias && slot.alias.trim().length > 0) {
|
|
772
508
|
return slot.alias.trim();
|
|
@@ -783,16 +519,7 @@ function buildAliasOnlyExpression(slots) {
|
|
|
783
519
|
return slots.map((slot, index) => normalizeSlotAliasForExpression(slot, index)).join(" + ");
|
|
784
520
|
}
|
|
785
521
|
function buildCanonicalExpressionFromSlots(slots) {
|
|
786
|
-
|
|
787
|
-
return PRIMARY_SLOT_ALIAS;
|
|
788
|
-
}
|
|
789
|
-
return slots.map(
|
|
790
|
-
(slot, index) => buildDefaultSlotExpression(
|
|
791
|
-
normalizeSlotAliasForExpression(slot, index),
|
|
792
|
-
slot.inputId ?? null,
|
|
793
|
-
slot.remap
|
|
794
|
-
)
|
|
795
|
-
).join(" + ");
|
|
522
|
+
return buildAliasOnlyExpression(slots);
|
|
796
523
|
}
|
|
797
524
|
function expressionsEquivalent(left, right) {
|
|
798
525
|
return left.trim() === right.trim();
|
|
@@ -1903,9 +1630,7 @@ var DefaultExpressionVariableTable = class {
|
|
|
1903
1630
|
targetId: options.targetId,
|
|
1904
1631
|
animatableId: options.animatableId,
|
|
1905
1632
|
component: options.component,
|
|
1906
|
-
valueType: options.valueType
|
|
1907
|
-
remap: options.remap,
|
|
1908
|
-
autoRemap: options.autoRemap
|
|
1633
|
+
valueType: options.valueType
|
|
1909
1634
|
}
|
|
1910
1635
|
});
|
|
1911
1636
|
}
|
|
@@ -2088,12 +1813,12 @@ function createLegacyIrGraph(payload) {
|
|
|
2088
1813
|
function toIrBindingSummary(summaries) {
|
|
2089
1814
|
return summaries.map((summary) => ({
|
|
2090
1815
|
...summary,
|
|
2091
|
-
remap: { ...summary.remap },
|
|
2092
1816
|
issues: summary.issues ? [...summary.issues] : void 0
|
|
2093
1817
|
}));
|
|
2094
1818
|
}
|
|
2095
1819
|
|
|
2096
1820
|
// src/ir/compiler.ts
|
|
1821
|
+
import { cloneDeepSafe as cloneDeepSafe2 } from "@vizij/utils";
|
|
2097
1822
|
function compileIrGraph(graph, options = {}) {
|
|
2098
1823
|
const preferLegacy = options.preferLegacySpec === true;
|
|
2099
1824
|
const legacySpec = graph.legacy?.spec;
|
|
@@ -2178,7 +1903,7 @@ function cloneJsonLike(value) {
|
|
|
2178
1903
|
if (value === void 0 || value === null) {
|
|
2179
1904
|
return value;
|
|
2180
1905
|
}
|
|
2181
|
-
return
|
|
1906
|
+
return cloneDeepSafe2(value);
|
|
2182
1907
|
}
|
|
2183
1908
|
function inlineSingleUseConstants(spec) {
|
|
2184
1909
|
const nodes = spec.nodes ?? [];
|
|
@@ -2217,13 +1942,16 @@ function inlineSingleUseConstants(spec) {
|
|
|
2217
1942
|
}
|
|
2218
1943
|
|
|
2219
1944
|
// src/graphBuilder.ts
|
|
2220
|
-
import { buildAnimatableValue } from "@vizij/utils";
|
|
1945
|
+
import { buildAnimatableValue, cloneDeepSafe as cloneDeepSafe4 } from "@vizij/utils";
|
|
2221
1946
|
import { SELF_BINDING_ID as SELF_BINDING_ID2 } from "@vizij/utils";
|
|
2222
1947
|
import { nodeRegistryVersion } from "@vizij/node-graph-wasm/metadata";
|
|
2223
1948
|
|
|
2224
1949
|
// src/bindingMetadata.ts
|
|
1950
|
+
import {
|
|
1951
|
+
cloneDeepSafe as cloneDeepSafe3
|
|
1952
|
+
} from "@vizij/utils";
|
|
2225
1953
|
function cloneOperand(entry) {
|
|
2226
|
-
return
|
|
1954
|
+
return cloneDeepSafe3(entry);
|
|
2227
1955
|
}
|
|
2228
1956
|
function describeSlot(entry) {
|
|
2229
1957
|
const metadata = entry.metadata;
|
|
@@ -2265,17 +1993,17 @@ function describeReference(node, variables) {
|
|
|
2265
1993
|
function stringifyExpression(node) {
|
|
2266
1994
|
switch (node.type) {
|
|
2267
1995
|
case "Literal":
|
|
2268
|
-
return Number.isFinite(node.value) ? `${node.value}` : "0";
|
|
1996
|
+
return Number.isFinite(node.value) ? `${node.value} ` : "0";
|
|
2269
1997
|
case "VectorLiteral":
|
|
2270
1998
|
return `vec(${node.values.join(", ")})`;
|
|
2271
1999
|
case "Reference":
|
|
2272
2000
|
return node.name;
|
|
2273
2001
|
case "Unary":
|
|
2274
|
-
return `${node.operator}${stringifyExpression(node.operand)}`;
|
|
2002
|
+
return `${node.operator}${stringifyExpression(node.operand)} `;
|
|
2275
2003
|
case "Binary":
|
|
2276
|
-
return `${stringifyExpression(node.left)} ${node.operator} ${stringifyExpression(node.right)}`;
|
|
2004
|
+
return `${stringifyExpression(node.left)} ${node.operator} ${stringifyExpression(node.right)} `;
|
|
2277
2005
|
case "Function":
|
|
2278
|
-
return `${node.name}(${node.args.map(stringifyExpression).join(", ")})`;
|
|
2006
|
+
return `${node.name} (${node.args.map(stringifyExpression).join(", ")})`;
|
|
2279
2007
|
default:
|
|
2280
2008
|
return "";
|
|
2281
2009
|
}
|
|
@@ -2359,7 +2087,6 @@ function evaluateBinding({
|
|
|
2359
2087
|
counter: 0,
|
|
2360
2088
|
reservedNodes: /* @__PURE__ */ new Map(),
|
|
2361
2089
|
nodeValueTypes: /* @__PURE__ */ new Map(),
|
|
2362
|
-
slotRemapNodes: /* @__PURE__ */ new Map(),
|
|
2363
2090
|
graphReservedNodes: context.graphReservedNodes,
|
|
2364
2091
|
generateReservedNodeId: context.generateReservedNodeId
|
|
2365
2092
|
};
|
|
@@ -2416,9 +2143,7 @@ function evaluateBinding({
|
|
|
2416
2143
|
targetId,
|
|
2417
2144
|
animatableId,
|
|
2418
2145
|
component,
|
|
2419
|
-
valueType: slotValueType
|
|
2420
|
-
remap: { ...slot.remap },
|
|
2421
|
-
autoRemap: slot.inputId !== SELF_BINDING_ID2 && slotValueType === "scalar"
|
|
2146
|
+
valueType: slotValueType
|
|
2422
2147
|
});
|
|
2423
2148
|
setNodeValueType(
|
|
2424
2149
|
exprContext,
|
|
@@ -2432,7 +2157,6 @@ function evaluateBinding({
|
|
|
2432
2157
|
slotId,
|
|
2433
2158
|
slotAlias: alias,
|
|
2434
2159
|
inputId: slot.inputId ?? null,
|
|
2435
|
-
remap: { ...slot.remap },
|
|
2436
2160
|
expression: trimmedExpression,
|
|
2437
2161
|
valueType: slotValueType,
|
|
2438
2162
|
nodeId: slotOutputId,
|
|
@@ -2451,9 +2175,7 @@ function evaluateBinding({
|
|
|
2451
2175
|
targetId,
|
|
2452
2176
|
animatableId,
|
|
2453
2177
|
component,
|
|
2454
|
-
valueType: targetValueType
|
|
2455
|
-
remap: createDefaultRemap(target),
|
|
2456
|
-
autoRemap: false
|
|
2178
|
+
valueType: targetValueType
|
|
2457
2179
|
});
|
|
2458
2180
|
setNodeValueType(
|
|
2459
2181
|
exprContext,
|
|
@@ -2467,7 +2189,6 @@ function evaluateBinding({
|
|
|
2467
2189
|
slotId: PRIMARY_SLOT_ID,
|
|
2468
2190
|
slotAlias: alias,
|
|
2469
2191
|
inputId: null,
|
|
2470
|
-
remap: createDefaultRemap(target),
|
|
2471
2192
|
expression: trimmedExpression,
|
|
2472
2193
|
valueType: targetValueType,
|
|
2473
2194
|
nodeId: constantId,
|
|
@@ -2664,73 +2385,6 @@ function ensureOperandValueType(context, operandId, expected, functionName, inpu
|
|
|
2664
2385
|
`Function "${functionName}" expects ${expectation} input for "${inputId}", but the expression produced ${actual}.`
|
|
2665
2386
|
);
|
|
2666
2387
|
}
|
|
2667
|
-
function resolveSlotReferenceNode(entry, fallbackNodeId, context) {
|
|
2668
|
-
if (entry.kind !== "slot") {
|
|
2669
|
-
return fallbackNodeId;
|
|
2670
|
-
}
|
|
2671
|
-
const metadata = entry.metadata;
|
|
2672
|
-
if (!metadata || metadata.autoRemap === false || !metadata.remap) {
|
|
2673
|
-
return fallbackNodeId;
|
|
2674
|
-
}
|
|
2675
|
-
if (metadata.valueType !== "scalar") {
|
|
2676
|
-
return fallbackNodeId;
|
|
2677
|
-
}
|
|
2678
|
-
if (isIdentityRemap(metadata.remap)) {
|
|
2679
|
-
return fallbackNodeId;
|
|
2680
|
-
}
|
|
2681
|
-
const cacheKey = metadata.slotId ?? entry.name;
|
|
2682
|
-
const existing = context.slotRemapNodes.get(cacheKey);
|
|
2683
|
-
if (existing) {
|
|
2684
|
-
return existing;
|
|
2685
|
-
}
|
|
2686
|
-
const remapNodeId = createSlotRemapNode(
|
|
2687
|
-
context,
|
|
2688
|
-
fallbackNodeId,
|
|
2689
|
-
metadata.remap,
|
|
2690
|
-
metadata.slotAlias ?? cacheKey
|
|
2691
|
-
);
|
|
2692
|
-
context.slotRemapNodes.set(cacheKey, remapNodeId);
|
|
2693
|
-
return remapNodeId;
|
|
2694
|
-
}
|
|
2695
|
-
function createSlotRemapNode(context, sourceNodeId, remap, slotKey) {
|
|
2696
|
-
const safeSlotKey = sanitizeNodeId(slotKey || "slot");
|
|
2697
|
-
const nodeId = `slot_remap_${safeSlotKey}_${context.counter++}`;
|
|
2698
|
-
context.nodes.push({
|
|
2699
|
-
id: nodeId,
|
|
2700
|
-
type: "centered_remap",
|
|
2701
|
-
inputDefaults: {
|
|
2702
|
-
in_low: remap.inLow,
|
|
2703
|
-
in_anchor: remap.inAnchor,
|
|
2704
|
-
in_high: remap.inHigh,
|
|
2705
|
-
out_low: remap.outLow,
|
|
2706
|
-
out_anchor: remap.outAnchor,
|
|
2707
|
-
out_high: remap.outHigh
|
|
2708
|
-
}
|
|
2709
|
-
});
|
|
2710
|
-
context.edges.push({
|
|
2711
|
-
from: { nodeId: sourceNodeId },
|
|
2712
|
-
to: { nodeId, portId: "in" }
|
|
2713
|
-
});
|
|
2714
|
-
setNodeValueType(context, nodeId, "scalar");
|
|
2715
|
-
return nodeId;
|
|
2716
|
-
}
|
|
2717
|
-
function isIdentityRemap(remap) {
|
|
2718
|
-
return nearlyEqual(remap.inLow, remap.outLow) && nearlyEqual(remap.inAnchor, remap.outAnchor) && nearlyEqual(remap.inHigh, remap.outHigh);
|
|
2719
|
-
}
|
|
2720
|
-
function nearlyEqual(a, b, epsilon = 1e-4) {
|
|
2721
|
-
return Math.abs(a - b) <= epsilon;
|
|
2722
|
-
}
|
|
2723
|
-
var REMAP_FUNCTION_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
2724
|
-
"piecewise_remap",
|
|
2725
|
-
"centered_remap",
|
|
2726
|
-
"remap"
|
|
2727
|
-
]);
|
|
2728
|
-
function shouldSkipAutoRemapForArgument(nodeType, index) {
|
|
2729
|
-
if (!REMAP_FUNCTION_NODE_TYPES.has(nodeType)) {
|
|
2730
|
-
return false;
|
|
2731
|
-
}
|
|
2732
|
-
return index === 0;
|
|
2733
|
-
}
|
|
2734
2388
|
function getConstantNodeId(context, value) {
|
|
2735
2389
|
const key = Number.isFinite(value) ? value.toString() : "NaN";
|
|
2736
2390
|
const existing = context.constants.get(key);
|
|
@@ -3189,8 +2843,7 @@ var BINARY_FUNCTION_OPERATOR_MAP = {
|
|
|
3189
2843
|
"&&": "and",
|
|
3190
2844
|
"||": "or"
|
|
3191
2845
|
};
|
|
3192
|
-
function materializeExpression(node, context, variables, issues
|
|
3193
|
-
const autoRemap = options?.autoRemap !== false;
|
|
2846
|
+
function materializeExpression(node, context, variables, issues) {
|
|
3194
2847
|
switch (node.type) {
|
|
3195
2848
|
case "Literal": {
|
|
3196
2849
|
return getConstantNodeId(context, node.value);
|
|
@@ -3205,10 +2858,7 @@ function materializeExpression(node, context, variables, issues, options) {
|
|
|
3205
2858
|
return getConstantNodeId(context, 0);
|
|
3206
2859
|
}
|
|
3207
2860
|
const mappedId = entry.nodeId ?? getConstantNodeId(context, 0);
|
|
3208
|
-
|
|
3209
|
-
return mappedId;
|
|
3210
|
-
}
|
|
3211
|
-
return resolveSlotReferenceNode(entry, mappedId, context);
|
|
2861
|
+
return mappedId;
|
|
3212
2862
|
}
|
|
3213
2863
|
case "Unary": {
|
|
3214
2864
|
const operandId = materializeExpression(
|
|
@@ -3346,13 +2996,7 @@ function materializeExpression(node, context, variables, issues, options) {
|
|
|
3346
2996
|
);
|
|
3347
2997
|
const operandNodes = argNodes.slice(0, operandLimit);
|
|
3348
2998
|
const operands = operandNodes.map(
|
|
3349
|
-
(arg,
|
|
3350
|
-
arg,
|
|
3351
|
-
context,
|
|
3352
|
-
variables,
|
|
3353
|
-
issues,
|
|
3354
|
-
shouldSkipAutoRemapForArgument(definition.nodeType, index) ? { autoRemap: false } : void 0
|
|
3355
|
-
)
|
|
2999
|
+
(arg, _index) => materializeExpression(arg, context, variables, issues)
|
|
3356
3000
|
);
|
|
3357
3001
|
const paramArgStart = operandLimit;
|
|
3358
3002
|
const paramArgNodes = paramArgCount > 0 ? argNodes.slice(paramArgStart, paramArgStart + paramArgCount) : [];
|
|
@@ -3554,7 +3198,6 @@ function buildRigGraphSpec({
|
|
|
3554
3198
|
slotId: PRIMARY_SLOT_ID,
|
|
3555
3199
|
slotAlias: PRIMARY_SLOT_ALIAS,
|
|
3556
3200
|
inputId: null,
|
|
3557
|
-
remap: createDefaultRemap(target),
|
|
3558
3201
|
expression: PRIMARY_SLOT_ALIAS,
|
|
3559
3202
|
valueType: target.valueType === "vector" ? "vector" : "scalar",
|
|
3560
3203
|
issues: ["Binding not found."],
|
|
@@ -3712,7 +3355,6 @@ function buildRigGraphSpec({
|
|
|
3712
3355
|
}),
|
|
3713
3356
|
bindings: filteredSummaryBindings.map((binding) => ({
|
|
3714
3357
|
...binding,
|
|
3715
|
-
remap: { ...binding.remap },
|
|
3716
3358
|
expression: binding.expression,
|
|
3717
3359
|
valueType: binding.valueType,
|
|
3718
3360
|
issues: binding.issues ? [...binding.issues] : void 0,
|
|
@@ -3747,7 +3389,6 @@ function buildRigGraphSpec({
|
|
|
3747
3389
|
bindings: toIrBindingSummary(
|
|
3748
3390
|
filteredSummaryBindings.map((binding) => ({
|
|
3749
3391
|
...binding,
|
|
3750
|
-
remap: { ...binding.remap },
|
|
3751
3392
|
issues: binding.issues ? [...binding.issues] : void 0
|
|
3752
3393
|
}))
|
|
3753
3394
|
)
|
|
@@ -3866,7 +3507,7 @@ function cloneJsonLike2(value) {
|
|
|
3866
3507
|
if (value === void 0 || value === null) {
|
|
3867
3508
|
return value;
|
|
3868
3509
|
}
|
|
3869
|
-
return
|
|
3510
|
+
return cloneDeepSafe4(value);
|
|
3870
3511
|
}
|
|
3871
3512
|
function validateRemapDefaults(nodes) {
|
|
3872
3513
|
const issues = [];
|
|
@@ -3894,15 +3535,8 @@ function validateRemapDefaults(nodes) {
|
|
|
3894
3535
|
|
|
3895
3536
|
// src/ir/inspection.ts
|
|
3896
3537
|
import { findNodeSignature } from "@vizij/node-graph-wasm/metadata";
|
|
3538
|
+
import { cloneDeepSafe as cloneDeepSafe5 } from "@vizij/utils";
|
|
3897
3539
|
var MACHINE_REPORT_VERSION = 1;
|
|
3898
|
-
var REMAP_KEYS = [
|
|
3899
|
-
"inLow",
|
|
3900
|
-
"inAnchor",
|
|
3901
|
-
"inHigh",
|
|
3902
|
-
"outLow",
|
|
3903
|
-
"outAnchor",
|
|
3904
|
-
"outHigh"
|
|
3905
|
-
];
|
|
3906
3540
|
var DEFAULT_DIFF_LIMIT = 50;
|
|
3907
3541
|
function buildMachineReport(result) {
|
|
3908
3542
|
return {
|
|
@@ -3943,7 +3577,6 @@ function normalizeGraphBindingSummaries(bindings) {
|
|
|
3943
3577
|
slotId: binding.slotId,
|
|
3944
3578
|
slotAlias: binding.slotAlias,
|
|
3945
3579
|
inputId: binding.inputId ?? null,
|
|
3946
|
-
remap: normalizeRemap2(binding.remap),
|
|
3947
3580
|
expression: binding.expression,
|
|
3948
3581
|
valueType: binding.valueType,
|
|
3949
3582
|
nodeId: binding.nodeId,
|
|
@@ -3958,7 +3591,7 @@ function cloneBindingMetadata2(metadata) {
|
|
|
3958
3591
|
if (!metadata) {
|
|
3959
3592
|
return void 0;
|
|
3960
3593
|
}
|
|
3961
|
-
return
|
|
3594
|
+
return cloneDeepSafe5(metadata);
|
|
3962
3595
|
}
|
|
3963
3596
|
function normalizeIssues(issues) {
|
|
3964
3597
|
const byTargetEntries = Object.entries(issues.byTarget ?? {}).map(
|
|
@@ -4042,7 +3675,6 @@ function normalizeIrGraphSummary(summary) {
|
|
|
4042
3675
|
function normalizeIrBindingSummaries(bindings) {
|
|
4043
3676
|
const normalized = bindings.map((binding) => ({
|
|
4044
3677
|
...binding,
|
|
4045
|
-
remap: sortPlainObject(binding.remap),
|
|
4046
3678
|
issues: normalizeStringArray(binding.issues)
|
|
4047
3679
|
}));
|
|
4048
3680
|
normalized.sort((a, b) => bindingSortKey(a).localeCompare(bindingSortKey(b)));
|
|
@@ -4145,13 +3777,6 @@ function normalizeRegistryParamSpec(param) {
|
|
|
4145
3777
|
}
|
|
4146
3778
|
return normalized;
|
|
4147
3779
|
}
|
|
4148
|
-
function normalizeRemap2(remap) {
|
|
4149
|
-
const normalized = {};
|
|
4150
|
-
REMAP_KEYS.forEach((key) => {
|
|
4151
|
-
normalized[key] = remap[key];
|
|
4152
|
-
});
|
|
4153
|
-
return normalized;
|
|
4154
|
-
}
|
|
4155
3780
|
function normalizeStringArray(values) {
|
|
4156
3781
|
if (!values || values.length === 0) {
|
|
4157
3782
|
return void 0;
|
|
@@ -4294,7 +3919,6 @@ export {
|
|
|
4294
3919
|
bindingTargetFromInput,
|
|
4295
3920
|
PRIMARY_SLOT_ID,
|
|
4296
3921
|
PRIMARY_SLOT_ALIAS,
|
|
4297
|
-
createDefaultRemap,
|
|
4298
3922
|
createDefaultBindings,
|
|
4299
3923
|
createDefaultBinding,
|
|
4300
3924
|
createDefaultParentBinding,
|
|
@@ -4306,14 +3930,10 @@ export {
|
|
|
4306
3930
|
updateBindingSlotAlias,
|
|
4307
3931
|
updateBindingSlotValueType,
|
|
4308
3932
|
updateBindingExpression,
|
|
4309
|
-
updateBindingSlotRemap,
|
|
4310
3933
|
updateBindingWithInput,
|
|
4311
|
-
remapValue,
|
|
4312
3934
|
reconcileBindings,
|
|
4313
3935
|
bindingToDefinition,
|
|
4314
3936
|
bindingFromDefinition,
|
|
4315
|
-
buildPiecewiseRemapExpression,
|
|
4316
|
-
buildDefaultSlotExpression,
|
|
4317
3937
|
buildCanonicalBindingExpression,
|
|
4318
3938
|
parseControlExpression,
|
|
4319
3939
|
collectExpressionReferences,
|