@elementor/editor-controls 4.0.7 → 4.0.8

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
@@ -2301,8 +2301,26 @@ var getOffCanvasElements = () => {
2301
2301
  };
2302
2302
  });
2303
2303
  };
2304
+ var getFormElements = () => {
2305
+ const extendedWindow = window;
2306
+ const documentId = extendedWindow.elementor.config.document.id;
2307
+ const selectors = [
2308
+ `[data-elementor-id="${documentId}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,
2309
+ `[data-elementor-id="${documentId}"] select[id]`,
2310
+ `[data-elementor-id="${documentId}"] textarea[id]`
2311
+ ];
2312
+ const formElements = extendedWindow.elementor.$previewContents[0].querySelectorAll(selectors.join(", "));
2313
+ return Array.from(formElements).map((formElement) => {
2314
+ const tagName = formElement.tagName.toLowerCase();
2315
+ return {
2316
+ label: `${formElement.id} (${tagName === "input" ? formElement.getAttribute("type") : tagName})`,
2317
+ value: formElement.id
2318
+ };
2319
+ });
2320
+ };
2304
2321
  var collectionMethods = {
2305
- "off-canvas": getOffCanvasElements
2322
+ "off-canvas": getOffCanvasElements,
2323
+ "form-elements": getFormElements
2306
2324
  };
2307
2325
  var useDynamicOptions = (collectionId, initialOptions) => {
2308
2326
  const [options, setOptions] = (0, import_react25.useState)(initialOptions ?? []);