@jxsuite/studio 4.0.0 → 4.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.
Files changed (86) hide show
  1. package/dist/chunks/{2020-xp8vnwma.js → 2020-n6tfwnda.js} +2 -2
  2. package/dist/chunks/{Overlay.dev-723bv0df.js → Overlay.dev-etqjwyf9.js} +4 -4
  3. package/dist/chunks/cf-account-picker-en86v7x7.js +163 -0
  4. package/dist/chunks/{content-source-t88vb2dr.js → content-source-48xg86wj.js} +17 -17
  5. package/dist/chunks/{convert-to-repeater-dhw1nrz9.js → convert-to-repeater-43tfn7cs.js} +24 -24
  6. package/dist/chunks/{entry-commands-6z6bhxg0.js → entry-commands-e63f1xc0.js} +20 -20
  7. package/dist/chunks/{extension-sections-3ydgjbdy.js → extension-sections-txv08xxg.js} +23 -23
  8. package/dist/chunks/{file-ops-rskmhxyq.js → file-ops-wbh4hhsx.js} +16 -16
  9. package/dist/chunks/{files-0cratsr0.js → files-3kfkwhk4.js} +25 -24
  10. package/dist/chunks/{focus-trap.esm-ggawf1hy.js → focus-trap.esm-9t2drp0g.js} +6 -5
  11. package/dist/chunks/{format-host-tgcmfs4p.js → format-host-w16q81tf.js} +2 -2
  12. package/dist/chunks/fs-events-hrrg328g.js +1 -1
  13. package/dist/chunks/{git-panel-0yywyk76.js → git-panel-532whr1y.js} +16 -15
  14. package/dist/chunks/{index-nj44jpzj.js → index-wcnt3r9g.js} +2 -2
  15. package/dist/chunks/{jx-validate-8q2g05x1.js → jx-validate-8er6gbxy.js} +3 -3
  16. package/dist/chunks/{layers-panel-z3tqe5cd.js → layers-panel-07hm7g5j.js} +19 -19
  17. package/dist/chunks/{monaco-setup-rws7k4br.js → monaco-setup-vx9bhp1d.js} +2 -2
  18. package/dist/chunks/{publish-panel-54jvhskq.js → publish-panel-v9st96ja.js} +11 -10
  19. package/dist/chunks/{quick-search-cgfmjwq5.js → quick-search-zccjp6gv.js} +26 -25
  20. package/dist/chunks/{right-panel-cqp8bc4v.js → right-panel-vm3b6kwy.js} +17 -17
  21. package/dist/chunks/{sp-overlay.dev-yztmtrs1.js → sp-overlay.dev-qgvhnxf4.js} +5 -5
  22. package/dist/chunks/{sp-tooltip.dev-xcvpnqr0.js → sp-tooltip.dev-4sastdnw.js} +3 -3
  23. package/dist/chunks/{studio-txwkm6p9.js → studio-0bq6eh7v.js} +2 -2
  24. package/dist/chunks/studio-1ngbejft.js +181 -0
  25. package/dist/chunks/{studio-gv8vvshc.js → studio-1wagb550.js} +3 -3
  26. package/dist/chunks/{studio-kjjsjak4.js → studio-2b946z26.js} +58 -57
  27. package/dist/chunks/{studio-4pqqxbrt.js → studio-3bqpr0zh.js} +16 -16
  28. package/dist/chunks/{studio-v38hmvx1.js → studio-4b5z1x43.js} +42 -8
  29. package/dist/chunks/{studio-9c4k4vhv.js → studio-4n2b5gzb.js} +4 -4
  30. package/dist/chunks/{studio-p8j86wag.js → studio-4r1pv6zf.js} +2 -2
  31. package/dist/chunks/{studio-mmv72a27.js → studio-5fx3g9jg.js} +29 -48
  32. package/dist/chunks/{studio-5rywrkxz.js → studio-5myknm0a.js} +42 -42
  33. package/dist/chunks/{studio-sf7zjgv1.js → studio-6yw4y3my.js} +3 -3
  34. package/dist/chunks/{studio-pdfjntbk.js → studio-950k0dx6.js} +35 -35
  35. package/dist/chunks/{studio-eenfkt4e.js → studio-ahn3pdgx.js} +5 -5
  36. package/dist/chunks/{studio-eesa1myv.js → studio-b55y6ewx.js} +9 -9
  37. package/dist/chunks/{studio-cb12yz9w.js → studio-cmb03bg5.js} +99 -1264
  38. package/dist/chunks/studio-dm19q43r.js +195 -0
  39. package/dist/chunks/{studio-ahjfdy6e.js → studio-ef49pnzx.js} +6 -6
  40. package/dist/chunks/{studio-wx5609xd.js → studio-ew0djmhg.js} +10 -10
  41. package/dist/chunks/{studio-9r6j5ev1.js → studio-f3wqjtk5.js} +4 -3
  42. package/dist/chunks/{studio-8swrjbny.js → studio-fbf92ckf.js} +14 -14
  43. package/dist/chunks/{studio-4q0wznzf.js → studio-gcye7qka.js} +442 -126
  44. package/dist/chunks/{studio-ex8zyp98.js → studio-gfgb8pe6.js} +23 -184
  45. package/dist/chunks/{studio-r1r7afxx.js → studio-jc994dnr.js} +24 -24
  46. package/dist/chunks/{studio-yxrkyv8a.js → studio-jkftxyvz.js} +52 -3416
  47. package/dist/chunks/{studio-hbtp0eh1.js → studio-msd847zn.js} +13 -13
  48. package/dist/chunks/{studio-kyk2v92a.js → studio-mtfnaqs9.js} +14 -14
  49. package/dist/chunks/{studio-vadzgkrz.js → studio-n6j9t10q.js} +2 -2
  50. package/dist/chunks/{studio-68n67094.js → studio-q9jd1a60.js} +4 -4
  51. package/dist/chunks/studio-qcy05dp8.js +1743 -0
  52. package/dist/chunks/{studio-htsf0w6m.js → studio-qjy2z9bv.js} +12 -30
  53. package/dist/chunks/{studio-2zkz8evn.js → studio-trxrabqf.js} +12 -12
  54. package/dist/chunks/{studio-5q69gfag.js → studio-x4qkdat5.js} +12 -11
  55. package/dist/chunks/studio-x813zp48.js +195 -0
  56. package/dist/chunks/{studio-1hbqnt19.js → studio-zqazsct2.js} +29 -29
  57. package/dist/chunks/{workspace-xpres40v.js → workspace-fjx52ryv.js} +4 -4
  58. package/dist/iframe-entry.js +34 -33
  59. package/dist/manifest.json +7 -0
  60. package/dist/studio.js +534 -546
  61. package/favicon.ico +0 -0
  62. package/index.html +1 -0
  63. package/package.json +15 -14
  64. package/src/about/about-modal.ts +4 -3
  65. package/src/files/files.ts +6 -4
  66. package/src/files/media-paths.ts +13 -42
  67. package/src/files/media-usage.ts +41 -131
  68. package/src/hosting/document.ts +2 -0
  69. package/src/hosting/layout.ts +8 -0
  70. package/src/new-project/import-tab.ts +37 -15
  71. package/src/new-project/location-fields.ts +8 -5
  72. package/src/panels/ai-chat/composer.ts +10 -0
  73. package/src/platforms/cloud.ts +241 -70
  74. package/src/publish/publish-panel.ts +62 -2
  75. package/src/services/ai-import-tools.ts +50 -12
  76. package/src/services/ai-models.ts +108 -1
  77. package/src/services/context-manager.ts +12 -1
  78. package/src/services/tool-executor.ts +11 -0
  79. package/src/settings/preferences-accounts.ts +193 -12
  80. package/src/settings/preferences-dialog.ts +75 -18
  81. package/src/types.ts +27 -3
  82. package/src/ui/ai-managed-connect.ts +62 -13
  83. package/src/ui/ai-model-picker.ts +29 -2
  84. package/src/ui/cf-account-picker.ts +200 -0
  85. package/styles/shell.css +36 -0
  86. package/dist/chunks/studio-bw5dz6km.js +0 -608
