@almadar/ui 2.51.0 → 2.53.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/avl/index.cjs +325 -93
- package/dist/avl/index.d.cts +36 -6
- package/dist/avl/index.js +325 -93
- package/dist/components/index.cjs +114 -21
- package/dist/components/index.js +114 -21
- package/dist/components/molecules/markdown/CodeBlock.d.ts +9 -4
- package/dist/components/organisms/avl/AvlOrbitalsCosmicZoom.d.ts +16 -0
- package/dist/components/organisms/avl/FlowCanvas.d.ts +20 -6
- package/dist/providers/index.cjs +114 -21
- package/dist/providers/index.js +114 -21
- package/dist/runtime/index.cjs +114 -21
- package/dist/runtime/index.js +114 -21
- package/package.json +1 -1
|
@@ -9223,6 +9223,26 @@ var CodeBlock = React90__namespace.default.memo(
|
|
|
9223
9223
|
const codeRef = React90.useRef(null);
|
|
9224
9224
|
const savedScrollLeftRef = React90.useRef(0);
|
|
9225
9225
|
const [copied, setCopied] = React90.useState(false);
|
|
9226
|
+
const [editableValue, setEditableValue] = React90.useState(code);
|
|
9227
|
+
const [editableTextareaKey, setEditableTextareaKey] = React90.useState(0);
|
|
9228
|
+
const lastPropCodeRef = React90.useRef(code);
|
|
9229
|
+
const editableTextareaRef = React90.useRef(null);
|
|
9230
|
+
const editableOverlayRef = React90.useRef(null);
|
|
9231
|
+
React90.useEffect(() => {
|
|
9232
|
+
if (code !== lastPropCodeRef.current) {
|
|
9233
|
+
lastPropCodeRef.current = code;
|
|
9234
|
+
setEditableValue(code);
|
|
9235
|
+
setEditableTextareaKey((k) => k + 1);
|
|
9236
|
+
}
|
|
9237
|
+
}, [code]);
|
|
9238
|
+
const handleEditableScroll = React90.useCallback(() => {
|
|
9239
|
+
const ta = editableTextareaRef.current;
|
|
9240
|
+
const ov = editableOverlayRef.current;
|
|
9241
|
+
if (ta && ov) {
|
|
9242
|
+
ov.scrollTop = ta.scrollTop;
|
|
9243
|
+
ov.scrollLeft = ta.scrollLeft;
|
|
9244
|
+
}
|
|
9245
|
+
}, []);
|
|
9226
9246
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
9227
9247
|
const [collapsed, setCollapsed] = React90.useState(() => /* @__PURE__ */ new Set());
|
|
9228
9248
|
const foldRegions = React90.useMemo(
|
|
@@ -9383,33 +9403,106 @@ var CodeBlock = React90__namespace.default.memo(
|
|
|
9383
9403
|
}
|
|
9384
9404
|
),
|
|
9385
9405
|
editable ? (
|
|
9386
|
-
/* GAP-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9406
|
+
/* GAP-77: editable mode = transparent Textarea on top + Prism-highlighted
|
|
9407
|
+
overlay underneath. The textarea is uncontrolled (defaultValue + key)
|
|
9408
|
+
to avoid cursor jumps; the overlay reads `editableValue` which is
|
|
9409
|
+
mirrored from the textarea via onChange. Both elements share IDENTICAL
|
|
9410
|
+
font / line-height / padding so the highlighted text aligns with the
|
|
9411
|
+
textarea's invisible glyphs.
|
|
9412
|
+
|
|
9413
|
+
Scroll sync: the overlay has `pointer-events: none` and the textarea
|
|
9414
|
+
scrolls; `handleEditableScroll` keeps the overlay's scroll matched. */
|
|
9415
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9416
|
+
Box,
|
|
9394
9417
|
{
|
|
9395
|
-
defaultValue: code,
|
|
9396
|
-
onChange: (e) => onChange?.(e.target.value),
|
|
9397
|
-
spellCheck: false,
|
|
9398
9418
|
style: {
|
|
9399
|
-
|
|
9400
|
-
fontSize: "13px",
|
|
9401
|
-
lineHeight: "1.5",
|
|
9419
|
+
position: "relative",
|
|
9402
9420
|
backgroundColor: "#1e1e1e",
|
|
9403
|
-
color: "#e6e6e6",
|
|
9404
9421
|
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
9405
|
-
border: "none",
|
|
9406
|
-
padding: "1rem",
|
|
9407
|
-
resize: "none",
|
|
9408
9422
|
minHeight: "160px",
|
|
9409
9423
|
maxHeight,
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9424
|
+
overflow: "hidden"
|
|
9425
|
+
},
|
|
9426
|
+
children: [
|
|
9427
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9428
|
+
"div",
|
|
9429
|
+
{
|
|
9430
|
+
ref: editableOverlayRef,
|
|
9431
|
+
"aria-hidden": true,
|
|
9432
|
+
style: {
|
|
9433
|
+
position: "absolute",
|
|
9434
|
+
inset: 0,
|
|
9435
|
+
overflow: "hidden",
|
|
9436
|
+
pointerEvents: "none",
|
|
9437
|
+
maxHeight
|
|
9438
|
+
},
|
|
9439
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9440
|
+
SyntaxHighlighter__default.default,
|
|
9441
|
+
{
|
|
9442
|
+
PreTag: "div",
|
|
9443
|
+
language,
|
|
9444
|
+
style: activeStyle,
|
|
9445
|
+
customStyle: {
|
|
9446
|
+
backgroundColor: "transparent",
|
|
9447
|
+
borderRadius: 0,
|
|
9448
|
+
padding: "1rem",
|
|
9449
|
+
margin: 0,
|
|
9450
|
+
whiteSpace: "pre",
|
|
9451
|
+
minWidth: "100%",
|
|
9452
|
+
minHeight: "160px",
|
|
9453
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9454
|
+
fontSize: "13px",
|
|
9455
|
+
lineHeight: "1.5"
|
|
9456
|
+
},
|
|
9457
|
+
codeTagProps: {
|
|
9458
|
+
style: {
|
|
9459
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9460
|
+
fontSize: "13px",
|
|
9461
|
+
lineHeight: "1.5"
|
|
9462
|
+
}
|
|
9463
|
+
},
|
|
9464
|
+
children: editableValue || " "
|
|
9465
|
+
}
|
|
9466
|
+
)
|
|
9467
|
+
}
|
|
9468
|
+
),
|
|
9469
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9470
|
+
Textarea,
|
|
9471
|
+
{
|
|
9472
|
+
ref: editableTextareaRef,
|
|
9473
|
+
defaultValue: code,
|
|
9474
|
+
onChange: (e) => {
|
|
9475
|
+
setEditableValue(e.target.value);
|
|
9476
|
+
onChange?.(e.target.value);
|
|
9477
|
+
},
|
|
9478
|
+
onScroll: handleEditableScroll,
|
|
9479
|
+
spellCheck: false,
|
|
9480
|
+
style: {
|
|
9481
|
+
position: "relative",
|
|
9482
|
+
zIndex: 1,
|
|
9483
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9484
|
+
fontSize: "13px",
|
|
9485
|
+
lineHeight: "1.5",
|
|
9486
|
+
backgroundColor: "transparent",
|
|
9487
|
+
color: "transparent",
|
|
9488
|
+
caretColor: "#e6e6e6",
|
|
9489
|
+
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
9490
|
+
border: "none",
|
|
9491
|
+
padding: "1rem",
|
|
9492
|
+
resize: "none",
|
|
9493
|
+
minHeight: "160px",
|
|
9494
|
+
maxHeight,
|
|
9495
|
+
width: "100%",
|
|
9496
|
+
height: "100%",
|
|
9497
|
+
outline: "none",
|
|
9498
|
+
whiteSpace: "pre",
|
|
9499
|
+
overflowWrap: "normal",
|
|
9500
|
+
overflow: "auto"
|
|
9501
|
+
}
|
|
9502
|
+
},
|
|
9503
|
+
editableTextareaKey
|
|
9504
|
+
)
|
|
9505
|
+
]
|
|
9413
9506
|
}
|
|
9414
9507
|
)
|
|
9415
9508
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
package/dist/components/index.js
CHANGED
|
@@ -9178,6 +9178,26 @@ var CodeBlock = React90__default.memo(
|
|
|
9178
9178
|
const codeRef = useRef(null);
|
|
9179
9179
|
const savedScrollLeftRef = useRef(0);
|
|
9180
9180
|
const [copied, setCopied] = useState(false);
|
|
9181
|
+
const [editableValue, setEditableValue] = useState(code);
|
|
9182
|
+
const [editableTextareaKey, setEditableTextareaKey] = useState(0);
|
|
9183
|
+
const lastPropCodeRef = useRef(code);
|
|
9184
|
+
const editableTextareaRef = useRef(null);
|
|
9185
|
+
const editableOverlayRef = useRef(null);
|
|
9186
|
+
useEffect(() => {
|
|
9187
|
+
if (code !== lastPropCodeRef.current) {
|
|
9188
|
+
lastPropCodeRef.current = code;
|
|
9189
|
+
setEditableValue(code);
|
|
9190
|
+
setEditableTextareaKey((k) => k + 1);
|
|
9191
|
+
}
|
|
9192
|
+
}, [code]);
|
|
9193
|
+
const handleEditableScroll = useCallback(() => {
|
|
9194
|
+
const ta = editableTextareaRef.current;
|
|
9195
|
+
const ov = editableOverlayRef.current;
|
|
9196
|
+
if (ta && ov) {
|
|
9197
|
+
ov.scrollTop = ta.scrollTop;
|
|
9198
|
+
ov.scrollLeft = ta.scrollLeft;
|
|
9199
|
+
}
|
|
9200
|
+
}, []);
|
|
9181
9201
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
9182
9202
|
const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
|
|
9183
9203
|
const foldRegions = useMemo(
|
|
@@ -9338,33 +9358,106 @@ var CodeBlock = React90__default.memo(
|
|
|
9338
9358
|
}
|
|
9339
9359
|
),
|
|
9340
9360
|
editable ? (
|
|
9341
|
-
/* GAP-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9361
|
+
/* GAP-77: editable mode = transparent Textarea on top + Prism-highlighted
|
|
9362
|
+
overlay underneath. The textarea is uncontrolled (defaultValue + key)
|
|
9363
|
+
to avoid cursor jumps; the overlay reads `editableValue` which is
|
|
9364
|
+
mirrored from the textarea via onChange. Both elements share IDENTICAL
|
|
9365
|
+
font / line-height / padding so the highlighted text aligns with the
|
|
9366
|
+
textarea's invisible glyphs.
|
|
9367
|
+
|
|
9368
|
+
Scroll sync: the overlay has `pointer-events: none` and the textarea
|
|
9369
|
+
scrolls; `handleEditableScroll` keeps the overlay's scroll matched. */
|
|
9370
|
+
/* @__PURE__ */ jsxs(
|
|
9371
|
+
Box,
|
|
9349
9372
|
{
|
|
9350
|
-
defaultValue: code,
|
|
9351
|
-
onChange: (e) => onChange?.(e.target.value),
|
|
9352
|
-
spellCheck: false,
|
|
9353
9373
|
style: {
|
|
9354
|
-
|
|
9355
|
-
fontSize: "13px",
|
|
9356
|
-
lineHeight: "1.5",
|
|
9374
|
+
position: "relative",
|
|
9357
9375
|
backgroundColor: "#1e1e1e",
|
|
9358
|
-
color: "#e6e6e6",
|
|
9359
9376
|
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
9360
|
-
border: "none",
|
|
9361
|
-
padding: "1rem",
|
|
9362
|
-
resize: "none",
|
|
9363
9377
|
minHeight: "160px",
|
|
9364
9378
|
maxHeight,
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9379
|
+
overflow: "hidden"
|
|
9380
|
+
},
|
|
9381
|
+
children: [
|
|
9382
|
+
/* @__PURE__ */ jsx(
|
|
9383
|
+
"div",
|
|
9384
|
+
{
|
|
9385
|
+
ref: editableOverlayRef,
|
|
9386
|
+
"aria-hidden": true,
|
|
9387
|
+
style: {
|
|
9388
|
+
position: "absolute",
|
|
9389
|
+
inset: 0,
|
|
9390
|
+
overflow: "hidden",
|
|
9391
|
+
pointerEvents: "none",
|
|
9392
|
+
maxHeight
|
|
9393
|
+
},
|
|
9394
|
+
children: /* @__PURE__ */ jsx(
|
|
9395
|
+
SyntaxHighlighter,
|
|
9396
|
+
{
|
|
9397
|
+
PreTag: "div",
|
|
9398
|
+
language,
|
|
9399
|
+
style: activeStyle,
|
|
9400
|
+
customStyle: {
|
|
9401
|
+
backgroundColor: "transparent",
|
|
9402
|
+
borderRadius: 0,
|
|
9403
|
+
padding: "1rem",
|
|
9404
|
+
margin: 0,
|
|
9405
|
+
whiteSpace: "pre",
|
|
9406
|
+
minWidth: "100%",
|
|
9407
|
+
minHeight: "160px",
|
|
9408
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9409
|
+
fontSize: "13px",
|
|
9410
|
+
lineHeight: "1.5"
|
|
9411
|
+
},
|
|
9412
|
+
codeTagProps: {
|
|
9413
|
+
style: {
|
|
9414
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9415
|
+
fontSize: "13px",
|
|
9416
|
+
lineHeight: "1.5"
|
|
9417
|
+
}
|
|
9418
|
+
},
|
|
9419
|
+
children: editableValue || " "
|
|
9420
|
+
}
|
|
9421
|
+
)
|
|
9422
|
+
}
|
|
9423
|
+
),
|
|
9424
|
+
/* @__PURE__ */ jsx(
|
|
9425
|
+
Textarea,
|
|
9426
|
+
{
|
|
9427
|
+
ref: editableTextareaRef,
|
|
9428
|
+
defaultValue: code,
|
|
9429
|
+
onChange: (e) => {
|
|
9430
|
+
setEditableValue(e.target.value);
|
|
9431
|
+
onChange?.(e.target.value);
|
|
9432
|
+
},
|
|
9433
|
+
onScroll: handleEditableScroll,
|
|
9434
|
+
spellCheck: false,
|
|
9435
|
+
style: {
|
|
9436
|
+
position: "relative",
|
|
9437
|
+
zIndex: 1,
|
|
9438
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
9439
|
+
fontSize: "13px",
|
|
9440
|
+
lineHeight: "1.5",
|
|
9441
|
+
backgroundColor: "transparent",
|
|
9442
|
+
color: "transparent",
|
|
9443
|
+
caretColor: "#e6e6e6",
|
|
9444
|
+
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
9445
|
+
border: "none",
|
|
9446
|
+
padding: "1rem",
|
|
9447
|
+
resize: "none",
|
|
9448
|
+
minHeight: "160px",
|
|
9449
|
+
maxHeight,
|
|
9450
|
+
width: "100%",
|
|
9451
|
+
height: "100%",
|
|
9452
|
+
outline: "none",
|
|
9453
|
+
whiteSpace: "pre",
|
|
9454
|
+
overflowWrap: "normal",
|
|
9455
|
+
overflow: "auto"
|
|
9456
|
+
}
|
|
9457
|
+
},
|
|
9458
|
+
editableTextareaKey
|
|
9459
|
+
)
|
|
9460
|
+
]
|
|
9368
9461
|
}
|
|
9369
9462
|
)
|
|
9370
9463
|
) : /* @__PURE__ */ jsx(
|
|
@@ -24,10 +24,15 @@ export interface CodeBlockProps {
|
|
|
24
24
|
/** Additional CSS classes */
|
|
25
25
|
className?: string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* When true, render an editable surface that composes a transparent `Textarea`
|
|
28
|
+
* over a Prism-highlighted overlay. The overlay re-tokenizes on each keystroke
|
|
29
|
+
* (driven from a local mirror of the textarea value), so users see syntax-highlighted
|
|
30
|
+
* code while still being able to type. Folding is skipped in editable mode.
|
|
31
|
+
*
|
|
32
|
+
* History: GAP-51 first-cut shipped plain (no-highlighting) editable text;
|
|
33
|
+
* GAP-77 (2026-04-12) added the Prism overlay layer.
|
|
34
|
+
*
|
|
35
|
+
* Default: false (existing read-only behavior unchanged).
|
|
31
36
|
*/
|
|
32
37
|
editable?: boolean;
|
|
33
38
|
/**
|
|
@@ -34,5 +34,21 @@ export interface AvlOrbitalsCosmicZoomProps {
|
|
|
34
34
|
* highlighted while the user can still click any other orbital to select it.
|
|
35
35
|
*/
|
|
36
36
|
highlightedOrbital?: string;
|
|
37
|
+
/**
|
|
38
|
+
* GAP-55: fired when the user clicks an orbital tile. Consumers (e.g. the
|
|
39
|
+
* builder workspace) use this as the trigger to drill INTO the clicked
|
|
40
|
+
* orbital — typically by switching back to the canvas tab and opening the
|
|
41
|
+
* clicked orbital at L2 expanded. Local `selected` toggle (visual highlight +
|
|
42
|
+
* info panel) still fires regardless of whether the callback is provided.
|
|
43
|
+
*/
|
|
44
|
+
onOrbitalSelect?: (orbital: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* GAP-54: minimum zoom factor when scroll-wheel zooming. Default 0.4.
|
|
47
|
+
*/
|
|
48
|
+
minZoom?: number;
|
|
49
|
+
/**
|
|
50
|
+
* GAP-54: maximum zoom factor when scroll-wheel zooming. Default 3.
|
|
51
|
+
*/
|
|
52
|
+
maxZoom?: number;
|
|
37
53
|
}
|
|
38
54
|
export declare const AvlOrbitalsCosmicZoom: React.FC<AvlOrbitalsCosmicZoomProps>;
|
|
@@ -29,15 +29,29 @@ export interface FlowCanvasProps {
|
|
|
29
29
|
}) => void;
|
|
30
30
|
onLevelChange?: (level: ViewLevel, orbital?: string) => void;
|
|
31
31
|
/**
|
|
32
|
-
* GAP-52: fired when the user double-clicks an orbital
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
32
|
+
* GAP-52: fired when the user double-clicks an orbital. Consumers (e.g. the
|
|
33
|
+
* builder workspace) use this as the trigger to enter cosmic mode
|
|
34
|
+
* (`AvlOrbitalsCosmicZoom`) for the focused orbital.
|
|
35
|
+
*
|
|
36
|
+
* The level at which this fires is controlled by `cosmicEntryLevel` (default
|
|
37
|
+
* `'expanded'`). At `'expanded'` the existing overview→expanded drill is
|
|
38
|
+
* preserved — the callback fires only on the second double-click. At
|
|
39
|
+
* `'overview'` the callback fires on the FIRST double-click and the existing
|
|
40
|
+
* drill is suppressed for that interaction. `'both'` fires at either level.
|
|
41
|
+
*
|
|
42
|
+
* The callback runs unconditionally — persona / permission gating is the
|
|
38
43
|
* consumer's responsibility.
|
|
39
44
|
*/
|
|
40
45
|
onOrbitalDoubleClick?: (orbital: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* GAP-53: which level the `onOrbitalDoubleClick` callback fires at.
|
|
48
|
+
* - `'expanded'` (default, non-breaking) — fires only at L2 expanded; the
|
|
49
|
+
* first overview double-click still drills overview→expanded.
|
|
50
|
+
* - `'overview'` — fires at L1 overview on the FIRST double-click. The
|
|
51
|
+
* overview→expanded drill is suppressed when the callback is provided.
|
|
52
|
+
* - `'both'` — fires at either level.
|
|
53
|
+
*/
|
|
54
|
+
cosmicEntryLevel?: 'expanded' | 'overview' | 'both';
|
|
41
55
|
initialOrbital?: string;
|
|
42
56
|
/** Start at Level 2 (expanded) when initialOrbital is set. Default: 'overview'. */
|
|
43
57
|
initialLevel?: ViewLevel;
|
package/dist/providers/index.cjs
CHANGED
|
@@ -4108,6 +4108,26 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4108
4108
|
const codeRef = React114.useRef(null);
|
|
4109
4109
|
const savedScrollLeftRef = React114.useRef(0);
|
|
4110
4110
|
const [copied, setCopied] = React114.useState(false);
|
|
4111
|
+
const [editableValue, setEditableValue] = React114.useState(code);
|
|
4112
|
+
const [editableTextareaKey, setEditableTextareaKey] = React114.useState(0);
|
|
4113
|
+
const lastPropCodeRef = React114.useRef(code);
|
|
4114
|
+
const editableTextareaRef = React114.useRef(null);
|
|
4115
|
+
const editableOverlayRef = React114.useRef(null);
|
|
4116
|
+
React114.useEffect(() => {
|
|
4117
|
+
if (code !== lastPropCodeRef.current) {
|
|
4118
|
+
lastPropCodeRef.current = code;
|
|
4119
|
+
setEditableValue(code);
|
|
4120
|
+
setEditableTextareaKey((k) => k + 1);
|
|
4121
|
+
}
|
|
4122
|
+
}, [code]);
|
|
4123
|
+
const handleEditableScroll = React114.useCallback(() => {
|
|
4124
|
+
const ta = editableTextareaRef.current;
|
|
4125
|
+
const ov = editableOverlayRef.current;
|
|
4126
|
+
if (ta && ov) {
|
|
4127
|
+
ov.scrollTop = ta.scrollTop;
|
|
4128
|
+
ov.scrollLeft = ta.scrollLeft;
|
|
4129
|
+
}
|
|
4130
|
+
}, []);
|
|
4111
4131
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
4112
4132
|
const [collapsed, setCollapsed] = React114.useState(() => /* @__PURE__ */ new Set());
|
|
4113
4133
|
const foldRegions = React114.useMemo(
|
|
@@ -4268,33 +4288,106 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4268
4288
|
}
|
|
4269
4289
|
),
|
|
4270
4290
|
editable ? (
|
|
4271
|
-
/* GAP-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4291
|
+
/* GAP-77: editable mode = transparent Textarea on top + Prism-highlighted
|
|
4292
|
+
overlay underneath. The textarea is uncontrolled (defaultValue + key)
|
|
4293
|
+
to avoid cursor jumps; the overlay reads `editableValue` which is
|
|
4294
|
+
mirrored from the textarea via onChange. Both elements share IDENTICAL
|
|
4295
|
+
font / line-height / padding so the highlighted text aligns with the
|
|
4296
|
+
textarea's invisible glyphs.
|
|
4297
|
+
|
|
4298
|
+
Scroll sync: the overlay has `pointer-events: none` and the textarea
|
|
4299
|
+
scrolls; `handleEditableScroll` keeps the overlay's scroll matched. */
|
|
4300
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4301
|
+
Box,
|
|
4279
4302
|
{
|
|
4280
|
-
defaultValue: code,
|
|
4281
|
-
onChange: (e) => onChange?.(e.target.value),
|
|
4282
|
-
spellCheck: false,
|
|
4283
4303
|
style: {
|
|
4284
|
-
|
|
4285
|
-
fontSize: "13px",
|
|
4286
|
-
lineHeight: "1.5",
|
|
4304
|
+
position: "relative",
|
|
4287
4305
|
backgroundColor: "#1e1e1e",
|
|
4288
|
-
color: "#e6e6e6",
|
|
4289
4306
|
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
4290
|
-
border: "none",
|
|
4291
|
-
padding: "1rem",
|
|
4292
|
-
resize: "none",
|
|
4293
4307
|
minHeight: "160px",
|
|
4294
4308
|
maxHeight,
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4309
|
+
overflow: "hidden"
|
|
4310
|
+
},
|
|
4311
|
+
children: [
|
|
4312
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4313
|
+
"div",
|
|
4314
|
+
{
|
|
4315
|
+
ref: editableOverlayRef,
|
|
4316
|
+
"aria-hidden": true,
|
|
4317
|
+
style: {
|
|
4318
|
+
position: "absolute",
|
|
4319
|
+
inset: 0,
|
|
4320
|
+
overflow: "hidden",
|
|
4321
|
+
pointerEvents: "none",
|
|
4322
|
+
maxHeight
|
|
4323
|
+
},
|
|
4324
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4325
|
+
SyntaxHighlighter__default.default,
|
|
4326
|
+
{
|
|
4327
|
+
PreTag: "div",
|
|
4328
|
+
language,
|
|
4329
|
+
style: activeStyle,
|
|
4330
|
+
customStyle: {
|
|
4331
|
+
backgroundColor: "transparent",
|
|
4332
|
+
borderRadius: 0,
|
|
4333
|
+
padding: "1rem",
|
|
4334
|
+
margin: 0,
|
|
4335
|
+
whiteSpace: "pre",
|
|
4336
|
+
minWidth: "100%",
|
|
4337
|
+
minHeight: "160px",
|
|
4338
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
4339
|
+
fontSize: "13px",
|
|
4340
|
+
lineHeight: "1.5"
|
|
4341
|
+
},
|
|
4342
|
+
codeTagProps: {
|
|
4343
|
+
style: {
|
|
4344
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
4345
|
+
fontSize: "13px",
|
|
4346
|
+
lineHeight: "1.5"
|
|
4347
|
+
}
|
|
4348
|
+
},
|
|
4349
|
+
children: editableValue || " "
|
|
4350
|
+
}
|
|
4351
|
+
)
|
|
4352
|
+
}
|
|
4353
|
+
),
|
|
4354
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4355
|
+
Textarea,
|
|
4356
|
+
{
|
|
4357
|
+
ref: editableTextareaRef,
|
|
4358
|
+
defaultValue: code,
|
|
4359
|
+
onChange: (e) => {
|
|
4360
|
+
setEditableValue(e.target.value);
|
|
4361
|
+
onChange?.(e.target.value);
|
|
4362
|
+
},
|
|
4363
|
+
onScroll: handleEditableScroll,
|
|
4364
|
+
spellCheck: false,
|
|
4365
|
+
style: {
|
|
4366
|
+
position: "relative",
|
|
4367
|
+
zIndex: 1,
|
|
4368
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
4369
|
+
fontSize: "13px",
|
|
4370
|
+
lineHeight: "1.5",
|
|
4371
|
+
backgroundColor: "transparent",
|
|
4372
|
+
color: "transparent",
|
|
4373
|
+
caretColor: "#e6e6e6",
|
|
4374
|
+
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
4375
|
+
border: "none",
|
|
4376
|
+
padding: "1rem",
|
|
4377
|
+
resize: "none",
|
|
4378
|
+
minHeight: "160px",
|
|
4379
|
+
maxHeight,
|
|
4380
|
+
width: "100%",
|
|
4381
|
+
height: "100%",
|
|
4382
|
+
outline: "none",
|
|
4383
|
+
whiteSpace: "pre",
|
|
4384
|
+
overflowWrap: "normal",
|
|
4385
|
+
overflow: "auto"
|
|
4386
|
+
}
|
|
4387
|
+
},
|
|
4388
|
+
editableTextareaKey
|
|
4389
|
+
)
|
|
4390
|
+
]
|
|
4298
4391
|
}
|
|
4299
4392
|
)
|
|
4300
4393
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|