@liveblocks/react-ui 3.18.2 → 3.18.3-test1
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/LICENSE +16 -0
- package/dist/_private/index.d.cts +1 -1
- package/dist/_private/index.d.ts +1 -1
- package/dist/components/AiTool.cjs.map +1 -1
- package/dist/components/AiTool.js.map +1 -1
- package/dist/components/Comment.cjs +2 -3
- package/dist/components/Comment.cjs.map +1 -1
- package/dist/components/Comment.js +2 -3
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Composer.cjs +3 -4
- package/dist/components/Composer.cjs.map +1 -1
- package/dist/components/Composer.js +3 -4
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/FloatingComposer.cjs.map +1 -1
- package/dist/components/FloatingComposer.js.map +1 -1
- package/dist/components/FloatingThread.cjs.map +1 -1
- package/dist/components/FloatingThread.js.map +1 -1
- package/dist/components/HistoryVersionSummary.cjs.map +1 -1
- package/dist/components/HistoryVersionSummary.js.map +1 -1
- package/dist/components/InboxNotification.cjs +1 -1
- package/dist/components/InboxNotification.cjs.map +1 -1
- package/dist/components/InboxNotification.js +1 -1
- package/dist/components/InboxNotification.js.map +1 -1
- package/dist/components/InboxNotificationList.cjs.map +1 -1
- package/dist/components/InboxNotificationList.js.map +1 -1
- package/dist/components/internal/AiComposer.cjs +1 -2
- package/dist/components/internal/AiComposer.cjs.map +1 -1
- package/dist/components/internal/AiComposer.js +1 -2
- package/dist/components/internal/AiComposer.js.map +1 -1
- package/dist/components/internal/Dropdown.cjs.map +1 -1
- package/dist/components/internal/Dropdown.js.map +1 -1
- package/dist/components/internal/EmojiPicker.cjs.map +1 -1
- package/dist/components/internal/EmojiPicker.js.map +1 -1
- package/dist/components/internal/Tooltip.cjs.map +1 -1
- package/dist/components/internal/Tooltip.js.map +1 -1
- package/dist/primitives/AiComposer/index.cjs +1 -2
- package/dist/primitives/AiComposer/index.cjs.map +1 -1
- package/dist/primitives/AiComposer/index.js +1 -2
- package/dist/primitives/AiComposer/index.js.map +1 -1
- package/dist/primitives/AiMessage/tool-invocation.cjs +1 -2
- package/dist/primitives/AiMessage/tool-invocation.cjs.map +1 -1
- package/dist/primitives/AiMessage/tool-invocation.js +1 -2
- package/dist/primitives/AiMessage/tool-invocation.js.map +1 -1
- package/dist/primitives/Collapsible/index.cjs +7 -14
- package/dist/primitives/Collapsible/index.cjs.map +1 -1
- package/dist/primitives/Collapsible/index.js +7 -14
- package/dist/primitives/Collapsible/index.js.map +1 -1
- package/dist/primitives/Composer/index.cjs +1 -2
- package/dist/primitives/Composer/index.cjs.map +1 -1
- package/dist/primitives/Composer/index.js +1 -2
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/slate/plugins/auto-links.cjs +7 -14
- package/dist/primitives/Composer/slate/plugins/auto-links.cjs.map +1 -1
- package/dist/primitives/Composer/slate/plugins/auto-links.js +7 -14
- package/dist/primitives/Composer/slate/plugins/auto-links.js.map +1 -1
- package/dist/primitives/Composer/utils.cjs +3 -1
- package/dist/primitives/Composer/utils.cjs.map +1 -1
- package/dist/primitives/Composer/utils.js +3 -1
- package/dist/primitives/Composer/utils.js.map +1 -1
- package/dist/primitives/Duration.cjs +0 -1
- package/dist/primitives/Duration.cjs.map +1 -1
- package/dist/primitives/Duration.js +0 -1
- package/dist/primitives/Duration.js.map +1 -1
- package/dist/primitives/FileSize.cjs.map +1 -1
- package/dist/primitives/FileSize.js.map +1 -1
- package/dist/primitives/Timestamp.cjs.map +1 -1
- package/dist/primitives/Timestamp.js.map +1 -1
- package/dist/primitives/slate/utils/get-dom-range.cjs +1 -1
- package/dist/primitives/slate/utils/get-dom-range.cjs.map +1 -1
- package/dist/primitives/slate/utils/get-dom-range.js +1 -1
- package/dist/primitives/slate/utils/get-dom-range.js.map +1 -1
- package/dist/primitives/slate/utils/get-match-range.cjs +2 -4
- package/dist/primitives/slate/utils/get-match-range.cjs.map +1 -1
- package/dist/primitives/slate/utils/get-match-range.js +2 -4
- package/dist/primitives/slate/utils/get-match-range.js.map +1 -1
- package/dist/utils/ErrorBoundary.cjs +1 -2
- package/dist/utils/ErrorBoundary.cjs.map +1 -1
- package/dist/utils/ErrorBoundary.js +1 -2
- package/dist/utils/ErrorBoundary.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +36 -28
- package/src/styles/index.css +54 -53
- package/styles/dark/attributes.css +1 -1
- package/styles/dark/attributes.css.map +1 -1
- package/styles/dark/media-query.css +1 -1
- package/styles/dark/media-query.css.map +1 -1
- package/styles.css +1 -1
- package/styles.css.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timestamp.cjs","sources":["../../src/primitives/Timestamp.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport type { ComponentPropsWithSlot } from \"../types\";\nimport { capitalize } from \"../utils/capitalize\";\nimport { dateTimeFormat, relativeTimeFormat } from \"../utils/intl\";\nimport { useInterval } from \"../utils/use-interval\";\nimport { useRerender } from \"../utils/use-rerender\";\n\nconst DYNAMIC_DATE_THRESHOLD = 3 * 24 * 60 * 60 * 1000; // 3 days\nconst RENDER_INTERVAL = 30 * 1000; // 30 seconds\n\nconst TIMESTAMP_NAME = \"Timestamp\";\n\nexport interface TimestampProps
|
|
1
|
+
{"version":3,"file":"Timestamp.cjs","sources":["../../src/primitives/Timestamp.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport type { ComponentPropsWithSlot } from \"../types\";\nimport { capitalize } from \"../utils/capitalize\";\nimport { dateTimeFormat, relativeTimeFormat } from \"../utils/intl\";\nimport { useInterval } from \"../utils/use-interval\";\nimport { useRerender } from \"../utils/use-rerender\";\n\nconst DYNAMIC_DATE_THRESHOLD = 3 * 24 * 60 * 60 * 1000; // 3 days\nconst RENDER_INTERVAL = 30 * 1000; // 30 seconds\n\nconst TIMESTAMP_NAME = \"Timestamp\";\n\nexport interface TimestampProps extends Omit<\n ComponentPropsWithSlot<\"time\">,\n \"children\" | \"title\"\n> {\n /**\n * The date to display.\n */\n date: Date | string | number;\n\n /**\n * A function to format the displayed date.\n */\n children?: (date: Date, locale?: string) => ReactNode;\n\n /**\n * The `title` attribute's value or a function to format it.\n */\n title?: string | ((date: Date, locale?: string) => string);\n\n /**\n * The interval in milliseconds at which the component will re-render.\n * Can be set to `false` to disable re-rendering.\n */\n interval?: number | false;\n\n /**\n * The locale used when formatting the date.\n */\n locale?: string;\n}\n\nconst relativeUnits = {\n seconds: 60,\n minutes: 60,\n hours: 24,\n days: 7,\n weeks: 4.34524,\n months: 12,\n};\n\n/**\n * Formats a date absolutely.\n */\nfunction formatVerboseDate(date: Date, locale?: string) {\n const formatter = dateTimeFormat(locale, {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n });\n\n return capitalize(formatter.format(date));\n}\n\n/**\n * Formats a date absolutely with only the day and month.\n */\nfunction formatShortDate(date: Date, locale?: string) {\n const formatter = dateTimeFormat(locale, {\n month: \"short\",\n day: \"numeric\",\n });\n\n return capitalize(formatter.format(date));\n}\n\n// Some locales' relative formatting can be broken (e.g. \"-1h\") when using the narrow style.\nconst localesWithBrokenNarrowRelativeFormatting = [\n \"br\",\n \"fr\",\n \"nb\",\n \"nn\",\n \"no\",\n \"ro\",\n \"sv\",\n];\n\n/**\n * Formats a date relatively.\n */\nexport function formatRelativeDate(date: Date, locale?: string) {\n let resolvedLocale: string;\n\n if (locale) {\n resolvedLocale = locale;\n } else {\n const formatter = relativeTimeFormat();\n\n resolvedLocale = formatter.resolvedOptions().locale;\n }\n\n const isBrokenWhenNarrow = localesWithBrokenNarrowRelativeFormatting.some(\n (locale) =>\n resolvedLocale === locale || resolvedLocale.startsWith(`${locale}-`)\n );\n\n const formatter = relativeTimeFormat(resolvedLocale, {\n style: isBrokenWhenNarrow ? \"short\" : \"narrow\",\n numeric: \"auto\",\n });\n\n let difference = (date.getTime() - Date.now()) / 1000;\n\n if (\n difference > -relativeUnits.seconds &&\n difference < relativeUnits.seconds\n ) {\n return formatter.format(0, \"seconds\");\n }\n\n for (const [unit, length] of Object.entries(relativeUnits)) {\n if (Math.abs(difference) < length) {\n return formatter.format(\n Math.round(difference),\n unit as Intl.RelativeTimeFormatUnit\n );\n }\n\n difference /= length;\n }\n\n return capitalize(formatter.format(Math.round(difference), \"years\"));\n}\n\n/**\n * Formats a date relatively if it's recent or soon,\n * otherwise absolutely with only the day and month.\n */\nfunction formatDynamicDate(date: Date, locale?: string) {\n return Math.abs(date.getTime() - Date.now()) <= DYNAMIC_DATE_THRESHOLD\n ? formatRelativeDate(date, locale)\n : formatShortDate(date, locale);\n}\n\n/**\n * Displays a formatted date, and automatically re-renders to support relative\n * formatting. Defaults to relative formatting for nearby dates and a short\n * absolute formatting for more distant ones.\n *\n * @example\n * <Timestamp date={new Date()} />\n *\n * @example\n * <Timestamp date={new Date()} title={(date) => date.toISOString()} interval={false}>\n * {(date) => date.toLocaleDateString()}\n * </Timestamp>\n */\nexport const Timestamp = forwardRef<HTMLTimeElement, TimestampProps>(\n (\n {\n date,\n locale,\n children: renderChildren = formatDynamicDate,\n title: renderTitle = formatVerboseDate,\n dateTime,\n interval = RENDER_INTERVAL,\n asChild,\n ...props\n },\n forwardedRef\n ) => {\n const Component = asChild ? SlotPrimitive.Slot : \"time\";\n const [rerender, key] = useRerender();\n const parsedDate = useMemo(() => new Date(date), [date]);\n const normalizedDate = useMemo(\n () => parsedDate.toISOString(),\n [parsedDate]\n );\n const title = useMemo(\n () =>\n typeof renderTitle === \"function\"\n ? renderTitle(parsedDate, locale)\n : renderTitle,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [renderTitle, parsedDate, locale, key]\n );\n const children = useMemo(\n () =>\n typeof renderChildren === \"function\"\n ? renderChildren(parsedDate, locale)\n : renderChildren,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [renderChildren, parsedDate, locale, key]\n );\n\n useInterval(rerender, interval);\n\n return (\n <Component\n {...props}\n ref={forwardedRef}\n dateTime={dateTime ?? normalizedDate}\n title={title}\n >\n {children}\n </Component>\n );\n }\n);\n\nif (process.env.NODE_ENV !== \"production\") {\n Timestamp.displayName = TIMESTAMP_NAME;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA;AACA;AAEA;AAiCA;AAAsB;AACX;AACA;AACF;AACD;AACC;AAET;AAKA;AACE;AAAyC;AACjC;AACC;AACF;AACC;AACE;AAGV;AACF;AAKA;AACE;AAAyC;AAChC;AACF;AAGP;AACF;AAGA;AAAkD;AAChD;AACA;AACA;AACA;AACA;AACA;AAEF;AAKgB;AACd;AAEA;AACE;AAAiB;AAEjB;AAEA;AAA6C;AAG/C;AAAqE;AAEE;AAGvE;AAAqD;AACb;AAC7B;AAGX;AAEA;AAIE;AAAoC;AAGtC;AACE;AACE;AAAiB;AACM;AACrB;AACF;AAGF;AAAc;AAGhB;AACF;AAMA;AACE;AAGF;AAeO;AAAkB;AAErB;AACE;AACA;AAC2B;AACN;AACrB;AACW;AACX;AACG;AAIL;AACA;AACA;AACA;AAAuB;AACQ;AAClB;AAEb;AAAc;AAIN;AAAA;AAE+B;AAEvC;AAAiB;AAIT;AAAA;AAEkC;AAG1C;AAEA;AACE;AAAC;AAAA;AACK;AACC;AACiB;AACtB;AAEC;AAAA;AACH;AAGN;AAEA;AACE;AACF;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timestamp.js","sources":["../../src/primitives/Timestamp.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport type { ComponentPropsWithSlot } from \"../types\";\nimport { capitalize } from \"../utils/capitalize\";\nimport { dateTimeFormat, relativeTimeFormat } from \"../utils/intl\";\nimport { useInterval } from \"../utils/use-interval\";\nimport { useRerender } from \"../utils/use-rerender\";\n\nconst DYNAMIC_DATE_THRESHOLD = 3 * 24 * 60 * 60 * 1000; // 3 days\nconst RENDER_INTERVAL = 30 * 1000; // 30 seconds\n\nconst TIMESTAMP_NAME = \"Timestamp\";\n\nexport interface TimestampProps
|
|
1
|
+
{"version":3,"file":"Timestamp.js","sources":["../../src/primitives/Timestamp.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport type { ComponentPropsWithSlot } from \"../types\";\nimport { capitalize } from \"../utils/capitalize\";\nimport { dateTimeFormat, relativeTimeFormat } from \"../utils/intl\";\nimport { useInterval } from \"../utils/use-interval\";\nimport { useRerender } from \"../utils/use-rerender\";\n\nconst DYNAMIC_DATE_THRESHOLD = 3 * 24 * 60 * 60 * 1000; // 3 days\nconst RENDER_INTERVAL = 30 * 1000; // 30 seconds\n\nconst TIMESTAMP_NAME = \"Timestamp\";\n\nexport interface TimestampProps extends Omit<\n ComponentPropsWithSlot<\"time\">,\n \"children\" | \"title\"\n> {\n /**\n * The date to display.\n */\n date: Date | string | number;\n\n /**\n * A function to format the displayed date.\n */\n children?: (date: Date, locale?: string) => ReactNode;\n\n /**\n * The `title` attribute's value or a function to format it.\n */\n title?: string | ((date: Date, locale?: string) => string);\n\n /**\n * The interval in milliseconds at which the component will re-render.\n * Can be set to `false` to disable re-rendering.\n */\n interval?: number | false;\n\n /**\n * The locale used when formatting the date.\n */\n locale?: string;\n}\n\nconst relativeUnits = {\n seconds: 60,\n minutes: 60,\n hours: 24,\n days: 7,\n weeks: 4.34524,\n months: 12,\n};\n\n/**\n * Formats a date absolutely.\n */\nfunction formatVerboseDate(date: Date, locale?: string) {\n const formatter = dateTimeFormat(locale, {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n });\n\n return capitalize(formatter.format(date));\n}\n\n/**\n * Formats a date absolutely with only the day and month.\n */\nfunction formatShortDate(date: Date, locale?: string) {\n const formatter = dateTimeFormat(locale, {\n month: \"short\",\n day: \"numeric\",\n });\n\n return capitalize(formatter.format(date));\n}\n\n// Some locales' relative formatting can be broken (e.g. \"-1h\") when using the narrow style.\nconst localesWithBrokenNarrowRelativeFormatting = [\n \"br\",\n \"fr\",\n \"nb\",\n \"nn\",\n \"no\",\n \"ro\",\n \"sv\",\n];\n\n/**\n * Formats a date relatively.\n */\nexport function formatRelativeDate(date: Date, locale?: string) {\n let resolvedLocale: string;\n\n if (locale) {\n resolvedLocale = locale;\n } else {\n const formatter = relativeTimeFormat();\n\n resolvedLocale = formatter.resolvedOptions().locale;\n }\n\n const isBrokenWhenNarrow = localesWithBrokenNarrowRelativeFormatting.some(\n (locale) =>\n resolvedLocale === locale || resolvedLocale.startsWith(`${locale}-`)\n );\n\n const formatter = relativeTimeFormat(resolvedLocale, {\n style: isBrokenWhenNarrow ? \"short\" : \"narrow\",\n numeric: \"auto\",\n });\n\n let difference = (date.getTime() - Date.now()) / 1000;\n\n if (\n difference > -relativeUnits.seconds &&\n difference < relativeUnits.seconds\n ) {\n return formatter.format(0, \"seconds\");\n }\n\n for (const [unit, length] of Object.entries(relativeUnits)) {\n if (Math.abs(difference) < length) {\n return formatter.format(\n Math.round(difference),\n unit as Intl.RelativeTimeFormatUnit\n );\n }\n\n difference /= length;\n }\n\n return capitalize(formatter.format(Math.round(difference), \"years\"));\n}\n\n/**\n * Formats a date relatively if it's recent or soon,\n * otherwise absolutely with only the day and month.\n */\nfunction formatDynamicDate(date: Date, locale?: string) {\n return Math.abs(date.getTime() - Date.now()) <= DYNAMIC_DATE_THRESHOLD\n ? formatRelativeDate(date, locale)\n : formatShortDate(date, locale);\n}\n\n/**\n * Displays a formatted date, and automatically re-renders to support relative\n * formatting. Defaults to relative formatting for nearby dates and a short\n * absolute formatting for more distant ones.\n *\n * @example\n * <Timestamp date={new Date()} />\n *\n * @example\n * <Timestamp date={new Date()} title={(date) => date.toISOString()} interval={false}>\n * {(date) => date.toLocaleDateString()}\n * </Timestamp>\n */\nexport const Timestamp = forwardRef<HTMLTimeElement, TimestampProps>(\n (\n {\n date,\n locale,\n children: renderChildren = formatDynamicDate,\n title: renderTitle = formatVerboseDate,\n dateTime,\n interval = RENDER_INTERVAL,\n asChild,\n ...props\n },\n forwardedRef\n ) => {\n const Component = asChild ? SlotPrimitive.Slot : \"time\";\n const [rerender, key] = useRerender();\n const parsedDate = useMemo(() => new Date(date), [date]);\n const normalizedDate = useMemo(\n () => parsedDate.toISOString(),\n [parsedDate]\n );\n const title = useMemo(\n () =>\n typeof renderTitle === \"function\"\n ? renderTitle(parsedDate, locale)\n : renderTitle,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [renderTitle, parsedDate, locale, key]\n );\n const children = useMemo(\n () =>\n typeof renderChildren === \"function\"\n ? renderChildren(parsedDate, locale)\n : renderChildren,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [renderChildren, parsedDate, locale, key]\n );\n\n useInterval(rerender, interval);\n\n return (\n <Component\n {...props}\n ref={forwardedRef}\n dateTime={dateTime ?? normalizedDate}\n title={title}\n >\n {children}\n </Component>\n );\n }\n);\n\nif (process.env.NODE_ENV !== \"production\") {\n Timestamp.displayName = TIMESTAMP_NAME;\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;AACA;AAEA;AAiCA;AAAsB;AACX;AACA;AACF;AACD;AACC;AAET;AAKA;AACE;AAAyC;AACjC;AACC;AACF;AACC;AACE;AAGV;AACF;AAKA;AACE;AAAyC;AAChC;AACF;AAGP;AACF;AAGA;AAAkD;AAChD;AACA;AACA;AACA;AACA;AACA;AAEF;AAKgB;AACd;AAEA;AACE;AAAiB;AAEjB;AAEA;AAA6C;AAG/C;AAAqE;AAEE;AAGvE;AAAqD;AACb;AAC7B;AAGX;AAEA;AAIE;AAAoC;AAGtC;AACE;AACE;AAAiB;AACM;AACrB;AACF;AAGF;AAAc;AAGhB;AACF;AAMA;AACE;AAGF;AAeO;AAAkB;AAErB;AACE;AACA;AAC2B;AACN;AACrB;AACW;AACX;AACG;AAIL;AACA;AACA;AACA;AAAuB;AACQ;AAClB;AAEb;AAAc;AAIN;AAAA;AAE+B;AAEvC;AAAiB;AAIT;AAAA;AAEkC;AAG1C;AAEA;AACE;AAAC;AAAA;AACK;AACC;AACiB;AACtB;AAEC;AAAA;AACH;AAGN;AAEA;AACE;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dom-range.cjs","sources":["../../../../src/primitives/slate/utils/get-dom-range.ts"],"sourcesContent":["import type { Editor as SlateEditor, Range as SlateRange } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\n\nconst MAX_RETRIES = 3;\n\nexport function getDOMRange(\n editor: SlateEditor,\n range: SlateRange,\n retries: number = MAX_RETRIES\n): Range | undefined {\n if (retries <= 0) {\n return;\n }\n\n try {\n return ReactEditor.toDOMRange(editor, range);\n } catch
|
|
1
|
+
{"version":3,"file":"get-dom-range.cjs","sources":["../../../../src/primitives/slate/utils/get-dom-range.ts"],"sourcesContent":["import type { Editor as SlateEditor, Range as SlateRange } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\n\nconst MAX_RETRIES = 3;\n\nexport function getDOMRange(\n editor: SlateEditor,\n range: SlateRange,\n retries: number = MAX_RETRIES\n): Range | undefined {\n if (retries <= 0) {\n return;\n }\n\n try {\n return ReactEditor.toDOMRange(editor, range);\n } catch {\n return getDOMRange(\n editor,\n {\n anchor: range.anchor,\n focus: range.anchor,\n },\n retries - 1\n );\n }\n}\n"],"names":["ReactEditor"],"mappings":";;;;AAGA,MAAM,WAAc,GAAA,CAAA,CAAA;AAEb,SAAS,WACd,CAAA,MAAA,EACA,KACA,EAAA,OAAA,GAAkB,WACC,EAAA;AACnB,EAAA,IAAI,WAAW,CAAG,EAAA;AAChB,IAAA,OAAA;AAAA,GACF;AAEA,EAAI,IAAA;AACF,IAAO,OAAAA,sBAAA,CAAY,UAAW,CAAA,MAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,GACrC,CAAA,MAAA;AACN,IAAO,OAAA,WAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA,QACE,QAAQ,KAAM,CAAA,MAAA;AAAA,QACd,OAAO,KAAM,CAAA,MAAA;AAAA,OACf;AAAA,MACA,OAAU,GAAA,CAAA;AAAA,KACZ,CAAA;AAAA,GACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dom-range.js","sources":["../../../../src/primitives/slate/utils/get-dom-range.ts"],"sourcesContent":["import type { Editor as SlateEditor, Range as SlateRange } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\n\nconst MAX_RETRIES = 3;\n\nexport function getDOMRange(\n editor: SlateEditor,\n range: SlateRange,\n retries: number = MAX_RETRIES\n): Range | undefined {\n if (retries <= 0) {\n return;\n }\n\n try {\n return ReactEditor.toDOMRange(editor, range);\n } catch
|
|
1
|
+
{"version":3,"file":"get-dom-range.js","sources":["../../../../src/primitives/slate/utils/get-dom-range.ts"],"sourcesContent":["import type { Editor as SlateEditor, Range as SlateRange } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\n\nconst MAX_RETRIES = 3;\n\nexport function getDOMRange(\n editor: SlateEditor,\n range: SlateRange,\n retries: number = MAX_RETRIES\n): Range | undefined {\n if (retries <= 0) {\n return;\n }\n\n try {\n return ReactEditor.toDOMRange(editor, range);\n } catch {\n return getDOMRange(\n editor,\n {\n anchor: range.anchor,\n focus: range.anchor,\n },\n retries - 1\n );\n }\n}\n"],"names":[],"mappings":";;AAGA,MAAM,WAAc,GAAA,CAAA,CAAA;AAEb,SAAS,WACd,CAAA,MAAA,EACA,KACA,EAAA,OAAA,GAAkB,WACC,EAAA;AACnB,EAAA,IAAI,WAAW,CAAG,EAAA;AAChB,IAAA,OAAA;AAAA,GACF;AAEA,EAAI,IAAA;AACF,IAAO,OAAA,WAAA,CAAY,UAAW,CAAA,MAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,GACrC,CAAA,MAAA;AACN,IAAO,OAAA,WAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA,QACE,QAAQ,KAAM,CAAA,MAAA;AAAA,QACd,OAAO,KAAM,CAAA,MAAA;AAAA,OACf;AAAA,MACA,OAAU,GAAA,CAAA;AAAA,KACZ,CAAA;AAAA,GACF;AACF;;;;"}
|
|
@@ -41,14 +41,12 @@ function getMatchRange(editor, at, terminators = [" "], options = defaultOptions
|
|
|
41
41
|
}
|
|
42
42
|
if (direction !== "before") {
|
|
43
43
|
point = end;
|
|
44
|
-
while (move("after"))
|
|
45
|
-
;
|
|
44
|
+
while (move("after")) ;
|
|
46
45
|
end = point;
|
|
47
46
|
}
|
|
48
47
|
if (direction !== "after") {
|
|
49
48
|
point = start;
|
|
50
|
-
while (move("before"))
|
|
51
|
-
;
|
|
49
|
+
while (move("before")) ;
|
|
52
50
|
start = point;
|
|
53
51
|
}
|
|
54
52
|
if (include) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-match-range.cjs","sources":["../../../../src/primitives/slate/utils/get-match-range.ts"],"sourcesContent":["import type { Point as SlatePoint } from \"slate\";\nimport {\n Editor as SlateEditor,\n Path as SlatePath,\n Range as SlateRange,\n} from \"slate\";\n\nimport { isWhitespaceCharacter } from \"./is-whitespace-character\";\n\ninterface Options {\n include?: boolean;\n direction?: \"before\" | \"after\" | \"both\";\n allowConsecutiveWhitespace?: boolean;\n ignoreTerminator?: (\n character: string,\n point: SlatePoint,\n direction: \"before\" | \"after\"\n ) => boolean;\n}\n\nconst defaultOptions: Options = {\n direction: \"before\",\n allowConsecutiveWhitespace: true,\n};\n\nexport function getMatchRange(\n editor: SlateEditor,\n at: SlateRange,\n terminators: string[] = [\" \"],\n options: Options = defaultOptions\n): SlateRange | undefined {\n const { include, direction, ignoreTerminator, allowConsecutiveWhitespace } = {\n ...defaultOptions,\n ...options,\n };\n\n let [start, end] = SlateRange.edges(at);\n let point: SlatePoint = start;\n let previousCharacterWasWhitespace = false;\n\n function move(direction: \"before\" | \"after\"): boolean {\n const nextPoint =\n direction === \"after\"\n ? SlateEditor.after(editor, point, { unit: \"character\" })\n : SlateEditor.before(editor, point, { unit: \"character\" });\n\n // Stop if we reached the end of a block\n if (!nextPoint || SlatePath.compare(nextPoint.path, point.path) !== 0) {\n return false;\n }\n\n const nextCharacter =\n nextPoint &&\n SlateEditor.string(\n editor,\n direction === \"after\"\n ? { anchor: point, focus: nextPoint }\n : { anchor: nextPoint, focus: point }\n );\n const lastCharacter =\n nextCharacter &&\n nextCharacter[direction === \"after\" ? 0 : nextCharacter.length - 1];\n\n if (\n !allowConsecutiveWhitespace &&\n previousCharacterWasWhitespace &&\n isWhitespaceCharacter(lastCharacter)\n ) {\n return false;\n }\n\n if (\n nextPoint &&\n lastCharacter &&\n (!terminators.includes(lastCharacter) ||\n ignoreTerminator?.(lastCharacter, nextPoint, direction))\n ) {\n previousCharacterWasWhitespace = isWhitespaceCharacter(lastCharacter);\n point = nextPoint;\n\n if (point.offset === 0) {\n return false;\n }\n } else {\n return false;\n }\n\n return true;\n }\n\n if (direction !== \"before\") {\n point = end;\n while (move(\"after\"));\n end = point;\n }\n\n if (direction !== \"after\") {\n point = start;\n while (move(\"before\"));\n start = point;\n }\n\n if (include) {\n return {\n anchor:\n direction === \"before\" || direction === \"both\"\n ? (SlateEditor.before(editor, start, { unit: \"offset\" }) ?? start)\n : start,\n focus:\n direction === \"after\" || direction === \"both\"\n ? (SlateEditor.after(editor, end, { unit: \"offset\" }) ?? end)\n : end,\n };\n }\n\n return { anchor: start, focus: end };\n}\n"],"names":["SlateRange","direction","SlateEditor","SlatePath","isWhitespaceCharacter"],"mappings":";;;;;AAoBA,MAAM,cAA0B,GAAA;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CAAC,CAAA,CAAA;AAEpE,IAAA,IACE,CAAC,0BAAA,IACD,8BACA,IAAAG,2CAAA,CAAsB,aAAa,CACnC,EAAA;AACA,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IACE,IAAA,SAAA,IACA,aACC,KAAA,CAAC,WAAY,CAAA,QAAA,CAAS,aAAa,CAAA,IAClC,gBAAmB,GAAA,aAAA,EAAe,SAAWH,EAAAA,UAAS,CACxD,CAAA,EAAA;AACA,MAAA,8BAAA,GAAiCG,4CAAsB,aAAa,CAAA,CAAA;AACpE,MAAQ,KAAA,GAAA,SAAA,CAAA;AAER,MAAI,IAAA,KAAA,CAAM,WAAW,CAAG,EAAA;AACtB,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACK,MAAA;AACL,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAA,IAAI,cAAc,QAAU,EAAA;AAC1B,IAAQ,KAAA,GAAA,GAAA,CAAA;AACR,IAAA,
|
|
1
|
+
{"version":3,"file":"get-match-range.cjs","sources":["../../../../src/primitives/slate/utils/get-match-range.ts"],"sourcesContent":["import type { Point as SlatePoint } from \"slate\";\nimport {\n Editor as SlateEditor,\n Path as SlatePath,\n Range as SlateRange,\n} from \"slate\";\n\nimport { isWhitespaceCharacter } from \"./is-whitespace-character\";\n\ninterface Options {\n include?: boolean;\n direction?: \"before\" | \"after\" | \"both\";\n allowConsecutiveWhitespace?: boolean;\n ignoreTerminator?: (\n character: string,\n point: SlatePoint,\n direction: \"before\" | \"after\"\n ) => boolean;\n}\n\nconst defaultOptions: Options = {\n direction: \"before\",\n allowConsecutiveWhitespace: true,\n};\n\nexport function getMatchRange(\n editor: SlateEditor,\n at: SlateRange,\n terminators: string[] = [\" \"],\n options: Options = defaultOptions\n): SlateRange | undefined {\n const { include, direction, ignoreTerminator, allowConsecutiveWhitespace } = {\n ...defaultOptions,\n ...options,\n };\n\n let [start, end] = SlateRange.edges(at);\n let point: SlatePoint = start;\n let previousCharacterWasWhitespace = false;\n\n function move(direction: \"before\" | \"after\"): boolean {\n const nextPoint =\n direction === \"after\"\n ? SlateEditor.after(editor, point, { unit: \"character\" })\n : SlateEditor.before(editor, point, { unit: \"character\" });\n\n // Stop if we reached the end of a block\n if (!nextPoint || SlatePath.compare(nextPoint.path, point.path) !== 0) {\n return false;\n }\n\n const nextCharacter =\n nextPoint &&\n SlateEditor.string(\n editor,\n direction === \"after\"\n ? { anchor: point, focus: nextPoint }\n : { anchor: nextPoint, focus: point }\n );\n const lastCharacter =\n nextCharacter &&\n nextCharacter[direction === \"after\" ? 0 : nextCharacter.length - 1];\n\n if (\n !allowConsecutiveWhitespace &&\n previousCharacterWasWhitespace &&\n isWhitespaceCharacter(lastCharacter)\n ) {\n return false;\n }\n\n if (\n nextPoint &&\n lastCharacter &&\n (!terminators.includes(lastCharacter) ||\n ignoreTerminator?.(lastCharacter, nextPoint, direction))\n ) {\n previousCharacterWasWhitespace = isWhitespaceCharacter(lastCharacter);\n point = nextPoint;\n\n if (point.offset === 0) {\n return false;\n }\n } else {\n return false;\n }\n\n return true;\n }\n\n if (direction !== \"before\") {\n point = end;\n while (move(\"after\"));\n end = point;\n }\n\n if (direction !== \"after\") {\n point = start;\n while (move(\"before\"));\n start = point;\n }\n\n if (include) {\n return {\n anchor:\n direction === \"before\" || direction === \"both\"\n ? (SlateEditor.before(editor, start, { unit: \"offset\" }) ?? start)\n : start,\n focus:\n direction === \"after\" || direction === \"both\"\n ? (SlateEditor.after(editor, end, { unit: \"offset\" }) ?? end)\n : end,\n };\n }\n\n return { anchor: start, focus: end };\n}\n"],"names":["SlateRange","direction","SlateEditor","SlatePath","isWhitespaceCharacter"],"mappings":";;;;;AAoBA,MAAM,cAA0B,GAAA;AAAA,EAC9B,SAAW,EAAA,QAAA;AAAA,EACX,0BAA4B,EAAA,IAAA;AAC9B,CAAA,CAAA;AAEgB,SAAA,aAAA,CACd,QACA,EAC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O,EAAE,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,GAAI,EAAA,CAAA;AACrC;;;;"}
|
|
@@ -39,14 +39,12 @@ function getMatchRange(editor, at, terminators = [" "], options = defaultOptions
|
|
|
39
39
|
}
|
|
40
40
|
if (direction !== "before") {
|
|
41
41
|
point = end;
|
|
42
|
-
while (move("after"))
|
|
43
|
-
;
|
|
42
|
+
while (move("after")) ;
|
|
44
43
|
end = point;
|
|
45
44
|
}
|
|
46
45
|
if (direction !== "after") {
|
|
47
46
|
point = start;
|
|
48
|
-
while (move("before"))
|
|
49
|
-
;
|
|
47
|
+
while (move("before")) ;
|
|
50
48
|
start = point;
|
|
51
49
|
}
|
|
52
50
|
if (include) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-match-range.js","sources":["../../../../src/primitives/slate/utils/get-match-range.ts"],"sourcesContent":["import type { Point as SlatePoint } from \"slate\";\nimport {\n Editor as SlateEditor,\n Path as SlatePath,\n Range as SlateRange,\n} from \"slate\";\n\nimport { isWhitespaceCharacter } from \"./is-whitespace-character\";\n\ninterface Options {\n include?: boolean;\n direction?: \"before\" | \"after\" | \"both\";\n allowConsecutiveWhitespace?: boolean;\n ignoreTerminator?: (\n character: string,\n point: SlatePoint,\n direction: \"before\" | \"after\"\n ) => boolean;\n}\n\nconst defaultOptions: Options = {\n direction: \"before\",\n allowConsecutiveWhitespace: true,\n};\n\nexport function getMatchRange(\n editor: SlateEditor,\n at: SlateRange,\n terminators: string[] = [\" \"],\n options: Options = defaultOptions\n): SlateRange | undefined {\n const { include, direction, ignoreTerminator, allowConsecutiveWhitespace } = {\n ...defaultOptions,\n ...options,\n };\n\n let [start, end] = SlateRange.edges(at);\n let point: SlatePoint = start;\n let previousCharacterWasWhitespace = false;\n\n function move(direction: \"before\" | \"after\"): boolean {\n const nextPoint =\n direction === \"after\"\n ? SlateEditor.after(editor, point, { unit: \"character\" })\n : SlateEditor.before(editor, point, { unit: \"character\" });\n\n // Stop if we reached the end of a block\n if (!nextPoint || SlatePath.compare(nextPoint.path, point.path) !== 0) {\n return false;\n }\n\n const nextCharacter =\n nextPoint &&\n SlateEditor.string(\n editor,\n direction === \"after\"\n ? { anchor: point, focus: nextPoint }\n : { anchor: nextPoint, focus: point }\n );\n const lastCharacter =\n nextCharacter &&\n nextCharacter[direction === \"after\" ? 0 : nextCharacter.length - 1];\n\n if (\n !allowConsecutiveWhitespace &&\n previousCharacterWasWhitespace &&\n isWhitespaceCharacter(lastCharacter)\n ) {\n return false;\n }\n\n if (\n nextPoint &&\n lastCharacter &&\n (!terminators.includes(lastCharacter) ||\n ignoreTerminator?.(lastCharacter, nextPoint, direction))\n ) {\n previousCharacterWasWhitespace = isWhitespaceCharacter(lastCharacter);\n point = nextPoint;\n\n if (point.offset === 0) {\n return false;\n }\n } else {\n return false;\n }\n\n return true;\n }\n\n if (direction !== \"before\") {\n point = end;\n while (move(\"after\"));\n end = point;\n }\n\n if (direction !== \"after\") {\n point = start;\n while (move(\"before\"));\n start = point;\n }\n\n if (include) {\n return {\n anchor:\n direction === \"before\" || direction === \"both\"\n ? (SlateEditor.before(editor, start, { unit: \"offset\" }) ?? start)\n : start,\n focus:\n direction === \"after\" || direction === \"both\"\n ? (SlateEditor.after(editor, end, { unit: \"offset\" }) ?? end)\n : end,\n };\n }\n\n return { anchor: start, focus: end };\n}\n"],"names":["SlateRange","direction","SlateEditor","SlatePath"],"mappings":";;;AAoBA,MAAM,cAA0B,GAAA;AAAA,EAC9B,SAAW,EAAA,QAAA;AAAA,EACX,0BAA4B,EAAA,IAAA;AAC9B,CAAA,CAAA;AAEgB,SAAA,aAAA,CACd,QACA,EACA,EAAA,WAAA,GAAwB,CAAC,GAAG,CAAA,EAC5B,UAAmB,cACK,EAAA;AACxB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAW,EAAA,gBAAA,EAAkB,4BAA+B,GAAA;AAAA,IAC3E,GAAG,cAAA;AAAA,IACH,GAAG,OAAA;AAAA,GACL,CAAA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AsB,aAAa,CAAA,CAAA;AACpE,MAAQ,KAAA,GAAA,SAAA,CAAA;AAER,MAAI,IAAA,KAAA,CAAM,WAAW,CAAG,EAAA;AACtB,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAAA,KACK,MAAA;AACL,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAA,IAAI,cAAc,QAAU,EAAA;AAC1B,IAAQ,KAAA,GAAA,GAAA,CAAA;AACR,IAAA,
|
|
1
|
+
{"version":3,"file":"get-match-range.js","sources":["../../../../src/primitives/slate/utils/get-match-range.ts"],"sourcesContent":["import type { Point as SlatePoint } from \"slate\";\nimport {\n Editor as SlateEditor,\n Path as SlatePath,\n Range as SlateRange,\n} from \"slate\";\n\nimport { isWhitespaceCharacter } from \"./is-whitespace-character\";\n\ninterface Options {\n include?: boolean;\n direction?: \"before\" | \"after\" | \"both\";\n allowConsecutiveWhitespace?: boolean;\n ignoreTerminator?: (\n character: string,\n point: SlatePoint,\n direction: \"before\" | \"after\"\n ) => boolean;\n}\n\nconst defaultOptions: Options = {\n direction: \"before\",\n allowConsecutiveWhitespace: true,\n};\n\nexport function getMatchRange(\n editor: SlateEditor,\n at: SlateRange,\n terminators: string[] = [\" \"],\n options: Options = defaultOptions\n): SlateRange | undefined {\n const { include, direction, ignoreTerminator, allowConsecutiveWhitespace } = {\n ...defaultOptions,\n ...options,\n };\n\n let [start, end] = SlateRange.edges(at);\n let point: SlatePoint = start;\n let previousCharacterWasWhitespace = false;\n\n function move(direction: \"before\" | \"after\"): boolean {\n const nextPoint =\n direction === \"after\"\n ? SlateEditor.after(editor, point, { unit: \"character\" })\n : SlateEditor.before(editor, point, { unit: \"character\" });\n\n // Stop if we reached the end of a block\n if (!nextPoint || SlatePath.compare(nextPoint.path, point.path) !== 0) {\n return false;\n }\n\n const nextCharacter =\n nextPoint &&\n SlateEditor.string(\n editor,\n direction === \"after\"\n ? { anchor: point, focus: nextPoint }\n : { anchor: nextPoint, focus: point }\n );\n const lastCharacter =\n nextCharacter &&\n nextCharacter[direction === \"after\" ? 0 : nextCharacter.length - 1];\n\n if (\n !allowConsecutiveWhitespace &&\n previousCharacterWasWhitespace &&\n isWhitespaceCharacter(lastCharacter)\n ) {\n return false;\n }\n\n if (\n nextPoint &&\n lastCharacter &&\n (!terminators.includes(lastCharacter) ||\n ignoreTerminator?.(lastCharacter, nextPoint, direction))\n ) {\n previousCharacterWasWhitespace = isWhitespaceCharacter(lastCharacter);\n point = nextPoint;\n\n if (point.offset === 0) {\n return false;\n }\n } else {\n return false;\n }\n\n return true;\n }\n\n if (direction !== \"before\") {\n point = end;\n while (move(\"after\"));\n end = point;\n }\n\n if (direction !== \"after\") {\n point = start;\n while (move(\"before\"));\n start = point;\n }\n\n if (include) {\n return {\n anchor:\n direction === \"before\" || direction === \"both\"\n ? (SlateEditor.before(editor, start, { unit: \"offset\" }) ?? start)\n : start,\n focus:\n direction === \"after\" || direction === \"both\"\n ? (SlateEditor.after(editor, end, { unit: \"offset\" }) ?? end)\n : end,\n };\n }\n\n return { anchor: start, focus: end };\n}\n"],"names":["SlateRange","direction","SlateEditor","SlatePath"],"mappings":";;;AAoBA,MAAM,cAA0B,GAAA;AAAA,EAC9B,SAAW,EAAA,QAAA;AAAA,EACX,0BAA4B,EAAA,IAAA;AAC9B,CAAA,CAAA;AAEgB,SAAA,aAAA,CACd,QACA,EACA,EAAA,WAAA,GAAwB,CAAC,GAAG,CAAA,EAC5B,UAAmB,cACK,EAAA;AACxB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAW,EAAA,gBAAA,EAAkB,4BAA+B,GAAA;AAAA,IAC3E,GAAG,cAAA;AAAA,IACH,GAAG,OAAA;AAAA,GACL,CAAA;AAEA,EAAA,IAAI,CAAC,KAAO,EAAA,GAAG,CAAI,GAAAA,KAAA,CAAW,MAAM,EAAE,CAAA,CAAA;AACtC,EAAA,IAAI,KAAoB,GAAA,KAAA,CAAA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A;AAAA,OACT;AAAA,KACK,MAAA;AACL,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAA,IAAI,cAAc,QAAU,EAAA;AAC1B,IAAQ,KAAA,GAAA,GAAA,CAAA;AACR,IAAO,OAAA,IAAA,CAAK,OAAO,CAAE,EAAA,CAAA;AACrB,IAAM,GAAA,GAAA,KAAA,CAAA;AAAA,GACR;AAEA,EAAA,IAAI,cAAc,OAAS,EAAA;AACzB,IAAQ,KAAA,GAAA,KAAA,CAAA;AACR,IAAO,OAAA,IAAA,CAAK,QAAQ,CAAE,EAAA,CAAA;AACtB,IAAQ,KAAA,GAAA,KAAA,CAAA;AAAA,GACV;AAEA,EAAA,IAAI,OAAS,EAAA;AACX,IAAO,OAAA;AAAA,MACL,MACE,EAAA,SAAA,KAAc,QAAY,IAAA,SAAA,KAAc,SACnCC,MAAY,CAAA,MAAA,CAAO,MAAQ,EAAA,KAAA,EAAO,EAAE,IAAA,EAAM,QAAS,EAAC,KAAK,KAC1D,GAAA,KAAA;AAAA,MACN,KACE,EAAA,SAAA,KAAc,OAAW,IAAA,SAAA,KAAc,SAClCA,MAAY,CAAA,KAAA,CAAM,MAAQ,EAAA,GAAA,EAAK,EAAE,IAAA,EAAM,QAAS,EAAC,KAAK,GACvD,GAAA,GAAA;AAAA,KACR,CAAA;AAAA,GACF;AAEA,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAO,EAAA,KAAA,EAAO,GAAI,EAAA,CAAA;AACrC;;;;"}
|
|
@@ -19,8 +19,7 @@ class ErrorBoundary extends react.Component {
|
|
|
19
19
|
this.setState({ error: null });
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
if (this.state.error === null)
|
|
23
|
-
return this.props.children;
|
|
22
|
+
if (this.state.error === null) return this.props.children;
|
|
24
23
|
const error = this.state.error;
|
|
25
24
|
const reset = this.reset.bind(this);
|
|
26
25
|
const fallback = this.props.fallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.cjs","sources":["../../src/utils/ErrorBoundary.tsx"],"sourcesContent":["import type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport { Component, createContext, useContext } from \"react\";\n\nconst ErrorBoundaryContext = createContext<{\n error: Error;\n reset: () => void;\n} | null>(null);\n\nexport interface ErrorBoundaryProps {\n children?: ReactNode;\n fallback?: ReactNode | ComponentType<{ error: Error }>;\n}\n\ninterface ErrorBoundaryState {\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error(error, errorInfo);\n }\n\n reset() {\n this.setState({ error: null });\n }\n\n render(): React.ReactNode {\n if (this.state.error === null) return this.props.children;\n\n const error = this.state.error;\n const reset = this.reset.bind(this);\n const fallback = this.props.fallback;\n const Fallback =\n typeof fallback === \"function\" ? fallback : () => fallback ?? null;\n return (\n <ErrorBoundaryContext.Provider value={{ error, reset }}>\n <Fallback error={this.state.error} />\n </ErrorBoundaryContext.Provider>\n );\n }\n}\n\nexport function useErrorBoundary(): {\n error: Error;\n reset: () => void;\n} {\n const context = useContext(ErrorBoundaryContext);\n\n if (context === null) {\n throw new Error(\n \"useErrorBoundary must be used within an ErrorBoundary component\"\n );\n }\n\n return context;\n}\n"],"names":["createContext","Component","jsx","useContext"],"mappings":";;;;;AAGA,MAAM,oBAAA,GAAuBA,oBAGnB,IAAI,CAAA,CAAA;AAWP,MAAM,sBAAsBC,eAGjC,CAAA;AAAA,EACA,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,IAAK,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAAO,yBAAyB,KAAc,EAAA;AAC5C,IAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACjB;AAAA,EAEA,iBAAA,CAAkB,OAAc,SAA4B,EAAA;AAC1D,IAAQ,OAAA,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,CAAA;AAAA,GAChC;AAAA,EAEA,KAAQ,GAAA;AACN,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,KAAO,EAAA,IAAA,EAAM,CAAA,CAAA;AAAA,GAC/B;AAAA,EAEA,MAA0B,GAAA;AACxB,IAAI,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.cjs","sources":["../../src/utils/ErrorBoundary.tsx"],"sourcesContent":["import type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport { Component, createContext, useContext } from \"react\";\n\nconst ErrorBoundaryContext = createContext<{\n error: Error;\n reset: () => void;\n} | null>(null);\n\nexport interface ErrorBoundaryProps {\n children?: ReactNode;\n fallback?: ReactNode | ComponentType<{ error: Error }>;\n}\n\ninterface ErrorBoundaryState {\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error(error, errorInfo);\n }\n\n reset() {\n this.setState({ error: null });\n }\n\n render(): React.ReactNode {\n if (this.state.error === null) return this.props.children;\n\n const error = this.state.error;\n const reset = this.reset.bind(this);\n const fallback = this.props.fallback;\n const Fallback =\n typeof fallback === \"function\" ? fallback : () => fallback ?? null;\n return (\n <ErrorBoundaryContext.Provider value={{ error, reset }}>\n <Fallback error={this.state.error} />\n </ErrorBoundaryContext.Provider>\n );\n }\n}\n\nexport function useErrorBoundary(): {\n error: Error;\n reset: () => void;\n} {\n const context = useContext(ErrorBoundaryContext);\n\n if (context === null) {\n throw new Error(\n \"useErrorBoundary must be used within an ErrorBoundary component\"\n );\n }\n\n return context;\n}\n"],"names":["createContext","Component","jsx","useContext"],"mappings":";;;;;AAGA,MAAM,oBAAA,GAAuBA,oBAGnB,IAAI,CAAA,CAAA;AAWP,MAAM,sBAAsBC,eAGjC,CAAA;AAAA,EACA,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,IAAK,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAAO,yBAAyB,KAAc,EAAA;AAC5C,IAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACjB;AAAA,EAEA,iBAAA,CAAkB,OAAc,SAA4B,EAAA;AAC1D,IAAQ,OAAA,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,CAAA;AAAA,GAChC;AAAA,EAEA,KAAQ,GAAA;AACN,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,KAAO,EAAA,IAAA,EAAM,CAAA,CAAA;AAAA,GAC/B;AAAA,EAEA,MAA0B,GAAA;AACxB,IAAA,IAAI,KAAK,KAAM,CAAA,KAAA,KAAU,IAAM,EAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAEjD,IAAM,MAAA,KAAA,GAAQ,KAAK,KAAM,CAAA,KAAA,CAAA;AACzB,IAAA,MAAM,KAAQ,GAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAClC,IAAM,MAAA,QAAA,GAAW,KAAK,KAAM,CAAA,QAAA,CAAA;AAC5B,IAAA,MAAM,WACJ,OAAO,QAAA,KAAa,UAAa,GAAA,QAAA,GAAW,MAAM,QAAY,IAAA,IAAA,CAAA;AAChE,IAAA,uBACGC,cAAA,CAAA,oBAAA,CAAqB,QAArB,EAAA,EAA8B,OAAO,EAAE,KAAA,EAAO,KAAM,EAAA,EACnD,yCAAC,QAAS,EAAA,EAAA,KAAA,EAAO,IAAK,CAAA,KAAA,CAAM,OAAO,CACrC,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAA;AAEO,SAAS,gBAGd,GAAA;AACA,EAAM,MAAA,OAAA,GAAUC,iBAAW,oBAAoB,CAAA,CAAA;AAE/C,EAAA,IAAI,YAAY,IAAM,EAAA;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iEAAA;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,OAAA,CAAA;AACT;;;;;"}
|
|
@@ -17,8 +17,7 @@ class ErrorBoundary extends Component {
|
|
|
17
17
|
this.setState({ error: null });
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
if (this.state.error === null)
|
|
21
|
-
return this.props.children;
|
|
20
|
+
if (this.state.error === null) return this.props.children;
|
|
22
21
|
const error = this.state.error;
|
|
23
22
|
const reset = this.reset.bind(this);
|
|
24
23
|
const fallback = this.props.fallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sources":["../../src/utils/ErrorBoundary.tsx"],"sourcesContent":["import type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport { Component, createContext, useContext } from \"react\";\n\nconst ErrorBoundaryContext = createContext<{\n error: Error;\n reset: () => void;\n} | null>(null);\n\nexport interface ErrorBoundaryProps {\n children?: ReactNode;\n fallback?: ReactNode | ComponentType<{ error: Error }>;\n}\n\ninterface ErrorBoundaryState {\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error(error, errorInfo);\n }\n\n reset() {\n this.setState({ error: null });\n }\n\n render(): React.ReactNode {\n if (this.state.error === null) return this.props.children;\n\n const error = this.state.error;\n const reset = this.reset.bind(this);\n const fallback = this.props.fallback;\n const Fallback =\n typeof fallback === \"function\" ? fallback : () => fallback ?? null;\n return (\n <ErrorBoundaryContext.Provider value={{ error, reset }}>\n <Fallback error={this.state.error} />\n </ErrorBoundaryContext.Provider>\n );\n }\n}\n\nexport function useErrorBoundary(): {\n error: Error;\n reset: () => void;\n} {\n const context = useContext(ErrorBoundaryContext);\n\n if (context === null) {\n throw new Error(\n \"useErrorBoundary must be used within an ErrorBoundary component\"\n );\n }\n\n return context;\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,oBAAA,GAAuB,cAGnB,IAAI,CAAA,CAAA;AAWP,MAAM,sBAAsB,SAGjC,CAAA;AAAA,EACA,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,IAAK,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAAO,yBAAyB,KAAc,EAAA;AAC5C,IAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACjB;AAAA,EAEA,iBAAA,CAAkB,OAAc,SAA4B,EAAA;AAC1D,IAAQ,OAAA,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,CAAA;AAAA,GAChC;AAAA,EAEA,KAAQ,GAAA;AACN,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,KAAO,EAAA,IAAA,EAAM,CAAA,CAAA;AAAA,GAC/B;AAAA,EAEA,MAA0B,GAAA;AACxB,IAAI,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sources":["../../src/utils/ErrorBoundary.tsx"],"sourcesContent":["import type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport { Component, createContext, useContext } from \"react\";\n\nconst ErrorBoundaryContext = createContext<{\n error: Error;\n reset: () => void;\n} | null>(null);\n\nexport interface ErrorBoundaryProps {\n children?: ReactNode;\n fallback?: ReactNode | ComponentType<{ error: Error }>;\n}\n\ninterface ErrorBoundaryState {\n error: Error | null;\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = { error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error(error, errorInfo);\n }\n\n reset() {\n this.setState({ error: null });\n }\n\n render(): React.ReactNode {\n if (this.state.error === null) return this.props.children;\n\n const error = this.state.error;\n const reset = this.reset.bind(this);\n const fallback = this.props.fallback;\n const Fallback =\n typeof fallback === \"function\" ? fallback : () => fallback ?? null;\n return (\n <ErrorBoundaryContext.Provider value={{ error, reset }}>\n <Fallback error={this.state.error} />\n </ErrorBoundaryContext.Provider>\n );\n }\n}\n\nexport function useErrorBoundary(): {\n error: Error;\n reset: () => void;\n} {\n const context = useContext(ErrorBoundaryContext);\n\n if (context === null) {\n throw new Error(\n \"useErrorBoundary must be used within an ErrorBoundary component\"\n );\n }\n\n return context;\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,oBAAA,GAAuB,cAGnB,IAAI,CAAA,CAAA;AAWP,MAAM,sBAAsB,SAGjC,CAAA;AAAA,EACA,YAAY,KAA2B,EAAA;AACrC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,IAAK,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAAO,yBAAyB,KAAc,EAAA;AAC5C,IAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACjB;AAAA,EAEA,iBAAA,CAAkB,OAAc,SAA4B,EAAA;AAC1D,IAAQ,OAAA,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,CAAA;AAAA,GAChC;AAAA,EAEA,KAAQ,GAAA;AACN,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,KAAO,EAAA,IAAA,EAAM,CAAA,CAAA;AAAA,GAC/B;AAAA,EAEA,MAA0B,GAAA;AACxB,IAAA,IAAI,KAAK,KAAM,CAAA,KAAA,KAAU,IAAM,EAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAEjD,IAAM,MAAA,KAAA,GAAQ,KAAK,KAAM,CAAA,KAAA,CAAA;AACzB,IAAA,MAAM,KAAQ,GAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAClC,IAAM,MAAA,QAAA,GAAW,KAAK,KAAM,CAAA,QAAA,CAAA;AAC5B,IAAA,MAAM,WACJ,OAAO,QAAA,KAAa,UAAa,GAAA,QAAA,GAAW,MAAM,QAAY,IAAA,IAAA,CAAA;AAChE,IAAA,uBACG,GAAA,CAAA,oBAAA,CAAqB,QAArB,EAAA,EAA8B,OAAO,EAAE,KAAA,EAAO,KAAM,EAAA,EACnD,8BAAC,QAAS,EAAA,EAAA,KAAA,EAAO,IAAK,CAAA,KAAA,CAAM,OAAO,CACrC,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAA;AAEO,SAAS,gBAGd,GAAA;AACA,EAAM,MAAA,OAAA,GAAU,WAAW,oBAAoB,CAAA,CAAA;AAE/C,EAAA,IAAI,YAAY,IAAM,EAAA;AACpB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iEAAA;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,OAAA,CAAA;AACT;;;;"}
|
package/dist/version.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const PKG_NAME = "@liveblocks/react-ui";
|
|
4
|
-
const PKG_VERSION = typeof "3.18.
|
|
4
|
+
const PKG_VERSION = typeof "3.18.3-test1" === "string" && "3.18.3-test1";
|
|
5
5
|
const PKG_FORMAT = typeof "cjs" === "string" && "cjs";
|
|
6
6
|
|
|
7
7
|
exports.PKG_FORMAT = PKG_FORMAT;
|
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,cAAA,KAAgB,QAAY,IAAA,eAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;;;"}
|
package/dist/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const PKG_NAME = "@liveblocks/react-ui";
|
|
2
|
-
const PKG_VERSION = typeof "3.18.
|
|
2
|
+
const PKG_VERSION = typeof "3.18.3-test1" === "string" && "3.18.3-test1";
|
|
3
3
|
const PKG_FORMAT = typeof "esm" === "string" && "esm";
|
|
4
4
|
|
|
5
5
|
export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,cAAA,KAAgB,QAAY,IAAA,eAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react-ui",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.3-test1",
|
|
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
|
"author": "Liveblocks Inc.",
|
|
@@ -64,34 +64,22 @@
|
|
|
64
64
|
"**/*.css.map",
|
|
65
65
|
"README.md"
|
|
66
66
|
],
|
|
67
|
-
"scripts": {
|
|
68
|
-
"dev": "rollup --config rollup.config.js --watch",
|
|
69
|
-
"build": "rollup --config rollup.config.js",
|
|
70
|
-
"start": "npm run dev",
|
|
71
|
-
"format": "eslint --fix src/; stylelint --fix src/styles/; prettier --write src/",
|
|
72
|
-
"lint": "eslint src/; stylelint src/styles/",
|
|
73
|
-
"lint:package": "publint --strict && attw --pack",
|
|
74
|
-
"test": "npx liveblocks dev -p 1154 -c 'vitest run'",
|
|
75
|
-
"test:ci": "vitest run",
|
|
76
|
-
"test:types": "vitest run --config ./vitest.config.typecheck.ts",
|
|
77
|
-
"test:watch": "vitest"
|
|
78
|
-
},
|
|
79
67
|
"dependencies": {
|
|
80
68
|
"@floating-ui/react-dom": "^2.1.0",
|
|
81
|
-
"@liveblocks/client": "3.18.2",
|
|
82
|
-
"@liveblocks/core": "3.18.2",
|
|
83
|
-
"@liveblocks/react": "3.18.2",
|
|
84
69
|
"frimousse": "^0.2.0",
|
|
85
70
|
"marked": "^15.0.11",
|
|
86
71
|
"radix-ui": "^1.4.0",
|
|
87
72
|
"slate": "^0.110.2",
|
|
88
73
|
"slate-history": "^0.110.3",
|
|
89
74
|
"slate-hyperscript": "^0.100.0",
|
|
90
|
-
"slate-react": "^0.110.3"
|
|
75
|
+
"slate-react": "^0.110.3",
|
|
76
|
+
"@liveblocks/react": "3.18.3-test1",
|
|
77
|
+
"@liveblocks/client": "3.18.3-test1",
|
|
78
|
+
"@liveblocks/core": "3.18.3-test1"
|
|
91
79
|
},
|
|
92
80
|
"peerDependencies": {
|
|
93
|
-
"@types/react": "
|
|
94
|
-
"@types/react-dom": "
|
|
81
|
+
"@types/react": "^18 || ^19",
|
|
82
|
+
"@types/react-dom": "^18 || ^19",
|
|
95
83
|
"react": "^18 || ^19 || ^19.0.0-rc",
|
|
96
84
|
"react-dom": "^18 || ^19 || ^19.0.0-rc"
|
|
97
85
|
},
|
|
@@ -104,17 +92,25 @@
|
|
|
104
92
|
}
|
|
105
93
|
},
|
|
106
94
|
"devDependencies": {
|
|
107
|
-
"@
|
|
108
|
-
"@
|
|
109
|
-
"@
|
|
110
|
-
"
|
|
111
|
-
"@testing-library/react": "^13.1.1",
|
|
95
|
+
"@radix-ui/react-dropdown-menu": "^2.1.0",
|
|
96
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
97
|
+
"@testing-library/react": "^16.3.0",
|
|
98
|
+
"eslint": "^9.39.4",
|
|
112
99
|
"eslint-plugin-react": "^7.33.2",
|
|
113
|
-
"eslint-plugin-react-hooks": "^
|
|
100
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
101
|
+
"msw": "^2.10.4",
|
|
102
|
+
"react": "^18.2.0",
|
|
103
|
+
"react-dom": "^18.2.0",
|
|
104
|
+
"rollup": "3.28.1",
|
|
114
105
|
"stylelint": "^15.10.2",
|
|
115
106
|
"stylelint-config-standard": "^34.0.0",
|
|
116
107
|
"stylelint-order": "^6.0.3",
|
|
117
|
-
"stylelint-plugin-logical-css": "^0.13.2"
|
|
108
|
+
"stylelint-plugin-logical-css": "^0.13.2",
|
|
109
|
+
"typescript": "^5.9.3",
|
|
110
|
+
"vitest": "^4.1.4",
|
|
111
|
+
"@liveblocks/eslint-config": "0.0.0",
|
|
112
|
+
"@liveblocks/rollup-config": "0.0.0",
|
|
113
|
+
"@liveblocks/vitest-config": "1.0.0"
|
|
118
114
|
},
|
|
119
115
|
"sideEffects": false,
|
|
120
116
|
"bugs": {
|
|
@@ -145,5 +141,17 @@
|
|
|
145
141
|
"rooms",
|
|
146
142
|
"documents",
|
|
147
143
|
"conflict resolution"
|
|
148
|
-
]
|
|
149
|
-
|
|
144
|
+
],
|
|
145
|
+
"scripts": {
|
|
146
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
147
|
+
"build": "rollup --config rollup.config.js",
|
|
148
|
+
"start": "pnpm run dev",
|
|
149
|
+
"format": "eslint --fix src/; stylelint --fix src/styles/; prettier --write src/",
|
|
150
|
+
"lint": "eslint src/; stylelint src/styles/",
|
|
151
|
+
"lint:package": "publint --strict && attw --pack",
|
|
152
|
+
"test": "pnpm dlx liveblocks dev -p 1164 -c 'vitest run'",
|
|
153
|
+
"test:ci": "vitest run",
|
|
154
|
+
"test:types": "vitest run --config ./vitest.config.typecheck.ts",
|
|
155
|
+
"test:watch": "vitest"
|
|
156
|
+
}
|
|
157
|
+
}
|
package/src/styles/index.css
CHANGED
|
@@ -249,27 +249,27 @@
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
&:where(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
:enabled:hover,
|
|
253
|
+
:enabled:focus-visible,
|
|
254
|
+
[aria-expanded="true"],
|
|
255
|
+
[aria-selected="true"]
|
|
256
|
+
) {
|
|
257
257
|
--lb-button-background: var(--lb-foreground-subtle);
|
|
258
258
|
|
|
259
259
|
color: var(--lb-foreground-tertiary);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
&:where(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
263
|
+
[data-variant="default"]:not(
|
|
264
|
+
:is(
|
|
265
|
+
:enabled:hover,
|
|
266
|
+
:enabled:focus-visible,
|
|
267
|
+
[aria-expanded="true"],
|
|
268
|
+
[aria-selected="true"],
|
|
269
|
+
[aria-pressed]
|
|
270
|
+
)
|
|
271
|
+
)
|
|
272
|
+
) {
|
|
273
273
|
background: transparent;
|
|
274
274
|
}
|
|
275
275
|
|
|
@@ -279,11 +279,11 @@
|
|
|
279
279
|
color: var(--lb-accent-foreground);
|
|
280
280
|
|
|
281
281
|
&:where(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
:enabled:hover,
|
|
283
|
+
:enabled:focus-visible,
|
|
284
|
+
[aria-expanded="true"],
|
|
285
|
+
[aria-selected="true"]
|
|
286
|
+
) {
|
|
287
287
|
--lb-button-background: var(--lb-accent-secondary);
|
|
288
288
|
|
|
289
289
|
color: var(--lb-accent-foreground);
|
|
@@ -296,11 +296,11 @@
|
|
|
296
296
|
color: var(--lb-destructive-foreground);
|
|
297
297
|
|
|
298
298
|
&:where(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
:enabled:hover,
|
|
300
|
+
:enabled:focus-visible,
|
|
301
|
+
[aria-expanded="true"],
|
|
302
|
+
[aria-selected="true"]
|
|
303
|
+
) {
|
|
304
304
|
--lb-button-background: var(--lb-destructive-secondary);
|
|
305
305
|
|
|
306
306
|
color: var(--lb-destructive-foreground);
|
|
@@ -345,11 +345,11 @@
|
|
|
345
345
|
color: var(--lb-foreground-tertiary);
|
|
346
346
|
|
|
347
347
|
&:where(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
:enabled:hover,
|
|
349
|
+
:enabled:focus-visible,
|
|
350
|
+
[aria-expanded="true"],
|
|
351
|
+
[aria-selected="true"]
|
|
352
|
+
) {
|
|
353
353
|
--lb-button-background: var(--lb-foreground);
|
|
354
354
|
|
|
355
355
|
color: var(--lb-dynamic-background);
|
|
@@ -427,12 +427,12 @@
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
.lb-dropdown-item:where(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
430
|
+
:is(
|
|
431
|
+
[data-highlighted]:not([data-highlighted="false"]),
|
|
432
|
+
[data-selected]:not([data-selected="false"]),
|
|
433
|
+
[data-active]:not([data-active="false"])
|
|
434
|
+
)
|
|
435
|
+
) {
|
|
436
436
|
:where(.lb-icon-container) {
|
|
437
437
|
color: var(--lb-foreground-tertiary);
|
|
438
438
|
}
|
|
@@ -1493,11 +1493,11 @@
|
|
|
1493
1493
|
box-shadow: inset 0 0 0 1px var(--lb-accent-moderate);
|
|
1494
1494
|
|
|
1495
1495
|
&:where(
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1496
|
+
:enabled:hover,
|
|
1497
|
+
:enabled:focus-visible,
|
|
1498
|
+
[aria-expanded="true"],
|
|
1499
|
+
[aria-selected="true"]
|
|
1500
|
+
) {
|
|
1501
1501
|
color: var(--lb-accent);
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
@@ -2376,11 +2376,11 @@
|
|
|
2376
2376
|
transition-property: background;
|
|
2377
2377
|
|
|
2378
2378
|
&:where(
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2379
|
+
:hover,
|
|
2380
|
+
:focus-visible,
|
|
2381
|
+
:focus-within,
|
|
2382
|
+
[data-selected]:not([data-selected="false"])
|
|
2383
|
+
) {
|
|
2384
2384
|
--lb-dynamic-background: var(--lb-background-foreground-faint);
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
@@ -2502,7 +2502,8 @@
|
|
|
2502
2502
|
|
|
2503
2503
|
/* 0,0,0 specificity to inherit any styles applied to `code` elements */
|
|
2504
2504
|
:where(:is(.lb-root) code) {
|
|
2505
|
-
font-family:
|
|
2505
|
+
font-family:
|
|
2506
|
+
ui-monospace, Menlo, Monaco, "Roboto Mono", "Cascadia Code",
|
|
2506
2507
|
"Source Code Pro", Consolas, "DejaVu Sans Mono", monospace;
|
|
2507
2508
|
}
|
|
2508
2509
|
|
|
@@ -2577,10 +2578,10 @@
|
|
|
2577
2578
|
.lb-emoji-picker-emoji
|
|
2578
2579
|
) {
|
|
2579
2580
|
&:where(
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2581
|
+
[data-highlighted]:not([data-highlighted="false"]),
|
|
2582
|
+
[data-selected]:not([data-selected="false"]),
|
|
2583
|
+
[data-active]:not([data-active="false"])
|
|
2584
|
+
) {
|
|
2584
2585
|
background: var(--lb-foreground-subtle);
|
|
2585
2586
|
transition-duration: calc(var(--lb-transition-duration) / 2);
|
|
2586
2587
|
}
|
|
@@ -2908,8 +2909,8 @@
|
|
|
2908
2909
|
* Rich messages get more padding than plain text ones.
|
|
2909
2910
|
*/
|
|
2910
2911
|
&:where(
|
|
2911
|
-
|
|
2912
|
-
|
|
2912
|
+
:has(h1, h2, h3, h4, h5, h6, ul, ol, blockquote, table, .lb-code-block)
|
|
2913
|
+
) {
|
|
2913
2914
|
--lb-ai-chat-message-content-horizontal-padding: calc(
|
|
2914
2915
|
1.375 * var(--lb-spacing)
|
|
2915
2916
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes lb-animation-shimmer-text-invert{0%,to{
|
|
1
|
+
@keyframes lb-animation-shimmer-text-invert{0%,to{mask-image:linear-gradient(90deg,#00000080 36%,#000000f2 48% 52%,#00000080 64%);mask-size:300% 100%}0%{mask-position:100% 0}to{mask-position:0 0}}.lb-root:where(:is(.dark,[data-theme=dark],[data-dark])),:is(.dark,[data-theme=dark],[data-dark]) :where(.lb-root){--lb-accent:#4af;--lb-destructive:#f77;--lb-background:#222;--lb-foreground:#fff;--lb-accent-contrast:16%;--lb-destructive-contrast:16%;--lb-foreground-contrast:10%;--lb-inset-shadow:inset 0 0 0 1px #ffffff0f;--lb-highlight-shadow:inset 0 0 0 1px #ffffff1f;--lb-elevation-shadow:0 0 0 1px #0000000a, 0 2px 6px #00000014, 0 8px 26px #0000001f;--lb-elevation-shadow-moderate:0 0 0 1px #0000000a, 0 2px 6px #0000000d, 0 8px 26px #0000000f;--lb-tooltip-shadow:0 2px 4px #00000014, 0 4px 12px #0000001f;color-scheme:dark}.lb-root:where(:is(.dark,[data-theme=dark],[data-dark])):where(.lb-elevation,.lb-tooltip,.lb-comment-pin),:is(.dark,[data-theme=dark],[data-dark]) :where(.lb-root):where(.lb-elevation,.lb-tooltip,.lb-comment-pin){--lb-background:#333;--lb-foreground-contrast:10%}.lb-root:where(:is(.dark,[data-theme=dark],[data-dark])):where(.lb-elevation-moderate),:is(.dark,[data-theme=dark],[data-dark]) :where(.lb-root):where(.lb-elevation-moderate){--lb-background:#2a2a2a;--lb-foreground-contrast:10%}.lb-root:where(:is(.dark,[data-theme=dark],[data-dark])) .lb-ai-chat-pending,:is(.dark,[data-theme=dark],[data-dark]) :where(.lb-root) .lb-ai-chat-pending{animation-name:lb-animation-shimmer-text-invert}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/styles/dark/src/styles/dark/index.css","../../src/styles/dark/src/styles/dark/attributes.css"],"names":[],"mappings":"AAwCA,4CAAA,MAAA
|
|
1
|
+
{"version":3,"sources":["../../src/styles/dark/src/styles/dark/index.css","../../src/styles/dark/src/styles/dark/attributes.css"],"names":[],"mappings":"AAwCA,4CAAA,MAAA,+EAAA,CAAA,mBAAA,CAAA,GAAA,oBAAA,CAAA,GAAA,iBAAA,CAAA,CCpCA,mHAAA,gBAAA,CAAA,qBAAA,CAAA,oBAAA,CAAA,oBAAA,CAAA,wBAAA,CAAA,6BAAA,CAAA,4BAAA,CAAA,2CAAA,CAAA,+CAAA,CAAA,oFAAA,CAAA,6FAAA,CAAA,6DAAA,CAAA,iBAAA,CDqBE,qNAAA,oBAAA,CAAA,4BAAA,CAKA,+KAAA,uBAAA,CAAA,4BAAA,CAKA,2JAAA,+CAAA","file":"attributes.css","sourcesContent":["@import \"../constants\";\n\n@mixin dark-styles {\n /**\n * Colors\n */\n --lb-accent: #4af;\n --lb-destructive: #f77;\n --lb-background: #222;\n --lb-foreground: #fff;\n --lb-accent-contrast: 16%;\n --lb-destructive-contrast: 16%;\n --lb-foreground-contrast: 10%;\n\n /**\n * Shadows\n */\n --lb-inset-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%);\n --lb-highlight-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);\n --lb-elevation-shadow: $lb-elevation-shadow;\n --lb-elevation-shadow-moderate: $lb-elevation-shadow-moderate;\n --lb-tooltip-shadow: $lb-tooltip-shadow;\n\n color-scheme: dark;\n\n &:where(.lb-elevation, .lb-tooltip, .lb-comment-pin) {\n --lb-background: #333;\n --lb-foreground-contrast: 10%;\n }\n\n &:where(.lb-elevation-moderate) {\n --lb-background: #2a2a2a;\n --lb-foreground-contrast: 10%;\n }\n\n .lb-ai-chat-pending {\n animation-name: lb-animation-shimmer-text-invert;\n }\n}\n\n@keyframes lb-animation-shimmer-text-invert {\n from,\n to {\n mask-image: linear-gradient(\n 90deg,\n rgb(0 0 0 / 50%) 36%,\n rgb(0 0 0 / 95%) 48%,\n rgb(0 0 0 / 95%) 52%,\n rgb(0 0 0 / 50%) 64%\n );\n mask-size: 300% 100%;\n }\n\n from {\n mask-position: 100% 0;\n }\n\n to {\n mask-position: 0% 0;\n }\n}\n","/* stylelint-disable selector-class-pattern */\n\n@import \"./index\";\n\n.lb-root:where(:is(.dark, [data-theme=\"dark\"], [data-dark])),\n:is(.dark, [data-theme=\"dark\"], [data-dark]) :where(.lb-root) {\n @include dark-styles;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes lb-animation-shimmer-text-invert{0%,to{
|
|
1
|
+
@keyframes lb-animation-shimmer-text-invert{0%,to{mask-image:linear-gradient(90deg,#00000080 36%,#000000f2 48% 52%,#00000080 64%);mask-size:300% 100%}0%{mask-position:100% 0}to{mask-position:0 0}}@media (prefers-color-scheme:dark){.lb-root{--lb-accent:#4af;--lb-destructive:#f77;--lb-background:#222;--lb-foreground:#fff;--lb-accent-contrast:16%;--lb-destructive-contrast:16%;--lb-foreground-contrast:10%;--lb-inset-shadow:inset 0 0 0 1px #ffffff0f;--lb-highlight-shadow:inset 0 0 0 1px #ffffff1f;--lb-elevation-shadow:0 0 0 1px #0000000a, 0 2px 6px #00000014, 0 8px 26px #0000001f;--lb-elevation-shadow-moderate:0 0 0 1px #0000000a, 0 2px 6px #0000000d, 0 8px 26px #0000000f;--lb-tooltip-shadow:0 2px 4px #00000014, 0 4px 12px #0000001f;color-scheme:dark}.lb-root:where(.lb-elevation,.lb-tooltip,.lb-comment-pin){--lb-background:#333;--lb-foreground-contrast:10%}.lb-root:where(.lb-elevation-moderate){--lb-background:#2a2a2a;--lb-foreground-contrast:10%}.lb-root .lb-ai-chat-pending{animation-name:lb-animation-shimmer-text-invert}}
|