@jxsuite/studio 3.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.
- package/README.md +5 -5
- package/dist/chunks/{2020-xp8vnwma.js → 2020-n6tfwnda.js} +2 -2
- package/dist/chunks/Overlay.dev-etqjwyf9.js +23 -0
- package/dist/chunks/cf-account-picker-en86v7x7.js +163 -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-48xg86wj.js +49 -0
- package/dist/chunks/{convert-to-repeater-6vvx96n2.js → convert-to-repeater-43tfn7cs.js} +33 -25
- package/dist/chunks/entry-commands-e63f1xc0.js +46 -0
- package/dist/chunks/{extension-sections-kwzvpemr.js → extension-sections-txv08xxg.js} +34 -26
- package/dist/chunks/file-ops-wbh4hhsx.js +48 -0
- package/dist/chunks/files-3kfkwhk4.js +93 -0
- package/dist/chunks/{focus-trap.esm-ggawf1hy.js → focus-trap.esm-9t2drp0g.js} +6 -5
- package/dist/chunks/{format-host-8fr3545e.js → format-host-w16q81tf.js} +3 -3
- package/dist/chunks/fs-events-hrrg328g.js +21 -0
- package/dist/chunks/{git-panel-g01d93vc.js → git-panel-532whr1y.js} +22 -16
- package/dist/chunks/{index-nj44jpzj.js → index-wcnt3r9g.js} +2 -2
- package/dist/chunks/{jx-validate-jj9rnt4n.js → jx-validate-8er6gbxy.js} +6 -4
- package/dist/chunks/layers-panel-07hm7g5j.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-vx9bhp1d.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-v9st96ja.js +29 -0
- package/dist/chunks/quick-search-zccjp6gv.js +66 -0
- package/dist/chunks/references-3qx8fkyp.js +29 -0
- package/dist/chunks/right-panel-vm3b6kwy.js +46 -0
- package/dist/chunks/sp-overlay.dev-qgvhnxf4.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-4sastdnw.js +15 -0
- package/dist/chunks/{sp-tray.dev-64v4pxw8.js → sp-tray.dev-tkbscm06.js} +5 -5
- package/dist/chunks/{studio-wdt9y92a.js → studio-0bq6eh7v.js} +2 -2
- package/dist/chunks/studio-1ngbejft.js +181 -0
- package/dist/chunks/studio-1wagb550.js +118 -0
- package/dist/chunks/{studio-j595e748.js → studio-2b946z26.js} +172 -95
- package/dist/chunks/{studio-pkp61mh8.js → studio-3bqpr0zh.js} +25 -17
- package/dist/chunks/{studio-k4jvjcfx.js → studio-4b5z1x43.js} +46 -12
- package/dist/chunks/{studio-ry1vz5sv.js → studio-4n2b5gzb.js} +15 -13
- package/dist/chunks/{studio-p5dja96s.js → studio-4r1pv6zf.js} +2 -2
- package/dist/chunks/{studio-kvfx9z2c.js → studio-4rzyrtjz.js} +70 -31
- package/dist/chunks/{studio-tzx3xmvx.js → studio-5fx3g9jg.js} +33 -52
- package/dist/chunks/{studio-rh1cnamv.js → studio-5myknm0a.js} +565 -135
- package/dist/chunks/studio-6yw4y3my.js +91 -0
- package/dist/chunks/{studio-0rqqhrdy.js → studio-7nte2hj4.js} +2 -2
- package/dist/chunks/studio-92ab2jqe.js +282 -0
- package/dist/chunks/{studio-6z5eyjwn.js → studio-950k0dx6.js} +72 -135
- package/dist/chunks/{studio-sas7mt3k.js → studio-9ab8gqsm.js} +2 -2
- package/dist/chunks/studio-9n4mrmnb.js +184 -0
- package/dist/chunks/{studio-hcxzyk3x.js → studio-ahn3pdgx.js} +6 -6
- package/dist/chunks/studio-b55y6ewx.js +498 -0
- package/dist/chunks/{studio-s519zc99.js → studio-bgxt93ga.js} +3 -3
- package/dist/chunks/studio-cft9r4r7.js +119 -0
- package/dist/chunks/{studio-dc8s8heb.js → studio-cmb03bg5.js} +6904 -8321
- package/dist/chunks/studio-dm19q43r.js +195 -0
- package/dist/chunks/{studio-2x9zbxmx.js → studio-ef49pnzx.js} +11 -9
- package/dist/chunks/{studio-ay8wcr2b.js → studio-eqq1w638.js} +7 -9
- package/dist/chunks/{studio-5efrtn1m.js → studio-ew0djmhg.js} +23 -19
- package/dist/chunks/{studio-tr20m8g8.js → studio-f3wqjtk5.js} +39 -3
- package/dist/chunks/{studio-xntfdy1x.js → studio-fbf92ckf.js} +36 -23
- package/dist/chunks/{studio-4q0wznzf.js → studio-gcye7qka.js} +442 -126
- package/dist/chunks/{studio-7p35254k.js → studio-gfgb8pe6.js} +36 -193
- package/dist/chunks/studio-jc994dnr.js +1066 -0
- package/dist/chunks/{studio-hj2se583.js → studio-jkftxyvz.js} +69 -3423
- 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-twsafr1e.js → studio-m3hwn7y1.js} +3 -3
- package/dist/chunks/studio-msd847zn.js +1315 -0
- package/dist/chunks/{studio-g5gdqnyd.js → studio-mtfnaqs9.js} +19 -19
- package/dist/chunks/{studio-7ejemhej.js → studio-n6j9t10q.js} +6 -6
- 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-q43a5y9h.js +394 -0
- package/dist/chunks/studio-q7v10cg2.js +106 -0
- package/dist/chunks/{studio-6kv3apa9.js → studio-q9jd1a60.js} +27 -11
- package/dist/chunks/studio-qcy05dp8.js +1743 -0
- package/dist/chunks/{studio-a0yp7syn.js → studio-qjy2z9bv.js} +29 -132
- package/dist/chunks/{studio-2w11grav.js → studio-qq6jym04.js} +3 -3
- 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-t7qb9db8.js +665 -0
- package/dist/chunks/studio-tmc5emrw.js +8 -0
- package/dist/chunks/{studio-r5xbtctf.js → studio-trxrabqf.js} +292 -2297
- package/dist/chunks/studio-wcy8trfx.js +263 -0
- package/dist/chunks/{studio-3dkcd4c5.js → studio-x4qkdat5.js} +62 -57
- package/dist/chunks/studio-x813zp48.js +195 -0
- package/dist/chunks/{studio-qpfq7xhm.js → studio-xrapxwwc.js} +22 -285
- package/dist/chunks/{studio-xm3dbxvn.js → studio-zczps70q.js} +2 -2
- package/dist/chunks/{studio-8ezdegcx.js → studio-zqazsct2.js} +40 -36
- package/dist/chunks/workspace-fjx52ryv.js +89 -0
- package/dist/iframe-entry.js +141 -56
- package/dist/manifest.json +7 -0
- package/dist/studio.js +2605 -1950
- package/favicon.ico +0 -0
- package/index.html +1 -0
- package/package.json +20 -18
- package/src/about/about-modal.ts +4 -3
- 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 +487 -59
- package/src/files/fs-events.ts +9 -0
- package/src/files/gitignore.ts +432 -0
- package/src/files/media-paths.ts +13 -42
- package/src/files/media-usage.ts +41 -131
- 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/hosting/document.ts +2 -0
- package/src/hosting/layout.ts +8 -0
- package/src/media/media-open.ts +58 -0
- package/src/media/media-pane.ts +310 -0
- package/src/new-project/import-tab.ts +357 -163
- package/src/new-project/location-fields.ts +8 -5
- 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 +31 -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 +261 -70
- package/src/platforms/devserver.ts +67 -33
- package/src/preview/preview-overlay.ts +226 -0
- package/src/publish/publish-panel.ts +62 -2
- package/src/services/ai-ask.ts +247 -0
- package/src/services/ai-import-tools.ts +532 -0
- package/src/services/ai-models.ts +108 -1
- 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 +101 -1
- 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 +45 -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-accounts.ts +193 -12
- package/src/settings/preferences-dialog.ts +93 -59
- 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 +129 -7
- package/src/ui/ai-managed-connect.ts +62 -13
- package/src/ui/ai-model-picker.ts +189 -0
- package/src/ui/cf-account-picker.ts +200 -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 +147 -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-bw5dz6km.js +0 -608
- package/dist/chunks/studio-c31yb4t6.js +0 -55
- package/src/canvas/site-style-css.ts +0 -117
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectionInfo
|
|
3
|
+
} from "./studio-b55y6ewx.js";
|
|
4
|
+
import {
|
|
5
|
+
findContentTypeSchema
|
|
6
|
+
} from "./studio-trxrabqf.js";
|
|
7
|
+
import {
|
|
8
|
+
projectState
|
|
9
|
+
} from "./studio-p4ngc046.js";
|
|
10
|
+
|
|
11
|
+
// src/content/entry-model.ts
|
|
12
|
+
function collectionNames() {
|
|
13
|
+
return Object.keys(projectState?.projectConfig?.content ?? {});
|
|
14
|
+
}
|
|
15
|
+
function entryCollection(name) {
|
|
16
|
+
const info = collectionInfo(name);
|
|
17
|
+
if (!info) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
if (/\.[a-z\d]+$/i.test(info.dir)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
def: info.def,
|
|
25
|
+
dir: info.dir,
|
|
26
|
+
ext: info.ext,
|
|
27
|
+
name: info.name,
|
|
28
|
+
schema: info.def.schema ?? null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function entryCollections() {
|
|
32
|
+
return collectionNames().map((name) => entryCollection(name)).filter((collection) => collection !== null);
|
|
33
|
+
}
|
|
34
|
+
function collectionOfPath(path) {
|
|
35
|
+
const matched = findContentTypeSchema(path ?? null, projectState?.projectConfig);
|
|
36
|
+
return matched ? entryCollection(matched.name) : null;
|
|
37
|
+
}
|
|
38
|
+
function cloneDefault(value) {
|
|
39
|
+
if (value === null || typeof value !== "object") {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
return JSON.parse(JSON.stringify(value));
|
|
43
|
+
}
|
|
44
|
+
function emptyForField(field) {
|
|
45
|
+
if (typeof field.$ref === "string") {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
switch (field.type) {
|
|
49
|
+
case "boolean": {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
case "integer":
|
|
53
|
+
case "number": {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
case "array": {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
case "object": {
|
|
60
|
+
return seedEntry(field);
|
|
61
|
+
}
|
|
62
|
+
default: {
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function seedEntry(schema) {
|
|
68
|
+
const properties = schema?.properties;
|
|
69
|
+
if (!properties) {
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
const required = new Set(Array.isArray(schema?.required) ? schema.required : []);
|
|
73
|
+
const seed = {};
|
|
74
|
+
for (const [name, field] of Object.entries(properties)) {
|
|
75
|
+
if (field.default !== undefined) {
|
|
76
|
+
seed[name] = cloneDefault(field.default);
|
|
77
|
+
} else if (required.has(name)) {
|
|
78
|
+
seed[name] = emptyForField(field);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return seed;
|
|
82
|
+
}
|
|
83
|
+
function missingRequired(schema, value) {
|
|
84
|
+
const required = Array.isArray(schema?.required) ? schema.required : [];
|
|
85
|
+
return required.filter((name) => value[name] === undefined);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { entryCollection, entryCollections, collectionOfPath, seedEntry, missingRequired };
|
|
89
|
+
|
|
90
|
+
//# debugId=4E0453F542F313E864756E2164756E21
|
|
91
|
+
//# sourceMappingURL=studio-6yw4y3my.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
|
|
@@ -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
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LitElement
|
|
3
|
-
} from "./studio-
|
|
3
|
+
} from "./studio-7nte2hj4.js";
|
|
4
|
+
import {
|
|
5
|
+
invalidateMediaMeta,
|
|
6
|
+
mediaMetaSummary,
|
|
7
|
+
peekMediaMeta,
|
|
8
|
+
recordImageSize,
|
|
9
|
+
seedMediaMeta
|
|
10
|
+
} from "./studio-1wagb550.js";
|
|
4
11
|
import {
|
|
5
12
|
applyCatalogPick,
|
|
6
13
|
chipSummary,
|
|
@@ -19,31 +26,28 @@ import {
|
|
|
19
26
|
renderOperandEditor,
|
|
20
27
|
resolveContextPointer,
|
|
21
28
|
slotMode
|
|
22
|
-
} from "./studio-
|
|
23
|
-
import {
|
|
24
|
-
live
|
|
25
|
-
} from "./studio-c31yb4t6.js";
|
|
29
|
+
} from "./studio-x4qkdat5.js";
|
|
26
30
|
import {
|
|
27
31
|
IMAGE_EXTENSIONS,
|
|
28
32
|
MEDIA_EXTENSIONS,
|
|
29
|
-
baseName,
|
|
30
33
|
codeService,
|
|
31
34
|
extensionOf,
|
|
32
35
|
fetchPluginSchema,
|
|
33
36
|
getFunctionArgs,
|
|
34
|
-
loadUsages,
|
|
35
|
-
mediaKind,
|
|
36
37
|
mediaSiteUrl,
|
|
37
|
-
peekUsages,
|
|
38
38
|
pluginSchemaCache,
|
|
39
39
|
previewFileSrc,
|
|
40
|
-
retryUsages,
|
|
41
40
|
setLintMarkers,
|
|
42
41
|
uploadAccept,
|
|
43
|
-
uploadAssets
|
|
42
|
+
uploadAssets
|
|
43
|
+
} from "./studio-qjy2z9bv.js";
|
|
44
|
+
import {
|
|
45
|
+
loadUsages,
|
|
46
|
+
peekUsages,
|
|
47
|
+
retryUsages,
|
|
44
48
|
usageFiles,
|
|
45
49
|
usageHeadline
|
|
46
|
-
} from "./studio-
|
|
50
|
+
} from "./studio-cft9r4r7.js";
|
|
47
51
|
import {
|
|
48
52
|
attachInstruction,
|
|
49
53
|
canvasModeOfTab,
|
|
@@ -54,7 +58,6 @@ import {
|
|
|
54
58
|
evaluateExpression,
|
|
55
59
|
extractInstruction,
|
|
56
60
|
isMutating,
|
|
57
|
-
normalizeProjectPath,
|
|
58
61
|
openPageAction,
|
|
59
62
|
previewAssetSrc,
|
|
60
63
|
pureSchemeOf,
|
|
@@ -64,40 +67,35 @@ import {
|
|
|
64
67
|
requestCanvasEval,
|
|
65
68
|
staleSelectionMessage,
|
|
66
69
|
tabOfPane
|
|
67
|
-
} from "./studio-
|
|
70
|
+
} from "./studio-2b946z26.js";
|
|
71
|
+
import {
|
|
72
|
+
getEffectiveLayoutPath,
|
|
73
|
+
getEffectiveLocales,
|
|
74
|
+
getEffectiveMedia,
|
|
75
|
+
getEffectiveStyle,
|
|
76
|
+
monacoTheme,
|
|
77
|
+
setBottomTab,
|
|
78
|
+
shell
|
|
79
|
+
} from "./studio-msd847zn.js";
|
|
68
80
|
import {
|
|
69
|
-
BUFFER_COMMIT,
|
|
70
|
-
NAVIGATOR_STATEMENTS_REGION,
|
|
71
81
|
abbreviateValue,
|
|
72
82
|
activePane,
|
|
73
|
-
activeRegistry,
|
|
74
83
|
activeTab,
|
|
75
84
|
argsSchema,
|
|
76
85
|
attrLabel,
|
|
77
86
|
booleanArg,
|
|
78
87
|
booleanProperty,
|
|
79
|
-
bufferIsLive,
|
|
80
|
-
bufferMovedOn,
|
|
81
|
-
bufferWrites,
|
|
82
88
|
camelToKebab,
|
|
83
89
|
camelToLabel,
|
|
84
|
-
cancelBufferWrites,
|
|
85
|
-
commitBufferWrites,
|
|
86
90
|
detachTab,
|
|
87
91
|
enumArg,
|
|
88
92
|
enumProperty,
|
|
89
93
|
friendlyNameToVar,
|
|
90
|
-
getEffectiveLayoutPath,
|
|
91
|
-
getEffectiveLocales,
|
|
92
|
-
getEffectiveMedia,
|
|
93
|
-
getEffectiveStyle,
|
|
94
|
-
getLayerSlot,
|
|
95
94
|
inferInputType,
|
|
96
95
|
insertIntoPane,
|
|
97
96
|
isMediaFormat,
|
|
98
97
|
kebabToLabel,
|
|
99
98
|
localeLabel,
|
|
100
|
-
monacoTheme,
|
|
101
99
|
mutateAddDef,
|
|
102
100
|
mutateRemoveDef,
|
|
103
101
|
mutateRenameDef,
|
|
@@ -111,11 +109,8 @@ import {
|
|
|
111
109
|
parseCemType,
|
|
112
110
|
pathArg,
|
|
113
111
|
pathProperty,
|
|
114
|
-
popoverLayerFor,
|
|
115
112
|
primarySelection,
|
|
116
113
|
promoteTab,
|
|
117
|
-
setBottomTab,
|
|
118
|
-
shell,
|
|
119
114
|
sidePane,
|
|
120
115
|
stringArg,
|
|
121
116
|
stringProperty,
|
|
@@ -124,61 +119,78 @@ import {
|
|
|
124
119
|
translationPathFor,
|
|
125
120
|
unifyValues,
|
|
126
121
|
varDisplayName,
|
|
127
|
-
view,
|
|
128
122
|
workspace
|
|
129
|
-
} from "./studio-
|
|
123
|
+
} from "./studio-trxrabqf.js";
|
|
124
|
+
import {
|
|
125
|
+
BUFFER_COMMIT,
|
|
126
|
+
bufferIsLive,
|
|
127
|
+
bufferMovedOn,
|
|
128
|
+
bufferWrites,
|
|
129
|
+
cancelBufferWrites,
|
|
130
|
+
commitBufferWrites,
|
|
131
|
+
view
|
|
132
|
+
} from "./studio-wcy8trfx.js";
|
|
130
133
|
import {
|
|
131
134
|
classMap,
|
|
132
135
|
ifDefined
|
|
133
|
-
} from "./studio-
|
|
134
|
-
import {
|
|
135
|
-
Directive,
|
|
136
|
-
directive,
|
|
137
|
-
ref,
|
|
138
|
-
setCommittedValue
|
|
139
|
-
} from "./studio-kvfx9z2c.js";
|
|
140
|
-
import {
|
|
141
|
-
html,
|
|
142
|
-
nothing,
|
|
143
|
-
render
|
|
144
|
-
} from "./studio-5x5774ak.js";
|
|
136
|
+
} from "./studio-m3hwn7y1.js";
|
|
145
137
|
import {
|
|
146
138
|
combine
|
|
147
139
|
} from "./studio-g1wdche0.js";
|
|
148
140
|
import {
|
|
149
141
|
componentRegistry
|
|
150
|
-
} from "./studio-
|
|
142
|
+
} from "./studio-bgxt93ga.js";
|
|
151
143
|
import {
|
|
152
144
|
LIVE_PREVIEW,
|
|
153
145
|
cancelStyleDebounce,
|
|
154
146
|
debouncedStyleCommit,
|
|
155
|
-
displayTagName,
|
|
156
|
-
getEventBinding,
|
|
157
147
|
getNodeAtPath,
|
|
158
|
-
isExpressionDef,
|
|
159
|
-
isJsonObject,
|
|
160
|
-
isRef,
|
|
161
|
-
isTagExpression,
|
|
162
148
|
parentElementPath,
|
|
163
149
|
projectState,
|
|
164
150
|
renderOnly,
|
|
165
151
|
updateUi
|
|
166
|
-
} from "./studio-
|
|
152
|
+
} from "./studio-p4ngc046.js";
|
|
153
|
+
import {
|
|
154
|
+
NAVIGATOR_STATEMENTS_REGION,
|
|
155
|
+
activeRegistry,
|
|
156
|
+
getLayerSlot,
|
|
157
|
+
popoverLayerFor
|
|
158
|
+
} from "./studio-t7qb9db8.js";
|
|
167
159
|
import {
|
|
168
160
|
effect,
|
|
169
161
|
notify,
|
|
170
162
|
shallowRef,
|
|
171
163
|
toRaw
|
|
172
|
-
} from "./studio-
|
|
164
|
+
} from "./studio-xrapxwwc.js";
|
|
165
|
+
import {
|
|
166
|
+
Directive,
|
|
167
|
+
directive,
|
|
168
|
+
live,
|
|
169
|
+
ref,
|
|
170
|
+
setCommittedValue
|
|
171
|
+
} from "./studio-4rzyrtjz.js";
|
|
172
|
+
import {
|
|
173
|
+
html,
|
|
174
|
+
nothing,
|
|
175
|
+
render
|
|
176
|
+
} from "./studio-kryvsw6j.js";
|
|
177
|
+
import {
|
|
178
|
+
displayTagName,
|
|
179
|
+
getEventBinding,
|
|
180
|
+
isExpressionDef,
|
|
181
|
+
isJsonObject,
|
|
182
|
+
isRef,
|
|
183
|
+
isTagExpression
|
|
184
|
+
} from "./studio-q7v10cg2.js";
|
|
173
185
|
import {
|
|
174
186
|
getExtensions,
|
|
175
187
|
loadExtensions,
|
|
176
188
|
loadMonaco,
|
|
177
189
|
mountStillWanted
|
|
178
|
-
} from "./studio-
|
|
190
|
+
} from "./studio-ahn3pdgx.js";
|
|
179
191
|
import {
|
|
180
192
|
getPlatform
|
|
181
|
-
} from "./studio-
|
|
193
|
+
} from "./studio-9ab8gqsm.js";
|
|
182
194
|
import {
|
|
183
195
|
__require
|
|
184
196
|
} from "./studio-a0tswy0w.js";
|
|
@@ -698,81 +710,6 @@ function derivationCommands(deps) {
|
|
|
698
710
|
];
|
|
699
711
|
}
|
|
700
712
|
|
|
701
|
-
// src/files/media-meta.ts
|
|
702
|
-
var settled = new Map;
|
|
703
|
-
var inFlight = new Map;
|
|
704
|
-
var measured = new Map;
|
|
705
|
-
function metaFrom(path, entry) {
|
|
706
|
-
const name = baseName(path);
|
|
707
|
-
const dims = measured.get(path);
|
|
708
|
-
return {
|
|
709
|
-
bytes: typeof entry?.size === "number" ? entry.size : null,
|
|
710
|
-
ext: extensionOf(name),
|
|
711
|
-
height: dims?.height ?? null,
|
|
712
|
-
kind: mediaKind({ name }),
|
|
713
|
-
modified: entry?.modified ?? null,
|
|
714
|
-
name,
|
|
715
|
-
path,
|
|
716
|
-
width: dims?.width ?? null
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
function peekMediaMeta(path) {
|
|
720
|
-
return settled.get(normalizeProjectPath(path)) ?? null;
|
|
721
|
-
}
|
|
722
|
-
function seedMediaMeta(entries) {
|
|
723
|
-
for (const entry of entries) {
|
|
724
|
-
if (entry.type !== "file") {
|
|
725
|
-
continue;
|
|
726
|
-
}
|
|
727
|
-
const path = normalizeProjectPath(entry.path);
|
|
728
|
-
if (!settled.has(path)) {
|
|
729
|
-
settled.set(path, metaFrom(path, entry));
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
function recordImageSize(path, width, height) {
|
|
734
|
-
if (!(width > 0 && height > 0)) {
|
|
735
|
-
return false;
|
|
736
|
-
}
|
|
737
|
-
const key = normalizeProjectPath(path);
|
|
738
|
-
const known = measured.get(key);
|
|
739
|
-
if (known && known.width === width && known.height === height) {
|
|
740
|
-
return false;
|
|
741
|
-
}
|
|
742
|
-
measured.set(key, { height, width });
|
|
743
|
-
const meta = settled.get(key);
|
|
744
|
-
if (meta) {
|
|
745
|
-
settled.set(key, { ...meta, height, width });
|
|
746
|
-
}
|
|
747
|
-
return true;
|
|
748
|
-
}
|
|
749
|
-
function invalidateMediaMeta() {
|
|
750
|
-
settled.clear();
|
|
751
|
-
measured.clear();
|
|
752
|
-
}
|
|
753
|
-
function formatBytes(bytes) {
|
|
754
|
-
if (bytes < 1024) {
|
|
755
|
-
return `${bytes} B`;
|
|
756
|
-
}
|
|
757
|
-
if (bytes < 1024 * 1024) {
|
|
758
|
-
return `${Math.round(bytes / 1024)} KB`;
|
|
759
|
-
}
|
|
760
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
761
|
-
}
|
|
762
|
-
function mediaMetaSummary(meta) {
|
|
763
|
-
if (!meta) {
|
|
764
|
-
return "";
|
|
765
|
-
}
|
|
766
|
-
const parts = [];
|
|
767
|
-
if (meta.width !== null && meta.height !== null) {
|
|
768
|
-
parts.push(`${meta.width} × ${meta.height}`);
|
|
769
|
-
}
|
|
770
|
-
if (meta.bytes !== null) {
|
|
771
|
-
parts.push(formatBytes(meta.bytes));
|
|
772
|
-
}
|
|
773
|
-
return parts.join(" · ");
|
|
774
|
-
}
|
|
775
|
-
|
|
776
713
|
// src/ui/media-picker.ts
|
|
777
714
|
var mediaCache = [];
|
|
778
715
|
var mediaCacheLoaded = false;
|
|
@@ -5127,10 +5064,10 @@ function renderUsagesSection(tagName, componentPath) {
|
|
|
5127
5064
|
`;
|
|
5128
5065
|
}
|
|
5129
5066
|
function openUsage(path) {
|
|
5130
|
-
import("./files-
|
|
5067
|
+
import("./files-3kfkwhk4.js").then((m) => m.openFileInTab(path));
|
|
5131
5068
|
}
|
|
5132
5069
|
function showLogicTab() {
|
|
5133
|
-
import("./right-panel-
|
|
5070
|
+
import("./right-panel-vm3b6kwy.js").then((m) => m.setInspectorTab("events"));
|
|
5134
5071
|
}
|
|
5135
5072
|
function renderPropertiesPanelTemplate(ctx) {
|
|
5136
5073
|
const tab = activeTab.value;
|
|
@@ -6998,5 +6935,5 @@ function registerSignalsCommands(registry) {
|
|
|
6998
6935
|
|
|
6999
6936
|
export { isSchemeQuery, schemeOfQuery, parseMediaEntries, DERIVE_PRESETS, PRESET_LABELS, declaredMedia, installDerivationEffects, presetRefusal, deriveRefusal, pinRefusal, derivationCommands, invalidateMediaCache, renderMediaPicker, spTextField, spTextArea, spNumberField, unwrapSignal, dataTypeLabel, registerDataExplorerCommands, registerDataPanel, livePreviewExpression, closeFunctionEditor, logicTarget, revealLogicPanel, openLogicTarget, registerLogicPanel, registerFormulaEditorCommands, JxColorPopover, isColorPopoverOpen, css_meta_default, initCssData, getCssInitialMap, allConditionsPass, autoOpenSections, getLonghands, expandShorthand, compressShorthand, expandBorderSide, compressBorderSide, widgetForType2 as widgetForType, renderStatementEditor, mapSignalsFor, bindableSignalNames, defaultAsString, invalidatePageRouteCache, renderPropertiesPanelTemplate, isInspectorSectionOpen, setInspectorSection, inspectorCommands, registerInspectorCommands, defCategory, defBadgeLabel, isCustomElementDoc, collectCssParts, renderSignalsTemplate, registerSignalsCommands };
|
|
7000
6937
|
|
|
7001
|
-
//# debugId=
|
|
7002
|
-
//# sourceMappingURL=studio-
|
|
6938
|
+
//# debugId=2CD9C998ADB35BE064756E2164756E21
|
|
6939
|
+
//# sourceMappingURL=studio-950k0dx6.js.map
|