@elementor/editor-controls 4.1.0-702 → 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.mjs CHANGED
@@ -2214,8 +2214,26 @@ var getOffCanvasElements = () => {
2214
2214
  };
2215
2215
  });
2216
2216
  };
2217
+ var getFormElements = () => {
2218
+ const extendedWindow = window;
2219
+ const documentId = extendedWindow.elementor.config.document.id;
2220
+ const selectors = [
2221
+ `[data-elementor-id="${documentId}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,
2222
+ `[data-elementor-id="${documentId}"] select[id]`,
2223
+ `[data-elementor-id="${documentId}"] textarea[id]`
2224
+ ];
2225
+ const formElements = extendedWindow.elementor.$previewContents[0].querySelectorAll(selectors.join(", "));
2226
+ return Array.from(formElements).map((formElement) => {
2227
+ const tagName = formElement.tagName.toLowerCase();
2228
+ return {
2229
+ label: `${formElement.id} (${tagName === "input" ? formElement.getAttribute("type") : tagName})`,
2230
+ value: formElement.id
2231
+ };
2232
+ });
2233
+ };
2217
2234
  var collectionMethods = {
2218
- "off-canvas": getOffCanvasElements
2235
+ "off-canvas": getOffCanvasElements,
2236
+ "form-elements": getFormElements
2219
2237
  };
2220
2238
  var useDynamicOptions = (collectionId, initialOptions) => {
2221
2239
  const [options, setOptions] = useState5(initialOptions ?? []);