@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
|
@@ -3,39 +3,39 @@ import {
|
|
|
3
3
|
getRecentProjects,
|
|
4
4
|
openFileInTab,
|
|
5
5
|
trackRecentFile
|
|
6
|
-
} from "./studio-
|
|
6
|
+
} from "./studio-5myknm0a.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./studio-
|
|
8
|
+
activeTab
|
|
9
|
+
} from "./studio-trxrabqf.js";
|
|
10
|
+
import {
|
|
11
|
+
classMap
|
|
12
|
+
} from "./studio-m3hwn7y1.js";
|
|
13
|
+
import {
|
|
14
|
+
flattenTree,
|
|
15
|
+
nodeLabel,
|
|
16
|
+
projectState
|
|
17
|
+
} from "./studio-p4ngc046.js";
|
|
10
18
|
import {
|
|
11
19
|
activeRegistry,
|
|
12
|
-
activeTab,
|
|
13
20
|
getLayerSlot
|
|
14
|
-
} from "./studio-
|
|
15
|
-
import {
|
|
16
|
-
classMap
|
|
17
|
-
} from "./studio-twsafr1e.js";
|
|
21
|
+
} from "./studio-t7qb9db8.js";
|
|
18
22
|
import {
|
|
23
|
+
live,
|
|
19
24
|
ref
|
|
20
|
-
} from "./studio-
|
|
25
|
+
} from "./studio-4rzyrtjz.js";
|
|
21
26
|
import {
|
|
22
27
|
html,
|
|
23
28
|
nothing,
|
|
24
29
|
render
|
|
25
|
-
} from "./studio-
|
|
26
|
-
import {
|
|
27
|
-
flattenTree,
|
|
28
|
-
nodeLabel,
|
|
29
|
-
projectState
|
|
30
|
-
} from "./studio-cjm7fdjf.js";
|
|
30
|
+
} from "./studio-kryvsw6j.js";
|
|
31
31
|
import {
|
|
32
32
|
documentExtensions,
|
|
33
33
|
formatByExtension,
|
|
34
34
|
loadFormats
|
|
35
|
-
} from "./studio-
|
|
35
|
+
} from "./studio-ahn3pdgx.js";
|
|
36
36
|
import {
|
|
37
37
|
getPlatform
|
|
38
|
-
} from "./studio-
|
|
38
|
+
} from "./studio-9ab8gqsm.js";
|
|
39
39
|
|
|
40
40
|
// src/panels/quick-search.ts
|
|
41
41
|
var PALETTE_MODES = [
|
|
@@ -655,5 +655,5 @@ function renderOverlay() {
|
|
|
655
655
|
|
|
656
656
|
export { PALETTE_MODES, modeSpec, resolvePaletteMode, fuzzyScore, rankBy, paletteArgs, getRecentCommands, initQuickSearch, openQuickSearch, closeQuickSearch, isQuickSearchOpen };
|
|
657
657
|
|
|
658
|
-
//# debugId=
|
|
659
|
-
//# sourceMappingURL=studio-
|
|
658
|
+
//# debugId=444BCF8C29E5B5ED64756E2164756E21
|
|
659
|
+
//# sourceMappingURL=studio-mtfnaqs9.js.map
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
SpectrumElement,
|
|
9
9
|
property,
|
|
10
10
|
query
|
|
11
|
-
} from "./studio-
|
|
11
|
+
} from "./studio-zczps70q.js";
|
|
12
12
|
import {
|
|
13
13
|
css
|
|
14
|
-
} from "./studio-
|
|
14
|
+
} from "./studio-7nte2hj4.js";
|
|
15
15
|
import {
|
|
16
16
|
ifDefined
|
|
17
|
-
} from "./studio-
|
|
17
|
+
} from "./studio-m3hwn7y1.js";
|
|
18
18
|
import {
|
|
19
19
|
html
|
|
20
|
-
} from "./studio-
|
|
20
|
+
} from "./studio-kryvsw6j.js";
|
|
21
21
|
import {
|
|
22
22
|
__require
|
|
23
23
|
} from "./studio-a0tswy0w.js";
|
|
@@ -240,7 +240,7 @@ class Tooltip extends SpectrumElement {
|
|
|
240
240
|
`;
|
|
241
241
|
if (this.selfManaged) {
|
|
242
242
|
this.dependencyManager.add("sp-overlay");
|
|
243
|
-
import("./sp-overlay.dev-
|
|
243
|
+
import("./sp-overlay.dev-qgvhnxf4.js");
|
|
244
244
|
return html`
|
|
245
245
|
<sp-overlay
|
|
246
246
|
?open=${this.open && !this.disabled && this.dependencyManager.loaded}
|
|
@@ -315,4 +315,4 @@ defineElement("sp-tooltip", Tooltip);
|
|
|
315
315
|
export { DependencyManagerController };
|
|
316
316
|
|
|
317
317
|
//# debugId=B26C538C82CA430D64756E2164756E21
|
|
318
|
-
//# sourceMappingURL=studio-
|
|
318
|
+
//# sourceMappingURL=studio-n6j9t10q.js.map
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
SpectrumElement,
|
|
10
10
|
property,
|
|
11
11
|
query
|
|
12
|
-
} from "./studio-
|
|
12
|
+
} from "./studio-zczps70q.js";
|
|
13
13
|
import {
|
|
14
14
|
css
|
|
15
|
-
} from "./studio-
|
|
15
|
+
} from "./studio-7nte2hj4.js";
|
|
16
16
|
import {
|
|
17
17
|
ifDefined
|
|
18
|
-
} from "./studio-
|
|
18
|
+
} from "./studio-m3hwn7y1.js";
|
|
19
19
|
import {
|
|
20
20
|
html
|
|
21
|
-
} from "./studio-
|
|
21
|
+
} from "./studio-kryvsw6j.js";
|
|
22
22
|
|
|
23
23
|
// ../../node_modules/@spectrum-web-components/progress-circle/src/progress-circle.css.js
|
|
24
24
|
var e = css`
|
|
@@ -288,4 +288,4 @@ defineElement("sp-progress-circle", ProgressCircle);
|
|
|
288
288
|
export { languageResolverUpdatedSymbol, LanguageResolutionController, ProgressCircle };
|
|
289
289
|
|
|
290
290
|
//# debugId=D9778D0A36E46FD364756E2164756E21
|
|
291
|
-
//# sourceMappingURL=studio-
|
|
291
|
+
//# sourceMappingURL=studio-n8b9wqwy.js.map
|
|
@@ -1,104 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return isJsonObject(value) && typeof value.$ref === "string";
|
|
7
|
-
}
|
|
8
|
-
function isFunctionDef(value) {
|
|
9
|
-
return isJsonObject(value) && value.$prototype === "Function";
|
|
10
|
-
}
|
|
11
|
-
function isExpressionDef(value) {
|
|
12
|
-
return isJsonObject(value) && isJsonObject(value.$expression);
|
|
13
|
-
}
|
|
14
|
-
function isNamedFormulaDef(value) {
|
|
15
|
-
return isExpressionDef(value) && Array.isArray(value.parameters) && value.parameters.length > 0;
|
|
16
|
-
}
|
|
17
|
-
function hasStructuredBody(value) {
|
|
18
|
-
return isFunctionDef(value) && Array.isArray(value.body);
|
|
19
|
-
}
|
|
20
|
-
function isPrototypeDef(value) {
|
|
21
|
-
return isJsonObject(value) && typeof value.$prototype === "string" && value.$prototype !== "Function";
|
|
22
|
-
}
|
|
23
|
-
function isServerFnDef(value) {
|
|
24
|
-
return isJsonObject(value) && value.timing === "server" && typeof value.$src === "string" && typeof value.$export === "string" && !value.$prototype;
|
|
25
|
-
}
|
|
26
|
-
var SCHEMA_KEYWORDS = new Set([
|
|
27
|
-
"type",
|
|
28
|
-
"enum",
|
|
29
|
-
"minimum",
|
|
30
|
-
"maximum",
|
|
31
|
-
"minLength",
|
|
32
|
-
"maxLength",
|
|
33
|
-
"pattern",
|
|
34
|
-
"format",
|
|
35
|
-
"items",
|
|
36
|
-
"properties",
|
|
37
|
-
"required",
|
|
38
|
-
"description",
|
|
39
|
-
"title",
|
|
40
|
-
"$comment"
|
|
41
|
-
]);
|
|
42
|
-
function isMappedArray(value) {
|
|
43
|
-
return isJsonObject(value) && value.$prototype === "Array";
|
|
44
|
-
}
|
|
45
|
-
function isTemplateString(value) {
|
|
46
|
-
return typeof value === "string" && value.includes("${");
|
|
47
|
-
}
|
|
48
|
-
function bodyReturnsValue(body) {
|
|
49
|
-
return /\breturn\b[^\S\n]*(?![;}\s]|$)/.test(body);
|
|
50
|
-
}
|
|
51
|
-
function isNestedStyle(value) {
|
|
52
|
-
return typeof value === "object" && value !== null;
|
|
53
|
-
}
|
|
54
|
-
function getNestedStyle(style, key) {
|
|
55
|
-
const value = style?.[key];
|
|
56
|
-
return isNestedStyle(value) ? value : undefined;
|
|
57
|
-
}
|
|
58
|
-
function ensureNestedStyle(style, key) {
|
|
59
|
-
const existing = style[key];
|
|
60
|
-
if (isNestedStyle(existing)) {
|
|
61
|
-
return existing;
|
|
62
|
-
}
|
|
63
|
-
const created = {};
|
|
64
|
-
style[key] = created;
|
|
65
|
-
return created;
|
|
66
|
-
}
|
|
67
|
-
function isEventBinding(value) {
|
|
68
|
-
return isRef(value) || isFunctionDef(value) || isExpressionDef(value);
|
|
69
|
-
}
|
|
70
|
-
function getEventBinding(node, key) {
|
|
71
|
-
const value = node[key];
|
|
72
|
-
return isEventBinding(value) ? value : undefined;
|
|
73
|
-
}
|
|
74
|
-
function paramNames(parameters) {
|
|
75
|
-
if (!parameters) {
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
return parameters.map((p) => typeof p === "string" ? p : p.name);
|
|
79
|
-
}
|
|
80
|
-
function isTagExpression(tagName) {
|
|
81
|
-
return isJsonObject(tagName) && isJsonObject(tagName.$expression);
|
|
82
|
-
}
|
|
83
|
-
function tagNameCandidates(tagName) {
|
|
84
|
-
if (typeof tagName === "string") {
|
|
85
|
-
return [tagName];
|
|
86
|
-
}
|
|
87
|
-
if (!isTagExpression(tagName)) {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
const expression = tagName.$expression;
|
|
91
|
-
if (expression.operator === "?:") {
|
|
92
|
-
return [...new Set([expression.value, expression.initial])];
|
|
93
|
-
}
|
|
94
|
-
return [...new Set([...Object.values(expression.cases), expression.default])];
|
|
95
|
-
}
|
|
96
|
-
function displayTagName(tagName) {
|
|
97
|
-
return typeof tagName === "string" ? tagName : tagNameCandidates(tagName).join("|");
|
|
98
|
-
}
|
|
99
|
-
function isPrivateStateKey(key) {
|
|
100
|
-
return key.startsWith("#");
|
|
101
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
displayTagName,
|
|
3
|
+
isEventBinding,
|
|
4
|
+
isRef
|
|
5
|
+
} from "./studio-q7v10cg2.js";
|
|
102
6
|
|
|
103
7
|
// src/ui/timing.ts
|
|
104
8
|
var INPUT_DEBOUNCE = 400;
|
|
@@ -445,7 +349,7 @@ function updateCanvas(tab, patch) {
|
|
|
445
349
|
}
|
|
446
350
|
}
|
|
447
351
|
|
|
448
|
-
export {
|
|
352
|
+
export { LIVE_PREVIEW, POLL_GIT, getNodeAtPath, childList, normalizeArrayChildren, parentElementPath, childIndex, pathKey, pathsEqual, isAncestor, flattenTree, nodeLabel, projectState, setProjectState, requireProjectState, stripEventHandlers, activityBar, leftPanel, rightPanel, toolbarEl, statusbarEl, initShellRefs, VOID_ELEMENTS, COMMON_SELECTORS, isNestedSelector, debouncedStyleCommit, cancelStyleDebounce, rendersInFlight, registerRenderer, render, renderOnly, updateSession, updateUi, updateCanvas };
|
|
449
353
|
|
|
450
|
-
//# debugId=
|
|
451
|
-
//# sourceMappingURL=studio-
|
|
354
|
+
//# debugId=6E6FF14C9164545D64756E2164756E21
|
|
355
|
+
//# sourceMappingURL=studio-p4ngc046.js.map
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import {
|
|
2
|
+
invalidateUsages
|
|
3
|
+
} from "./studio-cft9r4r7.js";
|
|
4
|
+
import {
|
|
5
|
+
projectState
|
|
6
|
+
} from "./studio-p4ngc046.js";
|
|
7
|
+
import {
|
|
8
|
+
getPlatform
|
|
9
|
+
} from "./studio-9ab8gqsm.js";
|
|
10
|
+
|
|
11
|
+
// src/files/gitignore.ts
|
|
12
|
+
var RE_SPECIAL = /[.*+?^${}()|[\]\\]/;
|
|
13
|
+
function literal(ch) {
|
|
14
|
+
return RE_SPECIAL.test(ch) ? `\\${ch}` : ch;
|
|
15
|
+
}
|
|
16
|
+
function stripTrailingSpaces(line) {
|
|
17
|
+
let end = line.length;
|
|
18
|
+
while (end > 0 && line[end - 1] === " ") {
|
|
19
|
+
let backslashes = 0;
|
|
20
|
+
let i = end - 2;
|
|
21
|
+
while (i >= 0 && line[i] === "\\") {
|
|
22
|
+
backslashes += 1;
|
|
23
|
+
i -= 1;
|
|
24
|
+
}
|
|
25
|
+
if (backslashes % 2 === 1) {
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
end -= 1;
|
|
29
|
+
}
|
|
30
|
+
return line.slice(0, end);
|
|
31
|
+
}
|
|
32
|
+
function charClassEnd(pattern, start) {
|
|
33
|
+
let i = start + 1;
|
|
34
|
+
if (pattern[i] === "!") {
|
|
35
|
+
i += 1;
|
|
36
|
+
}
|
|
37
|
+
if (pattern[i] === "]") {
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
while (i < pattern.length) {
|
|
41
|
+
if (pattern[i] === "\\") {
|
|
42
|
+
i += 2;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (pattern[i] === "]") {
|
|
46
|
+
return i;
|
|
47
|
+
}
|
|
48
|
+
i += 1;
|
|
49
|
+
}
|
|
50
|
+
return -1;
|
|
51
|
+
}
|
|
52
|
+
function globToRegExpSource(pattern) {
|
|
53
|
+
let out = "";
|
|
54
|
+
let i = 0;
|
|
55
|
+
while (i < pattern.length) {
|
|
56
|
+
const ch = pattern[i];
|
|
57
|
+
if (ch === "\\") {
|
|
58
|
+
const next = pattern[i + 1];
|
|
59
|
+
if (next === undefined) {
|
|
60
|
+
out += String.raw`\\`;
|
|
61
|
+
i += 1;
|
|
62
|
+
} else {
|
|
63
|
+
out += literal(next);
|
|
64
|
+
i += 2;
|
|
65
|
+
}
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (ch === "*") {
|
|
69
|
+
let stars = 0;
|
|
70
|
+
while (pattern[i] === "*") {
|
|
71
|
+
stars += 1;
|
|
72
|
+
i += 1;
|
|
73
|
+
}
|
|
74
|
+
const atSegmentStart = out === "" || out.endsWith("/");
|
|
75
|
+
if (stars >= 2 && atSegmentStart && pattern[i] === "/") {
|
|
76
|
+
out += "(?:[^/]+/)*";
|
|
77
|
+
i += 1;
|
|
78
|
+
} else if (stars >= 2 && atSegmentStart && i >= pattern.length) {
|
|
79
|
+
out += ".*";
|
|
80
|
+
} else {
|
|
81
|
+
out += "[^/]*";
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (ch === "?") {
|
|
86
|
+
out += "[^/]";
|
|
87
|
+
i += 1;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (ch === "[") {
|
|
91
|
+
const end = charClassEnd(pattern, i);
|
|
92
|
+
if (end === -1) {
|
|
93
|
+
out += String.raw`\[`;
|
|
94
|
+
i += 1;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const raw = pattern.slice(i + 1, end);
|
|
98
|
+
const negatedClass = raw.startsWith("!");
|
|
99
|
+
const members = negatedClass ? raw.slice(1) : raw;
|
|
100
|
+
out += `[${negatedClass ? "^" : ""}${members.startsWith("]") ? String.raw`\]${members.slice(1)}` : members}]`;
|
|
101
|
+
i = end + 1;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
out += literal(ch);
|
|
105
|
+
i += 1;
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
function parseLine(raw) {
|
|
110
|
+
let line = stripTrailingSpaces(raw);
|
|
111
|
+
if (line === "" || line.startsWith("#")) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
let negated = false;
|
|
115
|
+
if (line.startsWith("!")) {
|
|
116
|
+
negated = true;
|
|
117
|
+
line = line.slice(1);
|
|
118
|
+
}
|
|
119
|
+
let dirOnly = false;
|
|
120
|
+
if (line.endsWith("/")) {
|
|
121
|
+
dirOnly = true;
|
|
122
|
+
line = line.slice(0, -1);
|
|
123
|
+
}
|
|
124
|
+
let anchored = line.includes("/");
|
|
125
|
+
if (line.startsWith("/")) {
|
|
126
|
+
line = line.slice(1);
|
|
127
|
+
anchored = true;
|
|
128
|
+
}
|
|
129
|
+
if (line === "") {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const body = globToRegExpSource(line);
|
|
133
|
+
return {
|
|
134
|
+
dirOnly,
|
|
135
|
+
negated,
|
|
136
|
+
re: new RegExp(`^${anchored ? "" : "(?:.*/)?"}${body}$`),
|
|
137
|
+
source: raw
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function parseGitignore(text) {
|
|
141
|
+
const rules = [];
|
|
142
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
143
|
+
const rule = parseLine(raw);
|
|
144
|
+
if (rule) {
|
|
145
|
+
rules.push(rule);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return rules;
|
|
149
|
+
}
|
|
150
|
+
function normalizePath(path) {
|
|
151
|
+
const p = path.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
152
|
+
return p === "." ? "" : p;
|
|
153
|
+
}
|
|
154
|
+
function relativeTo(base, path) {
|
|
155
|
+
if (base === "") {
|
|
156
|
+
return path;
|
|
157
|
+
}
|
|
158
|
+
return path.startsWith(`${base}/`) ? path.slice(base.length + 1) : null;
|
|
159
|
+
}
|
|
160
|
+
function ancestorDirs(dir) {
|
|
161
|
+
const base = normalizePath(dir);
|
|
162
|
+
const chain = [""];
|
|
163
|
+
if (base === "") {
|
|
164
|
+
return chain;
|
|
165
|
+
}
|
|
166
|
+
let acc = "";
|
|
167
|
+
for (const segment of base.split("/")) {
|
|
168
|
+
acc = acc === "" ? segment : `${acc}/${segment}`;
|
|
169
|
+
chain.push(acc);
|
|
170
|
+
}
|
|
171
|
+
return chain;
|
|
172
|
+
}
|
|
173
|
+
function verdictFor(layers, path, isDir) {
|
|
174
|
+
let ignored = false;
|
|
175
|
+
for (const layer of layers) {
|
|
176
|
+
const rel = relativeTo(layer.base, path);
|
|
177
|
+
if (rel === null || rel === "") {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
for (const rule of layer.rules) {
|
|
181
|
+
if (rule.dirOnly && !isDir) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (rule.re.test(rel)) {
|
|
185
|
+
ignored = !rule.negated;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return ignored;
|
|
190
|
+
}
|
|
191
|
+
function isIgnored(layers, path, isDir) {
|
|
192
|
+
const target = normalizePath(path);
|
|
193
|
+
if (target === "") {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
const segments = target.split("/");
|
|
197
|
+
let prefix = "";
|
|
198
|
+
for (const [index, segment] of segments.entries()) {
|
|
199
|
+
prefix = prefix === "" ? segment : `${prefix}/${segment}`;
|
|
200
|
+
const last = index === segments.length - 1;
|
|
201
|
+
if (verdictFor(layers, prefix, last ? isDir : true)) {
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
var layerCache = new Map;
|
|
208
|
+
var inFlight = new Map;
|
|
209
|
+
function resetIgnoreCache() {
|
|
210
|
+
layerCache.clear();
|
|
211
|
+
inFlight.clear();
|
|
212
|
+
}
|
|
213
|
+
async function readGitignore(dir) {
|
|
214
|
+
try {
|
|
215
|
+
const text = await getPlatform().readFile(dir === "" ? ".gitignore" : `${dir}/.gitignore`);
|
|
216
|
+
return { base: dir, rules: parseGitignore(text) };
|
|
217
|
+
} catch {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function readLayer(dir) {
|
|
222
|
+
const cached = layerCache.get(dir);
|
|
223
|
+
if (cached !== undefined) {
|
|
224
|
+
return Promise.resolve(cached);
|
|
225
|
+
}
|
|
226
|
+
const pending = inFlight.get(dir);
|
|
227
|
+
if (pending) {
|
|
228
|
+
return pending;
|
|
229
|
+
}
|
|
230
|
+
const read = readGitignore(dir).then((layer) => {
|
|
231
|
+
layerCache.set(dir, layer);
|
|
232
|
+
inFlight.delete(dir);
|
|
233
|
+
return layer;
|
|
234
|
+
});
|
|
235
|
+
inFlight.set(dir, read);
|
|
236
|
+
return read;
|
|
237
|
+
}
|
|
238
|
+
async function reloadIgnoreCache() {
|
|
239
|
+
const dirs = [...layerCache.keys()];
|
|
240
|
+
inFlight.clear();
|
|
241
|
+
const fresh = await Promise.all(dirs.map((dir) => readGitignore(dir)));
|
|
242
|
+
layerCache.clear();
|
|
243
|
+
for (const [index, dir] of dirs.entries()) {
|
|
244
|
+
layerCache.set(dir, fresh[index] ?? null);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function ensureIgnoreLayers(dir) {
|
|
248
|
+
await Promise.all(ancestorDirs(dir).map((ancestor) => readLayer(ancestor)));
|
|
249
|
+
}
|
|
250
|
+
function loadedLayersFor(dir) {
|
|
251
|
+
const layers = [];
|
|
252
|
+
for (const ancestor of ancestorDirs(dir)) {
|
|
253
|
+
const layer = layerCache.get(ancestor);
|
|
254
|
+
if (layer) {
|
|
255
|
+
layers.push(layer);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return layers;
|
|
259
|
+
}
|
|
260
|
+
function isIgnoredEntry(dir, path, isDir) {
|
|
261
|
+
return isIgnored(loadedLayersFor(dir), path, isDir);
|
|
262
|
+
}
|
|
263
|
+
function touchesGitignore(paths) {
|
|
264
|
+
return paths.some((path) => normalizePath(path).split("/").pop() === ".gitignore");
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// src/files/fs-events.ts
|
|
268
|
+
var RECENT_MS = 1500;
|
|
269
|
+
var recentLocal = new Map;
|
|
270
|
+
var norm = (p) => p.replaceAll("\\", "/");
|
|
271
|
+
function markLocalMutation(...paths) {
|
|
272
|
+
const expiry = Date.now() + RECENT_MS;
|
|
273
|
+
for (const p of paths) {
|
|
274
|
+
if (p) {
|
|
275
|
+
recentLocal.set(norm(p), expiry);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function isRecentLocal(path) {
|
|
280
|
+
const key = norm(path);
|
|
281
|
+
const expiry = recentLocal.get(key);
|
|
282
|
+
if (expiry === undefined) {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
if (Date.now() > expiry) {
|
|
286
|
+
recentLocal.delete(key);
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
function parentDir(path) {
|
|
292
|
+
const i = path.lastIndexOf("/");
|
|
293
|
+
return i === -1 ? "." : path.slice(0, i);
|
|
294
|
+
}
|
|
295
|
+
function baseName(path) {
|
|
296
|
+
const i = path.lastIndexOf("/");
|
|
297
|
+
return i === -1 ? path : path.slice(i + 1);
|
|
298
|
+
}
|
|
299
|
+
function applyFsEvents(dirs, expanded, events) {
|
|
300
|
+
const changedDirs = new Set;
|
|
301
|
+
for (const ev of events) {
|
|
302
|
+
const parent = parentDir(ev.path);
|
|
303
|
+
if (ev.type === "add" || ev.type === "addDir") {
|
|
304
|
+
const entries = dirs.get(parent);
|
|
305
|
+
if (entries && !entries.some((e) => e.path === ev.path)) {
|
|
306
|
+
entries.push({
|
|
307
|
+
name: baseName(ev.path),
|
|
308
|
+
path: ev.path,
|
|
309
|
+
type: ev.isDir ? "directory" : "file"
|
|
310
|
+
});
|
|
311
|
+
changedDirs.add(parent);
|
|
312
|
+
}
|
|
313
|
+
if (ev.type === "addDir" && !dirs.has(ev.path)) {
|
|
314
|
+
dirs.set(ev.path, []);
|
|
315
|
+
}
|
|
316
|
+
} else if (ev.type === "unlink" || ev.type === "unlinkDir") {
|
|
317
|
+
const entries = dirs.get(parent);
|
|
318
|
+
if (entries) {
|
|
319
|
+
const idx = entries.findIndex((e) => e.path === ev.path);
|
|
320
|
+
if (idx !== -1) {
|
|
321
|
+
entries.splice(idx, 1);
|
|
322
|
+
changedDirs.add(parent);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (ev.type === "unlinkDir") {
|
|
326
|
+
dirs.delete(ev.path);
|
|
327
|
+
const nestedDirs = [];
|
|
328
|
+
for (const key of dirs.keys()) {
|
|
329
|
+
if (key.startsWith(`${ev.path}/`)) {
|
|
330
|
+
nestedDirs.push(key);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
for (const key of nestedDirs) {
|
|
334
|
+
dirs.delete(key);
|
|
335
|
+
}
|
|
336
|
+
const staleExpanded = [];
|
|
337
|
+
for (const key of expanded) {
|
|
338
|
+
if (key === ev.path || key.startsWith(`${ev.path}/`)) {
|
|
339
|
+
staleExpanded.push(key);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
for (const key of staleExpanded) {
|
|
343
|
+
expanded.delete(key);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return changedDirs;
|
|
349
|
+
}
|
|
350
|
+
function startFsSync(ctx) {
|
|
351
|
+
const platform = getPlatform();
|
|
352
|
+
if (!platform.subscribeFileEvents) {
|
|
353
|
+
return () => {};
|
|
354
|
+
}
|
|
355
|
+
let pending = [];
|
|
356
|
+
let timer = null;
|
|
357
|
+
const flush = () => {
|
|
358
|
+
timer = null;
|
|
359
|
+
const state = projectState;
|
|
360
|
+
const batch = pending.filter((e) => !isRecentLocal(e.path));
|
|
361
|
+
pending = [];
|
|
362
|
+
if (!state || batch.length === 0) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
const changedDirs = applyFsEvents(state.dirs, state.expanded, batch);
|
|
366
|
+
if (ctx.onContentChange) {
|
|
367
|
+
for (const ev of batch) {
|
|
368
|
+
if (ev.type === "change") {
|
|
369
|
+
ctx.onContentChange(ev.path);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (changedDirs.size > 0) {
|
|
374
|
+
ctx.renderLeftPanel();
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
return platform.subscribeFileEvents((events) => {
|
|
378
|
+
invalidateUsages();
|
|
379
|
+
ctx.invalidateDerivedCaches?.();
|
|
380
|
+
if (touchesGitignore(events.map((event) => event.path))) {
|
|
381
|
+
reloadIgnoreCache().then(() => ctx.renderLeftPanel());
|
|
382
|
+
}
|
|
383
|
+
pending.push(...events);
|
|
384
|
+
if (timer) {
|
|
385
|
+
clearTimeout(timer);
|
|
386
|
+
}
|
|
387
|
+
timer = setTimeout(flush, 50);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export { resetIgnoreCache, ensureIgnoreLayers, isIgnoredEntry, markLocalMutation, isRecentLocal, applyFsEvents, startFsSync };
|
|
392
|
+
|
|
393
|
+
//# debugId=3BC9649D86675B2D64756E2164756E21
|
|
394
|
+
//# sourceMappingURL=studio-q43a5y9h.js.map
|