@tradecanvas/core 1.35.0 → 1.37.0

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/dist/index.js CHANGED
@@ -12843,13 +12843,19 @@ var Mu = class {
12843
12843
  let e = this.getSelectedDrawingIds().map((e) => this.drawings.find((t) => t.id === e)).filter((e) => e !== void 0);
12844
12844
  return e.length === 0 ? 0 : (Fu.drawings = e.map((e) => structuredClone(e)), Fu.pastes = 0, e.length);
12845
12845
  }
12846
+ canPaste() {
12847
+ return this.state !== "creating" && Fu.drawings.some((e) => this.canPasteType(e.type));
12848
+ }
12849
+ canPasteType(e) {
12850
+ return this.registry.has(e) && this.toolAllowed(e);
12851
+ }
12846
12852
  paste() {
12847
12853
  if (Fu.drawings.length === 0 || this.state === "creating") return [];
12848
12854
  let e = Fu.drawings.every((e) => this.drawings.some((t) => t.id === e.id));
12849
12855
  Fu.pastes += 1;
12850
12856
  let t = e ? this.computeBarOffsetTime(3 * Fu.pastes) : 0, n = [];
12851
12857
  if (this.batchUndo(() => {
12852
- for (let e of Fu.drawings) !this.registry.has(e.type) || !this.toolAllowed(e.type) || n.push(this.addDrawing({
12858
+ for (let e of Fu.drawings) this.canPasteType(e.type) && n.push(this.addDrawing({
12853
12859
  type: e.type,
12854
12860
  anchors: e.anchors.map((e) => ({
12855
12861
  ...e,