@floegence/floe-webapp-core 0.35.18 → 0.35.20
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/editor/CodeEditor.js +68 -63
- package/dist/components/editor/languages.js +2 -2
- package/dist/components/editor/monacoStandaloneRuntime.d.ts +4 -0
- package/dist/components/editor/monacoStandaloneRuntime.js +21 -0
- package/dist/components/file-browser/DragPreview.js +42 -44
- package/dist/components/file-browser/FileGridView.js +61 -61
- package/dist/components/file-browser/FileIcons.d.ts +15 -4
- package/dist/components/file-browser/FileIcons.js +386 -50
- package/dist/components/file-browser/FileListView.js +151 -151
- package/dist/components/file-browser/index.d.ts +2 -2
- package/dist/components/file-browser/types.d.ts +5 -2
- package/dist/components/ui/FileSavePicker.js +56 -58
- package/dist/file-browser.js +25 -21
- package/dist/full.js +396 -392
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { use as
|
|
2
|
-
import { onMount as b,
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useResizeObserver as
|
|
1
|
+
import { use as L, effect as D, className as F, style as O, template as V } from "solid-js/web";
|
|
2
|
+
import { onMount as b, onCleanup as p, createEffect as g } from "solid-js";
|
|
3
|
+
import { useTheme as q } from "../../context/ThemeContext.js";
|
|
4
|
+
import { useResizeObserver as w } 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
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { resolveCodeEditorLanguageSpec as A } from "./languages.js";
|
|
8
|
+
import { ensureMonacoEnvironment as U } from "./monacoEnvironment.js";
|
|
9
|
+
import { ensureMonacoStandaloneRuntime as N } from "./monacoStandaloneRuntime.js";
|
|
10
|
+
var _ = /* @__PURE__ */ V("<div>");
|
|
11
|
+
const E = {
|
|
11
12
|
readOnly: !0,
|
|
12
13
|
automaticLayout: !1,
|
|
13
14
|
minimap: {
|
|
@@ -19,100 +20,104 @@ const M = {
|
|
|
19
20
|
tabSize: 2,
|
|
20
21
|
fontFamily: "var(--font-mono)"
|
|
21
22
|
};
|
|
22
|
-
let
|
|
23
|
-
function
|
|
24
|
-
return f.Uri.parse(`inmemory://model/${
|
|
23
|
+
let $ = 0;
|
|
24
|
+
function k(t, c) {
|
|
25
|
+
return f.Uri.parse(`inmemory://model/${t}/${encodeURIComponent(c)}`);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
28
|
-
const r =
|
|
27
|
+
function B(t, c) {
|
|
28
|
+
if (!t || !c) return "";
|
|
29
|
+
const r = t.getSelection();
|
|
29
30
|
return !r || r.isEmpty() ? "" : c.getValueInRange(r);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
const c =
|
|
32
|
+
function X(t) {
|
|
33
|
+
const c = q();
|
|
33
34
|
let r;
|
|
34
|
-
const
|
|
35
|
+
const R = ++$;
|
|
35
36
|
let n, o, s, S = null, v = 0;
|
|
36
|
-
const
|
|
37
|
+
const x = w(() => r), y = () => {
|
|
37
38
|
f.editor.setTheme(c.resolvedTheme() === "dark" ? "vs-dark" : "vs");
|
|
38
39
|
}, m = () => !n || !o ? null : {
|
|
39
40
|
editor: n,
|
|
40
41
|
model: o,
|
|
41
42
|
getValue: () => n.getValue(),
|
|
42
|
-
getSelectedText: () =>
|
|
43
|
+
getSelectedText: () => B(n, o),
|
|
43
44
|
focus: () => n.focus()
|
|
44
45
|
}, C = () => {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const a =
|
|
48
|
-
a !== S && (S = a,
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
46
|
+
const e = m();
|
|
47
|
+
if (!e) return;
|
|
48
|
+
const a = e.model.uri.toString();
|
|
49
|
+
a !== S && (S = a, t.onReady?.(e));
|
|
50
|
+
}, M = () => {
|
|
51
|
+
const e = m();
|
|
52
|
+
e && t.onSelectionChange?.(e.getSelectedText(), e);
|
|
53
|
+
}, I = async () => {
|
|
53
54
|
if (!n) return;
|
|
54
|
-
const
|
|
55
|
+
const e = ++v, a = A(t.language);
|
|
55
56
|
let i = a.id;
|
|
56
57
|
try {
|
|
57
58
|
await a.load?.();
|
|
58
59
|
} catch {
|
|
59
|
-
if (
|
|
60
|
+
if (e !== v) return;
|
|
60
61
|
i = "plaintext";
|
|
61
62
|
}
|
|
62
|
-
if (!n ||
|
|
63
|
-
const
|
|
64
|
-
if (o && o.uri.toString() ===
|
|
65
|
-
o.getLanguageId() !== i && f.editor.setModelLanguage(o, i), o.getValue() !==
|
|
63
|
+
if (!n || e !== v) return;
|
|
64
|
+
const d = k(R, t.path);
|
|
65
|
+
if (o && o.uri.toString() === d.toString()) {
|
|
66
|
+
o.getLanguageId() !== i && f.editor.setModelLanguage(o, i), o.getValue() !== t.value && o.setValue(t.value), C(), M();
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
const
|
|
69
|
-
o?.dispose(), o =
|
|
69
|
+
const l = f.editor.createModel(t.value, i, d);
|
|
70
|
+
o?.dispose(), o = l, n.setModel(o), C(), M();
|
|
70
71
|
};
|
|
71
72
|
return b(() => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
let e = !1, a, i;
|
|
74
|
+
(async () => {
|
|
75
|
+
if (!r || (U(), await N(), e || !r) || (n = f.editor.create(r, {
|
|
76
|
+
model: null,
|
|
77
|
+
...E,
|
|
78
|
+
...t.options ?? {}
|
|
79
|
+
}), y(), await I(), e || !n)) return;
|
|
80
|
+
const l = t.onContentChange, T = t.onChange, z = t.onSelectionChange;
|
|
81
|
+
a = n.onDidChangeModelContent((u) => {
|
|
82
|
+
const h = m();
|
|
83
|
+
h && (l?.(u, h), T && T(h.getValue()));
|
|
84
|
+
}), i = n.onDidChangeCursorSelection(() => {
|
|
85
|
+
const u = m();
|
|
86
|
+
u && z?.(u.getSelectedText(), u);
|
|
87
|
+
});
|
|
88
|
+
})().catch((l) => {
|
|
89
|
+
console.error("Failed to initialize Monaco editor runtime", l);
|
|
90
|
+
}), p(() => {
|
|
91
|
+
e = !0, a?.dispose(), i?.dispose(), s && cancelAnimationFrame(s), n?.dispose(), o?.dispose(), n = void 0, o = void 0;
|
|
87
92
|
});
|
|
88
93
|
}), g(() => {
|
|
89
94
|
y();
|
|
90
95
|
}), g(() => {
|
|
91
96
|
n && n.updateOptions({
|
|
92
|
-
...
|
|
93
|
-
...
|
|
97
|
+
...E,
|
|
98
|
+
...t.options ?? {}
|
|
94
99
|
});
|
|
95
100
|
}), g(() => {
|
|
96
|
-
|
|
101
|
+
t.path, t.language, t.value, I();
|
|
97
102
|
}), g(() => {
|
|
98
|
-
const
|
|
99
|
-
!
|
|
103
|
+
const e = x();
|
|
104
|
+
!e || !n || (s && cancelAnimationFrame(s), s = requestAnimationFrame(() => {
|
|
100
105
|
n?.layout({
|
|
101
|
-
width:
|
|
102
|
-
height:
|
|
106
|
+
width: e.width,
|
|
107
|
+
height: e.height
|
|
103
108
|
});
|
|
104
109
|
}));
|
|
105
110
|
}), (() => {
|
|
106
|
-
var
|
|
107
|
-
return typeof a == "function" ?
|
|
108
|
-
var
|
|
109
|
-
return
|
|
111
|
+
var e = _(), a = r;
|
|
112
|
+
return typeof a == "function" ? L(a, e) : r = e, D((i) => {
|
|
113
|
+
var d = t.class, l = t.style;
|
|
114
|
+
return d !== i.e && F(e, i.e = d), i.t = O(e, l, i.t), i;
|
|
110
115
|
}, {
|
|
111
116
|
e: void 0,
|
|
112
117
|
t: void 0
|
|
113
|
-
}),
|
|
118
|
+
}), e;
|
|
114
119
|
})();
|
|
115
120
|
}
|
|
116
121
|
export {
|
|
117
|
-
|
|
122
|
+
X as CodeEditor
|
|
118
123
|
};
|
|
@@ -44,8 +44,8 @@ const s = {
|
|
|
44
44
|
svelte: "plaintext",
|
|
45
45
|
groovy: "plaintext"
|
|
46
46
|
}, n = {
|
|
47
|
-
javascript: () => import("monaco-editor/esm/vs/
|
|
48
|
-
typescript: () => import("monaco-editor/esm/vs/
|
|
47
|
+
javascript: () => import("monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js"),
|
|
48
|
+
typescript: () => import("monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js"),
|
|
49
49
|
json: () => import("monaco-editor/esm/vs/language/json/monaco.contribution.js"),
|
|
50
50
|
html: () => import("monaco-editor/esm/vs/language/html/monaco.contribution.js"),
|
|
51
51
|
css: () => import("monaco-editor/esm/vs/language/css/monaco.contribution.js"),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function e(t) {
|
|
2
|
+
let n = null;
|
|
3
|
+
return () => n || (n = t().then(() => {
|
|
4
|
+
}).catch((o) => {
|
|
5
|
+
throw n = null, o;
|
|
6
|
+
}), n);
|
|
7
|
+
}
|
|
8
|
+
function r() {
|
|
9
|
+
return Promise.all([
|
|
10
|
+
import("monaco-editor/esm/vs/editor/edcore.main.js"),
|
|
11
|
+
import("monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestMemory.js"),
|
|
12
|
+
import("monaco-editor/esm/vs/editor/contrib/codelens/browser/codeLensCache.js"),
|
|
13
|
+
import("monaco-editor/esm/vs/editor/common/services/treeViewsDndService.js"),
|
|
14
|
+
import("monaco-editor/esm/vs/platform/actionWidget/browser/actionWidget.js")
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
const i = e(r);
|
|
18
|
+
export {
|
|
19
|
+
e as createMonacoStandaloneRuntime,
|
|
20
|
+
i as ensureMonacoStandaloneRuntime
|
|
21
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { createComponent as o, Portal as
|
|
2
|
-
import { createSignal as F, createEffect as
|
|
3
|
-
import { Presence as
|
|
1
|
+
import { createComponent as o, Portal as N, insert as a, effect as u, className as $, memo as V, template as l, setAttribute as A } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, createEffect as j, createMemo as d, Show as m, For as B } from "solid-js";
|
|
3
|
+
import { Presence as U, Motion as X } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { cn as f } from "../../utils/cn.js";
|
|
5
|
-
import { useFileBrowserDrag as
|
|
6
|
-
import {
|
|
7
|
-
var
|
|
8
|
-
const x = 3, P = 4, T = 4,
|
|
9
|
-
function
|
|
10
|
-
const g =
|
|
5
|
+
import { useFileBrowserDrag as G } from "../../context/FileBrowserDragContext.js";
|
|
6
|
+
import { FileItemIcon as W } from "./FileIcons.js";
|
|
7
|
+
var Y = /* @__PURE__ */ l('<div class="text-[10px] text-muted-foreground pl-6">and <!> more...'), q = /* @__PURE__ */ l("<span>Drop to move"), y = /* @__PURE__ */ l("<div>"), H = /* @__PURE__ */ l('<div class="flex items-center gap-2.5 text-xs text-foreground"><span class="flex-shrink-0 w-4 h-4"></span><span class="truncate font-medium">'), J = /* @__PURE__ */ l("<span>Cannot drop here"), K = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'), L = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>');
|
|
8
|
+
const x = 3, P = 4, T = 4, Q = 0.2;
|
|
9
|
+
function at() {
|
|
10
|
+
const g = G(), n = () => g?.dragState(), S = () => n()?.isDragging ?? !1, C = () => n()?.isDragEnding ?? !1, [c, h] = F(null), [s, w] = F(!1);
|
|
11
11
|
let _ = !1;
|
|
12
|
-
|
|
12
|
+
j(() => {
|
|
13
13
|
const t = S(), e = C();
|
|
14
14
|
if (t && !e && !_ && (h(null), w(!1)), e && !_) {
|
|
15
15
|
const r = n();
|
|
16
16
|
if (r && r.draggedItems.length > 0) {
|
|
17
17
|
const i = r.pointerPosition;
|
|
18
18
|
h({
|
|
19
|
-
items: r.draggedItems.map((
|
|
19
|
+
items: r.draggedItems.map((D) => D.item),
|
|
20
20
|
position: {
|
|
21
21
|
x: i.x + P,
|
|
22
22
|
y: i.y + T
|
|
@@ -52,17 +52,17 @@ function dt() {
|
|
|
52
52
|
}), z = d(() => {
|
|
53
53
|
const t = c();
|
|
54
54
|
return t?.committed && t?.target ? t.target : b();
|
|
55
|
-
}), M = d(() => c()?.committed ?? !1), p = () => n()?.isValidDrop ?? !1, O = () => !!n()?.dropTarget, I = () => O() && !c()
|
|
56
|
-
return o(
|
|
55
|
+
}), M = d(() => c()?.committed ?? !1), p = () => n()?.isValidDrop ?? !1, O = () => !!n()?.dropTarget, I = () => O() && !c();
|
|
56
|
+
return o(U, {
|
|
57
57
|
get children() {
|
|
58
58
|
return o(m, {
|
|
59
59
|
get when() {
|
|
60
|
-
return
|
|
60
|
+
return V(() => !!R())() && E().length > 0;
|
|
61
61
|
},
|
|
62
62
|
get children() {
|
|
63
|
-
return o(
|
|
63
|
+
return o(N, {
|
|
64
64
|
get children() {
|
|
65
|
-
return o(
|
|
65
|
+
return o(X.div, {
|
|
66
66
|
get class() {
|
|
67
67
|
return f("fixed top-0 left-0 pointer-events-none z-[9999]", "will-change-transform");
|
|
68
68
|
},
|
|
@@ -81,7 +81,7 @@ function dt() {
|
|
|
81
81
|
},
|
|
82
82
|
get transition() {
|
|
83
83
|
return {
|
|
84
|
-
duration: s() ?
|
|
84
|
+
duration: s() ? Q : 0,
|
|
85
85
|
easing: "ease-out"
|
|
86
86
|
};
|
|
87
87
|
},
|
|
@@ -90,51 +90,49 @@ function dt() {
|
|
|
90
90
|
},
|
|
91
91
|
get children() {
|
|
92
92
|
return [(() => {
|
|
93
|
-
var t =
|
|
94
|
-
return
|
|
93
|
+
var t = y();
|
|
94
|
+
return a(t, o(B, {
|
|
95
95
|
get each() {
|
|
96
96
|
return E();
|
|
97
97
|
},
|
|
98
98
|
children: (e) => (() => {
|
|
99
|
-
var r =
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
return N(e);
|
|
103
|
-
},
|
|
99
|
+
var r = H(), i = r.firstChild, D = i.nextSibling;
|
|
100
|
+
return a(i, o(W, {
|
|
101
|
+
item: e,
|
|
104
102
|
class: "w-4 h-4"
|
|
105
|
-
})),
|
|
103
|
+
})), a(D, () => e.name), r;
|
|
106
104
|
})()
|
|
107
|
-
}), null),
|
|
105
|
+
}), null), a(t, o(m, {
|
|
108
106
|
get when() {
|
|
109
107
|
return k() > 0;
|
|
110
108
|
},
|
|
111
109
|
get children() {
|
|
112
|
-
var e =
|
|
113
|
-
return i.nextSibling,
|
|
110
|
+
var e = Y(), r = e.firstChild, i = r.nextSibling;
|
|
111
|
+
return i.nextSibling, a(e, k, i), e;
|
|
114
112
|
}
|
|
115
|
-
}), null),
|
|
113
|
+
}), null), a(t, o(m, {
|
|
116
114
|
get when() {
|
|
117
115
|
return I();
|
|
118
116
|
},
|
|
119
117
|
get children() {
|
|
120
|
-
var e =
|
|
121
|
-
return
|
|
118
|
+
var e = y();
|
|
119
|
+
return a(e, o(m, {
|
|
122
120
|
get when() {
|
|
123
121
|
return p();
|
|
124
122
|
},
|
|
125
123
|
get fallback() {
|
|
126
|
-
return [o(
|
|
124
|
+
return [o(tt, {
|
|
127
125
|
class: "w-3.5 h-3.5"
|
|
128
|
-
}),
|
|
126
|
+
}), J()];
|
|
129
127
|
},
|
|
130
128
|
get children() {
|
|
131
|
-
return [o(
|
|
129
|
+
return [o(Z, {
|
|
132
130
|
class: "w-3.5 h-3.5"
|
|
133
|
-
}),
|
|
131
|
+
}), q()];
|
|
134
132
|
}
|
|
135
|
-
})), u(() =>
|
|
133
|
+
})), u(() => $(e, f("flex items-center gap-1.5 pt-1.5 mt-1 border-t border-border text-[11px] font-medium", "transition-colors duration-150", p() ? "text-success" : "text-error"))), e;
|
|
136
134
|
}
|
|
137
|
-
}), null), u(() =>
|
|
135
|
+
}), null), u(() => $(t, f(
|
|
138
136
|
"flex flex-col gap-1 p-2.5 rounded-lg",
|
|
139
137
|
"bg-card border border-border",
|
|
140
138
|
"shadow-md",
|
|
@@ -153,8 +151,8 @@ function dt() {
|
|
|
153
151
|
return v() > 1;
|
|
154
152
|
},
|
|
155
153
|
get children() {
|
|
156
|
-
var t =
|
|
157
|
-
return
|
|
154
|
+
var t = y();
|
|
155
|
+
return a(t, v), u(() => $(t, f(
|
|
158
156
|
"absolute -top-2 -right-2",
|
|
159
157
|
"min-w-[20px] h-5 px-1.5 rounded-full",
|
|
160
158
|
"bg-foreground text-background",
|
|
@@ -175,18 +173,18 @@ function dt() {
|
|
|
175
173
|
}
|
|
176
174
|
});
|
|
177
175
|
}
|
|
178
|
-
function
|
|
176
|
+
function Z(g) {
|
|
179
177
|
return (() => {
|
|
180
|
-
var n =
|
|
178
|
+
var n = K();
|
|
181
179
|
return u(() => A(n, "class", g.class)), n;
|
|
182
180
|
})();
|
|
183
181
|
}
|
|
184
|
-
function
|
|
182
|
+
function tt(g) {
|
|
185
183
|
return (() => {
|
|
186
|
-
var n =
|
|
184
|
+
var n = L();
|
|
187
185
|
return u(() => A(n, "class", g.class)), n;
|
|
188
186
|
})();
|
|
189
187
|
}
|
|
190
188
|
export {
|
|
191
|
-
|
|
189
|
+
at as DragPreview
|
|
192
190
|
};
|