@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
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { elToPath } from "../store";
|
|
8
|
+
import { isMappedArray, isRef } from "@jxsuite/schema/guards";
|
|
8
9
|
import { activeTab } from "../workspace/workspace";
|
|
9
10
|
import { applyCanvasStyle } from "../utils/canvas-media";
|
|
10
11
|
import { resolveDefaultForCanvas } from "../panels/signals-panel";
|
|
@@ -29,10 +30,12 @@ export function renderCanvasNode(
|
|
|
29
30
|
featureToggles: Record<string, boolean>,
|
|
30
31
|
) {
|
|
31
32
|
if (typeof node === "string" || typeof node === "number" || typeof node === "boolean") {
|
|
32
|
-
parent.
|
|
33
|
+
parent.append(document.createTextNode(String(node)));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!node || typeof node !== "object") {
|
|
33
37
|
return;
|
|
34
38
|
}
|
|
35
|
-
if (!node || typeof node !== "object") return;
|
|
36
39
|
|
|
37
40
|
const tag = node.tagName || "div";
|
|
38
41
|
const el = document.createElement(tag);
|
|
@@ -41,30 +44,32 @@ export function renderCanvasNode(
|
|
|
41
44
|
|
|
42
45
|
if (typeof node.textContent === "string") {
|
|
43
46
|
el.textContent = node.textContent;
|
|
44
|
-
} else if (
|
|
45
|
-
const tc = node.textContent
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
el.title = `Bound: ${tc.$ref}`;
|
|
52
|
-
}
|
|
47
|
+
} else if (isRef(node.textContent)) {
|
|
48
|
+
const tc = node.textContent;
|
|
49
|
+
const resolved = resolveDefaultForCanvas(tc, activeTab.value?.doc.document?.state);
|
|
50
|
+
el.textContent = typeof resolved === "string" ? resolved : null;
|
|
51
|
+
el.style.opacity = "0.7";
|
|
52
|
+
el.style.fontStyle = "italic";
|
|
53
|
+
el.title = `Bound: ${tc.$ref}`;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
if (node.id)
|
|
56
|
-
|
|
56
|
+
if (node.id) {
|
|
57
|
+
el.id = node.id;
|
|
58
|
+
}
|
|
59
|
+
if (node.className) {
|
|
60
|
+
el.className = node.className;
|
|
61
|
+
}
|
|
57
62
|
|
|
58
63
|
applyCanvasStyle(el, node.style, activeBreakpoints, featureToggles);
|
|
59
64
|
|
|
60
65
|
if (node.attributes && typeof node.attributes === "object") {
|
|
61
66
|
for (const [attr, val] of Object.entries(node.attributes)) {
|
|
62
67
|
try {
|
|
63
|
-
if (
|
|
68
|
+
if (isRef(val)) {
|
|
64
69
|
const resolved = resolveDefaultForCanvas(val, activeTab.value?.doc.document?.state);
|
|
65
|
-
el.setAttribute(attr, resolved
|
|
70
|
+
el.setAttribute(attr, String(resolved ?? ""));
|
|
66
71
|
} else {
|
|
67
|
-
el.setAttribute(attr, val);
|
|
72
|
+
el.setAttribute(attr, String(val));
|
|
68
73
|
}
|
|
69
74
|
} catch {}
|
|
70
75
|
}
|
|
@@ -80,13 +85,8 @@ export function renderCanvasNode(
|
|
|
80
85
|
featureToggles,
|
|
81
86
|
);
|
|
82
87
|
}
|
|
83
|
-
} else if (
|
|
84
|
-
node.children
|
|
85
|
-
typeof node.children === "object" &&
|
|
86
|
-
(node.children as Record<string, unknown>).$prototype === "Array"
|
|
87
|
-
) {
|
|
88
|
-
const childrenObj = node.children as Record<string, unknown>;
|
|
89
|
-
const template = childrenObj.map;
|
|
88
|
+
} else if (isMappedArray(node.children)) {
|
|
89
|
+
const template = node.children.map;
|
|
90
90
|
if (template && typeof template === "object") {
|
|
91
91
|
const wrapper = document.createElement("div");
|
|
92
92
|
wrapper.className = "repeater-perimeter";
|
|
@@ -98,7 +98,7 @@ export function renderCanvasNode(
|
|
|
98
98
|
activeBreakpoints,
|
|
99
99
|
featureToggles,
|
|
100
100
|
);
|
|
101
|
-
el.
|
|
101
|
+
el.append(wrapper);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -108,10 +108,10 @@ export function renderCanvasNode(
|
|
|
108
108
|
placeholder.textContent = `[$switch: ${keys.join(" | ")}]`;
|
|
109
109
|
placeholder.style.cssText =
|
|
110
110
|
"font-family:monospace;font-size:11px;padding:6px 10px;background:color-mix(in srgb, var(--danger) 8%, transparent);border:1px dashed color-mix(in srgb, var(--danger) 40%, transparent);border-radius:4px;color:var(--danger);font-style:italic";
|
|
111
|
-
el.
|
|
111
|
+
el.append(placeholder);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
el.style.pointerEvents = "none";
|
|
115
|
-
parent.
|
|
115
|
+
parent.append(el);
|
|
116
116
|
return el;
|
|
117
117
|
}
|