@elementor/editor-components 4.3.0-1039 → 4.3.0-1041

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
@@ -334,14 +334,21 @@ var useIsSanitizedComponent = (componentId, key) => {
334
334
  };
335
335
 
336
336
  // src/utils/component-document-data.ts
337
- import { getV1DocumentsManager } from "@elementor/editor-documents";
338
- var getComponentDocumentData = async (id) => {
339
- const documentManager = getV1DocumentsManager();
340
- try {
341
- return await documentManager.request(id);
342
- } catch {
343
- return null;
344
- }
337
+ import { ajax as ajax2 } from "@elementor/editor-v1-adapters";
338
+ var getComponentDocumentParams = (id) => ({
339
+ action: "get_document_config",
340
+ unique_id: `document-${id}`,
341
+ data: { id }
342
+ });
343
+ var pendingRequests = /* @__PURE__ */ new Map();
344
+ var getComponentDocumentData = (id) => {
345
+ const pendingRequest = pendingRequests.get(id);
346
+ if (pendingRequest) {
347
+ return pendingRequest;
348
+ }
349
+ const request = ajax2.load(getComponentDocumentParams(id)).catch(() => null).finally(() => pendingRequests.delete(id));
350
+ pendingRequests.set(id, request);
351
+ return request;
345
352
  };
346
353
 
347
354
  // src/component-instance-transformer.ts