wp/wp-includes/js/dist/style-engine.js
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    38 __webpack_require__.r(__webpack_exports__);
    38 __webpack_require__.r(__webpack_exports__);
    39 
    39 
    40 // EXPORTS
    40 // EXPORTS
    41 __webpack_require__.d(__webpack_exports__, {
    41 __webpack_require__.d(__webpack_exports__, {
    42   compileCSS: () => (/* binding */ compileCSS),
    42   compileCSS: () => (/* binding */ compileCSS),
    43   getCSSRules: () => (/* binding */ getCSSRules)
    43   getCSSRules: () => (/* binding */ getCSSRules),
       
    44   getCSSValueFromRawStyle: () => (/* reexport */ getCSSValueFromRawStyle)
    44 });
    45 });
    45 
    46 
    46 ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs
    47 ;// ./node_modules/tslib/tslib.es6.mjs
    47 /******************************************************************************
    48 /******************************************************************************
    48 Copyright (c) Microsoft Corporation.
    49 Copyright (c) Microsoft Corporation.
    49 
    50 
    50 Permission to use, copy, modify, and/or distribute this software for any
    51 Permission to use, copy, modify, and/or distribute this software for any
    51 purpose with or without fee is hereby granted.
    52 purpose with or without fee is hereby granted.
    56 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    57 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    57 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    58 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    58 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    59 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    59 PERFORMANCE OF THIS SOFTWARE.
    60 PERFORMANCE OF THIS SOFTWARE.
    60 ***************************************************************************** */
    61 ***************************************************************************** */
    61 /* global Reflect, Promise, SuppressedError, Symbol */
    62 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
    62 
    63 
    63 var extendStatics = function(d, b) {
    64 var extendStatics = function(d, b) {
    64   extendStatics = Object.setPrototypeOf ||
    65   extendStatics = Object.setPrototypeOf ||
    65       ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
    66       ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
    66       function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    67       function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
   167       step((generator = generator.apply(thisArg, _arguments || [])).next());
   168       step((generator = generator.apply(thisArg, _arguments || [])).next());
   168   });
   169   });
   169 }
   170 }
   170 
   171 
   171 function __generator(thisArg, body) {
   172 function __generator(thisArg, body) {
   172   var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
   173   var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
   173   return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
   174   return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
   174   function verb(n) { return function (v) { return step([n, v]); }; }
   175   function verb(n) { return function (v) { return step([n, v]); }; }
   175   function step(op) {
   176   function step(op) {
   176       if (f) throw new TypeError("Generator is already executing.");
   177       if (f) throw new TypeError("Generator is already executing.");
   177       while (g && (g = 0, op[0] && (_ = 0)), _) try {
   178       while (g && (g = 0, op[0] && (_ = 0)), _) try {
   178           if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
   179           if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
   272 }
   273 }
   273 
   274 
   274 function __asyncGenerator(thisArg, _arguments, generator) {
   275 function __asyncGenerator(thisArg, _arguments, generator) {
   275   if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
   276   if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
   276   var g = generator.apply(thisArg, _arguments || []), i, q = [];
   277   var g = generator.apply(thisArg, _arguments || []), i, q = [];
   277   return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
   278   return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
   278   function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
   279   function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
       
   280   function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
   279   function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
   281   function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
   280   function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
   282   function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
   281   function fulfill(value) { resume("next", value); }
   283   function fulfill(value) { resume("next", value); }
   282   function reject(value) { resume("throw", value); }
   284   function reject(value) { resume("throw", value); }
   283   function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
   285   function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
   306   Object.defineProperty(o, "default", { enumerable: true, value: v });
   308   Object.defineProperty(o, "default", { enumerable: true, value: v });
   307 }) : function(o, v) {
   309 }) : function(o, v) {
   308   o["default"] = v;
   310   o["default"] = v;
   309 };
   311 };
   310 
   312 
       
   313 var ownKeys = function(o) {
       
   314   ownKeys = Object.getOwnPropertyNames || function (o) {
       
   315     var ar = [];
       
   316     for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
       
   317     return ar;
       
   318   };
       
   319   return ownKeys(o);
       
   320 };
       
   321 
   311 function __importStar(mod) {
   322 function __importStar(mod) {
   312   if (mod && mod.__esModule) return mod;
   323   if (mod && mod.__esModule) return mod;
   313   var result = {};
   324   var result = {};
   314   if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
   325   if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
   315   __setModuleDefault(result, mod);
   326   __setModuleDefault(result, mod);
   316   return result;
   327   return result;
   317 }
   328 }
   318 
   329 
   319 function __importDefault(mod) {
   330 function __importDefault(mod) {
   339 }
   350 }
   340 
   351 
   341 function __addDisposableResource(env, value, async) {
   352 function __addDisposableResource(env, value, async) {
   342   if (value !== null && value !== void 0) {
   353   if (value !== null && value !== void 0) {
   343     if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
   354     if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
   344     var dispose;
   355     var dispose, inner;
   345     if (async) {
   356     if (async) {
   346         if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
   357       if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
   347         dispose = value[Symbol.asyncDispose];
   358       dispose = value[Symbol.asyncDispose];
   348     }
   359     }
   349     if (dispose === void 0) {
   360     if (dispose === void 0) {
   350         if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
   361       if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
   351         dispose = value[Symbol.dispose];
   362       dispose = value[Symbol.dispose];
       
   363       if (async) inner = dispose;
   352     }
   364     }
   353     if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
   365     if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
       
   366     if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
   354     env.stack.push({ value: value, dispose: dispose, async: async });
   367     env.stack.push({ value: value, dispose: dispose, async: async });
   355   }
   368   }
   356   else if (async) {
   369   else if (async) {
   357     env.stack.push({ async: true });
   370     env.stack.push({ async: true });
   358   }
   371   }
   367 function __disposeResources(env) {
   380 function __disposeResources(env) {
   368   function fail(e) {
   381   function fail(e) {
   369     env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
   382     env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
   370     env.hasError = true;
   383     env.hasError = true;
   371   }
   384   }
       
   385   var r, s = 0;
   372   function next() {
   386   function next() {
   373     while (env.stack.length) {
   387     while (r = env.stack.pop()) {
   374       var rec = env.stack.pop();
       
   375       try {
   388       try {
   376         var result = rec.dispose && rec.dispose.call(rec.value);
   389         if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
   377         if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
   390         if (r.dispose) {
       
   391           var result = r.dispose.call(r.value);
       
   392           if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
       
   393         }
       
   394         else s |= 1;
   378       }
   395       }
   379       catch (e) {
   396       catch (e) {
   380           fail(e);
   397         fail(e);
   381       }
   398       }
   382     }
   399     }
       
   400     if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
   383     if (env.hasError) throw env.error;
   401     if (env.hasError) throw env.error;
   384   }
   402   }
   385   return next();
   403   return next();
       
   404 }
       
   405 
       
   406 function __rewriteRelativeImportExtension(path, preserveJsx) {
       
   407   if (typeof path === "string" && /^\.\.?\//.test(path)) {
       
   408       return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
       
   409           return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
       
   410       });
       
   411   }
       
   412   return path;
   386 }
   413 }
   387 
   414 
   388 /* harmony default export */ const tslib_es6 = ({
   415 /* harmony default export */ const tslib_es6 = ({
   389   __extends,
   416   __extends,
   390   __assign,
   417   __assign,
   391   __rest,
   418   __rest,
   392   __decorate,
   419   __decorate,
   393   __param,
   420   __param,
       
   421   __esDecorate,
       
   422   __runInitializers,
       
   423   __propKey,
       
   424   __setFunctionName,
   394   __metadata,
   425   __metadata,
   395   __awaiter,
   426   __awaiter,
   396   __generator,
   427   __generator,
   397   __createBinding,
   428   __createBinding,
   398   __exportStar,
   429   __exportStar,
   411   __classPrivateFieldGet,
   442   __classPrivateFieldGet,
   412   __classPrivateFieldSet,
   443   __classPrivateFieldSet,
   413   __classPrivateFieldIn,
   444   __classPrivateFieldIn,
   414   __addDisposableResource,
   445   __addDisposableResource,
   415   __disposeResources,
   446   __disposeResources,
       
   447   __rewriteRelativeImportExtension,
   416 });
   448 });
   417 
   449 
   418 ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
   450 ;// ./node_modules/lower-case/dist.es2015/index.js
   419 /**
   451 /**
   420  * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
   452  * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
   421  */
   453  */
   422 var SUPPORTED_LOCALE = {
   454 var SUPPORTED_LOCALE = {
   423     tr: {
   455     tr: {
   462  */
   494  */
   463 function lowerCase(str) {
   495 function lowerCase(str) {
   464     return str.toLowerCase();
   496     return str.toLowerCase();
   465 }
   497 }
   466 
   498 
   467 ;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
   499 ;// ./node_modules/no-case/dist.es2015/index.js
   468 
   500 
   469 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
   501 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
   470 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
   502 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
   471 // Remove all non-word characters.
   503 // Remove all non-word characters.
   472 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
   504 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
   494     if (re instanceof RegExp)
   526     if (re instanceof RegExp)
   495         return input.replace(re, value);
   527         return input.replace(re, value);
   496     return re.reduce(function (input, re) { return input.replace(re, value); }, input);
   528     return re.reduce(function (input, re) { return input.replace(re, value); }, input);
   497 }
   529 }
   498 
   530 
   499 ;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js
   531 ;// ./node_modules/dot-case/dist.es2015/index.js
   500 
   532 
   501 
   533 
   502 function dotCase(input, options) {
   534 function dotCase(input, options) {
   503     if (options === void 0) { options = {}; }
   535     if (options === void 0) { options = {}; }
   504     return noCase(input, __assign({ delimiter: "." }, options));
   536     return noCase(input, __assign({ delimiter: "." }, options));
   505 }
   537 }
   506 
   538 
   507 ;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js
   539 ;// ./node_modules/param-case/dist.es2015/index.js
   508 
   540 
   509 
   541 
   510 function paramCase(input, options) {
   542 function paramCase(input, options) {
   511     if (options === void 0) { options = {}; }
   543     if (options === void 0) { options = {}; }
   512     return dotCase(input, __assign({ delimiter: "-" }, options));
   544     return dotCase(input, __assign({ delimiter: "-" }, options));
   513 }
   545 }
   514 
   546 
   515 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/constants.js
   547 ;// ./node_modules/@wordpress/style-engine/build-module/styles/constants.js
   516 const VARIABLE_REFERENCE_PREFIX = 'var:';
   548 const VARIABLE_REFERENCE_PREFIX = 'var:';
   517 const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
   549 const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
   518 const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
   550 const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
   519 
   551 
   520 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/utils.js
   552 ;// ./node_modules/@wordpress/style-engine/build-module/styles/utils.js
   521 /**
   553 /**
   522  * External dependencies
   554  * External dependencies
   523  */
   555  */
   524 
   556 
   525 
   557 
   558 function generateRule(style, options, path, ruleKey) {
   590 function generateRule(style, options, path, ruleKey) {
   559   const styleValue = getStyleValueByPath(style, path);
   591   const styleValue = getStyleValueByPath(style, path);
   560   return styleValue ? [{
   592   return styleValue ? [{
   561     selector: options?.selector,
   593     selector: options?.selector,
   562     key: ruleKey,
   594     key: ruleKey,
   563     value: getCSSVarFromStyleValue(styleValue)
   595     value: getCSSValueFromRawStyle(styleValue)
   564   }] : [];
   596   }] : [];
   565 }
   597 }
   566 
   598 
   567 /**
   599 /**
   568  * Returns a JSON representation of the generated CSS rules taking into account box model properties, top, right, bottom, left.
   600  * Returns a JSON representation of the generated CSS rules taking into account box model properties, top, right, bottom, left.
   587       key: ruleKeys.default,
   619       key: ruleKeys.default,
   588       value: boxStyle
   620       value: boxStyle
   589     });
   621     });
   590   } else {
   622   } else {
   591     const sideRules = individualProperties.reduce((acc, side) => {
   623     const sideRules = individualProperties.reduce((acc, side) => {
   592       const value = getCSSVarFromStyleValue(getStyleValueByPath(boxStyle, [side]));
   624       const value = getCSSValueFromRawStyle(getStyleValueByPath(boxStyle, [side]));
   593       if (value) {
   625       if (value) {
   594         acc.push({
   626         acc.push({
   595           selector: options?.selector,
   627           selector: options?.selector,
   596           key: ruleKeys?.individual.replace('%s', upperFirst(side)),
   628           key: ruleKeys?.individual.replace('%s', upperFirst(side)),
   597           value
   629           value
   603   }
   635   }
   604   return rules;
   636   return rules;
   605 }
   637 }
   606 
   638 
   607 /**
   639 /**
   608  * Returns a CSS var value from incoming style value following the pattern `var:description|context|slug`.
   640  * Returns a WordPress CSS custom var value from incoming style preset value,
   609  *
   641  * if one is detected.
   610  * @param styleValue A raw style value.
   642  *
   611  *
   643  * The preset value is a string and follows the pattern `var:description|context|slug`.
   612  * @return string A CSS var value.
   644  *
   613  */
   645  * Example:
   614 function getCSSVarFromStyleValue(styleValue) {
   646  *
       
   647  * `getCSSValueFromRawStyle( 'var:preset|color|heavenlyBlue' )` // returns 'var(--wp--preset--color--heavenly-blue)'
       
   648  *
       
   649  * @param styleValue A string representing a raw CSS value. Non-strings won't be processed.
       
   650  *
       
   651  * @return A CSS custom var value if the incoming style value is a preset value.
       
   652  */
       
   653 
       
   654 function getCSSValueFromRawStyle(styleValue) {
   615   if (typeof styleValue === 'string' && styleValue.startsWith(VARIABLE_REFERENCE_PREFIX)) {
   655   if (typeof styleValue === 'string' && styleValue.startsWith(VARIABLE_REFERENCE_PREFIX)) {
   616     const variable = styleValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).map(presetVariable => paramCase(presetVariable, {
   656     const variable = styleValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).map(presetVariable => paramCase(presetVariable, {
   617       splitRegexp: [/([a-z0-9])([A-Z])/g,
   657       splitRegexp: [/([a-z0-9])([A-Z])/g,
   618       // fooBar => foo-bar, 3Bar => 3-bar
   658       // fooBar => foo-bar, 3Bar => 3-bar
   619       /([0-9])([a-z])/g,
   659       /([0-9])([a-z])/g,
   671   } catch (uriError) {
   711   } catch (uriError) {
   672     return uri;
   712     return uri;
   673   }
   713   }
   674 }
   714 }
   675 
   715 
   676 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/border/index.js
   716 ;// ./node_modules/@wordpress/style-engine/build-module/styles/border/index.js
   677 /**
   717 /**
   678  * Internal dependencies
   718  * Internal dependencies
   679  */
   719  */
   680 
   720 
   681 
   721 
   743   name: 'borderLeft',
   783   name: 'borderLeft',
   744   generate: createBorderEdgeGenerateFunction('left')
   784   generate: createBorderEdgeGenerateFunction('left')
   745 };
   785 };
   746 /* harmony default export */ const border = ([color, borderStyle, width, radius, borderTop, borderRight, borderBottom, borderLeft]);
   786 /* harmony default export */ const border = ([color, borderStyle, width, radius, borderTop, borderRight, borderBottom, borderLeft]);
   747 
   787 
   748 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/color/background.js
   788 ;// ./node_modules/@wordpress/style-engine/build-module/styles/color/background.js
   749 /**
   789 /**
   750  * Internal dependencies
   790  * Internal dependencies
   751  */
   791  */
   752 
   792 
   753 
   793 
   757     return generateRule(style, options, ['color', 'background'], 'backgroundColor');
   797     return generateRule(style, options, ['color', 'background'], 'backgroundColor');
   758   }
   798   }
   759 };
   799 };
   760 /* harmony default export */ const color_background = (background);
   800 /* harmony default export */ const color_background = (background);
   761 
   801 
   762 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/color/gradient.js
   802 ;// ./node_modules/@wordpress/style-engine/build-module/styles/color/gradient.js
   763 /**
   803 /**
   764  * Internal dependencies
   804  * Internal dependencies
   765  */
   805  */
   766 
   806 
   767 
   807 
   771     return generateRule(style, options, ['color', 'gradient'], 'background');
   811     return generateRule(style, options, ['color', 'gradient'], 'background');
   772   }
   812   }
   773 };
   813 };
   774 /* harmony default export */ const color_gradient = (gradient);
   814 /* harmony default export */ const color_gradient = (gradient);
   775 
   815 
   776 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/color/text.js
   816 ;// ./node_modules/@wordpress/style-engine/build-module/styles/color/text.js
   777 /**
   817 /**
   778  * Internal dependencies
   818  * Internal dependencies
   779  */
   819  */
   780 
   820 
   781 
   821 
   785     return generateRule(style, options, ['color', 'text'], 'color');
   825     return generateRule(style, options, ['color', 'text'], 'color');
   786   }
   826   }
   787 };
   827 };
   788 /* harmony default export */ const color_text = (text_text);
   828 /* harmony default export */ const color_text = (text_text);
   789 
   829 
   790 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/color/index.js
   830 ;// ./node_modules/@wordpress/style-engine/build-module/styles/color/index.js
   791 /**
   831 /**
   792  * Internal dependencies
   832  * Internal dependencies
   793  */
   833  */
   794 
   834 
   795 
   835 
   796 
   836 
   797 /* harmony default export */ const styles_color = ([color_text, color_gradient, color_background]);
   837 /* harmony default export */ const styles_color = ([color_text, color_gradient, color_background]);
   798 
   838 
   799 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/dimensions/index.js
   839 ;// ./node_modules/@wordpress/style-engine/build-module/styles/dimensions/index.js
   800 /**
   840 /**
   801  * Internal dependencies
   841  * Internal dependencies
   802  */
   842  */
   803 
   843 
   804 
   844 
   814     return generateRule(style, options, ['dimensions', 'aspectRatio'], 'aspectRatio');
   854     return generateRule(style, options, ['dimensions', 'aspectRatio'], 'aspectRatio');
   815   }
   855   }
   816 };
   856 };
   817 /* harmony default export */ const dimensions = ([minHeight, aspectRatio]);
   857 /* harmony default export */ const dimensions = ([minHeight, aspectRatio]);
   818 
   858 
   819 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/background/index.js
   859 ;// ./node_modules/@wordpress/style-engine/build-module/styles/background/index.js
   820 /**
   860 /**
   821  * Internal dependencies
   861  * Internal dependencies
   822  */
   862  */
   823 
   863 
   824 
   864 
   825 const backgroundImage = {
   865 const backgroundImage = {
   826   name: 'backgroundImage',
   866   name: 'backgroundImage',
   827   generate: (style, options) => {
   867   generate: (style, options) => {
   828     const _backgroundImage = style?.background?.backgroundImage;
   868     const _backgroundImage = style?.background?.backgroundImage;
       
   869 
       
   870     /*
       
   871      * The background image can be a string or an object.
       
   872      * If the background image is a string, it could already contain a url() function,
       
   873      * or have a linear-gradient value.
       
   874      */
   829     if (typeof _backgroundImage === 'object' && _backgroundImage?.url) {
   875     if (typeof _backgroundImage === 'object' && _backgroundImage?.url) {
   830       return [{
   876       return [{
   831         selector: options.selector,
   877         selector: options.selector,
   832         key: 'backgroundImage',
   878         key: 'backgroundImage',
   833         // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
   879         // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
   834         value: `url( '${encodeURI(safeDecodeURI(_backgroundImage.url))}' )`
   880         value: `url( '${encodeURI(safeDecodeURI(_backgroundImage.url))}' )`
   835       }];
   881       }];
   836     }
   882     }
   837 
   883     return generateRule(style, options, ['background', 'backgroundImage'], 'backgroundImage');
   838     /*
       
   839      * If the background image is a string, it could already contain a url() function,
       
   840      * or have a linear-gradient value.
       
   841      */
       
   842     if (typeof _backgroundImage === 'string') {
       
   843       return generateRule(style, options, ['background', 'backgroundImage'], 'backgroundImage');
       
   844     }
       
   845     return [];
       
   846   }
   884   }
   847 };
   885 };
   848 const backgroundPosition = {
   886 const backgroundPosition = {
   849   name: 'backgroundPosition',
   887   name: 'backgroundPosition',
   850   generate: (style, options) => {
   888   generate: (style, options) => {
   861   name: 'backgroundSize',
   899   name: 'backgroundSize',
   862   generate: (style, options) => {
   900   generate: (style, options) => {
   863     return generateRule(style, options, ['background', 'backgroundSize'], 'backgroundSize');
   901     return generateRule(style, options, ['background', 'backgroundSize'], 'backgroundSize');
   864   }
   902   }
   865 };
   903 };
   866 /* harmony default export */ const styles_background = ([backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize]);
   904 const backgroundAttachment = {
   867 
   905   name: 'backgroundAttachment',
   868 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/shadow/index.js
   906   generate: (style, options) => {
       
   907     return generateRule(style, options, ['background', 'backgroundAttachment'], 'backgroundAttachment');
       
   908   }
       
   909 };
       
   910 /* harmony default export */ const styles_background = ([backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, backgroundAttachment]);
       
   911 
       
   912 ;// ./node_modules/@wordpress/style-engine/build-module/styles/shadow/index.js
   869 /**
   913 /**
   870  * Internal dependencies
   914  * Internal dependencies
   871  */
   915  */
   872 
   916 
   873 
   917 
   877     return generateRule(style, options, ['shadow'], 'boxShadow');
   921     return generateRule(style, options, ['shadow'], 'boxShadow');
   878   }
   922   }
   879 };
   923 };
   880 /* harmony default export */ const styles_shadow = ([shadow]);
   924 /* harmony default export */ const styles_shadow = ([shadow]);
   881 
   925 
   882 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/outline/index.js
   926 ;// ./node_modules/@wordpress/style-engine/build-module/styles/outline/index.js
   883 /**
   927 /**
   884  * Internal dependencies
   928  * Internal dependencies
   885  */
   929  */
   886 
   930 
   887 
   931 
   909     return generateRule(style, options, path, ruleKey);
   953     return generateRule(style, options, path, ruleKey);
   910   }
   954   }
   911 };
   955 };
   912 /* harmony default export */ const outline = ([outline_color, outlineStyle, offset, outline_width]);
   956 /* harmony default export */ const outline = ([outline_color, outlineStyle, offset, outline_width]);
   913 
   957 
   914 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/spacing/padding.js
   958 ;// ./node_modules/@wordpress/style-engine/build-module/styles/spacing/padding.js
   915 /**
   959 /**
   916  * Internal dependencies
   960  * Internal dependencies
   917  */
   961  */
   918 
   962 
   919 
   963 
   926     });
   970     });
   927   }
   971   }
   928 };
   972 };
   929 /* harmony default export */ const spacing_padding = (padding);
   973 /* harmony default export */ const spacing_padding = (padding);
   930 
   974 
   931 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/spacing/margin.js
   975 ;// ./node_modules/@wordpress/style-engine/build-module/styles/spacing/margin.js
   932 /**
   976 /**
   933  * Internal dependencies
   977  * Internal dependencies
   934  */
   978  */
   935 
   979 
   936 
   980 
   943     });
   987     });
   944   }
   988   }
   945 };
   989 };
   946 /* harmony default export */ const spacing_margin = (margin);
   990 /* harmony default export */ const spacing_margin = (margin);
   947 
   991 
   948 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/spacing/index.js
   992 ;// ./node_modules/@wordpress/style-engine/build-module/styles/spacing/index.js
   949 /**
   993 /**
   950  * Internal dependencies
   994  * Internal dependencies
   951  */
   995  */
   952 
   996 
   953 
   997 
   954 /* harmony default export */ const spacing = ([spacing_margin, spacing_padding]);
   998 /* harmony default export */ const spacing = ([spacing_margin, spacing_padding]);
   955 
   999 
   956 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/typography/index.js
  1000 ;// ./node_modules/@wordpress/style-engine/build-module/styles/typography/index.js
   957 /**
  1001 /**
   958  * Internal dependencies
  1002  * Internal dependencies
   959  */
  1003  */
   960 
  1004 
   961 
  1005 
  1019     return generateRule(style, options, ['typography', 'writingMode'], 'writingMode');
  1063     return generateRule(style, options, ['typography', 'writingMode'], 'writingMode');
  1020   }
  1064   }
  1021 };
  1065 };
  1022 /* harmony default export */ const typography = ([fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textColumns, textDecoration, textTransform, writingMode]);
  1066 /* harmony default export */ const typography = ([fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textColumns, textDecoration, textTransform, writingMode]);
  1023 
  1067 
  1024 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/styles/index.js
  1068 ;// ./node_modules/@wordpress/style-engine/build-module/styles/index.js
  1025 /**
  1069 /**
  1026  * Internal dependencies
  1070  * Internal dependencies
  1027  */
  1071  */
  1028 
  1072 
  1029 
  1073 
  1033 
  1077 
  1034 
  1078 
  1035 
  1079 
  1036 const styleDefinitions = [...border, ...styles_color, ...dimensions, ...outline, ...spacing, ...typography, ...styles_shadow, ...styles_background];
  1080 const styleDefinitions = [...border, ...styles_color, ...dimensions, ...outline, ...spacing, ...typography, ...styles_shadow, ...styles_background];
  1037 
  1081 
  1038 ;// CONCATENATED MODULE: ./node_modules/@wordpress/style-engine/build-module/index.js
  1082 ;// ./node_modules/@wordpress/style-engine/build-module/index.js
  1039 /**
  1083 /**
  1040  * External dependencies
  1084  * External dependencies
  1041  */
  1085  */
  1042 
  1086 
  1043 
  1087 
  1106     }
  1150     }
  1107   });
  1151   });
  1108   return rules;
  1152   return rules;
  1109 }
  1153 }
  1110 
  1154 
       
  1155 // Export style utils.
       
  1156 
       
  1157 
  1111 (window.wp = window.wp || {}).styleEngine = __webpack_exports__;
  1158 (window.wp = window.wp || {}).styleEngine = __webpack_exports__;
  1112 /******/ })()
  1159 /******/ })()
  1113 ;
  1160 ;