@tldraw/commenting 5.4.0-canary.ea97ad4956b1 → 5.4.0-canary.fa89ff126c46

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.md ADDED
@@ -0,0 +1 @@
1
+ This code is licensed under the [tldraw license](https://github.com/tldraw/tldraw/blob/main/LICENSE.md)
@@ -23,6 +23,6 @@ __export(license_exports, {
23
23
  module.exports = __toCommonJS(license_exports);
24
24
  var import_tldraw = require("tldraw");
25
25
  function useCommentingEnabled() {
26
- return (0, import_tldraw.useLicenseFeatureFlag)((0, import_tldraw.useLicenseContext)(), "commenting");
26
+ return (0, import_tldraw.useLicenseFeatureFlag)((0, import_tldraw.useMaybeLicenseManager)(), "commenting");
27
27
  }
28
28
  //# sourceMappingURL=license.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/canvas/license.ts"],
4
- "sourcesContent": ["import { useLicenseContext, useLicenseFeatureFlag } from 'tldraw'\n\n/**\n * Whether commenting is licensed for this editor. Enabled in development; in production it requires\n * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants\n * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is\n * pending, so gated UI stays hidden until the license is confirmed.\n *\n * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment\n * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.\n * @public\n */\nexport function useCommentingEnabled(): boolean {\n\treturn useLicenseFeatureFlag(useLicenseContext(), 'commenting')\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyD;AAYlD,SAAS,uBAAgC;AAC/C,aAAO,yCAAsB,iCAAkB,GAAG,YAAY;AAC/D;",
4
+ "sourcesContent": ["import { useLicenseFeatureFlag, useMaybeLicenseManager } from 'tldraw'\n\n/**\n * Whether commenting is licensed for this editor. Enabled in development; in production it requires\n * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants\n * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is\n * pending, so gated UI stays hidden until the license is confirmed. Works outside `<Tldraw />` too:\n * UI mounted via `EditorProvider` resolves the license through the editor, and with no editor at\n * all this is `false`.\n *\n * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment\n * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.\n * @public\n */\nexport function useCommentingEnabled(): boolean {\n\treturn useLicenseFeatureFlag(useMaybeLicenseManager(), 'commenting')\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA8D;AAcvD,SAAS,uBAAgC;AAC/C,aAAO,yCAAsB,sCAAuB,GAAG,YAAY;AACpE;",
6
6
  "names": []
7
7
  }
@@ -128,7 +128,7 @@ export declare interface CommentBodyProps {
128
128
  }
129
129
 
130
130
  /** A single comment: Avatar, Byline, and a body slot the consumer renders. @public @react */
131
- export declare function CommentCard({ author, body, date, you, edited, actions, footer }: CommentCardProps): JSX.Element;
131
+ export declare function CommentCard({ author, body, date, you, edited, actions, footer, }: CommentCardProps): JSX.Element;
132
132
 
133
133
  /** @public */
134
134
  export declare interface CommentCardProps {
@@ -154,7 +154,7 @@ export declare interface CommentCardProps {
154
154
  * floating toolbar. Presentational by default; pass value/onChange/onSubmit to drive it as a form.
155
155
  * @public @react
156
156
  */
157
- export declare function CommentComposer({ author, placeholder, value, onChange, onSubmit, sendLabel, onArrowUpWhenEmpty, disabled, autoFocus, leading, getMentionSuggestions, renderMentionSuggestion }: CommentComposerProps): JSX.Element;
157
+ export declare function CommentComposer({ author, placeholder, value, onChange, onSubmit, sendLabel, onArrowUpWhenEmpty, disabled, autoFocus, leading, getMentionSuggestions, renderMentionSuggestion, }: CommentComposerProps): JSX.Element;
158
158
 
159
159
  /** @public */
160
160
  export declare interface CommentComposerProps {
@@ -398,7 +398,7 @@ export declare interface CommentingOptions {
398
398
  }
399
399
 
400
400
  /** One thread's row in a {@link CommentsList}. @public @react */
401
- export declare function CommentListItem({ id, author, preview, date, resolved, page, count, selected, reactions, href, resolvedLabel, onSelect }: CommentListItemRenderProps): JSX.Element;
401
+ export declare function CommentListItem({ id, author, preview, date, resolved, page, count, selected, reactions, href, resolvedLabel, onSelect, }: CommentListItemRenderProps): JSX.Element;
402
402
 
403
403
  /** @public */
404
404
  export declare interface CommentListItemProps {
@@ -490,7 +490,7 @@ export declare interface CommentPinProps {
490
490
  * than in the reaction row, so opening it doesn't chase the row as reactions are added.
491
491
  * @public @react
492
492
  */
493
- export declare function CommentReactionPicker({ comment, currentUserId, emoji }: CommentReactionPickerProps): JSX.Element | null;
493
+ export declare function CommentReactionPicker({ comment, currentUserId, emoji, }: CommentReactionPickerProps): JSX.Element | null;
494
494
 
495
495
  /** @public */
496
496
  export declare interface CommentReactionPickerProps {
@@ -520,7 +520,7 @@ export declare interface CommentReactionsProps {
520
520
 
521
521
  /** The funnel dropdown in the sidebar header: toggles for which threads the list shows.
522
522
  * @public @react */
523
- export declare function CommentsFilterMenu({ canFilterByAuthor, canFilterByUnread }: CommentsFilterMenuProps): JSX.Element;
523
+ export declare function CommentsFilterMenu({ canFilterByAuthor, canFilterByUnread, }: CommentsFilterMenuProps): JSX.Element;
524
524
 
525
525
  /** @public */
526
526
  export declare interface CommentsFilterMenuProps {
@@ -543,7 +543,7 @@ export declare const commentsHidden: EditorAtom<boolean>;
543
543
  * `CanvasCommentsSidebar` wires it to the store, but a consumer can build their own list from this.
544
544
  * @public @react
545
545
  */
546
- export declare function CommentsList({ items, onSelect, header, headerAction, empty, resolvedLabel, renderItem }: CommentsListProps): JSX.Element;
546
+ export declare function CommentsList({ items, onSelect, header, headerAction, empty, resolvedLabel, renderItem, }: CommentsListProps): JSX.Element;
547
547
 
548
548
  /** @public */
549
549
  export declare interface CommentsListProps {
@@ -598,7 +598,7 @@ export declare function CommentsVisibilityToggle(): JSX.Element;
598
598
  * composer's handlers; how each comment renders is overridable via `renderComment`.
599
599
  * @public @react
600
600
  */
601
- export declare function CommentThread({ comments, header, headerActions, resolvedBanner, composer, footer, renderComment }: CommentThreadProps): JSX.Element;
601
+ export declare function CommentThread({ comments, header, headerActions, resolvedBanner, composer, footer, renderComment, }: CommentThreadProps): JSX.Element;
602
602
 
603
603
  /** @public */
604
604
  export declare interface CommentThreadProps {
@@ -661,7 +661,7 @@ export declare class CommentTool extends StateNode {
661
661
  export declare const commentToolOverrides: TLUiOverrides;
662
662
 
663
663
  /** @public */
664
- export declare const commentTools: typeof CommentTool[];
664
+ export declare const commentTools: (typeof CommentTool)[];
665
665
 
666
666
  /** @public @react */
667
667
  export declare function CountBadge({ count, open }: CountBadgeProps): JSX.Element;
@@ -716,7 +716,7 @@ export declare const defaultCommentingOptions: {
716
716
  readonly dragHistory: undefined;
717
717
  readonly enableClustering: true;
718
718
  readonly enableRegions: false;
719
- readonly history: "ignore";
719
+ readonly history: 'ignore';
720
720
  readonly impreciseShapeAnchor: {
721
721
  readonly x: 1;
722
722
  readonly y: 0;
@@ -803,7 +803,7 @@ export declare function editComment(editor: Editor, comment: TLComment, body: TL
803
803
  * dismissal; `ReactionPicker` renders it in a dropdown under the add-reaction button.
804
804
  * @public @react
805
805
  */
806
- export declare function EmojiPicker({ emoji, selected, onSelect, renderReaction }: EmojiPickerProps): JSX.Element;
806
+ export declare function EmojiPicker({ emoji, selected, onSelect, renderReaction, }: EmojiPickerProps): JSX.Element;
807
807
 
808
808
  /** @public */
809
809
  export declare interface EmojiPickerProps {
@@ -982,7 +982,7 @@ export declare function putCommentRecords(editor: Editor, records: TLCommentReco
982
982
  * tooltip naming who reacted (the current user included), when `enableHoverList` is set.
983
983
  * @public @react
984
984
  */
985
- export declare function Reaction({ emoji, count, active, reactors, enableHoverList, renderReaction, ReactionTooltip, onClick }: ReactionProps): JSX.Element;
985
+ export declare function Reaction({ emoji, count, active, reactors, enableHoverList, renderReaction, ReactionTooltip, onClick, }: ReactionProps): JSX.Element;
986
986
 
987
987
  /**
988
988
  * The add-reaction affordance: a smiley button that opens an emoji grid.
@@ -994,7 +994,7 @@ export declare function Reaction({ emoji, count, active, reactors, enableHoverLi
994
994
  * done its job — and hands focus back to the trigger.
995
995
  * @public @react
996
996
  */
997
- export declare function ReactionPicker({ emoji, selected, onSelect, renderReaction, palette: Palette, menuId, className }: ReactionPickerProps): JSX.Element;
997
+ export declare function ReactionPicker({ emoji, selected, onSelect, renderReaction, palette: Palette, menuId, className, }: ReactionPickerProps): JSX.Element;
998
998
 
999
999
  /** @public */
1000
1000
  export declare interface ReactionPickerProps {
@@ -1062,7 +1062,7 @@ export declare interface ReactionReactor {
1062
1062
  * fixed as reactions are added here.
1063
1063
  * @public @react
1064
1064
  */
1065
- export declare function Reactions({ reactions, onToggle, canReact, enableHoverList, renderReaction, ReactionTooltip }: ReactionsProps): JSX.Element | null;
1065
+ export declare function Reactions({ reactions, onToggle, canReact, enableHoverList, renderReaction, ReactionTooltip, }: ReactionsProps): JSX.Element | null;
1066
1066
 
1067
1067
  /** @public */
1068
1068
  export declare interface ReactionsProps {
@@ -1352,7 +1352,9 @@ export declare function useCanModifyComment(currentUserId: null | string | undef
1352
1352
  * Whether commenting is licensed for this editor. Enabled in development; in production it requires
1353
1353
  * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants
1354
1354
  * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is
1355
- * pending, so gated UI stays hidden until the license is confirmed.
1355
+ * pending, so gated UI stays hidden until the license is confirmed. Works outside `<Tldraw />` too:
1356
+ * UI mounted via `EditorProvider` resolves the license through the editor, and with no editor at
1357
+ * all this is `false`.
1356
1358
  *
1357
1359
  * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment
1358
1360
  * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.
package/dist-cjs/index.js CHANGED
@@ -144,7 +144,7 @@ var import_state = require("./canvas/state");
144
144
  var import_thread_state = require("./canvas/thread-state");
145
145
  (0, import_utils.registerTldrawLibraryVersion)(
146
146
  "@tldraw/commenting",
147
- "5.4.0-canary.ea97ad4956b1",
147
+ "5.4.0-canary.fa89ff126c46",
148
148
  "cjs"
149
149
  );
150
150
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- import { useLicenseContext, useLicenseFeatureFlag } from "tldraw";
1
+ import { useLicenseFeatureFlag, useMaybeLicenseManager } from "tldraw";
2
2
  function useCommentingEnabled() {
3
- return useLicenseFeatureFlag(useLicenseContext(), "commenting");
3
+ return useLicenseFeatureFlag(useMaybeLicenseManager(), "commenting");
4
4
  }
5
5
  export {
6
6
  useCommentingEnabled
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/canvas/license.ts"],
4
- "sourcesContent": ["import { useLicenseContext, useLicenseFeatureFlag } from 'tldraw'\n\n/**\n * Whether commenting is licensed for this editor. Enabled in development; in production it requires\n * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants\n * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is\n * pending, so gated UI stays hidden until the license is confirmed.\n *\n * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment\n * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.\n * @public\n */\nexport function useCommentingEnabled(): boolean {\n\treturn useLicenseFeatureFlag(useLicenseContext(), 'commenting')\n}\n"],
5
- "mappings": "AAAA,SAAS,mBAAmB,6BAA6B;AAYlD,SAAS,uBAAgC;AAC/C,SAAO,sBAAsB,kBAAkB,GAAG,YAAY;AAC/D;",
4
+ "sourcesContent": ["import { useLicenseFeatureFlag, useMaybeLicenseManager } from 'tldraw'\n\n/**\n * Whether commenting is licensed for this editor. Enabled in development; in production it requires\n * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants\n * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is\n * pending, so gated UI stays hidden until the license is confirmed. Works outside `<Tldraw />` too:\n * UI mounted via `EditorProvider` resolves the license through the editor, and with no editor at\n * all this is `false`.\n *\n * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment\n * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.\n * @public\n */\nexport function useCommentingEnabled(): boolean {\n\treturn useLicenseFeatureFlag(useMaybeLicenseManager(), 'commenting')\n}\n"],
5
+ "mappings": "AAAA,SAAS,uBAAuB,8BAA8B;AAcvD,SAAS,uBAAgC;AAC/C,SAAO,sBAAsB,uBAAuB,GAAG,YAAY;AACpE;",
6
6
  "names": []
7
7
  }
@@ -128,7 +128,7 @@ export declare interface CommentBodyProps {
128
128
  }
129
129
 
130
130
  /** A single comment: Avatar, Byline, and a body slot the consumer renders. @public @react */
131
- export declare function CommentCard({ author, body, date, you, edited, actions, footer }: CommentCardProps): JSX.Element;
131
+ export declare function CommentCard({ author, body, date, you, edited, actions, footer, }: CommentCardProps): JSX.Element;
132
132
 
133
133
  /** @public */
134
134
  export declare interface CommentCardProps {
@@ -154,7 +154,7 @@ export declare interface CommentCardProps {
154
154
  * floating toolbar. Presentational by default; pass value/onChange/onSubmit to drive it as a form.
155
155
  * @public @react
156
156
  */
157
- export declare function CommentComposer({ author, placeholder, value, onChange, onSubmit, sendLabel, onArrowUpWhenEmpty, disabled, autoFocus, leading, getMentionSuggestions, renderMentionSuggestion }: CommentComposerProps): JSX.Element;
157
+ export declare function CommentComposer({ author, placeholder, value, onChange, onSubmit, sendLabel, onArrowUpWhenEmpty, disabled, autoFocus, leading, getMentionSuggestions, renderMentionSuggestion, }: CommentComposerProps): JSX.Element;
158
158
 
159
159
  /** @public */
160
160
  export declare interface CommentComposerProps {
@@ -398,7 +398,7 @@ export declare interface CommentingOptions {
398
398
  }
399
399
 
400
400
  /** One thread's row in a {@link CommentsList}. @public @react */
401
- export declare function CommentListItem({ id, author, preview, date, resolved, page, count, selected, reactions, href, resolvedLabel, onSelect }: CommentListItemRenderProps): JSX.Element;
401
+ export declare function CommentListItem({ id, author, preview, date, resolved, page, count, selected, reactions, href, resolvedLabel, onSelect, }: CommentListItemRenderProps): JSX.Element;
402
402
 
403
403
  /** @public */
404
404
  export declare interface CommentListItemProps {
@@ -490,7 +490,7 @@ export declare interface CommentPinProps {
490
490
  * than in the reaction row, so opening it doesn't chase the row as reactions are added.
491
491
  * @public @react
492
492
  */
493
- export declare function CommentReactionPicker({ comment, currentUserId, emoji }: CommentReactionPickerProps): JSX.Element | null;
493
+ export declare function CommentReactionPicker({ comment, currentUserId, emoji, }: CommentReactionPickerProps): JSX.Element | null;
494
494
 
495
495
  /** @public */
496
496
  export declare interface CommentReactionPickerProps {
@@ -520,7 +520,7 @@ export declare interface CommentReactionsProps {
520
520
 
521
521
  /** The funnel dropdown in the sidebar header: toggles for which threads the list shows.
522
522
  * @public @react */
523
- export declare function CommentsFilterMenu({ canFilterByAuthor, canFilterByUnread }: CommentsFilterMenuProps): JSX.Element;
523
+ export declare function CommentsFilterMenu({ canFilterByAuthor, canFilterByUnread, }: CommentsFilterMenuProps): JSX.Element;
524
524
 
525
525
  /** @public */
526
526
  export declare interface CommentsFilterMenuProps {
@@ -543,7 +543,7 @@ export declare const commentsHidden: EditorAtom<boolean>;
543
543
  * `CanvasCommentsSidebar` wires it to the store, but a consumer can build their own list from this.
544
544
  * @public @react
545
545
  */
546
- export declare function CommentsList({ items, onSelect, header, headerAction, empty, resolvedLabel, renderItem }: CommentsListProps): JSX.Element;
546
+ export declare function CommentsList({ items, onSelect, header, headerAction, empty, resolvedLabel, renderItem, }: CommentsListProps): JSX.Element;
547
547
 
548
548
  /** @public */
549
549
  export declare interface CommentsListProps {
@@ -598,7 +598,7 @@ export declare function CommentsVisibilityToggle(): JSX.Element;
598
598
  * composer's handlers; how each comment renders is overridable via `renderComment`.
599
599
  * @public @react
600
600
  */
601
- export declare function CommentThread({ comments, header, headerActions, resolvedBanner, composer, footer, renderComment }: CommentThreadProps): JSX.Element;
601
+ export declare function CommentThread({ comments, header, headerActions, resolvedBanner, composer, footer, renderComment, }: CommentThreadProps): JSX.Element;
602
602
 
603
603
  /** @public */
604
604
  export declare interface CommentThreadProps {
@@ -661,7 +661,7 @@ export declare class CommentTool extends StateNode {
661
661
  export declare const commentToolOverrides: TLUiOverrides;
662
662
 
663
663
  /** @public */
664
- export declare const commentTools: typeof CommentTool[];
664
+ export declare const commentTools: (typeof CommentTool)[];
665
665
 
666
666
  /** @public @react */
667
667
  export declare function CountBadge({ count, open }: CountBadgeProps): JSX.Element;
@@ -716,7 +716,7 @@ export declare const defaultCommentingOptions: {
716
716
  readonly dragHistory: undefined;
717
717
  readonly enableClustering: true;
718
718
  readonly enableRegions: false;
719
- readonly history: "ignore";
719
+ readonly history: 'ignore';
720
720
  readonly impreciseShapeAnchor: {
721
721
  readonly x: 1;
722
722
  readonly y: 0;
@@ -803,7 +803,7 @@ export declare function editComment(editor: Editor, comment: TLComment, body: TL
803
803
  * dismissal; `ReactionPicker` renders it in a dropdown under the add-reaction button.
804
804
  * @public @react
805
805
  */
806
- export declare function EmojiPicker({ emoji, selected, onSelect, renderReaction }: EmojiPickerProps): JSX.Element;
806
+ export declare function EmojiPicker({ emoji, selected, onSelect, renderReaction, }: EmojiPickerProps): JSX.Element;
807
807
 
808
808
  /** @public */
809
809
  export declare interface EmojiPickerProps {
@@ -982,7 +982,7 @@ export declare function putCommentRecords(editor: Editor, records: TLCommentReco
982
982
  * tooltip naming who reacted (the current user included), when `enableHoverList` is set.
983
983
  * @public @react
984
984
  */
985
- export declare function Reaction({ emoji, count, active, reactors, enableHoverList, renderReaction, ReactionTooltip, onClick }: ReactionProps): JSX.Element;
985
+ export declare function Reaction({ emoji, count, active, reactors, enableHoverList, renderReaction, ReactionTooltip, onClick, }: ReactionProps): JSX.Element;
986
986
 
987
987
  /**
988
988
  * The add-reaction affordance: a smiley button that opens an emoji grid.
@@ -994,7 +994,7 @@ export declare function Reaction({ emoji, count, active, reactors, enableHoverLi
994
994
  * done its job — and hands focus back to the trigger.
995
995
  * @public @react
996
996
  */
997
- export declare function ReactionPicker({ emoji, selected, onSelect, renderReaction, palette: Palette, menuId, className }: ReactionPickerProps): JSX.Element;
997
+ export declare function ReactionPicker({ emoji, selected, onSelect, renderReaction, palette: Palette, menuId, className, }: ReactionPickerProps): JSX.Element;
998
998
 
999
999
  /** @public */
1000
1000
  export declare interface ReactionPickerProps {
@@ -1062,7 +1062,7 @@ export declare interface ReactionReactor {
1062
1062
  * fixed as reactions are added here.
1063
1063
  * @public @react
1064
1064
  */
1065
- export declare function Reactions({ reactions, onToggle, canReact, enableHoverList, renderReaction, ReactionTooltip }: ReactionsProps): JSX.Element | null;
1065
+ export declare function Reactions({ reactions, onToggle, canReact, enableHoverList, renderReaction, ReactionTooltip, }: ReactionsProps): JSX.Element | null;
1066
1066
 
1067
1067
  /** @public */
1068
1068
  export declare interface ReactionsProps {
@@ -1352,7 +1352,9 @@ export declare function useCanModifyComment(currentUserId: null | string | undef
1352
1352
  * Whether commenting is licensed for this editor. Enabled in development; in production it requires
1353
1353
  * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants
1354
1354
  * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is
1355
- * pending, so gated UI stays hidden until the license is confirmed.
1355
+ * pending, so gated UI stays hidden until the license is confirmed. Works outside `<Tldraw />` too:
1356
+ * UI mounted via `EditorProvider` resolves the license through the editor, and with no editor at
1357
+ * all this is `false`.
1356
1358
  *
1357
1359
  * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment
1358
1360
  * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.
@@ -103,7 +103,7 @@ import {
103
103
  import { anchorPagePoint, focusThread, shapeAnchorAt } from "./canvas/thread-state.mjs";
104
104
  registerTldrawLibraryVersion(
105
105
  "@tldraw/commenting",
106
- "5.4.0-canary.ea97ad4956b1",
106
+ "5.4.0-canary.fa89ff126c46",
107
107
  "esm"
108
108
  );
109
109
  export {
package/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "@tldraw/commenting",
3
3
  "description": "tldraw commenting UI components.",
4
- "version": "5.4.0-canary.ea97ad4956b1",
4
+ "version": "5.4.0-canary.fa89ff126c46",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
8
8
  },
9
9
  "homepage": "https://tldraw.dev",
10
10
  "license": "SEE LICENSE IN LICENSE.md",
11
+ "tldraw_product": {
12
+ "stableId": "tldraw:commenting",
13
+ "name": "Commenting",
14
+ "type": "feature",
15
+ "parent": "tldraw:collaboration",
16
+ "premium": true,
17
+ "licenseFlag": "FEAT_COMMENTING"
18
+ },
11
19
  "repository": {
12
20
  "type": "git",
13
21
  "url": "https://github.com/tldraw/tldraw"
@@ -38,7 +46,7 @@
38
46
  "lint": "yarn run -T tsx ../../internal/scripts/lint.ts"
39
47
  },
40
48
  "devDependencies": {
41
- "@tldraw/driver": "5.4.0-canary.ea97ad4956b1",
49
+ "@tldraw/driver": "5.4.0-canary.fa89ff126c46",
42
50
  "@types/react": "^19.2.7",
43
51
  "@types/react-dom": "^19.2.3",
44
52
  "react": "^19.2.1",
@@ -56,9 +64,9 @@
56
64
  "@tiptap/core": "^3.12.1",
57
65
  "@tiptap/pm": "^3.12.1",
58
66
  "@tiptap/react": "^3.12.1",
59
- "@tldraw/mentions": "5.4.0-canary.ea97ad4956b1",
60
- "@tldraw/utils": "5.4.0-canary.ea97ad4956b1",
61
- "tldraw": "5.4.0-canary.ea97ad4956b1"
67
+ "@tldraw/mentions": "5.4.0-canary.fa89ff126c46",
68
+ "@tldraw/utils": "5.4.0-canary.fa89ff126c46",
69
+ "tldraw": "5.4.0-canary.fa89ff126c46"
62
70
  },
63
71
  "module": "dist-esm/index.mjs",
64
72
  "source": "src/index.ts",
@@ -1,15 +1,17 @@
1
- import { useLicenseContext, useLicenseFeatureFlag } from 'tldraw'
1
+ import { useLicenseFeatureFlag, useMaybeLicenseManager } from 'tldraw'
2
2
 
3
3
  /**
4
4
  * Whether commenting is licensed for this editor. Enabled in development; in production it requires
5
5
  * a tldraw license that includes the commenting feature (or the collaboration umbrella that grants
6
6
  * it). Reactive: re-reads when license validation resolves, and returns `false` while validation is
7
- * pending, so gated UI stays hidden until the license is confirmed.
7
+ * pending, so gated UI stays hidden until the license is confirmed. Works outside `<Tldraw />` too:
8
+ * UI mounted via `EditorProvider` resolves the license through the editor, and with no editor at
9
+ * all this is `false`.
8
10
  *
9
11
  * The built-in commenting components (`CanvasComments`, `CanvasCommentsSidebar`, and the comment
10
12
  * tool's Quick Action) gate on this. Use it to gate any custom commenting UI the same way.
11
13
  * @public
12
14
  */
13
15
  export function useCommentingEnabled(): boolean {
14
- return useLicenseFeatureFlag(useLicenseContext(), 'commenting')
16
+ return useLicenseFeatureFlag(useMaybeLicenseManager(), 'commenting')
15
17
  }