@@ -1,21 +1,36 @@
1
1
  import {
2
2
  pendingSchedulers
3
3
  } from "./studio-8jpzqk5s.js";
4
+ import {
5
+ authenticateGithub
6
+ } from "./studio-1ngbejft.js";
4
7
  import {
5
8
  activityIdleBlockers,
6
9
  beginActivity,
7
10
  showProgressModal
8
- } from "./studio-9c4k4vhv.js";
11
+ } from "./studio-4n2b5gzb.js";
9
12
  import {
10
13
  canvasIdleBlockers,
11
14
  canvasPointAt,
12
15
  registerPanel,
13
16
  renderEmptyState,
14
17
  revealCanvasPath
15
- } from "./studio-kjjsjak4.js";
18
+ } from "./studio-2b946z26.js";
16
19
  import {
17
20
  shell
18
- } from "./studio-hbtp0eh1.js";
21
+ } from "./studio-msd847zn.js";
22
+ import {
23
+ activeTab,
24
+ collabState,
25
+ flushAllCollab
26
+ } from "./studio-trxrabqf.js";
27
+ import {
28
+ POLL_GIT,
29
+ projectState,
30
+ render,
31
+ renderOnly,
32
+ rendersInFlight
33
+ } from "./studio-p4ngc046.js";
19
34
  import {
20
35
  overlayIdleBlockers,
21
36
  showConfirmDialog,
@@ -25,11 +40,6 @@ import {
25
40
  import {
26
41
  errorMessage
27
42
  } from "./studio-9n4mrmnb.js";
28
- import {
29
- activeTab,
30
- collabState,
31
- flushAllCollab
32
- } from "./studio-2zkz8evn.js";
33
43
  import {
34
44
  notify,
35
45
  now
@@ -43,16 +53,9 @@ import {
43
53
  html,
44
54
  nothing
45
55
  } from "./studio-kryvsw6j.js";
46
- import {
47
- POLL_GIT,
48
- projectState,
49
- render,
50
- renderOnly,
51
- rendersInFlight
52
- } from "./studio-p4ngc046.js";
53
56
  import {
54
57
  formatForPath
55
- } from "./studio-eenfkt4e.js";
58
+ } from "./studio-ahn3pdgx.js";
56
59
  import {
57
60
  getPlatform,
58
61
  hasPlatform,
@@ -62,170 +65,6 @@ import {
62
65
  __require
63
66
  } from "./studio-a0tswy0w.js";
64
67
 
65
- // src/github/github-auth.ts
66
- var CLIENT_ID = "Ov23liYVlMFpgjOEPXJH";
67
- var STORAGE_KEY = "jx_github_token";
68
- function nativeAuth() {
69
- return globalThis.__jxPlatform?.githubAuth ?? null;
70
- }
71
- var nativeToken = null;
72
- var nativeStored = false;
73
- function githubTokenStored() {
74
- return nativeToken !== null || nativeStored || localStorage.getItem(STORAGE_KEY) !== null;
75
- }
76
- function githubTokenLocation() {
77
- return nativeAuth() ? "desktop" : "browser";
78
- }
79
- var NOTIFY_KEY = "github.auth";
80
- var SOURCE = "Source Control";
81
- var RETRY = "git.signInToGithub";
82
- var MAX_POLL_FAILURES = 3;
83
- var UNREACHABLE_DETAIL = "The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a " + "browser cannot call them directly — the desktop app can. A machine that is offline fails " + "identically, and the browser does not say which happened.";
84
- function getGithubToken() {
85
- return nativeToken ?? localStorage.getItem(STORAGE_KEY);
86
- }
87
- function clearGithubToken() {
88
- nativeToken = null;
89
- nativeStored = false;
90
- localStorage.removeItem(STORAGE_KEY);
91
- nativeAuth()?.signOut().catch(() => {});
92
- }
93
- function reportUnreachable(error) {
94
- notify.error("Could not reach GitHub to sign in.", {
95
- action: RETRY,
96
- detail: `${UNREACHABLE_DETAIL}
97
-
98
- ${errorMessage(error)}`,
99
- key: NOTIFY_KEY,
100
- source: SOURCE
101
- });
102
- }
103
- function reportRefused(message, detail) {
104
- notify.warn(message, { action: RETRY, detail, key: NOTIFY_KEY, source: SOURCE });
105
- }
106
- async function requestDeviceCode() {
107
- let codeRes;
108
- try {
109
- codeRes = await fetch("https://github.com/login/device/code", {
110
- body: JSON.stringify({ client_id: CLIENT_ID, scope: "repo" }),
111
- headers: {
112
- Accept: "application/json",
113
- "Content-Type": "application/json"
114
- },
115
- method: "POST"
116
- });
117
- } catch (error) {
118
- reportUnreachable(error);
119
- return null;
120
- }
121
- if (!codeRes.ok) {
122
- reportRefused("GitHub refused to start the sign-in.", `GitHub answered ${codeRes.status}${codeRes.statusText ? ` ${codeRes.statusText}` : ""}.`);
123
- return null;
124
- }
125
- return await codeRes.json();
126
- }
127
- async function authenticateGithub() {
128
- const existing = getGithubToken();
129
- if (existing) {
130
- return existing;
131
- }
132
- const native = nativeAuth();
133
- if (native) {
134
- try {
135
- const { token } = await native.signIn();
136
- nativeToken = token;
137
- return token;
138
- } catch (error) {
139
- reportRefused("GitHub sign-in was not completed.", errorMessage(error));
140
- return null;
141
- }
142
- }
143
- const codeData = await requestDeviceCode();
144
- if (!codeData) {
145
- return null;
146
- }
147
- const { device_code, user_code, verification_uri, interval = 5 } = codeData;
148
- return showDialog((done) => {
149
- let cancelled = false;
150
- let pollTimer = null;
151
- let failures = 0;
152
- const stop = () => {
153
- cancelled = true;
154
- if (pollTimer) {
155
- clearTimeout(pollTimer);
156
- }
157
- done(null);
158
- };
159
- const poll = async () => {
160
- if (cancelled) {
161
- return;
162
- }
163
- try {
164
- const tokenRes = await fetch("https://github.com/login/oauth/access_token", {
165
- body: JSON.stringify({
166
- client_id: CLIENT_ID,
167
- device_code,
168
- grant_type: "urn:ietf:params:oauth:grant-type:device_code"
169
- }),
170
- headers: {
171
- Accept: "application/json",
172
- "Content-Type": "application/json"
173
- },
174
- method: "POST"
175
- });
176
- const tokenData = await tokenRes.json();
177
- failures = 0;
178
- if (tokenData.access_token) {
179
- localStorage.setItem(STORAGE_KEY, tokenData.access_token);
180
- done(tokenData.access_token);
181
- return;
182
- }
183
- if (tokenData.error === "authorization_pending") {
184
- pollTimer = setTimeout(poll, interval * 1000);
185
- return;
186
- }
187
- if (tokenData.error === "slow_down") {
188
- pollTimer = setTimeout(poll, (interval + 5) * 1000);
189
- return;
190
- }
191
- reportRefused("GitHub sign-in was not completed.", tokenData.error === "access_denied" ? "The authorization was declined on GitHub." : tokenData.error === "expired_token" ? "The device code expired before it was entered." : `GitHub answered "${tokenData.error ?? "an unrecognised response"}".`);
192
- cancelled = true;
193
- done(null);
194
- } catch (error) {
195
- failures += 1;
196
- if (failures >= MAX_POLL_FAILURES) {
197
- reportUnreachable(error);
198
- cancelled = true;
199
- done(null);
200
- return;
201
- }
202
- pollTimer = setTimeout(poll, interval * 1000);
203
- }
204
- };
205
- pollTimer = setTimeout(poll, interval * 1000);
206
- return html`
207
- <sp-dialog-wrapper
208
- open
209
- headline="Sign in to GitHub"
210
- cancel-label="Cancel"
211
- @cancel=${stop}
212
- @close=${stop}
213
- >
214
- <div class="github-auth-dialog">
215
- <p>Enter this code on GitHub to authorize Jx Studio:</p>
216
- <div class="github-auth-code">${user_code}</div>
217
- <p>
218
- <a href="${verification_uri}" target="_blank" rel="noopener"
219
- >Open ${verification_uri}</a
220
- >
221
- </p>
222
- <p class="github-auth-waiting">Waiting for authorization…</p>
223
- </div>
224
- </sp-dialog-wrapper>
225
- `;
226
- });
227
- }
228
-
229
68
  // src/github/github-publish.ts
230
69
  var REPO_STEPS = ["Create the repository", "Add the remote", "Push"];
231
70
  async function createGithubRepository({ projectName }) {
@@ -352,7 +191,7 @@ async function createGithubRepository({ projectName }) {
352
191
  });
353
192
  return false;
354
193
  }
355
- const { refreshGitStatus } = await import("./git-panel-0yywyk76.js");
194
+ const { refreshGitStatus } = await import("./git-panel-532whr1y.js");
356
195
  await refreshGitStatus();
357
196
  activity.done(repo.html_url);
358
197
  notify.success(`Repository created: ${repo.html_url}`, { key: "github.repo" });
@@ -1807,7 +1646,7 @@ function registerGitPanel() {
1807
1646
  });
1808
1647
  }
