@w100n/documents 0.18.0 → 0.18.1

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/collab.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  pending,
12
12
  save,
13
13
  seed
14
- } from "./chunk-ZCSHH24C.js";
14
+ } from "./chunk-2G34AIPU.js";
15
15
  import "./chunk-GSIPTCQH.js";
16
16
  import "./chunk-BWU6FPPZ.js";
17
17
  import "./chunk-ZAVXCH7V.js";
package/dist/index.cjs CHANGED
@@ -4993,7 +4993,7 @@ var init_wiki = __esm({
4993
4993
  var version;
4994
4994
  var init_package = __esm({
4995
4995
  "package.json"() {
4996
- version = "0.18.0";
4996
+ version = "0.18.1";
4997
4997
  }
4998
4998
  });
4999
4999
 
@@ -14636,6 +14636,14 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14636
14636
  const [menu, setMenu] = (0, import_react19.useState)(null);
14637
14637
  const [spot3, setSpot] = (0, import_react19.useState)(null);
14638
14638
  const [edit, setEdit] = (0, import_react19.useState)(null);
14639
+ const popup = (0, import_react19.useRef)(null);
14640
+ (0, import_react19.useLayoutEffect)(() => {
14641
+ const el = popup.current;
14642
+ const at2 = menu ?? spot3;
14643
+ if (!el || !at2) return;
14644
+ el.style.top = `${Math.max(8, Math.min(at2.y, innerHeight - el.offsetHeight - 8))}px`;
14645
+ el.style.left = `${Math.max(8, Math.min(at2.x, innerWidth - el.offsetWidth - 8))}px`;
14646
+ }, [menu, spot3]);
14639
14647
  const [naming, setNaming] = (0, import_react19.useState)(null);
14640
14648
  const [notice, setNotice] = (0, import_react19.useState)(null);
14641
14649
  const early = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
@@ -15223,28 +15231,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15223
15231
  kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
15224
15232
  renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
15225
15233
  docbar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
15226
- host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15234
+ host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15227
15235
  "button",
15228
15236
  {
15229
15237
  type: "button",
15230
- className: "w100n-docs-action",
15238
+ className: "w100n-docs-action w100n-docs-square",
15231
15239
  "data-tone": "blue",
15232
15240
  "aria-label": t.sendChat,
15233
15241
  title: t.sendChat,
15234
15242
  onClick: () => host.send(doc.data.id),
15235
- children: [
15236
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Send, { "aria-hidden": true }),
15237
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: t.sendChat })
15238
- ]
15243
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Send, { "aria-hidden": true })
15239
15244
  }
15240
15245
  ),
15241
- sharing && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
15246
+ sharing && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
15242
15247
  setTab("sharing");
15243
15248
  side2("panel", true);
15244
- }, children: [
15245
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }),
15246
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: t.share })
15247
- ] }),
15249
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }) }),
15248
15250
  doc.data && !versionId && actions?.(doc.data),
15249
15251
  narrow && panelToggle,
15250
15252
  end && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
@@ -15634,7 +15636,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15634
15636
  setMaking(false);
15635
15637
  opened2(made2);
15636
15638
  } }),
15637
- menu && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
15639
+ menu && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
15638
15640
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-head", children: [
15639
15641
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: menu.item.name }),
15640
15642
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.kinds[menu.item.kind], size2(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
@@ -15734,7 +15736,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15734
15736
  ] })
15735
15737
  ] })
15736
15738
  ] }),
15737
- spot3 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
15739
+ spot3 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
15738
15740
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-head", children: [
15739
15741
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: folderNamed(spot3.at) }),
15740
15742
  spot3.at.folder && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [names2.get(spot3.at.spaceId), ...spot3.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })