@tldraw/commenting 5.3.0 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -0
- package/dist-cjs/canvas/license.js +1 -1
- package/dist-cjs/canvas/license.js.map +2 -2
- package/dist-cjs/index.d.ts +3 -1
- package/dist-cjs/index.js +1 -1
- package/dist-esm/canvas/license.mjs +2 -2
- package/dist-esm/canvas/license.mjs.map +2 -2
- package/dist-esm/index.d.mts +3 -1
- package/dist-esm/index.mjs +1 -1
- package/package.json +13 -5
- package/src/canvas/license.ts +5 -3
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.
|
|
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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
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
|
}
|
package/dist-cjs/index.d.ts
CHANGED
|
@@ -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.3.
|
|
147
|
+
"5.3.2",
|
|
148
148
|
"cjs"
|
|
149
149
|
);
|
|
150
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLicenseFeatureFlag, useMaybeLicenseManager } from "tldraw";
|
|
2
2
|
function useCommentingEnabled() {
|
|
3
|
-
return useLicenseFeatureFlag(
|
|
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 {
|
|
5
|
-
"mappings": "AAAA,SAAS,
|
|
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
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -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-esm/index.mjs
CHANGED
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.3.
|
|
4
|
+
"version": "5.3.2",
|
|
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.3.
|
|
49
|
+
"@tldraw/driver": "5.3.2",
|
|
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.3.
|
|
60
|
-
"@tldraw/utils": "5.3.
|
|
61
|
-
"tldraw": "5.3.
|
|
67
|
+
"@tldraw/mentions": "5.3.2",
|
|
68
|
+
"@tldraw/utils": "5.3.2",
|
|
69
|
+
"tldraw": "5.3.2"
|
|
62
70
|
},
|
|
63
71
|
"module": "dist-esm/index.mjs",
|
|
64
72
|
"source": "src/index.ts",
|
package/src/canvas/license.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
16
|
+
return useLicenseFeatureFlag(useMaybeLicenseManager(), 'commenting')
|
|
15
17
|
}
|