@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.js
CHANGED
|
@@ -1695,7 +1695,18 @@ function withItem(collab, row, fromRoom = false) {
|
|
|
1695
1695
|
const poll = pollFromRow(row);
|
|
1696
1696
|
if (poll === null) return collab;
|
|
1697
1697
|
const known = collab.polls.find((p) => p.id === poll.id);
|
|
1698
|
-
|
|
1698
|
+
let merged = fromRoom && known !== void 0 ? { ...poll, myVote: known.myVote } : poll;
|
|
1699
|
+
if (fromRoom && known !== void 0 && !poll.options.some((o) => o.votes !== void 0)) {
|
|
1700
|
+
const counted = new Map(known.options.map((o) => [o.id, o]));
|
|
1701
|
+
merged = {
|
|
1702
|
+
...merged,
|
|
1703
|
+
voterCount: known.voterCount,
|
|
1704
|
+
options: merged.options.map((o) => {
|
|
1705
|
+
const had = counted.get(o.id);
|
|
1706
|
+
return had === void 0 ? o : { ...o, votes: had.votes, voters: had.voters };
|
|
1707
|
+
})
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1699
1710
|
return { ...collab, polls: upsert(collab.polls, merged) };
|
|
1700
1711
|
}
|
|
1701
1712
|
if (kind === "question") {
|
|
@@ -1728,13 +1739,8 @@ function without(collab, ids) {
|
|
|
1728
1739
|
}
|
|
1729
1740
|
function applyCollabPacket(collab, payload, context) {
|
|
1730
1741
|
const item = obj(payload["item"]);
|
|
1731
|
-
const audience = str(payload["audience"]);
|
|
1732
1742
|
if (item !== null) {
|
|
1733
1743
|
const kind = str(item["kind"]);
|
|
1734
|
-
const hostOnlyView = kind === "poll" || kind === "question";
|
|
1735
|
-
if (hostOnlyView && context.isHost && audience !== "hosts") {
|
|
1736
|
-
return { next: null, dropped: "the room copy of an item a host receives in full" };
|
|
1737
|
-
}
|
|
1738
1744
|
let next = withItem(collab, item, true);
|
|
1739
1745
|
if (kind === "poll" && str(item["state"]) === "live") {
|
|
1740
1746
|
const before = collab.polls.find((p) => p.id === str(item["id"]));
|
|
@@ -8982,7 +8988,20 @@ function PanelShell({
|
|
|
8982
8988
|
onClose,
|
|
8983
8989
|
children
|
|
8984
8990
|
}) {
|
|
8985
|
-
|
|
8991
|
+
const ref = useRef4(null);
|
|
8992
|
+
useLayoutEffect(() => {
|
|
8993
|
+
const panel = ref.current;
|
|
8994
|
+
const root = panel?.closest(".mx-meet");
|
|
8995
|
+
const header = root?.querySelector(":scope > .mx-meet__header") ?? null;
|
|
8996
|
+
if (!panel || !header) return void 0;
|
|
8997
|
+
const place = () => panel.style.setProperty("--mx-meet-panel-top", `${header.offsetHeight}px`);
|
|
8998
|
+
place();
|
|
8999
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
9000
|
+
const observer = new ResizeObserver(place);
|
|
9001
|
+
observer.observe(header);
|
|
9002
|
+
return () => observer.disconnect();
|
|
9003
|
+
}, []);
|
|
9004
|
+
return /* @__PURE__ */ jsxs3("aside", { ref, className: "mx-meet__panel", "aria-label": title, children: [
|
|
8986
9005
|
/* @__PURE__ */ jsxs3("header", { className: "mx-meet__panel-head", children: [
|
|
8987
9006
|
/* @__PURE__ */ jsx4("h2", { className: "mx-meet__panel-title", children: title }),
|
|
8988
9007
|
/* @__PURE__ */ jsx4(ControlButton, { label: "Close panel", onClick: onClose, children: /* @__PURE__ */ jsx4(CloseIcon, { width: 16, height: 16 }) })
|