PageSourceSearch

https://missdream.org/wp-includes/js/dist/private-apis.js

js missdream.org collected 2026-09-24 20:40:30 UTC 4,531 bytes, 120 lines download raw bytes

1(function() {
2"use strict";
3var wp;
4(wp ||= {}).privateApis = (() => {
5  var __defProp = Object.defineProperty;
6  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7  var __getOwnPropNames = Object.getOwnPropertyNames;
8  var __hasOwnProp = Object.prototype.hasOwnProperty;
9  var __export = (target, all) => {
10    for (var name in all)
11      __defProp(target, name, { get: all[name], enumerable: true });
12  };
13  var __copyProps = (to, from, except, desc) => {
14    if (from && typeof from === "object" || typeof from === "function") {
15      for (let key of __getOwnPropNames(from))
16        if (!__hasOwnProp.call(to, key) && key !== except)
17          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18    }
19    return to;
20  };
21  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
23  
23// packages/private-apis/build-module/index.mjs
24  var index_exports = {};
25  __export(index_exports, {
26    __dangerousOptInToUnstableAPIsOnlyForCoreModules: () => __dangerousOptInToUnstableAPIsOnlyForCoreModules
27  });
28
29  
29// packages/private-apis/build-module/implementation.mjs
30  var CORE_MODULES_USING_PRIVATE_APIS = [
31    "@wordpress/admin-ui",
32    "@wordpress/api-fetch",
33    "@wordpress/block-directory",
34    "@wordpress/block-editor",
35    "@wordpress/block-library",
36    "@wordpress/blocks",
37    "@wordpress/boot",
38    "@wordpress/commands",
39    "@wordpress/compose",
40    "@wordpress/connectors",
41    "@wordpress/workflows",
42    "@wordpress/components",
43    "@wordpress/content-types",
44    "@wordpress/core-commands",
45    "@wordpress/core-data",
46    "@wordpress/customize-widgets",
47    "@wordpress/data",
48    "@wordpress/edit-post",
49    "@wordpress/edit-site",
50    "@wordpress/edit-widgets",
51    "@wordpress/editor",
52    "@wordpress/font-list-route",
53    "@wordpress/format-library",
54    "@wordpress/patterns",
55    "@wordpress/preferences",
56    "@wordpress/reusable-blocks",
57    "@wordpress/rich-text",
58    "@wordpress/route",
59    "@wordpress/router",
60    "@wordpress/routes",
61    "@wordpress/storybook",
62    "@wordpress/sync",
63    "@wordpress/theme",
64    "@wordpress/dataviews",
65    "@wordpress/fields",
66    "@wordpress/lazy-editor",
67    "@wordpress/media-editor",
68    "@wordpress/media-utils",
69    "@wordpress/upload-media",
70    "@wordpress/global-styles-engine",
71    "@wordpress/global-styles-ui",
72    "@wordpress/ui",
73    "@wordpress/views",
74    "@wordpress/widget-dashboard"
75  ];
76  var requiredConsent = "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.";
77  var __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => {
78    if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) {
79      throw new Error(
80        `You tried to opt-in to unstable APIs as module "${moduleName}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`
81      );
82    }
83    if (consent !== requiredConsent) {
84      throw new Error(
85        `You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.`
86      );
87    }
88    return {
89      lock,
90      unlock
91    };
92  };
93  function lock(object, privateData) {
94    if (!object) {
95      throw new Error("Cannot lock an undefined object.");
96    }
97    const _object = object;
98    if (!(__private in _object)) {
99      _object[__private] = {};
100    }
101    lockedData.set(_object[__private], privateData);
102  }
103  function unlock(object) {
104    if (!object) {
105      throw new Error("Cannot unlock an undefined object.");
106    }
107    const _object = object;
108    if (!(__private in _object)) {
109      throw new Error(
110        "Cannot unlock an object that was not locked before. "
111      );
112    }
113    return lockedData.get(_object[__private]);
114  }
115  var lockedData = /* @__PURE__ */ new WeakMap();
116  var __private = /* @__PURE__ */ Symbol("Private API ID");
117  return __toCommonJS(index_exports);
118})();
119(window.wp ||= {}).privateApis = wp.privateApis;
120})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.