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/vim-web.js CHANGED
@@ -59607,12 +59607,9 @@ class GpuPicker {
59607
59607
  const pixelX = Math.floor(screenPos.x * this._renderTarget.width);
59608
59608
  const pixelY = Math.floor((1 - screenPos.y) * this._renderTarget.height);
59609
59609
  this._renderer.setRenderTarget(this._renderTarget);
59610
- this._renderer.setScissorTest(true);
59611
- this._renderer.setScissor(pixelX, pixelY, 1, 1);
59612
59610
  this._renderer.setClearColor(0, 0);
59613
59611
  this._renderer.clear();
59614
59612
  this._renderer.render(this._scene.threeScene, camera2);
59615
- this._renderer.setScissorTest(false);
59616
59613
  this._renderer.setRenderTarget(currentRenderTarget);
59617
59614
  camera2.layers.enable(Layers2.NoRaycast);
59618
59615
  this._scene.threeScene.overrideMaterial = currentOverrideMaterial;
@@ -59625,6 +59622,8 @@ class GpuPicker {
59625
59622
  1,
59626
59623
  this._readBuffer
59627
59624
  );
59625
+ console.log("GPU Pick buffer:", this._readBuffer[0], this._readBuffer[1], this._readBuffer[2], this._readBuffer[3]);
59626
+ console.log("GPU Pick screen:", screenPos.x, screenPos.y, "pixel:", pixelX, pixelY, "target:", this._renderTarget.width, "x", this._renderTarget.height);
59628
59627
  const depth = this._readBuffer[1];
59629
59628
  const normalX = this._readBuffer[2];
59630
59629
  const normalY = this._readBuffer[3];
@@ -86162,7 +86161,7 @@ function UltraSuggestion() {
86162
86161
  "a",
86163
86162
  {
86164
86163
  className: "vc-text-primary vc-underline vc-font-bold",
86165
- href: "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra",
86164
+ href: "https://docs.vimaec.com/docs/vim-flex/vim-ultra",
86166
86165
  target: "_blank",
86167
86166
  rel: "noopener noreferrer",
86168
86167
  children: "VIM Ultra"
@@ -86548,19 +86547,48 @@ function GenericBoolField(props) {
86548
86547
  }
86549
86548
  function GenericSelectField(props) {
86550
86549
  const refresher = useRefresher();
86551
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
86552
- "select",
86553
- {
86554
- disabled: props.disabled ?? false,
86555
- value: props.field.state.get(),
86556
- onChange: (e) => {
86557
- refresher.refresh();
86558
- props.field.state.set(e.target.value);
86550
+ const [open, setOpen] = useState(false);
86551
+ const ref = useRef(null);
86552
+ useEffect(() => {
86553
+ if (!open) return;
86554
+ const onPointerDown = (e) => {
86555
+ if (ref.current && !ref.current.contains(e.target)) {
86556
+ setOpen(false);
86557
+ }
86558
+ };
86559
+ document.addEventListener("pointerdown", onPointerDown);
86560
+ return () => document.removeEventListener("pointerdown", onPointerDown);
86561
+ }, [open]);
86562
+ const current = props.field.options.find((o) => o.value === props.field.state.get());
86563
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "vc-relative vc-w-full", children: [
86564
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
86565
+ "button",
86566
+ {
86567
+ type: "button",
86568
+ disabled: props.disabled ?? false,
86569
+ onClick: () => setOpen((o) => !o),
86570
+ 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",
86571
+ children: [
86572
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: (current == null ? void 0 : current.label) ?? "" }),
86573
+ /* @__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" }) })
86574
+ ]
86575
+ }
86576
+ ),
86577
+ 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(
86578
+ "div",
86579
+ {
86580
+ 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" : ""}`,
86581
+ onPointerDown: (e) => {
86582
+ e.stopPropagation();
86583
+ props.field.state.set(opt.value);
86584
+ refresher.refresh();
86585
+ setOpen(false);
86586
+ },
86587
+ children: opt.label
86559
86588
  },
86560
- className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
86561
- children: props.field.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt.value, children: opt.label }, opt.value))
86562
- }
86563
- );
86589
+ opt.value
86590
+ )) })
86591
+ ] });
86564
86592
  }
86565
86593
  function useCustomizer(baseEntries, ref) {
86566
86594
  const customization = useRef();
@@ -87224,20 +87252,48 @@ function renderSettingsToggle(settings2, item) {
87224
87252
  }
87225
87253
  function renderSettingsSelect(settings2, item) {
87226
87254
  const value = item.getter(settings2.value);
87227
- const handleChange = (e) => {
87228
- settings2.update((s) => item.setter(s, e.target.value));
87229
- };
87255
+ const [open, setOpen] = useState(false);
87256
+ const ref = useRef(null);
87257
+ useEffect(() => {
87258
+ if (!open) return;
87259
+ const onPointerDown = (e) => {
87260
+ if (ref.current && !ref.current.contains(e.target)) {
87261
+ setOpen(false);
87262
+ }
87263
+ };
87264
+ document.addEventListener("pointerdown", onPointerDown);
87265
+ return () => document.removeEventListener("pointerdown", onPointerDown);
87266
+ }, [open]);
87267
+ const current = item.options.find((o) => o.value === value);
87230
87268
  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: [
87231
87269
  item.label,
87232
- /* @__PURE__ */ jsxRuntimeExports.jsx(
87233
- "select",
87234
- {
87235
- value,
87236
- onChange: handleChange,
87237
- 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",
87238
- children: item.options.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt.value, children: opt.label }, opt.value))
87239
- }
87240
- )
87270
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "vc-relative vc-inline-block vc-ml-2", children: [
87271
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
87272
+ "button",
87273
+ {
87274
+ type: "button",
87275
+ onClick: () => setOpen((o) => !o),
87276
+ 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",
87277
+ children: [
87278
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: (current == null ? void 0 : current.label) ?? "" }),
87279
+ /* @__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" }) })
87280
+ ]
87281
+ }
87282
+ ),
87283
+ 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(
87284
+ "div",
87285
+ {
87286
+ 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" : ""}`,
87287
+ onPointerDown: (e) => {
87288
+ e.stopPropagation();
87289
+ settings2.update((s) => item.setter(s, opt.value));
87290
+ setOpen(false);
87291
+ },
87292
+ children: opt.label
87293
+ },
87294
+ opt.value
87295
+ )) })
87296
+ ] })
87241
87297
  ] });
87242
87298
  }
87243
87299
  function renderSettingsSubtitle(item) {