@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.
Files changed (108) hide show
  1. package/README.md +730 -96
  2. package/dist/index.js +3726 -3713
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/components/input/select-position.d.ts +54 -0
  5. package/dist/monaco-setup.core.d.ts +4 -0
  6. package/dist/monaco-setup.d.ts +1 -4
  7. package/dist/monaco-setup.js +19 -19
  8. package/dist/monaco-setup.js.map +1 -1
  9. package/dist/style.css +1 -1
  10. package/package.json +20 -3
  11. package/dist/assets/DuiShowcase-BOtwgwbq.css +0 -1
  12. package/dist/assets/DuiShowcase-Bl4Oi2Vw.js +0 -74723
  13. package/dist/assets/abap-DLDM7-KI.js +0 -1
  14. package/dist/assets/apex-DNDY2TF8.js +0 -1
  15. package/dist/assets/azcli-Y6nb8tq_.js +0 -1
  16. package/dist/assets/bat-BwHxbl9M.js +0 -1
  17. package/dist/assets/bicep-CFznDFnq.js +0 -2
  18. package/dist/assets/cameligo-Bf6VGUru.js +0 -1
  19. package/dist/assets/clojure-Dnu-v4kV.js +0 -1
  20. package/dist/assets/codicon-ngg6Pgfi.ttf +0 -0
  21. package/dist/assets/coffee-Bd8akH9Z.js +0 -1
  22. package/dist/assets/cpp-BbWJElDN.js +0 -1
  23. package/dist/assets/csharp-Co3qMtFm.js +0 -1
  24. package/dist/assets/csp-D-4FJmMZ.js +0 -1
  25. package/dist/assets/css-DdJfP1eB.js +0 -3
  26. package/dist/assets/css.worker-B4z49cGk.js +0 -93
  27. package/dist/assets/cssMode-CZYOZ1AO.js +0 -1
  28. package/dist/assets/cypher-cTPe9QuQ.js +0 -1
  29. package/dist/assets/dart-BOtBlQCF.js +0 -1
  30. package/dist/assets/dockerfile-BG73LgW2.js +0 -1
  31. package/dist/assets/ecl-BEgZUVRK.js +0 -1
  32. package/dist/assets/elixir-BkW5O-1t.js +0 -1
  33. package/dist/assets/flow9-BeJ5waoc.js +0 -1
  34. package/dist/assets/freemarker2-CGSa1nHJ.js +0 -3
  35. package/dist/assets/fsharp-PahG7c26.js +0 -1
  36. package/dist/assets/go-acbASCJo.js +0 -1
  37. package/dist/assets/graphql-BxJiqAUM.js +0 -1
  38. package/dist/assets/handlebars-mB8dxbcs.js +0 -1
  39. package/dist/assets/hcl-DtV1sZF8.js +0 -1
  40. package/dist/assets/html-l7YRKuHI.js +0 -1
  41. package/dist/assets/html.worker-DtiGdgqp.js +0 -470
  42. package/dist/assets/htmlMode-CuoiFE2t.js +0 -1
  43. package/dist/assets/index-Dylj6yGs.css +0 -10
  44. package/dist/assets/index-ROymQLGX.js +0 -50
  45. package/dist/assets/ini-Kd9XrMLS.js +0 -1
  46. package/dist/assets/java-CXBNlu9o.js +0 -1
  47. package/dist/assets/javascript-9UYwmKgx.js +0 -1
  48. package/dist/assets/json.worker-leyajbqV.js +0 -58
  49. package/dist/assets/jsonMode-6uegdfHj.js +0 -7
  50. package/dist/assets/julia-cl7-CwDS.js +0 -1
  51. package/dist/assets/kotlin-s7OhZKlX.js +0 -1
  52. package/dist/assets/less-9HpZscsL.js +0 -2
  53. package/dist/assets/lexon-OrD6JF1K.js +0 -1
  54. package/dist/assets/liquid-C8P3CEDc.js +0 -1
  55. package/dist/assets/lspLanguageFeatures-Ju8ugRgx.js +0 -4
  56. package/dist/assets/lua-Cyyb5UIc.js +0 -1
  57. package/dist/assets/m3-B8OfTtLu.js +0 -1
  58. package/dist/assets/markdown-BFxVWTOG.js +0 -1
  59. package/dist/assets/mdx-D4_p5PzA.js +0 -1
  60. package/dist/assets/mips-CiqrrVzr.js +0 -1
  61. package/dist/assets/monaco-editor-CN2OOCze.js +0 -908
  62. package/dist/assets/monaco-editor-qiF_U8vl.css +0 -1
  63. package/dist/assets/msdax-DmeGPVcC.js +0 -1
  64. package/dist/assets/mysql-C_tMU-Nz.js +0 -1
  65. package/dist/assets/objective-c-BDtDVThU.js +0 -1
  66. package/dist/assets/pascal-vHIfCaH5.js +0 -1
  67. package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
  68. package/dist/assets/perl-Ub6l9XKa.js +0 -1
  69. package/dist/assets/pgsql-BlNEE0v7.js +0 -1
  70. package/dist/assets/php-BBUBE1dy.js +0 -1
  71. package/dist/assets/pla-DSh2-awV.js +0 -1
  72. package/dist/assets/postiats-CocnycG-.js +0 -1
  73. package/dist/assets/powerquery-tScXyioY.js +0 -1
  74. package/dist/assets/powershell-COWaemsV.js +0 -1
  75. package/dist/assets/protobuf-Brw8urJB.js +0 -2
  76. package/dist/assets/pug-8SOpv6rk.js +0 -1
  77. package/dist/assets/python-BDvE0baC.js +0 -1
  78. package/dist/assets/qsharp-Bw9ernYp.js +0 -1
  79. package/dist/assets/r-j7ic8hl3.js +0 -1
  80. package/dist/assets/razor-3AZt1jFw.js +0 -1
  81. package/dist/assets/redis-Bu5POkcn.js +0 -1
  82. package/dist/assets/redshift-Bs9aos_-.js +0 -1
  83. package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
  84. package/dist/assets/ruby-zBfavPgS.js +0 -1
  85. package/dist/assets/rust-BzKRNQWT.js +0 -1
  86. package/dist/assets/sb-BBc9UKZt.js +0 -1
  87. package/dist/assets/scala-D9hQfWCl.js +0 -1
  88. package/dist/assets/scheme-BPhDTwHR.js +0 -1
  89. package/dist/assets/scss-CBJaRo0y.js +0 -3
  90. package/dist/assets/shell-DiJ1NA_G.js +0 -1
  91. package/dist/assets/solidity-Db0IVjzk.js +0 -1
  92. package/dist/assets/sophia-CnS9iZB_.js +0 -1
  93. package/dist/assets/sparql-CJmd_6j2.js +0 -1
  94. package/dist/assets/sql-ClhHkBeG.js +0 -1
  95. package/dist/assets/st-CHwy0fLd.js +0 -1
  96. package/dist/assets/swift-Bqt4WxQ4.js +0 -3
  97. package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
  98. package/dist/assets/tcl-Dm6ycUr_.js +0 -1
  99. package/dist/assets/ts.worker-59MjiAqk.js +0 -67731
  100. package/dist/assets/tsMode-2fAJOXuF.js +0 -11
  101. package/dist/assets/twig-Csy3S7wG.js +0 -1
  102. package/dist/assets/typescript-Bv1W4NlY.js +0 -1
  103. package/dist/assets/typespec-Btyra-wh.js +0 -1
  104. package/dist/assets/vb-Db0cS2oM.js +0 -1
  105. package/dist/assets/wgsl-BTesnYfV.js +0 -298
  106. package/dist/assets/xml-CR03X85Q.js +0 -1
  107. package/dist/assets/yaml-Qi3RsNvX.js +0 -1
  108. 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;
@@ -0,0 +1,4 @@
1
+ import * as monaco from 'monaco-editor';
2
+ /** Call this whenever the app theme changes to re-theme all open Monaco editors */
3
+ export declare function applyMonacoTheme(theme: 'dark' | 'light'): void;
4
+ export { monaco };
@@ -1,4 +1 @@
1
- import * as monaco from 'monaco-editor';
2
- /** Call this whenever the app theme changes to re-theme all open Monaco editors */
3
- export declare function applyMonacoTheme(theme: 'dark' | 'light'): void;
4
- export { monaco };
1
+ export * from './monaco-setup.core';
@@ -1,12 +1,12 @@
1
- import Y, { DiffEditor as fe, loader as pe } from "@monaco-editor/react";
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 me, G as he, H as ke, I as be, J as Ce } from "./chunks/doc-path-CS9-ZNht.js";
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 ye, useEffect as A, useRef as R, useCallback as z, useMemo as ee } from "react";
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] = ye(H);
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" ? me(d, t) : u === "xml" ? he(d, t) : [];
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
- fe,
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
- pe.config({ monaco: O });
1038
+ be.config({ monaco: O });
1044
1039
  window.monaco = O;
1045
- be(We);
1046
- Ce(qe);
1047
- ke();
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