@ai-matrx/meet 0.7.11 → 0.7.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/CHANGELOG.md +16 -0
- package/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +26 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +26 -7
- package/dist/react.js.map +1 -1
- package/dist/styles.css +2 -1
- package/package.json +2 -2
package/dist/react.cjs
CHANGED
|
@@ -1999,7 +1999,18 @@ function withItem(collab, row, fromRoom = false) {
|
|
|
1999
1999
|
const poll = pollFromRow(row);
|
|
2000
2000
|
if (poll === null) return collab;
|
|
2001
2001
|
const known = collab.polls.find((p) => p.id === poll.id);
|
|
2002
|
-
|
|
2002
|
+
let merged = fromRoom && known !== void 0 ? { ...poll, myVote: known.myVote } : poll;
|
|
2003
|
+
if (fromRoom && known !== void 0 && !poll.options.some((o) => o.votes !== void 0)) {
|
|
2004
|
+
const counted = new Map(known.options.map((o) => [o.id, o]));
|
|
2005
|
+
merged = {
|
|
2006
|
+
...merged,
|
|
2007
|
+
voterCount: known.voterCount,
|
|
2008
|
+
options: merged.options.map((o) => {
|
|
2009
|
+
const had = counted.get(o.id);
|
|
2010
|
+
return had === void 0 ? o : { ...o, votes: had.votes, voters: had.voters };
|
|
2011
|
+
})
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2003
2014
|
return { ...collab, polls: upsert(collab.polls, merged) };
|
|
2004
2015
|
}
|
|
2005
2016
|
if (kind === "question") {
|
|
@@ -2032,13 +2043,8 @@ function without(collab, ids) {
|
|
|
2032
2043
|
}
|
|
2033
2044
|
function applyCollabPacket(collab, payload, context) {
|
|
2034
2045
|
const item = obj(payload["item"]);
|
|
2035
|
-
const audience = str(payload["audience"]);
|
|
2036
2046
|
if (item !== null) {
|
|
2037
2047
|
const kind = str(item["kind"]);
|
|
2038
|
-
const hostOnlyView = kind === "poll" || kind === "question";
|
|
2039
|
-
if (hostOnlyView && context.isHost && audience !== "hosts") {
|
|
2040
|
-
return { next: null, dropped: "the room copy of an item a host receives in full" };
|
|
2041
|
-
}
|
|
2042
2048
|
let next = withItem(collab, item, true);
|
|
2043
2049
|
if (kind === "poll" && str(item["state"]) === "live") {
|
|
2044
2050
|
const before = collab.polls.find((p) => p.id === str(item["id"]));
|
|
@@ -9286,7 +9292,20 @@ function PanelShell({
|
|
|
9286
9292
|
onClose,
|
|
9287
9293
|
children
|
|
9288
9294
|
}) {
|
|
9289
|
-
|
|
9295
|
+
const ref = (0, import_react5.useRef)(null);
|
|
9296
|
+
(0, import_react5.useLayoutEffect)(() => {
|
|
9297
|
+
const panel = ref.current;
|
|
9298
|
+
const root = panel?.closest(".mx-meet");
|
|
9299
|
+
const header = root?.querySelector(":scope > .mx-meet__header") ?? null;
|
|
9300
|
+
if (!panel || !header) return void 0;
|
|
9301
|
+
const place = () => panel.style.setProperty("--mx-meet-panel-top", `${header.offsetHeight}px`);
|
|
9302
|
+
place();
|
|
9303
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
9304
|
+
const observer = new ResizeObserver(place);
|
|
9305
|
+
observer.observe(header);
|
|
9306
|
+
return () => observer.disconnect();
|
|
9307
|
+
}, []);
|
|
9308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("aside", { ref, className: "mx-meet__panel", "aria-label": title, children: [
|
|
9290
9309
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "mx-meet__panel-head", children: [
|
|
9291
9310
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "mx-meet__panel-title", children: title }),
|
|
9292
9311
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ControlButton, { label: "Close panel", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CloseIcon, { width: 16, height: 16 }) })
|