@typespec/html-program-viewer 0.72.0-dev.1 → 0.72.0-dev.2
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/emitter/index.js +93 -49
- package/dist/{manifest-DvYpHITg.js → manifest-CVLhuDVf.js} +1 -1
- package/dist/react/index.js +95 -51
- package/dist/react/inspect-type/inspect-type.d.ts.map +1 -1
- package/dist/react/type-config.d.ts +27 -11
- package/dist/react/type-config.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/emitter/index.js
CHANGED
|
@@ -5427,39 +5427,62 @@ const JsValue = ({ value }) => {
|
|
|
5427
5427
|
}
|
|
5428
5428
|
};
|
|
5429
5429
|
|
|
5430
|
-
const
|
|
5430
|
+
const CommonPropsConfig = {
|
|
5431
|
+
namespace: "parent",
|
|
5432
|
+
name: "value"
|
|
5433
|
+
};
|
|
5434
|
+
const HiddenProps = [
|
|
5435
|
+
"entityKind",
|
|
5436
|
+
"kind",
|
|
5437
|
+
"node",
|
|
5438
|
+
"symbol",
|
|
5439
|
+
"templateNode",
|
|
5440
|
+
"templateArguments",
|
|
5441
|
+
"templateMapper",
|
|
5442
|
+
"instantiationParameters",
|
|
5443
|
+
"decorators",
|
|
5444
|
+
"isFinished"
|
|
5445
|
+
];
|
|
5446
|
+
const HiddenPropsConfig = Object.fromEntries(HiddenProps.map((prop) => [prop, "skip"]));
|
|
5447
|
+
const TypeConfig = buildConfig({
|
|
5431
5448
|
Namespace: {
|
|
5432
5449
|
namespaces: "skip",
|
|
5433
|
-
models: "nested",
|
|
5434
|
-
scalars: "nested",
|
|
5435
|
-
interfaces: "nested",
|
|
5436
|
-
operations: "nested",
|
|
5437
|
-
unions: "nested",
|
|
5438
|
-
enums: "nested",
|
|
5439
|
-
decoratorDeclarations: "nested"
|
|
5450
|
+
models: "nested-items",
|
|
5451
|
+
scalars: "nested-items",
|
|
5452
|
+
interfaces: "nested-items",
|
|
5453
|
+
operations: "nested-items",
|
|
5454
|
+
unions: "nested-items",
|
|
5455
|
+
enums: "nested-items",
|
|
5456
|
+
decoratorDeclarations: "nested-items"
|
|
5440
5457
|
},
|
|
5441
5458
|
Interface: {
|
|
5442
|
-
operations: "nested",
|
|
5459
|
+
operations: "nested-items",
|
|
5443
5460
|
sourceInterfaces: "ref"
|
|
5444
5461
|
},
|
|
5445
5462
|
Operation: {
|
|
5446
5463
|
interface: "parent",
|
|
5447
|
-
parameters: "nested",
|
|
5464
|
+
parameters: "nested-items",
|
|
5448
5465
|
returnType: "ref",
|
|
5449
5466
|
sourceOperation: "ref"
|
|
5450
5467
|
},
|
|
5451
5468
|
Model: {
|
|
5452
|
-
indexer:
|
|
5469
|
+
indexer: {
|
|
5470
|
+
kind: "nested",
|
|
5471
|
+
properties: {
|
|
5472
|
+
key: "ref",
|
|
5473
|
+
value: "ref"
|
|
5474
|
+
}
|
|
5475
|
+
},
|
|
5453
5476
|
baseModel: "ref",
|
|
5454
5477
|
derivedModels: "ref",
|
|
5455
|
-
properties: "nested",
|
|
5478
|
+
properties: "nested-items",
|
|
5456
5479
|
sourceModel: "ref",
|
|
5457
5480
|
sourceModels: "value"
|
|
5458
5481
|
},
|
|
5459
5482
|
Scalar: {
|
|
5460
5483
|
baseScalar: "ref",
|
|
5461
5484
|
derivedScalars: "ref",
|
|
5462
|
-
constructors: "nested"
|
|
5485
|
+
constructors: "nested-items"
|
|
5463
5486
|
},
|
|
5464
5487
|
ModelProperty: {
|
|
5465
5488
|
model: "parent",
|
|
@@ -5469,7 +5492,7 @@ const TypeConfig = {
|
|
|
5469
5492
|
defaultValue: "value"
|
|
5470
5493
|
},
|
|
5471
5494
|
Enum: {
|
|
5472
|
-
members: "nested"
|
|
5495
|
+
members: "nested-items"
|
|
5473
5496
|
},
|
|
5474
5497
|
EnumMember: {
|
|
5475
5498
|
enum: "parent",
|
|
@@ -5477,8 +5500,8 @@ const TypeConfig = {
|
|
|
5477
5500
|
value: "value"
|
|
5478
5501
|
},
|
|
5479
5502
|
Union: {
|
|
5480
|
-
expression: "
|
|
5481
|
-
variants: "nested"
|
|
5503
|
+
expression: "value",
|
|
5504
|
+
variants: "nested-items"
|
|
5482
5505
|
},
|
|
5483
5506
|
UnionVariant: {
|
|
5484
5507
|
union: "parent",
|
|
@@ -5488,13 +5511,13 @@ const TypeConfig = {
|
|
|
5488
5511
|
value: "value"
|
|
5489
5512
|
},
|
|
5490
5513
|
Decorator: {
|
|
5491
|
-
parameters: "nested",
|
|
5514
|
+
parameters: "nested-items",
|
|
5492
5515
|
implementation: "skip",
|
|
5493
5516
|
target: "ref"
|
|
5494
5517
|
},
|
|
5495
5518
|
ScalarConstructor: {
|
|
5496
5519
|
scalar: "parent",
|
|
5497
|
-
parameters: "nested"
|
|
5520
|
+
parameters: "nested-items"
|
|
5498
5521
|
},
|
|
5499
5522
|
FunctionParameter: null,
|
|
5500
5523
|
Number: {
|
|
@@ -5506,10 +5529,10 @@ const TypeConfig = {
|
|
|
5506
5529
|
value: "value"
|
|
5507
5530
|
},
|
|
5508
5531
|
Tuple: {
|
|
5509
|
-
values: "nested"
|
|
5532
|
+
values: "nested-items"
|
|
5510
5533
|
},
|
|
5511
5534
|
StringTemplate: {
|
|
5512
|
-
spans: "nested",
|
|
5535
|
+
spans: "nested-items",
|
|
5513
5536
|
stringValue: "value"
|
|
5514
5537
|
},
|
|
5515
5538
|
StringTemplateSpan: {
|
|
@@ -5522,29 +5545,38 @@ const TypeConfig = {
|
|
|
5522
5545
|
},
|
|
5523
5546
|
// Don't want to expose those for now
|
|
5524
5547
|
Intrinsic: null
|
|
5525
|
-
};
|
|
5526
|
-
const CommonPropsConfig = {
|
|
5527
|
-
namespace: "parent"
|
|
5528
|
-
};
|
|
5529
|
-
const HiddenProps = [
|
|
5530
|
-
"entityKind",
|
|
5531
|
-
"kind",
|
|
5532
|
-
"name",
|
|
5533
|
-
"node",
|
|
5534
|
-
"symbol",
|
|
5535
|
-
"templateNode",
|
|
5536
|
-
"templateArguments",
|
|
5537
|
-
"templateMapper",
|
|
5538
|
-
"instantiationParameters",
|
|
5539
|
-
"decorators",
|
|
5540
|
-
"projector",
|
|
5541
|
-
"isFinished"
|
|
5542
|
-
];
|
|
5548
|
+
});
|
|
5543
5549
|
new Set(HiddenProps);
|
|
5544
|
-
function
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5550
|
+
function getRenderingConfig(type) {
|
|
5551
|
+
return TypeConfig[type.kind];
|
|
5552
|
+
}
|
|
5553
|
+
function buildConfig(raw) {
|
|
5554
|
+
return Object.fromEntries(
|
|
5555
|
+
Object.entries(raw).map(([kind, config]) => {
|
|
5556
|
+
return [kind, buildConfigForKind(config)];
|
|
5557
|
+
})
|
|
5558
|
+
);
|
|
5559
|
+
}
|
|
5560
|
+
function buildConfigForKind(config) {
|
|
5561
|
+
if (config === null) {
|
|
5562
|
+
return null;
|
|
5563
|
+
}
|
|
5564
|
+
return Object.fromEntries(
|
|
5565
|
+
Object.entries({ ...CommonPropsConfig, ...HiddenPropsConfig, ...config }).map(
|
|
5566
|
+
([key, value]) => {
|
|
5567
|
+
return [key, buildConfigForProperty(value)];
|
|
5568
|
+
}
|
|
5569
|
+
)
|
|
5570
|
+
);
|
|
5571
|
+
}
|
|
5572
|
+
function buildConfigForProperty(value) {
|
|
5573
|
+
if (typeof value === "string") {
|
|
5574
|
+
return { kind: value };
|
|
5575
|
+
}
|
|
5576
|
+
return {
|
|
5577
|
+
kind: "nested",
|
|
5578
|
+
properties: buildConfigForKind(value.properties)
|
|
5579
|
+
};
|
|
5548
5580
|
}
|
|
5549
5581
|
|
|
5550
5582
|
const TreeNavigatorContext = createContext(void 0);
|
|
@@ -5669,13 +5701,22 @@ const SimpleType = ({ type, children }) => {
|
|
|
5669
5701
|
children
|
|
5670
5702
|
] });
|
|
5671
5703
|
};
|
|
5672
|
-
const EntityProperties = ({ entity
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5704
|
+
const EntityProperties = ({ entity }) => {
|
|
5705
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(InspectObject, { value: entity, config: getRenderingConfig(entity) });
|
|
5706
|
+
};
|
|
5707
|
+
const InspectObject = ({
|
|
5708
|
+
value,
|
|
5709
|
+
config
|
|
5710
|
+
}) => {
|
|
5711
|
+
if (value === void 0) {
|
|
5712
|
+
return null;
|
|
5713
|
+
}
|
|
5714
|
+
const props = Object.entries(value).map(([key, value2]) => {
|
|
5715
|
+
const action = config?.[key];
|
|
5716
|
+
if (action === void 0 || action === null || action.kind === "skip") {
|
|
5676
5717
|
return void 0;
|
|
5677
5718
|
}
|
|
5678
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EntityProperty, { name: key, value, action }, key);
|
|
5719
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(EntityProperty, { name: key, value: value2, action }, key);
|
|
5679
5720
|
}).filter((x) => Boolean(x));
|
|
5680
5721
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: props });
|
|
5681
5722
|
};
|
|
@@ -5689,12 +5730,15 @@ const EntityProperty = (props) => {
|
|
|
5689
5730
|
};
|
|
5690
5731
|
const EntityPropertyValue = ({ value, action }) => {
|
|
5691
5732
|
const render = (x) => {
|
|
5692
|
-
if (action === "parent") {
|
|
5733
|
+
if (action.kind === "parent") {
|
|
5693
5734
|
return x.entityKind === "Type" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ParentReference, { type: x }) : null;
|
|
5694
5735
|
}
|
|
5695
|
-
const renderRef = action === "ref";
|
|
5736
|
+
const renderRef = action.kind === "ref";
|
|
5696
5737
|
return renderRef ? /* @__PURE__ */ jsxRuntimeExports.jsx(EntityReference, { entity: x }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EntityUI, { entity: x });
|
|
5697
5738
|
};
|
|
5739
|
+
if (action.kind === "nested") {
|
|
5740
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(InspectObject, { value, config: action.properties });
|
|
5741
|
+
}
|
|
5698
5742
|
if (value === void 0) {
|
|
5699
5743
|
return null;
|
|
5700
5744
|
} else if (value.entityKind) {
|
package/dist/react/index.js
CHANGED
|
@@ -34325,7 +34325,7 @@ let manifest;
|
|
|
34325
34325
|
try {
|
|
34326
34326
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34327
34327
|
// @ts-ignore
|
|
34328
|
-
manifest = (await import('../manifest-
|
|
34328
|
+
manifest = (await import('../manifest-CVLhuDVf.js')).default;
|
|
34329
34329
|
}
|
|
34330
34330
|
catch {
|
|
34331
34331
|
const name = "../dist/manifest.js";
|
|
@@ -45459,39 +45459,62 @@ function isMapLike(value) {
|
|
|
45459
45459
|
return "entries" in value && typeof value.entries === "function";
|
|
45460
45460
|
}
|
|
45461
45461
|
|
|
45462
|
-
const
|
|
45462
|
+
const CommonPropsConfig = {
|
|
45463
|
+
namespace: "parent",
|
|
45464
|
+
name: "value"
|
|
45465
|
+
};
|
|
45466
|
+
const HiddenProps = [
|
|
45467
|
+
"entityKind",
|
|
45468
|
+
"kind",
|
|
45469
|
+
"node",
|
|
45470
|
+
"symbol",
|
|
45471
|
+
"templateNode",
|
|
45472
|
+
"templateArguments",
|
|
45473
|
+
"templateMapper",
|
|
45474
|
+
"instantiationParameters",
|
|
45475
|
+
"decorators",
|
|
45476
|
+
"isFinished"
|
|
45477
|
+
];
|
|
45478
|
+
const HiddenPropsConfig = Object.fromEntries(HiddenProps.map((prop) => [prop, "skip"]));
|
|
45479
|
+
const TypeConfig = buildConfig({
|
|
45463
45480
|
Namespace: {
|
|
45464
45481
|
namespaces: "skip",
|
|
45465
|
-
models: "nested",
|
|
45466
|
-
scalars: "nested",
|
|
45467
|
-
interfaces: "nested",
|
|
45468
|
-
operations: "nested",
|
|
45469
|
-
unions: "nested",
|
|
45470
|
-
enums: "nested",
|
|
45471
|
-
decoratorDeclarations: "nested"
|
|
45482
|
+
models: "nested-items",
|
|
45483
|
+
scalars: "nested-items",
|
|
45484
|
+
interfaces: "nested-items",
|
|
45485
|
+
operations: "nested-items",
|
|
45486
|
+
unions: "nested-items",
|
|
45487
|
+
enums: "nested-items",
|
|
45488
|
+
decoratorDeclarations: "nested-items"
|
|
45472
45489
|
},
|
|
45473
45490
|
Interface: {
|
|
45474
|
-
operations: "nested",
|
|
45491
|
+
operations: "nested-items",
|
|
45475
45492
|
sourceInterfaces: "ref"
|
|
45476
45493
|
},
|
|
45477
45494
|
Operation: {
|
|
45478
45495
|
interface: "parent",
|
|
45479
|
-
parameters: "nested",
|
|
45496
|
+
parameters: "nested-items",
|
|
45480
45497
|
returnType: "ref",
|
|
45481
45498
|
sourceOperation: "ref"
|
|
45482
45499
|
},
|
|
45483
45500
|
Model: {
|
|
45484
|
-
indexer:
|
|
45501
|
+
indexer: {
|
|
45502
|
+
kind: "nested",
|
|
45503
|
+
properties: {
|
|
45504
|
+
key: "ref",
|
|
45505
|
+
value: "ref"
|
|
45506
|
+
}
|
|
45507
|
+
},
|
|
45485
45508
|
baseModel: "ref",
|
|
45486
45509
|
derivedModels: "ref",
|
|
45487
|
-
properties: "nested",
|
|
45510
|
+
properties: "nested-items",
|
|
45488
45511
|
sourceModel: "ref",
|
|
45489
45512
|
sourceModels: "value"
|
|
45490
45513
|
},
|
|
45491
45514
|
Scalar: {
|
|
45492
45515
|
baseScalar: "ref",
|
|
45493
45516
|
derivedScalars: "ref",
|
|
45494
|
-
constructors: "nested"
|
|
45517
|
+
constructors: "nested-items"
|
|
45495
45518
|
},
|
|
45496
45519
|
ModelProperty: {
|
|
45497
45520
|
model: "parent",
|
|
@@ -45501,7 +45524,7 @@ const TypeConfig = {
|
|
|
45501
45524
|
defaultValue: "value"
|
|
45502
45525
|
},
|
|
45503
45526
|
Enum: {
|
|
45504
|
-
members: "nested"
|
|
45527
|
+
members: "nested-items"
|
|
45505
45528
|
},
|
|
45506
45529
|
EnumMember: {
|
|
45507
45530
|
enum: "parent",
|
|
@@ -45509,8 +45532,8 @@ const TypeConfig = {
|
|
|
45509
45532
|
value: "value"
|
|
45510
45533
|
},
|
|
45511
45534
|
Union: {
|
|
45512
|
-
expression: "
|
|
45513
|
-
variants: "nested"
|
|
45535
|
+
expression: "value",
|
|
45536
|
+
variants: "nested-items"
|
|
45514
45537
|
},
|
|
45515
45538
|
UnionVariant: {
|
|
45516
45539
|
union: "parent",
|
|
@@ -45520,13 +45543,13 @@ const TypeConfig = {
|
|
|
45520
45543
|
value: "value"
|
|
45521
45544
|
},
|
|
45522
45545
|
Decorator: {
|
|
45523
|
-
parameters: "nested",
|
|
45546
|
+
parameters: "nested-items",
|
|
45524
45547
|
implementation: "skip",
|
|
45525
45548
|
target: "ref"
|
|
45526
45549
|
},
|
|
45527
45550
|
ScalarConstructor: {
|
|
45528
45551
|
scalar: "parent",
|
|
45529
|
-
parameters: "nested"
|
|
45552
|
+
parameters: "nested-items"
|
|
45530
45553
|
},
|
|
45531
45554
|
FunctionParameter: null,
|
|
45532
45555
|
Number: {
|
|
@@ -45538,10 +45561,10 @@ const TypeConfig = {
|
|
|
45538
45561
|
value: "value"
|
|
45539
45562
|
},
|
|
45540
45563
|
Tuple: {
|
|
45541
|
-
values: "nested"
|
|
45564
|
+
values: "nested-items"
|
|
45542
45565
|
},
|
|
45543
45566
|
StringTemplate: {
|
|
45544
|
-
spans: "nested",
|
|
45567
|
+
spans: "nested-items",
|
|
45545
45568
|
stringValue: "value"
|
|
45546
45569
|
},
|
|
45547
45570
|
StringTemplateSpan: {
|
|
@@ -45554,29 +45577,38 @@ const TypeConfig = {
|
|
|
45554
45577
|
},
|
|
45555
45578
|
// Don't want to expose those for now
|
|
45556
45579
|
Intrinsic: null
|
|
45557
|
-
};
|
|
45558
|
-
const CommonPropsConfig = {
|
|
45559
|
-
namespace: "parent"
|
|
45560
|
-
};
|
|
45561
|
-
const HiddenProps = [
|
|
45562
|
-
"entityKind",
|
|
45563
|
-
"kind",
|
|
45564
|
-
"name",
|
|
45565
|
-
"node",
|
|
45566
|
-
"symbol",
|
|
45567
|
-
"templateNode",
|
|
45568
|
-
"templateArguments",
|
|
45569
|
-
"templateMapper",
|
|
45570
|
-
"instantiationParameters",
|
|
45571
|
-
"decorators",
|
|
45572
|
-
"projector",
|
|
45573
|
-
"isFinished"
|
|
45574
|
-
];
|
|
45580
|
+
});
|
|
45575
45581
|
new Set(HiddenProps);
|
|
45576
|
-
function
|
|
45577
|
-
|
|
45578
|
-
|
|
45579
|
-
|
|
45582
|
+
function getRenderingConfig(type) {
|
|
45583
|
+
return TypeConfig[type.kind];
|
|
45584
|
+
}
|
|
45585
|
+
function buildConfig(raw) {
|
|
45586
|
+
return Object.fromEntries(
|
|
45587
|
+
Object.entries(raw).map(([kind, config]) => {
|
|
45588
|
+
return [kind, buildConfigForKind(config)];
|
|
45589
|
+
})
|
|
45590
|
+
);
|
|
45591
|
+
}
|
|
45592
|
+
function buildConfigForKind(config) {
|
|
45593
|
+
if (config === null) {
|
|
45594
|
+
return null;
|
|
45595
|
+
}
|
|
45596
|
+
return Object.fromEntries(
|
|
45597
|
+
Object.entries({ ...CommonPropsConfig, ...HiddenPropsConfig, ...config }).map(
|
|
45598
|
+
([key, value]) => {
|
|
45599
|
+
return [key, buildConfigForProperty(value)];
|
|
45600
|
+
}
|
|
45601
|
+
)
|
|
45602
|
+
);
|
|
45603
|
+
}
|
|
45604
|
+
function buildConfigForProperty(value) {
|
|
45605
|
+
if (typeof value === "string") {
|
|
45606
|
+
return { kind: value };
|
|
45607
|
+
}
|
|
45608
|
+
return {
|
|
45609
|
+
kind: "nested",
|
|
45610
|
+
properties: buildConfigForKind(value.properties)
|
|
45611
|
+
};
|
|
45580
45612
|
}
|
|
45581
45613
|
|
|
45582
45614
|
function expandNamespaces(namespace) {
|
|
@@ -45646,7 +45678,7 @@ function computeTypeNode(parentPath, type, name) {
|
|
|
45646
45678
|
}
|
|
45647
45679
|
function computeTypeNodeProps(path, type, name) {
|
|
45648
45680
|
const typeRendering = TypeConfig[type.kind];
|
|
45649
|
-
const children = Object.entries(type).filter(([key]) => typeRendering?.[key] === "nested").map(([key, value]) => {
|
|
45681
|
+
const children = Object.entries(type).filter(([key]) => typeRendering?.[key]?.kind === "nested-items").map(([key, value]) => {
|
|
45650
45682
|
const propPath = path + "." + key;
|
|
45651
45683
|
if (isMapLike(value)) {
|
|
45652
45684
|
return computeItemList(propPath, key, value);
|
|
@@ -46066,13 +46098,22 @@ const SimpleType = ({ type, children }) => {
|
|
|
46066
46098
|
children
|
|
46067
46099
|
] });
|
|
46068
46100
|
};
|
|
46069
|
-
const EntityProperties = ({ entity
|
|
46070
|
-
|
|
46071
|
-
|
|
46072
|
-
|
|
46101
|
+
const EntityProperties = ({ entity }) => {
|
|
46102
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(InspectObject, { value: entity, config: getRenderingConfig(entity) });
|
|
46103
|
+
};
|
|
46104
|
+
const InspectObject = ({
|
|
46105
|
+
value,
|
|
46106
|
+
config
|
|
46107
|
+
}) => {
|
|
46108
|
+
if (value === void 0) {
|
|
46109
|
+
return null;
|
|
46110
|
+
}
|
|
46111
|
+
const props = Object.entries(value).map(([key, value2]) => {
|
|
46112
|
+
const action = config?.[key];
|
|
46113
|
+
if (action === void 0 || action === null || action.kind === "skip") {
|
|
46073
46114
|
return void 0;
|
|
46074
46115
|
}
|
|
46075
|
-
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(EntityProperty, { name: key, value, action }, key);
|
|
46116
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(EntityProperty, { name: key, value: value2, action }, key);
|
|
46076
46117
|
}).filter((x) => Boolean(x));
|
|
46077
46118
|
return /* @__PURE__ */ jsxRuntimeExports$1.jsx("ul", { children: props });
|
|
46078
46119
|
};
|
|
@@ -46086,12 +46127,15 @@ const EntityProperty = (props) => {
|
|
|
46086
46127
|
};
|
|
46087
46128
|
const EntityPropertyValue = ({ value, action }) => {
|
|
46088
46129
|
const render = (x) => {
|
|
46089
|
-
if (action === "parent") {
|
|
46130
|
+
if (action.kind === "parent") {
|
|
46090
46131
|
return x.entityKind === "Type" ? /* @__PURE__ */ jsxRuntimeExports$1.jsx(ParentReference, { type: x }) : null;
|
|
46091
46132
|
}
|
|
46092
|
-
const renderRef = action === "ref";
|
|
46133
|
+
const renderRef = action.kind === "ref";
|
|
46093
46134
|
return renderRef ? /* @__PURE__ */ jsxRuntimeExports$1.jsx(EntityReference, { entity: x }) : /* @__PURE__ */ jsxRuntimeExports$1.jsx(EntityUI, { entity: x });
|
|
46094
46135
|
};
|
|
46136
|
+
if (action.kind === "nested") {
|
|
46137
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(InspectObject, { value, config: action.properties });
|
|
46138
|
+
}
|
|
46095
46139
|
if (value === void 0) {
|
|
46096
46140
|
return null;
|
|
46097
46141
|
} else if (value.entityKind) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect-type.d.ts","sourceRoot":"","sources":["../../../src/react/inspect-type/inspect-type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAe,KAAK,iBAAiB,EAAqC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"inspect-type.d.ts","sourceRoot":"","sources":["../../../src/react/inspect-type/inspect-type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAe,KAAK,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAc/F,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAM3D,CAAC;AAuEF,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAmD3D,CAAC"}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
import { Type } from '@typespec/compiler';
|
|
2
|
-
export type
|
|
1
|
+
import { Entity, Type } from '@typespec/compiler';
|
|
2
|
+
export type PropertyRendering<T> = {
|
|
3
|
+
kind: "parent" | "nested-items" | "ref" | "value" | "skip";
|
|
4
|
+
} | NestedPropertyRendering<T>;
|
|
5
|
+
export type PropertyRenderingRaw<T> = "parent" | "nested-items" | "ref" | "value" | "skip" | NestedPropertyRenderingRaw<T>;
|
|
6
|
+
export type PropertiesRenderingRaw<T> = {
|
|
7
|
+
[K in keyof T]: PropertyRenderingRaw<T[K]>;
|
|
8
|
+
};
|
|
9
|
+
export type PropertiesRendering<T> = {
|
|
10
|
+
[K in keyof T]: PropertyRendering<T[K]>;
|
|
11
|
+
};
|
|
12
|
+
export type NestedPropertyRendering<T> = {
|
|
13
|
+
kind: "nested";
|
|
14
|
+
properties: PropertiesRendering<T>;
|
|
15
|
+
};
|
|
16
|
+
export type NestedPropertyRenderingRaw<T> = {
|
|
17
|
+
kind: "nested";
|
|
18
|
+
properties: PropertiesRenderingRaw<T>;
|
|
19
|
+
};
|
|
20
|
+
export declare const CommonPropsConfig: {
|
|
21
|
+
namespace: string;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
3
24
|
export declare const TypeConfig: TypeGraphConfig;
|
|
4
|
-
type
|
|
5
|
-
type TypeConfig<T extends Type> = Record<PropsToDefine<T>, EntityPropertyConfig> | null;
|
|
25
|
+
type TypeConfig<T extends Type> = PropertiesRendering<T> | null;
|
|
6
26
|
type TypeGraphConfig = {
|
|
7
27
|
[K in Type["kind"]]: TypeConfig<Extract<Type, {
|
|
8
28
|
kind: K;
|
|
9
29
|
}>>;
|
|
10
30
|
};
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare const HiddenProps: readonly ["entityKind", "kind", "name", "node", "symbol", "templateNode", "templateArguments", "templateMapper", "instantiationParameters", "decorators", "projector", "isFinished"];
|
|
15
|
-
type HiddenPropsType = (typeof HiddenProps)[number];
|
|
16
|
-
export declare const HiddenPropsSet: Set<"symbol" | "kind" | "entityKind" | "name" | "node" | "templateNode" | "templateArguments" | "templateMapper" | "instantiationParameters" | "decorators" | "projector" | "isFinished">;
|
|
17
|
-
export declare function getPropertyRendering<T extends Type, K extends keyof T>(type: T, key: K): EntityPropertyConfig;
|
|
31
|
+
export declare const HiddenPropsSet: Set<"symbol" | "entityKind" | "kind" | "node" | "templateNode" | "templateArguments" | "templateMapper" | "instantiationParameters" | "decorators" | "isFinished">;
|
|
32
|
+
export declare function getPropertyRendering<T extends Type, K extends keyof T>(type: T, key: K): PropertyRenderingRaw<T>;
|
|
33
|
+
export declare function getRenderingConfig<T extends Entity>(type: T): PropertiesRendering<T> | null;
|
|
18
34
|
export {};
|
|
19
35
|
//# sourceMappingURL=type-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-config.d.ts","sourceRoot":"","sources":["../../src/react/type-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"type-config.d.ts","sourceRoot":"","sources":["../../src/react/type-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC3B;IAAE,IAAI,EAAE,QAAQ,GAAG,cAAc,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAA;CAAE,GAC9D,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAC/B,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAC9B,QAAQ,GACR,cAAc,GACd,KAAK,GACL,OAAO,GACP,MAAM,GACN,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAElC,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AACvF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEjF,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACpC,CAAC;AACF,MAAM,MAAM,0BAA0B,CAAC,CAAC,IAAI;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAoBF,eAAO,MAAM,UAAU,EAAE,eAsGvB,CAAC;AAOH,KAAK,UAAU,CAAC,CAAC,SAAS,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAChE,KAAK,eAAe,GAAG;KACpB,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC5D,CAAC;AAIF,eAAO,MAAM,cAAc,oKAAuB,CAAC;AAEnD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,MAAM,CAAC,EACpE,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,CAAC,GACL,oBAAoB,CAAC,CAAC,CAAC,CAIzB;AACD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAE3F"}
|
package/package.json
CHANGED