1809
1648
 
1810
- export { hydrateProjectList, getProjectList, registerGridProbe, shouldInstallAutomation, installAutomationHook, stripRange, isUpgrade, maybePromptJxsuiteUpdate, autoSyncProjectOnOpen, githubTokenStored, githubTokenLocation, clearGithubToken, refreshGitStatus, cloneRepository, platformSupportsClone, readGitDiff, loadDiffForLens, initRepository, pushCurrentBranch, signInToGithub, renderGitPanel, relativeDate, sourceControlCommands, registerSourceControlCommands, cleanupGitPanel, registerGitPanel };
1649
+ export { hydrateProjectList, getProjectList, registerGridProbe, shouldInstallAutomation, installAutomationHook, stripRange, isUpgrade, maybePromptJxsuiteUpdate, autoSyncProjectOnOpen, refreshGitStatus, cloneRepository, platformSupportsClone, readGitDiff, loadDiffForLens, initRepository, pushCurrentBranch, signInToGithub, renderGitPanel, relativeDate, sourceControlCommands, registerSourceControlCommands, cleanupGitPanel, registerGitPanel };
1811
1650
 
1812
- //# debugId=C93BAA1491AC405A64756E2164756E21
1813
- //# sourceMappingURL=studio-ex8zyp98.js.map
1651
+ //# debugId=A3E12C5252EAE27564756E2164756E21
1652
+ //# sourceMappingURL=studio-gfgb8pe6.js.map
@@ -7,13 +7,13 @@ import {
7
7
  entryCollections,
8
8
  missingRequired,
9
9
  seedEntry
10
- } from "./studio-sf7zjgv1.js";
10
+ } from "./studio-6yw4y3my.js";
11
11
  import {
12
12
  referenceTarget,
13
13
  registerFormControl,
14
14
  renderForm,
15
15
  resolveContextPointer
16
- } from "./studio-5q69gfag.js";
16
+ } from "./studio-x4qkdat5.js";
17
17
  import {
18
18
  DRAFT_FIELD,
19
19
  DRAFT_MEANING,
@@ -21,17 +21,10 @@ import {
21
21
  isDraftEntry,
22
22
  reloadDraftAwareGrids,
23
23
  setIncludeDrafts
24
- } from "./studio-eesa1myv.js";
24
+ } from "./studio-b55y6ewx.js";
25
25
  import {
26
26
  notePreviewOverlayEdit
27
- } from "./studio-cb12yz9w.js";
28
- import {
29
- activeRegistry,
30
- paneRegion
31
- } from "./studio-t7qb9db8.js";
32
- import {
33
- errorMessage
34
- } from "./studio-9n4mrmnb.js";
27
+ } from "./studio-cmb03bg5.js";
35
28
  import {
36
29
  LOCALE_PLACEHOLDER,
37
30
  activateTab,
@@ -50,7 +43,20 @@ import {
50
43
  toCamelCase,
51
44
  transactDoc,
52
45
  workspace
53
- } from "./studio-2zkz8evn.js";
46
+ } from "./studio-trxrabqf.js";
47
+ import {
48
+ cloneValue
49
+ } from "./studio-5ehhackm.js";
50
+ import {
51
+ projectState
52
+ } from "./studio-p4ngc046.js";
53
+ import {
54
+ activeRegistry,
55
+ paneRegion
56
+ } from "./studio-t7qb9db8.js";
57
+ import {
58
+ errorMessage
59
+ } from "./studio-9n4mrmnb.js";
54
60
  import {
55
61
  effect,
56
62
  effectScope,
@@ -65,19 +71,13 @@ import {
65
71
  nothing,
66
72
  render
67
73
  } from "./studio-kryvsw6j.js";
68
- import {
69
- cloneValue
70
- } from "./studio-5ehhackm.js";
71
- import {
72
- projectState
73
- } from "./studio-p4ngc046.js";
74
74
  import {
75
75
  defaultContentFormat,
76
76
  formatByName,
77
77
  formatForPath,
78
78
  formatSerialize,
79
79
  loadFormats
80
- } from "./studio-eenfkt4e.js";
80
+ } from "./studio-ahn3pdgx.js";
81
81
  import {
82
82
  __require
83
83
  } from "./studio-a0tswy0w.js";
