@typespec/html-program-viewer 0.62.0-dev.1 → 0.63.0-dev.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.
@@ -0,0 +1,6 @@
1
+ const manifest = {
2
+ "version": "0.62.0",
3
+ "commit": "7aa6b682a6f3a97e616c849adf04fba9cff685e6"
4
+ };
5
+
6
+ export { manifest as default };
@@ -2846,15 +2846,20 @@ const Sash = ({
2846
2846
  ...others
2847
2847
  }) => {
2848
2848
  const [draging, setDrag] = useState(false);
2849
- const handleMouseMove = (e) => {
2850
- onDragging(e);
2851
- };
2849
+ const handleMouseMove = (e) => onDragging(createDraggingEventFromMouseEvent(e));
2852
2850
  const handleMouseUp = (e) => {
2853
2851
  setDrag(false);
2854
- onDragEnd(e);
2852
+ onDragEnd(createDraggingEventFromMouseEvent(e));
2855
2853
  window.removeEventListener("mousemove", handleMouseMove);
2856
2854
  window.removeEventListener("mouseup", handleMouseUp);
2857
2855
  };
2856
+ const handleTouchMove = (e) => onDragging(createDraggingEventFromTouchEvent(e));
2857
+ const handleTouchUp = (e) => {
2858
+ setDrag(false);
2859
+ onDragEnd(createDraggingEventFromTouchEvent(e));
2860
+ window.removeEventListener("touchmove", handleTouchMove);
2861
+ window.removeEventListener("touchend", handleTouchUp);
2862
+ };
2858
2863
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2859
2864
  "div",
2860
2865
  {
@@ -2862,16 +2867,37 @@ const Sash = ({
2862
2867
  className: mergeClasses(style$1$1["sash"], className),
2863
2868
  onMouseDown: (e) => {
2864
2869
  setDrag(true);
2865
- onDragStart(e);
2870
+ onDragStart(createDraggingEventFromMouseEvent(e));
2866
2871
  window.addEventListener("mousemove", handleMouseMove);
2867
2872
  window.addEventListener("mouseup", handleMouseUp);
2868
2873
  },
2874
+ onTouchStart: (e) => {
2875
+ setDrag(true);
2876
+ onDragStart(createDraggingEventFromTouchEvent(e));
2877
+ window.addEventListener("touchmove", handleTouchMove);
2878
+ window.addEventListener("touchend", handleTouchUp);
2879
+ },
2869
2880
  onDoubleClick: onReset,
2870
2881
  ...others,
2871
2882
  children: render(draging)
2872
2883
  }
2873
2884
  );
2874
2885
  };
2886
+ function createDraggingEventFromMouseEvent(originalEvent) {
2887
+ return {
2888
+ originalEvent,
2889
+ pageX: originalEvent.pageX,
2890
+ pageY: originalEvent.pageY
2891
+ };
2892
+ }
2893
+ function createDraggingEventFromTouchEvent(originalEvent) {
2894
+ const lastTouch = originalEvent.touches[originalEvent.touches.length - 1];
2895
+ return {
2896
+ originalEvent,
2897
+ pageX: lastTouch.clientX,
2898
+ pageY: lastTouch.clientY
2899
+ };
2900
+ }
2875
2901
 
2876
2902
  const defaultDimensions = { width: 0, height: 0 };
2877
2903
  function useElDimensions(ref) {
@@ -17649,6 +17675,15 @@ function getEncodedRootLength(path) {
17649
17675
  return 0;
17650
17676
  }
17651
17677
 
17678
+ var ResolutionResultFlags;
17679
+ (function (ResolutionResultFlags) {
17680
+ ResolutionResultFlags[ResolutionResultFlags["None"] = 0] = "None";
17681
+ ResolutionResultFlags[ResolutionResultFlags["Resolved"] = 2] = "Resolved";
17682
+ ResolutionResultFlags[ResolutionResultFlags["Unknown"] = 4] = "Unknown";
17683
+ ResolutionResultFlags[ResolutionResultFlags["Ambiguous"] = 8] = "Ambiguous";
17684
+ ResolutionResultFlags[ResolutionResultFlags["NotFound"] = 16] = "NotFound";
17685
+ ResolutionResultFlags[ResolutionResultFlags["ResolutionFailed"] = 28] = "ResolutionFailed";
17686
+ })(ResolutionResultFlags || (ResolutionResultFlags = {}));
17652
17687
  /**
17653
17688
  * AST types
17654
17689
  */
@@ -17785,7 +17820,7 @@ let manifest;
17785
17820
  try {
17786
17821
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17787
17822
  // @ts-ignore
17788
- manifest = (await import('../manifest-sbs2hQhm.js')).default;
17823
+ manifest = (await import('../manifest-CoFoVY97.js')).default;
17789
17824
  }
17790
17825
  catch {
17791
17826
  const name = "../dist/manifest.js";
@@ -18199,18 +18234,6 @@ const diagnostics = {
18199
18234
  default: paramMessage `Intersection contains duplicate property definitions for ${"propName"}`,
18200
18235
  },
18201
18236
  },
18202
- "unknown-identifier": {
18203
- severity: "error",
18204
- messages: {
18205
- default: paramMessage `Unknown identifier ${"id"}`,
18206
- },
18207
- },
18208
- "unknown-decorator": {
18209
- severity: "error",
18210
- messages: {
18211
- default: "Unknown decorator",
18212
- },
18213
- },
18214
18237
  "invalid-decorator": {
18215
18238
  severity: "error",
18216
18239
  messages: {
@@ -18221,9 +18244,11 @@ const diagnostics = {
18221
18244
  severity: "error",
18222
18245
  messages: {
18223
18246
  default: paramMessage `Cannot resolve ${"id"}`,
18247
+ identifier: paramMessage `Unknown identifier ${"id"}`,
18248
+ decorator: paramMessage `Unknown decorator @${"id"}`,
18224
18249
  inDecorator: paramMessage `Cannot resolve ${"id"} in decorator`,
18225
18250
  underNamespace: paramMessage `Namespace ${"namespace"} doesn't have member ${"id"}`,
18226
- underContainer: paramMessage `${"kind"} doesn't have member ${"id"}`,
18251
+ member: paramMessage `${"kind"} doesn't have member ${"id"}`,
18227
18252
  metaProperty: paramMessage `${"kind"} doesn't have meta property ${"id"}`,
18228
18253
  node: paramMessage `Cannot resolve '${"id"}' in node ${"nodeName"} since it has no members. Did you mean to use "::" instead of "."?`,
18229
18254
  },
@@ -18610,7 +18635,13 @@ const diagnostics = {
18610
18635
  "invalid-emitter": {
18611
18636
  severity: "error",
18612
18637
  messages: {
18613
- default: paramMessage `Requested emitter package ${"emitterPackage"} does not provide an "onEmit" function.`,
18638
+ default: paramMessage `Requested emitter package ${"emitterPackage"} does not provide an "$onEmit" function.`,
18639
+ },
18640
+ },
18641
+ "js-error": {
18642
+ severity: "error",
18643
+ messages: {
18644
+ default: paramMessage `Failed to load ${"specifier"} due to the following JS error: ${"error"}`,
18614
18645
  },
18615
18646
  },
18616
18647
  "missing-import": {
@@ -18761,6 +18792,32 @@ const diagnostics = {
18761
18792
  duplicate: paramMessage `Same encoded name '${"name"}' is used for 2 members '${"mimeType"}'`,
18762
18793
  },
18763
18794
  },
18795
+ "incompatible-paging-props": {
18796
+ severity: "error",
18797
+ messages: {
18798
+ default: paramMessage `Paging property has multiple types: '${"kinds"}'`,
18799
+ },
18800
+ },
18801
+ "invalid-paging-prop": {
18802
+ severity: "error",
18803
+ messages: {
18804
+ default: paramMessage `Paging property '${"kind"}' is not valid in this context.`,
18805
+ input: paramMessage `Paging property '${"kind"}' cannot be used in the parameters of an operation.`,
18806
+ output: paramMessage `Paging property '${"kind"}' cannot be used in the return type of an operation.`,
18807
+ },
18808
+ },
18809
+ "duplicate-paging-prop": {
18810
+ severity: "error",
18811
+ messages: {
18812
+ default: paramMessage `Duplicate property paging '${"kind"}' for operation ${"operationName"}.`,
18813
+ },
18814
+ },
18815
+ "missing-paging-items": {
18816
+ severity: "error",
18817
+ messages: {
18818
+ default: paramMessage `Paged operation '${"operationName"}' return type must have a property annotated with @pageItems.`,
18819
+ },
18820
+ },
18764
18821
  /**
18765
18822
  * Service
18766
18823
  */
@@ -27732,6 +27789,7 @@ const TypeSpecConfigJsonSchema = {
27732
27789
  emitters: {
27733
27790
  type: "object",
27734
27791
  nullable: true,
27792
+ deprecated: true,
27735
27793
  required: [],
27736
27794
  additionalProperties: {
27737
27795
  oneOf: [{ type: "boolean" }, emitterOptionsSchema],
@@ -30797,6 +30855,16 @@ function createTypekit() {
30797
30855
  /** @experimental */
30798
30856
  createTypekit();
30799
30857
 
30858
+ /**
30859
+ * Get the documentation string for the given type.
30860
+ * @param program Program
30861
+ * @param target Type
30862
+ * @returns Documentation value
30863
+ */
30864
+ function getDoc(program, target) {
30865
+ return getDocDataInternal(program, target, "self")?.value;
30866
+ }
30867
+
30800
30868
  const globalLibraryUrlsLoadedSym = Symbol.for("TYPESPEC_LIBRARY_URLS_LOADED");
30801
30869
  if (globalThis[globalLibraryUrlsLoadedSym] === undefined) {
30802
30870
  globalThis[globalLibraryUrlsLoadedSym] = new Set();
@@ -30810,16 +30878,6 @@ var UsageFlags;
30810
30878
  UsageFlags[UsageFlags["Output"] = 4] = "Output";
30811
30879
  })(UsageFlags || (UsageFlags = {}));
30812
30880
 
30813
- /**
30814
- * Get the documentation string for the given type.
30815
- * @param program Program
30816
- * @param target Type
30817
- * @returns Documentation value
30818
- */
30819
- function getDoc(program, target) {
30820
- return getDocDataInternal(program, target, "self")?.value;
30821
- }
30822
-
30823
30881
  var main$4 = {};
30824
30882
 
30825
30883
  var api$2 = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/html-program-viewer",
3
- "version": "0.62.0-dev.1",
3
+ "version": "0.63.0-dev.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": "~0.61.0 || >=0.62.0-dev <0.62.0"
39
+ "@typespec/compiler": "~0.62.0 || >=0.63.0-dev <0.63.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluentui/react-components": "~9.55.0",
@@ -54,7 +54,7 @@
54
54
  "@types/node": "~22.7.5",
55
55
  "@types/react": "~18.3.11",
56
56
  "@types/react-dom": "~18.3.0",
57
- "@typespec/compiler": "~0.61.0 || >=0.62.0-dev <0.62.0",
57
+ "@typespec/compiler": "~0.62.0 || >=0.63.0-dev <0.63.0",
58
58
  "@vitejs/plugin-react": "~4.3.2",
59
59
  "@vitest/coverage-v8": "^2.1.2",
60
60
  "@vitest/ui": "^2.1.2",
@@ -1,6 +0,0 @@
1
- const manifest = {
2
- "version": "0.61.0",
3
- "commit": "52beb60a6b9a490891d2f94eb328cf35159f5168"
4
- };
5
-
6
- export { manifest as default };