@nativedesktop/react 0.2.0 → 0.3.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/generated/rpc.js +1 -0
- package/dist/index.js +3 -0
- package/dist/packages/react/src/generated/intrinsics.d.ts +1 -0
- package/dist/packages/react/src/generated/rpc.d.ts +5 -0
- package/dist/packages/react/src/index.d.ts +1 -1
- package/dist/packages/react/src/metrics.d.ts +16 -0
- package/package.json +1 -1
package/dist/generated/rpc.js
CHANGED
|
@@ -3,6 +3,7 @@ var RPC_ERRORS = {
|
|
|
3
3
|
notActionable: { code: -32001, message: "not actionable" },
|
|
4
4
|
waitForTimeout: { code: -32002, message: "waitFor timeout" },
|
|
5
5
|
inputUnsupported: { code: -32003, message: "input synthesis unsupported on this backend" },
|
|
6
|
+
windowGone: { code: -32004, message: "window closed" },
|
|
6
7
|
methodNotFound: { code: -32601, message: "method not found" },
|
|
7
8
|
invalidParams: { code: -32602, message: "invalid params" },
|
|
8
9
|
internalError: { code: -32603, message: "internal error" },
|
package/dist/index.js
CHANGED
|
@@ -1649,8 +1649,10 @@ var Spacing = {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
};
|
|
1651
1651
|
var ContentMargin = appleLanguage() ? 20 : 12;
|
|
1652
|
+
var ContentWidth = appleLanguage() ? 720 : 600;
|
|
1652
1653
|
onBackendKnown(() => {
|
|
1653
1654
|
ContentMargin = appleLanguage() ? 20 : 12;
|
|
1655
|
+
ContentWidth = appleLanguage() ? 720 : 600;
|
|
1654
1656
|
});
|
|
1655
1657
|
// src/paths.ts
|
|
1656
1658
|
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
@@ -2239,6 +2241,7 @@ export {
|
|
|
2239
2241
|
Spacing,
|
|
2240
2242
|
Platform,
|
|
2241
2243
|
Fragment3 as Fragment,
|
|
2244
|
+
ContentWidth,
|
|
2242
2245
|
ContentMargin,
|
|
2243
2246
|
Activity2 as Activity
|
|
2244
2247
|
};
|
|
@@ -324,6 +324,11 @@ export declare const RPC_ERRORS: {
|
|
|
324
324
|
readonly code: -32003;
|
|
325
325
|
readonly message: "input synthesis unsupported on this backend";
|
|
326
326
|
};
|
|
327
|
+
/** data: {window}. getTree/screenshot only: params.window named a real Window ref (e.g. from windows()) that has since closed, distinguishing a benign concurrent-close race from invalidParams (a malformed request). Every other window-scoped method resolves a closed window into its own no-match result instead of this error. */
|
|
328
|
+
readonly windowGone: {
|
|
329
|
+
readonly code: -32004;
|
|
330
|
+
readonly message: "window closed";
|
|
331
|
+
};
|
|
327
332
|
readonly methodNotFound: {
|
|
328
333
|
readonly code: -32601;
|
|
329
334
|
readonly message: "method not found";
|
|
@@ -2,7 +2,7 @@ export { render, sendCommand, sendNativeCommand, createPortal, createPool, moveN
|
|
|
2
2
|
export type { Pool } from "./renderer.ts";
|
|
3
3
|
export { Platform, hasWidget, hasCommand } from "./platform.ts";
|
|
4
4
|
export type { Backend, OS } from "./platform.ts";
|
|
5
|
-
export { Spacing, ContentMargin } from "./metrics.ts";
|
|
5
|
+
export { Spacing, ContentMargin, ContentWidth } from "./metrics.ts";
|
|
6
6
|
export type { SpacingScale } from "./metrics.ts";
|
|
7
7
|
export { getAppDataDir, ensureAppDataDir } from "./paths.ts";
|
|
8
8
|
export { defineNativeComponent } from "./native-component.ts";
|
|
@@ -10,3 +10,19 @@ export declare const Spacing: SpacingScale;
|
|
|
10
10
|
* binding (a number export cannot be a getter): read it at render time, not
|
|
11
11
|
* into a module-scope constant. */
|
|
12
12
|
export declare let ContentMargin: number;
|
|
13
|
+
/** The platform's reading measure for settings-shaped content — the width to
|
|
14
|
+
* cap a content column at, as `<clamp maximumSize>`.
|
|
15
|
+
*
|
|
16
|
+
* A column, not a widget: the cap belongs to whatever holds the column so
|
|
17
|
+
* every child shares it. This matters on AppKit, where `<settingsgroup>` is a
|
|
18
|
+
* SwiftUI grouped `Form` and that style caps and centers its own card inside
|
|
19
|
+
* whatever width it is handed. A `<codeeditor>` or `<table>` beside it has no
|
|
20
|
+
* such cap, so the two disagree by however wide the pane happens to be, and
|
|
21
|
+
* neither `maxWidth: .infinity` nor a wider frame turns the Form's cap off.
|
|
22
|
+
* Clamping the column below the cap settles it: the Form stops capping, its
|
|
23
|
+
* card fills the column, and its siblings line up with it. GTK has the same
|
|
24
|
+
* shape natively — AdwPreferencesGroup fills its AdwClamp — so one tree reads
|
|
25
|
+
* correctly on both.
|
|
26
|
+
*
|
|
27
|
+
* A live binding for the same reason `ContentMargin` is. */
|
|
28
|
+
export declare let ContentWidth: number;
|