2018-12-13 23:41:57 -05:00
|
|
|
this["wp"] = this["wp"] || {}; this["wp"]["i18n"] =
|
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var installedModules = {};
|
|
|
|
/******/
|
|
|
|
/******/ // The require function
|
|
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/
|
|
|
|
/******/ // Check if module is in cache
|
|
|
|
/******/ if(installedModules[moduleId]) {
|
|
|
|
/******/ return installedModules[moduleId].exports;
|
|
|
|
/******/ }
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
|
|
/******/ var module = installedModules[moduleId] = {
|
|
|
|
/******/ i: moduleId,
|
|
|
|
/******/ l: false,
|
|
|
|
/******/ exports: {}
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // Execute the module function
|
|
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
|
|
/******/
|
|
|
|
/******/ // Flag the module as loaded
|
|
|
|
/******/ module.l = true;
|
|
|
|
/******/
|
|
|
|
/******/ // Return the exports of the module
|
|
|
|
/******/ return module.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/
|
|
|
|
/******/
|
|
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
|
|
/******/ __webpack_require__.m = modules;
|
|
|
|
/******/
|
|
|
|
/******/ // expose the module cache
|
|
|
|
/******/ __webpack_require__.c = installedModules;
|
|
|
|
/******/
|
|
|
|
/******/ // define getter function for harmony exports
|
|
|
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
|
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
|
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
|
|
/******/ }
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // define __esModule on exports
|
|
|
|
/******/ __webpack_require__.r = function(exports) {
|
|
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
/******/ }
|
|
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // create a fake namespace object
|
|
|
|
/******/ // mode & 1: value is a module id, require it
|
|
|
|
/******/ // mode & 2: merge all properties of value into the ns
|
|
|
|
/******/ // mode & 4: return value when already ns object
|
|
|
|
/******/ // mode & 8|1: behave like require
|
|
|
|
/******/ __webpack_require__.t = function(value, mode) {
|
|
|
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
|
|
/******/ if(mode & 8) return value;
|
|
|
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
|
|
/******/ var ns = Object.create(null);
|
|
|
|
/******/ __webpack_require__.r(ns);
|
|
|
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
|
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
|
|
/******/ return ns;
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
|
|
/******/ __webpack_require__.n = function(module) {
|
|
|
|
/******/ var getter = module && module.__esModule ?
|
|
|
|
/******/ function getDefault() { return module['default']; } :
|
|
|
|
/******/ function getModuleExports() { return module; };
|
|
|
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
|
|
/******/ return getter;
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // Object.prototype.hasOwnProperty.call
|
|
|
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
|
|
/******/
|
|
|
|
/******/ // __webpack_public_path__
|
|
|
|
/******/ __webpack_require__.p = "";
|
|
|
|
/******/
|
|
|
|
/******/
|
|
|
|
/******/ // Load entry module and return exports
|
2021-05-20 08:20:04 -04:00
|
|
|
/******/ return __webpack_require__(__webpack_require__.s = "Vhyj");
|
2018-12-13 23:41:57 -05:00
|
|
|
/******/ })
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ ({
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/***/ "4Z/T":
|
2018-12-17 22:14:52 -05:00
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
|
|
|
|
|
|
|
|
!function() {
|
|
|
|
'use strict'
|
|
|
|
|
|
|
|
var re = {
|
|
|
|
not_string: /[^s]/,
|
|
|
|
not_bool: /[^t]/,
|
|
|
|
not_type: /[^T]/,
|
|
|
|
not_primitive: /[^v]/,
|
|
|
|
number: /[diefg]/,
|
|
|
|
numeric_arg: /[bcdiefguxX]/,
|
|
|
|
json: /[j]/,
|
|
|
|
not_json: /[^j]/,
|
|
|
|
text: /^[^\x25]+/,
|
|
|
|
modulo: /^\x25{2}/,
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
|
2018-12-17 22:14:52 -05:00
|
|
|
key: /^([a-z_][a-z_\d]*)/i,
|
|
|
|
key_access: /^\.([a-z_][a-z_\d]*)/i,
|
|
|
|
index_access: /^\[(\d+)\]/,
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
sign: /^[+-]/
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function sprintf(key) {
|
|
|
|
// `arguments` is not an array, but should be fine for this call
|
|
|
|
return sprintf_format(sprintf_parse(key), arguments)
|
|
|
|
}
|
|
|
|
|
|
|
|
function vsprintf(fmt, argv) {
|
|
|
|
return sprintf.apply(null, [fmt].concat(argv || []))
|
|
|
|
}
|
|
|
|
|
|
|
|
function sprintf_format(parse_tree, argv) {
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
|
2018-12-17 22:14:52 -05:00
|
|
|
for (i = 0; i < tree_length; i++) {
|
|
|
|
if (typeof parse_tree[i] === 'string') {
|
|
|
|
output += parse_tree[i]
|
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
else if (typeof parse_tree[i] === 'object') {
|
|
|
|
ph = parse_tree[i] // convenience purposes only
|
|
|
|
if (ph.keys) { // keyword argument
|
2018-12-17 22:14:52 -05:00
|
|
|
arg = argv[cursor]
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
for (k = 0; k < ph.keys.length; k++) {
|
|
|
|
if (arg == undefined) {
|
|
|
|
throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = arg[ph.keys[k]]
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
else if (ph.param_no) { // positional argument (explicit)
|
|
|
|
arg = argv[ph.param_no]
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
else { // positional argument (implicit)
|
|
|
|
arg = argv[cursor++]
|
|
|
|
}
|
|
|
|
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
|
2018-12-17 22:14:52 -05:00
|
|
|
arg = arg()
|
|
|
|
}
|
|
|
|
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
|
2018-12-17 22:14:52 -05:00
|
|
|
throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
|
|
|
|
}
|
|
|
|
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
if (re.number.test(ph.type)) {
|
2018-12-17 22:14:52 -05:00
|
|
|
is_positive = arg >= 0
|
|
|
|
}
|
|
|
|
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
switch (ph.type) {
|
2018-12-17 22:14:52 -05:00
|
|
|
case 'b':
|
|
|
|
arg = parseInt(arg, 10).toString(2)
|
|
|
|
break
|
|
|
|
case 'c':
|
|
|
|
arg = String.fromCharCode(parseInt(arg, 10))
|
|
|
|
break
|
|
|
|
case 'd':
|
|
|
|
case 'i':
|
|
|
|
arg = parseInt(arg, 10)
|
|
|
|
break
|
|
|
|
case 'j':
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'e':
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'f':
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'g':
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'o':
|
|
|
|
arg = (parseInt(arg, 10) >>> 0).toString(8)
|
|
|
|
break
|
|
|
|
case 's':
|
|
|
|
arg = String(arg)
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 't':
|
|
|
|
arg = String(!!arg)
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'T':
|
|
|
|
arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'u':
|
|
|
|
arg = parseInt(arg, 10) >>> 0
|
|
|
|
break
|
|
|
|
case 'v':
|
|
|
|
arg = arg.valueOf()
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
break
|
|
|
|
case 'x':
|
|
|
|
arg = (parseInt(arg, 10) >>> 0).toString(16)
|
|
|
|
break
|
|
|
|
case 'X':
|
|
|
|
arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
|
|
|
|
break
|
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
if (re.json.test(ph.type)) {
|
2018-12-17 22:14:52 -05:00
|
|
|
output += arg
|
|
|
|
}
|
|
|
|
else {
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
|
2018-12-17 22:14:52 -05:00
|
|
|
sign = is_positive ? '+' : '-'
|
|
|
|
arg = arg.toString().replace(re.sign, '')
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
sign = ''
|
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '
|
|
|
|
pad_length = ph.width - (sign + arg).length
|
|
|
|
pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
|
|
|
|
output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return output
|
|
|
|
}
|
|
|
|
|
|
|
|
var sprintf_cache = Object.create(null)
|
|
|
|
|
|
|
|
function sprintf_parse(fmt) {
|
|
|
|
if (sprintf_cache[fmt]) {
|
|
|
|
return sprintf_cache[fmt]
|
|
|
|
}
|
|
|
|
|
|
|
|
var _fmt = fmt, match, parse_tree = [], arg_names = 0
|
|
|
|
while (_fmt) {
|
|
|
|
if ((match = re.text.exec(_fmt)) !== null) {
|
|
|
|
parse_tree.push(match[0])
|
|
|
|
}
|
|
|
|
else if ((match = re.modulo.exec(_fmt)) !== null) {
|
|
|
|
parse_tree.push('%')
|
|
|
|
}
|
|
|
|
else if ((match = re.placeholder.exec(_fmt)) !== null) {
|
|
|
|
if (match[2]) {
|
|
|
|
arg_names |= 1
|
|
|
|
var field_list = [], replacement_field = match[2], field_match = []
|
|
|
|
if ((field_match = re.key.exec(replacement_field)) !== null) {
|
|
|
|
field_list.push(field_match[1])
|
|
|
|
while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
|
|
|
|
if ((field_match = re.key_access.exec(replacement_field)) !== null) {
|
|
|
|
field_list.push(field_match[1])
|
|
|
|
}
|
|
|
|
else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
|
|
|
|
field_list.push(field_match[1])
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new SyntaxError('[sprintf] failed to parse named argument key')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new SyntaxError('[sprintf] failed to parse named argument key')
|
|
|
|
}
|
|
|
|
match[2] = field_list
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
arg_names |= 2
|
|
|
|
}
|
|
|
|
if (arg_names === 3) {
|
|
|
|
throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
|
|
|
|
}
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
|
|
|
|
parse_tree.push(
|
|
|
|
{
|
|
|
|
placeholder: match[0],
|
|
|
|
param_no: match[1],
|
|
|
|
keys: match[2],
|
|
|
|
sign: match[3],
|
|
|
|
pad_char: match[4],
|
|
|
|
align: match[5],
|
|
|
|
width: match[6],
|
|
|
|
precision: match[7],
|
|
|
|
type: match[8]
|
|
|
|
}
|
|
|
|
)
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw new SyntaxError('[sprintf] unexpected placeholder')
|
|
|
|
}
|
|
|
|
_fmt = _fmt.substring(match[0].length)
|
|
|
|
}
|
|
|
|
return sprintf_cache[fmt] = parse_tree
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* export to either browser or node.js
|
|
|
|
*/
|
|
|
|
/* eslint-disable quote-props */
|
|
|
|
if (true) {
|
|
|
|
exports['sprintf'] = sprintf
|
|
|
|
exports['vsprintf'] = vsprintf
|
|
|
|
}
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
window['sprintf'] = sprintf
|
|
|
|
window['vsprintf'] = vsprintf
|
|
|
|
|
|
|
|
if (true) {
|
|
|
|
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
|
|
|
return {
|
|
|
|
'sprintf': sprintf,
|
|
|
|
'vsprintf': vsprintf
|
|
|
|
}
|
|
|
|
}).call(exports, __webpack_require__, exports, module),
|
|
|
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* eslint-enable quote-props */
|
Block Editor: Upgrade the `@wordpress/` packages.
This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.
Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.
Built from https://develop.svn.wordpress.org/trunk@44533
git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 20:54:56 -05:00
|
|
|
}(); // eslint-disable-line
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/***/ "4eJC":
|
2021-05-19 11:09:27 -04:00
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Memize options object.
|
|
|
|
*
|
|
|
|
* @typedef MemizeOptions
|
|
|
|
*
|
|
|
|
* @property {number} [maxSize] Maximum size of the cache.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal cache entry.
|
|
|
|
*
|
|
|
|
* @typedef MemizeCacheNode
|
|
|
|
*
|
|
|
|
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
|
|
|
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
|
|
|
* @property {Array<*>} args Function arguments for cache
|
|
|
|
* entry.
|
|
|
|
* @property {*} val Function result.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Properties of the enhanced function for controlling cache.
|
|
|
|
*
|
|
|
|
* @typedef MemizeMemoizedFunction
|
|
|
|
*
|
|
|
|
* @property {()=>void} clear Clear the cache.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Accepts a function to be memoized, and returns a new memoized function, with
|
|
|
|
* optional options.
|
|
|
|
*
|
|
|
|
* @template {Function} F
|
|
|
|
*
|
|
|
|
* @param {F} fn Function to memoize.
|
|
|
|
* @param {MemizeOptions} [options] Options object.
|
|
|
|
*
|
|
|
|
* @return {F & MemizeMemoizedFunction} Memoized function.
|
|
|
|
*/
|
|
|
|
function memize( fn, options ) {
|
|
|
|
var size = 0;
|
|
|
|
|
|
|
|
/** @type {?MemizeCacheNode|undefined} */
|
|
|
|
var head;
|
|
|
|
|
|
|
|
/** @type {?MemizeCacheNode|undefined} */
|
|
|
|
var tail;
|
|
|
|
|
|
|
|
options = options || {};
|
|
|
|
|
|
|
|
function memoized( /* ...args */ ) {
|
|
|
|
var node = head,
|
|
|
|
len = arguments.length,
|
|
|
|
args, i;
|
|
|
|
|
|
|
|
searchCache: while ( node ) {
|
|
|
|
// Perform a shallow equality test to confirm that whether the node
|
|
|
|
// under test is a candidate for the arguments passed. Two arrays
|
|
|
|
// are shallowly equal if their length matches and each entry is
|
|
|
|
// strictly equal between the two sets. Avoid abstracting to a
|
|
|
|
// function which could incur an arguments leaking deoptimization.
|
|
|
|
|
|
|
|
// Check whether node arguments match arguments length
|
|
|
|
if ( node.args.length !== arguments.length ) {
|
|
|
|
node = node.next;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check whether node arguments match arguments values
|
|
|
|
for ( i = 0; i < len; i++ ) {
|
|
|
|
if ( node.args[ i ] !== arguments[ i ] ) {
|
|
|
|
node = node.next;
|
|
|
|
continue searchCache;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// At this point we can assume we've found a match
|
|
|
|
|
|
|
|
// Surface matched node to head if not already
|
|
|
|
if ( node !== head ) {
|
|
|
|
// As tail, shift to previous. Must only shift if not also
|
|
|
|
// head, since if both head and tail, there is no previous.
|
|
|
|
if ( node === tail ) {
|
|
|
|
tail = node.prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adjust siblings to point to each other. If node was tail,
|
|
|
|
// this also handles new tail's empty `next` assignment.
|
|
|
|
/** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
|
|
|
|
if ( node.next ) {
|
|
|
|
node.next.prev = node.prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
node.next = head;
|
|
|
|
node.prev = null;
|
|
|
|
/** @type {MemizeCacheNode} */ ( head ).prev = node;
|
|
|
|
head = node;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return immediately
|
|
|
|
return node.val;
|
|
|
|
}
|
|
|
|
|
|
|
|
// No cached value found. Continue to insertion phase:
|
|
|
|
|
|
|
|
// Create a copy of arguments (avoid leaking deoptimization)
|
|
|
|
args = new Array( len );
|
|
|
|
for ( i = 0; i < len; i++ ) {
|
|
|
|
args[ i ] = arguments[ i ];
|
|
|
|
}
|
|
|
|
|
|
|
|
node = {
|
|
|
|
args: args,
|
|
|
|
|
|
|
|
// Generate the result from original function
|
|
|
|
val: fn.apply( null, args ),
|
|
|
|
};
|
|
|
|
|
|
|
|
// Don't need to check whether node is already head, since it would
|
|
|
|
// have been returned above already if it was
|
|
|
|
|
|
|
|
// Shift existing head down list
|
|
|
|
if ( head ) {
|
|
|
|
head.prev = node;
|
|
|
|
node.next = head;
|
|
|
|
} else {
|
|
|
|
// If no head, follows that there's no tail (at initial or reset)
|
|
|
|
tail = node;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Trim tail if we're reached max size and are pending cache insertion
|
|
|
|
if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
|
|
|
|
tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
|
|
|
|
/** @type {MemizeCacheNode} */ ( tail ).next = null;
|
|
|
|
} else {
|
|
|
|
size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
head = node;
|
|
|
|
|
|
|
|
return node.val;
|
|
|
|
}
|
|
|
|
|
|
|
|
memoized.clear = function() {
|
|
|
|
head = null;
|
|
|
|
tail = null;
|
|
|
|
size = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
if ( false ) {}
|
|
|
|
|
|
|
|
// Ignore reason: There's not a clear solution to create an intersection of
|
|
|
|
// the function with additional properties, where the goal is to retain the
|
|
|
|
// function signature of the incoming argument and add control properties
|
|
|
|
// on the return value.
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
return memoized;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = memize;
|
2021-02-02 00:17:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/***/ "Vhyj":
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
"use strict";
|
2020-06-29 07:50:29 -04:00
|
|
|
// ESM COMPAT FLAG
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
2020-06-29 07:50:29 -04:00
|
|
|
// EXPORTS
|
|
|
|
__webpack_require__.d(__webpack_exports__, "sprintf", function() { return /* reexport */ sprintf_sprintf; });
|
2021-05-19 11:09:27 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "createI18n", function() { return /* reexport */ createI18n; });
|
2021-04-15 11:19:43 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "defaultI18n", function() { return /* reexport */ default_i18n; });
|
2020-06-29 07:50:29 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "setLocaleData", function() { return /* reexport */ default_i18n_setLocaleData; });
|
2021-05-07 07:48:27 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "resetLocaleData", function() { return /* reexport */ default_i18n_resetLocaleData; });
|
2021-04-15 11:19:43 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "getLocaleData", function() { return /* reexport */ default_i18n_getLocaleData; });
|
|
|
|
__webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* reexport */ default_i18n_subscribe; });
|
2020-06-29 07:50:29 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "__", function() { return /* reexport */ default_i18n_; });
|
|
|
|
__webpack_require__.d(__webpack_exports__, "_x", function() { return /* reexport */ default_i18n_x; });
|
|
|
|
__webpack_require__.d(__webpack_exports__, "_n", function() { return /* reexport */ default_i18n_n; });
|
|
|
|
__webpack_require__.d(__webpack_exports__, "_nx", function() { return /* reexport */ default_i18n_nx; });
|
|
|
|
__webpack_require__.d(__webpack_exports__, "isRTL", function() { return /* reexport */ default_i18n_isRTL; });
|
2021-04-15 11:19:43 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, "hasTranslation", function() { return /* reexport */ default_i18n_hasTranslation; });
|
2020-06-29 07:50:29 -04:00
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
// EXTERNAL MODULE: ./node_modules/memize/index.js
|
2021-05-20 08:20:04 -04:00
|
|
|
var memize = __webpack_require__("4eJC");
|
2020-06-26 09:33:47 -04:00
|
|
|
var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/sprintf-js/src/sprintf.js
|
2021-05-20 08:20:04 -04:00
|
|
|
var sprintf = __webpack_require__("4Z/T");
|
2020-06-26 09:33:47 -04:00
|
|
|
var sprintf_default = /*#__PURE__*/__webpack_require__.n(sprintf);
|
|
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/sprintf.js
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log to console, once per message; or more precisely, per referentially equal
|
|
|
|
* argument set. Because Jed throws errors, we log these to the console instead
|
|
|
|
* to avoid crashing the application.
|
|
|
|
*
|
|
|
|
* @param {...*} args Arguments to pass to `console.error`
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const logErrorOnce = memize_default()(console.error); // eslint-disable-line no-console
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a formatted string. If an error occurs in applying the format, the
|
|
|
|
* original format string is returned.
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {string} format The format of the string to generate.
|
|
|
|
* @param {...*} args Arguments to apply to the format.
|
2020-06-26 09:33:47 -04:00
|
|
|
*
|
2021-04-15 11:19:43 -04:00
|
|
|
* @see https://www.npmjs.com/package/sprintf-js
|
2020-06-26 09:33:47 -04:00
|
|
|
*
|
|
|
|
* @return {string} The formatted string.
|
|
|
|
*/
|
|
|
|
|
2021-11-15 07:50:17 -05:00
|
|
|
function sprintf_sprintf(format) {
|
2020-06-26 09:33:47 -04:00
|
|
|
try {
|
2021-11-15 07:50:17 -05:00
|
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
|
|
args[_key - 1] = arguments[_key];
|
|
|
|
}
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
return sprintf_default.a.sprintf(format, ...args);
|
2020-06-26 09:33:47 -04:00
|
|
|
} catch (error) {
|
2021-11-08 09:29:21 -05:00
|
|
|
if (error instanceof Error) {
|
|
|
|
logErrorOnce('sprintf error: \n\n' + error.toString());
|
|
|
|
}
|
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
return format;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// CONCATENATED MODULE: ./node_modules/@tannin/postfix/index.js
|
|
|
|
var PRECEDENCE, OPENERS, TERMINATORS, PATTERN;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Operator precedence mapping.
|
|
|
|
*
|
|
|
|
* @type {Object}
|
|
|
|
*/
|
|
|
|
PRECEDENCE = {
|
|
|
|
'(': 9,
|
|
|
|
'!': 8,
|
|
|
|
'*': 7,
|
|
|
|
'/': 7,
|
|
|
|
'%': 7,
|
|
|
|
'+': 6,
|
|
|
|
'-': 6,
|
|
|
|
'<': 5,
|
|
|
|
'<=': 5,
|
|
|
|
'>': 5,
|
|
|
|
'>=': 5,
|
|
|
|
'==': 4,
|
|
|
|
'!=': 4,
|
|
|
|
'&&': 3,
|
|
|
|
'||': 2,
|
|
|
|
'?': 1,
|
|
|
|
'?:': 1,
|
|
|
|
};
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Characters which signal pair opening, to be terminated by terminators.
|
|
|
|
*
|
|
|
|
* @type {string[]}
|
|
|
|
*/
|
|
|
|
OPENERS = [ '(', '?' ];
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Characters which signal pair termination, the value an array with the
|
|
|
|
* opener as its first member. The second member is an optional operator
|
|
|
|
* replacement to push to the stack.
|
|
|
|
*
|
|
|
|
* @type {string[]}
|
|
|
|
*/
|
|
|
|
TERMINATORS = {
|
|
|
|
')': [ '(' ],
|
|
|
|
':': [ '?', '?:' ],
|
|
|
|
};
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Pattern matching operators and openers.
|
|
|
|
*
|
|
|
|
* @type {RegExp}
|
|
|
|
*/
|
|
|
|
PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
/**
|
2018-12-17 22:14:52 -05:00
|
|
|
* Given a C expression, returns the equivalent postfix (Reverse Polish)
|
|
|
|
* notation terms as an array.
|
|
|
|
*
|
|
|
|
* If a postfix string is desired, simply `.join( ' ' )` the result.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
|
|
|
* @example
|
|
|
|
*
|
|
|
|
* ```js
|
2018-12-17 22:14:52 -05:00
|
|
|
* import postfix from '@tannin/postfix';
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* postfix( 'n > 1' );
|
|
|
|
* // ⇒ [ 'n', '1', '>' ]
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
* ```
|
|
|
|
*
|
|
|
|
* @param {string} expression C expression.
|
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* @return {string[]} Postfix terms.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
function postfix( expression ) {
|
|
|
|
var terms = [],
|
|
|
|
stack = [],
|
|
|
|
match, operator, term, element;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
while ( ( match = expression.match( PATTERN ) ) ) {
|
|
|
|
operator = match[ 0 ];
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// Term is the string preceding the operator match. It may contain
|
|
|
|
// whitespace, and may be empty (if operator is at beginning).
|
|
|
|
term = expression.substr( 0, match.index ).trim();
|
|
|
|
if ( term ) {
|
|
|
|
terms.push( term );
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
while ( ( element = stack.pop() ) ) {
|
|
|
|
if ( TERMINATORS[ operator ] ) {
|
|
|
|
if ( TERMINATORS[ operator ][ 0 ] === element ) {
|
|
|
|
// Substitution works here under assumption that because
|
|
|
|
// the assigned operator will no longer be a terminator, it
|
|
|
|
// will be pushed to the stack during the condition below.
|
|
|
|
operator = TERMINATORS[ operator ][ 1 ] || operator;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) {
|
|
|
|
// Push to stack if either an opener or when pop reveals an
|
|
|
|
// element of lower precedence.
|
|
|
|
stack.push( element );
|
|
|
|
break;
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// For each popped from stack, push to terms.
|
|
|
|
terms.push( element );
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
if ( ! TERMINATORS[ operator ] ) {
|
|
|
|
stack.push( operator );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Slice matched fragment from expression to continue match.
|
|
|
|
expression = expression.substr( match.index + operator.length );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Push remainder of operand, if exists, to terms.
|
|
|
|
expression = expression.trim();
|
|
|
|
if ( expression ) {
|
|
|
|
terms.push( expression );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Pop remaining items from stack into terms.
|
|
|
|
return terms.concat( stack.reverse() );
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/@tannin/evaluate/index.js
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
/**
|
|
|
|
* Operator callback functions.
|
|
|
|
*
|
|
|
|
* @type {Object}
|
|
|
|
*/
|
|
|
|
var OPERATORS = {
|
|
|
|
'!': function( a ) {
|
|
|
|
return ! a;
|
|
|
|
},
|
|
|
|
'*': function( a, b ) {
|
|
|
|
return a * b;
|
|
|
|
},
|
|
|
|
'/': function( a, b ) {
|
|
|
|
return a / b;
|
|
|
|
},
|
|
|
|
'%': function( a, b ) {
|
|
|
|
return a % b;
|
|
|
|
},
|
|
|
|
'+': function( a, b ) {
|
|
|
|
return a + b;
|
|
|
|
},
|
|
|
|
'-': function( a, b ) {
|
|
|
|
return a - b;
|
|
|
|
},
|
|
|
|
'<': function( a, b ) {
|
|
|
|
return a < b;
|
|
|
|
},
|
|
|
|
'<=': function( a, b ) {
|
|
|
|
return a <= b;
|
|
|
|
},
|
|
|
|
'>': function( a, b ) {
|
|
|
|
return a > b;
|
|
|
|
},
|
|
|
|
'>=': function( a, b ) {
|
|
|
|
return a >= b;
|
|
|
|
},
|
|
|
|
'==': function( a, b ) {
|
|
|
|
return a === b;
|
|
|
|
},
|
|
|
|
'!=': function( a, b ) {
|
|
|
|
return a !== b;
|
|
|
|
},
|
|
|
|
'&&': function( a, b ) {
|
|
|
|
return a && b;
|
|
|
|
},
|
|
|
|
'||': function( a, b ) {
|
|
|
|
return a || b;
|
|
|
|
},
|
|
|
|
'?:': function( a, b, c ) {
|
|
|
|
if ( a ) {
|
|
|
|
throw b;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Given an array of postfix terms and operand variables, returns the result of
|
|
|
|
* the postfix evaluation.
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
*
|
|
|
|
* ```js
|
|
|
|
* import evaluate from '@tannin/evaluate';
|
|
|
|
*
|
|
|
|
* // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'
|
|
|
|
* const terms = [ '3', '4', '5', '*', '6', '/', '+' ];
|
|
|
|
*
|
|
|
|
* evaluate( terms, {} );
|
|
|
|
* // ⇒ 6.333333333333334
|
|
|
|
* ```
|
|
|
|
*
|
|
|
|
* @param {string[]} postfix Postfix terms.
|
|
|
|
* @param {Object} variables Operand variables.
|
|
|
|
*
|
|
|
|
* @return {*} Result of evaluation.
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
function evaluate_evaluate( postfix, variables ) {
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
var stack = [],
|
2019-03-07 04:09:59 -05:00
|
|
|
i, j, args, getOperatorResult, term, value;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
for ( i = 0; i < postfix.length; i++ ) {
|
|
|
|
term = postfix[ i ];
|
|
|
|
|
|
|
|
getOperatorResult = OPERATORS[ term ];
|
|
|
|
if ( getOperatorResult ) {
|
2019-03-07 04:09:59 -05:00
|
|
|
// Pop from stack by number of function arguments.
|
|
|
|
j = getOperatorResult.length;
|
|
|
|
args = Array( j );
|
|
|
|
while ( j-- ) {
|
|
|
|
args[ j ] = stack.pop();
|
|
|
|
}
|
|
|
|
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
try {
|
2019-03-07 04:09:59 -05:00
|
|
|
value = getOperatorResult.apply( null, args );
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
} catch ( earlyReturn ) {
|
|
|
|
return earlyReturn;
|
|
|
|
}
|
|
|
|
} else if ( variables.hasOwnProperty( term ) ) {
|
|
|
|
value = variables[ term ];
|
|
|
|
} else {
|
|
|
|
value = +term;
|
|
|
|
}
|
|
|
|
|
|
|
|
stack.push( value );
|
|
|
|
}
|
|
|
|
|
|
|
|
return stack[ 0 ];
|
|
|
|
}
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// CONCATENATED MODULE: ./node_modules/@tannin/compile/index.js
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Given a C expression, returns a function which can be called to evaluate its
|
|
|
|
* result.
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
*
|
|
|
|
* ```js
|
|
|
|
* import compile from '@tannin/compile';
|
|
|
|
*
|
|
|
|
* const evaluate = compile( 'n > 1' );
|
|
|
|
*
|
|
|
|
* evaluate( { n: 2 } );
|
|
|
|
* // ⇒ true
|
|
|
|
* ```
|
|
|
|
*
|
|
|
|
* @param {string} expression C expression.
|
|
|
|
*
|
2020-03-10 10:53:18 -04:00
|
|
|
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
|
2018-12-17 22:14:52 -05:00
|
|
|
*/
|
|
|
|
function compile( expression ) {
|
|
|
|
var terms = postfix( expression );
|
|
|
|
|
|
|
|
return function( variables ) {
|
|
|
|
return evaluate_evaluate( terms, variables );
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/@tannin/plural-forms/index.js
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Given a C expression, returns a function which, when called with a value,
|
|
|
|
* evaluates the result with the value assumed to be the "n" variable of the
|
|
|
|
* expression. The result will be coerced to its numeric equivalent.
|
|
|
|
*
|
|
|
|
* @param {string} expression C expression.
|
|
|
|
*
|
|
|
|
* @return {Function} Evaluator function.
|
|
|
|
*/
|
|
|
|
function pluralForms( expression ) {
|
2018-12-17 22:14:52 -05:00
|
|
|
var evaluate = compile( expression );
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
return function( n ) {
|
|
|
|
return +evaluate( { n: n } );
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// CONCATENATED MODULE: ./node_modules/tannin/index.js
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-12-17 22:14:52 -05:00
|
|
|
* Tannin constructor options.
|
|
|
|
*
|
2020-01-08 06:57:23 -05:00
|
|
|
* @typedef {Object} TanninOptions
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
2020-01-08 06:57:23 -05:00
|
|
|
* @property {string} [contextDelimiter] Joiner in string lookup with context.
|
|
|
|
* @property {Function} [onMissingKey] Callback to invoke when key missing.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Domain metadata.
|
|
|
|
*
|
|
|
|
* @typedef {Object} TanninDomainMetadata
|
|
|
|
*
|
|
|
|
* @property {string} [domain] Domain name.
|
|
|
|
* @property {string} [lang] Language code.
|
|
|
|
* @property {(string|Function)} [plural_forms] Plural forms expression or
|
|
|
|
* function evaluator.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Domain translation pair respectively representing the singular and plural
|
|
|
|
* translation.
|
|
|
|
*
|
2020-03-10 10:53:18 -04:00
|
|
|
* @typedef {[string,string]} TanninTranslation
|
2020-01-08 06:57:23 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Locale data domain. The key is used as reference for lookup, the value an
|
|
|
|
* array of two string entries respectively representing the singular and plural
|
|
|
|
* translation.
|
|
|
|
*
|
2020-03-10 10:53:18 -04:00
|
|
|
* @typedef {{[key:string]:TanninDomainMetadata|TanninTranslation,'':TanninDomainMetadata|TanninTranslation}} TanninLocaleDomain
|
2020-01-08 06:57:23 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Jed-formatted locale data.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*
|
2020-03-10 10:53:18 -04:00
|
|
|
* @typedef {{[domain:string]:TanninLocaleDomain}} TanninLocaleData
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-12-17 22:14:52 -05:00
|
|
|
* Default Tannin constructor options.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* @type {TanninOptions}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
var DEFAULT_OPTIONS = {
|
|
|
|
contextDelimiter: '\u0004',
|
|
|
|
onMissingKey: null,
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2018-12-17 22:14:52 -05:00
|
|
|
* Given a specific locale data's config `plural_forms` value, returns the
|
|
|
|
* expression.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
|
|
|
* @example
|
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* ```
|
|
|
|
* getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
* ```
|
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* @param {string} pf Locale data plural forms.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*
|
2018-12-17 22:14:52 -05:00
|
|
|
* @return {string} Plural forms expression.
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
function getPluralExpression( pf ) {
|
|
|
|
var parts, i, part;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
parts = pf.split( ';' );
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
for ( i = 0; i < parts.length; i++ ) {
|
|
|
|
part = parts[ i ].trim();
|
|
|
|
if ( part.indexOf( 'plural=' ) === 0 ) {
|
|
|
|
return part.substr( 7 );
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
}
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Tannin constructor.
|
|
|
|
*
|
2020-01-08 06:57:23 -05:00
|
|
|
* @class
|
|
|
|
*
|
|
|
|
* @param {TanninLocaleData} data Jed-formatted locale data.
|
|
|
|
* @param {TanninOptions} [options] Tannin options.
|
2018-12-17 22:14:52 -05:00
|
|
|
*/
|
|
|
|
function Tannin( data, options ) {
|
|
|
|
var key;
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
/**
|
|
|
|
* Jed-formatted locale data.
|
|
|
|
*
|
|
|
|
* @name Tannin#data
|
|
|
|
* @type {TanninLocaleData}
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
this.data = data;
|
2020-01-08 06:57:23 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plural forms function cache, keyed by plural forms string.
|
|
|
|
*
|
|
|
|
* @name Tannin#pluralForms
|
|
|
|
* @type {Object<string,Function>}
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
this.pluralForms = {};
|
|
|
|
|
2020-01-08 06:57:23 -05:00
|
|
|
/**
|
|
|
|
* Effective options for instance, including defaults.
|
|
|
|
*
|
|
|
|
* @name Tannin#options
|
|
|
|
* @type {TanninOptions}
|
|
|
|
*/
|
2018-12-17 22:14:52 -05:00
|
|
|
this.options = {};
|
2020-01-08 06:57:23 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
for ( key in DEFAULT_OPTIONS ) {
|
2020-03-10 10:53:18 -04:00
|
|
|
this.options[ key ] = options !== undefined && key in options
|
|
|
|
? options[ key ]
|
|
|
|
: DEFAULT_OPTIONS[ key ];
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the plural form index for the given domain and value.
|
|
|
|
*
|
|
|
|
* @param {string} domain Domain on which to calculate plural form.
|
|
|
|
* @param {number} n Value for which plural form is to be calculated.
|
|
|
|
*
|
|
|
|
* @return {number} Plural form index.
|
|
|
|
*/
|
|
|
|
Tannin.prototype.getPluralForm = function( domain, n ) {
|
|
|
|
var getPluralForm = this.pluralForms[ domain ],
|
2019-03-21 08:48:00 -04:00
|
|
|
config, plural, pf;
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
if ( ! getPluralForm ) {
|
|
|
|
config = this.data[ domain ][ '' ];
|
2019-03-21 08:48:00 -04:00
|
|
|
|
|
|
|
pf = (
|
2018-12-17 22:14:52 -05:00
|
|
|
config[ 'Plural-Forms' ] ||
|
|
|
|
config[ 'plural-forms' ] ||
|
2020-01-08 06:57:23 -05:00
|
|
|
// Ignore reason: As known, there's no way to document the empty
|
|
|
|
// string property on a key to guarantee this as metadata.
|
|
|
|
// @ts-ignore
|
2018-12-17 22:14:52 -05:00
|
|
|
config.plural_forms
|
|
|
|
);
|
|
|
|
|
2019-03-21 08:48:00 -04:00
|
|
|
if ( typeof pf !== 'function' ) {
|
|
|
|
plural = getPluralExpression(
|
|
|
|
config[ 'Plural-Forms' ] ||
|
|
|
|
config[ 'plural-forms' ] ||
|
2020-01-08 06:57:23 -05:00
|
|
|
// Ignore reason: As known, there's no way to document the empty
|
|
|
|
// string property on a key to guarantee this as metadata.
|
|
|
|
// @ts-ignore
|
2019-03-21 08:48:00 -04:00
|
|
|
config.plural_forms
|
|
|
|
);
|
|
|
|
|
|
|
|
pf = pluralForms( plural );
|
|
|
|
}
|
|
|
|
|
|
|
|
getPluralForm = this.pluralForms[ domain ] = pf;
|
2018-12-17 22:14:52 -05:00
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
return getPluralForm( n );
|
|
|
|
};
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Translate a string.
|
|
|
|
*
|
2020-03-10 10:53:18 -04:00
|
|
|
* @param {string} domain Translation domain.
|
|
|
|
* @param {string|void} context Context distinguishing terms of the same name.
|
|
|
|
* @param {string} singular Primary key for translation lookup.
|
|
|
|
* @param {string=} plural Fallback value used for non-zero plural
|
|
|
|
* form index.
|
|
|
|
* @param {number=} n Value to use in calculating plural form.
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
|
|
|
* @return {string} Translated string.
|
|
|
|
*/
|
|
|
|
Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
|
|
|
|
var index, key, entry;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
if ( n === undefined ) {
|
|
|
|
// Default to singular.
|
|
|
|
index = 0;
|
|
|
|
} else {
|
|
|
|
// Find index by evaluating plural form for value.
|
|
|
|
index = this.getPluralForm( domain, n );
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
}
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
key = singular;
|
|
|
|
|
|
|
|
// If provided, context is prepended to key with delimiter.
|
|
|
|
if ( context ) {
|
|
|
|
key = context + this.options.contextDelimiter + singular;
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
}
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
entry = this.data[ domain ][ key ];
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// Verify not only that entry exists, but that the intended index is within
|
|
|
|
// range and non-empty.
|
|
|
|
if ( entry && entry[ index ] ) {
|
|
|
|
return entry[ index ];
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
if ( this.options.onMissingKey ) {
|
|
|
|
this.options.onMissingKey( singular, domain );
|
|
|
|
}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
// If entry not found, fall back to singular vs. plural with zero index
|
|
|
|
// representing the singular value.
|
|
|
|
return index === 0 ? singular : plural;
|
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/create-i18n.js
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
|
2020-01-22 17:06:21 -05:00
|
|
|
/**
|
2020-06-26 09:33:47 -04:00
|
|
|
* @typedef {Record<string,any>} LocaleData
|
2020-01-22 17:06:21 -05:00
|
|
|
*/
|
|
|
|
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
/**
|
|
|
|
* Default locale data to use for Tannin domain when not otherwise provided.
|
|
|
|
* Assumes an English plural forms expression.
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @type {LocaleData}
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const DEFAULT_LOCALE_DATA = {
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
'': {
|
2020-06-26 09:33:47 -04:00
|
|
|
/** @param {number} n */
|
2021-05-19 11:09:27 -04:00
|
|
|
plural_forms(n) {
|
2019-09-19 11:19:18 -04:00
|
|
|
return n === 1 ? 0 : 1;
|
|
|
|
}
|
2021-05-19 11:09:27 -04:00
|
|
|
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
}
|
|
|
|
};
|
2021-04-15 11:19:43 -04:00
|
|
|
/*
|
|
|
|
* Regular expression that matches i18n hooks like `i18n.gettext`, `i18n.ngettext`,
|
|
|
|
* `i18n.gettext_domain` or `i18n.ngettext_with_context` or `i18n.has_translation`.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const I18N_HOOK_REGEXP = /^i18n\.(n?gettext|has_translation)(_|$)/;
|
2021-04-15 11:19:43 -04:00
|
|
|
/**
|
|
|
|
* @typedef {(domain?: string) => LocaleData} GetLocaleData
|
|
|
|
*
|
|
|
|
* Returns locale data by domain in a
|
|
|
|
* Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*/
|
2021-01-27 21:04:13 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {(data?: LocaleData, domain?: string) => void} SetLocaleData
|
2021-04-15 11:19:43 -04:00
|
|
|
*
|
2021-01-27 21:04:13 -05:00
|
|
|
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
|
|
|
* Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*/
|
|
|
|
|
2021-05-07 07:48:27 -04:00
|
|
|
/**
|
|
|
|
* @typedef {(data?: LocaleData, domain?: string) => void} ResetLocaleData
|
|
|
|
*
|
|
|
|
* Resets all current Tannin instance locale data and sets the specified
|
|
|
|
* locale data for the domain. Accepts data in a Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*/
|
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
/** @typedef {() => void} SubscribeCallback */
|
|
|
|
|
|
|
|
/** @typedef {() => void} UnsubscribeCallback */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {(callback: SubscribeCallback) => UnsubscribeCallback} Subscribe
|
|
|
|
*
|
|
|
|
* Subscribes to changes of locale data
|
|
|
|
*/
|
|
|
|
|
2021-02-02 00:17:13 -05:00
|
|
|
/**
|
|
|
|
* @typedef {(domain?: string) => string} GetFilterDomain
|
|
|
|
* Retrieve the domain to use when calling domain-specific filters.
|
|
|
|
*/
|
|
|
|
|
2021-01-27 21:04:13 -05:00
|
|
|
/**
|
|
|
|
* @typedef {(text: string, domain?: string) => string} __
|
|
|
|
*
|
|
|
|
* Retrieve the translation of text.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/__/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {(text: string, context: string, domain?: string) => string} _x
|
|
|
|
*
|
|
|
|
* Retrieve translated string with gettext context.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_x/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {(single: string, plural: string, number: number, domain?: string) => string} _n
|
|
|
|
*
|
|
|
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
|
|
* number.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_n/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {(single: string, plural: string, number: number, context: string, domain?: string) => string} _nx
|
|
|
|
*
|
|
|
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
|
|
* number, with gettext context.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_nx/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {() => boolean} IsRtl
|
|
|
|
*
|
|
|
|
* Check if current locale is RTL.
|
|
|
|
*
|
|
|
|
* **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
|
|
|
|
* For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
|
|
|
|
* language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
|
|
|
|
* including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
|
|
|
|
*/
|
|
|
|
|
2021-02-02 00:17:13 -05:00
|
|
|
/**
|
2021-04-15 11:19:43 -04:00
|
|
|
* @typedef {(single: string, context?: string, domain?: string) => boolean} HasTranslation
|
|
|
|
*
|
|
|
|
* Check if there is a translation for a given string in singular form.
|
2021-02-02 00:17:13 -05:00
|
|
|
*/
|
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
/** @typedef {import('@wordpress/hooks').Hooks} Hooks */
|
2021-01-27 21:04:13 -05:00
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
2020-06-26 09:33:47 -04:00
|
|
|
* An i18n instance
|
|
|
|
*
|
2021-01-27 21:04:13 -05:00
|
|
|
* @typedef I18n
|
2021-11-08 09:29:21 -05:00
|
|
|
* @property {GetLocaleData} getLocaleData Returns locale data by domain in a Jed-formatted JSON object shape.
|
|
|
|
* @property {SetLocaleData} setLocaleData Merges locale data into the Tannin instance by domain. Accepts data in a
|
2021-05-07 07:48:27 -04:00
|
|
|
* Jed-formatted JSON object shape.
|
|
|
|
* @property {ResetLocaleData} resetLocaleData Resets all current Tannin instance locale data and sets the specified
|
|
|
|
* locale data for the domain. Accepts data in a Jed-formatted JSON object shape.
|
2021-11-08 09:29:21 -05:00
|
|
|
* @property {Subscribe} subscribe Subscribes to changes of Tannin locale data.
|
|
|
|
* @property {__} __ Retrieve the translation of text.
|
|
|
|
* @property {_x} _x Retrieve translated string with gettext context.
|
|
|
|
* @property {_n} _n Translates and retrieves the singular or plural form based on the supplied
|
2021-05-07 07:48:27 -04:00
|
|
|
* number.
|
2021-11-08 09:29:21 -05:00
|
|
|
* @property {_nx} _nx Translates and retrieves the singular or plural form based on the supplied
|
2021-05-07 07:48:27 -04:00
|
|
|
* number, with gettext context.
|
2021-11-08 09:29:21 -05:00
|
|
|
* @property {IsRtl} isRTL Check if current locale is RTL.
|
|
|
|
* @property {HasTranslation} hasTranslation Check if there is a translation for a given string.
|
2020-06-26 09:33:47 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create an i18n instance
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {LocaleData} [initialData] Locale data configuration.
|
|
|
|
* @param {string} [initialDomain] Domain for which configuration applies.
|
|
|
|
* @param {Hooks} [hooks] Hooks implementation.
|
|
|
|
*
|
|
|
|
* @return {I18n} I18n instance.
|
2018-12-13 23:41:57 -05:00
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const createI18n = (initialData, initialDomain, hooks) => {
|
2020-06-26 09:33:47 -04:00
|
|
|
/**
|
|
|
|
* The underlying instance of Tannin to which exported functions interface.
|
|
|
|
*
|
|
|
|
* @type {Tannin}
|
|
|
|
*/
|
2021-05-19 11:09:27 -04:00
|
|
|
const tannin = new Tannin({});
|
|
|
|
const listeners = new Set();
|
2021-04-15 11:19:43 -04:00
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const notifyListeners = () => {
|
|
|
|
listeners.forEach(listener => listener());
|
2021-04-15 11:19:43 -04:00
|
|
|
};
|
|
|
|
/**
|
|
|
|
* Subscribe to changes of locale data.
|
|
|
|
*
|
|
|
|
* @param {SubscribeCallback} callback Subscription callback.
|
|
|
|
* @return {UnsubscribeCallback} Unsubscribe callback.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const subscribe = callback => {
|
2021-04-15 11:19:43 -04:00
|
|
|
listeners.add(callback);
|
2021-05-19 11:09:27 -04:00
|
|
|
return () => listeners.delete(callback);
|
2021-04-15 11:19:43 -04:00
|
|
|
};
|
|
|
|
/** @type {GetLocaleData} */
|
|
|
|
|
|
|
|
|
2021-11-15 07:50:17 -05:00
|
|
|
const getLocaleData = function () {
|
|
|
|
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
|
|
return tannin.data[domain];
|
|
|
|
};
|
2021-04-15 11:19:43 -04:00
|
|
|
/**
|
|
|
|
* @param {LocaleData} [data]
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {string} [domain]
|
2021-04-15 11:19:43 -04:00
|
|
|
*/
|
2020-06-26 09:33:47 -04:00
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
|
2021-11-15 07:50:17 -05:00
|
|
|
const doSetLocaleData = function (data) {
|
|
|
|
let domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
2021-05-19 11:09:27 -04:00
|
|
|
tannin.data[domain] = { ...DEFAULT_LOCALE_DATA,
|
|
|
|
...tannin.data[domain],
|
|
|
|
...data
|
|
|
|
}; // Populate default domain configuration (supported locale date which omits
|
2020-06-26 09:33:47 -04:00
|
|
|
// a plural forms expression).
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
tannin.data[domain][''] = { ...DEFAULT_LOCALE_DATA[''],
|
|
|
|
...tannin.data[domain]['']
|
|
|
|
};
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
2021-04-15 11:19:43 -04:00
|
|
|
/** @type {SetLocaleData} */
|
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const setLocaleData = (data, domain) => {
|
2021-04-15 11:19:43 -04:00
|
|
|
doSetLocaleData(data, domain);
|
|
|
|
notifyListeners();
|
|
|
|
};
|
2021-05-07 07:48:27 -04:00
|
|
|
/** @type {ResetLocaleData} */
|
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const resetLocaleData = (data, domain) => {
|
2021-05-07 07:48:27 -04:00
|
|
|
// Reset all current Tannin locale data.
|
|
|
|
tannin.data = {}; // Reset cached plural forms functions cache.
|
|
|
|
|
|
|
|
tannin.pluralForms = {};
|
|
|
|
setLocaleData(data, domain);
|
|
|
|
};
|
2020-06-26 09:33:47 -04:00
|
|
|
/**
|
|
|
|
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
|
|
|
|
* otherwise previously assigned.
|
|
|
|
*
|
|
|
|
* @param {string|undefined} domain Domain to retrieve the translated text.
|
|
|
|
* @param {string|undefined} context Context information for the translators.
|
|
|
|
* @param {string} single Text to translate if non-plural. Used as
|
|
|
|
* fallback return value on a caught error.
|
|
|
|
* @param {string} [plural] The text to be used if the number is
|
|
|
|
* plural.
|
|
|
|
* @param {number} [number] The number to compare against to use
|
|
|
|
* either the singular or plural form.
|
|
|
|
*
|
|
|
|
* @return {string} The translated string.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2021-11-15 07:50:17 -05:00
|
|
|
const dcnpgettext = function () {
|
|
|
|
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
|
|
let context = arguments.length > 1 ? arguments[1] : undefined;
|
|
|
|
let single = arguments.length > 2 ? arguments[2] : undefined;
|
|
|
|
let plural = arguments.length > 3 ? arguments[3] : undefined;
|
|
|
|
let number = arguments.length > 4 ? arguments[4] : undefined;
|
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
if (!tannin.data[domain]) {
|
2021-04-15 11:19:43 -04:00
|
|
|
// use `doSetLocaleData` to set silently, without notifying listeners
|
|
|
|
doSetLocaleData(undefined, domain);
|
2020-06-26 09:33:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return tannin.dcnpgettext(domain, context, single, plural, number);
|
|
|
|
};
|
2021-02-02 00:17:13 -05:00
|
|
|
/** @type {GetFilterDomain} */
|
|
|
|
|
|
|
|
|
2021-11-15 07:50:17 -05:00
|
|
|
const getFilterDomain = function () {
|
|
|
|
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
|
|
return domain;
|
|
|
|
};
|
2021-01-27 21:04:13 -05:00
|
|
|
/** @type {__} */
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const __ = (text, domain) => {
|
|
|
|
let translation = dcnpgettext(domain, undefined, text);
|
2021-04-15 11:19:43 -04:00
|
|
|
|
|
|
|
if (!hooks) {
|
|
|
|
return translation;
|
|
|
|
}
|
2021-02-02 00:17:13 -05:00
|
|
|
/**
|
|
|
|
* Filters text with its translation.
|
|
|
|
*
|
|
|
|
* @param {string} translation Translated text.
|
|
|
|
* @param {string} text Text to translate.
|
|
|
|
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
translation =
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.gettext', translation, text, domain);
|
|
|
|
return (
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.gettext_' + getFilterDomain(domain), translation, text, domain)
|
|
|
|
);
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
2021-01-27 21:04:13 -05:00
|
|
|
/** @type {_x} */
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const _x = (text, context, domain) => {
|
|
|
|
let translation = dcnpgettext(domain, context, text);
|
2021-04-15 11:19:43 -04:00
|
|
|
|
|
|
|
if (!hooks) {
|
|
|
|
return translation;
|
|
|
|
}
|
2021-02-02 00:17:13 -05:00
|
|
|
/**
|
|
|
|
* Filters text with its translation based on context information.
|
|
|
|
*
|
|
|
|
* @param {string} translation Translated text.
|
|
|
|
* @param {string} text Text to translate.
|
|
|
|
* @param {string} context Context information for the translators.
|
|
|
|
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
translation =
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.gettext_with_context', translation, text, context, domain);
|
|
|
|
return (
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.gettext_with_context_' + getFilterDomain(domain), translation, text, context, domain)
|
|
|
|
);
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
2021-01-27 21:04:13 -05:00
|
|
|
/** @type {_n} */
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const _n = (single, plural, number, domain) => {
|
|
|
|
let translation = dcnpgettext(domain, undefined, single, plural, number);
|
2021-02-02 00:17:13 -05:00
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
if (!hooks) {
|
2021-02-02 00:17:13 -05:00
|
|
|
return translation;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Filters the singular or plural form of a string.
|
|
|
|
*
|
|
|
|
* @param {string} translation Translated text.
|
|
|
|
* @param {string} single The text to be used if the number is singular.
|
|
|
|
* @param {string} plural The text to be used if the number is plural.
|
|
|
|
* @param {string} number The number to compare against to use either the singular or plural form.
|
|
|
|
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
translation =
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.ngettext', translation, single, plural, number, domain);
|
|
|
|
return (
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.ngettext_' + getFilterDomain(domain), translation, single, plural, number, domain)
|
|
|
|
);
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
2021-01-27 21:04:13 -05:00
|
|
|
/** @type {_nx} */
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const _nx = (single, plural, number, context, domain) => {
|
|
|
|
let translation = dcnpgettext(domain, context, single, plural, number);
|
2021-02-02 00:17:13 -05:00
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
if (!hooks) {
|
2021-02-02 00:17:13 -05:00
|
|
|
return translation;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Filters the singular or plural form of a string with gettext context.
|
|
|
|
*
|
|
|
|
* @param {string} translation Translated text.
|
|
|
|
* @param {string} single The text to be used if the number is singular.
|
|
|
|
* @param {string} plural The text to be used if the number is plural.
|
|
|
|
* @param {string} number The number to compare against to use either the singular or plural form.
|
|
|
|
* @param {string} context Context information for the translators.
|
|
|
|
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
translation =
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.ngettext_with_context', translation, single, plural, number, context, domain);
|
|
|
|
return (
|
|
|
|
/** @type {string} */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.ngettext_with_context_' + getFilterDomain(domain), translation, single, plural, number, context, domain)
|
|
|
|
);
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
2021-01-27 21:04:13 -05:00
|
|
|
/** @type {IsRtl} */
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const isRTL = () => {
|
2020-06-26 09:33:47 -04:00
|
|
|
return 'rtl' === _x('ltr', 'text direction');
|
|
|
|
};
|
2021-04-15 11:19:43 -04:00
|
|
|
/** @type {HasTranslation} */
|
|
|
|
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const hasTranslation = (single, context, domain) => {
|
2021-04-15 11:19:43 -04:00
|
|
|
var _tannin$data, _tannin$data2;
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const key = context ? context + '\u0004' + single : single;
|
|
|
|
let result = !!((_tannin$data = tannin.data) !== null && _tannin$data !== void 0 && (_tannin$data2 = _tannin$data[domain !== null && domain !== void 0 ? domain : 'default']) !== null && _tannin$data2 !== void 0 && _tannin$data2[key]);
|
2021-04-15 11:19:43 -04:00
|
|
|
|
|
|
|
if (hooks) {
|
|
|
|
/**
|
|
|
|
* Filters the presence of a translation in the locale data.
|
|
|
|
*
|
|
|
|
* @param {boolean} hasTranslation Whether the translation is present or not..
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {string} single The singular form of the translated text (used as key in locale data)
|
|
|
|
* @param {string} context Context information for the translators.
|
|
|
|
* @param {string} domain Text domain. Unique identifier for retrieving translated strings.
|
2021-04-15 11:19:43 -04:00
|
|
|
*/
|
|
|
|
result =
|
|
|
|
/** @type { boolean } */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.has_translation', result, single, context, domain);
|
|
|
|
result =
|
|
|
|
/** @type { boolean } */
|
|
|
|
|
|
|
|
/** @type {*} */
|
|
|
|
hooks.applyFilters('i18n.has_translation_' + getFilterDomain(domain), result, single, context, domain);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
};
|
2020-06-26 09:33:47 -04:00
|
|
|
|
|
|
|
if (initialData) {
|
|
|
|
setLocaleData(initialData, initialDomain);
|
|
|
|
}
|
|
|
|
|
2021-04-15 11:19:43 -04:00
|
|
|
if (hooks) {
|
|
|
|
/**
|
|
|
|
* @param {string} hookName
|
|
|
|
*/
|
2021-05-19 11:09:27 -04:00
|
|
|
const onHookAddedOrRemoved = hookName => {
|
2021-04-15 11:19:43 -04:00
|
|
|
if (I18N_HOOK_REGEXP.test(hookName)) {
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
hooks.addAction('hookAdded', 'core/i18n', onHookAddedOrRemoved);
|
|
|
|
hooks.addAction('hookRemoved', 'core/i18n', onHookAddedOrRemoved);
|
|
|
|
}
|
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
return {
|
2021-05-19 11:09:27 -04:00
|
|
|
getLocaleData,
|
|
|
|
setLocaleData,
|
|
|
|
resetLocaleData,
|
|
|
|
subscribe,
|
|
|
|
__,
|
|
|
|
_x,
|
|
|
|
_n,
|
|
|
|
_nx,
|
|
|
|
isRTL,
|
|
|
|
hasTranslation
|
2020-06-26 09:33:47 -04:00
|
|
|
};
|
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2021-02-02 00:17:13 -05:00
|
|
|
// EXTERNAL MODULE: external ["wp","hooks"]
|
2021-05-20 08:20:04 -04:00
|
|
|
var external_wp_hooks_ = __webpack_require__("g56x");
|
2021-02-02 00:17:13 -05:00
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/default-i18n.js
|
2021-02-02 00:17:13 -05:00
|
|
|
/**
|
2021-04-15 11:19:43 -04:00
|
|
|
* Internal dependencies
|
2021-02-02 00:17:13 -05:00
|
|
|
*/
|
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
2021-04-15 11:19:43 -04:00
|
|
|
* WordPress dependencies
|
2020-06-26 09:33:47 -04:00
|
|
|
*/
|
|
|
|
|
2021-02-02 00:17:13 -05:00
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const i18n = createI18n(undefined, undefined, external_wp_hooks_["defaultHooks"]);
|
2021-04-15 11:19:43 -04:00
|
|
|
/**
|
|
|
|
* Default, singleton instance of `I18n`.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* harmony default export */ var default_i18n = (i18n);
|
2020-06-26 09:33:47 -04:00
|
|
|
/*
|
|
|
|
* Comments in this file are duplicated from ./i18n due to
|
|
|
|
* https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {import('./create-i18n').LocaleData} LocaleData
|
2021-04-15 11:19:43 -04:00
|
|
|
* @typedef {import('./create-i18n').SubscribeCallback} SubscribeCallback
|
|
|
|
* @typedef {import('./create-i18n').UnsubscribeCallback} UnsubscribeCallback
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns locale data by domain in a Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*
|
|
|
|
* @param {string} [domain] Domain for which to get the data.
|
|
|
|
* @return {LocaleData} Locale data.
|
2018-12-13 23:41:57 -05:00
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_getLocaleData = i18n.getLocaleData.bind(i18n);
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
* Merges locale data into the Tannin instance by domain. Accepts data in a
|
|
|
|
* Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {LocaleData} [data] Locale data configuration.
|
|
|
|
* @param {string} [domain] Domain for which configuration applies.
|
2018-12-13 23:41:57 -05:00
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_setLocaleData = i18n.setLocaleData.bind(i18n);
|
2021-05-07 07:48:27 -04:00
|
|
|
/**
|
|
|
|
* Resets all current Tannin instance locale data and sets the specified
|
|
|
|
* locale data for the domain. Accepts data in a Jed-formatted JSON object shape.
|
|
|
|
*
|
|
|
|
* @see http://messageformat.github.io/Jed/
|
|
|
|
*
|
|
|
|
* @param {LocaleData} [data] Locale data configuration.
|
|
|
|
* @param {string} [domain] Domain for which configuration applies.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_resetLocaleData = i18n.resetLocaleData.bind(i18n);
|
2021-04-15 11:19:43 -04:00
|
|
|
/**
|
|
|
|
* Subscribes to changes of locale data
|
|
|
|
*
|
|
|
|
* @param {SubscribeCallback} callback Subscription callback
|
|
|
|
* @return {UnsubscribeCallback} Unsubscribe callback
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_subscribe = i18n.subscribe.bind(i18n);
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
|
|
|
* Retrieve the translation of text.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/__/
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {string} text Text to translate.
|
|
|
|
* @param {string} [domain] Domain to retrieve the translated text.
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
|
|
|
* @return {string} Translated text.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_ = i18n.__.bind(i18n);
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
|
|
|
* Retrieve translated string with gettext context.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_x/
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {string} text Text to translate.
|
|
|
|
* @param {string} context Context information for the translators.
|
|
|
|
* @param {string} [domain] Domain to retrieve the translated text.
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
|
|
|
* @return {string} Translated context string without pipe.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_x = i18n._x.bind(i18n);
|
2018-12-13 23:41:57 -05:00
|
|
|
/**
|
|
|
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
|
|
* number.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_n/
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {string} single The text to be used if the number is singular.
|
|
|
|
* @param {string} plural The text to be used if the number is plural.
|
|
|
|
* @param {number} number The number to compare against to use either the
|
|
|
|
* singular or plural form.
|
|
|
|
* @param {string} [domain] Domain to retrieve the translated text.
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
|
|
|
* @return {string} The translated singular or plural form.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_n = i18n._n.bind(i18n);
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
|
|
|
* Translates and retrieves the singular or plural form based on the supplied
|
|
|
|
* number, with gettext context.
|
|
|
|
*
|
|
|
|
* @see https://developer.wordpress.org/reference/functions/_nx/
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {string} single The text to be used if the number is singular.
|
|
|
|
* @param {string} plural The text to be used if the number is plural.
|
|
|
|
* @param {number} number The number to compare against to use either the
|
2018-12-17 22:14:52 -05:00
|
|
|
* singular or plural form.
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {string} context Context information for the translators.
|
|
|
|
* @param {string} [domain] Domain to retrieve the translated text.
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
|
|
|
* @return {string} The translated singular or plural form.
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_nx = i18n._nx.bind(i18n);
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
2020-06-26 09:33:47 -04:00
|
|
|
* Check if current locale is RTL.
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
2020-06-26 09:33:47 -04:00
|
|
|
* **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
|
|
|
|
* For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
|
|
|
|
* language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
|
|
|
|
* including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
2020-06-26 09:33:47 -04:00
|
|
|
* @return {boolean} Whether locale is RTL.
|
2018-12-17 22:14:52 -05:00
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_isRTL = i18n.isRTL.bind(i18n);
|
2021-04-15 11:19:43 -04:00
|
|
|
/**
|
|
|
|
* Check if there is a translation for a given string (in singular form).
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {string} single Singular form of the string to look up.
|
2021-04-15 11:19:43 -04:00
|
|
|
* @param {string} [context] Context information for the translators.
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {string} [domain] Domain to retrieve the translated text.
|
2021-04-15 11:19:43 -04:00
|
|
|
* @return {boolean} Whether the translation exists or not.
|
|
|
|
*/
|
|
|
|
|
2021-05-19 11:09:27 -04:00
|
|
|
const default_i18n_hasTranslation = i18n.hasTranslation.bind(i18n);
|
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 10:37:00 -05:00
|
|
|
|
2020-06-26 09:33:47 -04:00
|
|
|
// CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "g56x":
|
|
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
(function() { module.exports = window["wp"]["hooks"]; }());
|
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
/***/ })
|
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/******/ });
|