@seniorsistemas/angular-components 17.29.1-bugfix-ptfgap-1059-df2f86c9 → 17.29.1-bugfix-ptfgap-1059-3a1e3465

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.
@@ -4071,7 +4071,10 @@ var CoreFacade = /** @class */ (function () {
4071
4071
  }
4072
4072
  };
4073
4073
  CoreFacade.prototype.setPayload = function (payload) {
4074
- this.setCode(this.getSafeCode(payload));
4074
+ var safeCode = this.getSafeCode(payload);
4075
+ // Força a atualização sem verificar _lastCodeEmitted,
4076
+ // mas preserva o cursor verificando no nível do editor
4077
+ this.setCodeWithCursorPreservation(safeCode);
4075
4078
  };
4076
4079
  CoreFacade.prototype.getOnCoreFinishLoadObservable = function () {
4077
4080
  return this.$onCoreFinishLoad.asObservable();
@@ -5560,6 +5563,29 @@ var CodeMirror6Core = /** @class */ (function (_super) {
5560
5563
  this._codeReceivedBeforeViewCreation = code;
5561
5564
  }
5562
5565
  };
5566
+ CodeMirror6Core.prototype.setCodeWithCursorPreservation = function (code) {
5567
+ if (CodeMirror6Core._editorView) {
5568
+ var currentCode = CodeMirror6Core._editorView.state.doc.toString();
5569
+ // Só atualiza se o conteúdo for realmente diferente
5570
+ if (currentCode !== code) {
5571
+ var currentSelection = CodeMirror6Core._editorView.state.selection.main;
5572
+ CodeMirror6Core.updateEditorView({
5573
+ changes: {
5574
+ from: 0,
5575
+ to: CodeMirror6Core._editorView.state.doc.length,
5576
+ insert: code
5577
+ },
5578
+ selection: {
5579
+ anchor: Math.min(currentSelection.anchor, code.length),
5580
+ head: Math.min(currentSelection.head, code.length)
5581
+ }
5582
+ });
5583
+ }
5584
+ }
5585
+ else {
5586
+ this._codeReceivedBeforeViewCreation = code;
5587
+ }
5588
+ };
5563
5589
  CodeMirror6Core.$onCompletionItemsUpdate = new Subject();
5564
5590
  CodeMirror6Core._ngUnsubscribe = new Subject();
5565
5591
  CodeMirror6Core._editorView = null;