vim-web 1.0.0-alpha.1 → 1.0.0-alpha.3

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/style.css CHANGED
@@ -706,6 +706,9 @@ video:where(.vim-component,.vim-component *) {
706
706
  .vc-bottom-0 {
707
707
  bottom: 0px;
708
708
  }
709
+ .vc-bottom-full {
710
+ bottom: 100%;
711
+ }
709
712
  .vc-left-0 {
710
713
  left: 0px;
711
714
  }
@@ -840,6 +843,9 @@ video:where(.vim-component,.vim-component *) {
840
843
  .vc-block {
841
844
  display: block;
842
845
  }
846
+ .vc-inline-block {
847
+ display: inline-block;
848
+ }
843
849
  .vc-inline {
844
850
  display: inline;
845
851
  }
@@ -855,6 +861,9 @@ video:where(.vim-component,.vim-component *) {
855
861
  .vc-h-2 {
856
862
  height: 0.5rem;
857
863
  }
864
+ .vc-h-3 {
865
+ height: 0.75rem;
866
+ }
858
867
  .vc-h-4 {
859
868
  height: 1rem;
860
869
  }
@@ -915,6 +924,9 @@ video:where(.vim-component,.vim-component *) {
915
924
  .vc-min-w-0 {
916
925
  min-width: 0px;
917
926
  }
927
+ .vc-min-w-full {
928
+ min-width: 100%;
929
+ }
918
930
  .\!vc-max-w-xs {
919
931
  max-width: 20rem !important;
920
932
  }
@@ -985,6 +997,9 @@ video:where(.vim-component,.vim-component *) {
985
997
  .vc-justify-evenly {
986
998
  justify-content: space-evenly;
987
999
  }
1000
+ .vc-gap-1 {
1001
+ gap: 0.25rem;
1002
+ }
988
1003
  .vc-gap-2 {
989
1004
  gap: 0.5rem;
990
1005
  }
@@ -1183,6 +1198,9 @@ video:where(.vim-component,.vim-component *) {
1183
1198
  .vc-pr-2 {
1184
1199
  padding-right: 0.5rem;
1185
1200
  }
1201
+ .vc-text-left {
1202
+ text-align: left;
1203
+ }
1186
1204
  .vc-text-center {
1187
1205
  text-align: center;
1188
1206
  }
@@ -59623,12 +59623,9 @@ void main() {
59623
59623
  const pixelX = Math.floor(screenPos.x * this._renderTarget.width);
59624
59624
  const pixelY = Math.floor((1 - screenPos.y) * this._renderTarget.height);
59625
59625
  this._renderer.setRenderTarget(this._renderTarget);
59626
- this._renderer.setScissorTest(true);
59627
- this._renderer.setScissor(pixelX, pixelY, 1, 1);
59628
59626
  this._renderer.setClearColor(0, 0);
59629
59627
  this._renderer.clear();
59630
59628
  this._renderer.render(this._scene.threeScene, camera2);
59631
- this._renderer.setScissorTest(false);
59632
59629
  this._renderer.setRenderTarget(currentRenderTarget);
59633
59630
  camera2.layers.enable(Layers.NoRaycast);
59634
59631
  this._scene.threeScene.overrideMaterial = currentOverrideMaterial;
@@ -59641,6 +59638,8 @@ void main() {
59641
59638
  1,
59642
59639
  this._readBuffer
59643
59640
  );
59641
+ console.log("GPU Pick buffer:", this._readBuffer[0], this._readBuffer[1], this._readBuffer[2], this._readBuffer[3]);
59642
+ console.log("GPU Pick screen:", screenPos.x, screenPos.y, "pixel:", pixelX, pixelY, "target:", this._renderTarget.width, "x", this._renderTarget.height);
59644
59643
  const depth = this._readBuffer[1];
59645
59644
  const normalX = this._readBuffer[2];
59646
59645
  const normalY = this._readBuffer[3];
@@ -86178,7 +86177,7 @@ Averrage Date/Second ${avgDataRatePS} kb
86178
86177
  "a",
86179
86178
  {
86180
86179
  className: "vc-text-primary vc-underline vc-font-bold",
86181
- href: "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra",
86180
+ href: "https://docs.vimaec.com/docs/vim-flex/vim-ultra",
86182
86181
  target: "_blank",
86183
86182
  rel: "noopener noreferrer",
86184
86183
  children: "VIM Ultra"
@@ -86564,19 +86563,48 @@ Averrage Date/Second ${avgDataRatePS} kb
86564
86563
  }
86565
86564
  function GenericSelectField(props) {
86566
86565
  const refresher = useRefresher();
86567
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
86568
- "select",
86569
- {
86570
- disabled: props.disabled ?? false,
86571
- value: props.field.state.get(),
86572
- onChange: (e) => {
86573
- refresher.refresh();
86574
- props.field.state.set(e.target.value);
86566
+ const [open, setOpen] = React2.useState(false);
86567
+ const ref = React2.useRef(null);
86568
+ React2.useEffect(() => {
86569
+ if (!open) return;
86570
+ const onPointerDown = (e) => {
86571
+ if (ref.current && !ref.current.contains(e.target)) {
86572
+ setOpen(false);
86573
+ }
86574
+ };
86575
+ document.addEventListener("pointerdown", onPointerDown);
86576
+ return () => document.removeEventListener("pointerdown", onPointerDown);
86577
+ }, [open]);
86578
+ const current = props.field.options.find((o) => o.value === props.field.state.get());
86579
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "vc-relative vc-w-full", children: [
86580
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
86581
+ "button",
86582
+ {
86583
+ type: "button",
86584
+ disabled: props.disabled ?? false,
86585
+ onClick: () => setOpen((o) => !o),
86586
+ className: "vc-border vc-border-gray-300 vc-py-1 vc-w-full vc-px-1 vc-text-left vc-bg-white vc-cursor-pointer vc-flex vc-items-center vc-justify-between",
86587
+ children: [
86588
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: (current == null ? void 0 : current.label) ?? "" }),
86589
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "vc-w-3 vc-h-3 vc-ml-1 vc-shrink-0", viewBox: "0 0 12 12", fill: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M2 4l4 4 4-4", stroke: "currentColor", strokeWidth: "2", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) })
86590
+ ]
86591
+ }
86592
+ ),
86593
+ open && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vc-absolute vc-left-0 vc-right-0 vc-bottom-full vc-z-50 vc-border vc-border-gray-300 vc-bg-white vc-shadow-lg", children: props.field.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
86594
+ "div",
86595
+ {
86596
+ className: `vc-px-1 vc-py-1 vc-cursor-pointer hover:vc-bg-gray-100 ${opt.value === props.field.state.get() ? "vc-bg-gray-100" : ""}`,
86597
+ onPointerDown: (e) => {
86598
+ e.stopPropagation();
86599
+ props.field.state.set(opt.value);
86600
+ refresher.refresh();
86601
+ setOpen(false);
86602
+ },
86603
+ children: opt.label
86575
86604
  },
86576
- className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
86577
- children: props.field.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt.value, children: opt.label }, opt.value))
86578
- }
86579
- );
86605
+ opt.value
86606
+ )) })
86607
+ ] });
86580
86608
  }
