@typespec/html-program-viewer 0.71.0-dev.1 → 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.
@@ -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
- const providerSelector = `.${fluentProviderClassNames.root}.${styleTagId}`;
5107
- const providerElements = targetDocument.querySelectorAll(providerSelector);
5108
- // In SSR, we will have DOM upfront. To avoid false positives the check on nested style tag is performed
5109
- const isSSR = targetDocument.querySelector(`${providerSelector} > style[id="${styleTagId}"]`) !== null;
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
@@ -0,0 +1,6 @@
1
+ const manifest = {
2
+ "version": "1.1.0",
3
+ "commit": "cc74c72d4dcfd78a6a6a84e5618a16a5bad462c1"
4
+ };
5
+
6
+ export { manifest as default };
@@ -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
- const prefix = op.interface
30944
- ? getInterfaceName(op.interface, options) + "."
30945
- : getNamespacePrefix(op.namespace, options);
30946
- return `${prefix}${opName}`;
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
  }
@@ -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-Cf9CSWMa.js')).default;
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-dev.1",
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,7 +36,7 @@
36
36
  "!dist/test/**"
37
37
  ],
38
38
  "peerDependencies": {
39
- "@typespec/compiler": "^1.0.0"
39
+ "@typespec/compiler": "^1.1.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluentui/react-components": "~9.63.0",
@@ -54,7 +54,6 @@
54
54
  "@types/node": "~22.13.11",
55
55
  "@types/react": "~18.3.11",
56
56
  "@types/react-dom": "~18.3.0",
57
- "@typespec/compiler": "^1.0.0",
58
57
  "@vitejs/plugin-react": "~4.4.1",
59
58
  "@vitest/coverage-v8": "^3.1.2",
60
59
  "@vitest/ui": "^3.1.2",
@@ -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": {
@@ -1,6 +0,0 @@
1
- const manifest = {
2
- "version": "1.0.0",
3
- "commit": "a878edeadfe53b6437f7c94f0fe0e81225d7b996"
4
- };
5
-
6
- export { manifest as default };