@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/tabs/tab.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference lib="dom" />
|
|
2
|
-
import {
|
|
2
|
+
import { effectScope, reactive } from "../reactivity";
|
|
3
3
|
import { formatByName, formatForPath } from "../format/format-host";
|
|
4
4
|
import type {
|
|
5
|
-
GitDiffState,
|
|
6
|
-
InlineEditDef,
|
|
7
|
-
FunctionEditDef,
|
|
8
5
|
DocumentStackEntry,
|
|
9
|
-
|
|
6
|
+
FunctionEditDef,
|
|
10
7
|
GitBranchesResult,
|
|
8
|
+
GitDiffState,
|
|
9
|
+
GitStatusResult,
|
|
10
|
+
InlineEditDef,
|
|
11
11
|
} from "../types";
|
|
12
12
|
import type { JxMutableNode } from "@jxsuite/schema/types";
|
|
13
13
|
|
|
@@ -49,8 +49,8 @@ export interface Tab {
|
|
|
49
49
|
fileHandle: FileSystemFileHandle | null;
|
|
50
50
|
capabilities: { modes: string[] };
|
|
51
51
|
scope: {
|
|
52
|
-
stop()
|
|
53
|
-
run<T>(fn: () => T)
|
|
52
|
+
stop: () => void;
|
|
53
|
+
run: <T>(fn: () => T) => T | undefined;
|
|
54
54
|
[k: string]: unknown;
|
|
55
55
|
};
|
|
56
56
|
doc: {
|
|
@@ -69,7 +69,7 @@ export interface Tab {
|
|
|
69
69
|
ui: TabUi;
|
|
70
70
|
canvas: {
|
|
71
71
|
status: string;
|
|
72
|
-
scope: { stop()
|
|
72
|
+
scope: { stop: () => void; [k: string]: unknown } | null;
|
|
73
73
|
error: string | null;
|
|
74
74
|
pendingInlineEdit: InlineEditDef | null;
|
|
75
75
|
};
|
|
@@ -83,30 +83,30 @@ export interface Tab {
|
|
|
83
83
|
/** @returns {TabUi} */
|
|
84
84
|
function createDefaultUi() {
|
|
85
85
|
return {
|
|
86
|
-
rightTab: "properties",
|
|
87
|
-
canvasMode: "edit",
|
|
88
|
-
zoom: 1,
|
|
89
86
|
activeMedia: null,
|
|
90
87
|
activeSelector: null,
|
|
88
|
+
canvasMode: "edit",
|
|
91
89
|
editingFunction: null,
|
|
92
90
|
featureToggles: {},
|
|
93
|
-
|
|
91
|
+
gitBranches: null,
|
|
92
|
+
gitCommitMessage: "",
|
|
93
|
+
gitDiffState: null,
|
|
94
|
+
gitError: null,
|
|
95
|
+
gitLoading: false,
|
|
96
|
+
gitStatus: null,
|
|
94
97
|
inspectorSections: {},
|
|
95
|
-
|
|
98
|
+
pendingInlineEdit: null,
|
|
99
|
+
rightTab: "properties",
|
|
100
|
+
settingsTab: "stylebook",
|
|
96
101
|
styleFilter: "",
|
|
97
102
|
styleFilterActive: false,
|
|
103
|
+
styleSections: {},
|
|
104
|
+
styleShorthands: {},
|
|
105
|
+
stylebookCustomizedOnly: false,
|
|
106
|
+
stylebookFilter: "",
|
|
98
107
|
stylebookSelection: null,
|
|
99
108
|
stylebookTab: "elements",
|
|
100
|
-
|
|
101
|
-
stylebookCustomizedOnly: false,
|
|
102
|
-
settingsTab: "stylebook",
|
|
103
|
-
gitStatus: null,
|
|
104
|
-
gitBranches: null,
|
|
105
|
-
gitCommitMessage: "",
|
|
106
|
-
gitLoading: false,
|
|
107
|
-
gitError: null,
|
|
108
|
-
gitDiffState: null,
|
|
109
|
-
pendingInlineEdit: null,
|
|
109
|
+
zoom: 1,
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -148,35 +148,35 @@ export function createTab({
|
|
|
148
148
|
const resolvedModes = capabilities?.modes ?? inferModes(documentPath, sourceFormat);
|
|
149
149
|
|
|
150
150
|
const tab = scope.run(() => ({
|
|
151
|
-
id,
|
|
152
|
-
documentPath,
|
|
153
|
-
fileHandle,
|
|
154
151
|
capabilities: { modes: resolvedModes },
|
|
155
|
-
scope,
|
|
156
152
|
doc: reactive({
|
|
157
|
-
document,
|
|
158
|
-
sourceFormat,
|
|
159
153
|
content: { frontmatter: frontmatter || {} },
|
|
160
|
-
mode: inferDocumentMode(documentPath, sourceFormat),
|
|
161
|
-
handlersSource: null,
|
|
162
154
|
dirty: false,
|
|
155
|
+
document,
|
|
156
|
+
handlersSource: null,
|
|
157
|
+
mode: inferDocumentMode(documentPath, sourceFormat),
|
|
158
|
+
sourceFormat,
|
|
163
159
|
}),
|
|
160
|
+
documentPath,
|
|
161
|
+
fileHandle,
|
|
162
|
+
history: reactive({
|
|
163
|
+
index: 0,
|
|
164
|
+
snapshots: [{ document: structuredClone(document), selection: null }],
|
|
165
|
+
}),
|
|
166
|
+
id,
|
|
167
|
+
scope,
|
|
164
168
|
session: reactive({
|
|
165
|
-
selection: null,
|
|
166
|
-
hover: null,
|
|
167
|
-
clipboard: null,
|
|
168
|
-
documentStack: [],
|
|
169
|
-
ui: createDefaultUi(),
|
|
170
169
|
canvas: {
|
|
171
|
-
status: "idle",
|
|
172
|
-
scope: null,
|
|
173
170
|
error: null,
|
|
174
171
|
pendingInlineEdit: null,
|
|
172
|
+
scope: null,
|
|
173
|
+
status: "idle",
|
|
175
174
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
clipboard: null,
|
|
176
|
+
documentStack: [],
|
|
177
|
+
hover: null,
|
|
178
|
+
selection: null,
|
|
179
|
+
ui: createDefaultUi(),
|
|
180
180
|
}),
|
|
181
181
|
})) as unknown as Tab;
|
|
182
182
|
|
|
@@ -189,9 +189,13 @@ export function createTab({
|
|
|
189
189
|
* @returns {string[]}
|
|
190
190
|
*/
|
|
191
191
|
function inferModes(documentPath: string | null | undefined, sourceFormat: string | null) {
|
|
192
|
-
if (documentPath === "project.json")
|
|
192
|
+
if (documentPath === "project.json") {
|
|
193
|
+
return ["stylebook", "source"];
|
|
194
|
+
}
|
|
193
195
|
const format = formatByName(sourceFormat) ?? formatForPath(documentPath);
|
|
194
|
-
if (format)
|
|
196
|
+
if (format) {
|
|
197
|
+
return format.studio?.modes ?? ["edit", "design", "preview", "source"];
|
|
198
|
+
}
|
|
195
199
|
return ALL_MODES;
|
|
196
200
|
}
|
|
197
201
|
|
|
@@ -205,7 +209,9 @@ function inferModes(documentPath: string | null | undefined, sourceFormat: strin
|
|
|
205
209
|
*/
|
|
206
210
|
function inferDocumentMode(documentPath: string | null | undefined, sourceFormat: string | null) {
|
|
207
211
|
const format = formatByName(sourceFormat) ?? formatForPath(documentPath);
|
|
208
|
-
if (format)
|
|
212
|
+
if (format) {
|
|
213
|
+
return format.studio?.documentMode?.default ?? "content";
|
|
214
|
+
}
|
|
209
215
|
return "component";
|
|
210
216
|
}
|
|
211
217
|
|