@@ -618,7 +618,7 @@ function entryIdsFor(collection) {
618
618
  if (known) {
619
619
  return known;
620
620
  }
621
- const pending = import("./content-source-t88vb2dr.js").then((m) => m.listCollectionEntryIds(collection));
621
+ const pending = import("./content-source-48xg86wj.js").then((m) => m.listCollectionEntryIds(collection));
622
622
  entryIdCache.set(collection, pending);
623
623
  return pending;
624
624
  }
@@ -880,7 +880,7 @@ function renderEntryMode(surface, tab) {
880
880
  });
881
881
  }
882
882
  async function openEntryEditor(path) {
883
- const { openFileInTab } = await import("./files-0cratsr0.js");
883
+ const { openFileInTab } = await import("./files-3kfkwhk4.js");
884
884
  await openFileInTab(path);
885
885
  for (const [id, tab] of workspace.tabs.entries()) {
886
886
  if (tab.documentPath !== path) {
@@ -942,7 +942,7 @@ async function createEntry(collectionName, opts = {}) {
942
942
  });
943
943
  return null;
944
944
  }
945
- const { createFileIn } = await import("./files-0cratsr0.js");
945
+ const { createFileIn } = await import("./files-3kfkwhk4.js");
946
946
  const created = await createFileIn({
947
947
  content,
948
948
  dir: destination,
@@ -1062,5 +1062,5 @@ function registerContentCommands(registry) {
1062
1062
 
1063
1063
  export { detectFieldFormat, fieldCardTpl, addFieldFormTpl, schemaForType, entryFields, entryPaneMounted, detachEntryPane, entryDraftPill, renderEntryMode, createEntry, contentCommands, registerContentCommands };
1064
1064
 
1065
- //# debugId=1103B912C500FD3E64756E2164756E21
1066
- //# sourceMappingURL=studio-r1r7afxx.js.map
1065
+ //# debugId=F59DE349279673DF64756E2164756E21
1066
+ //# sourceMappingURL=studio-jc994dnr.js.map