@immediately-run/sdk 0.1.5 → 0.2.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/contribute.cjs +32 -0
- package/dist/contribute.cjs.map +1 -0
- package/dist/contribute.d.cts +100 -0
- package/dist/contribute.d.ts +100 -0
- package/dist/contribute.js +8 -0
- package/dist/contribute.js.map +1 -0
- package/dist/editorContext.cjs +46 -0
- package/dist/editorContext.cjs.map +1 -0
- package/dist/editorContext.d.cts +32 -0
- package/dist/editorContext.d.ts +32 -0
- package/dist/editorContext.js +20 -0
- package/dist/editorContext.js.map +1 -0
- package/dist/formFactor.cjs +46 -0
- package/dist/formFactor.cjs.map +1 -0
- package/dist/formFactor.d.cts +29 -0
- package/dist/formFactor.d.ts +29 -0
- package/dist/formFactor.js +20 -0
- package/dist/formFactor.js.map +1 -0
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/mounts.cjs +18 -6
- package/dist/mounts.cjs.map +1 -1
- package/dist/mounts.d.cts +25 -3
- package/dist/mounts.d.ts +25 -3
- package/dist/mounts.js +15 -6
- package/dist/mounts.js.map +1 -1
- package/dist/protocolStream.cjs +87 -0
- package/dist/protocolStream.cjs.map +1 -0
- package/dist/protocolStream.d.cts +44 -0
- package/dist/protocolStream.d.ts +44 -0
- package/dist/protocolStream.js +61 -0
- package/dist/protocolStream.js.map +1 -0
- package/dist/theme.cjs +57 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +38 -0
- package/dist/theme.d.ts +38 -0
- package/dist/theme.js +30 -0
- package/dist/theme.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var contribute_exports = {};
|
|
20
|
+
__export(contribute_exports, {
|
|
21
|
+
contribute: () => contribute
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(contribute_exports);
|
|
24
|
+
var import_protocolStream = require("./protocolStream");
|
|
25
|
+
function contribute(opts) {
|
|
26
|
+
return (0, import_protocolStream.protocolStream)("protocol-contribute", "run", [opts]);
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
contribute
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=contribute.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contribute.ts"],"sourcesContent":["// Contribute — stream a save (PR or direct commit) from app code\n// (UI_AS_APPS_SPEC §5.1, CONTRIBUTE_SPEC). The host runs the *existing*\n// contribution orchestrator and streams its stages back; this is the typed\n// front door over `protocolStream`.\n//\n// The OAuth token never reaches here — it stays on the host. The app passes a\n// commit message + save mode and watches stages go by; the host owns the token,\n// the GitHub API calls, and the user-facing consent.\nimport { protocolStream } from './protocolStream';\n\n/** The save strategy. `direct` requires the first-party `contribute:direct`\n * capability and a scarier consent line — a `contribute:any` app asking for it\n * is REJECTED (`forbidden`), never silently downgraded to a PR (threat T11). */\nexport type ContributeMode = 'pr' | 'direct';\n\n/** A stage emitted as the contribution runs. Mirrors the host orchestrator's\n * event union; carries progress metadata only — never the token or file blobs. */\nexport type ContributionEvent =\n | { stage: 'auth-check' }\n | { stage: 'diff-compute' }\n | { stage: 'permission-check' }\n | { stage: 'install-required'; targetOwner: string; targetRepo: string; installUrl: string }\n | { stage: 'conflict-check' }\n | { stage: 'fork-prepare'; forkOwner: string; alreadyExists: boolean }\n | { stage: 'upload-blob'; path: string; index: number; total: number }\n | { stage: 'create-tree' }\n | { stage: 'create-commit' }\n | { stage: 'create-branch'; branchName: string }\n | { stage: 'create-pr' }\n | { stage: 'pr-updated'; prNumber: number; prUrl: string; commitSha: string }\n | { stage: 'commit-pushed'; ref: string; commitSha: string }\n | { stage: 'switch-branch'; provider: 'github'; pushOwner: string; repository: string; branchName: string }\n | { stage: 'done'; prUrl?: string; prNumber?: number; commitSha: string }\n | { stage: 'warning'; message: string; details?: unknown }\n | { stage: 'error'; message: string; recoverable: boolean };\n\n/** The settled outcome (the stream's return value). */\nexport interface ContributionResult {\n prUrl?: string;\n prNumber?: number;\n commitSha: string;\n treeSha: string;\n branchName: string;\n mode: 'direct-commit' | 'new-branch-pr' | 'extend-existing';\n}\n\nexport interface ContributeOptions {\n /** The commit message / PR title. */\n commitMessage: string;\n /** `'pr'` (default) opens a PR; `'direct'` commits to the branch and needs\n * the first-party `contribute:direct` capability. */\n mode?: ContributeMode;\n /** Override the generated branch name (PR mode). */\n branchName?: string;\n}\n\n/**\n * Save the current working tree, streaming each stage.\n *\n * ```ts\n * for await (const ev of contribute({ commitMessage: 'Edit post' })) {\n * if (ev.stage === 'done') console.log(ev.prUrl);\n * }\n * ```\n *\n * Yields {@link ContributionEvent}s and returns a {@link ContributionResult}.\n * Throws a `StreamError` (`.code`) if the host rejects the request — notably\n * `forbidden` when a `contribute:any` app asks for `mode: 'direct'` (T11).\n */\nexport function contribute(\n opts: ContributeOptions\n): AsyncGenerator<ContributionEvent, ContributionResult, void> {\n return protocolStream<ContributionEvent, ContributionResult>('protocol-contribute', 'run', [opts]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,4BAA+B;AA6DxB,SAAS,WACd,MAC6D;AAC7D,aAAO,sCAAsD,uBAAuB,OAAO,CAAC,IAAI,CAAC;AACnG;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** The save strategy. `direct` requires the first-party `contribute:direct`
|
|
2
|
+
* capability and a scarier consent line — a `contribute:any` app asking for it
|
|
3
|
+
* is REJECTED (`forbidden`), never silently downgraded to a PR (threat T11). */
|
|
4
|
+
type ContributeMode = 'pr' | 'direct';
|
|
5
|
+
/** A stage emitted as the contribution runs. Mirrors the host orchestrator's
|
|
6
|
+
* event union; carries progress metadata only — never the token or file blobs. */
|
|
7
|
+
type ContributionEvent = {
|
|
8
|
+
stage: 'auth-check';
|
|
9
|
+
} | {
|
|
10
|
+
stage: 'diff-compute';
|
|
11
|
+
} | {
|
|
12
|
+
stage: 'permission-check';
|
|
13
|
+
} | {
|
|
14
|
+
stage: 'install-required';
|
|
15
|
+
targetOwner: string;
|
|
16
|
+
targetRepo: string;
|
|
17
|
+
installUrl: string;
|
|
18
|
+
} | {
|
|
19
|
+
stage: 'conflict-check';
|
|
20
|
+
} | {
|
|
21
|
+
stage: 'fork-prepare';
|
|
22
|
+
forkOwner: string;
|
|
23
|
+
alreadyExists: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
stage: 'upload-blob';
|
|
26
|
+
path: string;
|
|
27
|
+
index: number;
|
|
28
|
+
total: number;
|
|
29
|
+
} | {
|
|
30
|
+
stage: 'create-tree';
|
|
31
|
+
} | {
|
|
32
|
+
stage: 'create-commit';
|
|
33
|
+
} | {
|
|
34
|
+
stage: 'create-branch';
|
|
35
|
+
branchName: string;
|
|
36
|
+
} | {
|
|
37
|
+
stage: 'create-pr';
|
|
38
|
+
} | {
|
|
39
|
+
stage: 'pr-updated';
|
|
40
|
+
prNumber: number;
|
|
41
|
+
prUrl: string;
|
|
42
|
+
commitSha: string;
|
|
43
|
+
} | {
|
|
44
|
+
stage: 'commit-pushed';
|
|
45
|
+
ref: string;
|
|
46
|
+
commitSha: string;
|
|
47
|
+
} | {
|
|
48
|
+
stage: 'switch-branch';
|
|
49
|
+
provider: 'github';
|
|
50
|
+
pushOwner: string;
|
|
51
|
+
repository: string;
|
|
52
|
+
branchName: string;
|
|
53
|
+
} | {
|
|
54
|
+
stage: 'done';
|
|
55
|
+
prUrl?: string;
|
|
56
|
+
prNumber?: number;
|
|
57
|
+
commitSha: string;
|
|
58
|
+
} | {
|
|
59
|
+
stage: 'warning';
|
|
60
|
+
message: string;
|
|
61
|
+
details?: unknown;
|
|
62
|
+
} | {
|
|
63
|
+
stage: 'error';
|
|
64
|
+
message: string;
|
|
65
|
+
recoverable: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** The settled outcome (the stream's return value). */
|
|
68
|
+
interface ContributionResult {
|
|
69
|
+
prUrl?: string;
|
|
70
|
+
prNumber?: number;
|
|
71
|
+
commitSha: string;
|
|
72
|
+
treeSha: string;
|
|
73
|
+
branchName: string;
|
|
74
|
+
mode: 'direct-commit' | 'new-branch-pr' | 'extend-existing';
|
|
75
|
+
}
|
|
76
|
+
interface ContributeOptions {
|
|
77
|
+
/** The commit message / PR title. */
|
|
78
|
+
commitMessage: string;
|
|
79
|
+
/** `'pr'` (default) opens a PR; `'direct'` commits to the branch and needs
|
|
80
|
+
* the first-party `contribute:direct` capability. */
|
|
81
|
+
mode?: ContributeMode;
|
|
82
|
+
/** Override the generated branch name (PR mode). */
|
|
83
|
+
branchName?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Save the current working tree, streaming each stage.
|
|
87
|
+
*
|
|
88
|
+
* ```ts
|
|
89
|
+
* for await (const ev of contribute({ commitMessage: 'Edit post' })) {
|
|
90
|
+
* if (ev.stage === 'done') console.log(ev.prUrl);
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* Yields {@link ContributionEvent}s and returns a {@link ContributionResult}.
|
|
95
|
+
* Throws a `StreamError` (`.code`) if the host rejects the request — notably
|
|
96
|
+
* `forbidden` when a `contribute:any` app asks for `mode: 'direct'` (T11).
|
|
97
|
+
*/
|
|
98
|
+
declare function contribute(opts: ContributeOptions): AsyncGenerator<ContributionEvent, ContributionResult, void>;
|
|
99
|
+
|
|
100
|
+
export { type ContributeMode, type ContributeOptions, type ContributionEvent, type ContributionResult, contribute };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** The save strategy. `direct` requires the first-party `contribute:direct`
|
|
2
|
+
* capability and a scarier consent line — a `contribute:any` app asking for it
|
|
3
|
+
* is REJECTED (`forbidden`), never silently downgraded to a PR (threat T11). */
|
|
4
|
+
type ContributeMode = 'pr' | 'direct';
|
|
5
|
+
/** A stage emitted as the contribution runs. Mirrors the host orchestrator's
|
|
6
|
+
* event union; carries progress metadata only — never the token or file blobs. */
|
|
7
|
+
type ContributionEvent = {
|
|
8
|
+
stage: 'auth-check';
|
|
9
|
+
} | {
|
|
10
|
+
stage: 'diff-compute';
|
|
11
|
+
} | {
|
|
12
|
+
stage: 'permission-check';
|
|
13
|
+
} | {
|
|
14
|
+
stage: 'install-required';
|
|
15
|
+
targetOwner: string;
|
|
16
|
+
targetRepo: string;
|
|
17
|
+
installUrl: string;
|
|
18
|
+
} | {
|
|
19
|
+
stage: 'conflict-check';
|
|
20
|
+
} | {
|
|
21
|
+
stage: 'fork-prepare';
|
|
22
|
+
forkOwner: string;
|
|
23
|
+
alreadyExists: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
stage: 'upload-blob';
|
|
26
|
+
path: string;
|
|
27
|
+
index: number;
|
|
28
|
+
total: number;
|
|
29
|
+
} | {
|
|
30
|
+
stage: 'create-tree';
|
|
31
|
+
} | {
|
|
32
|
+
stage: 'create-commit';
|
|
33
|
+
} | {
|
|
34
|
+
stage: 'create-branch';
|
|
35
|
+
branchName: string;
|
|
36
|
+
} | {
|
|
37
|
+
stage: 'create-pr';
|
|
38
|
+
} | {
|
|
39
|
+
stage: 'pr-updated';
|
|
40
|
+
prNumber: number;
|
|
41
|
+
prUrl: string;
|
|
42
|
+
commitSha: string;
|
|
43
|
+
} | {
|
|
44
|
+
stage: 'commit-pushed';
|
|
45
|
+
ref: string;
|
|
46
|
+
commitSha: string;
|
|
47
|
+
} | {
|
|
48
|
+
stage: 'switch-branch';
|
|
49
|
+
provider: 'github';
|
|
50
|
+
pushOwner: string;
|
|
51
|
+
repository: string;
|
|
52
|
+
branchName: string;
|
|
53
|
+
} | {
|
|
54
|
+
stage: 'done';
|
|
55
|
+
prUrl?: string;
|
|
56
|
+
prNumber?: number;
|
|
57
|
+
commitSha: string;
|
|
58
|
+
} | {
|
|
59
|
+
stage: 'warning';
|
|
60
|
+
message: string;
|
|
61
|
+
details?: unknown;
|
|
62
|
+
} | {
|
|
63
|
+
stage: 'error';
|
|
64
|
+
message: string;
|
|
65
|
+
recoverable: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** The settled outcome (the stream's return value). */
|
|
68
|
+
interface ContributionResult {
|
|
69
|
+
prUrl?: string;
|
|
70
|
+
prNumber?: number;
|
|
71
|
+
commitSha: string;
|
|
72
|
+
treeSha: string;
|
|
73
|
+
branchName: string;
|
|
74
|
+
mode: 'direct-commit' | 'new-branch-pr' | 'extend-existing';
|
|
75
|
+
}
|
|
76
|
+
interface ContributeOptions {
|
|
77
|
+
/** The commit message / PR title. */
|
|
78
|
+
commitMessage: string;
|
|
79
|
+
/** `'pr'` (default) opens a PR; `'direct'` commits to the branch and needs
|
|
80
|
+
* the first-party `contribute:direct` capability. */
|
|
81
|
+
mode?: ContributeMode;
|
|
82
|
+
/** Override the generated branch name (PR mode). */
|
|
83
|
+
branchName?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Save the current working tree, streaming each stage.
|
|
87
|
+
*
|
|
88
|
+
* ```ts
|
|
89
|
+
* for await (const ev of contribute({ commitMessage: 'Edit post' })) {
|
|
90
|
+
* if (ev.stage === 'done') console.log(ev.prUrl);
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* Yields {@link ContributionEvent}s and returns a {@link ContributionResult}.
|
|
95
|
+
* Throws a `StreamError` (`.code`) if the host rejects the request — notably
|
|
96
|
+
* `forbidden` when a `contribute:any` app asks for `mode: 'direct'` (T11).
|
|
97
|
+
*/
|
|
98
|
+
declare function contribute(opts: ContributeOptions): AsyncGenerator<ContributionEvent, ContributionResult, void>;
|
|
99
|
+
|
|
100
|
+
export { type ContributeMode, type ContributeOptions, type ContributionEvent, type ContributionResult, contribute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contribute.ts"],"sourcesContent":["// Contribute — stream a save (PR or direct commit) from app code\n// (UI_AS_APPS_SPEC §5.1, CONTRIBUTE_SPEC). The host runs the *existing*\n// contribution orchestrator and streams its stages back; this is the typed\n// front door over `protocolStream`.\n//\n// The OAuth token never reaches here — it stays on the host. The app passes a\n// commit message + save mode and watches stages go by; the host owns the token,\n// the GitHub API calls, and the user-facing consent.\nimport { protocolStream } from './protocolStream';\n\n/** The save strategy. `direct` requires the first-party `contribute:direct`\n * capability and a scarier consent line — a `contribute:any` app asking for it\n * is REJECTED (`forbidden`), never silently downgraded to a PR (threat T11). */\nexport type ContributeMode = 'pr' | 'direct';\n\n/** A stage emitted as the contribution runs. Mirrors the host orchestrator's\n * event union; carries progress metadata only — never the token or file blobs. */\nexport type ContributionEvent =\n | { stage: 'auth-check' }\n | { stage: 'diff-compute' }\n | { stage: 'permission-check' }\n | { stage: 'install-required'; targetOwner: string; targetRepo: string; installUrl: string }\n | { stage: 'conflict-check' }\n | { stage: 'fork-prepare'; forkOwner: string; alreadyExists: boolean }\n | { stage: 'upload-blob'; path: string; index: number; total: number }\n | { stage: 'create-tree' }\n | { stage: 'create-commit' }\n | { stage: 'create-branch'; branchName: string }\n | { stage: 'create-pr' }\n | { stage: 'pr-updated'; prNumber: number; prUrl: string; commitSha: string }\n | { stage: 'commit-pushed'; ref: string; commitSha: string }\n | { stage: 'switch-branch'; provider: 'github'; pushOwner: string; repository: string; branchName: string }\n | { stage: 'done'; prUrl?: string; prNumber?: number; commitSha: string }\n | { stage: 'warning'; message: string; details?: unknown }\n | { stage: 'error'; message: string; recoverable: boolean };\n\n/** The settled outcome (the stream's return value). */\nexport interface ContributionResult {\n prUrl?: string;\n prNumber?: number;\n commitSha: string;\n treeSha: string;\n branchName: string;\n mode: 'direct-commit' | 'new-branch-pr' | 'extend-existing';\n}\n\nexport interface ContributeOptions {\n /** The commit message / PR title. */\n commitMessage: string;\n /** `'pr'` (default) opens a PR; `'direct'` commits to the branch and needs\n * the first-party `contribute:direct` capability. */\n mode?: ContributeMode;\n /** Override the generated branch name (PR mode). */\n branchName?: string;\n}\n\n/**\n * Save the current working tree, streaming each stage.\n *\n * ```ts\n * for await (const ev of contribute({ commitMessage: 'Edit post' })) {\n * if (ev.stage === 'done') console.log(ev.prUrl);\n * }\n * ```\n *\n * Yields {@link ContributionEvent}s and returns a {@link ContributionResult}.\n * Throws a `StreamError` (`.code`) if the host rejects the request — notably\n * `forbidden` when a `contribute:any` app asks for `mode: 'direct'` (T11).\n */\nexport function contribute(\n opts: ContributeOptions\n): AsyncGenerator<ContributionEvent, ContributionResult, void> {\n return protocolStream<ContributionEvent, ContributionResult>('protocol-contribute', 'run', [opts]);\n}\n"],"mappings":"AAQA,SAAS,sBAAsB;AA6DxB,SAAS,WACd,MAC6D;AAC7D,SAAO,eAAsD,uBAAuB,OAAO,CAAC,IAAI,CAAC;AACnG;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var editorContext_exports = {};
|
|
20
|
+
__export(editorContext_exports, {
|
|
21
|
+
getEditorContext: () => getEditorContext,
|
|
22
|
+
onEditorContextChange: () => onEditorContextChange,
|
|
23
|
+
useEditorContext: () => useEditorContext
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(editorContext_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const editorContextService = () => {
|
|
28
|
+
return module.evaluation.module.bundler.editorContext;
|
|
29
|
+
};
|
|
30
|
+
const getEditorContext = () => editorContextService().getContext();
|
|
31
|
+
const onEditorContextChange = (listener) => {
|
|
32
|
+
const disposable = editorContextService().onChange(listener);
|
|
33
|
+
return () => disposable.dispose();
|
|
34
|
+
};
|
|
35
|
+
const useEditorContext = () => {
|
|
36
|
+
const [context, setContext] = (0, import_react.useState)(getEditorContext);
|
|
37
|
+
(0, import_react.useEffect)(() => onEditorContextChange(setContext), []);
|
|
38
|
+
return context;
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
getEditorContext,
|
|
43
|
+
onEditorContextChange,
|
|
44
|
+
useEditorContext
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=editorContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/editorContext.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * The editor \"dirty set\" mirrored from the immediately.run host into the sandbox\n * (UI_AS_APPS_SPEC §5.3): which files the user has changed but not yet saved.\n *\n * This is the ELEVATED `editor:read` capability — only a system app whose binding\n * grants it (e.g. the contribute dialog) receives it. The active file and ref are\n * already available to every app via routing (`useNavigationState`), so this\n * channel carries only the genuine delta: the unsaved paths. An app without\n * `editor:read` simply sees an empty dirty set.\n */\nexport interface EditorContext {\n /** Repo-relative paths the user has modified but not yet saved. */\n dirtyPaths: string[];\n}\n\ninterface EditorContextService {\n getContext(): EditorContext;\n onChange(listener: (context: EditorContext) => void): { dispose(): void };\n}\n\n// `module.evaluation.module.bundler.editorContext` is the sandbox bundler service\n// injected into the evaluation context (same path the other SDK helpers use).\nconst editorContextService = (): EditorContextService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.editorContext;\n};\n\n/**\n * Returns the current editor context (dirty set). Poll this for a one-off read;\n * use {@link onEditorContextChange} or {@link useEditorContext} to react.\n */\nexport const getEditorContext = (): EditorContext => editorContextService().getContext();\n\n/**\n * Subscribe to editor-context changes. The listener is invoked immediately with\n * the current context, then again on every change. Returns an unsubscribe fn.\n */\nexport const onEditorContextChange = (\n listener: (context: EditorContext) => void,\n): (() => void) => {\n const disposable = editorContextService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/**\n * React hook returning the current editor context (dirty set), re-rendering when\n * it changes. Handy for a contribute dialog: `const { dirtyPaths } =\n * useEditorContext()` to show \"you'll save N files\" before calling `contribute()`.\n */\nexport const useEditorContext = (): EditorContext => {\n const [context, setContext] = useState<EditorContext>(getEditorContext);\n useEffect(() => onEditorContextChange(setContext), []);\n return context;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAwBpC,MAAM,uBAAuB,MAA4B;AAEvD,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAMO,MAAM,mBAAmB,MAAqB,qBAAqB,EAAE,WAAW;AAMhF,MAAM,wBAAwB,CACnC,aACiB;AACjB,QAAM,aAAa,qBAAqB,EAAE,SAAS,QAAQ;AAC3D,SAAO,MAAM,WAAW,QAAQ;AAClC;AAOO,MAAM,mBAAmB,MAAqB;AACnD,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAwB,gBAAgB;AACtE,8BAAU,MAAM,sBAAsB,UAAU,GAAG,CAAC,CAAC;AACrD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor "dirty set" mirrored from the immediately.run host into the sandbox
|
|
3
|
+
* (UI_AS_APPS_SPEC §5.3): which files the user has changed but not yet saved.
|
|
4
|
+
*
|
|
5
|
+
* This is the ELEVATED `editor:read` capability — only a system app whose binding
|
|
6
|
+
* grants it (e.g. the contribute dialog) receives it. The active file and ref are
|
|
7
|
+
* already available to every app via routing (`useNavigationState`), so this
|
|
8
|
+
* channel carries only the genuine delta: the unsaved paths. An app without
|
|
9
|
+
* `editor:read` simply sees an empty dirty set.
|
|
10
|
+
*/
|
|
11
|
+
interface EditorContext {
|
|
12
|
+
/** Repo-relative paths the user has modified but not yet saved. */
|
|
13
|
+
dirtyPaths: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the current editor context (dirty set). Poll this for a one-off read;
|
|
17
|
+
* use {@link onEditorContextChange} or {@link useEditorContext} to react.
|
|
18
|
+
*/
|
|
19
|
+
declare const getEditorContext: () => EditorContext;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to editor-context changes. The listener is invoked immediately with
|
|
22
|
+
* the current context, then again on every change. Returns an unsubscribe fn.
|
|
23
|
+
*/
|
|
24
|
+
declare const onEditorContextChange: (listener: (context: EditorContext) => void) => (() => void);
|
|
25
|
+
/**
|
|
26
|
+
* React hook returning the current editor context (dirty set), re-rendering when
|
|
27
|
+
* it changes. Handy for a contribute dialog: `const { dirtyPaths } =
|
|
28
|
+
* useEditorContext()` to show "you'll save N files" before calling `contribute()`.
|
|
29
|
+
*/
|
|
30
|
+
declare const useEditorContext: () => EditorContext;
|
|
31
|
+
|
|
32
|
+
export { type EditorContext, getEditorContext, onEditorContextChange, useEditorContext };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor "dirty set" mirrored from the immediately.run host into the sandbox
|
|
3
|
+
* (UI_AS_APPS_SPEC §5.3): which files the user has changed but not yet saved.
|
|
4
|
+
*
|
|
5
|
+
* This is the ELEVATED `editor:read` capability — only a system app whose binding
|
|
6
|
+
* grants it (e.g. the contribute dialog) receives it. The active file and ref are
|
|
7
|
+
* already available to every app via routing (`useNavigationState`), so this
|
|
8
|
+
* channel carries only the genuine delta: the unsaved paths. An app without
|
|
9
|
+
* `editor:read` simply sees an empty dirty set.
|
|
10
|
+
*/
|
|
11
|
+
interface EditorContext {
|
|
12
|
+
/** Repo-relative paths the user has modified but not yet saved. */
|
|
13
|
+
dirtyPaths: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the current editor context (dirty set). Poll this for a one-off read;
|
|
17
|
+
* use {@link onEditorContextChange} or {@link useEditorContext} to react.
|
|
18
|
+
*/
|
|
19
|
+
declare const getEditorContext: () => EditorContext;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to editor-context changes. The listener is invoked immediately with
|
|
22
|
+
* the current context, then again on every change. Returns an unsubscribe fn.
|
|
23
|
+
*/
|
|
24
|
+
declare const onEditorContextChange: (listener: (context: EditorContext) => void) => (() => void);
|
|
25
|
+
/**
|
|
26
|
+
* React hook returning the current editor context (dirty set), re-rendering when
|
|
27
|
+
* it changes. Handy for a contribute dialog: `const { dirtyPaths } =
|
|
28
|
+
* useEditorContext()` to show "you'll save N files" before calling `contribute()`.
|
|
29
|
+
*/
|
|
30
|
+
declare const useEditorContext: () => EditorContext;
|
|
31
|
+
|
|
32
|
+
export { type EditorContext, getEditorContext, onEditorContextChange, useEditorContext };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
const editorContextService = () => {
|
|
3
|
+
return module.evaluation.module.bundler.editorContext;
|
|
4
|
+
};
|
|
5
|
+
const getEditorContext = () => editorContextService().getContext();
|
|
6
|
+
const onEditorContextChange = (listener) => {
|
|
7
|
+
const disposable = editorContextService().onChange(listener);
|
|
8
|
+
return () => disposable.dispose();
|
|
9
|
+
};
|
|
10
|
+
const useEditorContext = () => {
|
|
11
|
+
const [context, setContext] = useState(getEditorContext);
|
|
12
|
+
useEffect(() => onEditorContextChange(setContext), []);
|
|
13
|
+
return context;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getEditorContext,
|
|
17
|
+
onEditorContextChange,
|
|
18
|
+
useEditorContext
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=editorContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/editorContext.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * The editor \"dirty set\" mirrored from the immediately.run host into the sandbox\n * (UI_AS_APPS_SPEC §5.3): which files the user has changed but not yet saved.\n *\n * This is the ELEVATED `editor:read` capability — only a system app whose binding\n * grants it (e.g. the contribute dialog) receives it. The active file and ref are\n * already available to every app via routing (`useNavigationState`), so this\n * channel carries only the genuine delta: the unsaved paths. An app without\n * `editor:read` simply sees an empty dirty set.\n */\nexport interface EditorContext {\n /** Repo-relative paths the user has modified but not yet saved. */\n dirtyPaths: string[];\n}\n\ninterface EditorContextService {\n getContext(): EditorContext;\n onChange(listener: (context: EditorContext) => void): { dispose(): void };\n}\n\n// `module.evaluation.module.bundler.editorContext` is the sandbox bundler service\n// injected into the evaluation context (same path the other SDK helpers use).\nconst editorContextService = (): EditorContextService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.editorContext;\n};\n\n/**\n * Returns the current editor context (dirty set). Poll this for a one-off read;\n * use {@link onEditorContextChange} or {@link useEditorContext} to react.\n */\nexport const getEditorContext = (): EditorContext => editorContextService().getContext();\n\n/**\n * Subscribe to editor-context changes. The listener is invoked immediately with\n * the current context, then again on every change. Returns an unsubscribe fn.\n */\nexport const onEditorContextChange = (\n listener: (context: EditorContext) => void,\n): (() => void) => {\n const disposable = editorContextService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/**\n * React hook returning the current editor context (dirty set), re-rendering when\n * it changes. Handy for a contribute dialog: `const { dirtyPaths } =\n * useEditorContext()` to show \"you'll save N files\" before calling `contribute()`.\n */\nexport const useEditorContext = (): EditorContext => {\n const [context, setContext] = useState<EditorContext>(getEditorContext);\n useEffect(() => onEditorContextChange(setContext), []);\n return context;\n};\n"],"mappings":"AAAA,SAAS,WAAW,gBAAgB;AAwBpC,MAAM,uBAAuB,MAA4B;AAEvD,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAMO,MAAM,mBAAmB,MAAqB,qBAAqB,EAAE,WAAW;AAMhF,MAAM,wBAAwB,CACnC,aACiB;AACjB,QAAM,aAAa,qBAAqB,EAAE,SAAS,QAAQ;AAC3D,SAAO,MAAM,WAAW,QAAQ;AAClC;AAOO,MAAM,mBAAmB,MAAqB;AACnD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAwB,gBAAgB;AACtE,YAAU,MAAM,sBAAsB,UAAU,GAAG,CAAC,CAAC;AACrD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var formFactor_exports = {};
|
|
20
|
+
__export(formFactor_exports, {
|
|
21
|
+
getFormFactor: () => getFormFactor,
|
|
22
|
+
onFormFactorChange: () => onFormFactorChange,
|
|
23
|
+
useFormFactor: () => useFormFactor
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(formFactor_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const formFactorService = () => {
|
|
28
|
+
return module.evaluation.module.bundler.formFactor;
|
|
29
|
+
};
|
|
30
|
+
const getFormFactor = () => formFactorService().getFormFactor();
|
|
31
|
+
const onFormFactorChange = (listener) => {
|
|
32
|
+
const disposable = formFactorService().onChange(listener);
|
|
33
|
+
return () => disposable.dispose();
|
|
34
|
+
};
|
|
35
|
+
const useFormFactor = () => {
|
|
36
|
+
const [ff, setFf] = (0, import_react.useState)(getFormFactor);
|
|
37
|
+
(0, import_react.useEffect)(() => onFormFactorChange(setFf), []);
|
|
38
|
+
return ff;
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
getFormFactor,
|
|
43
|
+
onFormFactorChange,
|
|
44
|
+
useFormFactor
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=formFactor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/formFactor.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * The form factor of the surface your app is rendered into, mirrored from the\n * immediately.run host (UI_AS_APPS_SPEC §5.4.1). Read this to lay out\n * responsively — a narrow chrome panel, a full preview, or a mobile carousel\n * pane all report their box here. The host is the source of truth (it owns the\n * region); you cannot reliably measure your own viewport across the sandbox\n * boundary.\n *\n * Baseline capability `formFactor:read` — every app may read it.\n */\nexport type FormFactorClass = 'mobile' | 'tablet' | 'desktop';\nexport type Orientation = 'portrait' | 'landscape';\n\nexport interface FormFactor {\n class: FormFactorClass;\n orientation: Orientation;\n width: number;\n height: number;\n}\n\ninterface FormFactorService {\n getFormFactor(): FormFactor;\n onChange(listener: (formFactor: FormFactor) => void): { dispose(): void };\n}\n\nconst formFactorService = (): FormFactorService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.formFactor;\n};\n\n/** Returns the current form factor. Poll for a one-off read. */\nexport const getFormFactor = (): FormFactor =>\n formFactorService().getFormFactor();\n\n/**\n * Subscribe to form-factor changes. The listener is invoked immediately with\n * the current value, then again on every change. Returns an unsubscribe fn.\n */\nexport const onFormFactorChange = (\n listener: (formFactor: FormFactor) => void,\n): (() => void) => {\n const disposable = formFactorService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/** React hook returning the current form factor, re-rendering on change. */\nexport const useFormFactor = (): FormFactor => {\n const [ff, setFf] = useState<FormFactor>(getFormFactor);\n useEffect(() => onFormFactorChange(setFf), []);\n return ff;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AA2BpC,MAAM,oBAAoB,MAAyB;AAEjD,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAGO,MAAM,gBAAgB,MAC3B,kBAAkB,EAAE,cAAc;AAM7B,MAAM,qBAAqB,CAChC,aACiB;AACjB,QAAM,aAAa,kBAAkB,EAAE,SAAS,QAAQ;AACxD,SAAO,MAAM,WAAW,QAAQ;AAClC;AAGO,MAAM,gBAAgB,MAAkB;AAC7C,QAAM,CAAC,IAAI,KAAK,QAAI,uBAAqB,aAAa;AACtD,8BAAU,MAAM,mBAAmB,KAAK,GAAG,CAAC,CAAC;AAC7C,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The form factor of the surface your app is rendered into, mirrored from the
|
|
3
|
+
* immediately.run host (UI_AS_APPS_SPEC §5.4.1). Read this to lay out
|
|
4
|
+
* responsively — a narrow chrome panel, a full preview, or a mobile carousel
|
|
5
|
+
* pane all report their box here. The host is the source of truth (it owns the
|
|
6
|
+
* region); you cannot reliably measure your own viewport across the sandbox
|
|
7
|
+
* boundary.
|
|
8
|
+
*
|
|
9
|
+
* Baseline capability `formFactor:read` — every app may read it.
|
|
10
|
+
*/
|
|
11
|
+
type FormFactorClass = 'mobile' | 'tablet' | 'desktop';
|
|
12
|
+
type Orientation = 'portrait' | 'landscape';
|
|
13
|
+
interface FormFactor {
|
|
14
|
+
class: FormFactorClass;
|
|
15
|
+
orientation: Orientation;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
/** Returns the current form factor. Poll for a one-off read. */
|
|
20
|
+
declare const getFormFactor: () => FormFactor;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to form-factor changes. The listener is invoked immediately with
|
|
23
|
+
* the current value, then again on every change. Returns an unsubscribe fn.
|
|
24
|
+
*/
|
|
25
|
+
declare const onFormFactorChange: (listener: (formFactor: FormFactor) => void) => (() => void);
|
|
26
|
+
/** React hook returning the current form factor, re-rendering on change. */
|
|
27
|
+
declare const useFormFactor: () => FormFactor;
|
|
28
|
+
|
|
29
|
+
export { type FormFactor, type FormFactorClass, type Orientation, getFormFactor, onFormFactorChange, useFormFactor };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The form factor of the surface your app is rendered into, mirrored from the
|
|
3
|
+
* immediately.run host (UI_AS_APPS_SPEC §5.4.1). Read this to lay out
|
|
4
|
+
* responsively — a narrow chrome panel, a full preview, or a mobile carousel
|
|
5
|
+
* pane all report their box here. The host is the source of truth (it owns the
|
|
6
|
+
* region); you cannot reliably measure your own viewport across the sandbox
|
|
7
|
+
* boundary.
|
|
8
|
+
*
|
|
9
|
+
* Baseline capability `formFactor:read` — every app may read it.
|
|
10
|
+
*/
|
|
11
|
+
type FormFactorClass = 'mobile' | 'tablet' | 'desktop';
|
|
12
|
+
type Orientation = 'portrait' | 'landscape';
|
|
13
|
+
interface FormFactor {
|
|
14
|
+
class: FormFactorClass;
|
|
15
|
+
orientation: Orientation;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
/** Returns the current form factor. Poll for a one-off read. */
|
|
20
|
+
declare const getFormFactor: () => FormFactor;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to form-factor changes. The listener is invoked immediately with
|
|
23
|
+
* the current value, then again on every change. Returns an unsubscribe fn.
|
|
24
|
+
*/
|
|
25
|
+
declare const onFormFactorChange: (listener: (formFactor: FormFactor) => void) => (() => void);
|
|
26
|
+
/** React hook returning the current form factor, re-rendering on change. */
|
|
27
|
+
declare const useFormFactor: () => FormFactor;
|
|
28
|
+
|
|
29
|
+
export { type FormFactor, type FormFactorClass, type Orientation, getFormFactor, onFormFactorChange, useFormFactor };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
const formFactorService = () => {
|
|
3
|
+
return module.evaluation.module.bundler.formFactor;
|
|
4
|
+
};
|
|
5
|
+
const getFormFactor = () => formFactorService().getFormFactor();
|
|
6
|
+
const onFormFactorChange = (listener) => {
|
|
7
|
+
const disposable = formFactorService().onChange(listener);
|
|
8
|
+
return () => disposable.dispose();
|
|
9
|
+
};
|
|
10
|
+
const useFormFactor = () => {
|
|
11
|
+
const [ff, setFf] = useState(getFormFactor);
|
|
12
|
+
useEffect(() => onFormFactorChange(setFf), []);
|
|
13
|
+
return ff;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getFormFactor,
|
|
17
|
+
onFormFactorChange,
|
|
18
|
+
useFormFactor
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=formFactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/formFactor.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * The form factor of the surface your app is rendered into, mirrored from the\n * immediately.run host (UI_AS_APPS_SPEC §5.4.1). Read this to lay out\n * responsively — a narrow chrome panel, a full preview, or a mobile carousel\n * pane all report their box here. The host is the source of truth (it owns the\n * region); you cannot reliably measure your own viewport across the sandbox\n * boundary.\n *\n * Baseline capability `formFactor:read` — every app may read it.\n */\nexport type FormFactorClass = 'mobile' | 'tablet' | 'desktop';\nexport type Orientation = 'portrait' | 'landscape';\n\nexport interface FormFactor {\n class: FormFactorClass;\n orientation: Orientation;\n width: number;\n height: number;\n}\n\ninterface FormFactorService {\n getFormFactor(): FormFactor;\n onChange(listener: (formFactor: FormFactor) => void): { dispose(): void };\n}\n\nconst formFactorService = (): FormFactorService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.formFactor;\n};\n\n/** Returns the current form factor. Poll for a one-off read. */\nexport const getFormFactor = (): FormFactor =>\n formFactorService().getFormFactor();\n\n/**\n * Subscribe to form-factor changes. The listener is invoked immediately with\n * the current value, then again on every change. Returns an unsubscribe fn.\n */\nexport const onFormFactorChange = (\n listener: (formFactor: FormFactor) => void,\n): (() => void) => {\n const disposable = formFactorService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/** React hook returning the current form factor, re-rendering on change. */\nexport const useFormFactor = (): FormFactor => {\n const [ff, setFf] = useState<FormFactor>(getFormFactor);\n useEffect(() => onFormFactorChange(setFf), []);\n return ff;\n};\n"],"mappings":"AAAA,SAAS,WAAW,gBAAgB;AA2BpC,MAAM,oBAAoB,MAAyB;AAEjD,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAGO,MAAM,gBAAgB,MAC3B,kBAAkB,EAAE,cAAc;AAM7B,MAAM,qBAAqB,CAChC,aACiB;AACjB,QAAM,aAAa,kBAAkB,EAAE,SAAS,QAAQ;AACxD,SAAO,MAAM,WAAW,QAAQ;AAClC;AAGO,MAAM,gBAAgB,MAAkB;AAC7C,QAAM,CAAC,IAAI,KAAK,IAAI,SAAqB,aAAa;AACtD,YAAU,MAAM,mBAAmB,KAAK,GAAG,CAAC,CAAC;AAC7C,SAAO;AACT;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -22,7 +22,12 @@ __reExport(index_exports, require("./components/Include"), module.exports);
|
|
|
22
22
|
__reExport(index_exports, require("./components/MDXComponents"), module.exports);
|
|
23
23
|
__reExport(index_exports, require("./hooks"), module.exports);
|
|
24
24
|
__reExport(index_exports, require("./auth"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./theme"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./editorContext"), module.exports);
|
|
27
|
+
__reExport(index_exports, require("./formFactor"), module.exports);
|
|
25
28
|
__reExport(index_exports, require("./mounts"), module.exports);
|
|
29
|
+
__reExport(index_exports, require("./contribute"), module.exports);
|
|
30
|
+
__reExport(index_exports, require("./protocolStream"), module.exports);
|
|
26
31
|
__reExport(index_exports, require("./sandboxTypes"), module.exports);
|
|
27
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
33
|
0 && (module.exports = {
|
|
@@ -33,7 +38,12 @@ __reExport(index_exports, require("./sandboxTypes"), module.exports);
|
|
|
33
38
|
...require("./components/MDXComponents"),
|
|
34
39
|
...require("./hooks"),
|
|
35
40
|
...require("./auth"),
|
|
41
|
+
...require("./theme"),
|
|
42
|
+
...require("./editorContext"),
|
|
43
|
+
...require("./formFactor"),
|
|
36
44
|
...require("./mounts"),
|
|
45
|
+
...require("./contribute"),
|
|
46
|
+
...require("./protocolStream"),
|
|
37
47
|
...require("./sandboxTypes")
|
|
38
48
|
});
|
|
39
49
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './mounts';\nexport * from './sandboxTypes';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAIA,0BAAc,uCAJd;AAKA,0BAAc,oBALd;AAMA,0BAAc,mBANd;AAOA,0BAAc,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAIA,0BAAc,uCAJd;AAKA,0BAAc,oBALd;AAMA,0BAAc,mBANd;AAOA,0BAAc,oBAPd;AAQA,0BAAc,4BARd;AASA,0BAAc,yBATd;AAUA,0BAAc,qBAVd;AAWA,0BAAc,yBAXd;AAYA,0BAAc,6BAZd;AAaA,0BAAc,2BAbd;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,12 @@ export { Include, RenderExportedComponent, RenderExportedComponentContext, Rende
|
|
|
5
5
|
export { DEFAULT_MDX_COMPONENTS, InternalLink, Link } from './components/MDXComponents.cjs';
|
|
6
6
|
export { useFileMetadata, useMetadataQuery } from './hooks.cjs';
|
|
7
7
|
export { AuthState, AuthStatus, SandboxUser, getAuthState, onAuthChange, useAuth } from './auth.cjs';
|
|
8
|
-
export {
|
|
8
|
+
export { HostTheme, getHostTheme, onHostThemeChange, setHostTheme, useHostTheme } from './theme.cjs';
|
|
9
|
+
export { EditorContext, getEditorContext, onEditorContextChange, useEditorContext } from './editorContext.cjs';
|
|
10
|
+
export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.cjs';
|
|
11
|
+
export { MountQuery, SandboxMount, SpaceError, SpaceInfo, createSpace, findMount, getMounts, listSpaces, mount, mountSpace, onMountsChange, openAppSpace, requestMount, requestSpace, unmountSpace, useMounts, waitForMount } from './mounts.cjs';
|
|
12
|
+
export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.cjs';
|
|
13
|
+
export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.cjs';
|
|
9
14
|
export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.cjs';
|
|
10
15
|
import 'react';
|
|
11
16
|
import './TinkerableContext.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,12 @@ export { Include, RenderExportedComponent, RenderExportedComponentContext, Rende
|
|
|
5
5
|
export { DEFAULT_MDX_COMPONENTS, InternalLink, Link } from './components/MDXComponents.js';
|
|
6
6
|
export { useFileMetadata, useMetadataQuery } from './hooks.js';
|
|
7
7
|
export { AuthState, AuthStatus, SandboxUser, getAuthState, onAuthChange, useAuth } from './auth.js';
|
|
8
|
-
export {
|
|
8
|
+
export { HostTheme, getHostTheme, onHostThemeChange, setHostTheme, useHostTheme } from './theme.js';
|
|
9
|
+
export { EditorContext, getEditorContext, onEditorContextChange, useEditorContext } from './editorContext.js';
|
|
10
|
+
export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.js';
|
|
11
|
+
export { MountQuery, SandboxMount, SpaceError, SpaceInfo, createSpace, findMount, getMounts, listSpaces, mount, mountSpace, onMountsChange, openAppSpace, requestMount, requestSpace, unmountSpace, useMounts, waitForMount } from './mounts.js';
|
|
12
|
+
export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.js';
|
|
13
|
+
export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.js';
|
|
9
14
|
export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.js';
|
|
10
15
|
import 'react';
|
|
11
16
|
import './TinkerableContext.js';
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,11 @@ export * from "./components/Include";
|
|
|
5
5
|
export * from "./components/MDXComponents";
|
|
6
6
|
export * from "./hooks";
|
|
7
7
|
export * from "./auth";
|
|
8
|
+
export * from "./theme";
|
|
9
|
+
export * from "./editorContext";
|
|
10
|
+
export * from "./formFactor";
|
|
8
11
|
export * from "./mounts";
|
|
12
|
+
export * from "./contribute";
|
|
13
|
+
export * from "./protocolStream";
|
|
9
14
|
export * from "./sandboxTypes";
|
|
10
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './mounts';\nexport * from './sandboxTypes';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|