form-builder-pro 1.2.5 → 1.2.6

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
@@ -8620,6 +8620,8 @@ var SectionList = class {
8620
8620
 
8621
8621
  // src/builder/FormBuilder.ts
8622
8622
  var advancedCssPanelState = /* @__PURE__ */ new Map();
8623
+ var LABEL_DEBOUNCE_MS = 300;
8624
+ var labelUpdateTimeouts = /* @__PURE__ */ new Map();
8623
8625
  var FormBuilder = class {
8624
8626
  // For requestAnimationFrame debouncing
8625
8627
  constructor(container, options = {}) {
@@ -8798,7 +8800,7 @@ var FormBuilder = class {
8798
8800
  fields: s.fields.map((f) => ({
8799
8801
  id: f.id,
8800
8802
  type: f.type,
8801
- // Exclude label - prevents re-renders on field name typing
8803
+ label: f.label,
8802
8804
  layout: f.layout,
8803
8805
  width: f.width,
8804
8806
  css: f.css
@@ -8823,6 +8825,8 @@ var FormBuilder = class {
8823
8825
  cancelAnimationFrame(this.pendingRenderId);
8824
8826
  this.pendingRenderId = null;
8825
8827
  }
8828
+ labelUpdateTimeouts.forEach((id) => clearTimeout(id));
8829
+ labelUpdateTimeouts.clear();
8826
8830
  this.unsubscribe();
8827
8831
  this.container.innerHTML = "";
8828
8832
  }
@@ -9254,7 +9258,16 @@ var FormBuilder = class {
9254
9258
  value: selectedField.label,
9255
9259
  "data-focus-id": `field-label-${selectedField.id}`,
9256
9260
  oninput: (e) => {
9257
- formStore.getState().updateField(selectedField.id, { label: e.target.value });
9261
+ const fieldId2 = selectedField.id;
9262
+ const value = e.target.value;
9263
+ const existing = labelUpdateTimeouts.get(fieldId2);
9264
+ if (existing)
9265
+ clearTimeout(existing);
9266
+ const timeoutId = setTimeout(() => {
9267
+ labelUpdateTimeouts.delete(fieldId2);
9268
+ formStore.getState().updateField(fieldId2, { label: value });
9269
+ }, LABEL_DEBOUNCE_MS);
9270
+ labelUpdateTimeouts.set(fieldId2, timeoutId);
9258
9271
  }
9259
9272
  }));
9260
9273
  body.appendChild(labelGroup);