Pristine upstream, unpacked from the official wordpress.org tarball. https://wordpress.org/wordpress-7.1.1.tar.gz sha1 2a9d68474e8703aa3a66f80427b325e0941b6a1e (published by wordpress.org) sha256 3996fee13448ef12e07e9f0c77db2f655ffa1b7cde71c80a4965d3bf1fb956b3 This branch carries nothing but upstream releases, one commit each, and is never edited. It is the other side of the git-subtree merge that brings security releases into SiriusPress/wordpress/ — see SiriusPress/docs/upstream-merges.md.
120 lines
4.4 KiB
JavaScript
120 lines
4.4 KiB
JavaScript
(function() {
|
|
"use strict";
|
|
var wp;
|
|
(wp ||= {}).privateApis = (() => {
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// packages/private-apis/build-module/index.mjs
|
|
var index_exports = {};
|
|
__export(index_exports, {
|
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules: () => __dangerousOptInToUnstableAPIsOnlyForCoreModules
|
|
});
|
|
|
|
// packages/private-apis/build-module/implementation.mjs
|
|
var CORE_MODULES_USING_PRIVATE_APIS = [
|
|
"@wordpress/admin-ui",
|
|
"@wordpress/api-fetch",
|
|
"@wordpress/block-directory",
|
|
"@wordpress/block-editor",
|
|
"@wordpress/block-library",
|
|
"@wordpress/blocks",
|
|
"@wordpress/boot",
|
|
"@wordpress/commands",
|
|
"@wordpress/compose",
|
|
"@wordpress/connectors",
|
|
"@wordpress/workflows",
|
|
"@wordpress/components",
|
|
"@wordpress/content-types",
|
|
"@wordpress/core-commands",
|
|
"@wordpress/core-data",
|
|
"@wordpress/customize-widgets",
|
|
"@wordpress/data",
|
|
"@wordpress/edit-post",
|
|
"@wordpress/edit-site",
|
|
"@wordpress/edit-widgets",
|
|
"@wordpress/editor",
|
|
"@wordpress/font-list-route",
|
|
"@wordpress/format-library",
|
|
"@wordpress/patterns",
|
|
"@wordpress/preferences",
|
|
"@wordpress/reusable-blocks",
|
|
"@wordpress/rich-text",
|
|
"@wordpress/route",
|
|
"@wordpress/router",
|
|
"@wordpress/routes",
|
|
"@wordpress/storybook",
|
|
"@wordpress/sync",
|
|
"@wordpress/theme",
|
|
"@wordpress/dataviews",
|
|
"@wordpress/fields",
|
|
"@wordpress/lazy-editor",
|
|
"@wordpress/media-editor",
|
|
"@wordpress/media-utils",
|
|
"@wordpress/upload-media",
|
|
"@wordpress/global-styles-engine",
|
|
"@wordpress/global-styles-ui",
|
|
"@wordpress/ui",
|
|
"@wordpress/views",
|
|
"@wordpress/widget-dashboard"
|
|
];
|
|
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.";
|
|
var __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => {
|
|
if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) {
|
|
throw new Error(
|
|
`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.`
|
|
);
|
|
}
|
|
if (consent !== requiredConsent) {
|
|
throw new Error(
|
|
`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.`
|
|
);
|
|
}
|
|
return {
|
|
lock,
|
|
unlock
|
|
};
|
|
};
|
|
function lock(object, privateData) {
|
|
if (!object) {
|
|
throw new Error("Cannot lock an undefined object.");
|
|
}
|
|
const _object = object;
|
|
if (!(__private in _object)) {
|
|
_object[__private] = {};
|
|
}
|
|
lockedData.set(_object[__private], privateData);
|
|
}
|
|
function unlock(object) {
|
|
if (!object) {
|
|
throw new Error("Cannot unlock an undefined object.");
|
|
}
|
|
const _object = object;
|
|
if (!(__private in _object)) {
|
|
throw new Error(
|
|
"Cannot unlock an object that was not locked before. "
|
|
);
|
|
}
|
|
return lockedData.get(_object[__private]);
|
|
}
|
|
var lockedData = /* @__PURE__ */ new WeakMap();
|
|
var __private = /* @__PURE__ */ Symbol("Private API ID");
|
|
return __toCommonJS(index_exports);
|
|
})();
|
|
(window.wp ||= {}).privateApis = wp.privateApis;
|
|
})();
|