@jxsuite/studio 3.0.0 → 4.0.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/README.md +5 -5
- package/dist/chunks/Overlay.dev-723bv0df.js +23 -0
- package/dist/chunks/{cf-settings-zj2cj1ar.js → cf-settings-45fgyx8y.js} +6 -5
- package/dist/chunks/{components-z6cnkyy1.js → components-zmx10t62.js} +6 -5
- package/dist/chunks/content-source-t88vb2dr.js +49 -0
- package/dist/chunks/{convert-to-repeater-6vvx96n2.js → convert-to-repeater-dhw1nrz9.js} +27 -19
- package/dist/chunks/entry-commands-6z6bhxg0.js +46 -0
- package/dist/chunks/{extension-sections-kwzvpemr.js → extension-sections-3ydgjbdy.js} +32 -24
- package/dist/chunks/file-ops-rskmhxyq.js +48 -0
- package/dist/chunks/files-0cratsr0.js +92 -0
- package/dist/chunks/{format-host-8fr3545e.js → format-host-tgcmfs4p.js} +3 -3
- package/dist/chunks/fs-events-hrrg328g.js +21 -0
- package/dist/chunks/{git-panel-g01d93vc.js → git-panel-0yywyk76.js} +21 -16
- package/dist/chunks/{jx-validate-jj9rnt4n.js → jx-validate-8q2g05x1.js} +6 -4
- package/dist/chunks/layers-panel-z3tqe5cd.js +67 -0
- package/dist/chunks/layers-q75tj2mf.js +45 -0
- package/dist/chunks/lit-html-j055mkh8.js +22 -0
- package/dist/chunks/monaco-buffer-dqw0xxpx.js +25 -0
- package/dist/chunks/{monaco-setup-a5wkmbgh.js → monaco-setup-rws7k4br.js} +4 -4
- package/dist/chunks/notify-yjm79n4s.js +30 -0
- package/dist/chunks/parse-24d0gay3.js +19 -0
- package/dist/chunks/platform-ba1j1gbh.js +16 -0
- package/dist/chunks/publish-panel-54jvhskq.js +28 -0
- package/dist/chunks/quick-search-cgfmjwq5.js +65 -0
- package/dist/chunks/references-3qx8fkyp.js +29 -0
- package/dist/chunks/right-panel-cqp8bc4v.js +46 -0
- package/dist/chunks/sp-overlay.dev-yztmtrs1.js +18 -0
- package/dist/chunks/sp-popover.dev-n2etmqdp.js +9 -0
- package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +15 -0
- package/dist/chunks/sp-tooltip.dev-xcvpnqr0.js +15 -0
- package/dist/chunks/{sp-tray.dev-64v4pxw8.js → sp-tray.dev-tkbscm06.js} +5 -5
- package/dist/chunks/{studio-8ezdegcx.js → studio-1hbqnt19.js} +36 -32
- package/dist/chunks/{studio-r5xbtctf.js → studio-2zkz8evn.js} +446 -2451
- package/dist/chunks/{studio-pkp61mh8.js → studio-4pqqxbrt.js} +23 -15
- package/dist/chunks/{studio-kvfx9z2c.js → studio-4rzyrtjz.js} +70 -31
- package/dist/chunks/{studio-3dkcd4c5.js → studio-5q69gfag.js} +60 -56
- package/dist/chunks/{studio-rh1cnamv.js → studio-5rywrkxz.js} +563 -133
- package/dist/chunks/{studio-6kv3apa9.js → studio-68n67094.js} +25 -9
- package/dist/chunks/{studio-0rqqhrdy.js → studio-7nte2hj4.js} +2 -2
- package/dist/chunks/{studio-xntfdy1x.js → studio-8swrjbny.js} +31 -18
- package/dist/chunks/studio-92ab2jqe.js +282 -0
- package/dist/chunks/{studio-sas7mt3k.js → studio-9ab8gqsm.js} +2 -2
- package/dist/chunks/{studio-ry1vz5sv.js → studio-9c4k4vhv.js} +15 -13
- package/dist/chunks/studio-9n4mrmnb.js +184 -0
- package/dist/chunks/{studio-tr20m8g8.js → studio-9r6j5ev1.js} +37 -2
- package/dist/chunks/{studio-2x9zbxmx.js → studio-ahjfdy6e.js} +9 -7
- package/dist/chunks/{studio-s519zc99.js → studio-bgxt93ga.js} +3 -3
- package/dist/chunks/{studio-dc8s8heb.js → studio-cb12yz9w.js} +8528 -8780
- package/dist/chunks/studio-cft9r4r7.js +119 -0
- package/dist/chunks/{studio-hcxzyk3x.js → studio-eenfkt4e.js} +6 -6
- package/dist/chunks/studio-eesa1myv.js +498 -0
- package/dist/chunks/{studio-ay8wcr2b.js → studio-eqq1w638.js} +7 -9
- package/dist/chunks/{studio-7p35254k.js → studio-ex8zyp98.js} +30 -26
- package/dist/chunks/studio-gv8vvshc.js +118 -0
- package/dist/chunks/studio-hbtp0eh1.js +1315 -0
- package/dist/chunks/{studio-a0yp7syn.js → studio-htsf0w6m.js} +29 -114
- package/dist/chunks/{studio-j595e748.js → studio-kjjsjak4.js} +139 -63
- package/dist/chunks/{studio-5x5774ak.js → studio-kryvsw6j.js} +3 -3
- package/dist/chunks/{studio-kfpek536.js → studio-kyh9avvv.js} +2 -2
- package/dist/chunks/{studio-g5gdqnyd.js → studio-kyk2v92a.js} +14 -14
- package/dist/chunks/{studio-twsafr1e.js → studio-m3hwn7y1.js} +3 -3
- package/dist/chunks/{studio-tzx3xmvx.js → studio-mmv72a27.js} +8 -8
- package/dist/chunks/{studio-vhk5fmfv.js → studio-n8b9wqwy.js} +5 -5
- package/dist/chunks/{studio-cjm7fdjf.js → studio-p4ngc046.js} +8 -104
- package/dist/chunks/{studio-p5dja96s.js → studio-p8j86wag.js} +2 -2
- package/dist/chunks/{studio-6z5eyjwn.js → studio-pdfjntbk.js} +66 -129
- package/dist/chunks/studio-q43a5y9h.js +394 -0
- package/dist/chunks/studio-q7v10cg2.js +106 -0
- package/dist/chunks/{studio-2w11grav.js → studio-qq6jym04.js} +3 -3
- package/dist/chunks/studio-r1r7afxx.js +1066 -0
- package/dist/chunks/{studio-3fk1ac9z.js → studio-rdx8jcxy.js} +4 -4
- package/dist/chunks/{studio-4mqb9a0j.js → studio-rn9ta2mz.js} +4 -4
- package/dist/chunks/studio-sf7zjgv1.js +91 -0
- package/dist/chunks/studio-t7qb9db8.js +665 -0
- package/dist/chunks/studio-tmc5emrw.js +8 -0
- package/dist/chunks/{studio-wdt9y92a.js → studio-txwkm6p9.js} +2 -2
- package/dist/chunks/{studio-k4jvjcfx.js → studio-v38hmvx1.js} +7 -7
- package/dist/chunks/{studio-7ejemhej.js → studio-vadzgkrz.js} +6 -6
- package/dist/chunks/studio-wcy8trfx.js +263 -0
- package/dist/chunks/{studio-5efrtn1m.js → studio-wx5609xd.js} +21 -17
- package/dist/chunks/{studio-qpfq7xhm.js → studio-xrapxwwc.js} +22 -285
- package/dist/chunks/{studio-hj2se583.js → studio-yxrkyv8a.js} +41 -31
- package/dist/chunks/{studio-xm3dbxvn.js → studio-zczps70q.js} +2 -2
- package/dist/chunks/workspace-xpres40v.js +89 -0
- package/dist/iframe-entry.js +108 -24
- package/dist/studio.js +2362 -1695
- package/package.json +16 -15
- package/src/browse/library-pane.ts +57 -3
- package/src/canvas/canvas-render.ts +23 -1
- package/src/canvas/iframe-patch.ts +47 -21
- package/src/canvas/iframe-render.ts +22 -6
- package/src/commands/app-commands.ts +4 -0
- package/src/commands/command-args.ts +29 -0
- package/src/commands/context.ts +15 -1
- package/src/commands/defaults.ts +29 -1
- package/src/commands/levels.ts +16 -0
- package/src/commands/live-context.ts +3 -0
- package/src/content/collection-match.ts +267 -0
- package/src/content/entry-commands.ts +38 -29
- package/src/content/entry-fields.ts +6 -0
- package/src/editor/shortcuts.ts +5 -0
- package/src/files/file-ops.ts +10 -42
- package/src/files/files.ts +485 -59
- package/src/files/fs-events.ts +9 -0
- package/src/files/gitignore.ts +432 -0
- package/src/files/serialize-document.ts +60 -0
- package/src/format/convert-file.ts +511 -0
- package/src/format/format-choices.ts +199 -0
- package/src/grid/grid-view.ts +16 -2
- package/src/media/media-open.ts +58 -0
- package/src/media/media-pane.ts +310 -0
- package/src/new-project/import-tab.ts +332 -160
- package/src/new-project/new-project-modal.ts +27 -34
- package/src/packages/ensure-deps.ts +14 -7
- package/src/packages/jxsuite-update.ts +11 -11
- package/src/page-params.ts +10 -46
- package/src/panels/activity-bar.ts +45 -16
- package/src/panels/ai-chat/attached-context.ts +6 -1
- package/src/panels/ai-chat/chat-view.ts +255 -13
- package/src/panels/ai-chat/composer.ts +21 -97
- package/src/panels/ai-panel.ts +116 -2
- package/src/panels/navigator-panels.ts +7 -6
- package/src/panels/settings-menu.ts +799 -0
- package/src/panels/toolbar.ts +135 -15
- package/src/platforms/cloud.ts +20 -0
- package/src/platforms/devserver.ts +67 -33
- package/src/preview/preview-overlay.ts +226 -0
- package/src/services/ai-ask.ts +247 -0
- package/src/services/ai-import-tools.ts +494 -0
- package/src/services/ai-project-tools.ts +20 -26
- package/src/services/ai-system-prompt.ts +88 -2
- package/src/services/ai-turn-signal.ts +70 -0
- package/src/services/connection.ts +74 -0
- package/src/services/context-manager.ts +89 -0
- package/src/services/document-assistant.ts +45 -4
- package/src/services/import-client.ts +33 -6
- package/src/services/import-run.ts +158 -0
- package/src/services/import-seed.ts +120 -0
- package/src/services/jx-validate.ts +58 -6
- package/src/services/project-adoption.ts +71 -0
- package/src/services/references.ts +0 -0
- package/src/services/settings/definitions.ts +17 -0
- package/src/services/tool-executor.ts +34 -2
- package/src/settings/contexts-section.ts +45 -3
- package/src/settings/dependencies-editor.ts +43 -23
- package/src/settings/general-settings.ts +30 -12
- package/src/settings/preferences-dialog.ts +18 -41
- package/src/settings/preferences-sections.ts +57 -0
- package/src/settings/settings-document.ts +65 -9
- package/src/studio.ts +33 -6
- package/src/tabs/transact.ts +42 -19
- package/src/types.ts +103 -5
- package/src/ui/ai-model-picker.ts +162 -0
- package/src/ui/choice-field.ts +72 -0
- package/src/ui/layers.ts +83 -5
- package/src/utils/studio-utils.ts +22 -52
- package/styles/forced-colors.css +7 -0
- package/styles/overlays.css +256 -0
- package/styles/panels.css +13 -1
- package/styles/shell.css +111 -0
- package/dist/chunks/Overlay.dev-d2ajy6sj.js +0 -23
- package/dist/chunks/content-source-7fy9qrm0.js +0 -40
- package/dist/chunks/files-xcybanxe.js +0 -70
- package/dist/chunks/layers-panel-27essgkc.js +0 -60
- package/dist/chunks/publish-panel-09sy2bab.js +0 -22
- package/dist/chunks/quick-search-sefb61v8.js +0 -55
- package/dist/chunks/right-panel-9r32jd5j.js +0 -39
- package/dist/chunks/sp-overlay.dev-s18hymn9.js +0 -18
- package/dist/chunks/sp-popover.dev-dj9x7e7a.js +0 -9
- package/dist/chunks/sp-progress-circle.dev-0zxcyz3r.js +0 -15
- package/dist/chunks/sp-tooltip.dev-5c6d1kjz.js +0 -15
- package/dist/chunks/studio-c31yb4t6.js +0 -55
- package/src/canvas/site-style-css.ts +0 -117
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
project_schema_default,
|
|
3
3
|
schema_default
|
|
4
|
-
} from "./studio-
|
|
4
|
+
} from "./studio-9r6j5ev1.js";
|
|
5
5
|
import {
|
|
6
6
|
__require,
|
|
7
7
|
__toESM
|
|
@@ -36,23 +36,32 @@ function getValidator(kind) {
|
|
|
36
36
|
})();
|
|
37
37
|
return compiling[kind];
|
|
38
38
|
}
|
|
39
|
+
function asSchema(value) {
|
|
40
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length > 0 ? value : undefined;
|
|
41
|
+
}
|
|
39
42
|
function applyProjectSchemas(schemas) {
|
|
40
|
-
const document = schemas?.document ?? CORE.document;
|
|
41
|
-
const project = schemas?.project ?? CORE.project;
|
|
43
|
+
const document = asSchema(schemas?.document) ?? CORE.document;
|
|
44
|
+
const project = asSchema(schemas?.project) ?? CORE.project;
|
|
45
|
+
const applied = document !== CORE.document || project !== CORE.project;
|
|
42
46
|
if (document === active.document && project === active.project) {
|
|
43
|
-
return
|
|
47
|
+
return applied;
|
|
44
48
|
}
|
|
45
49
|
active.document = document;
|
|
46
50
|
active.project = project;
|
|
47
51
|
compiling.document = null;
|
|
48
52
|
compiling.project = null;
|
|
49
|
-
return
|
|
53
|
+
return applied;
|
|
50
54
|
}
|
|
51
55
|
function resetProjectSchemas() {
|
|
52
56
|
applyProjectSchemas(null);
|
|
53
57
|
}
|
|
58
|
+
var ERROR_PROPERTY_KEYS = ["unevaluatedProperty", "additionalProperty", "missingProperty"];
|
|
54
59
|
function formatErrors(validate) {
|
|
55
|
-
return (validate.errors || []).map((e) =>
|
|
60
|
+
return (validate.errors || []).map((e) => {
|
|
61
|
+
const key = ERROR_PROPERTY_KEYS.find((name) => typeof e.params?.[name] === "string");
|
|
62
|
+
const property = key ? ` (${String(e.params?.[key])})` : "";
|
|
63
|
+
return `${e.instancePath || "(root)"}: ${e.message}${property}`;
|
|
64
|
+
});
|
|
56
65
|
}
|
|
57
66
|
async function validateDoc(doc) {
|
|
58
67
|
const validate = await getValidator("document");
|
|
@@ -61,6 +70,13 @@ async function validateDoc(doc) {
|
|
|
61
70
|
}
|
|
62
71
|
return formatErrors(validate);
|
|
63
72
|
}
|
|
73
|
+
async function validateDocOrNull(doc) {
|
|
74
|
+
const validate = await getValidator("document");
|
|
75
|
+
if (!validate) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return validate(doc) ? [] : formatErrors(validate);
|
|
79
|
+
}
|
|
64
80
|
async function validateProjectConfig(config) {
|
|
65
81
|
const validate = await getValidator("project");
|
|
66
82
|
if (!validate || validate(config)) {
|
|
@@ -69,7 +85,7 @@ async function validateProjectConfig(config) {
|
|
|
69
85
|
return formatErrors(validate);
|
|
70
86
|
}
|
|
71
87
|
|
|
72
|
-
export { applyProjectSchemas, resetProjectSchemas, validateDoc, validateProjectConfig };
|
|
88
|
+
export { applyProjectSchemas, resetProjectSchemas, validateDoc, validateDocOrNull, validateProjectConfig };
|
|
73
89
|
|
|
74
|
-
//# debugId=
|
|
75
|
-
//# sourceMappingURL=studio-
|
|
90
|
+
//# debugId=8C68AEE13E72EFF064756E2164756E21
|
|
91
|
+
//# sourceMappingURL=studio-68n67094.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
noChange,
|
|
3
3
|
render
|
|
4
|
-
} from "./studio-
|
|
4
|
+
} from "./studio-kryvsw6j.js";
|
|
5
5
|
|
|
6
6
|
// ../../node_modules/@lit/reactive-element/development/css-tag.js
|
|
7
7
|
var NODE_MODE = false;
|
|
@@ -610,4 +610,4 @@ if (DEV_MODE2 && global3.litElementVersions.length > 1) {
|
|
|
610
610
|
export { css, defaultConverter, notEqual, LitElement };
|
|
611
611
|
|
|
612
612
|
//# debugId=5925B997A81EB5AC64756E2164756E21
|
|
613
|
-
//# sourceMappingURL=studio-
|
|
613
|
+
//# sourceMappingURL=studio-7nte2hj4.js.map
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseMediaEntries,
|
|
3
3
|
schemeOfQuery
|
|
4
|
-
} from "./studio-
|
|
5
|
-
import {
|
|
6
|
-
live
|
|
7
|
-
} from "./studio-c31yb4t6.js";
|
|
4
|
+
} from "./studio-pdfjntbk.js";
|
|
8
5
|
import {
|
|
9
6
|
mediaDisplayName,
|
|
10
7
|
mountStylebookCanvas,
|
|
11
8
|
panToStylebookTag,
|
|
12
9
|
serializeJxPath,
|
|
13
10
|
tabOfPane
|
|
14
|
-
} from "./studio-
|
|
11
|
+
} from "./studio-kjjsjak4.js";
|
|
15
12
|
import {
|
|
16
|
-
activeTab,
|
|
17
13
|
getEffectiveMedia,
|
|
18
14
|
getEffectiveStyle,
|
|
15
|
+
shell
|
|
16
|
+
} from "./studio-hbtp0eh1.js";
|
|
17
|
+
import {
|
|
18
|
+
activeTab,
|
|
19
19
|
isSpliceablePath,
|
|
20
|
-
shell,
|
|
21
20
|
varDisplayName
|
|
22
|
-
} from "./studio-
|
|
21
|
+
} from "./studio-2zkz8evn.js";
|
|
23
22
|
import {
|
|
24
23
|
classMap
|
|
25
|
-
} from "./studio-
|
|
24
|
+
} from "./studio-m3hwn7y1.js";
|
|
26
25
|
import {
|
|
26
|
+
live,
|
|
27
27
|
ref,
|
|
28
28
|
repeat
|
|
29
|
-
} from "./studio-
|
|
29
|
+
} from "./studio-4rzyrtjz.js";
|
|
30
30
|
import {
|
|
31
31
|
html,
|
|
32
32
|
render
|
|
33
|
-
} from "./studio-
|
|
33
|
+
} from "./studio-kryvsw6j.js";
|
|
34
34
|
import {
|
|
35
35
|
componentRegistry
|
|
36
|
-
} from "./studio-
|
|
36
|
+
} from "./studio-bgxt93ga.js";
|
|
37
37
|
import {
|
|
38
38
|
projectState,
|
|
39
39
|
updateSession
|
|
40
|
-
} from "./studio-
|
|
40
|
+
} from "./studio-p4ngc046.js";
|
|
41
41
|
import {
|
|
42
42
|
__require
|
|
43
43
|
} from "./studio-a0tswy0w.js";
|
|
@@ -491,6 +491,7 @@ function buildStylebookDoc(opts) {
|
|
|
491
491
|
|
|
492
492
|
// src/style/project-styles.ts
|
|
493
493
|
var PROJECT_STYLES_TITLE = "Project Styles";
|
|
494
|
+
var PROJECT_STYLES_VIEW = "stylebook";
|
|
494
495
|
var TOKEN_GROUPS = [
|
|
495
496
|
{ id: "color", prefix: "--color-", title: "Colors" },
|
|
496
497
|
{ id: "font", prefix: "--font-", title: "Fonts" },
|
|
@@ -736,6 +737,7 @@ function noopCommandDeps() {
|
|
|
736
737
|
undo: () => {},
|
|
737
738
|
redo: () => {},
|
|
738
739
|
openInBrowser: () => {},
|
|
740
|
+
buildSite: () => {},
|
|
739
741
|
closeDocument: () => {},
|
|
740
742
|
duplicateSelection: () => {},
|
|
741
743
|
deleteSelection: () => {},
|
|
@@ -793,9 +795,20 @@ function defaultCommands(deps) {
|
|
|
793
795
|
group: "2_output",
|
|
794
796
|
when: (ctx) => ctx.project.isSite,
|
|
795
797
|
enablement: documentOpen,
|
|
796
|
-
requires: "a
|
|
798
|
+
requires: "a page to preview",
|
|
797
799
|
run: () => deps.openInBrowser()
|
|
798
800
|
},
|
|
801
|
+
{
|
|
802
|
+
id: "project.buildSite",
|
|
803
|
+
title: "Build Site",
|
|
804
|
+
category: "Project",
|
|
805
|
+
level: "project",
|
|
806
|
+
menus: ["commandbar/overflow", "palette"],
|
|
807
|
+
group: "2_output",
|
|
808
|
+
when: (ctx) => ctx.project.isSite,
|
|
809
|
+
requires: "a site project",
|
|
810
|
+
run: () => deps.buildSite()
|
|
811
|
+
},
|
|
799
812
|
{
|
|
800
813
|
id: "edit.undo",
|
|
801
814
|
title: "Undo",
|
|
@@ -860,7 +873,7 @@ function defaultCommands(deps) {
|
|
|
860
873
|
description: "Turn the selected element into a repeater template, rendering it once per item of a " + "data collection the author picks in the dialog this opens."
|
|
861
874
|
},
|
|
862
875
|
run: () => {
|
|
863
|
-
import("./convert-to-repeater-
|
|
876
|
+
import("./convert-to-repeater-dhw1nrz9.js").then(({ convertToRepeater }) => convertToRepeater());
|
|
864
877
|
}
|
|
865
878
|
},
|
|
866
879
|
{
|
|
@@ -1062,7 +1075,7 @@ function inspectorFocusCommands(deps) {
|
|
|
1062
1075
|
});
|
|
1063
1076
|
}
|
|
1064
1077
|
|
|
1065
|
-
export { transposeStylebookStyle, tokenLabel, groupTokens, listTokenContexts, readTokenOverride, writeTokenOverride, addableContexts, stylebook_meta_default, renderStylebookMode, selectStylebookTag, INSPECTOR_TABS, noopCommandDeps, defaultCommands };
|
|
1078
|
+
export { transposeStylebookStyle, PROJECT_STYLES_TITLE, PROJECT_STYLES_VIEW, tokenLabel, groupTokens, listTokenContexts, readTokenOverride, writeTokenOverride, addableContexts, stylebook_meta_default, renderStylebookMode, selectStylebookTag, INSPECTOR_TABS, noopCommandDeps, defaultCommands };
|
|
1066
1079
|
|
|
1067
|
-
//# debugId=
|
|
1068
|
-
//# sourceMappingURL=studio-
|
|
1080
|
+
//# debugId=1C28C0702015039E64756E2164756E21
|
|
1081
|
+
//# sourceMappingURL=studio-8swrjbny.js.map
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import {
|
|
2
|
+
notify
|
|
3
|
+
} from "./studio-xrapxwwc.js";
|
|
4
|
+
import {
|
|
5
|
+
getPlatform,
|
|
6
|
+
hasPlatform
|
|
7
|
+
} from "./studio-9ab8gqsm.js";
|
|
8
|
+
|
|
9
|
+
// src/services/settings/definitions.ts
|
|
10
|
+
function normalizeBaseUrl(raw) {
|
|
11
|
+
return raw.trim().replace(/\/+$/, "");
|
|
12
|
+
}
|
|
13
|
+
function trimmed(raw) {
|
|
14
|
+
return raw.trim();
|
|
15
|
+
}
|
|
16
|
+
var SETTINGS = {
|
|
17
|
+
aiBaseUrl: {
|
|
18
|
+
default: "",
|
|
19
|
+
key: "jx.ai.baseUrl",
|
|
20
|
+
normalize: normalizeBaseUrl,
|
|
21
|
+
scope: "user"
|
|
22
|
+
},
|
|
23
|
+
aiOpenAiKey: {
|
|
24
|
+
default: "",
|
|
25
|
+
key: "jx.ai.openaiKey",
|
|
26
|
+
normalize: trimmed,
|
|
27
|
+
scope: "user",
|
|
28
|
+
secret: true
|
|
29
|
+
},
|
|
30
|
+
aiModel: {
|
|
31
|
+
default: "gpt-4o",
|
|
32
|
+
key: "jx.ai.model",
|
|
33
|
+
normalize: trimmed,
|
|
34
|
+
scope: "user"
|
|
35
|
+
},
|
|
36
|
+
keybindings: {
|
|
37
|
+
default: "",
|
|
38
|
+
key: "jx.keybindings",
|
|
39
|
+
normalize: (raw) => raw.trim() === "{}" ? "" : raw.trim(),
|
|
40
|
+
scope: "user"
|
|
41
|
+
},
|
|
42
|
+
theme: {
|
|
43
|
+
default: "",
|
|
44
|
+
key: "jx-studio-theme",
|
|
45
|
+
normalize: trimmed,
|
|
46
|
+
scope: "user"
|
|
47
|
+
},
|
|
48
|
+
showIgnoredFiles: {
|
|
49
|
+
default: "",
|
|
50
|
+
key: "jx.files.showIgnored",
|
|
51
|
+
normalize: trimmed,
|
|
52
|
+
scope: "user"
|
|
53
|
+
},
|
|
54
|
+
cfAccountId: {
|
|
55
|
+
default: "",
|
|
56
|
+
key: "jx.cf.accountId",
|
|
57
|
+
normalize: trimmed,
|
|
58
|
+
scope: "user"
|
|
59
|
+
},
|
|
60
|
+
cfToken: {
|
|
61
|
+
default: "",
|
|
62
|
+
key: "jx.cf.token",
|
|
63
|
+
normalize: trimmed,
|
|
64
|
+
scope: "user",
|
|
65
|
+
secret: true
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var ALL_SETTINGS = Object.values(SETTINGS);
|
|
69
|
+
var USER_SETTINGS = ALL_SETTINGS.filter((definition) => definition.scope === "user");
|
|
70
|
+
var USER_SETTING_KEYS = USER_SETTINGS.map((definition) => definition.key);
|
|
71
|
+
|
|
72
|
+
// src/services/settings/write-queue.ts
|
|
73
|
+
function createWriteQueue(opts) {
|
|
74
|
+
const schedule = opts.schedule ?? queueMicrotask;
|
|
75
|
+
let pending = null;
|
|
76
|
+
let tail = Promise.resolve();
|
|
77
|
+
let idle = Promise.resolve();
|
|
78
|
+
function flush() {
|
|
79
|
+
const patch = pending;
|
|
80
|
+
pending = null;
|
|
81
|
+
if (!patch) {
|
|
82
|
+
return tail;
|
|
83
|
+
}
|
|
84
|
+
tail = tail.then(() => opts.send(patch)).catch((error) => {
|
|
85
|
+
opts.onError?.(error, patch);
|
|
86
|
+
});
|
|
87
|
+
return tail;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
enqueue(patch) {
|
|
91
|
+
if (pending) {
|
|
92
|
+
Object.assign(pending, patch);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
pending = { ...patch };
|
|
96
|
+
idle = new Promise((resolve) => {
|
|
97
|
+
schedule(() => {
|
|
98
|
+
flush().then(resolve);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
settled() {
|
|
103
|
+
return idle;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// src/services/settings/kernel.ts
|
|
109
|
+
var values = new Map;
|
|
110
|
+
function writeCache(key, value) {
|
|
111
|
+
try {
|
|
112
|
+
if (value === null) {
|
|
113
|
+
globalThis.localStorage?.removeItem(key);
|
|
114
|
+
} else {
|
|
115
|
+
globalThis.localStorage?.setItem(key, value);
|
|
116
|
+
}
|
|
117
|
+
} catch {}
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
for (const definition of ALL_SETTINGS) {
|
|
121
|
+
const cached = globalThis.localStorage?.getItem(definition.key);
|
|
122
|
+
if (cached !== null && cached !== undefined) {
|
|
123
|
+
values.set(definition.key, cached);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch {}
|
|
127
|
+
function readStoredSetting(definition) {
|
|
128
|
+
return values.get(definition.key) ?? "";
|
|
129
|
+
}
|
|
130
|
+
function hasSetting(definition) {
|
|
131
|
+
return (values.get(definition.key) ?? "") !== "";
|
|
132
|
+
}
|
|
133
|
+
var listeners = new Set;
|
|
134
|
+
function onSettingsChanged(listener) {
|
|
135
|
+
listeners.add(listener);
|
|
136
|
+
return () => {
|
|
137
|
+
listeners.delete(listener);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function announce(keys) {
|
|
141
|
+
for (const listener of listeners) {
|
|
142
|
+
listener(keys);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
var queue = createWriteQueue({
|
|
146
|
+
onError(error) {
|
|
147
|
+
notify("error", "Your settings could not be saved.", {
|
|
148
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
149
|
+
key: "settings-write",
|
|
150
|
+
source: "Settings"
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
async send(patch) {
|
|
154
|
+
if (!hasPlatform()) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const platform = getPlatform();
|
|
158
|
+
if (!platform.patchSettings) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const set = {};
|
|
162
|
+
const remove = [];
|
|
163
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
164
|
+
if (value) {
|
|
165
|
+
set[key] = value;
|
|
166
|
+
} else {
|
|
167
|
+
remove.push(key);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
await platform.patchSettings({ remove, set });
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
function settingsSettled() {
|
|
174
|
+
return queue.settled();
|
|
175
|
+
}
|
|
176
|
+
function apply(patch) {
|
|
177
|
+
const moved = [];
|
|
178
|
+
for (const [key, next] of Object.entries(patch)) {
|
|
179
|
+
const before = values.get(key) ?? null;
|
|
180
|
+
if (before === next) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (next === null) {
|
|
184
|
+
values.delete(key);
|
|
185
|
+
} else {
|
|
186
|
+
values.set(key, next);
|
|
187
|
+
}
|
|
188
|
+
writeCache(key, next);
|
|
189
|
+
moved.push(key);
|
|
190
|
+
}
|
|
191
|
+
return moved;
|
|
192
|
+
}
|
|
193
|
+
function setSetting(definition, value) {
|
|
194
|
+
const next = definition.normalize ? definition.normalize(value) : value;
|
|
195
|
+
const moved = apply({ [definition.key]: next });
|
|
196
|
+
if (moved.length > 0) {
|
|
197
|
+
queue.enqueue({ [definition.key]: next });
|
|
198
|
+
announce(moved);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function setSettings(entries) {
|
|
202
|
+
const patch = {};
|
|
203
|
+
for (const [definition, value] of entries) {
|
|
204
|
+
patch[definition.key] = definition.normalize ? definition.normalize(value) : value;
|
|
205
|
+
}
|
|
206
|
+
const moved = apply(patch);
|
|
207
|
+
if (moved.length > 0) {
|
|
208
|
+
queue.enqueue(patch);
|
|
209
|
+
announce(moved);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function clearSettings(definitions) {
|
|
213
|
+
const patch = {};
|
|
214
|
+
for (const definition of definitions) {
|
|
215
|
+
patch[definition.key] = null;
|
|
216
|
+
}
|
|
217
|
+
const moved = apply(patch);
|
|
218
|
+
if (moved.length > 0) {
|
|
219
|
+
queue.enqueue(patch);
|
|
220
|
+
announce(moved);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async function hydrateSettings() {
|
|
224
|
+
if (!hasPlatform()) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const platform = getPlatform();
|
|
228
|
+
if (!platform.getSettings) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
let stored;
|
|
232
|
+
try {
|
|
233
|
+
stored = await platform.getSettings();
|
|
234
|
+
} catch {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const incoming = {};
|
|
238
|
+
let needsMigration = false;
|
|
239
|
+
for (const definition of USER_SETTINGS) {
|
|
240
|
+
const backendValue = stored[definition.key];
|
|
241
|
+
if (backendValue) {
|
|
242
|
+
incoming[definition.key] = backendValue;
|
|
243
|
+
} else if (values.get(definition.key)) {
|
|
244
|
+
needsMigration = true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const moved = apply(incoming);
|
|
248
|
+
if (moved.length > 0) {
|
|
249
|
+
announce(moved);
|
|
250
|
+
}
|
|
251
|
+
if (needsMigration) {
|
|
252
|
+
const push = {};
|
|
253
|
+
for (const definition of USER_SETTINGS) {
|
|
254
|
+
const value = values.get(definition.key);
|
|
255
|
+
if (value && !stored[definition.key]) {
|
|
256
|
+
push[definition.key] = value;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
queue.enqueue(push);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function adoptRemoteSettings(stored) {
|
|
263
|
+
const patch = {};
|
|
264
|
+
for (const definition of USER_SETTINGS) {
|
|
265
|
+
patch[definition.key] = stored[definition.key] ?? null;
|
|
266
|
+
}
|
|
267
|
+
const moved = apply(patch);
|
|
268
|
+
if (moved.length > 0) {
|
|
269
|
+
announce(moved);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function watchRemoteSettings() {
|
|
273
|
+
if (!hasPlatform()) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
getPlatform().subscribeSettings?.(adoptRemoteSettings);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export { SETTINGS, readStoredSetting, hasSetting, onSettingsChanged, settingsSettled, setSetting, setSettings, clearSettings, hydrateSettings, watchRemoteSettings };
|
|
280
|
+
|
|
281
|
+
//# debugId=C4A4FABDAA7EC06E64756E2164756E21
|
|
282
|
+
//# sourceMappingURL=studio-92ab2jqe.js.map
|
|
@@ -71,5 +71,5 @@ function hasPlatform() {
|
|
|
71
71
|
|
|
72
72
|
export { registerPlatform, platformInFlight, getPlatform, hasPlatform };
|
|
73
73
|
|
|
74
|
-
//# debugId=
|
|
75
|
-
//# sourceMappingURL=studio-
|
|
74
|
+
//# debugId=48AA6894A0BB2F0464756E2164756E21
|
|
75
|
+
//# sourceMappingURL=studio-9ab8gqsm.js.map
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderDeployChecklist
|
|
3
|
-
} from "./studio-
|
|
3
|
+
} from "./studio-ahjfdy6e.js";
|
|
4
4
|
import {
|
|
5
5
|
registerPanel,
|
|
6
6
|
renderEmptyState
|
|
7
|
-
} from "./studio-
|
|
7
|
+
} from "./studio-kjjsjak4.js";
|
|
8
8
|
import {
|
|
9
|
-
openModal,
|
|
10
9
|
setBottomTab
|
|
11
|
-
} from "./studio-
|
|
10
|
+
} from "./studio-hbtp0eh1.js";
|
|
12
11
|
import {
|
|
13
|
-
|
|
14
|
-
} from "./studio-
|
|
15
|
-
import {
|
|
16
|
-
html,
|
|
17
|
-
nothing
|
|
18
|
-
} from "./studio-5x5774ak.js";
|
|
12
|
+
openModal
|
|
13
|
+
} from "./studio-t7qb9db8.js";
|
|
19
14
|
import {
|
|
20
15
|
notify,
|
|
21
16
|
now,
|
|
22
17
|
reactive
|
|
23
|
-
} from "./studio-
|
|
18
|
+
} from "./studio-xrapxwwc.js";
|
|
19
|
+
import {
|
|
20
|
+
repeat
|
|
21
|
+
} from "./studio-4rzyrtjz.js";
|
|
22
|
+
import {
|
|
23
|
+
html,
|
|
24
|
+
nothing
|
|
25
|
+
} from "./studio-kryvsw6j.js";
|
|
24
26
|
|
|
25
27
|
// src/panels/activity-panel.ts
|
|
26
28
|
var activities = reactive([]);
|
|
@@ -351,5 +353,5 @@ function showProgressModal(opts) {
|
|
|
351
353
|
|
|
352
354
|
export { beginActivity, activityIdleBlockers, registerActivityPanel, showProgressModal };
|
|
353
355
|
|
|
354
|
-
//# debugId=
|
|
355
|
-
//# sourceMappingURL=studio-
|
|
356
|
+
//# debugId=55F83A7B38610BED64756E2164756E21
|
|
357
|
+
//# sourceMappingURL=studio-9c4k4vhv.js.map
|