| 166 | | $packages_dependencies = array( |
| 167 | | 'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ), |
| 168 | | 'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ), |
| 169 | | 'annotations' => array( |
| 170 | | 'wp-data', |
| 171 | | 'wp-hooks', |
| 172 | | 'wp-i18n', |
| 173 | | 'wp-polyfill', |
| 174 | | 'wp-rich-text', |
| 175 | | ), |
| 176 | | 'autop' => array( 'wp-polyfill' ), |
| 177 | | 'blob' => array( 'wp-polyfill' ), |
| 178 | | 'blocks' => array( |
| 179 | | 'wp-autop', |
| 180 | | 'wp-blob', |
| 181 | | 'wp-block-serialization-default-parser', |
| 182 | | 'wp-data', |
| 183 | | 'wp-dom', |
| 184 | | 'wp-element', |
| 185 | | 'wp-hooks', |
| 186 | | 'wp-i18n', |
| 187 | | 'wp-is-shallow-equal', |
| 188 | | 'wp-polyfill', |
| 189 | | 'wp-shortcode', |
| 190 | | 'lodash', |
| 191 | | ), |
| 192 | | 'block-library' => array( |
| 193 | | 'editor', |
| 194 | | 'lodash', |
| 195 | | 'moment', |
| 196 | | 'wp-api-fetch', |
| 197 | | 'wp-autop', |
| 198 | | 'wp-blob', |
| 199 | | 'wp-blocks', |
| 200 | | 'wp-components', |
| 201 | | 'wp-compose', |
| 202 | | 'wp-core-data', |
| 203 | | 'wp-data', |
| 204 | | 'wp-date', |
| 205 | | 'wp-editor', |
| 206 | | 'wp-element', |
| 207 | | 'wp-html-entities', |
| 208 | | 'wp-i18n', |
| 209 | | 'wp-keycodes', |
| 210 | | 'wp-polyfill', |
| 211 | | 'wp-url', |
| 212 | | 'wp-viewport', |
| 213 | | 'wp-rich-text', |
| 214 | | ), |
| 215 | | 'block-serialization-default-parser' => array(), |
| 216 | | 'block-serialization-spec-parser' => array( 'wp-polyfill' ), |
| 217 | | 'components' => array( |
| 218 | | 'lodash', |
| 219 | | 'moment', |
| 220 | | 'wp-a11y', |
| 221 | | 'wp-api-fetch', |
| 222 | | 'wp-compose', |
| 223 | | 'wp-deprecated', |
| 224 | | 'wp-dom', |
| 225 | | 'wp-element', |
| 226 | | 'wp-hooks', |
| 227 | | 'wp-html-entities', |
| 228 | | 'wp-i18n', |
| 229 | | 'wp-is-shallow-equal', |
| 230 | | 'wp-keycodes', |
| 231 | | 'wp-polyfill', |
| 232 | | 'wp-rich-text', |
| 233 | | 'wp-url', |
| 234 | | ), |
| 235 | | 'compose' => array( |
| 236 | | 'lodash', |
| 237 | | 'wp-deprecated', |
| 238 | | 'wp-element', |
| 239 | | 'wp-is-shallow-equal', |
| 240 | | 'wp-polyfill' |
| 241 | | ), |
| 242 | | 'core-data' => array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ), |
| 243 | | 'data' => array( |
| 244 | | 'lodash', |
| 245 | | 'wp-compose', |
| 246 | | 'wp-deprecated', |
| 247 | | 'wp-element', |
| 248 | | 'wp-is-shallow-equal', |
| 249 | | 'wp-polyfill', |
| 250 | | 'wp-redux-routine', |
| 251 | | ), |
| 252 | | 'date' => array( 'moment', 'wp-polyfill' ), |
| 253 | | 'deprecated' => array( 'wp-polyfill', 'wp-hooks' ), |
| 254 | | 'dom' => array( 'lodash', 'wp-polyfill', 'wp-tinymce' ), |
| 255 | | 'dom-ready' => array( 'wp-polyfill' ), |
| 256 | | 'edit-post' => array( |
| 257 | | 'jquery', |
| 258 | | 'lodash', |
| 259 | | 'postbox', |
| 260 | | 'media-models', |
| 261 | | 'media-views', |
| 262 | | 'wp-a11y', |
| 263 | | 'wp-api-fetch', |
| 264 | | 'wp-block-library', |
| 265 | | 'wp-blocks', |
| 266 | | 'wp-components', |
| 267 | | 'wp-compose', |
| 268 | | 'wp-core-data', |
| 269 | | 'wp-data', |
| 270 | | 'wp-dom-ready', |
| 271 | | 'wp-editor', |
| 272 | | 'wp-element', |
| 273 | | 'wp-embed', |
| 274 | | 'wp-i18n', |
| 275 | | 'wp-keycodes', |
| 276 | | 'wp-nux', |
| 277 | | 'wp-plugins', |
| 278 | | 'wp-polyfill', |
| 279 | | 'wp-url', |
| 280 | | 'wp-viewport', |
| 281 | | ), |
| 282 | | 'editor' => array( |
| 283 | | 'jquery', |
| 284 | | 'lodash', |
| 285 | | 'wp-tinymce-lists', |
| 286 | | 'wp-a11y', |
| 287 | | 'wp-api-fetch', |
| 288 | | 'wp-blob', |
| 289 | | 'wp-blocks', |
| 290 | | 'wp-components', |
| 291 | | 'wp-compose', |
| 292 | | 'wp-core-data', |
| 293 | | 'wp-data', |
| 294 | | 'wp-date', |
| 295 | | 'wp-deprecated', |
| 296 | | 'wp-dom', |
| 297 | | 'wp-element', |
| 298 | | 'wp-hooks', |
| 299 | | 'wp-html-entities', |
| 300 | | 'wp-i18n', |
| 301 | | 'wp-is-shallow-equal', |
| 302 | | 'wp-keycodes', |
| 303 | | 'wp-notices', |
| 304 | | 'wp-nux', |
| 305 | | 'wp-polyfill', |
| 306 | | 'wp-tinymce', |
| 307 | | 'wp-token-list', |
| 308 | | 'wp-url', |
| 309 | | 'wp-viewport', |
| 310 | | 'wp-wordcount', |
| 311 | | 'wp-rich-text', |
| 312 | | ), |
| 313 | | 'element' => array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ), |
| 314 | | 'escape-html' => array( 'wp-polyfill' ), |
| 315 | | 'format-library' => array( |
| 316 | | 'wp-components', |
| 317 | | 'wp-dom', |
| 318 | | 'wp-editor', |
| 319 | | 'wp-element', |
| 320 | | 'wp-i18n', |
| 321 | | 'wp-keycodes', |
| 322 | | 'wp-polyfill', |
| 323 | | 'wp-rich-text', |
| 324 | | 'wp-url', |
| 325 | | ), |
| 326 | | 'hooks' => array( 'wp-polyfill' ), |
| 327 | | 'html-entities' => array( 'wp-polyfill' ), |
| 328 | | 'i18n' => array( 'wp-polyfill' ), |
| 329 | | 'is-shallow-equal' => array( 'wp-polyfill' ), |
| 330 | | 'keycodes' => array( 'lodash', 'wp-polyfill', 'wp-i18n' ), |
| 331 | | 'list-reusable-blocks' => array( |
| 332 | | 'lodash', |
| 333 | | 'wp-api-fetch', |
| 334 | | 'wp-components', |
| 335 | | 'wp-compose', |
| 336 | | 'wp-element', |
| 337 | | 'wp-i18n', |
| 338 | | 'wp-polyfill', |
| 339 | | ), |
| 340 | | 'notices' => array( |
| 341 | | 'lodash', |
| 342 | | 'wp-a11y', |
| 343 | | 'wp-data', |
| 344 | | 'wp-polyfill', |
| 345 | | ), |
| 346 | | 'nux' => array( |
| 347 | | 'wp-element', |
| 348 | | 'wp-components', |
| 349 | | 'wp-compose', |
| 350 | | 'wp-data', |
| 351 | | 'wp-deprecated', |
| 352 | | 'wp-i18n', |
| 353 | | 'wp-polyfill', |
| 354 | | 'lodash', |
| 355 | | ), |
| 356 | | 'plugins' => array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ), |
| 357 | | 'redux-routine' => array( 'wp-polyfill' ), |
| 358 | | 'rich-text' => array( |
| 359 | | 'lodash', |
| 360 | | 'wp-blocks', |
| 361 | | 'wp-data', |
| 362 | | 'wp-deprecated', |
| 363 | | 'wp-escape-html', |
| 364 | | 'wp-polyfill', |
| 365 | | ), |
| 366 | | 'shortcode' => array( 'wp-polyfill', 'lodash' ), |
| 367 | | 'token-list' => array( 'lodash', 'wp-polyfill' ), |
| 368 | | 'url' => array( 'wp-polyfill' ), |
| 369 | | 'viewport' => array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ), |
| 370 | | 'wordcount' => array( 'wp-polyfill' ), |
| 371 | | ); |
| 372 | | |
| 373 | | $package_translations = array( |
| 374 | | 'api-fetch' => 'default', |
| 375 | | 'blocks' => 'default', |
| 376 | | 'block-library' => 'default', |
| 377 | | 'components' => 'default', |
| 378 | | 'edit-post' => 'default', |
| 379 | | 'editor' => 'default', |
| 380 | | 'format-library' => 'default', |
| 381 | | 'keycodes' => 'default', |
| 382 | | 'list-reusable-blocks' => 'default', |
| 383 | | 'nux' => 'default', |
| 384 | | ); |
| 385 | | |
| 386 | | foreach ( $packages_dependencies as $package => $dependencies ) { |
| 387 | | $handle = 'wp-' . $package; |
| 388 | | $path = "/wp-includes/js/dist/$package$suffix.js"; |
| 389 | | |
| 390 | | $scripts->add( $handle, $path, $dependencies, false, 1 ); |
| 391 | | |
| 392 | | if ( isset( $package_translations[ $package ] ) ) { |
| 393 | | $scripts->set_translations( $handle, $package_translations[ $package ] ); |
| 394 | | } |
| 395 | | } |
| | 153 | $scripts->add( 'wp-api-fetch', "/wp-includes/js/dist/api-fetch$suffix.js", array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ), false, '2.2.3' ); |
| | 154 | $scripts->set_translations( 'wp-api-fetch', 'default' ); |
| | 155 | |
| | 156 | $scripts->add( 'wp-a11y', "/wp-includes/js/dist/a11y$suffix.js", array( 'wp-dom-ready', 'wp-polyfill' ), false, '2.0.2' ); |
| | 157 | $scripts->add( 'wp-annotations', "/wp-includes/js/dist/annotations$suffix.js", array( 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text' ), false, '1.0.0' ); |
| | 158 | $scripts->add( 'wp-autop', "/wp-includes/js/dist/autop$suffix.js", array( 'wp-polyfill' ), false, '2.0.2' ); |
| | 159 | $scripts->add( 'wp-blob', "/wp-includes/js/dist/blob$suffix.js", array( 'wp-polyfill' ), false, '2.1.0' ); |
| | 160 | $scripts->add( 'wp-blocks', "/wp-includes/js/dist/blocks$suffix.js", array( 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode', 'lodash' ), false, '5.3.1' ); |
| | 161 | $scripts->set_translations( 'wp-blocks', 'default' ); |
| | 162 | |
| | 163 | $scripts->add( 'wp-block-library', "/wp-includes/js/dist/block-library$suffix.js", array( 'editor', 'lodash', 'moment', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-url', 'wp-viewport', 'wp-rich-text' ), false, '2.2.3' ); |
| | 164 | $scripts->set_translations( 'wp-block-library', 'default' ); |
| | 165 | |
| | 166 | $scripts->add( 'wp-block-serialization-default-parser', "/wp-includes/js/dist/block-serialization-default-parser$suffix.js", array(), false, '2.0.0' ); |
| | 167 | $scripts->add( 'wp-block-serialization-spec-parser', "/wp-includes/js/dist/block-serialization-spec-parser$suffix.js", array( 'wp-polyfill' ), false, '1' ); |
| | 168 | $scripts->add( 'wp-components', "/wp-includes/js/dist/components$suffix.js", array( 'lodash', 'moment', 'wp-a11y', 'wp-api-fetch', 'wp-compose', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-rich-text', 'wp-url' ), false, '6.0.1' ); |
| | 169 | $scripts->set_translations( 'wp-components', 'default' ); |
| | 170 | |
| | 171 | $scripts->add( 'wp-compose', "/wp-includes/js/dist/compose$suffix.js", array( 'lodash', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill' ), false, '2.1.2' ); |
| | 172 | $scripts->add( 'wp-core-data', "/wp-includes/js/dist/core-data$suffix.js", array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ), false, '2.0.12' ); |
| | 173 | $scripts->add( 'wp-data', "/wp-includes/js/dist/data$suffix.js", array( 'lodash', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-redux-routine' ), false, '3.1.2' ); |
| | 174 | $scripts->add( 'wp-date', "/wp-includes/js/dist/date$suffix.js", array( 'moment', 'wp-polyfill' ), false, '2.2.1' ); |
| | 175 | $scripts->add( 'wp-deprecated', "/wp-includes/js/dist/deprecated$suffix.js", array( 'wp-polyfill', 'wp-hooks' ), false, '2.0.3' ); |
| | 176 | $scripts->add( 'wp-dom', "/wp-includes/js/dist/dom$suffix.js", array( 'lodash', 'wp-polyfill', 'wp-tinymce' ), false, '2.0.6' ); |
| | 177 | $scripts->add( 'wp-dom-ready', "/wp-includes/js/dist/dom-ready$suffix.js", array( 'wp-polyfill' ), false, '2.0.2' ); |
| | 178 | $scripts->add( 'wp-edit-post', "/wp-includes/js/dist/edit-post$suffix.js", array( 'jquery', 'lodash', 'postbox', 'media-models', 'media-views', 'wp-a11y', 'wp-api-fetch', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-embed', 'wp-i18n', 'wp-keycodes', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url', 'wp-viewport' ), false, '3.0.1' ); |
| | 179 | $scripts->set_translations( 'wp-edit-post', 'default' ); |
| | 180 | |
| | 181 | $scripts->add( 'wp-editor', "/wp-includes/js/dist/editor$suffix.js", array( 'jquery', 'lodash', 'wp-tinymce-lists', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-nux', 'wp-polyfill', 'wp-tinymce', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-wordcount', 'wp-rich-text' ), false, '7.0.1' ); |
| | 182 | $scripts->set_translations( 'wp-editor', 'default' ); |
| | 183 | |
| | 184 | $scripts->add( 'wp-element', "/wp-includes/js/dist/element$suffix.js", array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ), false, '2.1.7' ); |
| | 185 | $scripts->add( 'wp-escape-html', "/wp-includes/js/dist/escape-html$suffix.js", array( 'wp-polyfill' ), false, '1.0.1' ); |
| | 186 | $scripts->add( 'wp-format-library', "/wp-includes/js/dist/format-library$suffix.js", array( 'wp-components', 'wp-dom', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-rich-text', 'wp-url' ), false, '1.2.1' ); |
| | 187 | $scripts->set_translations( 'wp-format-library', 'default' ); |
| | 188 | |
| | 189 | $scripts->add( 'wp-hooks', "/wp-includes/js/dist/hooks$suffix.js", array( 'wp-polyfill' ), false, '2.0.3' ); |
| | 190 | $scripts->add( 'wp-html-entities', "/wp-includes/js/dist/html-entities$suffix.js", array( 'wp-polyfill' ), false, '2.0.2' ); |
| | 191 | $scripts->add( 'wp-i18n', "/wp-includes/js/dist/i18n$suffix.js", array( 'wp-polyfill' ), false, '3.0.1' ); |
| | 192 | $scripts->add( 'wp-is-shallow-equal', "/wp-includes/js/dist/is-shallow-equal$suffix.js", array( 'wp-polyfill' ), false, '1.1.4' ); |
| | 193 | $scripts->add( 'wp-keycodes', "/wp-includes/js/dist/keycodes$suffix.js", array( 'lodash', 'wp-polyfill', 'wp-i18n' ), false, '2.0.3' ); |
| | 194 | $scripts->set_translations( 'wp-keycodes', 'default' ); |
| | 195 | |
| | 196 | $scripts->add( 'wp-list-reusable-blocks', "/wp-includes/js/dist/list-reusable-blocks$suffix.js", array( 'lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill' ), false, '1.1.11' ); |
| | 197 | $scripts->set_translations( 'wp-list-reusable-blocks', 'default' ); |
| | 198 | |
| | 199 | $scripts->add( 'wp-notices', "/wp-includes/js/dist/notices$suffix.js", array( 'lodash', 'wp-a11y', 'wp-data', 'wp-polyfill' ), false, '1.0.4' ); |
| | 200 | $scripts->add( 'wp-nux', "/wp-includes/js/dist/nux$suffix.js", array( 'wp-element', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-i18n', 'wp-polyfill', 'lodash' ), false, '2.0.13' ); |
| | 201 | $scripts->set_translations( 'wp-nux', 'default' ); |
| | 202 | |
| | 203 | $scripts->add( 'wp-plugins', "/wp-includes/js/dist/plugins$suffix.js", array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ), false, '2.0.8' ); |
| | 204 | $scripts->add( 'wp-redux-routine', "/wp-includes/js/dist/redux-routine$suffix.js", array( 'wp-polyfill' ), false, '3.0.3' ); |
| | 205 | $scripts->add( 'wp-rich-text', "/wp-includes/js/dist/rich-text$suffix.js", array( 'lodash', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-escape-html', 'wp-polyfill' ), false, '2.0.4' ); |
| | 206 | $scripts->add( 'wp-shortcode', "/wp-includes/js/dist/shortcode$suffix.js", array( 'wp-polyfill', 'lodash' ), false, '2.0.2' ); |
| | 207 | $scripts->add( 'wp-token-list', "/wp-includes/js/dist/token-list$suffix.js", array( 'lodash', 'wp-polyfill' ), false, '1.0.2' ); |
| | 208 | $scripts->add( 'wp-url', "/wp-includes/js/dist/url$suffix.js", array( 'wp-polyfill' ), false, '2.3.0' ); |
| | 209 | $scripts->add( 'wp-viewport', "/wp-includes/js/dist/viewport$suffix.js", array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ), false, '2.0.10' ); |
| | 210 | $scripts->add( 'wp-wordcount', "/wp-includes/js/dist/wordcount$suffix.js", array( 'wp-polyfill' ), false, '2.0.3' ); |