@liveblocks/react-ui 3.1.1 → 3.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react-ui",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -76,9 +76,9 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@floating-ui/react-dom": "^2.1.2",
79
- "@liveblocks/client": "3.1.1",
80
- "@liveblocks/core": "3.1.1",
81
- "@liveblocks/react": "3.1.1",
79
+ "@liveblocks/client": "3.1.2",
80
+ "@liveblocks/core": "3.1.2",
81
+ "@liveblocks/react": "3.1.2",
82
82
  "@radix-ui/react-dropdown-menu": "^2.1.2",
83
83
  "@radix-ui/react-popover": "^1.1.2",
84
84
  "@radix-ui/react-slot": "^1.1.0",
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- function isCommentBodyText(element) {
4
- return !("type" in element) && "text" in element && typeof element.text === "string";
5
- }
6
- function isCommentBodyMention(element) {
7
- return "type" in element && element.type === "mention";
8
- }
9
- function isCommentBodyLink(element) {
10
- return "type" in element && element.type === "link";
11
- }
12
- function toAbsoluteUrl(url) {
13
- if (url.startsWith("http://") || url.startsWith("https://")) {
14
- return url;
15
- } else if (url.startsWith("www.")) {
16
- return "https://" + url;
17
- }
18
- return;
19
- }
20
-
21
- exports.isCommentBodyLink = isCommentBodyLink;
22
- exports.isCommentBodyMention = isCommentBodyMention;
23
- exports.isCommentBodyText = isCommentBodyText;
24
- exports.toAbsoluteUrl = toAbsoluteUrl;
25
- //# sourceMappingURL=utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../src/primitives/Comment/utils.ts"],"sourcesContent":["import type {\n CommentBodyElement,\n CommentBodyLink,\n CommentBodyMention,\n CommentBodyText,\n} from \"@liveblocks/core\";\n\nexport function isCommentBodyText(\n element: CommentBodyElement\n): element is CommentBodyText {\n return (\n !(\"type\" in element) &&\n \"text\" in element &&\n typeof element.text === \"string\"\n );\n}\n\nexport function isCommentBodyMention(\n element: CommentBodyElement\n): element is CommentBodyMention {\n return \"type\" in element && element.type === \"mention\";\n}\n\nexport function isCommentBodyLink(\n element: CommentBodyElement\n): element is CommentBodyLink {\n return \"type\" in element && element.type === \"link\";\n}\n\n/**\n * Helper function to convert a URL (relative or absolute) to an absolute URL.\n *\n * @param url The URL to convert to an absolute URL (relative or absolute).\n * @returns The absolute URL or undefined if the URL is invalid.\n */\nexport function toAbsoluteUrl(url: string): string | undefined {\n // Check if the URL already contains a scheme\n if (url.startsWith(\"http://\") || url.startsWith(\"https://\")) {\n return url;\n } else if (url.startsWith(\"www.\")) {\n // If the URL starts with \"www.\", prepend \"https://\"\n return \"https://\" + url;\n }\n\n return;\n}\n"],"names":[],"mappings":";;AAOO,SAAS,kBACd,OAC4B,EAAA;AAC5B,EAAA,OACE,EAAE,MAAU,IAAA,OAAA,CAAA,IACZ,UAAU,OACV,IAAA,OAAO,QAAQ,IAAS,KAAA,QAAA,CAAA;AAE5B,CAAA;AAEO,SAAS,qBACd,OAC+B,EAAA;AAC/B,EAAO,OAAA,MAAA,IAAU,OAAW,IAAA,OAAA,CAAQ,IAAS,KAAA,SAAA,CAAA;AAC/C,CAAA;AAEO,SAAS,kBACd,OAC4B,EAAA;AAC5B,EAAO,OAAA,MAAA,IAAU,OAAW,IAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,CAAA;AAC/C,CAAA;AAQO,SAAS,cAAc,GAAiC,EAAA;AAE7D,EAAA,IAAI,IAAI,UAAW,CAAA,SAAS,KAAK,GAAI,CAAA,UAAA,CAAW,UAAU,CAAG,EAAA;AAC3D,IAAO,OAAA,GAAA,CAAA;AAAA,GACE,MAAA,IAAA,GAAA,CAAI,UAAW,CAAA,MAAM,CAAG,EAAA;AAEjC,IAAA,OAAO,UAAa,GAAA,GAAA,CAAA;AAAA,GACtB;AAEA,EAAA,OAAA;AACF;;;;;;;"}
@@ -1,20 +0,0 @@
1
- function isCommentBodyText(element) {
2
- return !("type" in element) && "text" in element && typeof element.text === "string";
3
- }
4
- function isCommentBodyMention(element) {
5
- return "type" in element && element.type === "mention";
6
- }
7
- function isCommentBodyLink(element) {
8
- return "type" in element && element.type === "link";
9
- }
10
- function toAbsoluteUrl(url) {
11
- if (url.startsWith("http://") || url.startsWith("https://")) {
12
- return url;
13
- } else if (url.startsWith("www.")) {
14
- return "https://" + url;
15
- }
16
- return;
17
- }
18
-
19
- export { isCommentBodyLink, isCommentBodyMention, isCommentBodyText, toAbsoluteUrl };
20
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/primitives/Comment/utils.ts"],"sourcesContent":["import type {\n CommentBodyElement,\n CommentBodyLink,\n CommentBodyMention,\n CommentBodyText,\n} from \"@liveblocks/core\";\n\nexport function isCommentBodyText(\n element: CommentBodyElement\n): element is CommentBodyText {\n return (\n !(\"type\" in element) &&\n \"text\" in element &&\n typeof element.text === \"string\"\n );\n}\n\nexport function isCommentBodyMention(\n element: CommentBodyElement\n): element is CommentBodyMention {\n return \"type\" in element && element.type === \"mention\";\n}\n\nexport function isCommentBodyLink(\n element: CommentBodyElement\n): element is CommentBodyLink {\n return \"type\" in element && element.type === \"link\";\n}\n\n/**\n * Helper function to convert a URL (relative or absolute) to an absolute URL.\n *\n * @param url The URL to convert to an absolute URL (relative or absolute).\n * @returns The absolute URL or undefined if the URL is invalid.\n */\nexport function toAbsoluteUrl(url: string): string | undefined {\n // Check if the URL already contains a scheme\n if (url.startsWith(\"http://\") || url.startsWith(\"https://\")) {\n return url;\n } else if (url.startsWith(\"www.\")) {\n // If the URL starts with \"www.\", prepend \"https://\"\n return \"https://\" + url;\n }\n\n return;\n}\n"],"names":[],"mappings":"AAOO,SAAS,kBACd,OAC4B,EAAA;AAC5B,EAAA,OACE,EAAE,MAAU,IAAA,OAAA,CAAA,IACZ,UAAU,OACV,IAAA,OAAO,QAAQ,IAAS,KAAA,QAAA,CAAA;AAE5B,CAAA;AAEO,SAAS,qBACd,OAC+B,EAAA;AAC/B,EAAO,OAAA,MAAA,IAAU,OAAW,IAAA,OAAA,CAAQ,IAAS,KAAA,SAAA,CAAA;AAC/C,CAAA;AAEO,SAAS,kBACd,OAC4B,EAAA;AAC5B,EAAO,OAAA,MAAA,IAAU,OAAW,IAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,CAAA;AAC/C,CAAA;AAQO,SAAS,cAAc,GAAiC,EAAA;AAE7D,EAAA,IAAI,IAAI,UAAW,CAAA,SAAS,KAAK,GAAI,CAAA,UAAA,CAAW,UAAU,CAAG,EAAA;AAC3D,IAAO,OAAA,GAAA,CAAA;AAAA,GACE,MAAA,IAAA,GAAA,CAAI,UAAW,CAAA,MAAM,CAAG,EAAA;AAEjC,IAAA,OAAO,UAAa,GAAA,GAAA,CAAA;AAAA,GACtB;AAEA,EAAA,OAAA;AACF;;;;"}
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- const PLACEHOLDER_BASE_URL = "https://localhost:9999";
4
- const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
5
- function generateURL(url, params, hash) {
6
- const isAbsolute = ABSOLUTE_URL_REGEX.test(url);
7
- const urlObject = new URL(url, isAbsolute ? void 0 : PLACEHOLDER_BASE_URL);
8
- if (params !== void 0) {
9
- for (const [param, value] of Object.entries(params)) {
10
- if (value) {
11
- urlObject.searchParams.set(param, String(value));
12
- }
13
- }
14
- }
15
- if (!urlObject.hash && hash !== void 0) {
16
- urlObject.hash = `#${hash}`;
17
- }
18
- return isAbsolute ? urlObject.href : urlObject.href.replace(PLACEHOLDER_BASE_URL, "");
19
- }
20
-
21
- exports.generateURL = generateURL;
22
- //# sourceMappingURL=url.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.cjs","sources":["../../src/utils/url.ts"],"sourcesContent":["const PLACEHOLDER_BASE_URL = \"https://localhost:9999\";\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\n\nexport function generateURL(\n url: string,\n params?: Record<string, string | number | undefined>,\n hash?: string\n) {\n const isAbsolute = ABSOLUTE_URL_REGEX.test(url);\n const urlObject = new URL(url, isAbsolute ? undefined : PLACEHOLDER_BASE_URL);\n\n if (params !== undefined) {\n for (const [param, value] of Object.entries(params)) {\n if (value) {\n urlObject.searchParams.set(param, String(value));\n }\n }\n }\n\n // Only add the new hash if the URL does not already have one\n if (!urlObject.hash && hash !== undefined) {\n urlObject.hash = `#${hash}`;\n }\n\n return isAbsolute\n ? urlObject.href\n : urlObject.href.replace(PLACEHOLDER_BASE_URL, \"\");\n}\n"],"names":[],"mappings":";;AAAA,MAAM,oBAAuB,GAAA,wBAAA,CAAA;AAC7B,MAAM,kBAAqB,GAAA,4BAAA,CAAA;AAEX,SAAA,WAAA,CACd,GACA,EAAA,MAAA,EACA,IACA,EAAA;AACA,EAAM,MAAA,UAAA,GAAa,kBAAmB,CAAA,IAAA,CAAK,GAAG,CAAA,CAAA;AAC9C,EAAA,MAAM,YAAY,IAAI,GAAA,CAAI,GAAK,EAAA,UAAA,GAAa,SAAY,oBAAoB,CAAA,CAAA;AAE5E,EAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,IAAA,KAAA,MAAW,CAAC,KAAO,EAAA,KAAK,KAAK,MAAO,CAAA,OAAA,CAAQ,MAAM,CAAG,EAAA;AACnD,MAAA,IAAI,KAAO,EAAA;AACT,QAAA,SAAA,CAAU,YAAa,CAAA,GAAA,CAAI,KAAO,EAAA,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAAA,OACjD;AAAA,KACF;AAAA,GACF;AAGA,EAAA,IAAI,CAAC,SAAA,CAAU,IAAQ,IAAA,IAAA,KAAS,KAAW,CAAA,EAAA;AACzC,IAAA,SAAA,CAAU,OAAO,CAAI,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AAAA,GACvB;AAEA,EAAA,OAAO,aACH,SAAU,CAAA,IAAA,GACV,UAAU,IAAK,CAAA,OAAA,CAAQ,sBAAsB,EAAE,CAAA,CAAA;AACrD;;;;"}
package/dist/utils/url.js DELETED
@@ -1,20 +0,0 @@
1
- const PLACEHOLDER_BASE_URL = "https://localhost:9999";
2
- const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
3
- function generateURL(url, params, hash) {
4
- const isAbsolute = ABSOLUTE_URL_REGEX.test(url);
5
- const urlObject = new URL(url, isAbsolute ? void 0 : PLACEHOLDER_BASE_URL);
6
- if (params !== void 0) {
7
- for (const [param, value] of Object.entries(params)) {
8
- if (value) {
9
- urlObject.searchParams.set(param, String(value));
10
- }
11
- }
12
- }
13
- if (!urlObject.hash && hash !== void 0) {
14
- urlObject.hash = `#${hash}`;
15
- }
16
- return isAbsolute ? urlObject.href : urlObject.href.replace(PLACEHOLDER_BASE_URL, "");
17
- }
18
-
19
- export { generateURL };
20
- //# sourceMappingURL=url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.js","sources":["../../src/utils/url.ts"],"sourcesContent":["const PLACEHOLDER_BASE_URL = \"https://localhost:9999\";\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\n\nexport function generateURL(\n url: string,\n params?: Record<string, string | number | undefined>,\n hash?: string\n) {\n const isAbsolute = ABSOLUTE_URL_REGEX.test(url);\n const urlObject = new URL(url, isAbsolute ? undefined : PLACEHOLDER_BASE_URL);\n\n if (params !== undefined) {\n for (const [param, value] of Object.entries(params)) {\n if (value) {\n urlObject.searchParams.set(param, String(value));\n }\n }\n }\n\n // Only add the new hash if the URL does not already have one\n if (!urlObject.hash && hash !== undefined) {\n urlObject.hash = `#${hash}`;\n }\n\n return isAbsolute\n ? urlObject.href\n : urlObject.href.replace(PLACEHOLDER_BASE_URL, \"\");\n}\n"],"names":[],"mappings":"AAAA,MAAM,oBAAuB,GAAA,wBAAA,CAAA;AAC7B,MAAM,kBAAqB,GAAA,4BAAA,CAAA;AAEX,SAAA,WAAA,CACd,GACA,EAAA,MAAA,EACA,IACA,EAAA;AACA,EAAM,MAAA,UAAA,GAAa,kBAAmB,CAAA,IAAA,CAAK,GAAG,CAAA,CAAA;AAC9C,EAAA,MAAM,YAAY,IAAI,GAAA,CAAI,GAAK,EAAA,UAAA,GAAa,SAAY,oBAAoB,CAAA,CAAA;AAE5E,EAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,IAAA,KAAA,MAAW,CAAC,KAAO,EAAA,KAAK,KAAK,MAAO,CAAA,OAAA,CAAQ,MAAM,CAAG,EAAA;AACnD,MAAA,IAAI,KAAO,EAAA;AACT,QAAA,SAAA,CAAU,YAAa,CAAA,GAAA,CAAI,KAAO,EAAA,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAAA,OACjD;AAAA,KACF;AAAA,GACF;AAGA,EAAA,IAAI,CAAC,SAAA,CAAU,IAAQ,IAAA,IAAA,KAAS,KAAW,CAAA,EAAA;AACzC,IAAA,SAAA,CAAU,OAAO,CAAI,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AAAA,GACvB;AAEA,EAAA,OAAO,aACH,SAAU,CAAA,IAAA,GACV,UAAU,IAAK,CAAA,OAAA,CAAQ,sBAAsB,EAAE,CAAA,CAAA;AACrD;;;;"}