@typespec/playground 0.6.0-dev.3 → 0.7.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.
- package/dist/react/index.js +31 -5
- package/package.json +11 -11
package/dist/react/index.js
CHANGED
|
@@ -1583,15 +1583,20 @@ const Sash = ({
|
|
|
1583
1583
|
...others
|
|
1584
1584
|
}) => {
|
|
1585
1585
|
const [draging, setDrag] = useState(false);
|
|
1586
|
-
const handleMouseMove = (e) =>
|
|
1587
|
-
onDragging(e);
|
|
1588
|
-
};
|
|
1586
|
+
const handleMouseMove = (e) => onDragging(createDraggingEventFromMouseEvent(e));
|
|
1589
1587
|
const handleMouseUp = (e) => {
|
|
1590
1588
|
setDrag(false);
|
|
1591
|
-
onDragEnd(e);
|
|
1589
|
+
onDragEnd(createDraggingEventFromMouseEvent(e));
|
|
1592
1590
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
1593
1591
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
1594
1592
|
};
|
|
1593
|
+
const handleTouchMove = (e) => onDragging(createDraggingEventFromTouchEvent(e));
|
|
1594
|
+
const handleTouchUp = (e) => {
|
|
1595
|
+
setDrag(false);
|
|
1596
|
+
onDragEnd(createDraggingEventFromTouchEvent(e));
|
|
1597
|
+
window.removeEventListener("touchmove", handleTouchMove);
|
|
1598
|
+
window.removeEventListener("touchend", handleTouchUp);
|
|
1599
|
+
};
|
|
1595
1600
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1596
1601
|
"div",
|
|
1597
1602
|
{
|
|
@@ -1599,16 +1604,37 @@ const Sash = ({
|
|
|
1599
1604
|
className: mergeClasses(style$1$1["sash"], className),
|
|
1600
1605
|
onMouseDown: (e) => {
|
|
1601
1606
|
setDrag(true);
|
|
1602
|
-
onDragStart(e);
|
|
1607
|
+
onDragStart(createDraggingEventFromMouseEvent(e));
|
|
1603
1608
|
window.addEventListener("mousemove", handleMouseMove);
|
|
1604
1609
|
window.addEventListener("mouseup", handleMouseUp);
|
|
1605
1610
|
},
|
|
1611
|
+
onTouchStart: (e) => {
|
|
1612
|
+
setDrag(true);
|
|
1613
|
+
onDragStart(createDraggingEventFromTouchEvent(e));
|
|
1614
|
+
window.addEventListener("touchmove", handleTouchMove);
|
|
1615
|
+
window.addEventListener("touchend", handleTouchUp);
|
|
1616
|
+
},
|
|
1606
1617
|
onDoubleClick: onReset,
|
|
1607
1618
|
...others,
|
|
1608
1619
|
children: render(draging)
|
|
1609
1620
|
}
|
|
1610
1621
|
);
|
|
1611
1622
|
};
|
|
1623
|
+
function createDraggingEventFromMouseEvent(originalEvent) {
|
|
1624
|
+
return {
|
|
1625
|
+
originalEvent,
|
|
1626
|
+
pageX: originalEvent.pageX,
|
|
1627
|
+
pageY: originalEvent.pageY
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
function createDraggingEventFromTouchEvent(originalEvent) {
|
|
1631
|
+
const lastTouch = originalEvent.touches[originalEvent.touches.length - 1];
|
|
1632
|
+
return {
|
|
1633
|
+
originalEvent,
|
|
1634
|
+
pageX: lastTouch.clientX,
|
|
1635
|
+
pageY: lastTouch.clientY
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1612
1638
|
|
|
1613
1639
|
const defaultDimensions = { width: 0, height: 0 };
|
|
1614
1640
|
function useElDimensions(ref) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/playground",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-dev.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec playground UI components.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@fluentui/react-components": "~9.55.0",
|
|
63
63
|
"@fluentui/react-icons": "^2.0.260",
|
|
64
|
-
"@typespec/bundler": "~0.1.
|
|
65
|
-
"@typespec/compiler": "~0.
|
|
66
|
-
"@typespec/html-program-viewer": "~0.
|
|
67
|
-
"@typespec/http": "~0.
|
|
68
|
-
"@typespec/openapi": "~0.
|
|
69
|
-
"@typespec/openapi3": "~0.
|
|
70
|
-
"@typespec/protobuf": "~0.
|
|
71
|
-
"@typespec/rest": "~0.
|
|
72
|
-
"@typespec/versioning": "~0.
|
|
64
|
+
"@typespec/bundler": "~0.1.9 || >=0.2.0-dev <0.2.0",
|
|
65
|
+
"@typespec/compiler": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
66
|
+
"@typespec/html-program-viewer": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
67
|
+
"@typespec/http": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
68
|
+
"@typespec/openapi": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
69
|
+
"@typespec/openapi3": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
70
|
+
"@typespec/protobuf": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
71
|
+
"@typespec/rest": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
72
|
+
"@typespec/versioning": "~0.62.0 || >=0.63.0-dev <0.63.0",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"debounce": "~2.1.1",
|
|
75
75
|
"lzutf8": "0.6.3",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@types/react": "~18.3.11",
|
|
96
96
|
"@types/react-dom": "~18.3.0",
|
|
97
97
|
"@types/swagger-ui-dist": "~3.30.5",
|
|
98
|
-
"@typespec/bundler": "~0.1.
|
|
98
|
+
"@typespec/bundler": "~0.1.9 || >=0.2.0-dev <0.2.0",
|
|
99
99
|
"@vitejs/plugin-react": "~4.3.2",
|
|
100
100
|
"c8": "^10.1.2",
|
|
101
101
|
"cross-env": "~7.0.3",
|