@tldraw/editor 4.2.0-next.bff7e3992d58 → 4.2.0-next.d1adb18fb8da

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.
@@ -22,10 +22,10 @@ __export(version_exports, {
22
22
  version: () => version
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const version = "4.2.0-next.bff7e3992d58";
25
+ const version = "4.2.0-next.d1adb18fb8da";
26
26
  const publishDates = {
27
27
  major: "2025-09-18T14:39:22.803Z",
28
- minor: "2025-11-12T17:36:59.531Z",
29
- patch: "2025-11-12T17:36:59.531Z"
28
+ minor: "2025-11-19T11:44:04.877Z",
29
+ patch: "2025-11-19T11:44:04.877Z"
30
30
  };
31
31
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.2.0-next.bff7e3992d58'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-11-12T17:36:59.531Z',\n\tpatch: '2025-11-12T17:36:59.531Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '4.2.0-next.d1adb18fb8da'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-11-19T11:44:04.877Z',\n\tpatch: '2025-11-19T11:44:04.877Z',\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1023,19 +1023,21 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1023
1023
  * after the editor has already been initialized.
1024
1024
  *
1025
1025
  * @param Tool - The tool to set.
1026
+ * @param parent - The parent state node to set the tool on.
1026
1027
  *
1027
1028
  * @public
1028
1029
  */
1029
- setTool(Tool: TLStateNodeConstructor): void;
1030
+ setTool(Tool: TLStateNodeConstructor, parent?: StateNode): void;
1030
1031
  /**
1031
1032
  * Remove a tool. Useful if you need to remove a tool from the state chart on demand,
1032
1033
  * after the editor has already been initialized.
1033
1034
  *
1034
1035
  * @param Tool - The tool to delete.
1036
+ * @param parent - The parent state node to remove the tool from.
1035
1037
  *
1036
1038
  * @public
1037
1039
  */
1038
- removeTool(Tool: TLStateNodeConstructor): void;
1040
+ removeTool(Tool: TLStateNodeConstructor, parent?: StateNode): void;
1039
1041
  /**
1040
1042
  * A set of functions to call when the app is disposed.
1041
1043
  *
@@ -302,7 +302,7 @@ import { uniq } from "./lib/utils/uniq.mjs";
302
302
  import { openWindow } from "./lib/utils/window-open.mjs";
303
303
  registerTldrawLibraryVersion(
304
304
  "@tldraw/editor",
305
- "4.2.0-next.bff7e3992d58",
305
+ "4.2.0-next.d1adb18fb8da",
306
306
  "esm"
307
307
  );
308
308
  export {
@@ -859,26 +859,30 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
859
859
  * after the editor has already been initialized.
860
860
  *
861
861
  * @param Tool - The tool to set.
862
+ * @param parent - The parent state node to set the tool on.
862
863
  *
863
864
  * @public
864
865
  */
865
- setTool(Tool) {
866
- if (hasOwnProperty(this.root.children, Tool.id)) {
866
+ setTool(Tool, parent) {
867
+ parent ??= this.root;
868
+ if (hasOwnProperty(parent.children, Tool.id)) {
867
869
  throw Error(`Can't override tool with id "${Tool.id}"`);
868
870
  }
869
- this.root.children[Tool.id] = new Tool(this, this.root);
871
+ parent.children[Tool.id] = new Tool(this, parent);
870
872
  }
871
873
  /**
872
874
  * Remove a tool. Useful if you need to remove a tool from the state chart on demand,
873
875
  * after the editor has already been initialized.
874
876
  *
875
877
  * @param Tool - The tool to delete.
878
+ * @param parent - The parent state node to remove the tool from.
876
879
  *
877
880
  * @public
878
881
  */
879
- removeTool(Tool) {
880
- if (hasOwnProperty(this.root.children, Tool.id)) {
881
- delete this.root.children[Tool.id];
882
+ removeTool(Tool, parent) {
883
+ parent ??= this.root;
884
+ if (hasOwnProperty(parent.children, Tool.id)) {
885
+ delete parent.children[Tool.id];
882
886
  }
883
887
  }
884
888
  /**