@elementor/editor-controls 4.1.0-703 → 4.1.0-704

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.d.mts CHANGED
@@ -99,6 +99,7 @@ declare const SelectControl: ControlComponent$1<({ options, onChange, MenuProps,
99
99
 
100
100
  declare const collectionMethods: {
101
101
  readonly 'off-canvas': () => SelectOption$1[];
102
+ readonly 'form-elements': () => SelectOption$1[];
102
103
  };
103
104
  type SelectControlWrapperProps = Parameters<typeof SelectControl>[0] & {
104
105
  collectionId?: keyof typeof collectionMethods;
package/dist/index.d.ts CHANGED
@@ -99,6 +99,7 @@ declare const SelectControl: ControlComponent$1<({ options, onChange, MenuProps,
99
99
 
100
100
  declare const collectionMethods: {
101
101
  readonly 'off-canvas': () => SelectOption$1[];
102
+ readonly 'form-elements': () => SelectOption$1[];
102
103
  };
103
104
  type SelectControlWrapperProps = Parameters<typeof SelectControl>[0] & {
104
105
  collectionId?: keyof typeof collectionMethods;
package/dist/index.js CHANGED
@@ -2299,8 +2299,26 @@ var getOffCanvasElements = () => {
2299
2299
  };
2300
2300
  });
2301
2301
  };
2302
+ var getFormElements = () => {
2303
+ const extendedWindow = window;
2304
+ const documentId = extendedWindow.elementor.config.document.id;
2305
+ const selectors = [
2306
+ `[data-elementor-id="${documentId}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,
2307
+ `[data-elementor-id="${documentId}"] select[id]`,
2308
+ `[data-elementor-id="${documentId}"] textarea[id]`
2309
+ ];
2310
+ const formElements = extendedWindow.elementor.$previewContents[0].querySelectorAll(selectors.join(", "));
2311
+ return Array.from(formElements).map((formElement) => {
2312
+ const tagName = formElement.tagName.toLowerCase();
2313
+ return {
2314
+ label: `${formElement.id} (${tagName === "input" ? formElement.getAttribute("type") : tagName})`,
2315
+ value: formElement.id
2316
+ };
2317
+ });
2318
+ };
2302
2319
  var collectionMethods = {
2303
- "off-canvas": getOffCanvasElements
2320
+ "off-canvas": getOffCanvasElements,
2321
+ "form-elements": getFormElements
2304
2322
  };
2305
2323
  var useDynamicOptions = (collectionId, initialOptions) => {
2306
2324
  const [options, setOptions] = (0, import_react25.useState)(initialOptions ?? []);