author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 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 |
19 | 2 |
/******/ "use strict"; |
3 |
/******/ // The require scope |
|
4 |
/******/ var __webpack_require__ = {}; |
|
5 |
/******/ |
|
6 |
/************************************************************************/ |
|
7 |
/******/ /* webpack/runtime/define property getters */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
8 |
/******/ (() => { |
19 | 9 |
/******/ // define getter functions for harmony exports |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
10 |
/******/ __webpack_require__.d = (exports, definition) => { |
19 | 11 |
/******/ for(var key in definition) { |
12 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
|
13 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
|
14 |
/******/ } |
|
15 |
/******/ } |
|
9 | 16 |
/******/ }; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
17 |
/******/ })(); |
19 | 18 |
/******/ |
19 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
|
21
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 |
/******/ __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
|
22 |
/******/ })(); |
19 | 23 |
/******/ |
9 | 24 |
/************************************************************************/ |
19 | 25 |
var __webpack_exports__ = {}; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
26 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
27 |
/* harmony export */ "default": () => (/* binding */ TokenList) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
28 |
/* harmony export */ }); |
9 | 29 |
/** |
30 |
* A set of tokens. |
|
31 |
* |
|
16 | 32 |
* @see https://dom.spec.whatwg.org/#domtokenlist |
9 | 33 |
*/ |
18 | 34 |
class TokenList { |
9 | 35 |
/** |
36 |
* Constructs a new instance of TokenList. |
|
37 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
38 |
* @param initialValue Initial value to assign. |
9 | 39 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
40 |
constructor(initialValue = '') { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
41 |
this._currentValue = ''; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
42 |
this._valueAsArray = []; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
43 |
this.value = initialValue; |
18 | 44 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
45 |
entries(...args) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
46 |
return this._valueAsArray.entries(...args); |
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 |
forEach(...args) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
49 |
return this._valueAsArray.forEach(...args); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
50 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
51 |
keys(...args) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
52 |
return this._valueAsArray.keys(...args); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
53 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
54 |
values(...args) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
55 |
return this._valueAsArray.values(...args); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
56 |
} |
9 | 57 |
|
18 | 58 |
/** |
59 |
* Returns the associated set as string. |
|
60 |
* |
|
61 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value |
|
62 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
63 |
* @return Token set as string. |
18 | 64 |
*/ |
65 |
get value() { |
|
66 |
return this._currentValue; |
|
67 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
68 |
|
18 | 69 |
/** |
70 |
* Replaces the associated set with a new string value. |
|
71 |
* |
|
72 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value |
|
73 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
74 |
* @param value New token set as string. |
18 | 75 |
*/ |
76 |
set value(value) { |
|
77 |
value = String(value); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
78 |
this._valueAsArray = [...new Set(value.split(/\s+/g).filter(Boolean))]; |
18 | 79 |
this._currentValue = this._valueAsArray.join(' '); |
80 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
81 |
|
18 | 82 |
/** |
83 |
* Returns the number of tokens. |
|
84 |
* |
|
85 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-length |
|
86 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
87 |
* @return Number of tokens. |
18 | 88 |
*/ |
89 |
get length() { |
|
90 |
return this._valueAsArray.length; |
|
91 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
92 |
|
18 | 93 |
/** |
94 |
* Returns the stringified form of the TokenList. |
|
95 |
* |
|
96 |
* @see https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior |
|
97 |
* @see https://www.ecma-international.org/ecma-262/9.0/index.html#sec-tostring |
|
98 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
99 |
* @return Token set as string. |
18 | 100 |
*/ |
101 |
toString() { |
|
102 |
return this.value; |
|
103 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
104 |
|
18 | 105 |
/** |
106 |
* Returns an iterator for the TokenList, iterating items of the set. |
|
107 |
* |
|
108 |
* @see https://dom.spec.whatwg.org/#domtokenlist |
|
109 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
110 |
* @return TokenList iterator. |
18 | 111 |
*/ |
112 |
*[Symbol.iterator]() { |
|
113 |
return yield* this._valueAsArray; |
|
114 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
115 |
|
18 | 116 |
/** |
117 |
* Returns the token with index `index`. |
|
118 |
* |
|
119 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-item |
|
120 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
121 |
* @param index Index at which to return token. |
18 | 122 |
* |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
123 |
* @return Token at index. |
18 | 124 |
*/ |
125 |
item(index) { |
|
126 |
return this._valueAsArray[index]; |
|
127 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
128 |
|
18 | 129 |
/** |
130 |
* Returns true if `token` is present, and false otherwise. |
|
131 |
* |
|
132 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-contains |
|
133 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
134 |
* @param item Token to test. |
18 | 135 |
* |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
136 |
* @return Whether token is present. |
18 | 137 |
*/ |
138 |
contains(item) { |
|
139 |
return this._valueAsArray.indexOf(item) !== -1; |
|
140 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
141 |
|
18 | 142 |
/** |
143 |
* Adds all arguments passed, except those already present. |
|
144 |
* |
|
145 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-add |
|
146 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
147 |
* @param items Items to add. |
18 | 148 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
149 |
add(...items) { |
18 | 150 |
this.value += ' ' + items.join(' '); |
151 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
152 |
|
18 | 153 |
/** |
154 |
* Removes arguments passed, if they are present. |
|
155 |
* |
|
156 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-remove |
|
157 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
158 |
* @param items Items to remove. |
18 | 159 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
160 |
remove(...items) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
161 |
this.value = this._valueAsArray.filter(val => !items.includes(val)).join(' '); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
162 |
} |
18 | 163 |
|
164 |
/** |
|
165 |
* If `force` is not given, "toggles" `token`, removing it if it’s present |
|
166 |
* and adding it if it’s not present. If `force` is true, adds token (same |
|
167 |
* as add()). If force is false, removes token (same as remove()). Returns |
|
168 |
* true if `token` is now present, and false otherwise. |
|
169 |
* |
|
170 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-toggle |
|
171 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
172 |
* @param token Token to toggle. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
173 |
* @param [force] Presence to force. |
18 | 174 |
* |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
175 |
* @return Whether token is present after toggle. |
18 | 176 |
*/ |
177 |
toggle(token, force) { |
|
178 |
if (undefined === force) { |
|
179 |
force = !this.contains(token); |
|
180 |
} |
|
181 |
if (force) { |
|
182 |
this.add(token); |
|
183 |
} else { |
|
184 |
this.remove(token); |
|
185 |
} |
|
186 |
return force; |
|
187 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
188 |
|
18 | 189 |
/** |
190 |
* Replaces `token` with `newToken`. Returns true if `token` was replaced |
|
191 |
* with `newToken`, and false otherwise. |
|
192 |
* |
|
193 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-replace |
|
194 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
195 |
* @param token Token to replace with `newToken`. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
196 |
* @param newToken Token to use in place of `token`. |
18 | 197 |
* |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
198 |
* @return Whether replacement occurred. |
18 | 199 |
*/ |
200 |
replace(token, newToken) { |
|
201 |
if (!this.contains(token)) { |
|
202 |
return false; |
|
203 |
} |
|
204 |
this.remove(token); |
|
205 |
this.add(newToken); |
|
206 |
return true; |
|
207 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
208 |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
209 |
/* eslint-disable @typescript-eslint/no-unused-vars */ |
18 | 210 |
/** |
211 |
* Returns true if `token` is in the associated attribute’s supported |
|
212 |
* tokens. Returns false otherwise. |
|
213 |
* |
|
214 |
* Always returns `true` in this implementation. |
|
215 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
216 |
* @param _token |
18 | 217 |
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-supports |
218 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
219 |
* @return Whether token is supported. |
18 | 220 |
*/ |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
221 |
supports(_token) { |
18 | 222 |
return true; |
223 |
} |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
224 |
/* eslint-enable @typescript-eslint/no-unused-vars */ |
18 | 225 |
} |
9 | 226 |
|
19 | 227 |
(window.wp = window.wp || {}).tokenList = __webpack_exports__["default"]; |
228 |
/******/ })() |
|
229 |
; |