@liveblocks/core 1.3.2 → 1.3.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/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +29 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "1.3.
|
|
9
|
+
var PKG_VERSION = "1.3.3";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -1711,7 +1711,9 @@ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
async function fetchApi(roomId2, endpoint, options) {
|
|
1713
1713
|
const authValue = await getAuthValue();
|
|
1714
|
-
const url = `${serverEndpoint}/c/rooms/${
|
|
1714
|
+
const url = `${serverEndpoint}/c/rooms/${encodeURIComponent(
|
|
1715
|
+
roomId2
|
|
1716
|
+
)}${endpoint}`;
|
|
1715
1717
|
return await fetch(url, {
|
|
1716
1718
|
...options,
|
|
1717
1719
|
headers: {
|
|
@@ -1757,7 +1759,7 @@ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
|
|
|
1757
1759
|
threadId
|
|
1758
1760
|
}) {
|
|
1759
1761
|
return fetchJson(
|
|
1760
|
-
`/threads/${threadId}/metadata`,
|
|
1762
|
+
`/threads/${encodeURIComponent(threadId)}/metadata`,
|
|
1761
1763
|
{
|
|
1762
1764
|
method: "POST",
|
|
1763
1765
|
headers: {
|
|
@@ -1772,16 +1774,19 @@ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
|
|
|
1772
1774
|
commentId,
|
|
1773
1775
|
body
|
|
1774
1776
|
}) {
|
|
1775
|
-
return fetchJson(
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
body
|
|
1783
|
-
|
|
1784
|
-
|
|
1777
|
+
return fetchJson(
|
|
1778
|
+
`/threads/${encodeURIComponent(threadId)}/comments`,
|
|
1779
|
+
{
|
|
1780
|
+
method: "POST",
|
|
1781
|
+
headers: {
|
|
1782
|
+
"Content-Type": "application/json"
|
|
1783
|
+
},
|
|
1784
|
+
body: JSON.stringify({
|
|
1785
|
+
id: commentId,
|
|
1786
|
+
body
|
|
1787
|
+
})
|
|
1788
|
+
}
|
|
1789
|
+
);
|
|
1785
1790
|
}
|
|
1786
1791
|
function editComment({
|
|
1787
1792
|
threadId,
|
|
@@ -1789,7 +1794,9 @@ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
|
|
|
1789
1794
|
body
|
|
1790
1795
|
}) {
|
|
1791
1796
|
return fetchJson(
|
|
1792
|
-
`/threads/${threadId}/comments/${
|
|
1797
|
+
`/threads/${encodeURIComponent(threadId)}/comments/${encodeURIComponent(
|
|
1798
|
+
commentId
|
|
1799
|
+
)}`,
|
|
1793
1800
|
{
|
|
1794
1801
|
method: "POST",
|
|
1795
1802
|
headers: {
|
|
@@ -1805,9 +1812,14 @@ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
|
|
|
1805
1812
|
threadId,
|
|
1806
1813
|
commentId
|
|
1807
1814
|
}) {
|
|
1808
|
-
await fetchJson(
|
|
1809
|
-
|
|
1810
|
-
|
|
1815
|
+
await fetchJson(
|
|
1816
|
+
`/threads/${encodeURIComponent(threadId)}/comments/${encodeURIComponent(
|
|
1817
|
+
commentId
|
|
1818
|
+
)}`,
|
|
1819
|
+
{
|
|
1820
|
+
method: "DELETE"
|
|
1821
|
+
}
|
|
1822
|
+
);
|
|
1811
1823
|
}
|
|
1812
1824
|
return {
|
|
1813
1825
|
getThreads,
|