@jxsuite/studio 0.28.2 → 0.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/studio.js +86144 -83971
- package/dist/studio.js.map +229 -219
- package/package.json +5 -5
- package/src/browse/browse-modal.ts +9 -3
- package/src/browse/browse.ts +139 -82
- package/src/canvas/canvas-diff.ts +35 -18
- package/src/canvas/canvas-helpers.ts +55 -21
- package/src/canvas/canvas-live-render.ts +140 -89
- package/src/canvas/canvas-render.ts +127 -82
- package/src/canvas/canvas-utils.ts +68 -42
- package/src/canvas/nested-site-style.ts +15 -7
- package/src/editor/component-inline-edit.ts +90 -51
- package/src/editor/content-inline-edit.ts +75 -72
- package/src/editor/context-menu.ts +125 -71
- package/src/editor/convert-targets.ts +17 -13
- package/src/editor/convert-to-component.ts +51 -28
- package/src/editor/convert-to-repeater.ts +44 -19
- package/src/editor/inline-edit.ts +107 -52
- package/src/editor/inline-format.ts +128 -60
- package/src/editor/insertion-helper.ts +26 -14
- package/src/editor/shortcuts.ts +89 -43
- package/src/editor/slash-menu.ts +41 -26
- package/src/files/components.ts +9 -7
- package/src/files/file-ops.ts +53 -33
- package/src/files/files.ts +246 -143
- package/src/format/constraints.ts +25 -15
- package/src/format/format-host.ts +33 -10
- package/src/github/github-auth.ts +24 -14
- package/src/github/github-publish.ts +20 -14
- package/src/new-project/new-project-modal.ts +27 -18
- package/src/panels/activity-bar.ts +27 -26
- package/src/panels/ai-panel.ts +100 -44
- package/src/panels/block-action-bar.ts +84 -52
- package/src/panels/canvas-dnd.ts +47 -28
- package/src/panels/data-explorer.ts +24 -11
- package/src/panels/dnd.ts +148 -100
- package/src/panels/editors.ts +54 -37
- package/src/panels/elements-panel.ts +23 -13
- package/src/panels/events-panel.ts +48 -38
- package/src/panels/git-panel.ts +95 -60
- package/src/panels/head-panel.ts +138 -84
- package/src/panels/imports-panel.ts +66 -29
- package/src/panels/layers-panel.ts +80 -36
- package/src/panels/left-panel.ts +86 -53
- package/src/panels/overlays.ts +36 -19
- package/src/panels/panel-events.ts +48 -27
- package/src/panels/panel-scheduler.ts +41 -23
- package/src/panels/preview-render.ts +26 -26
- package/src/panels/properties-panel.ts +155 -118
- package/src/panels/pseudo-preview.ts +31 -15
- package/src/panels/quick-search.ts +28 -13
- package/src/panels/right-panel.ts +35 -24
- package/src/panels/shared.ts +46 -29
- package/src/panels/signals-panel.ts +303 -186
- package/src/panels/statusbar.ts +27 -12
- package/src/panels/style-inputs.ts +30 -24
- package/src/panels/style-panel.ts +130 -90
- package/src/panels/style-utils.ts +63 -23
- package/src/panels/stylebook-layers-panel.ts +27 -30
- package/src/panels/stylebook-panel.ts +140 -72
- package/src/panels/tab-strip.ts +21 -10
- package/src/panels/toolbar.ts +52 -40
- package/src/panels/welcome-screen.ts +1 -1
- package/src/platform.ts +2 -1
- package/src/platforms/devserver.ts +221 -105
- package/src/recent-projects.ts +15 -7
- package/src/resize-edges.ts +7 -5
- package/src/services/cem-export.ts +73 -57
- package/src/services/code-services.ts +52 -25
- package/src/services/monaco-setup.ts +5 -5
- package/src/settings/content-types-editor.ts +133 -62
- package/src/settings/css-vars-editor.ts +31 -14
- package/src/settings/defs-editor.ts +125 -63
- package/src/settings/general-settings.ts +11 -6
- package/src/settings/head-editor.ts +30 -15
- package/src/settings/schema-field-ui.ts +75 -35
- package/src/settings/settings-modal.ts +35 -17
- package/src/site-context.ts +80 -47
- package/src/state.ts +98 -65
- package/src/store.ts +42 -23
- package/src/studio.ts +165 -144
- package/src/tabs/tab.ts +51 -45
- package/src/tabs/transact.ts +230 -109
- package/src/types.ts +60 -51
- package/src/ui/button-group.ts +3 -2
- package/src/ui/color-selector.ts +33 -15
- package/src/ui/expression-editor.ts +139 -86
- package/src/ui/field-input.ts +35 -18
- package/src/ui/field-row.ts +1 -1
- package/src/ui/icons.ts +5 -6
- package/src/ui/layers.ts +33 -26
- package/src/ui/media-picker.ts +13 -7
- package/src/ui/panel-resize.ts +39 -20
- package/src/ui/spectrum.ts +4 -2
- package/src/ui/unit-selector.ts +20 -11
- package/src/ui/value-selector.ts +13 -7
- package/src/ui/widgets.ts +34 -18
- package/src/utils/canvas-media.ts +66 -33
- package/src/utils/edit-display.ts +43 -44
- package/src/utils/google-fonts.ts +10 -6
- package/src/utils/inherited-style.ts +22 -8
- package/src/utils/studio-utils.ts +88 -45
- package/src/view.ts +9 -5
- package/src/workspace/workspace.ts +49 -29
package/src/view.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* store.js) makes renderer dependencies explicit.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import type { editor } from "monaco-editor";
|
|
11
|
+
|
|
10
12
|
interface ViewState {
|
|
11
13
|
panzoomWrap: HTMLElement | null;
|
|
12
14
|
renderGeneration: number;
|
|
@@ -16,12 +18,12 @@ interface ViewState {
|
|
|
16
18
|
panY: number;
|
|
17
19
|
prevCanvasMode: string | null;
|
|
18
20
|
monacoEditor:
|
|
19
|
-
| (
|
|
21
|
+
| (editor.IStandaloneCodeEditor & {
|
|
20
22
|
_ignoreNextChange?: boolean;
|
|
21
23
|
})
|
|
22
24
|
| null;
|
|
23
25
|
functionEditor:
|
|
24
|
-
| (
|
|
26
|
+
| (editor.IStandaloneCodeEditor & {
|
|
25
27
|
_ignoreNextChange?: boolean;
|
|
26
28
|
_editingTarget?: string | null;
|
|
27
29
|
})
|
|
@@ -136,8 +138,10 @@ export const view: ViewState = {
|
|
|
136
138
|
const COLLAPSE_STORAGE_KEY = "jx-studio-panel-widths";
|
|
137
139
|
|
|
138
140
|
export function applyPanelCollapse() {
|
|
139
|
-
const app = document.
|
|
140
|
-
if (!app)
|
|
141
|
+
const app = document.querySelector("#app");
|
|
142
|
+
if (!app) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
141
145
|
app.classList.toggle("left-collapsed", view.leftPanelCollapsed);
|
|
142
146
|
app.classList.toggle("right-collapsed", view.rightPanelCollapsed);
|
|
143
147
|
try {
|
|
@@ -146,6 +150,6 @@ export function applyPanelCollapse() {
|
|
|
146
150
|
saved.rightCollapsed = view.rightPanelCollapsed;
|
|
147
151
|
localStorage.setItem(COLLAPSE_STORAGE_KEY, JSON.stringify(saved));
|
|
148
152
|
} catch {
|
|
149
|
-
//
|
|
153
|
+
// Storage unavailable
|
|
150
154
|
}
|
|
151
155
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, reactive } from "../reactivity";
|
|
2
2
|
import { createTab, disposeTab } from "../tabs/tab";
|
|
3
3
|
import type { Tab } from "../tabs/tab";
|
|
4
4
|
|
|
5
5
|
import type { ComponentEntry } from "../files/components";
|
|
6
|
-
import type {
|
|
6
|
+
import type { JxMutableNode, JxStyle } from "@jxsuite/schema/types";
|
|
7
|
+
import type { ComputedRef } from "@vue/reactivity";
|
|
7
8
|
|
|
8
9
|
interface FileEntry {
|
|
9
10
|
name: string;
|
|
@@ -11,40 +12,49 @@ interface FileEntry {
|
|
|
11
12
|
type: string;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export interface Workspace {
|
|
16
|
+
projectRoot: string | null;
|
|
17
|
+
projectConfig: object | null;
|
|
18
|
+
componentRegistry: ComponentEntry[];
|
|
19
|
+
clipboard: JxMutableNode | null;
|
|
20
|
+
styleClipboard: JxStyle | null;
|
|
21
|
+
fileTree: {
|
|
22
|
+
dirs: Map<string, FileEntry[]>;
|
|
23
|
+
expanded: Set<string>;
|
|
24
|
+
selectedPath: string | null;
|
|
25
|
+
searchQuery: string;
|
|
26
|
+
};
|
|
27
|
+
tabs: Map<string, Tab>;
|
|
28
|
+
tabOrder: string[];
|
|
29
|
+
activeTabId: string | null;
|
|
30
|
+
ui: { activityBar: string };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Annotated as Workspace: Vue's UnwrapNestedRefs cannot terminate on the
|
|
34
|
+
// Recursive document types, and reactive() does not unwrap refs we never use.
|
|
35
|
+
export const workspace: Workspace = reactive({
|
|
36
|
+
activeTabId: null as string | null,
|
|
22
37
|
clipboard: null as JxMutableNode | null,
|
|
23
|
-
|
|
24
|
-
styleClipboard: null as JxStyle | null,
|
|
38
|
+
componentRegistry: [] as ComponentEntry[],
|
|
25
39
|
fileTree: {
|
|
26
|
-
/** @type {Map<string, FileEntry[]>} */
|
|
27
40
|
dirs: new Map<string, FileEntry[]>(),
|
|
28
|
-
/** @type {Set<string>} */
|
|
29
41
|
expanded: new Set<string>(),
|
|
30
|
-
/** @type {string | null} */
|
|
31
|
-
selectedPath: null as string | null,
|
|
32
42
|
searchQuery: "",
|
|
43
|
+
selectedPath: null as string | null,
|
|
33
44
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
projectConfig: null as object | null,
|
|
46
|
+
projectRoot: null as string | null,
|
|
47
|
+
styleClipboard: null as JxStyle | null,
|
|
37
48
|
tabOrder: [] as string[],
|
|
38
|
-
|
|
39
|
-
activeTabId: null as string | null,
|
|
49
|
+
tabs: new Map<string, Tab>(),
|
|
40
50
|
ui: {
|
|
41
51
|
activityBar: "files",
|
|
42
52
|
},
|
|
43
|
-
});
|
|
53
|
+
}) as unknown as Workspace;
|
|
44
54
|
|
|
45
55
|
export const activeTab = computed(() =>
|
|
46
56
|
workspace.activeTabId ? (workspace.tabs.get(workspace.activeTabId) ?? null) : null,
|
|
47
|
-
) as unknown as
|
|
57
|
+
) as unknown as ComputedRef<Tab | null>;
|
|
48
58
|
|
|
49
59
|
/**
|
|
50
60
|
* Open a new tab and make it active.
|
|
@@ -83,12 +93,14 @@ export function openTab(opts: {
|
|
|
83
93
|
*/
|
|
84
94
|
export function closeTab(tabId: string) {
|
|
85
95
|
const tab = workspace.tabs.get(tabId);
|
|
86
|
-
if (!tab)
|
|
96
|
+
if (!tab) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
87
99
|
disposeTab(tab);
|
|
88
100
|
workspace.tabs.delete(tabId);
|
|
89
101
|
workspace.tabOrder = workspace.tabOrder.filter((id) => id !== tabId);
|
|
90
102
|
if (workspace.activeTabId === tabId) {
|
|
91
|
-
workspace.activeTabId = workspace.tabOrder
|
|
103
|
+
workspace.activeTabId = workspace.tabOrder.at(-1) || null;
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
106
|
|
|
@@ -132,7 +144,9 @@ export function replaceAllTabs(newTabOpts: {
|
|
|
132
144
|
workspace.tabOrder = [newTab.id];
|
|
133
145
|
|
|
134
146
|
for (const id of oldIds) {
|
|
135
|
-
if (id === newTab.id)
|
|
147
|
+
if (id === newTab.id) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
136
150
|
workspace.tabs.delete(id);
|
|
137
151
|
}
|
|
138
152
|
for (const tab of oldTabs) {
|
|
@@ -148,7 +162,9 @@ export function replaceAllTabs(newTabOpts: {
|
|
|
148
162
|
* @param {string} tabId
|
|
149
163
|
*/
|
|
150
164
|
export function activateTab(tabId: string) {
|
|
151
|
-
if (workspace.tabs.has(tabId))
|
|
165
|
+
if (workspace.tabs.has(tabId)) {
|
|
166
|
+
workspace.activeTabId = tabId;
|
|
167
|
+
}
|
|
152
168
|
}
|
|
153
169
|
|
|
154
170
|
/**
|
|
@@ -161,11 +177,15 @@ export function activateTab(tabId: string) {
|
|
|
161
177
|
*/
|
|
162
178
|
export function renameTab(oldId: string, newId: string, newDocumentPath: string) {
|
|
163
179
|
const tab = workspace.tabs.get(oldId);
|
|
164
|
-
if (!tab)
|
|
180
|
+
if (!tab) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
165
183
|
tab.id = newId;
|
|
166
184
|
tab.documentPath = newDocumentPath;
|
|
167
185
|
workspace.tabs.delete(oldId);
|
|
168
186
|
workspace.tabs.set(newId, tab);
|
|
169
187
|
workspace.tabOrder = workspace.tabOrder.map((id) => (id === oldId ? newId : id));
|
|
170
|
-
if (workspace.activeTabId === oldId)
|
|
188
|
+
if (workspace.activeTabId === oldId) {
|
|
189
|
+
workspace.activeTabId = newId;
|
|
190
|
+
}
|
|
171
191
|
}
|