@hlang-tech/editor-ui 0.2.1 → 0.3.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/lib/index.d.mts +33 -10
- package/lib/index.d.ts +33 -10
- package/lib/index.js +21 -8
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +21 -8
- package/lib/index.mjs.map +1 -1
- package/lib/overlays/Toast.css +3 -1
- package/lib/shell/EditorShell.css +4 -0
- package/package.json +13 -12
package/lib/index.mjs
CHANGED
|
@@ -9,11 +9,18 @@ var TOKEN_NAMES = [
|
|
|
9
9
|
"hl-silver",
|
|
10
10
|
"hl-silver-hi",
|
|
11
11
|
"hl-silver-lo",
|
|
12
|
+
"hl-glass",
|
|
13
|
+
"hl-glass-2",
|
|
14
|
+
"hl-glass-blur",
|
|
15
|
+
"hl-glass-sat",
|
|
16
|
+
"hl-glass-edge",
|
|
17
|
+
"hl-glass-edge-hi",
|
|
12
18
|
"hl-spark",
|
|
13
19
|
"hl-r",
|
|
14
20
|
"hl-t",
|
|
15
21
|
"hl-w",
|
|
16
22
|
"hl-error",
|
|
23
|
+
"hl-warning",
|
|
17
24
|
"hl-ink",
|
|
18
25
|
"hl-ink-2",
|
|
19
26
|
"hl-ink-3",
|
|
@@ -26,7 +33,9 @@ var TOKEN_NAMES = [
|
|
|
26
33
|
"hl-shadow-node",
|
|
27
34
|
"hl-shadow-glass",
|
|
28
35
|
"hl-glow-silver",
|
|
29
|
-
"hl-ease"
|
|
36
|
+
"hl-ease",
|
|
37
|
+
"hl-activity",
|
|
38
|
+
"hl-cost"
|
|
30
39
|
];
|
|
31
40
|
function tokenVar(name) {
|
|
32
41
|
return `var(--${name})`;
|
|
@@ -217,9 +226,14 @@ var LiveSignalStore = class {
|
|
|
217
226
|
}
|
|
218
227
|
};
|
|
219
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Arms the frame loop if it is not running. Signals only record state; the
|
|
231
|
+
* next frame notifies, so a burst of signals costs one pass over the
|
|
232
|
+
* subscribers per frame, not one per signal, and every change shows within a
|
|
233
|
+
* frame.
|
|
234
|
+
*/
|
|
220
235
|
ensureLoop() {
|
|
221
236
|
if (this.running) {
|
|
222
|
-
this.flushNotifications();
|
|
223
237
|
return;
|
|
224
238
|
}
|
|
225
239
|
this.running = true;
|
|
@@ -607,10 +621,8 @@ function HlangNode({ data, selected }) {
|
|
|
607
621
|
import { BaseEdge, EdgeLabelRenderer, getBezierPath, useInternalNode } from "@xyflow/react";
|
|
608
622
|
import { Fragment, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
609
623
|
function useSourceRole(sourceId) {
|
|
610
|
-
var _a, _b;
|
|
611
624
|
const node = useInternalNode(sourceId);
|
|
612
|
-
const
|
|
613
|
-
const role = (_b = editorNode == null ? void 0 : editorNode.params) == null ? void 0 : _b.role;
|
|
625
|
+
const role = node == null ? void 0 : node.data.editorNode.params.role;
|
|
614
626
|
return typeof role === "string" && role.length > 0 ? role : void 0;
|
|
615
627
|
}
|
|
616
628
|
function FlowEdge(props) {
|
|
@@ -1247,7 +1259,8 @@ function OutlineTree({ core, onFocus }) {
|
|
|
1247
1259
|
const active = selection.isSelected(node.id);
|
|
1248
1260
|
const isHidden = viewState.isHidden(node.id);
|
|
1249
1261
|
const isLocked = viewState.isLocked(node.id);
|
|
1250
|
-
const
|
|
1262
|
+
const { imageUrl } = node.params;
|
|
1263
|
+
const thumbnail = typeof imageUrl === "string" && imageUrl.length > 0 ? imageUrl : void 0;
|
|
1251
1264
|
return /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs13(
|
|
1252
1265
|
"div",
|
|
1253
1266
|
{
|
|
@@ -1259,11 +1272,11 @@ function OutlineTree({ core, onFocus }) {
|
|
|
1259
1272
|
{
|
|
1260
1273
|
className: `hl-outline-icon hl-kind-${node.kind.toLowerCase()}`,
|
|
1261
1274
|
"aria-hidden": true,
|
|
1262
|
-
children:
|
|
1275
|
+
children: thumbnail !== void 0 ? /* @__PURE__ */ jsx21(
|
|
1263
1276
|
"img",
|
|
1264
1277
|
{
|
|
1265
1278
|
className: "hl-outline-thumb",
|
|
1266
|
-
src:
|
|
1279
|
+
src: thumbnail,
|
|
1267
1280
|
alt: ""
|
|
1268
1281
|
}
|
|
1269
1282
|
) : /* @__PURE__ */ jsx21(NodeIcon, { code: node.code, kind: node.kind, size: 13 })
|