getAllConfigs.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "default", {
  6. enumerable: true,
  7. get: ()=>getAllConfigs
  8. });
  9. const _configFullJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/config.full.js"));
  10. const _featureFlags = require("../featureFlags");
  11. function _interopRequireDefault(obj) {
  12. return obj && obj.__esModule ? obj : {
  13. default: obj
  14. };
  15. }
  16. function getAllConfigs(config) {
  17. var _config_presets;
  18. const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
  19. _configFullJs.default
  20. ]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
  21. const features = {
  22. // Add experimental configs here...
  23. respectDefaultRingColorOpacity: {
  24. theme: {
  25. ringColor: ({ theme })=>({
  26. DEFAULT: "#3b82f67f",
  27. ...theme("colors")
  28. })
  29. }
  30. },
  31. disableColorOpacityUtilitiesByDefault: {
  32. corePlugins: {
  33. backgroundOpacity: false,
  34. borderOpacity: false,
  35. divideOpacity: false,
  36. placeholderOpacity: false,
  37. ringOpacity: false,
  38. textOpacity: false
  39. }
  40. }
  41. };
  42. const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
  43. return [
  44. config,
  45. ...experimentals,
  46. ...configs
  47. ];
  48. }