86581
86609
  function useCustomizer(baseEntries, ref) {
86582
86610
  const customization = React2.useRef();
@@ -87240,20 +87268,48 @@ Averrage Date/Second ${avgDataRatePS} kb
87240
87268
  }
87241
87269
  function renderSettingsSelect(settings2, item) {
87242
87270
  const value = item.getter(settings2.value);
87243
- const handleChange = (e) => {
87244
- settings2.update((s) => item.setter(s, e.target.value));
87245
- };
87271
+ const [open, setOpen] = React2.useState(false);
87272
+ const ref = React2.useRef(null);
87273
+ React2.useEffect(() => {
87274
+ if (!open) return;
87275
+ const onPointerDown = (e) => {
87276
+ if (ref.current && !ref.current.contains(e.target)) {
87277
+ setOpen(false);
87278
+ }
87279
+ };
87280
+ document.addEventListener("pointerdown", onPointerDown);
87281
+ return () => document.removeEventListener("pointerdown", onPointerDown);
87282
+ }, [open]);
87283
+ const current = item.options.find((o) => o.value === value);
87246
87284
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "vc-m-1 vc-block vc-select-none vc-items-center vc-py-1 vc-text-gray-warm", children: [
87247
87285
  item.label,
87248
- /* @__PURE__ */ jsxRuntimeExports.jsx(
87249
- "select",
87250
- {
87251
- value,
87252
- onChange: handleChange,
87253
- className: "vc-ml-2 vc-rounded vc-border vc-border-gray-medium vc-bg-white vc-px-1 vc-py-0.5 vc-text-sm",
87254
- children: item.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt.value, children: opt.label }, opt.value))
87255
- }
87256
- )
87286
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "vc-relative vc-inline-block vc-ml-2", children: [
87287
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
87288
+ "button",
87289
+ {
87290
+ type: "button",
87291
+ onClick: () => setOpen((o) => !o),
87292
+ className: "vc-rounded vc-border vc-border-gray-medium vc-bg-white vc-px-1 vc-py-0.5 vc-text-sm vc-cursor-pointer vc-text-left vc-inline-flex vc-items-center vc-gap-1",
87293
+ children: [
87294
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: (current == null ? void 0 : current.label) ?? "" }),
87295
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "vc-w-3 vc-h-3 vc-shrink-0", viewBox: "0 0 12 12", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M2 4l4 4 4-4", stroke: "currentColor", strokeWidth: "2", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) })
87296
+ ]
87297
+ }
87298
+ ),
87299
+ open && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vc-absolute vc-left-0 vc-bottom-full vc-z-50 vc-min-w-full vc-rounded vc-border vc-border-gray-medium vc-bg-white vc-shadow-lg vc-text-sm", children: item.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
87300
+ "div",
87301
+ {
87302
+ className: `vc-px-2 vc-py-1 vc-cursor-pointer hover:vc-bg-gray-100 vc-whitespace-nowrap ${opt.value === value ? "vc-bg-gray-100" : ""}`,
87303
+ onPointerDown: (e) => {
87304
+ e.stopPropagation();
87305
+ settings2.update((s) => item.setter(s, opt.value));
87306
+ setOpen(false);
87307
+ },
87308
+ children: opt.label
87309
+ },
87310
+ opt.value
87311
+ )) })
87312
+ ] })
87257
87313
  ] });
87258
87314
  }
87259
87315
  function renderSettingsSubtitle(item) {