@teleporthq/teleport-plugin-common 0.43.48 → 0.43.51
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/__tests__/node-handlers/node-to-jsx/index.ts +287 -0
- package/dist/cjs/node-handlers/node-to-html/utils.d.ts.map +1 -1
- package/dist/cjs/node-handlers/node-to-html/utils.js +26 -5
- package/dist/cjs/node-handlers/node-to-html/utils.js.map +1 -1
- package/dist/cjs/node-handlers/node-to-jsx/index.d.ts.map +1 -1
- package/dist/cjs/node-handlers/node-to-jsx/index.js +20 -6
- package/dist/cjs/node-handlers/node-to-jsx/index.js.map +1 -1
- package/dist/cjs/node-handlers/node-to-jsx/utils.d.ts +6 -3
- package/dist/cjs/node-handlers/node-to-jsx/utils.d.ts.map +1 -1
- package/dist/cjs/node-handlers/node-to-jsx/utils.js +28 -19
- package/dist/cjs/node-handlers/node-to-jsx/utils.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/node-handlers/node-to-html/utils.d.ts.map +1 -1
- package/dist/esm/node-handlers/node-to-html/utils.js +26 -5
- package/dist/esm/node-handlers/node-to-html/utils.js.map +1 -1
- package/dist/esm/node-handlers/node-to-jsx/index.d.ts.map +1 -1
- package/dist/esm/node-handlers/node-to-jsx/index.js +20 -6
- package/dist/esm/node-handlers/node-to-jsx/index.js.map +1 -1
- package/dist/esm/node-handlers/node-to-jsx/utils.d.ts +6 -3
- package/dist/esm/node-handlers/node-to-jsx/utils.d.ts.map +1 -1
- package/dist/esm/node-handlers/node-to-jsx/utils.js +27 -18
- package/dist/esm/node-handlers/node-to-jsx/utils.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/node-handlers/node-to-html/utils.ts +43 -6
- package/src/node-handlers/node-to-jsx/index.ts +34 -10
- package/src/node-handlers/node-to-jsx/utils.ts +62 -27
|
@@ -226,6 +226,293 @@ describe('generateJSXSyntax', () => {
|
|
|
226
226
|
expect(wrappedContent.type).toBe('JSXElement')
|
|
227
227
|
expect((wrappedContent.openingElement.name as types.JSXIdentifier).name).toBe('container')
|
|
228
228
|
})
|
|
229
|
+
|
|
230
|
+
const buildTwoReferenceConditions = (matchingCriteria: string) =>
|
|
231
|
+
({
|
|
232
|
+
reference: {
|
|
233
|
+
type: 'dynamic',
|
|
234
|
+
content: { referenceType: 'state', id: 'newsletterOfferVisible' },
|
|
235
|
+
},
|
|
236
|
+
condition: {
|
|
237
|
+
conditions: [
|
|
238
|
+
{ operation: '===', operand: true },
|
|
239
|
+
{
|
|
240
|
+
operation: '===',
|
|
241
|
+
operand: false,
|
|
242
|
+
reference: {
|
|
243
|
+
type: 'dynamic',
|
|
244
|
+
content: { referenceType: 'state', id: 'userIsLoggedIn' },
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
matchingCriteria,
|
|
249
|
+
},
|
|
250
|
+
} as never)
|
|
251
|
+
|
|
252
|
+
it('compares each entry against its own reference when one is set (AND chain)', () => {
|
|
253
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
254
|
+
ownerContainer.content.renderingConditions = buildTwoReferenceConditions('all')
|
|
255
|
+
|
|
256
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
257
|
+
const twoStateParams: JSXGenerationParams = {
|
|
258
|
+
...params,
|
|
259
|
+
stateDefinitions: {
|
|
260
|
+
newsletterOfferVisible: { type: 'boolean', defaultValue: true },
|
|
261
|
+
userIsLoggedIn: { type: 'boolean', defaultValue: false },
|
|
262
|
+
},
|
|
263
|
+
globalReferences: [],
|
|
264
|
+
globalStateReferences: [],
|
|
265
|
+
}
|
|
266
|
+
const result = generateJSXSyntax(wrappingParent, twoStateParams, options)
|
|
267
|
+
|
|
268
|
+
const expressionChild = result.children[0] as types.JSXExpressionContainer
|
|
269
|
+
const outerLogical = expressionChild.expression as types.LogicalExpression
|
|
270
|
+
expect(outerLogical.operator).toBe('&&')
|
|
271
|
+
|
|
272
|
+
// Left side is the chained condition pair, joined with `&&` for 'all'.
|
|
273
|
+
const conditionChain = outerLogical.left as types.LogicalExpression
|
|
274
|
+
expect(conditionChain.type).toBe('LogicalExpression')
|
|
275
|
+
expect(conditionChain.operator).toBe('&&')
|
|
276
|
+
|
|
277
|
+
// `=== true` compiles to the bare identifier, `=== false` to `!identifier`
|
|
278
|
+
// — i.e. `newsletterOfferVisible && !userIsLoggedIn`, the wild-log case.
|
|
279
|
+
const firstComparison = conditionChain.left as types.Identifier
|
|
280
|
+
const secondComparison = conditionChain.right as types.UnaryExpression
|
|
281
|
+
expect(firstComparison.name).toBe('newsletterOfferVisible')
|
|
282
|
+
expect(secondComparison.operator).toBe('!')
|
|
283
|
+
expect((secondComparison.argument as types.Identifier).name).toBe('userIsLoggedIn')
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
it('chains mixed-reference entries with `||` when matchingCriteria is not "all"', () => {
|
|
287
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
288
|
+
ownerContainer.content.renderingConditions = buildTwoReferenceConditions('||')
|
|
289
|
+
|
|
290
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
291
|
+
const twoStateParams: JSXGenerationParams = {
|
|
292
|
+
...params,
|
|
293
|
+
stateDefinitions: {
|
|
294
|
+
newsletterOfferVisible: { type: 'boolean', defaultValue: true },
|
|
295
|
+
userIsLoggedIn: { type: 'boolean', defaultValue: false },
|
|
296
|
+
},
|
|
297
|
+
globalReferences: [],
|
|
298
|
+
globalStateReferences: [],
|
|
299
|
+
}
|
|
300
|
+
const result = generateJSXSyntax(wrappingParent, twoStateParams, options)
|
|
301
|
+
|
|
302
|
+
const expressionChild = result.children[0] as types.JSXExpressionContainer
|
|
303
|
+
const outerLogical = expressionChild.expression as types.LogicalExpression
|
|
304
|
+
const conditionChain = outerLogical.left as types.LogicalExpression
|
|
305
|
+
expect(conditionChain.operator).toBe('||')
|
|
306
|
+
expect((conditionChain.left as types.Identifier).name).toBe('newsletterOfferVisible')
|
|
307
|
+
expect(
|
|
308
|
+
((conditionChain.right as types.UnaryExpression).argument as types.Identifier).name
|
|
309
|
+
).toBe('userIsLoggedIn')
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
it('mixes a prop-referencing entry into a state-anchored chain with the right prefix', () => {
|
|
313
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
314
|
+
ownerContainer.content.renderingConditions = {
|
|
315
|
+
reference: {
|
|
316
|
+
type: 'dynamic',
|
|
317
|
+
content: { referenceType: 'state', id: 'menuOpen' },
|
|
318
|
+
},
|
|
319
|
+
condition: {
|
|
320
|
+
conditions: [
|
|
321
|
+
{ operation: '===', operand: true },
|
|
322
|
+
{
|
|
323
|
+
operation: '===',
|
|
324
|
+
operand: 'admin',
|
|
325
|
+
reference: {
|
|
326
|
+
type: 'dynamic',
|
|
327
|
+
content: { referenceType: 'prop', id: 'role' },
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
matchingCriteria: 'all',
|
|
332
|
+
},
|
|
333
|
+
} as never
|
|
334
|
+
|
|
335
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
336
|
+
const mixedParams: JSXGenerationParams = {
|
|
337
|
+
...params,
|
|
338
|
+
stateDefinitions: { menuOpen: { type: 'boolean', defaultValue: false } },
|
|
339
|
+
propDefinitions: { role: { type: 'string', defaultValue: 'guest' } },
|
|
340
|
+
globalReferences: [],
|
|
341
|
+
globalStateReferences: [],
|
|
342
|
+
}
|
|
343
|
+
const result = generateJSXSyntax(wrappingParent, mixedParams, options)
|
|
344
|
+
|
|
345
|
+
const expressionChild = result.children[0] as types.JSXExpressionContainer
|
|
346
|
+
const conditionChain = (expressionChild.expression as types.LogicalExpression)
|
|
347
|
+
.left as types.LogicalExpression
|
|
348
|
+
|
|
349
|
+
// `=== true` on the boolean state compiles to the bare identifier.
|
|
350
|
+
const stateComparison = conditionChain.left as types.Identifier
|
|
351
|
+
expect(stateComparison.name).toBe('menuOpen')
|
|
352
|
+
|
|
353
|
+
// The prop entry rides the `props.` prefix from the prefix map.
|
|
354
|
+
const propComparison = conditionChain.right as types.BinaryExpression
|
|
355
|
+
const propMember = propComparison.left as types.MemberExpression
|
|
356
|
+
expect((propMember.object as types.Identifier).name).toBe('props')
|
|
357
|
+
expect((propMember.property as types.Identifier).name).toBe('role')
|
|
358
|
+
expect((propComparison.right as types.StringLiteral).value).toBe('admin')
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
it('tracks a globalState per-entry reference on params for context wiring', () => {
|
|
362
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
363
|
+
ownerContainer.content.renderingConditions = {
|
|
364
|
+
reference: {
|
|
365
|
+
type: 'dynamic',
|
|
366
|
+
content: { referenceType: 'state', id: 'menuOpen' },
|
|
367
|
+
},
|
|
368
|
+
condition: {
|
|
369
|
+
conditions: [
|
|
370
|
+
{ operation: '===', operand: true },
|
|
371
|
+
{
|
|
372
|
+
operation: '===',
|
|
373
|
+
operand: true,
|
|
374
|
+
reference: {
|
|
375
|
+
type: 'dynamic',
|
|
376
|
+
content: { referenceType: 'globalState', id: 'darkMode' },
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
matchingCriteria: 'all',
|
|
381
|
+
},
|
|
382
|
+
} as never
|
|
383
|
+
|
|
384
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
385
|
+
const globalStateParams: JSXGenerationParams = {
|
|
386
|
+
...params,
|
|
387
|
+
stateDefinitions: { menuOpen: { type: 'boolean', defaultValue: false } },
|
|
388
|
+
globalStateDefinitions: {
|
|
389
|
+
darkMode: { id: 'darkMode', name: 'darkMode', type: 'boolean', defaultValue: false },
|
|
390
|
+
},
|
|
391
|
+
globalReferences: [],
|
|
392
|
+
globalStateReferences: [],
|
|
393
|
+
}
|
|
394
|
+
generateJSXSyntax(wrappingParent, globalStateParams, options)
|
|
395
|
+
|
|
396
|
+
expect(globalStateParams.globalStateReferences).toEqual([
|
|
397
|
+
{ id: 'darkMode', name: 'darkMode' },
|
|
398
|
+
])
|
|
399
|
+
})
|
|
400
|
+
|
|
401
|
+
it('nests a group entry as a parenthesized sub-chain — (a && b) || c', () => {
|
|
402
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
403
|
+
ownerContainer.content.renderingConditions = {
|
|
404
|
+
reference: {
|
|
405
|
+
type: 'dynamic',
|
|
406
|
+
content: { referenceType: 'state', id: 'a' },
|
|
407
|
+
},
|
|
408
|
+
condition: {
|
|
409
|
+
conditions: [
|
|
410
|
+
{
|
|
411
|
+
conditions: [
|
|
412
|
+
{ operation: '===', operand: 1 },
|
|
413
|
+
{
|
|
414
|
+
operation: '===',
|
|
415
|
+
operand: 3,
|
|
416
|
+
reference: {
|
|
417
|
+
type: 'dynamic',
|
|
418
|
+
content: { referenceType: 'state', id: 'b' },
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
matchingCriteria: 'all',
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
operation: '===',
|
|
426
|
+
operand: 5,
|
|
427
|
+
reference: {
|
|
428
|
+
type: 'dynamic',
|
|
429
|
+
content: { referenceType: 'state', id: 'c' },
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
matchingCriteria: '||',
|
|
434
|
+
},
|
|
435
|
+
} as never
|
|
436
|
+
|
|
437
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
438
|
+
const groupedParams: JSXGenerationParams = {
|
|
439
|
+
...params,
|
|
440
|
+
stateDefinitions: {
|
|
441
|
+
a: { type: 'number', defaultValue: 1 },
|
|
442
|
+
b: { type: 'number', defaultValue: 3 },
|
|
443
|
+
c: { type: 'number', defaultValue: 0 },
|
|
444
|
+
},
|
|
445
|
+
globalReferences: [],
|
|
446
|
+
globalStateReferences: [],
|
|
447
|
+
}
|
|
448
|
+
const result = generateJSXSyntax(wrappingParent, groupedParams, options)
|
|
449
|
+
|
|
450
|
+
const expressionChild = result.children[0] as types.JSXExpressionContainer
|
|
451
|
+
const conditionChain = (expressionChild.expression as types.LogicalExpression)
|
|
452
|
+
.left as types.LogicalExpression
|
|
453
|
+
|
|
454
|
+
// (a === 1 && b === 3) || c === 5 — the group nests as the left branch,
|
|
455
|
+
// which the printer emits parenthesized.
|
|
456
|
+
expect(conditionChain.operator).toBe('||')
|
|
457
|
+
|
|
458
|
+
const groupChain = conditionChain.left as types.LogicalExpression
|
|
459
|
+
expect(groupChain.type).toBe('LogicalExpression')
|
|
460
|
+
expect(groupChain.operator).toBe('&&')
|
|
461
|
+
const aComparison = groupChain.left as types.BinaryExpression
|
|
462
|
+
const bComparison = groupChain.right as types.BinaryExpression
|
|
463
|
+
expect((aComparison.left as types.Identifier).name).toBe('a')
|
|
464
|
+
expect((aComparison.right as types.NumericLiteral).value).toBe(1)
|
|
465
|
+
expect((bComparison.left as types.Identifier).name).toBe('b')
|
|
466
|
+
expect((bComparison.right as types.NumericLiteral).value).toBe(3)
|
|
467
|
+
|
|
468
|
+
const cComparison = conditionChain.right as types.BinaryExpression
|
|
469
|
+
expect((cComparison.left as types.Identifier).name).toBe('c')
|
|
470
|
+
expect((cComparison.right as types.NumericLiteral).value).toBe(5)
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
it('tracks references from leaves nested inside groups', () => {
|
|
474
|
+
const ownerContainer = elementNode('container', {}, [])
|
|
475
|
+
ownerContainer.content.renderingConditions = {
|
|
476
|
+
reference: {
|
|
477
|
+
type: 'dynamic',
|
|
478
|
+
content: { referenceType: 'state', id: 'menuOpen' },
|
|
479
|
+
},
|
|
480
|
+
condition: {
|
|
481
|
+
conditions: [
|
|
482
|
+
{ operation: '===', operand: true },
|
|
483
|
+
{
|
|
484
|
+
conditions: [
|
|
485
|
+
{
|
|
486
|
+
operation: '===',
|
|
487
|
+
operand: true,
|
|
488
|
+
reference: {
|
|
489
|
+
type: 'dynamic',
|
|
490
|
+
content: { referenceType: 'globalState', id: 'darkMode' },
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
],
|
|
494
|
+
},
|
|
495
|
+
],
|
|
496
|
+
matchingCriteria: 'all',
|
|
497
|
+
},
|
|
498
|
+
} as never
|
|
499
|
+
|
|
500
|
+
const wrappingParent = elementNode('container', {}, [ownerContainer])
|
|
501
|
+
const nestedTrackingParams: JSXGenerationParams = {
|
|
502
|
+
...params,
|
|
503
|
+
stateDefinitions: { menuOpen: { type: 'boolean', defaultValue: false } },
|
|
504
|
+
globalStateDefinitions: {
|
|
505
|
+
darkMode: { id: 'darkMode', name: 'darkMode', type: 'boolean', defaultValue: false },
|
|
506
|
+
},
|
|
507
|
+
globalReferences: [],
|
|
508
|
+
globalStateReferences: [],
|
|
509
|
+
}
|
|
510
|
+
generateJSXSyntax(wrappingParent, nestedTrackingParams, options)
|
|
511
|
+
|
|
512
|
+
expect(nestedTrackingParams.globalStateReferences).toEqual([
|
|
513
|
+
{ id: 'darkMode', name: 'darkMode' },
|
|
514
|
+
])
|
|
515
|
+
})
|
|
229
516
|
})
|
|
230
517
|
|
|
231
518
|
describe('navlink href via differentiatorValue', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-html/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-html/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,EAGzB,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EAIhB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAI1E,eAAO,MAAM,eAAe,aAChB,QAAQ,eACL,MAAM,WACV,MAAM,aACJ,kBAAkB,UACrB,4BAA4B,kBACpB,kBAAkB,QAC5B,eAAe,SAmFtB,CAAA;AAED,eAAO,MAAM,WAAW,aACZ,QAAQ,eACL,MAAM,YACT,MAAM,0BACQ,yBAAyB,EAAE,UAC3C,4BAA4B,kBACpB,kBAAkB,SAiCnC,CAAA;AAED,eAAO,MAAM,0BAA0B,SAAU,mBAAmB,KAAG,MAkBtE,CAAA;AAKD,eAAO,MAAM,gCAAgC,cAChC,mBAAmB,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,aAC3C,yBAAyB,KACnC,MAKF,CAAA"}
|
|
@@ -155,15 +155,36 @@ var standardizeUIDLConditionalExpression = function (value, condition) {
|
|
|
155
155
|
: condition;
|
|
156
156
|
return conditionalExpression;
|
|
157
157
|
};
|
|
158
|
+
// An entry carrying its own `reference` compares that reference instead of the
|
|
159
|
+
// expression's inherited key. Dynamic refs contribute their id; expr refs
|
|
160
|
+
// contribute their raw expression, parenthesized (this flavor works in string
|
|
161
|
+
// space, so the expression text slots in as the left side directly).
|
|
162
|
+
var resolveConditionEntryKey = function (entry, inheritedKey) {
|
|
163
|
+
if (!entry.reference) {
|
|
164
|
+
return inheritedKey;
|
|
165
|
+
}
|
|
166
|
+
if (entry.reference.type === 'dynamic') {
|
|
167
|
+
return entry.reference.content.id;
|
|
168
|
+
}
|
|
169
|
+
return "(".concat(entry.reference.content, ")");
|
|
170
|
+
};
|
|
171
|
+
// A group entry recurses with its own matchingCriteria and comes back already
|
|
172
|
+
// parenthesized; a leaf stringifies its single comparison unwrapped.
|
|
173
|
+
var stringifyConditionEntry = function (entry, inheritedKey) {
|
|
174
|
+
if (teleport_shared_1.UIDLUtils.isUIDLConditionGroup(entry)) {
|
|
175
|
+
return "(".concat(createConditional(inheritedKey, entry), ")");
|
|
176
|
+
}
|
|
177
|
+
return stringifyConditionalExpression(resolveConditionEntryKey(entry, inheritedKey), entry.operation, entry.operand, entry.containsField);
|
|
178
|
+
};
|
|
158
179
|
var createConditional = function (conditionalKey, conditionalExpression) {
|
|
159
180
|
var matchingCriteria = conditionalExpression.matchingCriteria, conditions = conditionalExpression.conditions;
|
|
160
181
|
if (conditions.length === 1) {
|
|
161
|
-
|
|
162
|
-
return stringifyConditionalExpression(conditionalKey, operation, operand, containsField);
|
|
182
|
+
return stringifyConditionEntry(conditions[0], conditionalKey);
|
|
163
183
|
}
|
|
164
|
-
var stringConditions = conditions.map(function (
|
|
165
|
-
var
|
|
166
|
-
|
|
184
|
+
var stringConditions = conditions.map(function (conditionEntry) {
|
|
185
|
+
var entryText = stringifyConditionEntry(conditionEntry, conditionalKey);
|
|
186
|
+
// Groups arrive parenthesized already; leaves get wrapped here.
|
|
187
|
+
return teleport_shared_1.UIDLUtils.isUIDLConditionGroup(conditionEntry) ? entryText : "(".concat(entryText, ")");
|
|
167
188
|
});
|
|
168
189
|
var joinOperator = matchingCriteria === 'all' ? '&&' : '||';
|
|
169
190
|
return stringConditions.join(" ".concat(joinOperator, " "));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-html/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAmD;AACnD,+DAAoE;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-html/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAmD;AACnD,+DAAoE;AAepE,8DAA6D;AAC7D,iEAAiD;AAE1C,IAAM,eAAe,GAAG,UAC7B,QAAkB,EAClB,WAAmB,EACnB,OAAe,EACf,SAA6B,EAC7B,MAAoC,EACpC,cAAkC,EAClC,IAAqB;IAEb,IAAA,UAAU,GAAK,MAAM,WAAX,CAAW;IAC7B,IAAM,cAAc,GAAG,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACjE,QAAQ,SAAS,CAAC,IAAI,EAAE;QACtB,KAAK,SAA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AQ,CAAC,OAAO,CAAA;IAC7B,IAAA,KAAkB,UAAU,CAAC,OAAO,EAAlC,EAAE,QAAA,EAAE,OAAO,aAAuB,CAAA;IAC1C,IAAM,UAAU,GAAG,2BAAS,CAAC,qBAAqB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC/D,IAAM,eAAe,GAAG,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAA;IAC7D,IAAM,eAAe,GAAG,sBAAe,6BAAW,CAAC,oBAAoB,EAAE,CAAE,CAAA;IAC3E,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IACpD,IAAM,UAAU,GAAG,UAAG,UAAU,iBAAO,eAAe,CAAE,CAAA;IAExD,IAAM,YAAY,GAAG,cAAc,CAAC,gBAAgB,IAAI,WAAW,CAAA;IACnE,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAA;IACzB,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;IAEhE,IAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAA;IAC5C,IAAI,MAAA,MAAA,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,0CAAE,IAAI,0CAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QACtE,OAAO,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;KACxC;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,eAAe,EAiBhB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node-handlers/node-to-jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,eAAe,EAiBhB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAKL,SAAS,EACV,MAAM,SAAS,CAAA;AA2oBhB,QAAA,MAAM,mBAAmB,EAAE,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,UAAU,CAwSrE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1248,11 +1248,10 @@ var generateRepeatNode = function (node, params, options) {
|
|
|
1248
1248
|
]));
|
|
1249
1249
|
});
|
|
1250
1250
|
};
|
|
1251
|
-
//
|
|
1252
|
-
//
|
|
1253
|
-
//
|
|
1254
|
-
|
|
1255
|
-
var wrapWithConditional = function (subTree, reference, condition, params, options) {
|
|
1251
|
+
// Tracks a condition reference's global / globalState usage on params and
|
|
1252
|
+
// resolves it to a ConditionalIdentifier. Shared by the top-level reference
|
|
1253
|
+
// and the optional per-entry references of a conditional expression.
|
|
1254
|
+
var trackAndResolveConditionIdentifier = function (reference, params, options) {
|
|
1256
1255
|
if (reference.type === 'dynamic' &&
|
|
1257
1256
|
'referenceType' in reference.content &&
|
|
1258
1257
|
reference.content.referenceType === 'global') {
|
|
@@ -1270,10 +1269,25 @@ var wrapWithConditional = function (subTree, reference, condition, params, optio
|
|
|
1270
1269
|
reference.content.referenceType === 'global'
|
|
1271
1270
|
? normalizeGlobalRef(reference)
|
|
1272
1271
|
: reference;
|
|
1273
|
-
|
|
1272
|
+
return (0, utils_1.createConditionIdentifier)(effectiveRef, params, options);
|
|
1273
|
+
};
|
|
1274
|
+
// Shared between UIDLConditionalNode (wraps a child subtree) and the inline
|
|
1275
|
+
// `renderingConditions` property on UIDLElement content. Tracks global and
|
|
1276
|
+
// globalState references on params, resolves the condition identifier — plus
|
|
1277
|
+
// one identifier per entry that carries its own `reference` — and builds the
|
|
1278
|
+
// `condition && <content/>` logical expression.
|
|
1279
|
+
var wrapWithConditional = function (subTree, reference, condition, params, options) {
|
|
1280
|
+
var conditionIdentifier = trackAndResolveConditionIdentifier(reference, params, options);
|
|
1274
1281
|
return (0, utils_1.createConditionalJSXExpression)(subTree, condition, conditionIdentifier, {
|
|
1275
1282
|
localIdentifier: options.localIdentifier,
|
|
1276
1283
|
detailsPageExposeAsName: options.detailsPageExposeAsName || params.detailsPageExposeAsName,
|
|
1284
|
+
// Leaf entries (any nesting depth) with their own left side resolve —
|
|
1285
|
+
// and globals-track — through the same path as the top-level reference.
|
|
1286
|
+
resolveEntryIdentifier: function (conditionEntry) {
|
|
1287
|
+
return conditionEntry.reference
|
|
1288
|
+
? trackAndResolveConditionIdentifier(conditionEntry.reference, params, options)
|
|
1289
|
+
: undefined;
|
|
1290
|
+
},
|
|
1277
1291
|
});
|
|
1278
1292
|
};
|
|
1279
1293
|
var generateConditionalNode = function (node, params, options) {
|