author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1 |
/******/ (() => { // webpackBootstrap |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2 |
/******/ "use strict"; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
3 |
/******/ // The require scope |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
4 |
/******/ var __webpack_require__ = {}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
5 |
/******/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
6 |
/************************************************************************/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
7 |
/******/ /* webpack/runtime/compat get default export */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
8 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
9 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
10 |
/******/ __webpack_require__.n = (module) => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
11 |
/******/ var getter = module && module.__esModule ? |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
12 |
/******/ () => (module['default']) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
13 |
/******/ () => (module); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
14 |
/******/ __webpack_require__.d(getter, { a: getter }); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
15 |
/******/ return getter; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
16 |
/******/ }; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
17 |
/******/ })(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
18 |
/******/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
19 |
/******/ /* webpack/runtime/define property getters */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
20 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
21 |
/******/ // define getter functions for harmony exports |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
22 |
/******/ __webpack_require__.d = (exports, definition) => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
23 |
/******/ for(var key in definition) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
24 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
25 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
26 |
/******/ } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
27 |
/******/ } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
28 |
/******/ }; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
29 |
/******/ })(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
30 |
/******/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
31 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
32 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
33 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
34 |
/******/ })(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
35 |
/******/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
36 |
/******/ /* webpack/runtime/make namespace object */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
37 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
38 |
/******/ // define __esModule on exports |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
39 |
/******/ __webpack_require__.r = (exports) => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
40 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
41 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
42 |
/******/ } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
43 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
44 |
/******/ }; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
45 |
/******/ })(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
46 |
/******/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
47 |
/************************************************************************/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
48 |
var __webpack_exports__ = {}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
49 |
// ESM COMPAT FLAG |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
50 |
__webpack_require__.r(__webpack_exports__); |
9 | 51 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
52 |
// EXPORTS |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
53 |
__webpack_require__.d(__webpack_exports__, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
54 |
PluginArea: () => (/* reexport */ plugin_area), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
55 |
getPlugin: () => (/* reexport */ getPlugin), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
56 |
getPlugins: () => (/* reexport */ getPlugins), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
57 |
registerPlugin: () => (/* reexport */ registerPlugin), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
58 |
unregisterPlugin: () => (/* reexport */ unregisterPlugin), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
59 |
usePluginContext: () => (/* reexport */ usePluginContext), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
60 |
withPluginContext: () => (/* reexport */ withPluginContext) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
61 |
}); |
9 | 62 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
63 |
;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js |
18 | 64 |
/** |
65 |
* Memize options object. |
|
66 |
* |
|
67 |
* @typedef MemizeOptions |
|
68 |
* |
|
69 |
* @property {number} [maxSize] Maximum size of the cache. |
|
70 |
*/ |
|
9 | 71 |
|
18 | 72 |
/** |
73 |
* Internal cache entry. |
|
74 |
* |
|
75 |
* @typedef MemizeCacheNode |
|
76 |
* |
|
77 |
* @property {?MemizeCacheNode|undefined} [prev] Previous node. |
|
78 |
* @property {?MemizeCacheNode|undefined} [next] Next node. |
|
79 |
* @property {Array<*>} args Function arguments for cache |
|
80 |
* entry. |
|
81 |
* @property {*} val Function result. |
|
82 |
*/ |
|
9 | 83 |
|
18 | 84 |
/** |
85 |
* Properties of the enhanced function for controlling cache. |
|
86 |
* |
|
87 |
* @typedef MemizeMemoizedFunction |
|
88 |
* |
|
89 |
* @property {()=>void} clear Clear the cache. |
|
90 |
*/ |
|
16 | 91 |
|
18 | 92 |
/** |
93 |
* Accepts a function to be memoized, and returns a new memoized function, with |
|
94 |
* optional options. |
|
95 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
96 |
* @template {(...args: any[]) => any} F |
18 | 97 |
* |
98 |
* @param {F} fn Function to memoize. |
|
99 |
* @param {MemizeOptions} [options] Options object. |
|
100 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
101 |
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. |
18 | 102 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
103 |
function memize(fn, options) { |
18 | 104 |
var size = 0; |
9 | 105 |
|
18 | 106 |
/** @type {?MemizeCacheNode|undefined} */ |
107 |
var head; |
|
9 | 108 |
|
18 | 109 |
/** @type {?MemizeCacheNode|undefined} */ |
110 |
var tail; |
|
111 |
||
112 |
options = options || {}; |
|
9 | 113 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
114 |
function memoized(/* ...args */) { |
18 | 115 |
var node = head, |
116 |
len = arguments.length, |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
117 |
args, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
118 |
i; |
18 | 119 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
120 |
searchCache: while (node) { |
18 | 121 |
// Perform a shallow equality test to confirm that whether the node |
122 |
// under test is a candidate for the arguments passed. Two arrays |
|
123 |
// are shallowly equal if their length matches and each entry is |
|
124 |
// strictly equal between the two sets. Avoid abstracting to a |
|
125 |
// function which could incur an arguments leaking deoptimization. |
|
9 | 126 |
|
18 | 127 |
// Check whether node arguments match arguments length |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
128 |
if (node.args.length !== arguments.length) { |
18 | 129 |
node = node.next; |
130 |
continue; |
|
131 |
} |
|
132 |
||
133 |
// Check whether node arguments match arguments values |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
134 |
for (i = 0; i < len; i++) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
135 |
if (node.args[i] !== arguments[i]) { |
18 | 136 |
node = node.next; |
137 |
continue searchCache; |
|
138 |
} |
|
139 |
} |
|
140 |
||
141 |
// At this point we can assume we've found a match |
|
9 | 142 |
|
18 | 143 |
// Surface matched node to head if not already |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
144 |
if (node !== head) { |
18 | 145 |
// As tail, shift to previous. Must only shift if not also |
146 |
// head, since if both head and tail, there is no previous. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
147 |
if (node === tail) { |
18 | 148 |
tail = node.prev; |
149 |
} |
|
150 |
||
151 |
// Adjust siblings to point to each other. If node was tail, |
|
152 |
// this also handles new tail's empty `next` assignment. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
153 |
/** @type {MemizeCacheNode} */ (node.prev).next = node.next; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
154 |
if (node.next) { |
18 | 155 |
node.next.prev = node.prev; |
156 |
} |
|
9 | 157 |
|
18 | 158 |
node.next = head; |
159 |
node.prev = null; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
160 |
/** @type {MemizeCacheNode} */ (head).prev = node; |
18 | 161 |
head = node; |
162 |
} |
|
163 |
||
164 |
// Return immediately |
|
165 |
return node.val; |
|
166 |
} |
|
167 |
||
168 |
// No cached value found. Continue to insertion phase: |
|
169 |
||
170 |
// Create a copy of arguments (avoid leaking deoptimization) |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
171 |
args = new Array(len); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
172 |
for (i = 0; i < len; i++) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
173 |
args[i] = arguments[i]; |
18 | 174 |
} |
175 |
||
176 |
node = { |
|
177 |
args: args, |
|
178 |
||
179 |
// Generate the result from original function |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
180 |
val: fn.apply(null, args), |
18 | 181 |
}; |
16 | 182 |
|
18 | 183 |
// Don't need to check whether node is already head, since it would |
184 |
// have been returned above already if it was |
|
16 | 185 |
|
18 | 186 |
// Shift existing head down list |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
187 |
if (head) { |
18 | 188 |
head.prev = node; |
189 |
node.next = head; |
|
190 |
} else { |
|
191 |
// If no head, follows that there's no tail (at initial or reset) |
|
192 |
tail = node; |
|
193 |
} |
|
16 | 194 |
|
18 | 195 |
// Trim tail if we're reached max size and are pending cache insertion |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
196 |
if (size === /** @type {MemizeOptions} */ (options).maxSize) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
197 |
tail = /** @type {MemizeCacheNode} */ (tail).prev; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
198 |
/** @type {MemizeCacheNode} */ (tail).next = null; |
18 | 199 |
} else { |
200 |
size++; |
|
201 |
} |
|
16 | 202 |
|
18 | 203 |
head = node; |
16 | 204 |
|
18 | 205 |
return node.val; |
206 |
} |
|
16 | 207 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
208 |
memoized.clear = function () { |
18 | 209 |
head = null; |
210 |
tail = null; |
|
211 |
size = 0; |
|
212 |
}; |
|
213 |
||
214 |
// Ignore reason: There's not a clear solution to create an intersection of |
|
215 |
// the function with additional properties, where the goal is to retain the |
|
216 |
// function signature of the incoming argument and add control properties |
|
217 |
// on the return value. |
|
218 |
||
219 |
// @ts-ignore |
|
220 |
return memoized; |
|
16 | 221 |
} |
222 |
||
223 |
||
224 |
||
19 | 225 |
;// CONCATENATED MODULE: external ["wp","element"] |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
226 |
const external_wp_element_namespaceObject = window["wp"]["element"]; |
19 | 227 |
;// CONCATENATED MODULE: external ["wp","hooks"] |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
228 |
const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
229 |
;// CONCATENATED MODULE: external ["wp","isShallowEqual"] |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
230 |
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
231 |
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); |
19 | 232 |
;// CONCATENATED MODULE: external ["wp","compose"] |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
233 |
const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
234 |
;// CONCATENATED MODULE: external "ReactJSXRuntime" |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
235 |
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
19 | 236 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js |
9 | 237 |
/** |
238 |
* WordPress dependencies |
|
239 |
*/ |
|
240 |
||
241 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
242 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
243 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
244 |
* Internal dependencies |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
245 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
246 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
247 |
const Context = (0,external_wp_element_namespaceObject.createContext)({ |
9 | 248 |
name: null, |
249 |
icon: null |
|
18 | 250 |
}); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
251 |
const PluginContextProvider = Context.Provider; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
252 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
253 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
254 |
* A hook that returns the plugin context. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
255 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
256 |
* @return {PluginContext} Plugin context |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
257 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
258 |
function usePluginContext() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
259 |
return (0,external_wp_element_namespaceObject.useContext)(Context); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
260 |
} |
9 | 261 |
|
262 |
/** |
|
263 |
* A Higher Order Component used to inject Plugin context to the |
|
264 |
* wrapped component. |
|
265 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
266 |
* @param mapContextToProps Function called on every context change, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
267 |
* expected to return object of props to |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
268 |
* merge with the component's own props. |
9 | 269 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
270 |
* @return {Component} Enhanced component with injected context as props. |
9 | 271 |
*/ |
19 | 272 |
const withPluginContext = mapContextToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
273 |
return props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Context.Consumer, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
274 |
children: context => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
275 |
...props, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
276 |
...mapContextToProps(context, props) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
277 |
}) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
278 |
}); |
18 | 279 |
}, 'withPluginContext'); |
280 |
||
19 | 281 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-error-boundary/index.js |
282 |
/** |
|
283 |
* WordPress dependencies |
|
284 |
*/ |
|
285 |
||
286 |
class PluginErrorBoundary extends external_wp_element_namespaceObject.Component { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
287 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
288 |
* @param {Object} props |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
289 |
*/ |
19 | 290 |
constructor(props) { |
291 |
super(props); |
|
292 |
this.state = { |
|
293 |
hasError: false |
|
294 |
}; |
|
295 |
} |
|
296 |
static getDerivedStateFromError() { |
|
297 |
return { |
|
298 |
hasError: true |
|
299 |
}; |
|
300 |
} |
|
18 | 301 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
302 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
303 |
* @param {Error} error Error object passed by React. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
304 |
*/ |
19 | 305 |
componentDidCatch(error) { |
306 |
const { |
|
307 |
name, |
|
308 |
onError |
|
309 |
} = this.props; |
|
310 |
if (onError) { |
|
311 |
onError(name, error); |
|
312 |
} |
|
313 |
} |
|
314 |
render() { |
|
315 |
if (!this.state.hasError) { |
|
316 |
return this.props.children; |
|
317 |
} |
|
318 |
return null; |
|
319 |
} |
|
320 |
} |
|
321 |
||
322 |
;// CONCATENATED MODULE: external ["wp","primitives"] |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
323 |
const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
19 | 324 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js |
18 | 325 |
/** |
326 |
* WordPress dependencies |
|
327 |
*/ |
|
9 | 328 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
330 |
const plugins = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
18 | 331 |
xmlns: "http://www.w3.org/2000/svg", |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
332 |
viewBox: "0 0 24 24", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
333 |
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
334 |
d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
335 |
}) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
336 |
}); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
337 |
/* harmony default export */ const library_plugins = (plugins); |
9 | 338 |
|
19 | 339 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js |
9 | 340 |
/* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
341 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
342 |
* External dependencies |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
343 |
*/ |
9 | 344 |
|
345 |
/** |
|
346 |
* WordPress dependencies |
|
347 |
*/ |
|
348 |
||
16 | 349 |
|
9 | 350 |
|
351 |
/** |
|
16 | 352 |
* Defined behavior of a plugin type. |
353 |
*/ |
|
354 |
||
355 |
/** |
|
9 | 356 |
* Plugin definitions keyed by plugin name. |
357 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
358 |
const api_plugins = {}; |
9 | 359 |
|
360 |
/** |
|
361 |
* Registers a plugin to the editor. |
|
362 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
363 |
* @param name A string identifying the plugin. Must be |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
364 |
* unique across all registered plugins. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
365 |
* @param settings The settings for this plugin. |
9 | 366 |
* |
16 | 367 |
* @example |
9 | 368 |
* ```js |
369 |
* // Using ES5 syntax |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
370 |
* var el = React.createElement; |
9 | 371 |
* var Fragment = wp.element.Fragment; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
372 |
* var PluginSidebar = wp.editor.PluginSidebar; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
373 |
* var PluginSidebarMoreMenuItem = wp.editor.PluginSidebarMoreMenuItem; |
9 | 374 |
* var registerPlugin = wp.plugins.registerPlugin; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
375 |
* var moreIcon = React.createElement( 'svg' ); //... svg element. |
9 | 376 |
* |
377 |
* function Component() { |
|
378 |
* return el( |
|
379 |
* Fragment, |
|
380 |
* {}, |
|
381 |
* el( |
|
382 |
* PluginSidebarMoreMenuItem, |
|
383 |
* { |
|
384 |
* target: 'sidebar-name', |
|
385 |
* }, |
|
386 |
* 'My Sidebar' |
|
387 |
* ), |
|
388 |
* el( |
|
389 |
* PluginSidebar, |
|
390 |
* { |
|
391 |
* name: 'sidebar-name', |
|
392 |
* title: 'My Sidebar', |
|
393 |
* }, |
|
394 |
* 'Content of the sidebar' |
|
395 |
* ) |
|
396 |
* ); |
|
397 |
* } |
|
398 |
* registerPlugin( 'plugin-name', { |
|
16 | 399 |
* icon: moreIcon, |
9 | 400 |
* render: Component, |
18 | 401 |
* scope: 'my-page', |
9 | 402 |
* } ); |
403 |
* ``` |
|
404 |
* |
|
16 | 405 |
* @example |
9 | 406 |
* ```js |
407 |
* // Using ESNext syntax |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
408 |
* import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/editor'; |
16 | 409 |
* import { registerPlugin } from '@wordpress/plugins'; |
410 |
* import { more } from '@wordpress/icons'; |
|
9 | 411 |
* |
412 |
* const Component = () => ( |
|
16 | 413 |
* <> |
9 | 414 |
* <PluginSidebarMoreMenuItem |
415 |
* target="sidebar-name" |
|
416 |
* > |
|
417 |
* My Sidebar |
|
418 |
* </PluginSidebarMoreMenuItem> |
|
419 |
* <PluginSidebar |
|
420 |
* name="sidebar-name" |
|
421 |
* title="My Sidebar" |
|
422 |
* > |
|
423 |
* Content of the sidebar |
|
424 |
* </PluginSidebar> |
|
16 | 425 |
* </> |
9 | 426 |
* ); |
427 |
* |
|
428 |
* registerPlugin( 'plugin-name', { |
|
16 | 429 |
* icon: more, |
9 | 430 |
* render: Component, |
18 | 431 |
* scope: 'my-page', |
9 | 432 |
* } ); |
433 |
* ``` |
|
434 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
435 |
* @return The final plugin settings object. |
9 | 436 |
*/ |
437 |
function registerPlugin(name, settings) { |
|
18 | 438 |
if (typeof settings !== 'object') { |
9 | 439 |
console.error('No settings object provided!'); |
440 |
return null; |
|
441 |
} |
|
442 |
if (typeof name !== 'string') { |
|
18 | 443 |
console.error('Plugin name must be string.'); |
9 | 444 |
return null; |
445 |
} |
|
446 |
if (!/^[a-z][a-z0-9-]*$/.test(name)) { |
|
18 | 447 |
console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'); |
9 | 448 |
return null; |
449 |
} |
|
16 | 450 |
if (api_plugins[name]) { |
18 | 451 |
console.error(`Plugin "${name}" is already registered.`); |
9 | 452 |
} |
19 | 453 |
settings = (0,external_wp_hooks_namespaceObject.applyFilters)('plugins.registerPlugin', settings, name); |
18 | 454 |
const { |
455 |
render, |
|
456 |
scope |
|
457 |
} = settings; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
458 |
if (typeof render !== 'function') { |
9 | 459 |
console.error('The "render" property must be specified and must be a valid function.'); |
460 |
return null; |
|
461 |
} |
|
18 | 462 |
if (scope) { |
463 |
if (typeof scope !== 'string') { |
|
464 |
console.error('Plugin scope must be string.'); |
|
465 |
return null; |
|
466 |
} |
|
467 |
if (!/^[a-z][a-z0-9-]*$/.test(scope)) { |
|
468 |
console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'); |
|
469 |
return null; |
|
470 |
} |
|
471 |
} |
|
472 |
api_plugins[name] = { |
|
473 |
name, |
|
474 |
icon: library_plugins, |
|
475 |
...settings |
|
476 |
}; |
|
19 | 477 |
(0,external_wp_hooks_namespaceObject.doAction)('plugins.pluginRegistered', settings, name); |
9 | 478 |
return settings; |
479 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
480 |
|
9 | 481 |
/** |
482 |
* Unregisters a plugin by name. |
|
483 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
484 |
* @param name Plugin name. |
9 | 485 |
* |
16 | 486 |
* @example |
9 | 487 |
* ```js |
488 |
* // Using ES5 syntax |
|
489 |
* var unregisterPlugin = wp.plugins.unregisterPlugin; |
|
490 |
* |
|
491 |
* unregisterPlugin( 'plugin-name' ); |
|
492 |
* ``` |
|
493 |
* |
|
16 | 494 |
* @example |
9 | 495 |
* ```js |
496 |
* // Using ESNext syntax |
|
16 | 497 |
* import { unregisterPlugin } from '@wordpress/plugins'; |
9 | 498 |
* |
499 |
* unregisterPlugin( 'plugin-name' ); |
|
500 |
* ``` |
|
501 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
502 |
* @return The previous plugin settings object, if it has been |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
503 |
* successfully unregistered; otherwise `undefined`. |
9 | 504 |
*/ |
505 |
function unregisterPlugin(name) { |
|
16 | 506 |
if (!api_plugins[name]) { |
9 | 507 |
console.error('Plugin "' + name + '" is not registered.'); |
508 |
return; |
|
509 |
} |
|
18 | 510 |
const oldPlugin = api_plugins[name]; |
16 | 511 |
delete api_plugins[name]; |
19 | 512 |
(0,external_wp_hooks_namespaceObject.doAction)('plugins.pluginUnregistered', oldPlugin, name); |
9 | 513 |
return oldPlugin; |
514 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
515 |
|
9 | 516 |
/** |
517 |
* Returns a registered plugin settings. |
|
518 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
519 |
* @param name Plugin name. |
9 | 520 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
521 |
* @return Plugin setting. |
9 | 522 |
*/ |
523 |
function getPlugin(name) { |
|
16 | 524 |
return api_plugins[name]; |
9 | 525 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
526 |
|
9 | 527 |
/** |
18 | 528 |
* Returns all registered plugins without a scope or for a given scope. |
9 | 529 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
530 |
* @param scope The scope to be used when rendering inside |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
531 |
* a plugin area. No scope by default. |
18 | 532 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
533 |
* @return The list of plugins without a scope or for a given scope. |
9 | 534 |
*/ |
18 | 535 |
function getPlugins(scope) { |
536 |
return Object.values(api_plugins).filter(plugin => plugin.scope === scope); |
|
9 | 537 |
} |
538 |
||
19 | 539 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js |
9 | 540 |
/** |
541 |
* External dependencies |
|
542 |
*/ |
|
543 |
||
18 | 544 |
|
9 | 545 |
/** |
546 |
* WordPress dependencies |
|
547 |
*/ |
|
548 |
||
549 |
||
550 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
551 |
|
9 | 552 |
/** |
553 |
* Internal dependencies |
|
554 |
*/ |
|
555 |
||
556 |
||
557 |
||
19 | 558 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
559 |
const getPluginContext = memize((icon, name) => ({ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
560 |
icon, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
561 |
name |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
562 |
})); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
563 |
|
9 | 564 |
/** |
565 |
* A component that renders all plugin fills in a hidden div. |
|
566 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
567 |
* @param props |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
568 |
* @param props.scope |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
569 |
* @param props.onError |
16 | 570 |
* @example |
9 | 571 |
* ```js |
572 |
* // Using ES5 syntax |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
573 |
* var el = React.createElement; |
9 | 574 |
* var PluginArea = wp.plugins.PluginArea; |
575 |
* |
|
576 |
* function Layout() { |
|
577 |
* return el( |
|
578 |
* 'div', |
|
18 | 579 |
* { scope: 'my-page' }, |
9 | 580 |
* 'Content of the page', |
581 |
* PluginArea |
|
582 |
* ); |
|
583 |
* } |
|
584 |
* ``` |
|
585 |
* |
|
16 | 586 |
* @example |
9 | 587 |
* ```js |
588 |
* // Using ESNext syntax |
|
16 | 589 |
* import { PluginArea } from '@wordpress/plugins'; |
9 | 590 |
* |
591 |
* const Layout = () => ( |
|
592 |
* <div> |
|
593 |
* Content of the page |
|
18 | 594 |
* <PluginArea scope="my-page" /> |
9 | 595 |
* </div> |
596 |
* ); |
|
597 |
* ``` |
|
598 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
599 |
* @return {Component} The component to be rendered. |
9 | 600 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
601 |
function PluginArea({ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
602 |
scope, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
603 |
onError |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
604 |
}) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
605 |
const store = (0,external_wp_element_namespaceObject.useMemo)(() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
606 |
let lastValue = []; |
18 | 607 |
return { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
608 |
subscribe(listener) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
609 |
(0,external_wp_hooks_namespaceObject.addAction)('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', listener); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
610 |
(0,external_wp_hooks_namespaceObject.addAction)('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', listener); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
611 |
return () => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
612 |
(0,external_wp_hooks_namespaceObject.removeAction)('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered'); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
613 |
(0,external_wp_hooks_namespaceObject.removeAction)('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered'); |
18 | 614 |
}; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
615 |
}, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
616 |
getValue() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
617 |
const nextValue = getPlugins(scope); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
618 |
if (!external_wp_isShallowEqual_default()(lastValue, nextValue)) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
619 |
lastValue = nextValue; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
620 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
621 |
return lastValue; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
622 |
} |
18 | 623 |
}; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
624 |
}, [scope]); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
625 |
const plugins = (0,external_wp_element_namespaceObject.useSyncExternalStore)(store.subscribe, store.getValue, store.getValue); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
626 |
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
627 |
style: { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
628 |
display: 'none' |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
629 |
}, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
630 |
children: plugins.map(({ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
631 |
icon, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
632 |
name, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
633 |
render: Plugin |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
634 |
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginContextProvider, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
635 |
value: getPluginContext(icon, name), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
636 |
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginErrorBoundary, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
637 |
name: name, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
638 |
onError: onError, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
639 |
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Plugin, {}) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
640 |
}) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
641 |
}, name)) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
642 |
}); |
18 | 643 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
644 |
/* harmony default export */ const plugin_area = (PluginArea); |
9 | 645 |
|
19 | 646 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/index.js |
9 | 647 |
|
648 |
||
649 |
||
19 | 650 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/index.js |
16 | 651 |
|
9 | 652 |
|
653 |
||
19 | 654 |
(window.wp = window.wp || {}).plugins = __webpack_exports__; |
655 |
/******/ })() |
|
656 |
; |