@typespec/html-program-viewer 0.71.0-dev.0 → 0.71.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/dist/emitter/index.js +24 -4
- package/dist/manifest-BJp8WsoA.js +6 -0
- package/dist/react/index.js +27 -13
- package/package.json +5 -5
- package/dist/manifest-0K2D8hcR.js +0 -6
package/dist/emitter/index.js
CHANGED
|
@@ -3943,6 +3943,8 @@ function disposeKeyborg(instance) {
|
|
|
3943
3943
|
keyborg.subscribe((isNavigatingWithKeyboard)=>{
|
|
3944
3944
|
if (!isNavigatingWithKeyboard) {
|
|
3945
3945
|
disposeCurrentElement();
|
|
3946
|
+
} else {
|
|
3947
|
+
registerElementIfNavigating(targetWindow.document.activeElement);
|
|
3946
3948
|
}
|
|
3947
3949
|
});
|
|
3948
3950
|
// Keyborg's focusin event is delegated so it's only registered once on the window
|
|
@@ -5103,10 +5105,28 @@ const insertSheet = (tag, rule)=>{
|
|
|
5103
5105
|
// this allows to do checks with strict mode enabled as .useEffect() will be called with incremented IDs because
|
|
5104
5106
|
// of double render.
|
|
5105
5107
|
if (targetDocument) {
|
|
5106
|
-
|
|
5107
|
-
const
|
|
5108
|
-
|
|
5109
|
-
const
|
|
5108
|
+
var _styleElement_textContent;
|
|
5109
|
+
const providerElementSelector = `.${fluentProviderClassNames.root}.${styleTagId}`;
|
|
5110
|
+
const providerElements = targetDocument.querySelectorAll(providerElementSelector);
|
|
5111
|
+
const styleElementSelector = `style[id="${styleTagId}"]`;
|
|
5112
|
+
const styleElements = targetDocument.querySelectorAll(styleElementSelector);
|
|
5113
|
+
if (styleElements.length > 1) {
|
|
5114
|
+
// eslint-disable-next-line no-console
|
|
5115
|
+
console.error([
|
|
5116
|
+
'@fluentui/react-provider: We found multiple <style> elements with same IDs in your DOM.',
|
|
5117
|
+
'Please make sure that you configured your application properly.',
|
|
5118
|
+
'\n',
|
|
5119
|
+
'\n',
|
|
5120
|
+
'Configuration guide: https://aka.ms/fluentui-conflicting-ids'
|
|
5121
|
+
].join(' '));
|
|
5122
|
+
return;
|
|
5123
|
+
}
|
|
5124
|
+
const styleElement = styleElements.item(0);
|
|
5125
|
+
var _styleElement_textContent_length;
|
|
5126
|
+
// Heads up!
|
|
5127
|
+
//
|
|
5128
|
+
// In SSR, we will have DOM upfront & style tags will have CSS rules defined in `.textContent`
|
|
5129
|
+
const isSSR = ((_styleElement_textContent_length = styleElement === null || styleElement === void 0 ? void 0 : (_styleElement_textContent = styleElement.textContent) === null || _styleElement_textContent === void 0 ? void 0 : _styleElement_textContent.length) !== null && _styleElement_textContent_length !== void 0 ? _styleElement_textContent_length : 0) > 0;
|
|
5110
5130
|
const elementsCount = isSSR ? 1 : 0;
|
|
5111
5131
|
if (providerElements.length > elementsCount) {
|
|
5112
5132
|
// eslint-disable-next-line no-console
|
package/dist/react/index.js
CHANGED
|
@@ -30859,7 +30859,7 @@ function getNamespaceFullName(type, options) {
|
|
|
30859
30859
|
return segments.join(".");
|
|
30860
30860
|
}
|
|
30861
30861
|
function getNamespacePrefix(type, options) {
|
|
30862
|
-
if (type === undefined || isStdNamespace(type)) {
|
|
30862
|
+
if (type === undefined || isStdNamespace(type) || options?.nameOnly === true) {
|
|
30863
30863
|
return "";
|
|
30864
30864
|
}
|
|
30865
30865
|
const namespaceFullName = getNamespaceFullName(type, options);
|
|
@@ -30940,10 +30940,12 @@ function getOperationName(op, options) {
|
|
|
30940
30940
|
const params = op.node.templateParameters.map((t) => getIdentifierName(t.id.sv, options));
|
|
30941
30941
|
opName += `<${params.join(", ")}>`;
|
|
30942
30942
|
}
|
|
30943
|
-
|
|
30944
|
-
|
|
30945
|
-
|
|
30946
|
-
|
|
30943
|
+
{
|
|
30944
|
+
const prefix = op.interface
|
|
30945
|
+
? getInterfaceName(op.interface, options) + "."
|
|
30946
|
+
: getNamespacePrefix(op.namespace, options);
|
|
30947
|
+
return `${prefix}${opName}`;
|
|
30948
|
+
}
|
|
30947
30949
|
}
|
|
30948
30950
|
function getIdentifierName(name, options) {
|
|
30949
30951
|
return options?.printable ? printIdentifier(name) : name;
|
|
@@ -31171,21 +31173,27 @@ function getPagingOperation(program, op) {
|
|
|
31171
31173
|
}
|
|
31172
31174
|
return diags.wrap(result);
|
|
31173
31175
|
}
|
|
31174
|
-
function navigateProperties(type, callback, path = []) {
|
|
31176
|
+
function navigateProperties(type, callback, path = [], visited = new Set()) {
|
|
31177
|
+
if (visited.has(type))
|
|
31178
|
+
return;
|
|
31179
|
+
visited.add(type);
|
|
31175
31180
|
switch (type.kind) {
|
|
31176
31181
|
case "Model":
|
|
31177
31182
|
for (const prop of type.properties.values()) {
|
|
31178
31183
|
callback(prop, [...path, prop]);
|
|
31179
|
-
navigateProperties(prop.type, callback, [...path, prop]);
|
|
31184
|
+
navigateProperties(prop.type, callback, [...path, prop], visited);
|
|
31185
|
+
}
|
|
31186
|
+
if (type.baseModel) {
|
|
31187
|
+
navigateProperties(type.baseModel, callback, path, visited);
|
|
31180
31188
|
}
|
|
31181
31189
|
break;
|
|
31182
31190
|
case "Union":
|
|
31183
31191
|
for (const member of type.variants.values()) {
|
|
31184
|
-
navigateProperties(member, callback, path);
|
|
31192
|
+
navigateProperties(member, callback, path, visited);
|
|
31185
31193
|
}
|
|
31186
31194
|
break;
|
|
31187
31195
|
case "UnionVariant":
|
|
31188
|
-
navigateProperties(type.type, callback, path);
|
|
31196
|
+
navigateProperties(type.type, callback, path, visited);
|
|
31189
31197
|
break;
|
|
31190
31198
|
}
|
|
31191
31199
|
}
|
|
@@ -31346,12 +31354,12 @@ var MutatorFlow;
|
|
|
31346
31354
|
|
|
31347
31355
|
const [getSummary, setSummary] = useStateMap(createStateSymbol("summary"));
|
|
31348
31356
|
/**
|
|
31349
|
-
*
|
|
31357
|
+
* `@doc` attaches a documentation string. Works great with multi-line string literals.
|
|
31350
31358
|
*
|
|
31351
|
-
* The first argument to
|
|
31359
|
+
* The first argument to `@doc` is a string, which may contain template parameters, enclosed in braces,
|
|
31352
31360
|
* which are replaced with an attribute for the type (commonly "name") passed as the second (optional) argument.
|
|
31353
31361
|
*
|
|
31354
|
-
*
|
|
31362
|
+
* `@doc` can be specified on any language element -- a model, an operation, a namespace, etc.
|
|
31355
31363
|
*/
|
|
31356
31364
|
const $doc = (context, target, text, sourceObject) => {
|
|
31357
31365
|
validateDecoratorUniqueOnNode(context, target, $doc);
|
|
@@ -32096,6 +32104,12 @@ defineKit({
|
|
|
32096
32104
|
constructors: copyMap(type.constructors),
|
|
32097
32105
|
});
|
|
32098
32106
|
break;
|
|
32107
|
+
case "Tuple":
|
|
32108
|
+
clone = this.program.checker.createType({
|
|
32109
|
+
...type,
|
|
32110
|
+
values: [...type.values],
|
|
32111
|
+
});
|
|
32112
|
+
break;
|
|
32099
32113
|
default:
|
|
32100
32114
|
clone = this.program.checker.createType({
|
|
32101
32115
|
...type,
|
|
@@ -34300,7 +34314,7 @@ let manifest;
|
|
|
34300
34314
|
try {
|
|
34301
34315
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34302
34316
|
// @ts-ignore
|
|
34303
|
-
manifest = (await import('../manifest-
|
|
34317
|
+
manifest = (await import('../manifest-BJp8WsoA.js')).default;
|
|
34304
34318
|
}
|
|
34305
34319
|
catch {
|
|
34306
34320
|
const name = "../dist/manifest.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/html-program-viewer",
|
|
3
|
-
"version": "0.71.0
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for emitting an html view of the program.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"!dist/test/**"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@typespec/compiler": "^1.
|
|
39
|
+
"@typespec/compiler": "^1.1.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@fluentui/react-components": "~9.
|
|
42
|
+
"@fluentui/react-components": "~9.63.0",
|
|
43
43
|
"@fluentui/react-icons": "^2.0.292",
|
|
44
44
|
"@fluentui/react-list": "^9.1.2",
|
|
45
45
|
"react": "~18.3.1",
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
"@types/node": "~22.13.11",
|
|
55
55
|
"@types/react": "~18.3.11",
|
|
56
56
|
"@types/react-dom": "~18.3.0",
|
|
57
|
-
"@
|
|
58
|
-
"@vitejs/plugin-react": "~4.3.4",
|
|
57
|
+
"@vitejs/plugin-react": "~4.4.1",
|
|
59
58
|
"@vitest/coverage-v8": "^3.1.2",
|
|
60
59
|
"@vitest/ui": "^3.1.2",
|
|
61
60
|
"c8": "^10.1.3",
|
|
@@ -66,6 +65,7 @@
|
|
|
66
65
|
"vite-plugin-dts": "4.5.3",
|
|
67
66
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
68
67
|
"vitest": "^3.1.2",
|
|
68
|
+
"@typespec/compiler": "^1.1.0",
|
|
69
69
|
"@typespec/react-components": "^0.57.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|