@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.
@@ -1,13 +1,14 @@
1
- import { use as R, effect as L, className as D, style as O, template as V } from "solid-js/web";
2
- import { onMount as b, createEffect as g, onCleanup as q } from "solid-js";
3
- import { useTheme as A } from "../../context/ThemeContext.js";
4
- import { useResizeObserver as F } from "../../hooks/useResizeObserver.js";
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 U } from "./languages.js";
8
- import { ensureMonacoEnvironment as p } from "./monacoEnvironment.js";
9
- var z = /* @__PURE__ */ V("<div>");
10
- const M = {
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 w = 0;
23
- function N(e, c) {
24
- return f.Uri.parse(`inmemory://model/${e}/${encodeURIComponent(c)}`);
23
+ let $ = 0;
24
+ function k(t, c) {
25
+ return f.Uri.parse(`inmemory://model/${t}/${encodeURIComponent(c)}`);
25
26
  }
26
- function _(e, c) {
27
- if (!e || !c) return "";
28
- const r = e.getSelection();
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 J(e) {
32
- const c = A();
32
+ function X(t) {
33
+ const c = q();
33
34
  let r;
34
- const x = ++w;
35
+ const R = ++$;
35
36
  let n, o, s, S = null, v = 0;
36
- const E = F(() => r), y = () => {
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: () => _(n, o),
43
+ getSelectedText: () => B(n, o),
43
44
  focus: () => n.focus()
44
45
  }, C = () => {
45
- const t = m();
46
- if (!t) return;
47
- const a = t.model.uri.toString();
48
- a !== S && (S = a, e.onReady?.(t));
49
- }, I = () => {
50
- const t = m();
51
- t && e.onSelectionChange?.(t.getSelectedText(), t);
52
- }, T = async () => {
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 t = ++v, a = U(e.language);
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 (t !== v) return;
60
+ if (e !== v) return;
60
61
  i = "plaintext";
61
62
  }
62
- if (!n || t !== v) return;
63
- const l = N(x, e.path);
64
- if (o && o.uri.toString() === l.toString()) {
65
- o.getLanguageId() !== i && f.editor.setModelLanguage(o, i), o.getValue() !== e.value && o.setValue(e.value), C(), I();
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 d = f.editor.createModel(e.value, i, l);
69
- o?.dispose(), o = d, n.setModel(o), C(), I();
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
- if (!r) return;
73
- p(), n = f.editor.create(r, {
74
- model: null,
75
- ...M,
76
- ...e.options ?? {}
77
- }), y(), T();
78
- const t = e.onContentChange, a = e.onChange, i = e.onSelectionChange, l = n.onDidChangeModelContent((u) => {
79
- const h = m();
80
- h && (t?.(u, h), a && a(h.getValue()));
81
- }), d = n.onDidChangeCursorSelection(() => {
82
- const u = m();
83
- u && i?.(u.getSelectedText(), u);
84
- });
85
- q(() => {
86
- l.dispose(), d.dispose(), s && cancelAnimationFrame(s), n?.dispose(), o?.dispose(), n = void 0, o = void 0;
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
- ...M,
93
- ...e.options ?? {}
97
+ ...E,
98
+ ...t.options ?? {}
94
99
  });
95
100
  }), g(() => {
96
- e.path, e.language, e.value, T();
101
+ t.path, t.language, t.value, I();
97
102
  }), g(() => {
98
- const t = E();
99
- !t || !n || (s && cancelAnimationFrame(s), s = requestAnimationFrame(() => {
103
+ const e = x();
104
+ !e || !n || (s && cancelAnimationFrame(s), s = requestAnimationFrame(() => {
100
105
  n?.layout({
101
- width: t.width,
102
- height: t.height
106
+ width: e.width,
107
+ height: e.height
103
108
  });
104
109
  }));
105
110
  }), (() => {
106
- var t = z(), a = r;
107
- return typeof a == "function" ? R(a, t) : r = t, L((i) => {
108
- var l = e.class, d = e.style;
109
- return l !== i.e && D(t, i.e = l), i.t = O(t, d, i.t), i;
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
- }), t;
118
+ }), e;
114
119
  })();
115
120
  }
116
121
  export {
117
- J as CodeEditor
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/language/typescript/monaco.contribution.js"),
48
- typescript: () => import("monaco-editor/esm/vs/language/typescript/monaco.contribution.js"),
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,4 @@
1
+ type MonacoStandaloneRuntimeLoader = () => Promise<unknown>;
2
+ export declare function createMonacoStandaloneRuntime(loader: MonacoStandaloneRuntimeLoader): () => Promise<void>;
3
+ export declare const ensureMonacoStandaloneRuntime: () => Promise<void>;
4
+ export {};
@@ -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 V, insert as l, Dynamic as j, effect as u, className as D, memo as B, template as a, setAttribute as A } from "solid-js/web";
2
- import { createSignal as F, createEffect as U, createMemo as d, Show as m, For as X } from "solid-js";
3
- import { Presence as G, Motion as W } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
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 Y } from "../../context/FileBrowserDragContext.js";
6
- import { FolderIcon as q, getFileIcon as H } from "./FileIcons.js";
7
- var J = /* @__PURE__ */ a('<div class="text-[10px] text-muted-foreground pl-6">and <!> more...'), K = /* @__PURE__ */ a("<span>Drop to move"), $ = /* @__PURE__ */ a("<div>"), L = /* @__PURE__ */ a('<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">'), Q = /* @__PURE__ */ a("<span>Cannot drop here"), Z = /* @__PURE__ */ a('<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">'), tt = /* @__PURE__ */ a('<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, et = 0.2;
9
- function dt() {
10
- const g = Y(), n = () => g?.dragState(), S = () => n()?.isDragging ?? !1, C = () => n()?.isDragEnding ?? !1, [c, h] = F(null), [s, w] = F(!1);
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
- U(() => {
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((y) => y.item),
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(), N = (t) => t.type === "folder" ? q : H(t.extension);
56
- return o(G, {
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 B(() => !!R())() && E().length > 0;
60
+ return V(() => !!R())() && E().length > 0;
61
61
  },
62
62
  get children() {
63
- return o(V, {
63
+ return o(N, {
64
64
  get children() {
65
- return o(W.div, {
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() ? et : 0,
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 l(t, o(X, {
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 = L(), i = r.firstChild, y = i.nextSibling;
100
- return l(i, o(j, {
101
- get component() {
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
- })), l(y, () => e.name), r;
103
+ })), a(D, () => e.name), r;
106
104
  })()
107
- }), null), l(t, o(m, {
105
+ }), null), a(t, o(m, {
108
106
  get when() {
109
107
  return k() > 0;
110
108
  },
111
109
  get children() {
112
- var e = J(), r = e.firstChild, i = r.nextSibling;
113
- return i.nextSibling, l(e, k, i), e;
110
+ var e = Y(), r = e.firstChild, i = r.nextSibling;
111
+ return i.nextSibling, a(e, k, i), e;
114
112
  }
115
- }), null), l(t, o(m, {
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 l(e, o(m, {
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(nt, {
124
+ return [o(tt, {
127
125
  class: "w-3.5 h-3.5"
128
- }), Q()];
126
+ }), J()];
129
127
  },
130
128
  get children() {
131
- return [o(rt, {
129
+ return [o(Z, {
132
130
  class: "w-3.5 h-3.5"
133
- }), K()];
131
+ }), q()];
134
132
  }
135
- })), u(() => D(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;
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(() => D(t, f(
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 l(t, v), u(() => D(t, f(
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 rt(g) {
176
+ function Z(g) {
179
177
  return (() => {
180
- var n = Z();
178
+ var n = K();
181
179
  return u(() => A(n, "class", g.class)), n;
182
180
  })();
183
181
  }
184
- function nt(g) {
182
+ function tt(g) {
185
183
  return (() => {
186
- var n = tt();
184
+ var n = L();
187
185
  return u(() => A(n, "class", g.class)), n;
188
186
  })();
189
187
  }
190
188
  export {
191
- dt as DragPreview
189
+ at as DragPreview
192
190
  };