@jxsuite/studio 0.17.0 → 0.18.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/dist/studio.js +1678 -1512
- package/dist/studio.js.map +20 -16
- package/package.json +2 -2
- package/src/canvas/canvas-render.js +2 -2
- package/src/canvas/canvas-utils.js +1 -1
- package/src/files/files.js +13 -1
- package/src/panels/activity-bar.js +12 -0
- package/src/panels/left-panel.js +2 -2
- package/src/panels/overlays.js +2 -2
- package/src/panels/style-panel.js +1 -1
- package/src/panels/stylebook-panel.js +30 -529
- package/src/panels/toolbar.js +7 -2
- package/src/settings/css-vars-editor.js +307 -0
- package/src/settings/general-settings.js +94 -0
- package/src/settings/head-editor.js +184 -0
- package/src/settings/settings-modal.js +117 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Jx Studio — visual builder for Jx documents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/pragmatic-drag-and-drop": "^1.8.1",
|
|
32
32
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
33
|
-
"@jxsuite/runtime": "^0.
|
|
33
|
+
"@jxsuite/runtime": "^0.18.0",
|
|
34
34
|
"@spectrum-web-components/accordion": "^1.12.1",
|
|
35
35
|
"@spectrum-web-components/action-bar": "1.12.1",
|
|
36
36
|
"@spectrum-web-components/action-button": "^1.12.1",
|
|
@@ -173,8 +173,8 @@ export function renderCanvas() {
|
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
//
|
|
177
|
-
if (canvasMode === "
|
|
176
|
+
// Stylebook mode: render element catalog with panzoom surface
|
|
177
|
+
if (canvasMode === "stylebook") {
|
|
178
178
|
renderStylebookMode({
|
|
179
179
|
canvasPanelTemplate,
|
|
180
180
|
applyTransform,
|
|
@@ -170,7 +170,7 @@ export function applyTransform() {
|
|
|
170
170
|
view.panzoomWrap.style.transform = `translate(${view.panX}px, ${view.panY}px) scale(${zoom})`;
|
|
171
171
|
renderZoomIndicator();
|
|
172
172
|
renderOnly("overlays");
|
|
173
|
-
if (_ctx.getCanvasMode() === "
|
|
173
|
+
if (_ctx.getCanvasMode() === "stylebook") _ctx.renderStylebookOverlays();
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
/** Calculate zoom + pan to fit all panels within the viewport. */
|
package/src/files/files.js
CHANGED
|
@@ -15,7 +15,13 @@ import { createState, projectState, setProjectState } from "../store.js";
|
|
|
15
15
|
import { getPlatform } from "../platform.js";
|
|
16
16
|
import { statusMessage } from "../panels/statusbar.js";
|
|
17
17
|
import { loadComponentRegistry } from "./components.js";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
workspace,
|
|
20
|
+
openTab,
|
|
21
|
+
activateTab,
|
|
22
|
+
replaceAllTabs,
|
|
23
|
+
activeTab,
|
|
24
|
+
} from "../workspace/workspace.js";
|
|
19
25
|
import { loadMarkdown } from "./file-ops.js";
|
|
20
26
|
import { view } from "../view.js";
|
|
21
27
|
import { addRecentProject, trackRecentFile } from "../recent-projects.js";
|
|
@@ -636,6 +642,12 @@ export async function openFileInTab(path) {
|
|
|
636
642
|
});
|
|
637
643
|
projectState.selectedPath = path;
|
|
638
644
|
trackRecentFile({ path, name: path.split("/").pop() || path });
|
|
645
|
+
|
|
646
|
+
if (path === "project.json") {
|
|
647
|
+
const tab = activeTab.value;
|
|
648
|
+
if (tab) tab.session.ui.canvasMode = "stylebook";
|
|
649
|
+
}
|
|
650
|
+
|
|
639
651
|
statusMessage(`Opened ${path.split("/").pop()}`);
|
|
640
652
|
} catch (/** @type {any} */ e) {
|
|
641
653
|
statusMessage(`Error: ${e.message}`);
|
|
@@ -5,6 +5,7 @@ import { activityBar, renderOnly } from "../store.js";
|
|
|
5
5
|
import { effect, effectScope } from "../reactivity.js";
|
|
6
6
|
import { activeTab } from "../workspace/workspace.js";
|
|
7
7
|
import { view } from "../view.js";
|
|
8
|
+
import { openSettingsModal } from "../settings/settings-modal.js";
|
|
8
9
|
|
|
9
10
|
/** @type {import("@vue/reactivity").EffectScope | null} */
|
|
10
11
|
let _scope = null;
|
|
@@ -113,6 +114,17 @@ export function renderActivityBar() {
|
|
|
113
114
|
`,
|
|
114
115
|
)}
|
|
115
116
|
</sp-tabs>
|
|
117
|
+
<div style="margin-top:auto;padding:8px 0;display:flex;justify-content:center">
|
|
118
|
+
<sp-action-button
|
|
119
|
+
quiet
|
|
120
|
+
size="m"
|
|
121
|
+
title="Settings"
|
|
122
|
+
aria-label="Settings"
|
|
123
|
+
@click=${() => openSettingsModal()}
|
|
124
|
+
>
|
|
125
|
+
<sp-icon-gears slot="icon"></sp-icon-gears>
|
|
126
|
+
</sp-action-button>
|
|
127
|
+
</div>
|
|
116
128
|
`;
|
|
117
129
|
litRender(tpl, /** @type {any} */ (activityBar));
|
|
118
130
|
}
|
package/src/panels/left-panel.js
CHANGED
|
@@ -131,7 +131,7 @@ function _render() {
|
|
|
131
131
|
let content;
|
|
132
132
|
if (tab === "layers")
|
|
133
133
|
content =
|
|
134
|
-
ctx.getCanvasMode() === "
|
|
134
|
+
ctx.getCanvasMode() === "stylebook"
|
|
135
135
|
? renderStylebookLayersTemplate({
|
|
136
136
|
selectStylebookTag,
|
|
137
137
|
stylebookMeta,
|
|
@@ -197,7 +197,7 @@ function _render() {
|
|
|
197
197
|
litRender(html`<div class="panel-body">${content}</div>`, leftPanel);
|
|
198
198
|
|
|
199
199
|
// Post-render side effects
|
|
200
|
-
if (tab === "layers" && ctx.getCanvasMode() !== "
|
|
200
|
+
if (tab === "layers" && ctx.getCanvasMode() !== "stylebook") ctx.registerLayersDnD();
|
|
201
201
|
else if (tab === "imports") {
|
|
202
202
|
/* no post-render DnD needed */
|
|
203
203
|
} else if (tab === "blocks") {
|
package/src/panels/overlays.js
CHANGED
|
@@ -83,7 +83,7 @@ function _flush() {
|
|
|
83
83
|
const { stylebookTab } = tab.session.ui;
|
|
84
84
|
const canvasMode = _ctx.getCanvasMode();
|
|
85
85
|
|
|
86
|
-
if (canvasMode !== "design" && canvasMode !== "edit" && canvasMode !== "
|
|
86
|
+
if (canvasMode !== "design" && canvasMode !== "edit" && canvasMode !== "stylebook") {
|
|
87
87
|
for (const p of canvasPanels) {
|
|
88
88
|
litRender(nothing, p.overlay);
|
|
89
89
|
p.overlayClk.style.pointerEvents = "none";
|
|
@@ -95,7 +95,7 @@ function _flush() {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
if (canvasMode === "
|
|
98
|
+
if (canvasMode === "stylebook") {
|
|
99
99
|
const enable = stylebookTab === "elements";
|
|
100
100
|
for (const p of canvasPanels) {
|
|
101
101
|
p.overlayClk.style.pointerEvents = enable ? "" : "none";
|
|
@@ -620,7 +620,7 @@ function styleSidebarTemplate(node, activeMediaTab, activeSelector) {
|
|
|
620
620
|
export function renderStylePanelTemplate(ctx) {
|
|
621
621
|
const tab = activeTab.value;
|
|
622
622
|
if (!tab) return html`<div class="empty-state">No document loaded</div>`;
|
|
623
|
-
if (ctx.getCanvasMode() === "
|
|
623
|
+
if (ctx.getCanvasMode() === "stylebook" && tab.session.ui.stylebookSelection) {
|
|
624
624
|
const node = tab.doc.document;
|
|
625
625
|
if (!node) return html`<div class="empty-state">No document loaded</div>`;
|
|
626
626
|
return html`
|