@floegence/floe-webapp-core 0.36.7 → 0.36.9
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/components/deck/DeckCell.d.ts +0 -5
- package/dist/components/deck/DeckCell.js +34 -45
- package/dist/components/deck/DeckGrid.d.ts +2 -16
- package/dist/components/deck/DeckGrid.js +83 -105
- package/dist/components/deck/WidgetResizeHandle.d.ts +3 -1
- package/dist/components/deck/WidgetResizeHandle.js +46 -80
- package/dist/components/deck/deckGridMetrics.d.ts +26 -0
- package/dist/components/deck/deckGridMetrics.js +32 -0
- package/dist/components/deck/deckPointerSession.d.ts +52 -0
- package/dist/components/deck/deckPointerSession.js +113 -0
- package/dist/components/editor/CodeEditor.d.ts +2 -0
- package/dist/components/editor/CodeEditor.js +24 -24
- package/dist/components/editor/index.d.ts +1 -0
- package/dist/components/editor/monacoStandaloneRuntime.d.ts +15 -3
- package/dist/components/editor/monacoStandaloneRuntime.js +45 -17
- package/dist/components/ui/InfiniteCanvas.d.ts +2 -0
- package/dist/components/ui/InfiniteCanvas.js +85 -84
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/localInteractionSurface.d.ts +19 -0
- package/dist/components/ui/localInteractionSurface.js +38 -23
- package/dist/components/workbench/WorkbenchCanvas.d.ts +4 -0
- package/dist/components/workbench/WorkbenchCanvas.js +176 -11
- package/dist/components/workbench/WorkbenchSurface.js +9 -6
- package/dist/components/workbench/WorkbenchWidget.d.ts +4 -1
- package/dist/components/workbench/WorkbenchWidget.js +153 -120
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/types.d.ts +19 -0
- package/dist/components/workbench/useWorkbenchModel.d.ts +4 -0
- package/dist/components/workbench/useWorkbenchModel.js +33 -32
- package/dist/components/workbench/workbenchHelpers.d.ts +14 -1
- package/dist/components/workbench/workbenchHelpers.js +117 -90
- package/dist/context/DeckContext.d.ts +1 -9
- package/dist/context/DeckContext.js +163 -168
- package/dist/deck.js +22 -21
- package/dist/editor.js +5 -2
- package/dist/full.js +528 -523
- package/dist/hooks/useDeckDrag.d.ts +4 -3
- package/dist/hooks/useDeckDrag.js +39 -72
- package/dist/index.js +54 -53
- package/dist/styles.css +1 -1
- package/dist/ui.js +97 -94
- package/dist/utils/gridCollision.d.ts +1 -0
- package/dist/utils/gridCollision.js +21 -17
- package/dist/workbench.css +16 -0
- package/dist/workbench.js +17 -14
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const DECK_GRID_COLS = 24;
|
|
2
|
+
export declare const DECK_DEFAULT_ROWS = 24;
|
|
3
|
+
export declare const DECK_GAP = 4;
|
|
4
|
+
export declare const DECK_MIN_ROW_HEIGHT = 20;
|
|
5
|
+
export declare const DECK_PADDING = 4;
|
|
6
|
+
export interface DeckGridConfig {
|
|
7
|
+
cols: number;
|
|
8
|
+
rowHeight: number;
|
|
9
|
+
gap: number;
|
|
10
|
+
defaultRows: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DeckGridMeasurements extends DeckGridConfig {
|
|
13
|
+
cellWidth: number;
|
|
14
|
+
cellHeight: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const DECK_GRID_CONFIG: {
|
|
17
|
+
readonly cols: 24;
|
|
18
|
+
readonly defaultRows: 24;
|
|
19
|
+
readonly gap: 4;
|
|
20
|
+
readonly rowHeight: 20;
|
|
21
|
+
};
|
|
22
|
+
export declare function getGridConfigFromElement(gridEl: HTMLElement): DeckGridConfig;
|
|
23
|
+
export declare function measureDeckGrid(gridEl: HTMLElement, options?: {
|
|
24
|
+
paddingLeft?: number;
|
|
25
|
+
paddingRight?: number;
|
|
26
|
+
}): DeckGridMeasurements | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const c = 24, r = 24, g = 4, C = 20, d = 4, E = {
|
|
2
|
+
cols: 24,
|
|
3
|
+
defaultRows: 24,
|
|
4
|
+
gap: 4,
|
|
5
|
+
rowHeight: 20
|
|
6
|
+
};
|
|
7
|
+
function D(t) {
|
|
8
|
+
return {
|
|
9
|
+
cols: parseInt(t.dataset.gridCols || String(24), 10),
|
|
10
|
+
rowHeight: parseFloat(t.dataset.rowHeight || String(20)),
|
|
11
|
+
gap: parseInt(t.dataset.gap || String(4), 10),
|
|
12
|
+
defaultRows: parseInt(t.dataset.defaultRows || String(24), 10)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function G(t, o) {
|
|
16
|
+
const n = D(t), s = o?.paddingLeft ?? 0, a = o?.paddingRight ?? 0, i = t.clientWidth - s - a, _ = n.gap * (n.cols - 1), e = (i - _) / n.cols;
|
|
17
|
+
return !Number.isFinite(e) || e <= 0 ? null : {
|
|
18
|
+
...n,
|
|
19
|
+
cellWidth: e,
|
|
20
|
+
cellHeight: n.rowHeight + n.gap
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
r as DECK_DEFAULT_ROWS,
|
|
25
|
+
g as DECK_GAP,
|
|
26
|
+
c as DECK_GRID_COLS,
|
|
27
|
+
E as DECK_GRID_CONFIG,
|
|
28
|
+
C as DECK_MIN_ROW_HEIGHT,
|
|
29
|
+
d as DECK_PADDING,
|
|
30
|
+
D as getGridConfigFromElement,
|
|
31
|
+
G as measureDeckGrid
|
|
32
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type HotInteractionKind } from '../../utils/hotInteraction';
|
|
2
|
+
export interface DeckPointerSessionSnapshot {
|
|
3
|
+
pointerId: number;
|
|
4
|
+
kind: HotInteractionKind;
|
|
5
|
+
widgetId: string;
|
|
6
|
+
gridEl: HTMLElement;
|
|
7
|
+
gridRect: DOMRect;
|
|
8
|
+
gridPaddingLeft: number;
|
|
9
|
+
gridPaddingRight: number;
|
|
10
|
+
startClientX: number;
|
|
11
|
+
startClientY: number;
|
|
12
|
+
startScrollTop: number;
|
|
13
|
+
lastClientX: number;
|
|
14
|
+
lastClientY: number;
|
|
15
|
+
lastAppliedClientX: number;
|
|
16
|
+
lastAppliedClientY: number;
|
|
17
|
+
lastAppliedScrollTop: number;
|
|
18
|
+
rafId: number | null;
|
|
19
|
+
stopHotInteraction: (() => void) | null;
|
|
20
|
+
}
|
|
21
|
+
export interface DeckPointerSessionFrame {
|
|
22
|
+
snapshot: DeckPointerSessionSnapshot;
|
|
23
|
+
deltaX: number;
|
|
24
|
+
deltaY: number;
|
|
25
|
+
cols: number;
|
|
26
|
+
rowHeight: number;
|
|
27
|
+
gap: number;
|
|
28
|
+
cellWidth: number;
|
|
29
|
+
cellHeight: number;
|
|
30
|
+
}
|
|
31
|
+
export interface StartDeckPointerSessionOptions {
|
|
32
|
+
kind: HotInteractionKind;
|
|
33
|
+
widgetId: string;
|
|
34
|
+
gridEl: HTMLElement;
|
|
35
|
+
captureEl?: HTMLElement | null;
|
|
36
|
+
pointerEvent: PointerEvent;
|
|
37
|
+
cursor: string;
|
|
38
|
+
onMove: (frame: DeckPointerSessionFrame) => void;
|
|
39
|
+
onEnd: (options: {
|
|
40
|
+
commit: boolean;
|
|
41
|
+
snapshot: DeckPointerSessionSnapshot;
|
|
42
|
+
}) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface DeckPointerSessionController {
|
|
45
|
+
snapshot: () => DeckPointerSessionSnapshot;
|
|
46
|
+
updatePointer: (event: Pick<PointerEvent, 'pointerId' | 'clientX' | 'clientY'>) => void;
|
|
47
|
+
stop: (options?: {
|
|
48
|
+
commit?: boolean;
|
|
49
|
+
event?: Pick<PointerEvent, 'pointerId' | 'clientX' | 'clientY'>;
|
|
50
|
+
}) => void;
|
|
51
|
+
}
|
|
52
|
+
export declare function startDeckPointerSession(options: StartDeckPointerSessionOptions): DeckPointerSessionController;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { startHotInteraction as X } from "../../utils/hotInteraction.js";
|
|
2
|
+
import { measureDeckGrid as h } from "./deckGridMetrics.js";
|
|
3
|
+
function C(e) {
|
|
4
|
+
const d = e.lastClientY - e.gridRect.top, t = e.gridRect.bottom - e.lastClientY;
|
|
5
|
+
let n = 0;
|
|
6
|
+
if (d < 48 ? n = -Math.ceil((48 - d) / 48 * 24) : t < 48 && (n = Math.ceil((48 - t) / 48 * 24)), n === 0) return !1;
|
|
7
|
+
const a = e.gridEl.scrollTop, o = Math.max(0, Math.min(a + n, e.gridEl.scrollHeight - e.gridEl.clientHeight));
|
|
8
|
+
return o === a ? !1 : (e.gridEl.scrollTop = o, !0);
|
|
9
|
+
}
|
|
10
|
+
function v(e) {
|
|
11
|
+
const i = e.gridEl.scrollTop;
|
|
12
|
+
if (e.lastClientX === e.lastAppliedClientX && e.lastClientY === e.lastAppliedClientY && i === e.lastAppliedScrollTop)
|
|
13
|
+
return null;
|
|
14
|
+
e.lastAppliedClientX = e.lastClientX, e.lastAppliedClientY = e.lastClientY, e.lastAppliedScrollTop = i;
|
|
15
|
+
const l = h(e.gridEl, {
|
|
16
|
+
paddingLeft: e.gridPaddingLeft,
|
|
17
|
+
paddingRight: e.gridPaddingRight
|
|
18
|
+
});
|
|
19
|
+
return l ? {
|
|
20
|
+
snapshot: e,
|
|
21
|
+
deltaX: e.lastClientX - e.startClientX,
|
|
22
|
+
deltaY: e.lastClientY - e.startClientY + (i - e.startScrollTop),
|
|
23
|
+
cols: l.cols,
|
|
24
|
+
rowHeight: l.rowHeight,
|
|
25
|
+
gap: l.gap,
|
|
26
|
+
cellWidth: l.cellWidth,
|
|
27
|
+
cellHeight: l.cellHeight
|
|
28
|
+
} : null;
|
|
29
|
+
}
|
|
30
|
+
function L(e) {
|
|
31
|
+
const i = e.gridEl.ownerDocument, l = i.defaultView ?? window, d = l.getComputedStyle(e.gridEl), t = {
|
|
32
|
+
pointerId: e.pointerEvent.pointerId,
|
|
33
|
+
kind: e.kind,
|
|
34
|
+
widgetId: e.widgetId,
|
|
35
|
+
gridEl: e.gridEl,
|
|
36
|
+
gridRect: e.gridEl.getBoundingClientRect(),
|
|
37
|
+
gridPaddingLeft: parseFloat(d.paddingLeft) || 0,
|
|
38
|
+
gridPaddingRight: parseFloat(d.paddingRight) || 0,
|
|
39
|
+
startClientX: e.pointerEvent.clientX,
|
|
40
|
+
startClientY: e.pointerEvent.clientY,
|
|
41
|
+
startScrollTop: e.gridEl.scrollTop,
|
|
42
|
+
lastClientX: e.pointerEvent.clientX,
|
|
43
|
+
lastClientY: e.pointerEvent.clientY,
|
|
44
|
+
lastAppliedClientX: e.pointerEvent.clientX,
|
|
45
|
+
lastAppliedClientY: e.pointerEvent.clientY,
|
|
46
|
+
lastAppliedScrollTop: e.gridEl.scrollTop,
|
|
47
|
+
rafId: null,
|
|
48
|
+
stopHotInteraction: X({
|
|
49
|
+
kind: e.kind,
|
|
50
|
+
cursor: e.cursor,
|
|
51
|
+
lockUserSelect: !0
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
let n = !0;
|
|
55
|
+
const a = () => {
|
|
56
|
+
if (t.rafId = null, !n) return;
|
|
57
|
+
const r = C(t), c = v(t);
|
|
58
|
+
c && e.onMove(c), n && r && o();
|
|
59
|
+
}, o = () => {
|
|
60
|
+
if (!(!n || t.rafId !== null)) {
|
|
61
|
+
if (typeof l.requestAnimationFrame != "function") {
|
|
62
|
+
a();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
t.rafId = l.requestAnimationFrame(a);
|
|
66
|
+
}
|
|
67
|
+
}, I = () => {
|
|
68
|
+
if (!(!e.captureEl || typeof e.captureEl.releasePointerCapture != "function"))
|
|
69
|
+
try {
|
|
70
|
+
e.captureEl.releasePointerCapture(t.pointerId);
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}, Y = () => {
|
|
74
|
+
i.removeEventListener("pointermove", g, !0), i.removeEventListener("pointerup", p, !0), i.removeEventListener("pointercancel", m, !0), e.captureEl?.removeEventListener("lostpointercapture", s);
|
|
75
|
+
}, u = (r) => {
|
|
76
|
+
if (!n) return;
|
|
77
|
+
const c = r?.event;
|
|
78
|
+
if (!(c && c.pointerId !== t.pointerId)) {
|
|
79
|
+
if (c && (t.lastClientX = c.clientX, t.lastClientY = c.clientY), n = !1, t.rafId !== null && typeof l.cancelAnimationFrame == "function" && (l.cancelAnimationFrame(t.rafId), t.rafId = null), r?.commit !== !1) {
|
|
80
|
+
C(t);
|
|
81
|
+
const E = v(t);
|
|
82
|
+
E && e.onMove(E);
|
|
83
|
+
}
|
|
84
|
+
Y(), I(), t.stopHotInteraction?.(), t.stopHotInteraction = null, e.onEnd({
|
|
85
|
+
commit: r?.commit !== !1,
|
|
86
|
+
snapshot: t
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}, f = (r) => {
|
|
90
|
+
!n || r.pointerId !== t.pointerId || (t.lastClientX = r.clientX, t.lastClientY = r.clientY, o());
|
|
91
|
+
}, g = (r) => {
|
|
92
|
+
f(r);
|
|
93
|
+
}, p = (r) => {
|
|
94
|
+
u({ event: r });
|
|
95
|
+
}, m = (r) => {
|
|
96
|
+
u({ event: r, commit: !1 });
|
|
97
|
+
}, s = () => {
|
|
98
|
+
u();
|
|
99
|
+
};
|
|
100
|
+
if (i.addEventListener("pointermove", g, !0), i.addEventListener("pointerup", p, !0), i.addEventListener("pointercancel", m, !0), e.captureEl?.addEventListener("lostpointercapture", s), e.captureEl && typeof e.captureEl.setPointerCapture == "function")
|
|
101
|
+
try {
|
|
102
|
+
e.captureEl.setPointerCapture(t.pointerId);
|
|
103
|
+
} catch {
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
snapshot: () => t,
|
|
107
|
+
updatePointer: f,
|
|
108
|
+
stop: u
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
L as startDeckPointerSession
|
|
113
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
3
3
|
import 'monaco-editor/min/vs/editor/editor.main.css';
|
|
4
|
+
import { type CodeEditorRuntimeOptions } from './monacoStandaloneRuntime';
|
|
4
5
|
export interface CodeEditorProps {
|
|
5
6
|
path: string;
|
|
6
7
|
language?: string;
|
|
7
8
|
value: string;
|
|
8
9
|
options?: monaco.editor.IStandaloneEditorConstructionOptions;
|
|
10
|
+
runtimeOptions?: CodeEditorRuntimeOptions;
|
|
9
11
|
class?: string;
|
|
10
12
|
style?: JSX.CSSProperties;
|
|
11
13
|
onReady?: (api: CodeEditorApi) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { use as L, effect as
|
|
2
|
-
import { onMount as b, onCleanup as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useResizeObserver as
|
|
1
|
+
import { use as L, effect as O, className as D, style as F, template as V } from "solid-js/web";
|
|
2
|
+
import { onMount as b, onCleanup as q, createEffect as g } from "solid-js";
|
|
3
|
+
import { useTheme as w } from "../../context/ThemeContext.js";
|
|
4
|
+
import { useResizeObserver as A } from "../../hooks/useResizeObserver.js";
|
|
5
5
|
import * as f from "monaco-editor/esm/vs/editor/editor.api.js";
|
|
6
6
|
import "monaco-editor/min/vs/editor/editor.main.css";
|
|
7
|
-
import { resolveCodeEditorLanguageSpec as
|
|
8
|
-
import { ensureMonacoEnvironment as
|
|
7
|
+
import { resolveCodeEditorLanguageSpec as U } from "./languages.js";
|
|
8
|
+
import { ensureMonacoEnvironment as p } from "./monacoEnvironment.js";
|
|
9
9
|
import { ensureMonacoStandaloneRuntime as N } from "./monacoStandaloneRuntime.js";
|
|
10
10
|
var _ = /* @__PURE__ */ V("<div>");
|
|
11
11
|
const E = {
|
|
@@ -30,11 +30,11 @@ function B(t, c) {
|
|
|
30
30
|
return !r || r.isEmpty() ? "" : c.getValueInRange(r);
|
|
31
31
|
}
|
|
32
32
|
function X(t) {
|
|
33
|
-
const c =
|
|
33
|
+
const c = w();
|
|
34
34
|
let r;
|
|
35
35
|
const R = ++$;
|
|
36
|
-
let n, o,
|
|
37
|
-
const x =
|
|
36
|
+
let n, o, d, S = null, v = 0;
|
|
37
|
+
const x = A(() => r), y = () => {
|
|
38
38
|
f.editor.setTheme(c.resolvedTheme() === "dark" ? "vs-dark" : "vs");
|
|
39
39
|
}, m = () => !n || !o ? null : {
|
|
40
40
|
editor: n,
|
|
@@ -52,7 +52,7 @@ function X(t) {
|
|
|
52
52
|
e && t.onSelectionChange?.(e.getSelectedText(), e);
|
|
53
53
|
}, I = async () => {
|
|
54
54
|
if (!n) return;
|
|
55
|
-
const e = ++v, a =
|
|
55
|
+
const e = ++v, a = U(t.language);
|
|
56
56
|
let i = a.id;
|
|
57
57
|
try {
|
|
58
58
|
await a.load?.();
|
|
@@ -61,34 +61,34 @@ function X(t) {
|
|
|
61
61
|
i = "plaintext";
|
|
62
62
|
}
|
|
63
63
|
if (!n || e !== v) return;
|
|
64
|
-
const
|
|
65
|
-
if (o && o.uri.toString() ===
|
|
64
|
+
const u = k(R, t.path);
|
|
65
|
+
if (o && o.uri.toString() === u.toString()) {
|
|
66
66
|
o.getLanguageId() !== i && f.editor.setModelLanguage(o, i), o.getValue() !== t.value && o.setValue(t.value), C(), M();
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const l = f.editor.createModel(t.value, i,
|
|
69
|
+
const l = f.editor.createModel(t.value, i, u);
|
|
70
70
|
o?.dispose(), o = l, n.setModel(o), C(), M();
|
|
71
71
|
};
|
|
72
72
|
return b(() => {
|
|
73
73
|
let e = !1, a, i;
|
|
74
74
|
(async () => {
|
|
75
|
-
if (!r || (
|
|
75
|
+
if (!r || (p(), await N(t.runtimeOptions), e || !r) || (n = f.editor.create(r, {
|
|
76
76
|
model: null,
|
|
77
77
|
...E,
|
|
78
78
|
...t.options ?? {}
|
|
79
79
|
}), y(), await I(), e || !n)) return;
|
|
80
80
|
const l = t.onContentChange, T = t.onChange, z = t.onSelectionChange;
|
|
81
|
-
a = n.onDidChangeModelContent((
|
|
81
|
+
a = n.onDidChangeModelContent((s) => {
|
|
82
82
|
const h = m();
|
|
83
|
-
h && (l?.(
|
|
83
|
+
h && (l?.(s, h), T && T(h.getValue()));
|
|
84
84
|
}), i = n.onDidChangeCursorSelection(() => {
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const s = m();
|
|
86
|
+
s && z?.(s.getSelectedText(), s);
|
|
87
87
|
});
|
|
88
88
|
})().catch((l) => {
|
|
89
89
|
console.error("Failed to initialize Monaco editor runtime", l);
|
|
90
|
-
}),
|
|
91
|
-
e = !0, a?.dispose(), i?.dispose(),
|
|
90
|
+
}), q(() => {
|
|
91
|
+
e = !0, a?.dispose(), i?.dispose(), d && cancelAnimationFrame(d), n?.dispose(), o?.dispose(), n = void 0, o = void 0;
|
|
92
92
|
});
|
|
93
93
|
}), g(() => {
|
|
94
94
|
y();
|
|
@@ -101,7 +101,7 @@ function X(t) {
|
|
|
101
101
|
t.path, t.language, t.value, I();
|
|
102
102
|
}), g(() => {
|
|
103
103
|
const e = x();
|
|
104
|
-
!e || !n || (
|
|
104
|
+
!e || !n || (d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
105
105
|
n?.layout({
|
|
106
106
|
width: e.width,
|
|
107
107
|
height: e.height
|
|
@@ -109,9 +109,9 @@ function X(t) {
|
|
|
109
109
|
}));
|
|
110
110
|
}), (() => {
|
|
111
111
|
var e = _(), a = r;
|
|
112
|
-
return typeof a == "function" ? L(a, e) : r = e,
|
|
113
|
-
var
|
|
114
|
-
return
|
|
112
|
+
return typeof a == "function" ? L(a, e) : r = e, O((i) => {
|
|
113
|
+
var u = t.class, l = t.style;
|
|
114
|
+
return u !== i.e && D(e, i.e = u), i.t = F(e, l, i.t), i;
|
|
115
115
|
}, {
|
|
116
116
|
e: void 0,
|
|
117
117
|
t: void 0
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { CodeEditor, type CodeEditorProps, type CodeEditorApi } from './CodeEditor';
|
|
2
2
|
export { resolveCodeEditorLanguageSpec, isCodeEditorLanguageSupported, type CodeEditorLanguageSpec } from './languages';
|
|
3
|
+
export { DEFAULT_MONACO_STANDALONE_FEATURES, normalizeMonacoRuntimeFeatureSet, type CodeEditorRuntimeOptions, type MonacoRuntimeFeatureSet, } from './monacoStandaloneRuntime';
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface MonacoRuntimeFeatureSet {
|
|
2
|
+
suggestMemory: boolean;
|
|
3
|
+
codeLensCache: boolean;
|
|
4
|
+
inlayHintsCache: boolean;
|
|
5
|
+
treeViewsDnd: boolean;
|
|
6
|
+
actionWidget: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CodeEditorRuntimeOptions {
|
|
9
|
+
standaloneFeatures?: Partial<MonacoRuntimeFeatureSet>;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_MONACO_STANDALONE_FEATURES: MonacoRuntimeFeatureSet;
|
|
12
|
+
type MonacoStandaloneRuntimeLoader = (features: MonacoRuntimeFeatureSet) => Promise<unknown>;
|
|
13
|
+
export declare function normalizeMonacoRuntimeFeatureSet(standaloneFeatures?: Partial<MonacoRuntimeFeatureSet>): MonacoRuntimeFeatureSet;
|
|
14
|
+
export declare function createMonacoStandaloneRuntime(loader: MonacoStandaloneRuntimeLoader): (options?: CodeEditorRuntimeOptions) => Promise<void>;
|
|
15
|
+
export declare const ensureMonacoStandaloneRuntime: (options?: CodeEditorRuntimeOptions) => Promise<void>;
|
|
4
16
|
export {};
|
|
@@ -1,21 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const s = {
|
|
2
|
+
suggestMemory: !0,
|
|
3
|
+
codeLensCache: !0,
|
|
4
|
+
inlayHintsCache: !0,
|
|
5
|
+
treeViewsDnd: !0,
|
|
6
|
+
actionWidget: !0
|
|
7
|
+
};
|
|
8
|
+
function u(e) {
|
|
9
|
+
return {
|
|
10
|
+
...s,
|
|
11
|
+
...e ?? {}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function d(e) {
|
|
15
|
+
return [
|
|
16
|
+
`suggestMemory:${e.suggestMemory ? "1" : "0"}`,
|
|
17
|
+
`codeLensCache:${e.codeLensCache ? "1" : "0"}`,
|
|
18
|
+
`inlayHintsCache:${e.inlayHintsCache ? "1" : "0"}`,
|
|
19
|
+
`treeViewsDnd:${e.treeViewsDnd ? "1" : "0"}`,
|
|
20
|
+
`actionWidget:${e.actionWidget ? "1" : "0"}`
|
|
21
|
+
].join("|");
|
|
22
|
+
}
|
|
23
|
+
function m(e) {
|
|
24
|
+
const n = /* @__PURE__ */ new Map();
|
|
25
|
+
return (r) => {
|
|
26
|
+
const o = u(r?.standaloneFeatures), t = d(o), i = n.get(t);
|
|
27
|
+
if (i) return i;
|
|
28
|
+
const c = e(o).then(() => {
|
|
29
|
+
}).catch((a) => {
|
|
30
|
+
throw n.delete(t), a;
|
|
31
|
+
});
|
|
32
|
+
return n.set(t, c), c;
|
|
33
|
+
};
|
|
7
34
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
import("monaco-editor/esm/vs/editor/edcore.main.js")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import("monaco-editor/esm/vs/editor/common/services/treeViewsDndService.js"),
|
|
14
|
-
import("monaco-editor/esm/vs/platform/actionWidget/browser/actionWidget.js")
|
|
15
|
-
]);
|
|
35
|
+
function h(e) {
|
|
36
|
+
const n = [
|
|
37
|
+
import("monaco-editor/esm/vs/editor/edcore.main.js")
|
|
38
|
+
];
|
|
39
|
+
return e.suggestMemory && n.push(import("monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestMemory.js")), e.codeLensCache && n.push(import("monaco-editor/esm/vs/editor/contrib/codelens/browser/codeLensCache.js")), e.inlayHintsCache && n.push(import("monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.js")), e.treeViewsDnd && n.push(import("monaco-editor/esm/vs/editor/common/services/treeViewsDndService.js")), e.actionWidget && n.push(import("monaco-editor/esm/vs/platform/actionWidget/browser/actionWidget.js")), Promise.all(n);
|
|
16
40
|
}
|
|
17
|
-
const
|
|
41
|
+
const g = m(
|
|
42
|
+
h
|
|
43
|
+
);
|
|
18
44
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
45
|
+
s as DEFAULT_MONACO_STANDALONE_FEATURES,
|
|
46
|
+
m as createMonacoStandaloneRuntime,
|
|
47
|
+
g as ensureMonacoStandaloneRuntime,
|
|
48
|
+
u as normalizeMonacoRuntimeFeatureSet
|
|
21
49
|
};
|
|
@@ -14,6 +14,7 @@ export interface InfiniteCanvasContextMenuEvent {
|
|
|
14
14
|
}
|
|
15
15
|
export interface InfiniteCanvasProps {
|
|
16
16
|
children: JSX.Element;
|
|
17
|
+
overlay?: (viewport: InfiniteCanvasPoint) => JSX.Element;
|
|
17
18
|
viewport: InfiniteCanvasPoint;
|
|
18
19
|
onViewportChange?: (viewport: InfiniteCanvasPoint) => void;
|
|
19
20
|
onCanvasContextMenu?: (event: InfiniteCanvasContextMenuEvent) => void;
|
|
@@ -22,6 +23,7 @@ export interface InfiniteCanvasProps {
|
|
|
22
23
|
contentClass?: string;
|
|
23
24
|
interactiveSelector?: string;
|
|
24
25
|
panSurfaceSelector?: string;
|
|
26
|
+
wheelInteractiveSelector?: string;
|
|
25
27
|
minScale?: number;
|
|
26
28
|
maxScale?: number;
|
|
27
29
|
wheelZoomSpeed?: number;
|