@tldraw/commenting 0.0.0-bootstrap → 5.3.0-internal.c5c7f1d817d0
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/commenting.css +131 -131
- package/dist-cjs/canvas/comment-body.js +1 -1
- package/dist-cjs/canvas/comment-body.js.map +2 -2
- package/dist-cjs/canvas/comments-filter-menu.js +1 -1
- package/dist-cjs/canvas/comments-filter-menu.js.map +1 -1
- package/dist-cjs/canvas/comments-overflow-menu.js +3 -3
- package/dist-cjs/canvas/comments-overflow-menu.js.map +2 -2
- package/dist-cjs/canvas/comments-overlay.js +65 -50
- package/dist-cjs/canvas/comments-overlay.js.map +2 -2
- package/dist-cjs/canvas/comments-sidebar.js +2 -2
- package/dist-cjs/canvas/comments-sidebar.js.map +2 -2
- package/dist-cjs/clustering/runtime.js +119 -7
- package/dist-cjs/clustering/runtime.js.map +2 -2
- package/dist-cjs/index.d.ts +28 -8
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/ui/avatar.js +10 -2
- package/dist-cjs/ui/avatar.js.map +2 -2
- package/dist-cjs/ui/byline.js +4 -4
- package/dist-cjs/ui/byline.js.map +2 -2
- package/dist-cjs/ui/comment-card.js +3 -3
- package/dist-cjs/ui/comment-card.js.map +2 -2
- package/dist-cjs/ui/comment-composer.js +30 -24
- package/dist-cjs/ui/comment-composer.js.map +2 -2
- package/dist-cjs/ui/comment-mention.js +1 -1
- package/dist-cjs/ui/comment-mention.js.map +2 -2
- package/dist-cjs/ui/comment-pin.js +5 -1
- package/dist-cjs/ui/comment-pin.js.map +2 -2
- package/dist-cjs/ui/comment-text.js +1 -1
- package/dist-cjs/ui/comment-text.js.map +2 -2
- package/dist-cjs/ui/comment-thread.js +6 -6
- package/dist-cjs/ui/comment-thread.js.map +2 -2
- package/dist-cjs/ui/comments-list.js +11 -11
- package/dist-cjs/ui/comments-list.js.map +2 -2
- package/dist-cjs/ui/count-badge.js +1 -1
- package/dist-cjs/ui/count-badge.js.map +2 -2
- package/dist-cjs/ui/empty-state.js +3 -3
- package/dist-cjs/ui/empty-state.js.map +2 -2
- package/dist-cjs/ui/mention-list.js +7 -7
- package/dist-cjs/ui/mention-list.js.map +2 -2
- package/dist-cjs/ui/mention-suggestion.js +3 -3
- package/dist-cjs/ui/mention-suggestion.js.map +2 -2
- package/dist-cjs/ui/mention.js +1 -1
- package/dist-cjs/ui/mention.js.map +2 -2
- package/dist-cjs/ui/reaction.js +11 -4
- package/dist-cjs/ui/reaction.js.map +2 -2
- package/dist-cjs/ui/reactions.js +10 -2
- package/dist-cjs/ui/reactions.js.map +2 -2
- package/dist-cjs/ui/send-button.js +1 -1
- package/dist-cjs/ui/send-button.js.map +2 -2
- package/dist-esm/canvas/comment-body.mjs +1 -1
- package/dist-esm/canvas/comment-body.mjs.map +2 -2
- package/dist-esm/canvas/comments-filter-menu.mjs +1 -1
- package/dist-esm/canvas/comments-filter-menu.mjs.map +1 -1
- package/dist-esm/canvas/comments-overflow-menu.mjs +3 -3
- package/dist-esm/canvas/comments-overflow-menu.mjs.map +2 -2
- package/dist-esm/canvas/comments-overlay.mjs +65 -50
- package/dist-esm/canvas/comments-overlay.mjs.map +2 -2
- package/dist-esm/canvas/comments-sidebar.mjs +2 -2
- package/dist-esm/canvas/comments-sidebar.mjs.map +2 -2
- package/dist-esm/clustering/runtime.mjs +119 -7
- package/dist-esm/clustering/runtime.mjs.map +2 -2
- package/dist-esm/index.d.mts +28 -8
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/ui/avatar.mjs +10 -2
- package/dist-esm/ui/avatar.mjs.map +2 -2
- package/dist-esm/ui/byline.mjs +4 -4
- package/dist-esm/ui/byline.mjs.map +2 -2
- package/dist-esm/ui/comment-card.mjs +3 -3
- package/dist-esm/ui/comment-card.mjs.map +2 -2
- package/dist-esm/ui/comment-composer.mjs +30 -24
- package/dist-esm/ui/comment-composer.mjs.map +2 -2
- package/dist-esm/ui/comment-mention.mjs +1 -1
- package/dist-esm/ui/comment-mention.mjs.map +2 -2
- package/dist-esm/ui/comment-pin.mjs +5 -1
- package/dist-esm/ui/comment-pin.mjs.map +2 -2
- package/dist-esm/ui/comment-text.mjs +1 -1
- package/dist-esm/ui/comment-text.mjs.map +2 -2
- package/dist-esm/ui/comment-thread.mjs +6 -6
- package/dist-esm/ui/comment-thread.mjs.map +2 -2
- package/dist-esm/ui/comments-list.mjs +11 -11
- package/dist-esm/ui/comments-list.mjs.map +2 -2
- package/dist-esm/ui/count-badge.mjs +1 -1
- package/dist-esm/ui/count-badge.mjs.map +2 -2
- package/dist-esm/ui/empty-state.mjs +3 -3
- package/dist-esm/ui/empty-state.mjs.map +2 -2
- package/dist-esm/ui/mention-list.mjs +7 -7
- package/dist-esm/ui/mention-list.mjs.map +2 -2
- package/dist-esm/ui/mention-suggestion.mjs +3 -3
- package/dist-esm/ui/mention-suggestion.mjs.map +2 -2
- package/dist-esm/ui/mention.mjs +1 -1
- package/dist-esm/ui/mention.mjs.map +2 -2
- package/dist-esm/ui/reaction.mjs +11 -4
- package/dist-esm/ui/reaction.mjs.map +2 -2
- package/dist-esm/ui/reactions.mjs +10 -2
- package/dist-esm/ui/reactions.mjs.map +2 -2
- package/dist-esm/ui/send-button.mjs +1 -1
- package/dist-esm/ui/send-button.mjs.map +2 -2
- package/package.json +3 -3
- package/src/canvas/canvas.css +25 -25
- package/src/canvas/comment-body.tsx +1 -1
- package/src/canvas/comment-render.test.ts +1 -1
- package/src/canvas/comments-filter-menu.tsx +1 -1
- package/src/canvas/comments-overflow-menu.tsx +3 -3
- package/src/canvas/comments-overlay.tsx +109 -76
- package/src/canvas/comments-sidebar.tsx +2 -2
- package/src/clustering/runtime.test.ts +183 -7
- package/src/clustering/runtime.ts +164 -15
- package/src/ui/avatar.tsx +9 -2
- package/src/ui/byline.tsx +4 -4
- package/src/ui/comment-card.tsx +3 -3
- package/src/ui/comment-composer.tsx +49 -30
- package/src/ui/comment-mention.ts +2 -2
- package/src/ui/comment-pin.tsx +5 -1
- package/src/ui/comment-text.tsx +1 -1
- package/src/ui/comment-thread.tsx +8 -6
- package/src/ui/comments-list.tsx +16 -12
- package/src/ui/comments.css +106 -106
- package/src/ui/count-badge.tsx +1 -1
- package/src/ui/empty-state.tsx +3 -3
- package/src/ui/mention-list.tsx +8 -8
- package/src/ui/mention-suggestion.tsx +3 -3
- package/src/ui/mention.tsx +1 -1
- package/src/ui/reaction.tsx +6 -3
- package/src/ui/reactions.tsx +6 -2
- package/src/ui/send-button.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/canvas/comments-filter-menu.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuTrigger,\n\tTldrawUiMenuCheckboxItem,\n\tTldrawUiMenuContextProvider,\n\tTldrawUiMenuGroup,\n\tuseEditor,\n\tuseTranslation,\n\tuseValue,\n} from 'tldraw'\nimport { SidebarFilters } from './sidebar-filters'\nimport { sidebarFilters } from './state'\n\n/** @public */\nexport interface CommentsFilterMenuProps {\n\t/** Whether to offer the \"only your threads\" toggle (needs a known current user). */\n\tcanFilterByAuthor?: boolean\n\t/** Whether to offer the \"only unread\" toggle (needs a read-status source). */\n\tcanFilterByUnread?: boolean\n}\n\n/** The funnel dropdown in the sidebar header: toggles for which threads the list shows.\n * @public @react */\nexport function CommentsFilterMenu({\n\tcanFilterByAuthor,\n\tcanFilterByUnread,\n}: CommentsFilterMenuProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst filters = useValue('sidebar filters', () => sidebarFilters.get(editor), [editor])\n\tconst toggle = (key: keyof SidebarFilters) => {\n\t\tsidebarFilters.update(editor, (f) => ({ ...f, [key]: !f[key] }))\n\t}\n\n\treturn (\n\t\t<TldrawUiDropdownMenuRoot id=\"comments-filter\">\n\t\t\t<TldrawUiDropdownMenuTrigger>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"cmt-header-btn\"\n\t\t\t\t\ttitle={msg('comments.filter')}\n\t\t\t\t\taria-label={msg('comments.filter')}\n\t\t\t\t>\n\t\t\t\t\t<FilterIcon />\n\t\t\t\t</button>\n\t\t\t</TldrawUiDropdownMenuTrigger>\n\t\t\t<TldrawUiDropdownMenuContent side=\"bottom\" align=\"start\">\n\t\t\t\t<TldrawUiMenuContextProvider type=\"menu\" sourceId=\"menu\">\n\t\t\t\t\t<TldrawUiMenuGroup id=\"comments-filter\">\n\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\tid=\"show-resolved\"\n\t\t\t\t\t\t\tlabel=\"comments.show-resolved\"\n\t\t\t\t\t\t\tchecked={filters.showResolved}\n\t\t\t\t\t\t\tonSelect={() => toggle('showResolved')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{canFilterByAuthor && (\n\t\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\t\tid=\"only-mine\"\n\t\t\t\t\t\t\t\tlabel=\"comments.only-mine\"\n\t\t\t\t\t\t\t\tchecked={filters.onlyMine}\n\t\t\t\t\t\t\t\tonSelect={() => toggle('onlyMine')}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{canFilterByUnread && (\n\t\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\t\tid=\"only-unread\"\n\t\t\t\t\t\t\t\tlabel=\"comments.only-unread\"\n\t\t\t\t\t\t\t\tchecked={filters.onlyUnread}\n\t\t\t\t\t\t\t\tonSelect={() => toggle('onlyUnread')}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\tid=\"only-current-page\"\n\t\t\t\t\t\t\tlabel=\"comments.only-current-page\"\n\t\t\t\t\t\t\tchecked={filters.onlyCurrentPage}\n\t\t\t\t\t\t\tonSelect={() => toggle('onlyCurrentPage')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TldrawUiMenuGroup>\n\t\t\t\t</TldrawUiMenuContextProvider>\n\t\t\t</TldrawUiDropdownMenuContent>\n\t\t</TldrawUiDropdownMenuRoot>\n\t)\n}\n\nfunction FilterIcon() {\n\treturn (\n\t\t<svg\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstrokeWidth=\"1.5\"\n\t\t\tstrokeLinecap=\"round\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<line x1=\"2.5\" y1=\"5\" x2=\"13.5\" y2=\"5\" />\n\t\t\t<line x1=\"2.5\" y1=\"11\" x2=\"13.5\" y2=\"11\" />\n\t\t\t<circle cx=\"6\" cy=\"5\" r=\"1.9\" fill=\"currentColor\" stroke=\"none\" />\n\t\t\t<circle cx=\"10.5\" cy=\"11\" r=\"1.9\" fill=\"currentColor\" stroke=\"none\" />\n\t\t</svg>\n\t)\n}\n"],
|
|
4
|
+
"sourcesContent": ["import {\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuTrigger,\n\tTldrawUiMenuCheckboxItem,\n\tTldrawUiMenuContextProvider,\n\tTldrawUiMenuGroup,\n\tuseEditor,\n\tuseTranslation,\n\tuseValue,\n} from 'tldraw'\nimport { SidebarFilters } from './sidebar-filters'\nimport { sidebarFilters } from './state'\n\n/** @public */\nexport interface CommentsFilterMenuProps {\n\t/** Whether to offer the \"only your threads\" toggle (needs a known current user). */\n\tcanFilterByAuthor?: boolean\n\t/** Whether to offer the \"only unread\" toggle (needs a read-status source). */\n\tcanFilterByUnread?: boolean\n}\n\n/** The funnel dropdown in the sidebar header: toggles for which threads the list shows.\n * @public @react */\nexport function CommentsFilterMenu({\n\tcanFilterByAuthor,\n\tcanFilterByUnread,\n}: CommentsFilterMenuProps) {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst filters = useValue('sidebar filters', () => sidebarFilters.get(editor), [editor])\n\tconst toggle = (key: keyof SidebarFilters) => {\n\t\tsidebarFilters.update(editor, (f) => ({ ...f, [key]: !f[key] }))\n\t}\n\n\treturn (\n\t\t<TldrawUiDropdownMenuRoot id=\"comments-filter\">\n\t\t\t<TldrawUiDropdownMenuTrigger>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"tlui-cmt-header-btn\"\n\t\t\t\t\ttitle={msg('comments.filter')}\n\t\t\t\t\taria-label={msg('comments.filter')}\n\t\t\t\t>\n\t\t\t\t\t<FilterIcon />\n\t\t\t\t</button>\n\t\t\t</TldrawUiDropdownMenuTrigger>\n\t\t\t<TldrawUiDropdownMenuContent side=\"bottom\" align=\"start\">\n\t\t\t\t<TldrawUiMenuContextProvider type=\"menu\" sourceId=\"menu\">\n\t\t\t\t\t<TldrawUiMenuGroup id=\"comments-filter\">\n\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\tid=\"show-resolved\"\n\t\t\t\t\t\t\tlabel=\"comments.show-resolved\"\n\t\t\t\t\t\t\tchecked={filters.showResolved}\n\t\t\t\t\t\t\tonSelect={() => toggle('showResolved')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{canFilterByAuthor && (\n\t\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\t\tid=\"only-mine\"\n\t\t\t\t\t\t\t\tlabel=\"comments.only-mine\"\n\t\t\t\t\t\t\t\tchecked={filters.onlyMine}\n\t\t\t\t\t\t\t\tonSelect={() => toggle('onlyMine')}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{canFilterByUnread && (\n\t\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\t\tid=\"only-unread\"\n\t\t\t\t\t\t\t\tlabel=\"comments.only-unread\"\n\t\t\t\t\t\t\t\tchecked={filters.onlyUnread}\n\t\t\t\t\t\t\t\tonSelect={() => toggle('onlyUnread')}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<TldrawUiMenuCheckboxItem\n\t\t\t\t\t\t\tid=\"only-current-page\"\n\t\t\t\t\t\t\tlabel=\"comments.only-current-page\"\n\t\t\t\t\t\t\tchecked={filters.onlyCurrentPage}\n\t\t\t\t\t\t\tonSelect={() => toggle('onlyCurrentPage')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TldrawUiMenuGroup>\n\t\t\t\t</TldrawUiMenuContextProvider>\n\t\t\t</TldrawUiDropdownMenuContent>\n\t\t</TldrawUiDropdownMenuRoot>\n\t)\n}\n\nfunction FilterIcon() {\n\treturn (\n\t\t<svg\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstrokeWidth=\"1.5\"\n\t\t\tstrokeLinecap=\"round\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<line x1=\"2.5\" y1=\"5\" x2=\"13.5\" y2=\"5\" />\n\t\t\t<line x1=\"2.5\" y1=\"11\" x2=\"13.5\" y2=\"11\" />\n\t\t\t<circle cx=\"6\" cy=\"5\" r=\"1.9\" fill=\"currentColor\" stroke=\"none\" />\n\t\t\t<circle cx=\"10.5\" cy=\"11\" r=\"1.9\" fill=\"currentColor\" stroke=\"none\" />\n\t\t</svg>\n\t)\n}\n"],
|
|
5
5
|
"mappings": "AA4CK,cAKA,YALA;AA5CL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,sBAAsB;AAYxB,SAAS,mBAAmB;AAAA,EAClC;AAAA,EACA;AACD,GAA4B;AAC3B,QAAM,SAAS,UAAU;AACzB,QAAM,MAAM,eAAe;AAC3B,QAAM,UAAU,SAAS,mBAAmB,MAAM,eAAe,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC;AACtF,QAAM,SAAS,CAAC,QAA8B;AAC7C,mBAAe,OAAO,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE;AAAA,EAChE;AAEA,SACC,qBAAC,4BAAyB,IAAG,mBAC5B;AAAA,wBAAC,+BACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAO,IAAI,iBAAiB;AAAA,QAC5B,cAAY,IAAI,iBAAiB;AAAA,QAEjC,8BAAC,cAAW;AAAA;AAAA,IACb,GACD;AAAA,IACA,oBAAC,+BAA4B,MAAK,UAAS,OAAM,SAChD,8BAAC,+BAA4B,MAAK,QAAO,UAAS,QACjD,+BAAC,qBAAkB,IAAG,mBACrB;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,OAAM;AAAA,UACN,SAAS,QAAQ;AAAA,UACjB,UAAU,MAAM,OAAO,cAAc;AAAA;AAAA,MACtC;AAAA,MACC,qBACA;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,OAAM;AAAA,UACN,SAAS,QAAQ;AAAA,UACjB,UAAU,MAAM,OAAO,UAAU;AAAA;AAAA,MAClC;AAAA,MAEA,qBACA;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,OAAM;AAAA,UACN,SAAS,QAAQ;AAAA,UACjB,UAAU,MAAM,OAAO,YAAY;AAAA;AAAA,MACpC;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,OAAM;AAAA,UACN,SAAS,QAAQ;AAAA,UACjB,UAAU,MAAM,OAAO,iBAAiB;AAAA;AAAA,MACzC;AAAA,OACD,GACD,GACD;AAAA,KACD;AAEF;AAEA,SAAS,aAAa;AACrB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,eAAY;AAAA,MAEZ;AAAA,4BAAC,UAAK,IAAG,OAAM,IAAG,KAAI,IAAG,QAAO,IAAG,KAAI;AAAA,QACvC,oBAAC,UAAK,IAAG,OAAM,IAAG,MAAK,IAAG,QAAO,IAAG,MAAK;AAAA,QACzC,oBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM,MAAK,gBAAe,QAAO,QAAO;AAAA,QAChE,oBAAC,YAAO,IAAG,QAAO,IAAG,MAAK,GAAE,OAAM,MAAK,gBAAe,QAAO,QAAO;AAAA;AAAA;AAAA,EACrE;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -20,7 +20,7 @@ function CommentsOverflowMenu() {
|
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
22
|
type: "button",
|
|
23
|
-
className: "cmt-header-btn",
|
|
23
|
+
className: "tlui-cmt-header-btn",
|
|
24
24
|
title: msg("comments.more-options"),
|
|
25
25
|
"aria-label": msg("comments.more-options"),
|
|
26
26
|
children: /* @__PURE__ */ jsx(MoreIcon, {})
|
|
@@ -30,11 +30,11 @@ function CommentsOverflowMenu() {
|
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
32
32
|
type: "button",
|
|
33
|
-
className: "cmt-menu-item",
|
|
33
|
+
className: "tlui-cmt-menu-item",
|
|
34
34
|
onClick: () => toggleCommentsHidden(editor),
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ jsx("span", { children: hidden ? msg("comments.show") : msg("comments.hide") }),
|
|
37
|
-
/* @__PURE__ */ jsx("span", { className: "cmt-menu-item__shortcut", children: HIDE_SHORTCUT })
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: "tlui-cmt-menu-item__shortcut", children: HIDE_SHORTCUT })
|
|
38
38
|
]
|
|
39
39
|
}
|
|
40
40
|
) }) }) })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/canvas/comments-overflow-menu.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuGroup,\n\tTldrawUiDropdownMenuItem,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuTrigger,\n\tuseEditor,\n\tuseTranslation,\n\tuseValue,\n} from 'tldraw'\nimport { commentsHidden, toggleCommentsHidden } from './state'\n\n// A keyboard-shortcut glyph, not translatable copy \u2014 kept out of JSX as a constant.\nconst HIDE_SHORTCUT = '\u21E7C'\n\n/** The overflow (\u22EF) dropdown in the sidebar header. For now it holds the hide/show-comments\n * toggle; it's the home for later comment-wide controls (notifications, mark all as read).\n * @public @react */\nexport function CommentsOverflowMenu() {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst hidden = useValue('comments hidden', () => commentsHidden.get(editor), [editor])\n\n\treturn (\n\t\t<TldrawUiDropdownMenuRoot id=\"comments-overflow\">\n\t\t\t<TldrawUiDropdownMenuTrigger>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"cmt-header-btn\"\n\t\t\t\t\ttitle={msg('comments.more-options')}\n\t\t\t\t\taria-label={msg('comments.more-options')}\n\t\t\t\t>\n\t\t\t\t\t<MoreIcon />\n\t\t\t\t</button>\n\t\t\t</TldrawUiDropdownMenuTrigger>\n\t\t\t<TldrawUiDropdownMenuContent side=\"bottom\" align=\"end\">\n\t\t\t\t<TldrawUiDropdownMenuGroup>\n\t\t\t\t\t<TldrawUiDropdownMenuItem>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclassName=\"cmt-menu-item\"\n\t\t\t\t\t\t\tonClick={() => toggleCommentsHidden(editor)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>{hidden ? msg('comments.show') : msg('comments.hide')}</span>\n\t\t\t\t\t\t\t<span className=\"cmt-menu-item__shortcut\">{HIDE_SHORTCUT}</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</TldrawUiDropdownMenuItem>\n\t\t\t\t</TldrawUiDropdownMenuGroup>\n\t\t\t</TldrawUiDropdownMenuContent>\n\t\t</TldrawUiDropdownMenuRoot>\n\t)\n}\n\nfunction MoreIcon() {\n\treturn (\n\t\t<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t<circle cx=\"3\" cy=\"8\" r=\"1.4\" />\n\t\t\t<circle cx=\"8\" cy=\"8\" r=\"1.4\" />\n\t\t\t<circle cx=\"13\" cy=\"8\" r=\"1.4\" />\n\t\t</svg>\n\t)\n}\n"],
|
|
5
|
-
"mappings": "AAgCK,cAMC,YAND;AAhCL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,gBAAgB,4BAA4B;AAGrD,MAAM,gBAAgB;AAKf,SAAS,uBAAuB;AACtC,QAAM,SAAS,UAAU;AACzB,QAAM,MAAM,eAAe;AAC3B,QAAM,SAAS,SAAS,mBAAmB,MAAM,eAAe,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC;AAErF,SACC,qBAAC,4BAAyB,IAAG,qBAC5B;AAAA,wBAAC,+BACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAO,IAAI,uBAAuB;AAAA,QAClC,cAAY,IAAI,uBAAuB;AAAA,QAEvC,8BAAC,YAAS;AAAA;AAAA,IACX,GACD;AAAA,IACA,oBAAC,+BAA4B,MAAK,UAAS,OAAM,OAChD,8BAAC,6BACA,8BAAC,4BACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAS,MAAM,qBAAqB,MAAM;AAAA,QAE1C;AAAA,8BAAC,UAAM,mBAAS,IAAI,eAAe,IAAI,IAAI,eAAe,GAAE;AAAA,UAC5D,oBAAC,UAAK,WAAU,
|
|
4
|
+
"sourcesContent": ["import {\n\tTldrawUiDropdownMenuContent,\n\tTldrawUiDropdownMenuGroup,\n\tTldrawUiDropdownMenuItem,\n\tTldrawUiDropdownMenuRoot,\n\tTldrawUiDropdownMenuTrigger,\n\tuseEditor,\n\tuseTranslation,\n\tuseValue,\n} from 'tldraw'\nimport { commentsHidden, toggleCommentsHidden } from './state'\n\n// A keyboard-shortcut glyph, not translatable copy \u2014 kept out of JSX as a constant.\nconst HIDE_SHORTCUT = '\u21E7C'\n\n/** The overflow (\u22EF) dropdown in the sidebar header. For now it holds the hide/show-comments\n * toggle; it's the home for later comment-wide controls (notifications, mark all as read).\n * @public @react */\nexport function CommentsOverflowMenu() {\n\tconst editor = useEditor()\n\tconst msg = useTranslation()\n\tconst hidden = useValue('comments hidden', () => commentsHidden.get(editor), [editor])\n\n\treturn (\n\t\t<TldrawUiDropdownMenuRoot id=\"comments-overflow\">\n\t\t\t<TldrawUiDropdownMenuTrigger>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"tlui-cmt-header-btn\"\n\t\t\t\t\ttitle={msg('comments.more-options')}\n\t\t\t\t\taria-label={msg('comments.more-options')}\n\t\t\t\t>\n\t\t\t\t\t<MoreIcon />\n\t\t\t\t</button>\n\t\t\t</TldrawUiDropdownMenuTrigger>\n\t\t\t<TldrawUiDropdownMenuContent side=\"bottom\" align=\"end\">\n\t\t\t\t<TldrawUiDropdownMenuGroup>\n\t\t\t\t\t<TldrawUiDropdownMenuItem>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclassName=\"tlui-cmt-menu-item\"\n\t\t\t\t\t\t\tonClick={() => toggleCommentsHidden(editor)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>{hidden ? msg('comments.show') : msg('comments.hide')}</span>\n\t\t\t\t\t\t\t<span className=\"tlui-cmt-menu-item__shortcut\">{HIDE_SHORTCUT}</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</TldrawUiDropdownMenuItem>\n\t\t\t\t</TldrawUiDropdownMenuGroup>\n\t\t\t</TldrawUiDropdownMenuContent>\n\t\t</TldrawUiDropdownMenuRoot>\n\t)\n}\n\nfunction MoreIcon() {\n\treturn (\n\t\t<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n\t\t\t<circle cx=\"3\" cy=\"8\" r=\"1.4\" />\n\t\t\t<circle cx=\"8\" cy=\"8\" r=\"1.4\" />\n\t\t\t<circle cx=\"13\" cy=\"8\" r=\"1.4\" />\n\t\t</svg>\n\t)\n}\n"],
|
|
5
|
+
"mappings": "AAgCK,cAMC,YAND;AAhCL;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,gBAAgB,4BAA4B;AAGrD,MAAM,gBAAgB;AAKf,SAAS,uBAAuB;AACtC,QAAM,SAAS,UAAU;AACzB,QAAM,MAAM,eAAe;AAC3B,QAAM,SAAS,SAAS,mBAAmB,MAAM,eAAe,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC;AAErF,SACC,qBAAC,4BAAyB,IAAG,qBAC5B;AAAA,wBAAC,+BACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV,OAAO,IAAI,uBAAuB;AAAA,QAClC,cAAY,IAAI,uBAAuB;AAAA,QAEvC,8BAAC,YAAS;AAAA;AAAA,IACX,GACD;AAAA,IACA,oBAAC,+BAA4B,MAAK,UAAS,OAAM,OAChD,8BAAC,6BACA,8BAAC,4BACA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAS,MAAM,qBAAqB,MAAM;AAAA,QAE1C;AAAA,8BAAC,UAAM,mBAAS,IAAI,eAAe,IAAI,IAAI,eAAe,GAAE;AAAA,UAC5D,oBAAC,UAAK,WAAU,gCAAgC,yBAAc;AAAA;AAAA;AAAA,IAC/D,GACD,GACD,GACD;AAAA,KACD;AAEF;AAEA,SAAS,WAAW;AACnB,SACC,qBAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,gBAAe,eAAY,QAC/E;AAAA,wBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM;AAAA,IAC9B,oBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM;AAAA,IAC9B,oBAAC,YAAO,IAAG,MAAK,IAAG,KAAI,GAAE,OAAM;AAAA,KAChC;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -109,17 +109,17 @@ function CanvasCommentsLayer(props) {
|
|
|
109
109
|
const pending = usePendingComment();
|
|
110
110
|
const openId = useValue("open thread id", () => openThreadId.get(editor), [editor]);
|
|
111
111
|
const impreciseShapeAnchor = props.impreciseShapeAnchor ?? options.impreciseShapeAnchor;
|
|
112
|
-
const [
|
|
112
|
+
const [heldThreadIds, setHeldThreadIds] = useState(EMPTY_SET);
|
|
113
113
|
const adoptOnRebuild = useRef(false);
|
|
114
114
|
const clusterLeaves = useValue(
|
|
115
115
|
"comment cluster leaves",
|
|
116
116
|
() => collectClusterLeaves(
|
|
117
117
|
editor,
|
|
118
|
-
threads.filter((thread) => !
|
|
118
|
+
threads.filter((thread) => !heldThreadIds.has(thread.id)),
|
|
119
119
|
openThreadId.get(editor),
|
|
120
120
|
impreciseShapeAnchor
|
|
121
121
|
),
|
|
122
|
-
[editor, threads, impreciseShapeAnchor,
|
|
122
|
+
[editor, threads, impreciseShapeAnchor, heldThreadIds]
|
|
123
123
|
);
|
|
124
124
|
const clusterZoomBounds = useValue(
|
|
125
125
|
"comment cluster zoom bounds",
|
|
@@ -134,21 +134,41 @@ function CanvasCommentsLayer(props) {
|
|
|
134
134
|
}, [clusterLeaves, clusterZoomBounds, editor]);
|
|
135
135
|
const [renderedModel, setRenderedModel] = useState(latestModel);
|
|
136
136
|
let clusterModel = renderedModel;
|
|
137
|
-
|
|
137
|
+
const pageId = useValue("comment cluster page", () => editor.getCurrentPageId(), [editor]);
|
|
138
|
+
const pageRef = useRef(pageId);
|
|
139
|
+
if (pageRef.current !== pageId) {
|
|
140
|
+
pageRef.current = pageId;
|
|
141
|
+
adoptOnRebuild.current = false;
|
|
142
|
+
latestModel.runtime.seed(editor.getZoomLevel());
|
|
143
|
+
if (heldThreadIds.size > 0) setHeldThreadIds(EMPTY_SET);
|
|
144
|
+
setRenderedModel(latestModel);
|
|
145
|
+
clusterModel = latestModel;
|
|
146
|
+
}
|
|
147
|
+
const rejoinPending = heldThreadIds.size === 0 && adoptOnRebuild.current;
|
|
148
|
+
if (renderedModel !== latestModel && rejoinPending) {
|
|
138
149
|
adoptOnRebuild.current = false;
|
|
139
150
|
latestModel.runtime.seedFrom(editor.getZoomLevel(), renderedModel.runtime.getVisible());
|
|
140
151
|
setRenderedModel(latestModel);
|
|
141
152
|
clusterModel = latestModel;
|
|
153
|
+
} else if (heldThreadIds.size === 0 && renderedModel === latestModel) {
|
|
154
|
+
adoptOnRebuild.current = false;
|
|
142
155
|
}
|
|
143
156
|
const newlyMovedIds = findMovedClusteredLeafIds(clusterModel, latestModel);
|
|
144
157
|
if (newlyMovedIds.length > 0) {
|
|
145
|
-
|
|
146
|
-
const next = new Set(movedThreadIds);
|
|
158
|
+
const next = new Set(heldThreadIds);
|
|
147
159
|
for (const id of newlyMovedIds) next.add(id);
|
|
148
|
-
|
|
160
|
+
setHeldThreadIds(next);
|
|
161
|
+
}
|
|
162
|
+
{
|
|
163
|
+
const latestLeafIds = new Set(latestModel.table.leaves.map((leaf) => leaf.id));
|
|
164
|
+
for (const leaf of clusterModel.table.leaves) {
|
|
165
|
+
if (!latestLeafIds.has(leaf.id)) {
|
|
166
|
+
clusterModel.runtime.detachLeaf(leaf.id);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
149
169
|
}
|
|
150
170
|
useEffect(() => {
|
|
151
|
-
if (
|
|
171
|
+
if (heldThreadIds.size === 0) return;
|
|
152
172
|
let lastZoom = editor.getZoomLevel();
|
|
153
173
|
return react("rejoin moved comment pins on zoom out", () => {
|
|
154
174
|
const zoom = editor.getZoomLevel();
|
|
@@ -156,9 +176,9 @@ function CanvasCommentsLayer(props) {
|
|
|
156
176
|
lastZoom = zoom;
|
|
157
177
|
if (zoom >= prevZoom) return;
|
|
158
178
|
adoptOnRebuild.current = true;
|
|
159
|
-
|
|
179
|
+
setHeldThreadIds(EMPTY_SET);
|
|
160
180
|
});
|
|
161
|
-
}, [
|
|
181
|
+
}, [heldThreadIds, editor]);
|
|
162
182
|
useEffect(() => {
|
|
163
183
|
if (clusterModel === latestModel) return;
|
|
164
184
|
let lastZoom = editor.getZoomLevel();
|
|
@@ -171,31 +191,31 @@ function CanvasCommentsLayer(props) {
|
|
|
171
191
|
setRenderedModel(latestModel);
|
|
172
192
|
});
|
|
173
193
|
}, [clusterModel, latestModel, editor]);
|
|
194
|
+
const partitionVersion = clusterModel.runtime.version;
|
|
174
195
|
const orphanThreads = useMemo(() => {
|
|
175
196
|
if (clusterModel === latestModel) return [];
|
|
176
|
-
const
|
|
197
|
+
const displayed = /* @__PURE__ */ new Set();
|
|
198
|
+
for (const node of clusterModel.runtime.getVisible().values()) {
|
|
199
|
+
for (const member of node.members) displayed.add(member);
|
|
200
|
+
}
|
|
177
201
|
const latestIds = new Set(latestModel.table.leaves.map((leaf) => leaf.id));
|
|
178
|
-
return threads.filter((thread) => latestIds.has(thread.id) && !
|
|
179
|
-
}, [clusterModel, latestModel, threads]);
|
|
180
|
-
const
|
|
181
|
-
() => threads.filter((thread) =>
|
|
182
|
-
[threads,
|
|
202
|
+
return threads.filter((thread) => latestIds.has(thread.id) && !displayed.has(thread.id));
|
|
203
|
+
}, [clusterModel, latestModel, threads, partitionVersion]);
|
|
204
|
+
const heldThreads = useMemo(
|
|
205
|
+
() => threads.filter((thread) => heldThreadIds.has(thread.id) && thread.id !== openId),
|
|
206
|
+
[threads, heldThreadIds, openId]
|
|
183
207
|
);
|
|
184
|
-
|
|
185
|
-
"comment cluster
|
|
208
|
+
useValue(
|
|
209
|
+
"comment cluster version",
|
|
186
210
|
() => {
|
|
187
211
|
clusterModel.runtime.onCamera(editor.getZoomLevel());
|
|
188
|
-
return clusterModel.runtime.
|
|
212
|
+
return clusterModel.runtime.version;
|
|
189
213
|
},
|
|
190
214
|
[clusterModel, editor]
|
|
191
215
|
);
|
|
192
216
|
const visibleNodes = useMemo(() => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
`[comments] cluster cursor k=${clusterCursor} \u2192 re-rendering ${nodes.length} visible nodes`
|
|
196
|
-
);
|
|
197
|
-
return nodes;
|
|
198
|
-
}, [clusterModel, clusterCursor]);
|
|
217
|
+
return Array.from(clusterModel.runtime.getVisible().values());
|
|
218
|
+
}, [clusterModel, partitionVersion]);
|
|
199
219
|
const fadeNodes = useFadeVisibleNodes(visibleNodes, clusterModel);
|
|
200
220
|
const threadsById = useMemo(
|
|
201
221
|
() => new Map(threads.map((thread) => [thread.id, thread])),
|
|
@@ -254,7 +274,7 @@ function CanvasCommentsLayer(props) {
|
|
|
254
274
|
if (e.key !== "Escape" || openThreadId.get(editor) === null) return;
|
|
255
275
|
if (isMentionPickerOpen()) return;
|
|
256
276
|
const target = e.target;
|
|
257
|
-
if (target && target.closest(".cmt-editing")) return;
|
|
277
|
+
if (target && target.closest(".tlui-cmt-editing")) return;
|
|
258
278
|
openThreadId.set(editor, null);
|
|
259
279
|
e.preventDefault();
|
|
260
280
|
e.stopPropagation();
|
|
@@ -275,7 +295,7 @@ function CanvasCommentsLayer(props) {
|
|
|
275
295
|
}, [editor]);
|
|
276
296
|
if (hidden) return null;
|
|
277
297
|
return createPortal(
|
|
278
|
-
/* @__PURE__ */ jsxs("div", { ref: layerRef, className: "cmt-canvas-layer", children: [
|
|
298
|
+
/* @__PURE__ */ jsxs("div", { ref: layerRef, className: "tlui-cmt-canvas-layer", children: [
|
|
279
299
|
options.enableClustering ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
280
300
|
fadeNodes.map(({ node, phase }) => {
|
|
281
301
|
let content;
|
|
@@ -306,7 +326,7 @@ function CanvasCommentsLayer(props) {
|
|
|
306
326
|
},
|
|
307
327
|
thread.id
|
|
308
328
|
)),
|
|
309
|
-
|
|
329
|
+
heldThreads.map((thread) => /* @__PURE__ */ jsx(
|
|
310
330
|
ThreadPin,
|
|
311
331
|
{
|
|
312
332
|
editor,
|
|
@@ -415,7 +435,7 @@ function cancelClusterFadeFrame(frame) {
|
|
|
415
435
|
else window.clearTimeout(frame);
|
|
416
436
|
}
|
|
417
437
|
function clusterFadeClassName(phase) {
|
|
418
|
-
return `cmt-cluster-fade cmt-cluster-fade--${phase}`;
|
|
438
|
+
return `tlui-cmt-cluster-fade tlui-cmt-cluster-fade--${phase}`;
|
|
419
439
|
}
|
|
420
440
|
function findMovedClusteredLeafIds(rendered, latest) {
|
|
421
441
|
if (rendered.table === latest.table) return [];
|
|
@@ -432,11 +452,6 @@ function findMovedClusteredLeafIds(rendered, latest) {
|
|
|
432
452
|
}
|
|
433
453
|
return moved;
|
|
434
454
|
}
|
|
435
|
-
function hasRemovedLeaves(rendered, latest) {
|
|
436
|
-
if (rendered.leaves.length === 0) return false;
|
|
437
|
-
const latestIds = new Set(latest.leaves.map((leaf) => leaf.id));
|
|
438
|
-
return rendered.leaves.some((leaf) => !latestIds.has(leaf.id));
|
|
439
|
-
}
|
|
440
455
|
function getClusterZoomBounds(editor) {
|
|
441
456
|
const cameraOptions = editor.getCameraOptions();
|
|
442
457
|
const baseZoom = cameraOptions.constraints ? editor.getBaseZoom() : 1;
|
|
@@ -501,7 +516,7 @@ const ClusterBadge = memo(function ClusterBadge2({
|
|
|
501
516
|
return /* @__PURE__ */ jsx(
|
|
502
517
|
"div",
|
|
503
518
|
{
|
|
504
|
-
className: "cmt-canvas-cluster",
|
|
519
|
+
className: "tlui-cmt-canvas-cluster",
|
|
505
520
|
style: { left: point.x, top: point.y },
|
|
506
521
|
onPointerDown: stop,
|
|
507
522
|
onClick: (e) => {
|
|
@@ -526,7 +541,7 @@ function ThreadPopover({
|
|
|
526
541
|
usePassThroughWheelEvents(ref);
|
|
527
542
|
usePassThroughMouseOverEvents(ref);
|
|
528
543
|
return createPortal(
|
|
529
|
-
/* @__PURE__ */ jsx("div", { ref, className: "cmt-canvas-popover", style, onPointerDown: stop, children }),
|
|
544
|
+
/* @__PURE__ */ jsx("div", { ref, className: "tlui-cmt-canvas-popover", style, onPointerDown: stop, children }),
|
|
530
545
|
container
|
|
531
546
|
);
|
|
532
547
|
}
|
|
@@ -571,7 +586,7 @@ function RegionBox({
|
|
|
571
586
|
return /* @__PURE__ */ jsx(
|
|
572
587
|
"div",
|
|
573
588
|
{
|
|
574
|
-
className: movable ? "cmt-canvas-region cmt-canvas-region--movable" : "cmt-canvas-region",
|
|
589
|
+
className: movable ? "tlui-cmt-canvas-region tlui-cmt-canvas-region--movable" : "tlui-cmt-canvas-region",
|
|
575
590
|
style: rect,
|
|
576
591
|
onPointerDown: movable ? startMove : void 0,
|
|
577
592
|
onPointerMove: movable ? onMove : void 0,
|
|
@@ -645,7 +660,7 @@ function RegionResizeHandles({
|
|
|
645
660
|
return /* @__PURE__ */ jsx(Fragment, { children: points.map((h) => /* @__PURE__ */ jsx(
|
|
646
661
|
"div",
|
|
647
662
|
{
|
|
648
|
-
className: "cmt-canvas-region-handle",
|
|
663
|
+
className: "tlui-cmt-canvas-region-handle",
|
|
649
664
|
style: { left: h.left, top: h.top, cursor: h.cursor },
|
|
650
665
|
onPointerDown: startResize,
|
|
651
666
|
onPointerMove: onResize(h),
|
|
@@ -710,11 +725,11 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
710
725
|
const onPointerDown = (e) => {
|
|
711
726
|
const target = e.target;
|
|
712
727
|
if (!target) return;
|
|
713
|
-
if (target.closest(".cmt-canvas-popover")) return;
|
|
728
|
+
if (target.closest(".tlui-cmt-canvas-popover")) return;
|
|
714
729
|
const marker = markerRef.current;
|
|
715
730
|
if (marker && marker.contains(target)) return;
|
|
716
|
-
if (target.closest(".cmt-canvas-region-handle, .cmt-canvas-region--movable")) return;
|
|
717
|
-
if (target.closest(".tlui-menu, [data-radix-popper-content-wrapper], .cmt-mention-popup"))
|
|
731
|
+
if (target.closest(".tlui-cmt-canvas-region-handle, .tlui-cmt-canvas-region--movable")) return;
|
|
732
|
+
if (target.closest(".tlui-menu, [data-radix-popper-content-wrapper], .tlui-cmt-mention-popup"))
|
|
718
733
|
return;
|
|
719
734
|
openThreadId.set(editor, null);
|
|
720
735
|
};
|
|
@@ -790,7 +805,7 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
790
805
|
return /* @__PURE__ */ jsx(
|
|
791
806
|
"div",
|
|
792
807
|
{
|
|
793
|
-
className: "cmt-editing",
|
|
808
|
+
className: "tlui-cmt-editing",
|
|
794
809
|
onKeyDown: (e) => {
|
|
795
810
|
if (e.key === "Escape") {
|
|
796
811
|
setEditingId(null);
|
|
@@ -822,7 +837,7 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
822
837
|
actions: comment.authorId === currentUserId ? /* @__PURE__ */ jsx(
|
|
823
838
|
"button",
|
|
824
839
|
{
|
|
825
|
-
className: "cmt-thread__action",
|
|
840
|
+
className: "tlui-cmt-thread__action",
|
|
826
841
|
title: msg("comments.edit"),
|
|
827
842
|
onClick: () => startEdit(comment),
|
|
828
843
|
children: /* @__PURE__ */ jsx(TldrawUiIcon, { icon: "dots-horizontal", label: msg("comments.edit"), small: true })
|
|
@@ -835,7 +850,7 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
835
850
|
currentUserId && /* @__PURE__ */ jsx(
|
|
836
851
|
"button",
|
|
837
852
|
{
|
|
838
|
-
className: "cmt-thread__action",
|
|
853
|
+
className: "tlui-cmt-thread__action",
|
|
839
854
|
title: msg(thread.resolved ? "comments.reopen" : "comments.resolve"),
|
|
840
855
|
onClick: toggleResolve,
|
|
841
856
|
children: /* @__PURE__ */ jsx(
|
|
@@ -851,7 +866,7 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
851
866
|
currentUserId && /* @__PURE__ */ jsx(
|
|
852
867
|
"button",
|
|
853
868
|
{
|
|
854
|
-
className: "cmt-thread__action",
|
|
869
|
+
className: "tlui-cmt-thread__action",
|
|
855
870
|
title: msg("comments.delete"),
|
|
856
871
|
onClick: deleteThread,
|
|
857
872
|
children: /* @__PURE__ */ jsx(TldrawUiIcon, { icon: "trash", label: msg("comments.delete"), small: true })
|
|
@@ -860,7 +875,7 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
860
875
|
/* @__PURE__ */ jsx(
|
|
861
876
|
"button",
|
|
862
877
|
{
|
|
863
|
-
className: "cmt-thread__action",
|
|
878
|
+
className: "tlui-cmt-thread__action",
|
|
864
879
|
title: msg("comments.dismiss"),
|
|
865
880
|
onClick: () => openThreadId.set(editor, null),
|
|
866
881
|
children: /* @__PURE__ */ jsx(TldrawUiIcon, { icon: "cross-2", label: msg("comments.dismiss"), small: true })
|
|
@@ -953,14 +968,14 @@ const ThreadPin = memo(function ThreadPin2({
|
|
|
953
968
|
/* @__PURE__ */ jsxs(
|
|
954
969
|
"div",
|
|
955
970
|
{
|
|
956
|
-
className: open ? "cmt-canvas-pin cmt-canvas-pin--open" : "cmt-canvas-pin",
|
|
971
|
+
className: open ? "tlui-cmt-canvas-pin tlui-cmt-canvas-pin--open" : "tlui-cmt-canvas-pin",
|
|
957
972
|
style: { left: renderPoint.x, top: renderPoint.y },
|
|
958
973
|
children: [
|
|
959
974
|
/* @__PURE__ */ jsx(
|
|
960
975
|
"div",
|
|
961
976
|
{
|
|
962
977
|
ref: markerRef,
|
|
963
|
-
className: "cmt-canvas-pin__marker",
|
|
978
|
+
className: "tlui-cmt-canvas-pin__marker",
|
|
964
979
|
onPointerDown: startDrag,
|
|
965
980
|
onPointerMove: onDrag,
|
|
966
981
|
onPointerUp: endDrag,
|
|
@@ -1029,7 +1044,7 @@ function PendingComposer({
|
|
|
1029
1044
|
const el = ref.current;
|
|
1030
1045
|
const target = e.target;
|
|
1031
1046
|
if (!el || !target) return;
|
|
1032
|
-
if (el.contains(target) || target.closest(".cmt-mention-popup")) return;
|
|
1047
|
+
if (el.contains(target) || target.closest(".tlui-cmt-mention-popup")) return;
|
|
1033
1048
|
pendingComment.set(editor, null);
|
|
1034
1049
|
};
|
|
1035
1050
|
document.addEventListener("pointerdown", onPointerDown, true);
|
|
@@ -1061,7 +1076,7 @@ function PendingComposer({
|
|
|
1061
1076
|
"div",
|
|
1062
1077
|
{
|
|
1063
1078
|
ref,
|
|
1064
|
-
className: "cmt-canvas-composer",
|
|
1079
|
+
className: "tlui-cmt-canvas-composer",
|
|
1065
1080
|
style: { left: point.x, top: point.y },
|
|
1066
1081
|
onPointerDown: stop,
|
|
1067
1082
|
onKeyDown: (e) => {
|