@jxsuite/studio 10.0.0 → 10.1.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/chunks/{2020-j56903f1.js → 2020-mkb0qa6p.js} +2 -2
- package/dist/chunks/adapter-xcpsmecx.js +4 -0
- package/dist/chunks/{add-new-flow-snx1s4b0.js → add-new-flow-ptmhmzr9.js} +3 -3
- package/dist/chunks/{cf-account-picker-xyqw0jex.js → cf-account-picker-z1sgwpwd.js} +3 -3
- package/dist/chunks/cf-settings-xqvhxxe9.js +4 -0
- package/dist/chunks/components-whsc81a7.js +4 -0
- package/dist/chunks/content-source-jwtxg78w.js +4 -0
- package/dist/chunks/{convert-to-repeater-fhdwyg14.js → convert-to-repeater-f92ey3kp.js} +3 -3
- package/dist/chunks/editor-zdqdpq1x.js +4 -0
- package/dist/chunks/entry-commands-w8p2fbpt.js +4 -0
- package/dist/chunks/{extension-sections-8ez2rrk8.js → extension-sections-y2p1te2r.js} +3 -3
- package/dist/chunks/file-ops-13ab4swj.js +4 -0
- package/dist/chunks/files-zbc8p6v1.js +4 -0
- package/dist/chunks/{format-host-zfjz4rzm.js → format-host-zjsbktbx.js} +3 -3
- package/dist/chunks/fs-events-t6x0hch6.js +4 -0
- package/dist/chunks/grid-open-fyzdwpkh.js +4 -0
- package/dist/chunks/{grid-view-ka55z38f.js → grid-view-r22jsqht.js} +5 -5
- package/dist/chunks/{iframe-host-na2mywz4.js → iframe-host-kbyqc7pt.js} +3 -3
- package/dist/chunks/index-6nvj89vb.js +4 -0
- package/dist/chunks/{index-qb98xhse.js → index-pxwwf00y.js} +2 -2
- package/dist/chunks/{javascript-ces13wny.js → javascript-pzqryby6.js} +2 -2
- package/dist/chunks/{jsonMode-6md16d4v.js → jsonMode-tcnyxyap.js} +5 -5
- package/dist/chunks/jx-validate-5sp8a4rm.js +4 -0
- package/dist/chunks/layers-panel-qrxj9vr2.js +4 -0
- package/dist/chunks/layers-tpzayggx.js +4 -0
- package/dist/chunks/lit-html-x6nrxsx3.js +4 -0
- package/dist/chunks/media-library-ywppnjrz.js +4 -0
- package/dist/chunks/media-picker-etxgc8qq.js +4 -0
- package/dist/chunks/{monaco-binding-p8j80s4w.js → monaco-binding-bqpge64f.js} +2 -2
- package/dist/chunks/monaco-buffer-qrnqhk0b.js +4 -0
- package/dist/chunks/{monaco-setup-wasktzfg.js → monaco-setup-1mkab762.js} +3 -3
- package/dist/chunks/notify-kcv38wwe.js +4 -0
- package/dist/chunks/parse-df2kkmhc.js +4 -0
- package/dist/chunks/{platform-c16mqvmp.js → platform-dtsysmyd.js} +2 -2
- package/dist/chunks/publish-panel-evb1rcxt.js +4 -0
- package/dist/chunks/{publish-quick-vr695j26.js → publish-quick-m9vkhahq.js} +3 -3
- package/dist/chunks/publish-workspace-ktk9h536.js +4 -0
- package/dist/chunks/quick-search-2f47fxcw.js +4 -0
- package/dist/chunks/references-5w6ajjv7.js +4 -0
- package/dist/chunks/right-panel-kz0a6byf.js +4 -0
- package/dist/chunks/source-control-1phx90zk.js +4 -0
- package/dist/chunks/{studio-h5tpz5ke.js → studio-07k0geap.js} +4 -4
- package/dist/chunks/{studio-7xag4na8.js → studio-0g2sm01j.js} +4 -4
- package/dist/chunks/{studio-de1s2x9v.js → studio-0hr000ba.js} +4 -4
- package/dist/chunks/{studio-35vrtpdq.js → studio-1wyp7dt5.js} +4 -4
- package/dist/chunks/{studio-34jrz12k.js → studio-20ap8dds.js} +4 -4
- package/dist/chunks/{studio-d83m0wyq.js → studio-291gqh98.js} +3 -3
- package/dist/chunks/{studio-xdpz9rpe.js → studio-37twdaf7.js} +29 -29
- package/dist/chunks/{studio-ry81j4q1.js → studio-4nkm4404.js} +4 -4
- package/dist/chunks/{studio-3v5cagy9.js → studio-4smcnv33.js} +3 -3
- package/dist/chunks/{studio-k3a8rp3d.js → studio-4zqfw5ha.js} +2 -2
- package/dist/chunks/{studio-d038kqbs.js → studio-56egy6vf.js} +4 -4
- package/dist/chunks/{studio-x3mjr5cc.js → studio-5dmgmyw4.js} +4 -4
- package/dist/chunks/{studio-x97ay0v4.js → studio-5e7p1vgd.js} +3 -3
- package/dist/chunks/{studio-ndskgqef.js → studio-5m0w815d.js} +3 -3
- package/dist/chunks/{studio-pqqq6v85.js → studio-695k95bw.js} +4 -4
- package/dist/chunks/{studio-gwrhcrss.js → studio-6vwvshw8.js} +2 -2
- package/dist/chunks/{studio-pgm83a2f.js → studio-76t560kn.js} +4 -4
- package/dist/chunks/{studio-396srjbk.js → studio-7823f0g8.js} +3 -3
- package/dist/chunks/{studio-r17asgs0.js → studio-7vb997ff.js} +4 -4
- package/dist/chunks/{studio-et2q4s8n.js → studio-8486jn4r.js} +3 -3
- package/dist/chunks/{studio-3w35qvay.js → studio-848rk4p1.js} +4 -4
- package/dist/chunks/{studio-5tzgq6fx.js → studio-8jb31dcf.js} +4 -4
- package/dist/chunks/{studio-y26hx9re.js → studio-8qejv8yf.js} +4 -4
- package/dist/chunks/{studio-h7weqf2q.js → studio-8x8616xd.js} +4 -4
- package/dist/chunks/{studio-hcsba201.js → studio-9cp96v90.js} +2 -2
- package/dist/chunks/{studio-dx73md4n.js → studio-9rcbvksg.js} +6 -6
- package/dist/chunks/{studio-m48v13s3.js → studio-a3s6frde.js} +3 -3
- package/dist/chunks/{studio-4kzbrr5t.js → studio-ahf3cspq.js} +3 -3
- package/dist/chunks/{studio-zgx7svjd.js → studio-bkmv1h3e.js} +5 -5
- package/dist/chunks/{studio-3c8pp7pb.js → studio-brdp85q7.js} +4 -4
- package/dist/chunks/{studio-yg3djpnm.js → studio-cgb97rwv.js} +4 -4
- package/dist/chunks/{studio-tj2s0tks.js → studio-ch8gt8vt.js} +3 -3
- package/dist/chunks/{studio-p1n2xjda.js → studio-cqf1k4qk.js} +4 -4
- package/dist/chunks/{studio-jttyqrmh.js → studio-cvz0e00f.js} +4 -4
- package/dist/chunks/{studio-5wzdy1jc.js → studio-dbgv4fv9.js} +14 -14
- package/dist/chunks/{studio-h310mbqm.js → studio-dy2xtt7a.js} +4 -4
- package/dist/chunks/{studio-xkxetm65.js → studio-eesyjg7h.js} +5 -5
- package/dist/chunks/studio-et6t8g4m.js +4 -0
- package/dist/chunks/{studio-cpkamjdn.js → studio-f2j9et3h.js} +8 -8
- package/dist/chunks/{studio-epenqmvk.js → studio-fep7hr66.js} +4 -4
- package/dist/chunks/{studio-2ks6ka4g.js → studio-fyf7j57j.js} +3 -3
- package/dist/chunks/{studio-rzg8hnkf.js → studio-g5prntab.js} +4 -4
- package/dist/chunks/{studio-c1pxszat.js → studio-ga77mf07.js} +4 -4
- package/dist/chunks/{studio-9cxmp61c.js → studio-ggm7zf70.js} +3 -3
- package/dist/chunks/studio-h7gy12h2.js +5 -0
- package/dist/chunks/{studio-9dz76yqc.js → studio-hsr3k06v.js} +5 -5
- package/dist/chunks/{studio-vzgmyt0v.js → studio-j933k8nr.js} +4 -4
- package/dist/chunks/studio-jgbvqcgh.js +5 -0
- package/dist/chunks/{studio-wxhy1yh7.js → studio-jh6t5qz4.js} +3 -3
- package/dist/chunks/{studio-88bmt9rh.js → studio-k4xc5g6h.js} +4 -4
- package/dist/chunks/{studio-wxdcd42g.js → studio-mwnmzx7g.js} +6 -6
- package/dist/chunks/{studio-1e8dw2w2.js → studio-nf0pqpbj.js} +4 -4
- package/dist/chunks/{studio-2j86y34y.js → studio-p0nf2e1f.js} +5 -5
- package/dist/chunks/{studio-k3bcy02e.js → studio-pd9dsqpq.js} +4 -4
- package/dist/chunks/{studio-agyvzfm4.js → studio-pmzg17fj.js} +4 -4
- package/dist/chunks/{studio-zg16eeq1.js → studio-pzfa2vmb.js} +4 -4
- package/dist/chunks/{studio-hy4ye0dx.js → studio-qyb5bebs.js} +7 -7
- package/dist/chunks/{studio-0ydxv2mr.js → studio-rf8d6p9f.js} +6 -6
- package/dist/chunks/{studio-45gyxpcq.js → studio-rt498t2v.js} +4 -4
- package/dist/chunks/studio-sd07xva5.js +6 -0
- package/dist/chunks/{studio-06j4en5h.js → studio-skynbac3.js} +2 -2
- package/dist/chunks/{studio-vswcpzk7.js → studio-t3j8htp7.js} +5 -5
- package/dist/chunks/{studio-3zge48z4.js → studio-thj81e98.js} +6 -6
- package/dist/chunks/{studio-ekgtrndg.js → studio-tpy3rdxn.js} +4 -4
- package/dist/chunks/{studio-ewarnzm4.js → studio-va0e63sk.js} +4 -4
- package/dist/chunks/{studio-gr36vnte.js → studio-vcz63n42.js} +4 -4
- package/dist/chunks/studio-vffwe9k7.js +5 -0
- package/dist/chunks/{studio-7dzyz9n8.js → studio-vjhej0w5.js} +103 -103
- package/dist/chunks/{studio-hwejq03c.js → studio-vxjap704.js} +4 -4
- package/dist/chunks/{studio-03mqh8ax.js → studio-w67vfgy5.js} +2 -2
- package/dist/chunks/{studio-ajw4k8hp.js → studio-x2metr13.js} +3 -3
- package/dist/chunks/{studio-771k2n12.js → studio-xebavr9s.js} +4 -4
- package/dist/chunks/{studio-x08a3m0a.js → studio-yg5n49za.js} +4 -4
- package/dist/chunks/{studio-xh683qzy.js → studio-yhz5b313.js} +4 -4
- package/dist/chunks/{studio-fy7jzj9j.js → studio-zacvfm31.js} +4 -4
- package/dist/chunks/{studio-zkq3r91p.js → studio-zsjpsw08.js} +4 -4
- package/dist/chunks/{studio-2hsqbq7b.js → studio-zxm98z2m.js} +6 -6
- package/dist/chunks/{tsMode-h6tkz0ea.js → tsMode-6vwhy6ty.js} +5 -5
- package/dist/chunks/workspace-d65bz1qk.js +4 -0
- package/dist/chunks/workspace-home-vbg9b3jh.js +4 -0
- package/dist/chunks/{ws-client-e951my95.js → ws-client-zcxkfgmf.js} +3 -3
- package/dist/manifest.json +71 -71
- package/dist/studio.js +73 -70
- package/package.json +4 -4
- package/src/platform-errors.ts +17 -1
- package/src/platforms/cloud.ts +14 -0
- package/src/publish/publish-changes.ts +136 -4
- package/src/types.ts +14 -0
- package/dist/chunks/adapter-wc5zvg9a.js +0 -4
- package/dist/chunks/cf-settings-hp1pjm0n.js +0 -4
- package/dist/chunks/components-nkwphrx3.js +0 -4
- package/dist/chunks/content-source-6a253wmk.js +0 -4
- package/dist/chunks/editor-wqrc68ca.js +0 -4
- package/dist/chunks/entry-commands-nef0wrmp.js +0 -4
- package/dist/chunks/file-ops-y3w71k1n.js +0 -4
- package/dist/chunks/files-de90apn9.js +0 -4
- package/dist/chunks/fs-events-77c0mr0x.js +0 -4
- package/dist/chunks/grid-open-4n4fjfpf.js +0 -4
- package/dist/chunks/index-ewmgdb7c.js +0 -4
- package/dist/chunks/jx-validate-b309c020.js +0 -4
- package/dist/chunks/layers-8rn8y6qv.js +0 -4
- package/dist/chunks/layers-panel-eyah7h9z.js +0 -4
- package/dist/chunks/lit-html-wyqw04y2.js +0 -4
- package/dist/chunks/media-library-gs3np47y.js +0 -4
- package/dist/chunks/media-picker-tt7dk4tb.js +0 -4
- package/dist/chunks/monaco-buffer-wsf6cmnq.js +0 -4
- package/dist/chunks/notify-qwst108r.js +0 -4
- package/dist/chunks/parse-n8dfxnqf.js +0 -4
- package/dist/chunks/publish-panel-d34bhvwj.js +0 -4
- package/dist/chunks/publish-workspace-2yr60mt4.js +0 -4
- package/dist/chunks/quick-search-e6xsdv0d.js +0 -4
- package/dist/chunks/references-gsj6trdv.js +0 -4
- package/dist/chunks/right-panel-33jv1knc.js +0 -4
- package/dist/chunks/source-control-bj9bejjv.js +0 -4
- package/dist/chunks/studio-38g0jdz7.js +0 -5
- package/dist/chunks/studio-dbxv7w4s.js +0 -5
- package/dist/chunks/studio-psh8mwnw.js +0 -4
- package/dist/chunks/studio-v9ywz2se.js +0 -6
- package/dist/chunks/studio-yx8hzqja.js +0 -5
- package/dist/chunks/workspace-home-zkkrxq3r.js +0 -4
- package/dist/chunks/workspace-tdqqjqaa.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/studio",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Jx Studio — visual builder for Jx documents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
62
62
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
63
|
-
"@jxsuite/ai": "^0.41.
|
|
63
|
+
"@jxsuite/ai": "^0.41.2",
|
|
64
64
|
"@jxsuite/collab": "^0.11.4",
|
|
65
|
-
"@jxsuite/create": "^1.5.
|
|
65
|
+
"@jxsuite/create": "^1.5.1",
|
|
66
66
|
"@jxsuite/formulas": "^0.0.26",
|
|
67
67
|
"@jxsuite/markup": "^1.0.2",
|
|
68
|
-
"@jxsuite/protocol": "^6.
|
|
68
|
+
"@jxsuite/protocol": "^6.1.0",
|
|
69
69
|
"@jxsuite/runtime": "^6.0.1",
|
|
70
70
|
"@jxsuite/schema": "^5.0.0",
|
|
71
71
|
"@jxsuite/site": "^2.2.2",
|
package/src/platform-errors.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface PlatformErrorInfo {
|
|
|
26
26
|
heading?: string;
|
|
27
27
|
/** What to do once one of its actions is done. */
|
|
28
28
|
retry?: RetryHint;
|
|
29
|
+
/** The paths a `conflict` names: the files the remote changed that this side changed too. */
|
|
30
|
+
conflicts?: string[];
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
const RETRY_HINTS = new Set<string>(["reload", "repeat", "none"]);
|
|
@@ -90,7 +92,7 @@ export function platformErrorInfo(cause: unknown): PlatformErrorInfo {
|
|
|
90
92
|
if (!isJsonObject(cause)) {
|
|
91
93
|
return {};
|
|
92
94
|
}
|
|
93
|
-
const { actions, code, heading, installUrl, retry, type } = cause;
|
|
95
|
+
const { actions, code, conflicts, heading, installUrl, retry, type } = cause;
|
|
94
96
|
const info: PlatformErrorInfo = {};
|
|
95
97
|
// A problem type wins over a legacy code: it is the shape the backend is migrating toward.
|
|
96
98
|
const derived = problemSlug(type) ?? (isString(code) ? normalizeCode(code) : null);
|
|
@@ -109,9 +111,23 @@ export function platformErrorInfo(cause: unknown): PlatformErrorInfo {
|
|
|
109
111
|
if (isRetryHint(retry)) {
|
|
110
112
|
info.retry = retry;
|
|
111
113
|
}
|
|
114
|
+
if (Array.isArray(conflicts)) {
|
|
115
|
+
info.conflicts = conflicts.filter((path) => isString(path));
|
|
116
|
+
}
|
|
112
117
|
return info;
|
|
113
118
|
}
|
|
114
119
|
|
|
120
|
+
/**
|
|
121
|
+
* The files a refused publish overlaps on the remote, when the error is that refusal: a pull or a
|
|
122
|
+
* commit the remote has moved under, whose changes touch the same paths (`pull_conflict`, or the
|
|
123
|
+
* `conflict` problem type carrying `conflicts`). Null for every other failure.
|
|
124
|
+
*/
|
|
125
|
+
export function remoteConflictsOf(cause: unknown): string[] | null {
|
|
126
|
+
const info = platformErrorInfo(cause);
|
|
127
|
+
const conflicting = info.code === "pull-conflict" || info.code === "conflict";
|
|
128
|
+
return conflicting && info.conflicts ? info.conflicts : null;
|
|
129
|
+
}
|
|
130
|
+
|
|
115
131
|
/** The GitHub-App install link when the error is the structured needs-installation 403. */
|
|
116
132
|
export function installUrlOf(cause: unknown): string | null {
|
|
117
133
|
const info = platformErrorInfo(cause);
|
package/src/platforms/cloud.ts
CHANGED
|
@@ -37,6 +37,7 @@ import type {
|
|
|
37
37
|
FsEvent,
|
|
38
38
|
FsResyncReason,
|
|
39
39
|
GitBranchesResult,
|
|
40
|
+
GitCommitBranchResult,
|
|
40
41
|
GitLogEntry,
|
|
41
42
|
GitStatusResult,
|
|
42
43
|
ImportProgressEvent,
|
|
@@ -220,6 +221,7 @@ interface StructuredBody extends ErrorBody {
|
|
|
220
221
|
actions?: JsonValue;
|
|
221
222
|
heading?: JsonValue;
|
|
222
223
|
retry?: JsonValue;
|
|
224
|
+
conflicts?: JsonValue;
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
/** What {@link platformError} carries on the Error it returns: the HTTP status, plus what it found. */
|
|
@@ -271,6 +273,10 @@ async function platformError(res: Response, fallback: string): Promise<Error> {
|
|
|
271
273
|
if (retry !== undefined) {
|
|
272
274
|
details.retry = retry;
|
|
273
275
|
}
|
|
276
|
+
const conflicts = body?.conflicts;
|
|
277
|
+
if (Array.isArray(conflicts)) {
|
|
278
|
+
details.conflicts = conflicts.filter((path) => isString(path));
|
|
279
|
+
}
|
|
274
280
|
return Object.assign(new Error(problemDetail(body) ?? fallback), details);
|
|
275
281
|
}
|
|
276
282
|
|
|
@@ -1590,6 +1596,14 @@ export function createCloudPlatform(project: CloudProject | null): StudioPlatfor
|
|
|
1590
1596
|
await okJson(await postJson("/git/create-branch", { name }), "Failed to create branch");
|
|
1591
1597
|
},
|
|
1592
1598
|
|
|
1599
|
+
/** One commit, parented on the session's base, onto a branch the backend creates for it. */
|
|
1600
|
+
async gitCommitBranch(opts: { branch: string; message: string }) {
|
|
1601
|
+
return okJson<GitCommitBranchResult>(
|
|
1602
|
+
await postJson("/git/commit-branch", { branch: opts.branch, message: opts.message }),
|
|
1603
|
+
`Could not publish to ${opts.branch}`,
|
|
1604
|
+
);
|
|
1605
|
+
},
|
|
1606
|
+
|
|
1593
1607
|
async gitDiff(path?: string) {
|
|
1594
1608
|
const data = await okJson<{ diff: string }>(
|
|
1595
1609
|
await api(`/git/diff?path=${encodeURIComponent(path ?? "")}`),
|
|
@@ -10,8 +10,16 @@
|
|
|
10
10
|
* a host that opens pull requests (`createPullRequest`); on one that does not (the dev server and
|
|
11
11
|
* the desktop app today) it is drawn disabled with that sentence rather than falling back to a
|
|
12
12
|
* branch push that opens nothing. On a host whose branches are sessions (`gitHosted`, the cloud) a
|
|
13
|
-
* branch cannot be
|
|
14
|
-
*
|
|
13
|
+
* branch cannot be checked out mid-flow, so review there commits to the session's own branch and
|
|
14
|
+
* opens the pull request from it; on the default branch, where every commit is live, the change set
|
|
15
|
+
* is committed as a branch of its own instead (`gitCommitBranch`), and the destination's note says
|
|
16
|
+
* which.
|
|
17
|
+
*
|
|
18
|
+
* **A remote that moved is not a dead end.** On such a host a commit the remote's newer changes
|
|
19
|
+
* overlap is refused with the files they share ({@link remoteConflictsOf}). The author is then
|
|
20
|
+
* offered the same branch of its own: {@link publishAsBranch} commits the change set onto the base
|
|
21
|
+
* it was edited against, which cannot conflict, and opens a pull request into the branch that
|
|
22
|
+
* moved, where GitHub reconciles the two.
|
|
15
23
|
*
|
|
16
24
|
* **Every word a control shows is decided here**, so the workspace and the dialog cannot disagree
|
|
17
25
|
* about what a button does: {@link destinationChoices}, {@link publishLabel} and
|
|
@@ -24,6 +32,8 @@
|
|
|
24
32
|
import { errorMessage } from "@jxsuite/schema/parse";
|
|
25
33
|
import { flushAllCollab } from "../collab/collab-session";
|
|
26
34
|
import { getPlatform, hasPlatform } from "../platform";
|
|
35
|
+
import { remoteConflictsOf } from "../platform-errors";
|
|
36
|
+
import { showPromptDialog } from "../ui/layers";
|
|
27
37
|
import { notify } from "../services/notify";
|
|
28
38
|
import { shell } from "../shell";
|
|
29
39
|
import { projectState } from "../store";
|
|
@@ -71,6 +81,21 @@ export function reviewBranchName(summary: string): string {
|
|
|
71
81
|
return `studio/${slug.replace(/-$/, "") || "changes"}`;
|
|
72
82
|
}
|
|
73
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Whether this host can commit a change set as a branch of its own without checking it out
|
|
86
|
+
* (`StudioPlatform.gitCommitBranch`): what lets the cloud send a review from the default branch and
|
|
87
|
+
* publish a change set the remote has conflicted with.
|
|
88
|
+
*/
|
|
89
|
+
export function platformCommitsBranches(): boolean {
|
|
90
|
+
return hasPlatform() && getPlatform().gitCommitBranch !== undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Whether review on this host commits a branch of its own rather than the session's branch. */
|
|
94
|
+
function reviewBranchesOff(): boolean {
|
|
95
|
+
const base = defaultBranch();
|
|
96
|
+
return platformHostsGit() && platformCommitsBranches() && base !== "" && currentBranch() === base;
|
|
97
|
+
}
|
|
98
|
+
|
|
74
99
|
/** One destination, as a radio card draws it. */
|
|
75
100
|
export interface DestinationChoice {
|
|
76
101
|
value: PublishDestination;
|
|
@@ -108,6 +133,9 @@ export function reviewRefusal(): string {
|
|
|
108
133
|
publish by accident. */
|
|
109
134
|
const base = defaultBranch();
|
|
110
135
|
const branch = currentBranch();
|
|
136
|
+
if (reviewBranchesOff()) {
|
|
137
|
+
return "";
|
|
138
|
+
}
|
|
111
139
|
if (!base || !branch || branch === base) {
|
|
112
140
|
return (
|
|
113
141
|
`Every commit to ${base || "the default branch"} on this host is live. Create a branch ` +
|
|
@@ -140,14 +168,17 @@ function liveNote(): string {
|
|
|
140
168
|
/** What Send for review does, said before it runs. */
|
|
141
169
|
function reviewNote(): string {
|
|
142
170
|
const branch = currentBranch() || "the current branch";
|
|
171
|
+
const summary = shell.git.commitMessage.trim();
|
|
172
|
+
const head = summary ? reviewBranchName(summary) : "a new studio/ branch";
|
|
173
|
+
if (reviewBranchesOff()) {
|
|
174
|
+
return `Saves to ${head} on GitHub and opens a pull request into ${branch}.`;
|
|
175
|
+
}
|
|
143
176
|
if (platformHostsGit()) {
|
|
144
177
|
return (
|
|
145
178
|
`Commits to ${branch} and opens a pull request from it into ` +
|
|
146
179
|
`${defaultBranch() || "the default branch"}.`
|
|
147
180
|
);
|
|
148
181
|
}
|
|
149
|
-
const summary = shell.git.commitMessage.trim();
|
|
150
|
-
const head = summary ? reviewBranchName(summary) : "a new studio/ branch";
|
|
151
182
|
return `Saves to ${head}, pushes it and opens a pull request into ${branch}.`;
|
|
152
183
|
}
|
|
153
184
|
|
|
@@ -424,6 +455,16 @@ export async function publishChanges(
|
|
|
424
455
|
await refreshGitStatus();
|
|
425
456
|
return shipped;
|
|
426
457
|
} catch (error) {
|
|
458
|
+
const conflicts = committed ? null : remoteConflictsOf(error);
|
|
459
|
+
if (conflicts && platformCommitsBranches()) {
|
|
460
|
+
shell.git.loading = false;
|
|
461
|
+
if (await publishAsBranch(message, conflicts)) {
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
// Declined: the refusal still stands, and it is what the author must read.
|
|
465
|
+
shell.git.error ??= errorMessage(error);
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
427
468
|
shell.git.error = errorMessage(error);
|
|
428
469
|
shell.git.loading = false;
|
|
429
470
|
// A push that failed after the commit landed must not offer the same summary again.
|
|
@@ -434,6 +475,89 @@ export async function publishChanges(
|
|
|
434
475
|
}
|
|
435
476
|
}
|
|
436
477
|
|
|
478
|
+
/** Up to three paths, then how many more: what a sentence can name of a list of files. */
|
|
479
|
+
function namePaths(paths: readonly string[]): string {
|
|
480
|
+
const shown = paths.slice(0, 3).join(", ");
|
|
481
|
+
return paths.length > 3 ? `${shown} and ${paths.length - 3} more` : shown;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Offer to publish a change set the remote has conflicted with as a branch of its own, and do it.
|
|
486
|
+
*
|
|
487
|
+
* Asked, never assumed: the author named a destination, and this is a different one. The dialog
|
|
488
|
+
* says which files collided and what will happen, and the branch name it proposes is the one Send
|
|
489
|
+
* for review would use, editable. Confirming commits the change set onto the base it was edited
|
|
490
|
+
* against (`gitCommitBranch`, which cannot conflict), opens a pull request from it into the branch
|
|
491
|
+
* that moved, and pulls that branch up to date now that the colliding changes have left it.
|
|
492
|
+
* Cancelling puts the summary back, as any publish that never committed does.
|
|
493
|
+
*
|
|
494
|
+
* @param message The summary the refused commit was made with.
|
|
495
|
+
* @param conflicts The files the remote changed that this change set changes too.
|
|
496
|
+
* @returns Whether the change set reached the new branch.
|
|
497
|
+
*/
|
|
498
|
+
export async function publishAsBranch(
|
|
499
|
+
message: string,
|
|
500
|
+
conflicts: readonly string[],
|
|
501
|
+
): Promise<boolean> {
|
|
502
|
+
const plat = getPlatform();
|
|
503
|
+
const commitBranch = plat.gitCommitBranch;
|
|
504
|
+
if (!commitBranch) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
const current = currentBranch() || "this branch";
|
|
508
|
+
const count = conflicts.length === 1 ? "1 file" : `${conflicts.length} files`;
|
|
509
|
+
const name = await showPromptDialog("Publish to a New Branch", {
|
|
510
|
+
confirmLabel: "Publish to branch",
|
|
511
|
+
message:
|
|
512
|
+
`${current} changed on GitHub after these edits began, and ${count} changed on both sides ` +
|
|
513
|
+
`(${namePaths(conflicts)}). Publish your changes to a branch of their own instead, and a ` +
|
|
514
|
+
`pull request will bring them into ${current}.`,
|
|
515
|
+
value: reviewBranchName(message),
|
|
516
|
+
validate: (value) => (value.trim() ? "" : "Enter a branch name."),
|
|
517
|
+
});
|
|
518
|
+
if (!name) {
|
|
519
|
+
restoreSummary(message);
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
522
|
+
shell.git.loading = true;
|
|
523
|
+
shell.git.error = null;
|
|
524
|
+
let committed = false;
|
|
525
|
+
try {
|
|
526
|
+
const result = await commitBranch({ branch: name, message });
|
|
527
|
+
committed = true;
|
|
528
|
+
const open = plat.createPullRequest;
|
|
529
|
+
const base = currentBranch();
|
|
530
|
+
const pr = open && base ? await open({ base, head: result.branch, title: message }) : null;
|
|
531
|
+
if (pr) {
|
|
532
|
+
shell.publish.review.number = pr.number;
|
|
533
|
+
shell.publish.review.url = pr.url;
|
|
534
|
+
}
|
|
535
|
+
notify.success(
|
|
536
|
+
pr
|
|
537
|
+
? `Published to ${result.branch}. Pull request #${pr.number} brings it into ${base}.`
|
|
538
|
+
: `Published to ${result.branch}.`,
|
|
539
|
+
{ detail: pr?.url ?? "", key: "publish.branch", source: "Publish" },
|
|
540
|
+
);
|
|
541
|
+
/* The colliding edits have left this session, so it can fast-forward to the remote now. A
|
|
542
|
+
pull that still cannot (another collaborator's edit overlaps too) is not this publish's
|
|
543
|
+
failure: the status says the branch is behind, and Pull says why. */
|
|
544
|
+
try {
|
|
545
|
+
await plat.gitPull();
|
|
546
|
+
} catch {
|
|
547
|
+
// Reported by the next Pull, where it can be acted on.
|
|
548
|
+
}
|
|
549
|
+
await refreshGitStatus();
|
|
550
|
+
return true;
|
|
551
|
+
} catch (error) {
|
|
552
|
+
shell.git.error = errorMessage(error);
|
|
553
|
+
shell.git.loading = false;
|
|
554
|
+
if (!committed) {
|
|
555
|
+
restoreSummary(message);
|
|
556
|
+
}
|
|
557
|
+
return false;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
437
561
|
/** What a pull request is opened with: its title, and the branches when the flow chose them. */
|
|
438
562
|
interface PullRequestRequest {
|
|
439
563
|
title: string;
|
|
@@ -454,6 +578,14 @@ async function commitForReview(
|
|
|
454
578
|
message: string,
|
|
455
579
|
onCommitted: () => void,
|
|
456
580
|
): Promise<PullRequestRequest> {
|
|
581
|
+
if (reviewBranchesOff() && plat.gitCommitBranch) {
|
|
582
|
+
/* Every commit to the default branch here is live, so the change set goes to a branch of its
|
|
583
|
+
own, parented on the session's base, and leaves the session: it is the pull request's now. */
|
|
584
|
+
const base = currentBranch();
|
|
585
|
+
const { branch } = await plat.gitCommitBranch({ branch: reviewBranchName(message), message });
|
|
586
|
+
onCommitted();
|
|
587
|
+
return { base, head: branch, title: message };
|
|
588
|
+
}
|
|
457
589
|
if (platformHostsGit()) {
|
|
458
590
|
// `reviewRefusal` has already refused the default branch, so this commit is not a live one.
|
|
459
591
|
await plat.gitCommit(message);
|
package/src/types.ts
CHANGED
|
@@ -34,6 +34,7 @@ import type {
|
|
|
34
34
|
ExtensionsInfo,
|
|
35
35
|
FsEvent,
|
|
36
36
|
GitBranchesResult,
|
|
37
|
+
GitCommitBranchResult,
|
|
37
38
|
GitLogEntry,
|
|
38
39
|
GitStatusResult,
|
|
39
40
|
ImportProgressEvent,
|
|
@@ -88,6 +89,7 @@ export type {
|
|
|
88
89
|
ExtensionsInfo,
|
|
89
90
|
FsEvent,
|
|
90
91
|
GitBranchesResult,
|
|
92
|
+
GitCommitBranchResult,
|
|
91
93
|
GitFileStatus,
|
|
92
94
|
GitLogEntry,
|
|
93
95
|
GitStatusResult,
|
|
@@ -580,6 +582,18 @@ export interface StudioPlatform {
|
|
|
580
582
|
gitFetch: () => Promise<void>;
|
|
581
583
|
gitCheckout: (branch: string) => Promise<void>;
|
|
582
584
|
gitCreateBranch: (name: string) => Promise<void>;
|
|
585
|
+
/**
|
|
586
|
+
* Commit the change set as a NEW branch, parented on the commit this session's edits were made
|
|
587
|
+
* against, and take the committed files out of this session. Rejects with code `branch_exists`
|
|
588
|
+
* when the name is taken (the ref is created, never moved).
|
|
589
|
+
*
|
|
590
|
+
* The way out on a host where a branch is a session (`gitHosted`): a commit to the session's own
|
|
591
|
+
* branch that the remote conflicts with can still be published, as a branch of its own the pull
|
|
592
|
+
* request then reconciles, and a change set on a branch whose every commit is live can be sent
|
|
593
|
+
* for review without landing there first. An ordinary working tree has no need of it: there a
|
|
594
|
+
* branch is created and checked out with the changes still in it (studio.md §22.8).
|
|
595
|
+
*/
|
|
596
|
+
gitCommitBranch?: (opts: { branch: string; message: string }) => Promise<GitCommitBranchResult>;
|
|
583
597
|
gitDiff: (path?: string) => Promise<string>;
|
|
584
598
|
gitShow: (opts: { path: string; ref?: string }) => Promise<string>;
|
|
585
599
|
gitDiscard: (files: string[]) => Promise<void>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{db,DE,NE,X2,AE}from"./studio-yx8hzqja.js";import"./studio-771k2n12.js";import"./studio-4kzbrr5t.js";import"./studio-03mqh8ax.js";export{AE as clearCfConnection,NE as getCfAccountId,db as getCfToken,X2 as setCfAccountId,DE as setCfToken};
|
|
2
|
-
|
|
3
|
-
//# debugId=0F33B1A35F1FF92864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=cf-settings-hp1pjm0n.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ne,Zw,xa,Mb,Fc,jc}from"./studio-1e8dw2w2.js";import"./studio-03mqh8ax.js";export{Zw as _componentRegistryLoaded,Fc as buildComponentInstance,Ne as componentRegistry,jc as computeRelativePath,xa as loadComponentRegistry,Mb as noteComponentSaved};
|
|
2
|
-
|
|
3
|
-
//# debugId=A35E7AE29ACD6F0964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=components-nkwphrx3.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{mb,rS,sS,gb,tT,nT,iT}from"./studio-wxdcd42g.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{rS as collectionDirs,mb as collectionInfo,sS as collectionSourceDirs,nT as createCollectionSource,iT as createPagesSource,gb as listCollectionEntryIds,tT as reloadDraftAwareGrids};
|
|
2
|
-
|
|
3
|
-
//# debugId=A52099944B7F1D8F64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=content-source-6a253wmk.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{B2,Wf,z2,W2,V2,np,U2,q2,ga,Y0,vd,G2,Wn,we}from"./studio-7dzyz9n8.js";export{B2 as CancellationTokenSource,Wf as Emitter,z2 as KeyCode,W2 as KeyMod,ga as MarkerSeverity,Y0 as MarkerTag,V2 as Position,np as Range,U2 as Selection,q2 as SelectionDirection,G2 as Token,vd as Uri,Wn as editor,we as languages};
|
|
2
|
-
|
|
3
|
-
//# debugId=009472AB65AE97D564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=editor-wqrc68ca.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{B_,Z2,bE}from"./studio-rzg8hnkf.js";import"./studio-dbxv7w4s.js";import"./studio-zg16eeq1.js";import"./studio-zgx7svjd.js";import"./studio-jw0q5j6k.js";import"./studio-fy7jzj9j.js";import"./studio-d038kqbs.js";import"./studio-wxdcd42g.js";import"./studio-agyvzfm4.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";import"./studio-k1wvtp03.js";export{Z2 as createEntry,B_ as entryFormatName,bE as registerContentCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=B64D22582B2D648864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=entry-commands-nef0wrmp.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{eN,jr,AT,rP,OT,wp,MT,_b,Sb}from"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{_b as confirmFileDelete,MT as exportFile,rP as openFile,AT as parseCollabSource,eN as parseFormatSource,jr as parseSourceForPath,Sb as renamePromptMessage,wp as saveFile,OT as setDocumentSavedListener};
|
|
2
|
-
|
|
3
|
-
//# debugId=57CBBBA7BE597CAB64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=file-ops-y3w71k1n.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Bs,pm,OE,ME,T2,PE,FE,jE,Z_,L2,pb,HE,$2,I2,BE,OD,R2,D2,fw,X_,MD,zE,N2,yi,Q_,WE,VE,fm,UE,A2,O2}from"./studio-3zge48z4.js";import"./studio-k3a8rp3d.js";import"./studio-d038kqbs.js";import"./studio-2ks6ka4g.js";import"./studio-wxdcd42g.js";import"./studio-hwejq03c.js";import"./studio-epenqmvk.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{$2 as FILE_ROW_HEIGHT,BE as canMoveInto,D2 as createFileIn,Z_ as findHomePage,jE as initProjectRepo,I2 as isFileDrag,fw as listTakenNames,Bs as loadDirectory,PE as loadProject,pm as loadProjectDirectories,A2 as mountFilesPanel,MD as notifyMoveOutcome,Q_ as openFileInPane,yi as openFileInTab,L2 as openHomePage,pb as openLastSessionOrHome,FE as openProject,zE as parentDirOf,R2 as pickAndUploadTo,OE as refreshProjectDirectoriesFor,UE as registerFilesPanel,WE as reloadCleanTab,fm as reloadFileInTab,VE as reloadTabsIfChanged,HE as setSessionWorkspaceShow,T2 as setShowIgnoredFiles,N2 as settleRename,ME as showIgnoredFiles,O2 as unmountFilesPanel,OD as uploadFilesToDir,X_ as writeNewFile};
|
|
2
|
-
|
|
3
|
-
//# debugId=5803FD53AF32D68164756E2164756E21
|
|
4
|
-
//# sourceMappingURL=files-de90apn9.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ta,Hd,C$}from"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{Hd as isRecentLocal,Ta as markLocalMutation,C$ as startFsSync};
|
|
2
|
-
|
|
3
|
-
//# debugId=488DC9A47953DD8E64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=fs-events-77c0mr0x.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{ZE,zD,oS,XE,QE}from"./studio-2ks6ka4g.js";import"./studio-wxdcd42g.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{zD as openCollectionGrid,ZE as openCsvGridTab,XE as openGridSourcePicker,oS as openPagesGrid,QE as registerGridCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=AD25A9B3B968468764756E2164756E21
|
|
4
|
-
//# sourceMappingURL=grid-open-4n4fjfpf.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{HI,BI,zI,WI,VI,wu,UI,Mg,qI,Vf,GI,Uf,u2,X0,ck,h2,p2,f2,m2,xu,g2,b2,v2,dk,uk,y2,w2,x2,_2,hk,S2}from"./studio-m48v13s3.js";import{yd,Q0,Pg,C2,ZI,XI,QI,eR,Fg,mk,gk}from"./studio-dx73md4n.js";import{zs,tP}from"./studio-h5tpz5ke.js";import{Se,oe,Lv,$v}from"./studio-ekgtrndg.js";export{VI as COLLAB_SCHEMA_VERSION,xu as CollabPathError,Fg as EnvelopeError,XI as FRAME_AWARENESS,eR as FRAME_CONTROL,QI as FRAME_DOC_CLOSE,ZI as FRAME_DOC_SYNC,BI as FRONTMATTER_KEY,p2 as LOCAL_ORIGIN,HI as META_KEY,f2 as MIRROR_ORIGIN,hk as PRESENCE_PALETTE,m2 as SEED_ORIGIN,WI as SOURCE_KEY,zI as STRUCTURE_KEY,C2 as UndoManager,yd as YDoc,y2 as acquireSourceCanonical,$v as applyDocOpToDoc,g2 as applyDocOpsToY,dk as canonicalOf,uk as canonicalRevOf,Lv as childArray,Se as cloneValue,S2 as colorForKey,Pg as createAbsolutePositionFromRelativePosition,Q0 as createRelativePositionFromTypeIndex,gk as decodeFrame,zs as deepEqual,tP as diffDocs,mk as encodeFrame,UI as frontmatterMap,oe as getNodeAtPath,_2 as isSourceReconciler,wu as metaMap,x2 as otherSourceEditors,w2 as releaseSourceCanonical,v2 as replaceYStructure,X0 as resolveYPath,h2 as seedStructure,qI as sourceText,Mg as structureMap,Vf as toYChildren,GI as toYNode,ck as updateSourceText,u2 as yDocToJson,b2 as yEventsToDocOps,Uf as yValueToJson};
|
|
2
|
-
|
|
3
|
-
//# debugId=9C7A756F61754BAE64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=index-ewmgdb7c.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{tt,f$,qb,m$,qo,pC,xi,Zs,Gb,g$}from"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";export{Gb as clearLayerSlot,Zs as getLayerSlot,f$ as initLayers,qb as isModalOpen,m$ as isPopoverOpen,tt as layerHost,g$ as overlayIdleBlockers,qo as showConfirmDialog,xi as showPromptDialog,pC as showSaveDiscardDialog};
|
|
2
|
-
|
|
3
|
-
//# debugId=88BB605569A862BE64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=layers-8rn8y6qv.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{E2,Rk}from"./studio-v9ywz2se.js";import"./studio-9dz76yqc.js";import"./studio-2j86y34y.js";import"./studio-d83m0wyq.js";import"./studio-wxhy1yh7.js";import"./studio-jw0q5j6k.js";import"./studio-fy7jzj9j.js";import"./studio-k3a8rp3d.js";import"./studio-pgm83a2f.js";import"./studio-agyvzfm4.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";import"./studio-k1wvtp03.js";export{Rk as registerLayersPanel,E2 as startLayerTitleEdit};
|
|
2
|
-
|
|
3
|
-
//# debugId=9D18EB13B3EDE2D064756E2164756E21
|
|
4
|
-
//# sourceMappingURL=layers-panel-eyah7h9z.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{nP,wb,KD,fS,_w,LT,$T,M2,iP,P2,mS,oP,IT}from"./studio-p1n2xjda.js";import"./studio-pgm83a2f.js";import"./studio-agyvzfm4.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{nP as MEDIA_HOME_MODE,M2 as applyMediaBrowse,mS as closeMediaPickDialog,KD as deleteMediaFile,_w as detachMediaLibrary,$T as focusMediaHome,fS as mediaLibraryMounted,oP as openMediaPickDialog,LT as renderMediaLibrary,P2 as requestMediaReplace,iP as requestMediaUpload,IT as resetMediaLibrary,wb as selectedEntry};
|
|
2
|
-
|
|
3
|
-
//# debugId=0B26CADF271A4C7664756E2164756E21
|
|
4
|
-
//# sourceMappingURL=media-library-gs3np47y.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{DT,NT,Wu,kw,F2,vS,j2,yS,Hl,bm}from"./studio-agyvzfm4.js";import"./studio-gr36vnte.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{kw as invalidateMediaCache,DT as isMediaScanPath,Hl as mountMediaPicker,NT as onProjectMediaChange,F2 as openFullMediaPicker,yS as pickAndUpload,Wu as projectMediaFiles,vS as showMediaPickerPopover,bm as unmountMediaPicker,j2 as uploadAndAssign};
|
|
2
|
-
|
|
3
|
-
//# debugId=FA358044FC8F149F64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=media-picker-tt7dk4tb.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Kp,gv,bv,K$,Jd,Jp,Yd,Yp}from"./studio-x08a3m0a.js";import"./studio-4kzbrr5t.js";export{Kp as BUFFER_COMMIT,Jd as bufferIsLive,Jp as bufferMovedOn,gv as bufferWrites,K$ as cancelBufferWrites,bv as commitBufferWrites,Yd as commitTabBuffers,Yp as tabBufferUnsaved};
|
|
2
|
-
|
|
3
|
-
//# debugId=587DEA207F66387764756E2164756E21
|
|
4
|
-
//# sourceMappingURL=monaco-buffer-wsf6cmnq.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{wk,J2}from"./studio-xh683qzy.js";import"./studio-yx8hzqja.js";import"./studio-2hsqbq7b.js";import"./studio-5wzdy1jc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{J2 as openPublishPanel,wk as seedPublishConnected};
|
|
2
|
-
|
|
3
|
-
//# debugId=226A4412FFE633F864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=publish-panel-d34bhvwj.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{nR,xk,o_,r_,_k}from"./studio-tj2s0tks.js";import"./studio-38g0jdz7.js";import"./studio-hwejq03c.js";import"./studio-epenqmvk.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{r_ as detachPublishWorkspace,xk as focusPublishHome,o_ as publishWorkspaceMounted,_k as renderPublishWorkspace,nR as showPublishTab};
|
|
2
|
-
|
|
3
|
-
//# debugId=D7F8A122C50D058864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=publish-workspace-2yr60mt4.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Sk,zg}from"./studio-3v5cagy9.js";import"./studio-3zge48z4.js";import"./studio-k3a8rp3d.js";import"./studio-d038kqbs.js";import"./studio-2ks6ka4g.js";import"./studio-wxdcd42g.js";import"./studio-hwejq03c.js";import"./studio-epenqmvk.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{Sk as initQuickSearch,zg as openQuickSearch};
|
|
2
|
-
|
|
3
|
-
//# debugId=B1FD077F611E0D8464756E2164756E21
|
|
4
|
-
//# sourceMappingURL=quick-search-e6xsdv0d.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{hh,Bd,La,k$,Sr,E$,Qb,T$,ev}from"./studio-de1s2x9v.js";import"./studio-psh8mwnw.js";import"./studio-03mqh8ax.js";export{Sr as invalidateUsages,La as loadUsages,E$ as onUsagesInvalidated,Bd as peekUsages,k$ as retryUsages,ev as usageFiles,Qb as usageHeadline,T$ as usageWarning,hh as usagesSupported};
|
|
2
|
-
|
|
3
|
-
//# debugId=C7AD0D04C3D93B3C64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=references-gsj6trdv.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{dR,Ck,Y2,kk,Wg,Dl,Su}from"./studio-yg3djpnm.js";import"./studio-9dz76yqc.js";import"./studio-2j86y34y.js";import"./studio-vswcpzk7.js";import"./studio-wxhy1yh7.js";import"./studio-zg16eeq1.js";import"./studio-zgx7svjd.js";import"./studio-fy7jzj9j.js";import"./studio-3zge48z4.js";import"./studio-k3a8rp3d.js";import"./studio-d038kqbs.js";import"./studio-2ks6ka4g.js";import"./studio-wxdcd42g.js";import"./studio-hwejq03c.js";import"./studio-epenqmvk.js";import"./studio-pgm83a2f.js";import"./studio-agyvzfm4.js";import"./studio-x97ay0v4.js";import"./studio-c1pxszat.js";import"./studio-gwrhcrss.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-h310mbqm.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";import"./studio-k1wvtp03.js";export{Dl as inspectorTab,Ck as mount,Wg as render,kk as restingInspectorTab,Su as setInspectorTab,dR as stripOf,Y2 as unmount};
|
|
2
|
-
|
|
3
|
-
//# debugId=2A0F79E0F48C224764756E2164756E21
|
|
4
|
-
//# sourceMappingURL=right-panel-33jv1knc.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ws,rT,cS,dS,vb,wa,sT,aT,lT,cT,dT,uT,hT,pT,fT,mT,gT,bT,vT,yT,uS,wT,xT,xw,_T,ST,yb,CT}from"./studio-hwejq03c.js";import"./studio-epenqmvk.js";import"./studio-ndskgqef.js";import"./studio-gr36vnte.js";import"./studio-hy4ye0dx.js";import"./studio-2hsqbq7b.js";import"./studio-9cxmp61c.js";import"./studio-pqqq6v85.js";import"./studio-1e8dw2w2.js";import"./studio-5wzdy1jc.js";import"./studio-ewarnzm4.js";import"./studio-34jrz12k.js";import"./studio-x3mjr5cc.js";import"./studio-h7weqf2q.js";import"./studio-771k2n12.js";import"./studio-jttyqrmh.js";import"./studio-ajw4k8hp.js";import"./studio-cpkamjdn.js";import"./studio-de1s2x9v.js";import"./studio-k3bcy02e.js";import"./studio-vzgmyt0v.js";import"./studio-x08a3m0a.js";import"./studio-ry81j4q1.js";import"./studio-4kzbrr5t.js";import"./studio-psh8mwnw.js";import"./studio-3w35qvay.js";import"./studio-03mqh8ax.js";export{ST as armGitPoll,uS as changeRow,yT as checkoutBranch,yb as cleanupSourceControl,dS as cloneRepository,xT as commitRow,vT as createBranch,bT as discardFile,cS as fetchGitLog,hT as fetchRemote,wT as groupFilesByComponent,gT as includeNewChanges,_T as lastUpdatedLabel,lT as loadDiffForLens,rT as noteFileSaved,uT as openFileComparison,wa as platformHostsGit,sT as platformOpensPullRequests,vb as platformSupportsClone,pT as pullRemote,Ws as refreshGitStatus,CT as registerSourceControlCommands,xw as relativeDate,dT as runCloneRepository,mT as setAllIncluded,fT as setIncluded,cT as setSourceControlDeps,aT as statusTag};
|
|
2
|
-
|
|
3
|
-
//# debugId=55FBA1F2C604823C64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=source-control-bj9bejjv.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{p,_e}from"./studio-03mqh8ax.js";import{ae}from"./studio-cpkamjdn.js";import{C}from"./studio-4kzbrr5t.js";import{te}from"./studio-psh8mwnw.js";import{fO,Vn,Ce,ui}from"./studio-vzgmyt0v.js";import{Em,h}from"./studio-5wzdy1jc.js";import{zl,Cb,Ri,Nd,SS}from"./studio-2hsqbq7b.js";import{Vs}from"./studio-hy4ye0dx.js";import{Ws,wa,sT}from"./studio-hwejq03c.js";import{as}from"./studio-s0fg2wav.js";import{S}from"./studio-45gyxpcq.js";import{le}from"./studio-7xag4na8.js";var g={attempts:6,delayMs:5000};function P(e,t){return`https://dash.cloudflare.com/${e}/pages/view/${t}`}async function k(e){if(e>0)await new Promise((t)=>{setTimeout(t,e)})}async function d(e={}){let t=Ri(),r=new AbortController,i=Vs({cancel:()=>{r.abort()},source:"Publish",status:"Starting…",steps:["Push to the remote","Ask Cloudflare for the deployment"],title:"Deploy"});i.step("Push to the remote");try{await p().gitPush({setUpstream:!0}),i.log("Pushed the current branch.")}catch(a){return i.log(te(a)),i.fail("Could not push to the remote.",{action:"git.push"}),!1}if(!t)return i.done("Pushed. No provider is connected, so nothing was asked to build it."),!0;i.step("Ask Cloudflare for the deployment");let n=e.attempts??g.attempts,s=e.delayMs??g.delayMs;for(let a=0;a<n;a+=1){if(r.signal.aborted)return!1;let o;try{o=await Cb(t)}catch(l){return i.log(te(l)),i.fail("Cloudflare did not answer.",{action:"publish.deploy"}),!1}if(o)return Nd(o),i.log(`${o.stage}: ${o.status} — ${o.url}`),i.done(`${o.stage}: ${o.status}`),!0;await k(s)}if(r.signal.aborted)return!1;return Nd(null),i.done("Pushed. Cloudflare has not reported a deployment yet."),!0}function x(){return[{category:"Publish",id:"publish.setUp",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"an open project on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>e.capability.publish,run:async()=>{let{openPublishPanel:e}=await (le("d34bhvwj"),import("./publish-panel-d34bhvwj.js"));e()},title:"Set Up Publishing"},{category:"Publish",id:"publish.deploy",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a repository with a remote and a connected deploy provider, on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>e.project.isRepo&&Ri()!==void 0&&e.capability.publish,run:async()=>{await d()},title:"Deploy"},{category:"Publish",id:"publish.openDashboard",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a connected deploy provider, on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>Ri()!==void 0&&e.capability.publish,run:()=>{let e=Ri();if(e)window.open(P(e.accountId,e.projectName),"_blank","noopener")},title:"Open Deployment Dashboard"},{category:"Publish",id:"publish.quick",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a project tracked by git",when:(e)=>e.project.open,enablement:(e)=>e.project.isRepo,run:async()=>{let{openQuickPublish:e}=await (le("vr695j26"),import("./publish-quick-vr695j26.js"));e()},title:"Quick Publish"},{args:Ce({tab:ui(Em,"Which view of the Publish workspace to show: review (the changes and where they go), deploys (the live site and its deployments), branches, or hosting (where the project is saved and hosted). Defaults to the view the workspace was left on.")},[]),category:"Publish",id:"publish.open",level:"project",menus:["never"],group:"8_publish",requires:"an open project",enablement:(e)=>e.project.open,run:async(e,t)=>{let r=t.tab===void 0?null:Vn("publish.open",t,"tab",Em),i=ae();if(!i)throw Error(`command "publish.open" needs the window's command registry`);if(await i.run("view.setWorkspace",{workspace:"publish"}),r!==null){let{showPublishTab:n}=await (le("2yr60mt4"),import("./publish-workspace-2yr60mt4.js"));n(r)}},title:"Show Publish"}]}function iR(e){e.registerAll(x())}function u(){let e=h.git.status?.remotes;return Array.isArray(e)&&e.length>0?e[0]??"":""}function c(){return h.git.branches?.current||h.git.status?.branch||""}function b(){return Ri()!==void 0&&zl()&&u()!==""}function D(){let e=Ri();return e?.productionUrl??e?.projectName??""}function y(e){return`studio/${as(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"").slice(0,48).replace(/-$/,"")||"changes"}`}function f(){return h.git.branches?.defaultBranch??""}function Hg(){if(!sT())return"This host cannot open a pull request yet. Publish live, or create a branch under Branches and push it.";if(wa()){let e=f(),t=c();if(!e||!t||t===e)return`Every commit to ${e||"the default branch"} on this host is live. Create a branch under Branches and send it for review from there.`;return""}if(u()==="")return"A pull request needs a remote. Create the GitHub repository under Hosting first.";return""}function j(){let e=c()||"the current branch";if(b())return`Commits to ${e} and deploys to ${D()}.`;if(wa())return`Commits to ${e} on GitHub.`;let t=u();return t?`Commits to ${e} and pushes it to ${t}.`:`Commits to ${e}. This repository has no remote, so nothing leaves this machine.`}function A(){let e=c()||"the current branch";if(wa())return`Commits to ${e} and opens a pull request from it into ${f()||"the default branch"}.`;let t=h.git.commitMessage.trim();return`Saves to ${t?y(t):"a new studio/ branch"}, pushes it and opens a pull request into ${e}.`}function Ty(e){let t=Hg();return[{checked:e==="live"?"true":"false",disabled:!1,label:"Publish live",note:j(),reason:"",value:"live"},{checked:e==="review"?"true":"false",disabled:t!=="",label:"Send for review",note:A(),reason:t,value:"review"}]}function qf(e){return e==="review"&&Hg()!==""?"live":e}function oR(e){if(e==="review")return"Send for review";if(b())return"Publish live";return wa()||u()!==""?"Commit and push":"Commit"}function w(e){let t=h.git.status?.files??[];return e?t:t.filter((r)=>Boolean(r.staged))}function Gf(e,t=!1){let{status:r}=h.git;if(!S||!r?.isRepo)return"Track this project with git first.";if(h.git.loading)return"Source control is busy.";if(r.files.length===0)return"There is nothing to publish.";if(w(t).length===0)return"Include at least one change.";if(!h.git.commitMessage.trim())return"Write a summary of the change first.";return e==="review"?Hg():""}function v(){return(h.git.status?.files??[]).map((e)=>`${e.status}:${e.path}`).join("|")}function s_(){return _e()&&p().buildSite!==void 0}async function rR(){if(!s_()||h.publish.build.state==="running")return;let e=p().buildSite;if(!e)return;h.publish.build.state="running",h.publish.build.text="Building the site…",h.publish.build.for=v();try{let t=await e();if(t.errors.length>0)h.publish.build.state="failed",h.publish.build.text=`Built with ${t.errors.length} error(s): ${t.errors[0]}`;else h.publish.build.state="passed",h.publish.build.text=t.mode==="live"?`${t.routes} page(s) render. This host previews the working tree; it does not build.`:`Site builds: ${t.routes} page(s).`}catch(t){h.publish.build.state="failed",h.publish.build.text=`The site could not be built: ${te(t)}`}}function Bg(){let e=[],t=SS();if(e.push(t?{command:t.command,key:"deploy",state:t.state==="unknown"?"unknown":"todo",text:`${t.label}: ${t.detail}`}:{command:"",key:"deploy",state:"done",text:"Everything this project needs to ship is in place."}),s_()){let r=h.publish.build.for===v()||h.publish.build.state==="running";e.push(r&&h.publish.build.state!=="idle"?{command:"",key:"build",state:h.publish.build.state==="passed"?"done":h.publish.build.state==="failed"?"failed":"running",text:h.publish.build.text}:{command:"",key:"build",state:"unknown",text:"The site has not been built with these changes."})}return e}function sR(e){let t=e.filter((r)=>r.state!=="done");if(t.length===0)return"Checks passed: ready to publish.";return t.map((r)=>r.text).join(" · ")}function aR(){return h.publish.review.number>0?{number:h.publish.review.number,url:h.publish.review.url}:null}function R(e){if(!h.git.commitMessage)h.git.commitMessage=e}async function Ly(e,t={}){let r=t.includeAll??!1,i=Gf(e,r);if(i)return h.git.error=i,!1;let n=h.git.commitMessage.trim(),s=p();h.git.commitMessage="",h.git.loading=!0,h.git.error=null,await fO();let a=!1,o=!0;try{if(r){let l=w(!0).filter((m)=>!m.staged).map((m)=>m.path);if(l.length>0)await s.gitStage(l)}if(e==="review")await B(s,n,()=>{a=!0});else if(await s.gitCommit(n),a=!0,b())h.git.loading=!1,o=await d();else if(!wa()&&u()!=="")await s.gitPush();return await Ws(),o}catch(l){if(h.git.error=te(l),h.git.loading=!1,!a)R(n);return!1}}async function q(e,t,r){if(wa()){await e.gitCommit(t),r();let s=f();return s?{base:s,title:t}:{title:t}}let i=c(),n=y(t);return await e.gitCreateBranch(n),await e.gitCommit(t),r(),await e.gitPush({setUpstream:!0}),i?{base:i,head:n,title:t}:{head:n,title:t}}async function B(e,t,r){let i=e.createPullRequest;if(!i)throw Error(Hg());let n=await i(await q(e,t,r));h.publish.review.number=n.number,h.publish.review.url=n.url,C.success(`Pull request #${n.number} opened for review.`,{detail:n.url,key:"publish.review",source:"Publish"})}
|
|
2
|
-
export{iR,Hg,Ty,qf,oR,Gf,s_,rR,Bg,sR,aR,Ly};
|
|
3
|
-
|
|
4
|
-
//# debugId=B83C05FCD5F6BB0064756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-38g0jdz7.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{Un,m,jt}from"./studio-vzgmyt0v.js";import{kD}from"./studio-zgx7svjd.js";import{Xu}from"./studio-pqqq6v85.js";import{le}from"./studio-7xag4na8.js";var e="edit",a=new Set(["edit","design"]);function r(t){for(let i of m.tabs.values())if(i.documentPath===t)return i;return null}async function Ml(t){if(!Xu(t)){let o=Un(t);if(o&&!o.fileBacked)return kD(t);let{openFileInTab:s}=await (le("de90apn9"),import("./files-de90apn9.js"));return await s(t),r(t)}let{openFileInTab:i}=await (le("de90apn9"),import("./files-de90apn9.js"));await i(t);let n=r(t);if(!n)return null;if(!a.has(n.session.ui.canvasMode)&&n.capabilities.modes.includes(e))n.session.ui.canvasMode=e,n.session.ui.preview=!1;return jt(n.id),n}
|
|
2
|
-
export{Ml};
|
|
3
|
-
|
|
4
|
-
//# debugId=C86248B95CF9AA2164756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-dbxv7w4s.js.map
|