@salilvnair/dui 1.0.11 → 1.0.13
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/README.md +730 -96
- package/dist/index.js +3726 -3713
- package/dist/index.js.map +1 -1
- package/dist/lib/components/input/select-position.d.ts +54 -0
- package/dist/monaco-setup.core.d.ts +4 -0
- package/dist/monaco-setup.d.ts +1 -4
- package/dist/monaco-setup.js +19 -19
- package/dist/monaco-setup.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +20 -3
- package/dist/assets/DuiShowcase-BOtwgwbq.css +0 -1
- package/dist/assets/DuiShowcase-Bl4Oi2Vw.js +0 -74723
- package/dist/assets/abap-DLDM7-KI.js +0 -1
- package/dist/assets/apex-DNDY2TF8.js +0 -1
- package/dist/assets/azcli-Y6nb8tq_.js +0 -1
- package/dist/assets/bat-BwHxbl9M.js +0 -1
- package/dist/assets/bicep-CFznDFnq.js +0 -2
- package/dist/assets/cameligo-Bf6VGUru.js +0 -1
- package/dist/assets/clojure-Dnu-v4kV.js +0 -1
- package/dist/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/dist/assets/coffee-Bd8akH9Z.js +0 -1
- package/dist/assets/cpp-BbWJElDN.js +0 -1
- package/dist/assets/csharp-Co3qMtFm.js +0 -1
- package/dist/assets/csp-D-4FJmMZ.js +0 -1
- package/dist/assets/css-DdJfP1eB.js +0 -3
- package/dist/assets/css.worker-B4z49cGk.js +0 -93
- package/dist/assets/cssMode-CZYOZ1AO.js +0 -1
- package/dist/assets/cypher-cTPe9QuQ.js +0 -1
- package/dist/assets/dart-BOtBlQCF.js +0 -1
- package/dist/assets/dockerfile-BG73LgW2.js +0 -1
- package/dist/assets/ecl-BEgZUVRK.js +0 -1
- package/dist/assets/elixir-BkW5O-1t.js +0 -1
- package/dist/assets/flow9-BeJ5waoc.js +0 -1
- package/dist/assets/freemarker2-CGSa1nHJ.js +0 -3
- package/dist/assets/fsharp-PahG7c26.js +0 -1
- package/dist/assets/go-acbASCJo.js +0 -1
- package/dist/assets/graphql-BxJiqAUM.js +0 -1
- package/dist/assets/handlebars-mB8dxbcs.js +0 -1
- package/dist/assets/hcl-DtV1sZF8.js +0 -1
- package/dist/assets/html-l7YRKuHI.js +0 -1
- package/dist/assets/html.worker-DtiGdgqp.js +0 -470
- package/dist/assets/htmlMode-CuoiFE2t.js +0 -1
- package/dist/assets/index-Dylj6yGs.css +0 -10
- package/dist/assets/index-ROymQLGX.js +0 -50
- package/dist/assets/ini-Kd9XrMLS.js +0 -1
- package/dist/assets/java-CXBNlu9o.js +0 -1
- package/dist/assets/javascript-9UYwmKgx.js +0 -1
- package/dist/assets/json.worker-leyajbqV.js +0 -58
- package/dist/assets/jsonMode-6uegdfHj.js +0 -7
- package/dist/assets/julia-cl7-CwDS.js +0 -1
- package/dist/assets/kotlin-s7OhZKlX.js +0 -1
- package/dist/assets/less-9HpZscsL.js +0 -2
- package/dist/assets/lexon-OrD6JF1K.js +0 -1
- package/dist/assets/liquid-C8P3CEDc.js +0 -1
- package/dist/assets/lspLanguageFeatures-Ju8ugRgx.js +0 -4
- package/dist/assets/lua-Cyyb5UIc.js +0 -1
- package/dist/assets/m3-B8OfTtLu.js +0 -1
- package/dist/assets/markdown-BFxVWTOG.js +0 -1
- package/dist/assets/mdx-D4_p5PzA.js +0 -1
- package/dist/assets/mips-CiqrrVzr.js +0 -1
- package/dist/assets/monaco-editor-CN2OOCze.js +0 -908
- package/dist/assets/monaco-editor-qiF_U8vl.css +0 -1
- package/dist/assets/msdax-DmeGPVcC.js +0 -1
- package/dist/assets/mysql-C_tMU-Nz.js +0 -1
- package/dist/assets/objective-c-BDtDVThU.js +0 -1
- package/dist/assets/pascal-vHIfCaH5.js +0 -1
- package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
- package/dist/assets/perl-Ub6l9XKa.js +0 -1
- package/dist/assets/pgsql-BlNEE0v7.js +0 -1
- package/dist/assets/php-BBUBE1dy.js +0 -1
- package/dist/assets/pla-DSh2-awV.js +0 -1
- package/dist/assets/postiats-CocnycG-.js +0 -1
- package/dist/assets/powerquery-tScXyioY.js +0 -1
- package/dist/assets/powershell-COWaemsV.js +0 -1
- package/dist/assets/protobuf-Brw8urJB.js +0 -2
- package/dist/assets/pug-8SOpv6rk.js +0 -1
- package/dist/assets/python-BDvE0baC.js +0 -1
- package/dist/assets/qsharp-Bw9ernYp.js +0 -1
- package/dist/assets/r-j7ic8hl3.js +0 -1
- package/dist/assets/razor-3AZt1jFw.js +0 -1
- package/dist/assets/redis-Bu5POkcn.js +0 -1
- package/dist/assets/redshift-Bs9aos_-.js +0 -1
- package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
- package/dist/assets/ruby-zBfavPgS.js +0 -1
- package/dist/assets/rust-BzKRNQWT.js +0 -1
- package/dist/assets/sb-BBc9UKZt.js +0 -1
- package/dist/assets/scala-D9hQfWCl.js +0 -1
- package/dist/assets/scheme-BPhDTwHR.js +0 -1
- package/dist/assets/scss-CBJaRo0y.js +0 -3
- package/dist/assets/shell-DiJ1NA_G.js +0 -1
- package/dist/assets/solidity-Db0IVjzk.js +0 -1
- package/dist/assets/sophia-CnS9iZB_.js +0 -1
- package/dist/assets/sparql-CJmd_6j2.js +0 -1
- package/dist/assets/sql-ClhHkBeG.js +0 -1
- package/dist/assets/st-CHwy0fLd.js +0 -1
- package/dist/assets/swift-Bqt4WxQ4.js +0 -3
- package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
- package/dist/assets/tcl-Dm6ycUr_.js +0 -1
- package/dist/assets/ts.worker-59MjiAqk.js +0 -67731
- package/dist/assets/tsMode-2fAJOXuF.js +0 -11
- package/dist/assets/twig-Csy3S7wG.js +0 -1
- package/dist/assets/typescript-Bv1W4NlY.js +0 -1
- package/dist/assets/typespec-Btyra-wh.js +0 -1
- package/dist/assets/vb-Db0cS2oM.js +0 -1
- package/dist/assets/wgsl-BTesnYfV.js +0 -298
- package/dist/assets/xml-CR03X85Q.js +0 -1
- package/dist/assets/yaml-Qi3RsNvX.js +0 -1
- package/dist/index.html +0 -15
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a select's menu goes, and how tall it is allowed to be.
|
|
3
|
+
*
|
|
4
|
+
* ── Why this is its own module ──
|
|
5
|
+
*
|
|
6
|
+
* It used to live inline in `SelectInputView`, with a copy of the same
|
|
7
|
+
* arithmetic in the test beside it and a comment promising the two were "kept
|
|
8
|
+
* in step by construction". They were, for a while. A test that owns a second
|
|
9
|
+
* copy of the thing it is testing cannot fail when the first copy drifts,
|
|
10
|
+
* which is the one job it had — so there is now one function, and the test
|
|
11
|
+
* imports it.
|
|
12
|
+
*
|
|
13
|
+
* ── The rule ──
|
|
14
|
+
*
|
|
15
|
+
* The decision has to use the height the menu will ACTUALLY be, not the height
|
|
16
|
+
* of its contents. `scrollHeight` for a few hundred options is many thousands
|
|
17
|
+
* of pixels; comparing that against the space on either side made every long
|
|
18
|
+
* list decide nothing fitted, fall through to opening downward, and run off
|
|
19
|
+
* the bottom of the window. The longer the list, the more certain it was to do
|
|
20
|
+
* the wrong thing.
|
|
21
|
+
*
|
|
22
|
+
* So: cap the height first, then choose the side with room, then clamp to the
|
|
23
|
+
* room that side actually has. The menu scrolls internally rather than past
|
|
24
|
+
* the edge of the window.
|
|
25
|
+
*/
|
|
26
|
+
/** Nothing taller than this, however long the list. */
|
|
27
|
+
export declare const MAX_MENU_H = 380;
|
|
28
|
+
/**
|
|
29
|
+
* Never collapse to a sliver.
|
|
30
|
+
*
|
|
31
|
+
* A trigger a few pixels from an edge has almost no room on that side, and a
|
|
32
|
+
* 12px menu is unusable — better to overlap the trigger slightly and stay
|
|
33
|
+
* readable. `placeSelectMenu` honours that by keeping the height and sliding
|
|
34
|
+
* the menu back inside the window, rather than by letting it hang over the
|
|
35
|
+
* edge where the overlapped part cannot be reached at all.
|
|
36
|
+
*/
|
|
37
|
+
export declare const MIN_MENU_H = 120;
|
|
38
|
+
export interface MenuPlacement {
|
|
39
|
+
side: 'above' | 'below';
|
|
40
|
+
/** Viewport coordinate for the menu's top edge. */
|
|
41
|
+
top: number;
|
|
42
|
+
/** What the menu may grow to. It scrolls beyond this. */
|
|
43
|
+
maxHeight: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Place the menu for a trigger at `rect` in a window `viewportHeight` tall.
|
|
47
|
+
*
|
|
48
|
+
* `contentHeight` is the menu's `scrollHeight` — what it would be if nothing
|
|
49
|
+
* constrained it. It informs the choice of side and never the final height.
|
|
50
|
+
*/
|
|
51
|
+
export declare function placeSelectMenu(rect: {
|
|
52
|
+
top: number;
|
|
53
|
+
bottom: number;
|
|
54
|
+
}, contentHeight: number, viewportHeight: number): MenuPlacement;
|
package/dist/monaco-setup.d.ts
CHANGED
package/dist/monaco-setup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fe from "monaco-editor/esm/vs/editor/editor.worker?worker&inline";
|
|
2
|
+
import pe from "monaco-editor/esm/vs/language/json/json.worker?worker&inline";
|
|
3
|
+
import me from "monaco-editor/esm/vs/language/html/html.worker?worker&inline";
|
|
4
|
+
import he from "monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline";
|
|
5
|
+
import Y, { DiffEditor as ke, loader as be } from "@monaco-editor/react";
|
|
2
6
|
import * as O from "monaco-editor";
|
|
3
|
-
import { q as X, E as Q, A as
|
|
7
|
+
import { q as X, E as Q, A as Ce, G as ye, H as ve, I as we, J as Ee } from "./chunks/doc-path-CS9-ZNht.js";
|
|
4
8
|
import { jsx as M } from "react/jsx-runtime";
|
|
5
|
-
import { useState as
|
|
6
|
-
import ve from "monaco-editor/esm/vs/editor/editor.worker?worker&inline";
|
|
7
|
-
import we from "monaco-editor/esm/vs/language/json/json.worker?worker&inline";
|
|
8
|
-
import Ee from "monaco-editor/esm/vs/language/html/html.worker?worker&inline";
|
|
9
|
-
import Te from "monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline";
|
|
9
|
+
import { useState as Te, useEffect as A, useRef as R, useCallback as z, useMemo as ee } from "react";
|
|
10
10
|
import { javascriptDefaults as P, JsxEmit as te, ModuleResolutionKind as ne, ModuleKind as oe, ScriptTarget as re, typescriptDefaults as ie } from "monaco-editor/esm/vs/language/typescript/monaco.contribution";
|
|
11
11
|
function H() {
|
|
12
12
|
var n;
|
|
@@ -14,7 +14,7 @@ function H() {
|
|
|
14
14
|
return e ? e === "vscode-light" ? "light" : "dark" : document.documentElement.getAttribute("data-theme") || "dark";
|
|
15
15
|
}
|
|
16
16
|
function j() {
|
|
17
|
-
const [e, n] =
|
|
17
|
+
const [e, n] = Te(H);
|
|
18
18
|
return A(() => {
|
|
19
19
|
const r = () => n(H()), i = new MutationObserver(r);
|
|
20
20
|
i.observe(document.documentElement, { attributes: !0, attributeFilter: ["data-theme", "data-vscode-theme-kind"] });
|
|
@@ -603,7 +603,7 @@ function Pe(e, n, r) {
|
|
|
603
603
|
var m, f, b;
|
|
604
604
|
const i = (m = e == null ? void 0 : e.getModel) == null ? void 0 : m.call(e), l = (b = (f = e == null ? void 0 : e.getTargetAtClientPoint) == null ? void 0 : f.call(e, n, r)) == null ? void 0 : b.position;
|
|
605
605
|
if (!i || !l) return [];
|
|
606
|
-
const u = i.getLanguageId(), d = i.getValue(), t = i.getOffsetAt(l), g = u === "json" ?
|
|
606
|
+
const u = i.getLanguageId(), d = i.getValue(), t = i.getOffsetAt(l), g = u === "json" ? Ce(d, t) : u === "xml" ? ye(d, t) : [];
|
|
607
607
|
if (!g.length) return [];
|
|
608
608
|
const C = [...g].reverse();
|
|
609
609
|
return [{
|
|
@@ -852,7 +852,7 @@ function qe({
|
|
|
852
852
|
}) {
|
|
853
853
|
const m = j(), f = g ?? (m === "light" ? "vs" : "vs-dark"), b = typeof i == "number" ? `${i}px` : i;
|
|
854
854
|
return /* @__PURE__ */ M(
|
|
855
|
-
|
|
855
|
+
ke,
|
|
856
856
|
{
|
|
857
857
|
height: b,
|
|
858
858
|
language: r,
|
|
@@ -881,11 +881,6 @@ function qe({
|
|
|
881
881
|
}
|
|
882
882
|
);
|
|
883
883
|
}
|
|
884
|
-
window.MonacoEnvironment = {
|
|
885
|
-
getWorker(e, n) {
|
|
886
|
-
return n === "json" ? new we() : n === "html" || n === "handlebars" || n === "razor" ? new Ee() : n === "typescript" || n === "javascript" ? new Te() : new ve();
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
884
|
O.editor.defineTheme("daakia-dark", {
|
|
890
885
|
base: "vs-dark",
|
|
891
886
|
inherit: !0,
|
|
@@ -1040,14 +1035,19 @@ O.editor.defineTheme("daakia-light", {
|
|
|
1040
1035
|
focusBorder: "#6366f1"
|
|
1041
1036
|
}
|
|
1042
1037
|
});
|
|
1043
|
-
|
|
1038
|
+
be.config({ monaco: O });
|
|
1044
1039
|
window.monaco = O;
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1040
|
+
we(We);
|
|
1041
|
+
Ee(qe);
|
|
1042
|
+
ve();
|
|
1048
1043
|
function Ye(e) {
|
|
1049
1044
|
O.editor.setTheme(e === "dark" ? "daakia-dark" : "daakia-light");
|
|
1050
1045
|
}
|
|
1046
|
+
window.MonacoEnvironment = {
|
|
1047
|
+
getWorker(e, n) {
|
|
1048
|
+
return n === "json" ? new pe() : n === "html" || n === "handlebars" || n === "razor" ? new me() : n === "typescript" || n === "javascript" ? new he() : new fe();
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
1051
|
export {
|
|
1052
1052
|
Ye as applyMonacoTheme,
|
|
1053
1053
|
O as monaco
|