@ai-matrx/canvas 0.2.0 → 0.2.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/CHANGELOG.md +16 -0
- package/dist/react.cjs +6 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +10 -2
- package/dist/react.d.ts +10 -2
- package/dist/react.js +7 -3
- package/dist/react.js.map +1 -1
- package/dist/styles.css +3 -1
- package/package.json +1 -1
package/dist/react.d.cts
CHANGED
|
@@ -245,9 +245,17 @@ interface CanvasColumnProps {
|
|
|
245
245
|
readonly placement?: "docked" | "fill";
|
|
246
246
|
}
|
|
247
247
|
declare function CanvasColumn({ className, style, onLiveWidth, placement }: CanvasColumnProps): react.JSX.Element | null;
|
|
248
|
-
/**
|
|
249
|
-
|
|
248
|
+
/**
|
|
249
|
+
* THE one button that opens and puts away the canvas (this window's).
|
|
250
|
+
*
|
|
251
|
+
* `variant` follows the tap-target PLACEMENT RULES (all glass or none): a host
|
|
252
|
+
* whose header row is glass (a bar floating over scrolling content) passes
|
|
253
|
+
* `"glass"` so the toggle matches its neighbours; on a solid bar keep the
|
|
254
|
+
* default `"transparent"`.
|
|
255
|
+
*/
|
|
256
|
+
declare function CanvasToggle({ className, variant, }: {
|
|
250
257
|
className?: string;
|
|
258
|
+
variant?: "glass" | "transparent";
|
|
251
259
|
}): react.JSX.Element;
|
|
252
260
|
/**
|
|
253
261
|
* For hosts without their own shell (a Vite app, an Electron window): the app
|
package/dist/react.d.ts
CHANGED
|
@@ -245,9 +245,17 @@ interface CanvasColumnProps {
|
|
|
245
245
|
readonly placement?: "docked" | "fill";
|
|
246
246
|
}
|
|
247
247
|
declare function CanvasColumn({ className, style, onLiveWidth, placement }: CanvasColumnProps): react.JSX.Element | null;
|
|
248
|
-
/**
|
|
249
|
-
|
|
248
|
+
/**
|
|
249
|
+
* THE one button that opens and puts away the canvas (this window's).
|
|
250
|
+
*
|
|
251
|
+
* `variant` follows the tap-target PLACEMENT RULES (all glass or none): a host
|
|
252
|
+
* whose header row is glass (a bar floating over scrolling content) passes
|
|
253
|
+
* `"glass"` so the toggle matches its neighbours; on a solid bar keep the
|
|
254
|
+
* default `"transparent"`.
|
|
255
|
+
*/
|
|
256
|
+
declare function CanvasToggle({ className, variant, }: {
|
|
250
257
|
className?: string;
|
|
258
|
+
variant?: "glass" | "transparent";
|
|
251
259
|
}): react.JSX.Element;
|
|
252
260
|
/**
|
|
253
261
|
* For hosts without their own shell (a Vite app, an Electron window): the app
|
package/dist/react.js
CHANGED
|
@@ -1536,7 +1536,7 @@ import {
|
|
|
1536
1536
|
useState as useState4,
|
|
1537
1537
|
useSyncExternalStore as useSyncExternalStore3
|
|
1538
1538
|
} from "react";
|
|
1539
|
-
import { TapTargetButtonTransparent } from "@ai-matrx/tap-target";
|
|
1539
|
+
import { TapTargetButton, TapTargetButtonTransparent } from "@ai-matrx/tap-target";
|
|
1540
1540
|
|
|
1541
1541
|
// src/react/CanvasPane.tsx
|
|
1542
1542
|
import {
|
|
@@ -2477,14 +2477,18 @@ function SplitChild({ size, handle, children }) {
|
|
|
2477
2477
|
] });
|
|
2478
2478
|
}
|
|
2479
2479
|
var isMac2 = () => typeof navigator !== "undefined" && /mac|iphone|ipad/i.test(navigator.platform ?? "");
|
|
2480
|
-
function CanvasToggle({
|
|
2480
|
+
function CanvasToggle({
|
|
2481
|
+
className,
|
|
2482
|
+
variant = "transparent"
|
|
2483
|
+
}) {
|
|
2481
2484
|
const { controller, windowId } = useCanvasInternals();
|
|
2482
2485
|
const isOpen = useCanvasState((s) => selectCanvasIsOpen(s, windowId));
|
|
2483
2486
|
const count = useCanvasState((s) => selectCanvasWindowItemCount(s, windowId));
|
|
2484
2487
|
const hint = canvasShortcutHint("canvas.toggle", isMac2());
|
|
2488
|
+
const Button = variant === "glass" ? TapTargetButton : TapTargetButtonTransparent;
|
|
2485
2489
|
return /* @__PURE__ */ jsxs5("span", { className: ["mxc-toggle", className].filter(Boolean).join(" "), "data-open": isOpen ? "" : void 0, children: [
|
|
2486
2490
|
/* @__PURE__ */ jsx6(
|
|
2487
|
-
|
|
2491
|
+
Button,
|
|
2488
2492
|
{
|
|
2489
2493
|
ariaLabel: isOpen ? "Hide canvas" : "Show canvas",
|
|
2490
2494
|
tooltip: `${isOpen ? "Hide canvas" : "Show canvas"}${hint ? ` (${hint})` : ""}`,
|