First version
This commit is contained in:
1350
CTOAsYouGo/node_modules/tailwindcss/CHANGELOG.md
generated
vendored
1350
CTOAsYouGo/node_modules/tailwindcss/CHANGELOG.md
generated
vendored
File diff suppressed because it is too large
Load Diff
3
CTOAsYouGo/node_modules/tailwindcss/LICENSE
generated
vendored
3
CTOAsYouGo/node_modules/tailwindcss/LICENSE
generated
vendored
@@ -1,6 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Tailwind Labs, Inc.
|
||||
Copyright (c) Adam Wathan <adam.wathan@gmail.com>
|
||||
Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
22
CTOAsYouGo/node_modules/tailwindcss/README.md
generated
vendored
22
CTOAsYouGo/node_modules/tailwindcss/README.md
generated
vendored
@@ -1,20 +1,12 @@
|
||||
<p align="center">
|
||||
<a href="https://tailwindcss.com" target="_blank">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-dark.svg">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg">
|
||||
<img alt="Tailwind CSS" src="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg" width="350" height="70" style="max-width: 100%;">
|
||||
</picture>
|
||||
</a>
|
||||
<p>
|
||||
<a href="https://tailwindcss.com/" target="_blank">
|
||||
<img alt="Tailwind CSS" width="350" src="https://refactoringui.nyc3.cdn.digitaloceanspaces.com/tailwind-logo.svg">
|
||||
</a><br>
|
||||
A utility-first CSS framework for rapidly building custom user interfaces.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
A utility-first CSS framework for rapidly building custom user interfaces.
|
||||
</p>
|
||||
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci-stable.yml?branch=master" alt="Build Status"></a>
|
||||
<p>
|
||||
<a href="https://travis-ci.org/tailwindcss/tailwindcss"><img src="https://img.shields.io/travis/tailwindcss/tailwindcss/master.svg" alt="Build Status"></a>
|
||||
<a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
|
||||
<a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
|
||||
<a href="https://github.com/tailwindcss/tailwindcss/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
|
||||
|
||||
3
CTOAsYouGo/node_modules/tailwindcss/colors.d.ts
generated
vendored
3
CTOAsYouGo/node_modules/tailwindcss/colors.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import type { DefaultColors } from './types/generated/colors'
|
||||
declare const colors: DefaultColors
|
||||
export = colors
|
||||
2
CTOAsYouGo/node_modules/tailwindcss/colors.js
generated
vendored
2
CTOAsYouGo/node_modules/tailwindcss/colors.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
let colors = require('./lib/public/colors')
|
||||
module.exports = (colors.__esModule ? colors : { default: colors }).default
|
||||
3
CTOAsYouGo/node_modules/tailwindcss/defaultConfig.d.ts
generated
vendored
3
CTOAsYouGo/node_modules/tailwindcss/defaultConfig.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import type { Config } from './types/config'
|
||||
declare const config: Config
|
||||
export = config
|
||||
6
CTOAsYouGo/node_modules/tailwindcss/defaultConfig.js
generated
vendored
6
CTOAsYouGo/node_modules/tailwindcss/defaultConfig.js
generated
vendored
@@ -1,2 +1,4 @@
|
||||
let defaultConfig = require('./lib/public/default-config')
|
||||
module.exports = (defaultConfig.__esModule ? defaultConfig : { default: defaultConfig }).default
|
||||
const cloneDeep = require('lodash/cloneDeep')
|
||||
const defaultConfig = require('./stubs/defaultConfig.stub.js')
|
||||
|
||||
module.exports = cloneDeep(defaultConfig)
|
||||
|
||||
4
CTOAsYouGo/node_modules/tailwindcss/defaultTheme.d.ts
generated
vendored
4
CTOAsYouGo/node_modules/tailwindcss/defaultTheme.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
||||
import type { Config } from './types/config'
|
||||
import { DefaultTheme } from './types/generated/default-theme'
|
||||
declare const theme: Config['theme'] & DefaultTheme
|
||||
export = theme
|
||||
6
CTOAsYouGo/node_modules/tailwindcss/defaultTheme.js
generated
vendored
6
CTOAsYouGo/node_modules/tailwindcss/defaultTheme.js
generated
vendored
@@ -1,2 +1,4 @@
|
||||
let defaultTheme = require('./lib/public/default-theme')
|
||||
module.exports = (defaultTheme.__esModule ? defaultTheme : { default: defaultTheme }).default
|
||||
const cloneDeep = require('lodash/cloneDeep')
|
||||
const defaultConfig = require('./stubs/defaultConfig.stub.js')
|
||||
|
||||
module.exports = cloneDeep(defaultConfig.theme)
|
||||
|
||||
587
CTOAsYouGo/node_modules/tailwindcss/dist/base.css
generated
vendored
Normal file
587
CTOAsYouGo/node_modules/tailwindcss/dist/base.css
generated
vendored
Normal file
@@ -0,0 +1,587 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct the line height in all browsers.
|
||||
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the `main` element consistently in IE.
|
||||
*/
|
||||
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57-
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers.
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
line-height: 1.15; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input { /* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
[type="reset"]:-moz-focusring,
|
||||
[type="submit"]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE 10+.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10.
|
||||
* 2. Remove the padding in IE 10.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||
*/
|
||||
|
||||
details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Misc
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10+.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually forked from SUIT CSS Base: https://github.com/suitcss/base
|
||||
* A thin layer on top of normalize.css that provides a starting point more
|
||||
* suitable for web applications.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Removes the default spacing and border for appropriate elements.
|
||||
*/
|
||||
|
||||
blockquote,
|
||||
dl,
|
||||
dd,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
hr,
|
||||
figure,
|
||||
p,
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Work around a Firefox/IE bug where the transparent `button` background
|
||||
* results in a loss of the default `button` focus styles.
|
||||
*/
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tailwind custom reset styles
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1. Use the user's configured `sans` font-family (with Tailwind's default
|
||||
* sans-serif font stack as a fallback) as a sane default.
|
||||
* 2. Use Tailwind's default "normal" line-height so the user isn't forced
|
||||
* to override it to ensure consistency even when using the default theme.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
|
||||
line-height: 1.5; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Prevent padding and border from affecting element width.
|
||||
*
|
||||
* We used to set this in the html element and inherit from
|
||||
* the parent element for everything else. This caused issues
|
||||
* in shadow-dom-enhanced elements like <details> where the content
|
||||
* is wrapped by a div with box-sizing set to `content-box`.
|
||||
*
|
||||
* https://github.com/mozdevs/cssremedy/issues/4
|
||||
*
|
||||
*
|
||||
* 2. Allow adding a border to an element by just adding a border-width.
|
||||
*
|
||||
* By default, the way the browser specifies that an element should have no
|
||||
* border is by setting it's border-style to `none` in the user-agent
|
||||
* stylesheet.
|
||||
*
|
||||
* In order to easily add borders to elements by just setting the `border-width`
|
||||
* property, we change the default border-style for all elements to `solid`, and
|
||||
* use border-width to hide them instead. This way our `border` utilities only
|
||||
* need to set the `border-width` property instead of the entire `border`
|
||||
* shorthand, making our border utilities much more straightforward to compose.
|
||||
*
|
||||
* https://github.com/tailwindcss/tailwindcss/pull/116
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box; /* 1 */
|
||||
border-width: 0; /* 2 */
|
||||
border-style: solid; /* 2 */
|
||||
border-color: #e2e8f0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure horizontal rules are visible by default
|
||||
*/
|
||||
|
||||
hr {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undo the `border-style: none` reset that Normalize applies to images so that
|
||||
* our `border-{width}` utilities have the expected effect.
|
||||
*
|
||||
* The Normalize reset is unnecessary for us since we default the border-width
|
||||
* to 0 on all elements.
|
||||
*
|
||||
* https://github.com/tailwindcss/tailwindcss/issues/362
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: #a0aec0;
|
||||
}
|
||||
|
||||
input::-ms-input-placeholder, textarea::-ms-input-placeholder {
|
||||
color: #a0aec0;
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
color: #a0aec0;
|
||||
}
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset links to optimize for opt-in styling instead of
|
||||
* opt-out.
|
||||
*/
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset form element properties that are easy to forget to
|
||||
* style explicitly so you don't inadvertently introduce
|
||||
* styles that deviate from your design system. These styles
|
||||
* supplement a partial reset that is already applied by
|
||||
* normalize.css.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the configured 'mono' font family for elements that
|
||||
* are expected to be rendered with a monospace font, falling
|
||||
* back to the system monospace stack if there is no configured
|
||||
* 'mono' font family.
|
||||
*/
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make replaced elements `display: block` by default as that's
|
||||
* the behavior you want almost all of the time. Inspired by
|
||||
* CSS Remedy, with `svg` added as well.
|
||||
*
|
||||
* https://github.com/mozdevs/cssremedy/issues/14
|
||||
*/
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
audio,
|
||||
iframe,
|
||||
embed,
|
||||
object {
|
||||
display: block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constrain images and videos to the parent width and preserve
|
||||
* their instrinsic aspect ratio.
|
||||
*
|
||||
* https://github.com/mozdevs/cssremedy/issues/14
|
||||
*/
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
1
CTOAsYouGo/node_modules/tailwindcss/dist/base.min.css
generated
vendored
Normal file
1
CTOAsYouGo/node_modules/tailwindcss/dist/base.min.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e2e8f0}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#a0aec0}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}
|
||||
147
CTOAsYouGo/node_modules/tailwindcss/dist/components.css
generated
vendored
Normal file
147
CTOAsYouGo/node_modules/tailwindcss/dist/components.css
generated
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
.container {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.container {
|
||||
max-width: 640px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
max-width: 768px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.container {
|
||||
max-width: 1024px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.container {
|
||||
max-width: 1280px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.sm\:container {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.sm\:container {
|
||||
max-width: 640px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.sm\:container {
|
||||
max-width: 768px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.sm\:container {
|
||||
max-width: 1024px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.sm\:container {
|
||||
max-width: 1280px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.md\:container {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.md\:container {
|
||||
max-width: 640px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.md\:container {
|
||||
max-width: 768px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.md\:container {
|
||||
max-width: 1024px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.md\:container {
|
||||
max-width: 1280px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.lg\:container {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.lg\:container {
|
||||
max-width: 640px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.lg\:container {
|
||||
max-width: 768px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.lg\:container {
|
||||
max-width: 1024px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.lg\:container {
|
||||
max-width: 1280px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.xl\:container {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.xl\:container {
|
||||
max-width: 640px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.xl\:container {
|
||||
max-width: 768px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.xl\:container {
|
||||
max-width: 1024px
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.xl\:container {
|
||||
max-width: 1280px
|
||||
}
|
||||
}
|
||||
}
|
||||
1
CTOAsYouGo/node_modules/tailwindcss/dist/components.min.css
generated
vendored
Normal file
1
CTOAsYouGo/node_modules/tailwindcss/dist/components.min.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:640px){.sm\:container{width:100%}@media (min-width:640px){.sm\:container{max-width:640px}}@media (min-width:768px){.sm\:container{max-width:768px}}@media (min-width:1024px){.sm\:container{max-width:1024px}}@media (min-width:1280px){.sm\:container{max-width:1280px}}}@media (min-width:768px){.md\:container{width:100%}@media (min-width:640px){.md\:container{max-width:640px}}@media (min-width:768px){.md\:container{max-width:768px}}@media (min-width:1024px){.md\:container{max-width:1024px}}@media (min-width:1280px){.md\:container{max-width:1280px}}}@media (min-width:1024px){.lg\:container{width:100%}@media (min-width:640px){.lg\:container{max-width:640px}}@media (min-width:768px){.lg\:container{max-width:768px}}@media (min-width:1024px){.lg\:container{max-width:1024px}}@media (min-width:1280px){.lg\:container{max-width:1280px}}}@media (min-width:1280px){.xl\:container{width:100%}@media (min-width:640px){.xl\:container{max-width:640px}}@media (min-width:768px){.xl\:container{max-width:768px}}@media (min-width:1024px){.xl\:container{max-width:1024px}}@media (min-width:1280px){.xl\:container{max-width:1280px}}}
|
||||
294706
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind-experimental.css
generated
vendored
Normal file
294706
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind-experimental.css
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind-experimental.min.css
generated
vendored
Normal file
1
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind-experimental.min.css
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
105251
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind.css
generated
vendored
Normal file
105251
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind.css
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind.min.css
generated
vendored
Normal file
1
CTOAsYouGo/node_modules/tailwindcss/dist/tailwind.min.css
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
104523
CTOAsYouGo/node_modules/tailwindcss/dist/utilities.css
generated
vendored
Normal file
104523
CTOAsYouGo/node_modules/tailwindcss/dist/utilities.css
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
CTOAsYouGo/node_modules/tailwindcss/dist/utilities.min.css
generated
vendored
Normal file
1
CTOAsYouGo/node_modules/tailwindcss/dist/utilities.min.css
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
36
CTOAsYouGo/node_modules/tailwindcss/lib/cli-peer-dependencies.js
generated
vendored
36
CTOAsYouGo/node_modules/tailwindcss/lib/cli-peer-dependencies.js
generated
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
lazyPostcss: function() {
|
||||
return lazyPostcss;
|
||||
},
|
||||
lazyPostcssImport: function() {
|
||||
return lazyPostcssImport;
|
||||
},
|
||||
lazyAutoprefixer: function() {
|
||||
return lazyAutoprefixer;
|
||||
},
|
||||
lazyCssnano: function() {
|
||||
return lazyCssnano;
|
||||
}
|
||||
});
|
||||
function lazyPostcss() {
|
||||
return require("postcss");
|
||||
}
|
||||
function lazyPostcssImport() {
|
||||
return require("postcss-import");
|
||||
}
|
||||
function lazyAutoprefixer() {
|
||||
return require("autoprefixer");
|
||||
}
|
||||
function lazyCssnano() {
|
||||
return require("cssnano");
|
||||
}
|
||||
17
CTOAsYouGo/node_modules/tailwindcss/lib/cli.js
generated
vendored
17
CTOAsYouGo/node_modules/tailwindcss/lib/cli.js
generated
vendored
@@ -1,7 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
if (false) {
|
||||
module.exports = require("./oxide/cli");
|
||||
} else {
|
||||
module.exports = require("./cli/index");
|
||||
}
|
||||
|
||||
var _main = _interopRequireDefault(require("./cli/main"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("./cli/utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
(0, _main.default)(process.argv.slice(2)).catch(error => utils.die(error.stack));
|
||||
62
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/deps.js
generated
vendored
62
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/deps.js
generated
vendored
@@ -1,62 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
loadPostcss: function() {
|
||||
return loadPostcss;
|
||||
},
|
||||
loadPostcssImport: function() {
|
||||
return loadPostcssImport;
|
||||
},
|
||||
loadCssNano: function() {
|
||||
return loadCssNano;
|
||||
},
|
||||
loadAutoprefixer: function() {
|
||||
return loadAutoprefixer;
|
||||
}
|
||||
});
|
||||
const _index = require("../../../peers/index.js");
|
||||
function loadPostcss() {
|
||||
// Try to load a local `postcss` version first
|
||||
try {
|
||||
return require("postcss");
|
||||
} catch {}
|
||||
return (0, _index.lazyPostcss)();
|
||||
}
|
||||
function loadPostcssImport() {
|
||||
// Try to load a local `postcss-import` version first
|
||||
try {
|
||||
return require("postcss-import");
|
||||
} catch {}
|
||||
return (0, _index.lazyPostcssImport)();
|
||||
}
|
||||
function loadCssNano() {
|
||||
let options = {
|
||||
preset: [
|
||||
"default",
|
||||
{
|
||||
cssDeclarationSorter: false
|
||||
}
|
||||
]
|
||||
};
|
||||
// Try to load a local `cssnano` version first
|
||||
try {
|
||||
return require("cssnano");
|
||||
} catch {}
|
||||
return (0, _index.lazyCssnano)()(options);
|
||||
}
|
||||
function loadAutoprefixer() {
|
||||
// Try to load a local `autoprefixer` version first
|
||||
try {
|
||||
return require("autoprefixer");
|
||||
} catch {}
|
||||
return (0, _index.lazyAutoprefixer)();
|
||||
}
|
||||
54
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/index.js
generated
vendored
54
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/index.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "build", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return build;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _resolveConfigPath = require("../../util/resolveConfigPath.js");
|
||||
const _plugin = require("./plugin.js");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function build(args) {
|
||||
let input = args["--input"];
|
||||
let shouldWatch = args["--watch"];
|
||||
// TODO: Deprecate this in future versions
|
||||
if (!input && args["_"][1]) {
|
||||
console.error("[deprecation] Running tailwindcss without -i, please provide an input file.");
|
||||
input = args["--input"] = args["_"][1];
|
||||
}
|
||||
if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
||||
console.error(`Specified input file ${args["--input"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) {
|
||||
console.error(`Specified config file ${args["--config"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
// TODO: Reference the @config path here if exists
|
||||
let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)();
|
||||
let processor = await (0, _plugin.createProcessor)(args, configPath);
|
||||
if (shouldWatch) {
|
||||
// Abort the watcher if stdin is closed to avoid zombie processes
|
||||
// You can disable this behavior with --watch=always
|
||||
if (args["--watch"] !== "always") {
|
||||
process.stdin.on("end", ()=>process.exit(0));
|
||||
}
|
||||
process.stdin.resume();
|
||||
await processor.watch();
|
||||
} else {
|
||||
await processor.build().catch((e)=>{
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
378
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/plugin.js
generated
vendored
378
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/plugin.js
generated
vendored
@@ -1,378 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createProcessor", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createProcessor;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _postcssloadconfig = /*#__PURE__*/ _interop_require_default(require("postcss-load-config"));
|
||||
const _lilconfig = require("lilconfig");
|
||||
const _plugins = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API
|
||||
));
|
||||
const _options = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API
|
||||
));
|
||||
const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("../../processTailwindFeatures"));
|
||||
const _deps = require("./deps");
|
||||
const _utils = require("./utils");
|
||||
const _sharedState = require("../../lib/sharedState");
|
||||
const _resolveConfig = /*#__PURE__*/ _interop_require_default(require("../../../resolveConfig.js"));
|
||||
const _content = require("../../lib/content.js");
|
||||
const _watching = require("./watching.js");
|
||||
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
||||
const _findAtConfigPath = require("../../lib/findAtConfigPath.js");
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../../util/log"));
|
||||
const _loadconfig = require("../../lib/load-config");
|
||||
const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("../../lib/getModuleDependencies"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {string} [customPostCssPath ]
|
||||
* @returns
|
||||
*/ async function loadPostCssPlugins(customPostCssPath) {
|
||||
let config = customPostCssPath ? await (async ()=>{
|
||||
let file = _path.default.resolve(customPostCssPath);
|
||||
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
|
||||
// @ts-ignore
|
||||
let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
|
||||
if (typeof config === "function") {
|
||||
config = config();
|
||||
} else {
|
||||
config = Object.assign({}, config);
|
||||
}
|
||||
if (!config.plugins) {
|
||||
config.plugins = [];
|
||||
}
|
||||
return {
|
||||
file,
|
||||
plugins: (0, _plugins.default)(config, file),
|
||||
options: (0, _options.default)(config, file)
|
||||
};
|
||||
})() : await (0, _postcssloadconfig.default)();
|
||||
let configPlugins = config.plugins;
|
||||
let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{
|
||||
if (typeof plugin === "function" && plugin.name === "tailwindcss") {
|
||||
return true;
|
||||
}
|
||||
if (typeof plugin === "object" && plugin !== null && plugin.postcssPlugin === "tailwindcss") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
let beforePlugins = configPluginTailwindIdx === -1 ? [] : configPlugins.slice(0, configPluginTailwindIdx);
|
||||
let afterPlugins = configPluginTailwindIdx === -1 ? configPlugins : configPlugins.slice(configPluginTailwindIdx + 1);
|
||||
return [
|
||||
beforePlugins,
|
||||
afterPlugins,
|
||||
config.options
|
||||
];
|
||||
}
|
||||
function loadBuiltinPostcssPlugins() {
|
||||
let postcss = (0, _deps.loadPostcss)();
|
||||
let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
|
||||
return [
|
||||
[
|
||||
(root)=>{
|
||||
root.walkAtRules("import", (rule)=>{
|
||||
if (rule.params.slice(1).startsWith("tailwindcss/")) {
|
||||
rule.after(postcss.comment({
|
||||
text: IMPORT_COMMENT + rule.params
|
||||
}));
|
||||
rule.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
(0, _deps.loadPostcssImport)(),
|
||||
(root)=>{
|
||||
root.walkComments((rule)=>{
|
||||
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
||||
rule.after(postcss.atRule({
|
||||
name: "import",
|
||||
params: rule.text.replace(IMPORT_COMMENT, "")
|
||||
}));
|
||||
rule.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
],
|
||||
[],
|
||||
{}
|
||||
];
|
||||
}
|
||||
let state = {
|
||||
/** @type {any} */ context: null,
|
||||
/** @type {ReturnType<typeof createWatcher> | null} */ watcher: null,
|
||||
/** @type {{content: string, extension: string}[]} */ changedContent: [],
|
||||
/** @type {ReturnType<typeof load> | null} */ configBag: null,
|
||||
contextDependencies: new Set(),
|
||||
/** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [],
|
||||
refreshContentPaths () {
|
||||
var _this_context;
|
||||
this.contentPaths = (0, _content.parseCandidateFiles)(this.context, (_this_context = this.context) === null || _this_context === void 0 ? void 0 : _this_context.tailwindConfig);
|
||||
},
|
||||
get config () {
|
||||
return this.context.tailwindConfig;
|
||||
},
|
||||
get contentPatterns () {
|
||||
return {
|
||||
all: this.contentPaths.map((contentPath)=>contentPath.pattern),
|
||||
dynamic: this.contentPaths.filter((contentPath)=>contentPath.glob !== undefined).map((contentPath)=>contentPath.pattern)
|
||||
};
|
||||
},
|
||||
loadConfig (configPath, content) {
|
||||
if (this.watcher && configPath) {
|
||||
this.refreshConfigDependencies();
|
||||
}
|
||||
let config = (0, _loadconfig.loadConfig)(configPath);
|
||||
let dependencies = (0, _getModuleDependencies.default)(configPath);
|
||||
this.configBag = {
|
||||
config,
|
||||
dependencies,
|
||||
dispose () {
|
||||
for (let file of dependencies){
|
||||
delete require.cache[require.resolve(file)];
|
||||
}
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, {
|
||||
content: {
|
||||
files: []
|
||||
}
|
||||
});
|
||||
// Override content files if `--content` has been passed explicitly
|
||||
if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
|
||||
this.configBag.config.content.files = content;
|
||||
}
|
||||
return this.configBag.config;
|
||||
},
|
||||
refreshConfigDependencies () {
|
||||
var _this_configBag;
|
||||
_sharedState.env.DEBUG && console.time("Module dependencies");
|
||||
(_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Module dependencies");
|
||||
},
|
||||
readContentPaths () {
|
||||
let content = [];
|
||||
// Resolve globs from the content config
|
||||
// TODO: When we make the postcss plugin async-capable this can become async
|
||||
let files = _fastglob.default.sync(this.contentPatterns.all);
|
||||
for (let file of files){
|
||||
if (false) {
|
||||
content.push({
|
||||
file,
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
} else {
|
||||
content.push({
|
||||
content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
}
|
||||
}
|
||||
// Resolve raw content in the tailwind config
|
||||
let rawContent = this.config.content.files.filter((file)=>{
|
||||
return file !== null && typeof file === "object";
|
||||
});
|
||||
for (let { raw: htmlContent , extension ="html" } of rawContent){
|
||||
content.push({
|
||||
content: htmlContent,
|
||||
extension
|
||||
});
|
||||
}
|
||||
return content;
|
||||
},
|
||||
getContext ({ createContext , cliConfigPath , root , result , content }) {
|
||||
if (this.context) {
|
||||
this.context.changedContent = this.changedContent.splice(0);
|
||||
return this.context;
|
||||
}
|
||||
_sharedState.env.DEBUG && console.time("Searching for config");
|
||||
var _findAtConfigPath1;
|
||||
let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath;
|
||||
_sharedState.env.DEBUG && console.timeEnd("Searching for config");
|
||||
_sharedState.env.DEBUG && console.time("Loading config");
|
||||
let config = this.loadConfig(configPath, content);
|
||||
_sharedState.env.DEBUG && console.timeEnd("Loading config");
|
||||
_sharedState.env.DEBUG && console.time("Creating context");
|
||||
this.context = createContext(config, []);
|
||||
Object.assign(this.context, {
|
||||
userConfigPath: configPath
|
||||
});
|
||||
_sharedState.env.DEBUG && console.timeEnd("Creating context");
|
||||
_sharedState.env.DEBUG && console.time("Resolving content paths");
|
||||
this.refreshContentPaths();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Resolving content paths");
|
||||
if (this.watcher) {
|
||||
_sharedState.env.DEBUG && console.time("Watch new files");
|
||||
this.watcher.refreshWatchedFiles();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Watch new files");
|
||||
}
|
||||
for (let file of this.readContentPaths()){
|
||||
this.context.changedContent.push(file);
|
||||
}
|
||||
return this.context;
|
||||
}
|
||||
};
|
||||
async function createProcessor(args, cliConfigPath) {
|
||||
var _args_content;
|
||||
let postcss = (0, _deps.loadPostcss)();
|
||||
let input = args["--input"];
|
||||
let output = args["--output"];
|
||||
let includePostCss = args["--postcss"];
|
||||
let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
|
||||
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) : loadBuiltinPostcssPlugins();
|
||||
if (args["--purge"]) {
|
||||
_log.default.warn("purge-flag-deprecated", [
|
||||
"The `--purge` flag has been deprecated.",
|
||||
"Please use `--content` instead."
|
||||
]);
|
||||
if (!args["--content"]) {
|
||||
args["--content"] = args["--purge"];
|
||||
}
|
||||
}
|
||||
var _args_content_split;
|
||||
let content = (_args_content_split = (_args_content = args["--content"]) === null || _args_content === void 0 ? void 0 : _args_content.split(/(?<!{[^}]+),/)) !== null && _args_content_split !== void 0 ? _args_content_split : [];
|
||||
let tailwindPlugin = ()=>{
|
||||
return {
|
||||
postcssPlugin: "tailwindcss",
|
||||
Once (root, { result }) {
|
||||
_sharedState.env.DEBUG && console.time("Compiling CSS");
|
||||
(0, _processTailwindFeatures.default)(({ createContext })=>{
|
||||
console.error();
|
||||
console.error("Rebuilding...");
|
||||
return ()=>{
|
||||
return state.getContext({
|
||||
createContext,
|
||||
cliConfigPath,
|
||||
root,
|
||||
result,
|
||||
content
|
||||
});
|
||||
};
|
||||
})(root, result);
|
||||
_sharedState.env.DEBUG && console.timeEnd("Compiling CSS");
|
||||
}
|
||||
};
|
||||
};
|
||||
tailwindPlugin.postcss = true;
|
||||
let plugins = [
|
||||
...beforePlugins,
|
||||
tailwindPlugin,
|
||||
!args["--minify"] && _utils.formatNodes,
|
||||
...afterPlugins,
|
||||
!args["--no-autoprefixer"] && (0, _deps.loadAutoprefixer)(),
|
||||
args["--minify"] && (0, _deps.loadCssNano)()
|
||||
].filter(Boolean);
|
||||
/** @type {import('postcss').Processor} */ // @ts-ignore
|
||||
let processor = postcss(plugins);
|
||||
async function readInput() {
|
||||
// Piping in data, let's drain the stdin
|
||||
if (input === "-") {
|
||||
return (0, _utils.drainStdin)();
|
||||
}
|
||||
// Input file has been provided
|
||||
if (input) {
|
||||
return _fs.default.promises.readFile(_path.default.resolve(input), "utf8");
|
||||
}
|
||||
// No input file provided, fallback to default atrules
|
||||
return "@tailwind base; @tailwind components; @tailwind utilities";
|
||||
}
|
||||
async function build() {
|
||||
let start = process.hrtime.bigint();
|
||||
return readInput().then((css)=>processor.process(css, {
|
||||
...postcssOptions,
|
||||
from: input,
|
||||
to: output
|
||||
})).then((result)=>{
|
||||
if (!state.watcher) {
|
||||
return result;
|
||||
}
|
||||
_sharedState.env.DEBUG && console.time("Recording PostCSS dependencies");
|
||||
for (let message of result.messages){
|
||||
if (message.type === "dependency") {
|
||||
state.contextDependencies.add(message.file);
|
||||
}
|
||||
}
|
||||
_sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
|
||||
// TODO: This needs to be in a different spot
|
||||
_sharedState.env.DEBUG && console.time("Watch new files");
|
||||
state.watcher.refreshWatchedFiles();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Watch new files");
|
||||
return result;
|
||||
}).then((result)=>{
|
||||
if (!output) {
|
||||
process.stdout.write(result.css);
|
||||
return;
|
||||
}
|
||||
return Promise.all([
|
||||
(0, _utils.outputFile)(result.opts.to, result.css),
|
||||
result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString())
|
||||
]);
|
||||
}).then(()=>{
|
||||
let end = process.hrtime.bigint();
|
||||
console.error();
|
||||
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
||||
}).then(()=>{}, (err)=>{
|
||||
// TODO: If an initial build fails we can't easily pick up any PostCSS dependencies
|
||||
// that were collected before the error occurred
|
||||
// The result is not stored on the error so we have to store it externally
|
||||
// and pull the messages off of it here somehow
|
||||
// This results in a less than ideal DX because the watcher will not pick up
|
||||
// changes to imported CSS if one of them caused an error during the initial build
|
||||
// If you fix it and then save the main CSS file so there's no error
|
||||
// The watcher will start watching the imported CSS files and will be
|
||||
// resilient to future errors.
|
||||
if (state.watcher) {
|
||||
console.error(err);
|
||||
} else {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
||||
*/ async function parseChanges(changes) {
|
||||
return Promise.all(changes.map(async (change)=>({
|
||||
content: await change.content(),
|
||||
extension: change.extension
|
||||
})));
|
||||
}
|
||||
if (input !== undefined && input !== "-") {
|
||||
state.contextDependencies.add(_path.default.resolve(input));
|
||||
}
|
||||
return {
|
||||
build,
|
||||
watch: async ()=>{
|
||||
state.watcher = (0, _watching.createWatcher)(args, {
|
||||
state,
|
||||
/**
|
||||
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
||||
*/ async rebuild (changes) {
|
||||
let needsNewContext = changes.some((change)=>{
|
||||
var _state_configBag;
|
||||
return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file);
|
||||
});
|
||||
if (needsNewContext) {
|
||||
state.context = null;
|
||||
} else {
|
||||
for (let change of (await parseChanges(changes))){
|
||||
state.changedContent.push(change);
|
||||
}
|
||||
}
|
||||
return build();
|
||||
}
|
||||
});
|
||||
await build();
|
||||
}
|
||||
};
|
||||
}
|
||||
88
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/utils.js
generated
vendored
88
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/utils.js
generated
vendored
@@ -1,88 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
indentRecursive: function() {
|
||||
return indentRecursive;
|
||||
},
|
||||
formatNodes: function() {
|
||||
return formatNodes;
|
||||
},
|
||||
readFileWithRetries: function() {
|
||||
return readFileWithRetries;
|
||||
},
|
||||
drainStdin: function() {
|
||||
return drainStdin;
|
||||
},
|
||||
outputFile: function() {
|
||||
return outputFile;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function indentRecursive(node, indent = 0) {
|
||||
node.each && node.each((child, i)=>{
|
||||
if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) {
|
||||
child.raws.before = `\n${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`;
|
||||
}
|
||||
child.raws.after = `\n${" ".repeat(indent)}`;
|
||||
indentRecursive(child, indent + 1);
|
||||
});
|
||||
}
|
||||
function formatNodes(root) {
|
||||
indentRecursive(root);
|
||||
if (root.first) {
|
||||
root.first.raws.before = "";
|
||||
}
|
||||
}
|
||||
async function readFileWithRetries(path, tries = 5) {
|
||||
for(let n = 0; n <= tries; n++){
|
||||
try {
|
||||
return await _fs.default.promises.readFile(path, "utf8");
|
||||
} catch (err) {
|
||||
if (n !== tries) {
|
||||
if (err.code === "ENOENT" || err.code === "EBUSY") {
|
||||
await new Promise((resolve)=>setTimeout(resolve, 10));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
function drainStdin() {
|
||||
return new Promise((resolve, reject)=>{
|
||||
let result = "";
|
||||
process.stdin.on("data", (chunk)=>{
|
||||
result += chunk;
|
||||
});
|
||||
process.stdin.on("end", ()=>resolve(result));
|
||||
process.stdin.on("error", (err)=>reject(err));
|
||||
});
|
||||
}
|
||||
async function outputFile(file, newContents) {
|
||||
try {
|
||||
let currentContents = await _fs.default.promises.readFile(file, "utf8");
|
||||
if (currentContents === newContents) {
|
||||
return; // Skip writing the file
|
||||
}
|
||||
} catch {}
|
||||
// Write the file
|
||||
await _fs.default.promises.mkdir(_path.default.dirname(file), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.default.promises.writeFile(file, newContents, "utf8");
|
||||
}
|
||||
182
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/watching.js
generated
vendored
182
CTOAsYouGo/node_modules/tailwindcss/lib/cli/build/watching.js
generated
vendored
@@ -1,182 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createWatcher", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createWatcher;
|
||||
}
|
||||
});
|
||||
const _chokidar = /*#__PURE__*/ _interop_require_default(require("chokidar"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch"));
|
||||
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _utils = require("./utils.js");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function createWatcher(args, { state , rebuild }) {
|
||||
let shouldPoll = args["--poll"];
|
||||
let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
|
||||
// Polling interval in milliseconds
|
||||
// Used only when polling or coalescing add/change events on Windows
|
||||
let pollInterval = 10;
|
||||
let watcher = _chokidar.default.watch([], {
|
||||
// Force checking for atomic writes in all situations
|
||||
// This causes chokidar to wait up to 100ms for a file to re-added after it's been unlinked
|
||||
// This only works when watching directories though
|
||||
atomic: true,
|
||||
usePolling: shouldPoll,
|
||||
interval: shouldPoll ? pollInterval : undefined,
|
||||
ignoreInitial: true,
|
||||
awaitWriteFinish: shouldCoalesceWriteEvents ? {
|
||||
stabilityThreshold: 50,
|
||||
pollInterval: pollInterval
|
||||
} : false
|
||||
});
|
||||
// A queue of rebuilds, file reads, etc… to run
|
||||
let chain = Promise.resolve();
|
||||
/**
|
||||
* A list of files that have been changed since the last rebuild
|
||||
*
|
||||
* @type {{file: string, content: () => Promise<string>, extension: string}[]}
|
||||
*/ let changedContent = [];
|
||||
/**
|
||||
* A list of files for which a rebuild has already been queued.
|
||||
* This is used to prevent duplicate rebuilds when multiple events are fired for the same file.
|
||||
* The rebuilt file is cleared from this list when it's associated rebuild has _started_
|
||||
* This is because if the file is changed during a rebuild it won't trigger a new rebuild which it should
|
||||
**/ let pendingRebuilds = new Set();
|
||||
let _timer;
|
||||
let _reject;
|
||||
/**
|
||||
* Rebuilds the changed files and resolves when the rebuild is
|
||||
* complete regardless of whether it was successful or not
|
||||
*/ async function rebuildAndContinue() {
|
||||
let changes = changedContent.splice(0);
|
||||
// There are no changes to rebuild so we can just do nothing
|
||||
if (changes.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Clear all pending rebuilds for the about-to-be-built files
|
||||
changes.forEach((change)=>pendingRebuilds.delete(change.file));
|
||||
// Resolve the promise even when the rebuild fails
|
||||
return rebuild(changes).then(()=>{}, (e)=>{
|
||||
console.error(e.toString());
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} file
|
||||
* @param {(() => Promise<string>) | null} content
|
||||
* @param {boolean} skipPendingCheck
|
||||
* @returns {Promise<void>}
|
||||
*/ function recordChangedFile(file, content = null, skipPendingCheck = false) {
|
||||
file = _path.default.resolve(file);
|
||||
// Applications like Vim/Neovim fire both rename and change events in succession for atomic writes
|
||||
// In that case rebuild has already been queued by rename, so can be skipped in change
|
||||
if (pendingRebuilds.has(file) && !skipPendingCheck) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Mark that a rebuild of this file is going to happen
|
||||
// It MUST happen synchronously before the rebuild is queued for this to be effective
|
||||
pendingRebuilds.add(file);
|
||||
changedContent.push({
|
||||
file,
|
||||
content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, "utf8"),
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
if (_timer) {
|
||||
clearTimeout(_timer);
|
||||
_reject();
|
||||
}
|
||||
// If a rebuild is already in progress we don't want to start another one until the 10ms timer has expired
|
||||
chain = chain.then(()=>new Promise((resolve, reject)=>{
|
||||
_timer = setTimeout(resolve, 10);
|
||||
_reject = reject;
|
||||
}));
|
||||
// Resolves once this file has been rebuilt (or the rebuild for this file has failed)
|
||||
// This queues as many rebuilds as there are changed files
|
||||
// But those rebuilds happen after some delay
|
||||
// And will immediately resolve if there are no changes
|
||||
chain = chain.then(rebuildAndContinue, rebuildAndContinue);
|
||||
return chain;
|
||||
}
|
||||
watcher.on("change", (file)=>recordChangedFile(file));
|
||||
watcher.on("add", (file)=>recordChangedFile(file));
|
||||
// Restore watching any files that are "removed"
|
||||
// This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed)
|
||||
// TODO: An an optimization we should allow removal when the config changes
|
||||
watcher.on("unlink", (file)=>{
|
||||
file = (0, _normalizepath.default)(file);
|
||||
// Only re-add the file if it's not covered by a dynamic pattern
|
||||
if (!_micromatch.default.some([
|
||||
file
|
||||
], state.contentPatterns.dynamic)) {
|
||||
watcher.add(file);
|
||||
}
|
||||
});
|
||||
// Some applications such as Visual Studio (but not VS Code)
|
||||
// will only fire a rename event for atomic writes and not a change event
|
||||
// This is very likely a chokidar bug but it's one we need to work around
|
||||
// We treat this as a change event and rebuild the CSS
|
||||
watcher.on("raw", (evt, filePath, meta)=>{
|
||||
if (evt !== "rename") {
|
||||
return;
|
||||
}
|
||||
let watchedPath = meta.watchedPath;
|
||||
// Watched path might be the file itself
|
||||
// Or the directory it is in
|
||||
filePath = watchedPath.endsWith(filePath) ? watchedPath : _path.default.join(watchedPath, filePath);
|
||||
// Skip this event since the files it is for does not match any of the registered content globs
|
||||
if (!_micromatch.default.some([
|
||||
filePath
|
||||
], state.contentPatterns.all)) {
|
||||
return;
|
||||
}
|
||||
// Skip since we've already queued a rebuild for this file that hasn't happened yet
|
||||
if (pendingRebuilds.has(filePath)) {
|
||||
return;
|
||||
}
|
||||
// We'll go ahead and add the file to the pending rebuilds list here
|
||||
// It'll be removed when the rebuild starts unless the read fails
|
||||
// which will be taken care of as well
|
||||
pendingRebuilds.add(filePath);
|
||||
async function enqueue() {
|
||||
try {
|
||||
// We need to read the file as early as possible outside of the chain
|
||||
// because it may be gone by the time we get to it. doing the read
|
||||
// immediately increases the chance that the file is still there
|
||||
let content = await (0, _utils.readFileWithRetries)(_path.default.resolve(filePath));
|
||||
if (content === undefined) {
|
||||
return;
|
||||
}
|
||||
// This will push the rebuild onto the chain
|
||||
// We MUST skip the rebuild check here otherwise the rebuild will never happen on Linux
|
||||
// This is because the order of events and timing is different on Linux
|
||||
// @ts-ignore: TypeScript isn't picking up that content is a string here
|
||||
await recordChangedFile(filePath, ()=>content, true);
|
||||
} catch {
|
||||
// If reading the file fails, it's was probably a deleted temporary file
|
||||
// So we can ignore it and no rebuild is needed
|
||||
}
|
||||
}
|
||||
enqueue().then(()=>{
|
||||
// If the file read fails we still need to make sure the file isn't stuck in the pending rebuilds list
|
||||
pendingRebuilds.delete(filePath);
|
||||
});
|
||||
});
|
||||
return {
|
||||
fswatcher: watcher,
|
||||
refreshWatchedFiles () {
|
||||
watcher.add(Array.from(state.contextDependencies));
|
||||
watcher.add(Array.from(state.configBag.dependencies));
|
||||
watcher.add(state.contentPatterns.all);
|
||||
}
|
||||
};
|
||||
}
|
||||
63
CTOAsYouGo/node_modules/tailwindcss/lib/cli/colors.js
generated
vendored
Normal file
63
CTOAsYouGo/node_modules/tailwindcss/lib/cli/colors.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.bold = bold;
|
||||
exports.info = info;
|
||||
exports.error = error;
|
||||
exports.command = command;
|
||||
exports.file = file;
|
||||
|
||||
var _chalk = _interopRequireDefault(require("chalk"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Applies colors to emphasize
|
||||
*
|
||||
* @param {...string} msgs
|
||||
*/
|
||||
function bold(...msgs) {
|
||||
return _chalk.default.bold(...msgs);
|
||||
}
|
||||
/**
|
||||
* Applies colors to inform
|
||||
*
|
||||
* @param {...string} msgs
|
||||
*/
|
||||
|
||||
|
||||
function info(...msgs) {
|
||||
return _chalk.default.bold.cyan(...msgs);
|
||||
}
|
||||
/**
|
||||
* Applies colors to signify error
|
||||
*
|
||||
* @param {...string} msgs
|
||||
*/
|
||||
|
||||
|
||||
function error(...msgs) {
|
||||
return _chalk.default.bold.red(...msgs);
|
||||
}
|
||||
/**
|
||||
* Applies colors to represent a command
|
||||
*
|
||||
* @param {...string} msgs
|
||||
*/
|
||||
|
||||
|
||||
function command(...msgs) {
|
||||
return _chalk.default.bold.magenta(...msgs);
|
||||
}
|
||||
/**
|
||||
* Applies colors to represent a file
|
||||
*
|
||||
* @param {...string} msgs
|
||||
*/
|
||||
|
||||
|
||||
function file(...msgs) {
|
||||
return _chalk.default.bold.magenta(...msgs);
|
||||
}
|
||||
132
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/build.js
generated
vendored
Normal file
132
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/build.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.run = run;
|
||||
exports.optionMap = exports.options = exports.description = exports.usage = void 0;
|
||||
|
||||
var _autoprefixer = _interopRequireDefault(require("autoprefixer"));
|
||||
|
||||
var _bytes = _interopRequireDefault(require("bytes"));
|
||||
|
||||
var _prettyHrtime = _interopRequireDefault(require("pretty-hrtime"));
|
||||
|
||||
var _ = _interopRequireDefault(require("../.."));
|
||||
|
||||
var _compile = _interopRequireDefault(require("../compile"));
|
||||
|
||||
var colors = _interopRequireWildcard(require("../colors"));
|
||||
|
||||
var emoji = _interopRequireWildcard(require("../emoji"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("../utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const usage = 'build <file> [options]';
|
||||
exports.usage = usage;
|
||||
const description = 'Compiles Tailwind CSS file.';
|
||||
exports.description = description;
|
||||
const options = [{
|
||||
usage: '-o, --output <file>',
|
||||
description: 'Output file.'
|
||||
}, {
|
||||
usage: '-c, --config <file>',
|
||||
description: 'Tailwind config file.'
|
||||
}, {
|
||||
usage: '--no-autoprefixer',
|
||||
description: "Don't add vendor prefixes using autoprefixer."
|
||||
}];
|
||||
exports.options = options;
|
||||
const optionMap = {
|
||||
output: ['output', 'o'],
|
||||
config: ['config', 'c'],
|
||||
noAutoprefixer: ['no-autoprefixer']
|
||||
};
|
||||
/**
|
||||
* Prints the error message and stops the process.
|
||||
*
|
||||
* @param {...string} [msgs]
|
||||
*/
|
||||
|
||||
exports.optionMap = optionMap;
|
||||
|
||||
function stop(...msgs) {
|
||||
utils.header();
|
||||
utils.error(...msgs);
|
||||
utils.die();
|
||||
}
|
||||
/**
|
||||
* Compiles CSS file and writes it to stdout.
|
||||
*
|
||||
* @param {CompileOptions} compileOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
|
||||
function buildToStdout(compileOptions) {
|
||||
return (0, _compile.default)(compileOptions).then(result => process.stdout.write(result.css));
|
||||
}
|
||||
/**
|
||||
* Compiles CSS file and writes it to a file.
|
||||
*
|
||||
* @param {CompileOptions} compileOptions
|
||||
* @param {int[]} startTime
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
|
||||
function buildToFile(compileOptions, startTime) {
|
||||
const inputFileSimplePath = utils.getSimplePath(compileOptions.inputFile);
|
||||
const outputFileSimplePath = utils.getSimplePath(compileOptions.outputFile);
|
||||
utils.header();
|
||||
utils.log();
|
||||
utils.log(emoji.go, ...(inputFileSimplePath ? ['Building:', colors.file(inputFileSimplePath)] : ['Building from default CSS...', colors.info('(No input file provided)')]));
|
||||
return (0, _compile.default)(compileOptions).then(result => {
|
||||
utils.writeFile(compileOptions.outputFile, result.css);
|
||||
const prettyTime = (0, _prettyHrtime.default)(process.hrtime(startTime));
|
||||
utils.log();
|
||||
utils.log(emoji.yes, 'Finished in', colors.info(prettyTime));
|
||||
utils.log(emoji.pack, 'Size:', colors.info((0, _bytes.default)(result.css.length)));
|
||||
utils.log(emoji.disk, 'Saved to', colors.file(outputFileSimplePath));
|
||||
utils.footer();
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Runs the command.
|
||||
*
|
||||
* @param {string[]} cliParams
|
||||
* @param {object} cliOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
|
||||
function run(cliParams, cliOptions) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const startTime = process.hrtime();
|
||||
const inputFile = cliParams[0];
|
||||
const configFile = cliOptions.config && cliOptions.config[0];
|
||||
const outputFile = cliOptions.output && cliOptions.output[0];
|
||||
const autoprefix = !cliOptions.noAutoprefixer;
|
||||
const inputFileSimplePath = utils.getSimplePath(inputFile);
|
||||
const configFileSimplePath = utils.getSimplePath(configFile);
|
||||
|
||||
if (inputFile) {
|
||||
!utils.exists(inputFile) && stop(colors.file(inputFileSimplePath), 'does not exist.');
|
||||
}
|
||||
|
||||
configFile && !utils.exists(configFile) && stop(colors.file(configFileSimplePath), 'does not exist.');
|
||||
const compileOptions = {
|
||||
inputFile,
|
||||
outputFile,
|
||||
plugins: [(0, _.default)(configFile)].concat(autoprefix ? [_autoprefixer.default] : [])
|
||||
};
|
||||
const buildPromise = outputFile ? buildToFile(compileOptions, startTime) : buildToStdout(compileOptions);
|
||||
buildPromise.then(resolve).catch(reject);
|
||||
});
|
||||
}
|
||||
103
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/help.js
generated
vendored
Normal file
103
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/help.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.forApp = forApp;
|
||||
exports.forCommand = forCommand;
|
||||
exports.invalidCommand = invalidCommand;
|
||||
exports.run = run;
|
||||
exports.description = exports.usage = void 0;
|
||||
|
||||
var _lodash = require("lodash");
|
||||
|
||||
var _ = _interopRequireDefault(require("."));
|
||||
|
||||
var constants = _interopRequireWildcard(require("../../constants"));
|
||||
|
||||
var colors = _interopRequireWildcard(require("../colors"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("../utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const usage = 'help [command]';
|
||||
exports.usage = usage;
|
||||
const description = 'More information about the command.';
|
||||
exports.description = description;
|
||||
const PADDING_SIZE = 3;
|
||||
/**
|
||||
* Prints general help.
|
||||
*/
|
||||
|
||||
function forApp() {
|
||||
const pad = Math.max(...(0, _lodash.map)(_.default, 'usage.length')) + PADDING_SIZE;
|
||||
utils.log();
|
||||
utils.log('Usage:');
|
||||
utils.log(' ', colors.bold(constants.cli + ' <command> [options]'));
|
||||
utils.log();
|
||||
utils.log('Commands:');
|
||||
(0, _lodash.forEach)(_.default, command => {
|
||||
utils.log(' ', colors.bold((0, _lodash.padEnd)(command.usage, pad)), command.description);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Prints help for a command.
|
||||
*
|
||||
* @param {object} command
|
||||
*/
|
||||
|
||||
|
||||
function forCommand(command) {
|
||||
utils.log();
|
||||
utils.log('Usage:');
|
||||
utils.log(' ', colors.bold(constants.cli, command.usage));
|
||||
utils.log();
|
||||
utils.log('Description:');
|
||||
utils.log(' ', colors.bold(command.description));
|
||||
|
||||
if (command.options) {
|
||||
const pad = Math.max(...(0, _lodash.map)(command.options, 'usage.length')) + PADDING_SIZE;
|
||||
utils.log();
|
||||
utils.log('Options:');
|
||||
(0, _lodash.forEach)(command.options, option => {
|
||||
utils.log(' ', colors.bold((0, _lodash.padEnd)(option.usage, pad)), option.description);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Prints invalid command error and general help. Kills the process.
|
||||
*
|
||||
* @param {string} commandName
|
||||
*/
|
||||
|
||||
|
||||
function invalidCommand(commandName) {
|
||||
utils.error('Invalid command:', colors.command(commandName));
|
||||
forApp();
|
||||
utils.die();
|
||||
}
|
||||
/**
|
||||
* Runs the command.
|
||||
*
|
||||
* @param {string[]} cliParams
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
|
||||
function run(cliParams) {
|
||||
return new Promise(resolve => {
|
||||
utils.header();
|
||||
const commandName = cliParams[0];
|
||||
const command = _.default[commandName];
|
||||
!commandName && forApp();
|
||||
commandName && command && forCommand(command);
|
||||
commandName && !command && invalidCommand(commandName);
|
||||
utils.footer();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
23
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/index.js
generated
vendored
Normal file
23
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var help = _interopRequireWildcard(require("./help"));
|
||||
|
||||
var init = _interopRequireWildcard(require("./init"));
|
||||
|
||||
var build = _interopRequireWildcard(require("./build"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
var _default = {
|
||||
help,
|
||||
init,
|
||||
build
|
||||
};
|
||||
exports.default = _default;
|
||||
69
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/init.js
generated
vendored
Normal file
69
CTOAsYouGo/node_modules/tailwindcss/lib/cli/commands/init.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.run = run;
|
||||
exports.optionMap = exports.options = exports.description = exports.usage = void 0;
|
||||
|
||||
var constants = _interopRequireWildcard(require("../../constants"));
|
||||
|
||||
var colors = _interopRequireWildcard(require("../colors"));
|
||||
|
||||
var emoji = _interopRequireWildcard(require("../emoji"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("../utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const usage = 'init [file]';
|
||||
exports.usage = usage;
|
||||
const description = 'Creates Tailwind config file. Default: ' + colors.file(utils.getSimplePath(constants.defaultConfigFile));
|
||||
exports.description = description;
|
||||
const options = [{
|
||||
usage: '--full',
|
||||
description: 'Generate complete configuration file.'
|
||||
}, {
|
||||
usage: '-p',
|
||||
description: 'Generate postcss.config.js file.'
|
||||
}];
|
||||
exports.options = options;
|
||||
const optionMap = {
|
||||
full: ['full'],
|
||||
postcss: ['p']
|
||||
};
|
||||
/**
|
||||
* Runs the command.
|
||||
*
|
||||
* @param {string[]} cliParams
|
||||
* @param {object} cliOptions
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
exports.optionMap = optionMap;
|
||||
|
||||
function run(cliParams, cliOptions) {
|
||||
return new Promise(resolve => {
|
||||
utils.header();
|
||||
const full = cliOptions.full;
|
||||
const file = cliParams[0] || constants.defaultConfigFile;
|
||||
const simplePath = utils.getSimplePath(file);
|
||||
utils.exists(file) && utils.die(colors.file(simplePath), 'already exists.');
|
||||
const stubFile = full ? constants.defaultConfigStubFile : constants.simpleConfigStubFile;
|
||||
utils.copyFile(stubFile, file);
|
||||
utils.log();
|
||||
utils.log(emoji.yes, 'Created Tailwind config file:', colors.file(simplePath));
|
||||
|
||||
if (cliOptions.postcss) {
|
||||
const path = utils.getSimplePath(constants.defaultPostCssConfigFile);
|
||||
utils.exists(constants.defaultPostCssConfigFile) && utils.die(colors.file(path), 'already exists.');
|
||||
utils.copyFile(constants.defaultPostCssConfigStubFile, constants.defaultPostCssConfigFile);
|
||||
utils.log(emoji.yes, 'Created PostCSS config file:', colors.file(path));
|
||||
}
|
||||
|
||||
utils.footer();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
53
CTOAsYouGo/node_modules/tailwindcss/lib/cli/compile.js
generated
vendored
Normal file
53
CTOAsYouGo/node_modules/tailwindcss/lib/cli/compile.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = compile;
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Compiler options
|
||||
*
|
||||
* @typedef {Object} CompileOptions
|
||||
* @property {string} inputFile
|
||||
* @property {string} outputFile
|
||||
* @property {array} plugins
|
||||
*/
|
||||
const defaultOptions = {
|
||||
inputFile: null,
|
||||
outputFile: null,
|
||||
plugins: []
|
||||
};
|
||||
/**
|
||||
* Compiles CSS file.
|
||||
*
|
||||
* @param {CompileOptions} options
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
||||
function compile(options = {}) {
|
||||
const config = { ...defaultOptions,
|
||||
...options
|
||||
};
|
||||
const css = config.inputFile ? utils.readFile(config.inputFile) : `
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
`;
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, _postcss.default)(config.plugins).process(css, {
|
||||
from: config.inputFile,
|
||||
to: config.outputFile
|
||||
}).then(resolve).catch(reject);
|
||||
});
|
||||
}
|
||||
21
CTOAsYouGo/node_modules/tailwindcss/lib/cli/emoji.js
generated
vendored
Normal file
21
CTOAsYouGo/node_modules/tailwindcss/lib/cli/emoji.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.warning = exports.disk = exports.pack = exports.go = exports.no = exports.yes = void 0;
|
||||
|
||||
var _nodeEmoji = require("node-emoji");
|
||||
|
||||
const yes = (0, _nodeEmoji.get)('white_check_mark');
|
||||
exports.yes = yes;
|
||||
const no = (0, _nodeEmoji.get)('no_entry_sign');
|
||||
exports.no = no;
|
||||
const go = (0, _nodeEmoji.get)('rocket');
|
||||
exports.go = go;
|
||||
const pack = (0, _nodeEmoji.get)('package');
|
||||
exports.pack = pack;
|
||||
const disk = (0, _nodeEmoji.get)('floppy_disk');
|
||||
exports.disk = disk;
|
||||
const warning = (0, _nodeEmoji.get)('warning');
|
||||
exports.warning = warning;
|
||||
73
CTOAsYouGo/node_modules/tailwindcss/lib/cli/help/index.js
generated
vendored
73
CTOAsYouGo/node_modules/tailwindcss/lib/cli/help/index.js
generated
vendored
@@ -1,73 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "help", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return help;
|
||||
}
|
||||
});
|
||||
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../package.json"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function help({ message , usage , commands , options }) {
|
||||
let indent = 2;
|
||||
// Render header
|
||||
console.log();
|
||||
console.log(`${_packagejson.default.name} v${_packagejson.default.version}`);
|
||||
// Render message
|
||||
if (message) {
|
||||
console.log();
|
||||
for (let msg of message.split("\n")){
|
||||
console.log(msg);
|
||||
}
|
||||
}
|
||||
// Render usage
|
||||
if (usage && usage.length > 0) {
|
||||
console.log();
|
||||
console.log("Usage:");
|
||||
for (let example of usage){
|
||||
console.log(" ".repeat(indent), example);
|
||||
}
|
||||
}
|
||||
// Render commands
|
||||
if (commands && commands.length > 0) {
|
||||
console.log();
|
||||
console.log("Commands:");
|
||||
for (let command of commands){
|
||||
console.log(" ".repeat(indent), command);
|
||||
}
|
||||
}
|
||||
// Render options
|
||||
if (options) {
|
||||
let groupedOptions = {};
|
||||
for (let [key, value] of Object.entries(options)){
|
||||
if (typeof value === "object") {
|
||||
groupedOptions[key] = {
|
||||
...value,
|
||||
flags: [
|
||||
key
|
||||
]
|
||||
};
|
||||
} else {
|
||||
groupedOptions[value].flags.push(key);
|
||||
}
|
||||
}
|
||||
console.log();
|
||||
console.log("Options:");
|
||||
for (let { flags , description , deprecated } of Object.values(groupedOptions)){
|
||||
if (deprecated) continue;
|
||||
if (flags.length === 1) {
|
||||
console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
|
||||
} else {
|
||||
console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log();
|
||||
}
|
||||
230
CTOAsYouGo/node_modules/tailwindcss/lib/cli/index.js
generated
vendored
230
CTOAsYouGo/node_modules/tailwindcss/lib/cli/index.js
generated
vendored
@@ -1,230 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _arg = /*#__PURE__*/ _interop_require_default(require("arg"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _build = require("./build");
|
||||
const _help = require("./help");
|
||||
const _init = require("./init");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function oneOf(...options) {
|
||||
return Object.assign((value = true)=>{
|
||||
for (let option of options){
|
||||
let parsed = option(value);
|
||||
if (parsed === value) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
throw new Error("...");
|
||||
}, {
|
||||
manualParsing: true
|
||||
});
|
||||
}
|
||||
let commands = {
|
||||
init: {
|
||||
run: _init.init,
|
||||
args: {
|
||||
"--esm": {
|
||||
type: Boolean,
|
||||
description: `Initialize configuration file as ESM`
|
||||
},
|
||||
"--ts": {
|
||||
type: Boolean,
|
||||
description: `Initialize configuration file as TypeScript`
|
||||
},
|
||||
"--postcss": {
|
||||
type: Boolean,
|
||||
description: `Initialize a \`postcss.config.js\` file`
|
||||
},
|
||||
"--full": {
|
||||
type: Boolean,
|
||||
description: `Include the default values for all options in the generated configuration file`
|
||||
},
|
||||
"-f": "--full",
|
||||
"-p": "--postcss"
|
||||
}
|
||||
},
|
||||
build: {
|
||||
run: _build.build,
|
||||
args: {
|
||||
"--input": {
|
||||
type: String,
|
||||
description: "Input file"
|
||||
},
|
||||
"--output": {
|
||||
type: String,
|
||||
description: "Output file"
|
||||
},
|
||||
"--watch": {
|
||||
type: oneOf(String, Boolean),
|
||||
description: "Watch for changes and rebuild as needed"
|
||||
},
|
||||
"--poll": {
|
||||
type: Boolean,
|
||||
description: "Use polling instead of filesystem events when watching"
|
||||
},
|
||||
"--content": {
|
||||
type: String,
|
||||
description: "Content paths to use for removing unused classes"
|
||||
},
|
||||
"--purge": {
|
||||
type: String,
|
||||
deprecated: true
|
||||
},
|
||||
"--postcss": {
|
||||
type: oneOf(String, Boolean),
|
||||
description: "Load custom PostCSS configuration"
|
||||
},
|
||||
"--minify": {
|
||||
type: Boolean,
|
||||
description: "Minify the output"
|
||||
},
|
||||
"--config": {
|
||||
type: String,
|
||||
description: "Path to a custom config file"
|
||||
},
|
||||
"--no-autoprefixer": {
|
||||
type: Boolean,
|
||||
description: "Disable autoprefixer"
|
||||
},
|
||||
"-c": "--config",
|
||||
"-i": "--input",
|
||||
"-o": "--output",
|
||||
"-m": "--minify",
|
||||
"-w": "--watch",
|
||||
"-p": "--poll"
|
||||
}
|
||||
}
|
||||
};
|
||||
let sharedFlags = {
|
||||
"--help": {
|
||||
type: Boolean,
|
||||
description: "Display usage information"
|
||||
},
|
||||
"-h": "--help"
|
||||
};
|
||||
if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
|
||||
(0, _help.help)({
|
||||
usage: [
|
||||
"tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
|
||||
"tailwindcss init [--full] [--postcss] [options...]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: {
|
||||
...commands.build.args,
|
||||
...sharedFlags
|
||||
}
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
|
||||
if (commands[command] === undefined) {
|
||||
if (_fs.default.existsSync(_path.default.resolve(command))) {
|
||||
// TODO: Deprecate this in future versions
|
||||
// Check if non-existing command, might be a file.
|
||||
command = "build";
|
||||
} else {
|
||||
(0, _help.help)({
|
||||
message: `Invalid command: ${command}`,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// Execute command
|
||||
let { args: flags , run } = commands[command];
|
||||
let args = (()=>{
|
||||
try {
|
||||
let result = (0, _arg.default)(Object.fromEntries(Object.entries({
|
||||
...flags,
|
||||
...sharedFlags
|
||||
}).filter(([_key, value])=>{
|
||||
var _value_type;
|
||||
return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
|
||||
}).map(([key, value])=>[
|
||||
key,
|
||||
typeof value === "object" ? value.type : value
|
||||
])), {
|
||||
permissive: true
|
||||
});
|
||||
// Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
|
||||
for(let i = result["_"].length - 1; i >= 0; --i){
|
||||
let flag = result["_"][i];
|
||||
if (!flag.startsWith("-")) continue;
|
||||
let [flagName, flagValue] = flag.split("=");
|
||||
let handler = flags[flagName];
|
||||
// Resolve flagName & handler
|
||||
while(typeof handler === "string"){
|
||||
flagName = handler;
|
||||
handler = flags[handler];
|
||||
}
|
||||
if (!handler) continue;
|
||||
let args = [];
|
||||
let offset = i + 1;
|
||||
// --flag value syntax was used so we need to pull `value` from `args`
|
||||
if (flagValue === undefined) {
|
||||
// Parse args for current flag
|
||||
while(result["_"][offset] && !result["_"][offset].startsWith("-")){
|
||||
args.push(result["_"][offset++]);
|
||||
}
|
||||
// Cleanup manually parsed flags + args
|
||||
result["_"].splice(i, 1 + args.length);
|
||||
// No args were provided, use default value defined in handler
|
||||
// One arg was provided, use that directly
|
||||
// Multiple args were provided so pass them all in an array
|
||||
flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args;
|
||||
} else {
|
||||
// Remove the whole flag from the args array
|
||||
result["_"].splice(i, 1);
|
||||
}
|
||||
// Set the resolved value in the `result` object
|
||||
result[flagName] = handler.type(flagValue, flagName);
|
||||
}
|
||||
// Ensure that the `command` is always the first argument in the `args`.
|
||||
// This is important so that we don't have to check if a default command
|
||||
// (build) was used or not from within each plugin.
|
||||
//
|
||||
// E.g.: tailwindcss input.css -> _: ['build', 'input.css']
|
||||
// E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
|
||||
if (result["_"][0] !== command) {
|
||||
result["_"].unshift(command);
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
if (err.code === "ARG_UNKNOWN_OPTION") {
|
||||
(0, _help.help)({
|
||||
message: err.message,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
})();
|
||||
if (args["--help"]) {
|
||||
(0, _help.help)({
|
||||
options: {
|
||||
...flags,
|
||||
...sharedFlags
|
||||
},
|
||||
usage: [
|
||||
`tailwindcss ${command} [options]`
|
||||
]
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
run(args);
|
||||
63
CTOAsYouGo/node_modules/tailwindcss/lib/cli/init/index.js
generated
vendored
63
CTOAsYouGo/node_modules/tailwindcss/lib/cli/init/index.js
generated
vendored
@@ -1,63 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "init", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return init;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isESM() {
|
||||
const pkgPath = _path.default.resolve("./package.json");
|
||||
try {
|
||||
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
||||
return pkg.type && pkg.type === "module";
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function init(args) {
|
||||
let messages = [];
|
||||
let isProjectESM = args["--ts"] || args["--esm"] || isESM();
|
||||
let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
|
||||
let extension = args["--ts"] ? "ts" : "js";
|
||||
var _args___;
|
||||
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
|
||||
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
||||
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
||||
} else {
|
||||
let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../stubs/config.simple.js"), "utf8");
|
||||
let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), "utf8");
|
||||
// Change colors import
|
||||
stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
|
||||
// Replace contents of {ts,js,cjs} file with the stub {simple,full}.
|
||||
stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
|
||||
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
||||
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
||||
}
|
||||
if (args["--postcss"]) {
|
||||
let postcssConfigLocation = _path.default.resolve("./postcss.config.js");
|
||||
if (_fs.default.existsSync(postcssConfigLocation)) {
|
||||
messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
|
||||
} else {
|
||||
let stubFile = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, "../../../stubs/postcss.config.js") : _path.default.resolve(__dirname, "../../../stubs/postcss.config.cjs"), "utf8");
|
||||
_fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8");
|
||||
messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`);
|
||||
}
|
||||
}
|
||||
if (messages.length > 0) {
|
||||
console.log();
|
||||
for (let message of messages){
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
CTOAsYouGo/node_modules/tailwindcss/lib/cli/main.js
generated
vendored
Normal file
32
CTOAsYouGo/node_modules/tailwindcss/lib/cli/main.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = run;
|
||||
|
||||
var _commands = _interopRequireDefault(require("./commands"));
|
||||
|
||||
var utils = _interopRequireWildcard(require("./utils"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* CLI application entrypoint.
|
||||
*
|
||||
* @param {string[]} cliArgs
|
||||
* @return {Promise}
|
||||
*/
|
||||
function run(cliArgs) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const params = utils.parseCliParams(cliArgs);
|
||||
const command = _commands.default[params[0]];
|
||||
const options = command ? utils.parseCliOptions(cliArgs, command.optionMap) : {};
|
||||
const commandPromise = command ? command.run(params.slice(1), options) : _commands.default.help.run(params);
|
||||
commandPromise.then(resolve).catch(reject);
|
||||
});
|
||||
}
|
||||
179
CTOAsYouGo/node_modules/tailwindcss/lib/cli/utils.js
generated
vendored
Normal file
179
CTOAsYouGo/node_modules/tailwindcss/lib/cli/utils.js
generated
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseCliParams = parseCliParams;
|
||||
exports.parseCliOptions = parseCliOptions;
|
||||
exports.log = log;
|
||||
exports.header = header;
|
||||
exports.footer = footer;
|
||||
exports.error = error;
|
||||
exports.die = die;
|
||||
exports.exists = exists;
|
||||
exports.copyFile = copyFile;
|
||||
exports.readFile = readFile;
|
||||
exports.writeFile = writeFile;
|
||||
exports.getSimplePath = getSimplePath;
|
||||
|
||||
var _fsExtra = require("fs-extra");
|
||||
|
||||
var _lodash = require("lodash");
|
||||
|
||||
var colors = _interopRequireWildcard(require("./colors"));
|
||||
|
||||
var emoji = _interopRequireWildcard(require("./emoji"));
|
||||
|
||||
var _package = _interopRequireDefault(require("../../package.json"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Gets CLI parameters.
|
||||
*
|
||||
* @param {string[]} cliArgs
|
||||
* @return {string[]}
|
||||
*/
|
||||
function parseCliParams(cliArgs) {
|
||||
const firstOptionIndex = cliArgs.findIndex(cliArg => cliArg.startsWith('-'));
|
||||
return firstOptionIndex > -1 ? cliArgs.slice(0, firstOptionIndex) : cliArgs;
|
||||
}
|
||||
/**
|
||||
* Gets mapped CLI options.
|
||||
*
|
||||
* @param {string[]} cliArgs
|
||||
* @param {object} [optionMap]
|
||||
* @return {object}
|
||||
*/
|
||||
|
||||
|
||||
function parseCliOptions(cliArgs, optionMap = {}) {
|
||||
let options = {};
|
||||
let currentOption = [];
|
||||
cliArgs.forEach(cliArg => {
|
||||
const option = cliArg.startsWith('-') && (0, _lodash.trimStart)(cliArg, '-').toLowerCase();
|
||||
const resolvedOption = (0, _lodash.findKey)(optionMap, aliases => aliases.includes(option));
|
||||
|
||||
if (resolvedOption) {
|
||||
currentOption = options[resolvedOption] || (options[resolvedOption] = []);
|
||||
} else if (option) {
|
||||
currentOption = [];
|
||||
} else {
|
||||
currentOption.push(cliArg);
|
||||
}
|
||||
});
|
||||
return { ...(0, _lodash.mapValues)(optionMap, () => undefined),
|
||||
...options
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Prints messages to console.
|
||||
*
|
||||
* @param {...string} [msgs]
|
||||
*/
|
||||
|
||||
|
||||
function log(...msgs) {
|
||||
console.log(' ', ...msgs);
|
||||
}
|
||||
/**
|
||||
* Prints application header to console.
|
||||
*/
|
||||
|
||||
|
||||
function header() {
|
||||
log();
|
||||
log(colors.bold(_package.default.name), colors.info(_package.default.version));
|
||||
}
|
||||
/**
|
||||
* Prints application footer to console.
|
||||
*/
|
||||
|
||||
|
||||
function footer() {
|
||||
log();
|
||||
}
|
||||
/**
|
||||
* Prints error messages to console.
|
||||
*
|
||||
* @param {...string} [msgs]
|
||||
*/
|
||||
|
||||
|
||||
function error(...msgs) {
|
||||
log();
|
||||
console.error(' ', emoji.no, colors.error(msgs.join(' ')));
|
||||
}
|
||||
/**
|
||||
* Kills the process. Optionally prints error messages to console.
|
||||
*
|
||||
* @param {...string} [msgs]
|
||||
*/
|
||||
|
||||
|
||||
function die(...msgs) {
|
||||
msgs.length && error(...msgs);
|
||||
footer();
|
||||
process.exit(1); // eslint-disable-line
|
||||
}
|
||||
/**
|
||||
* Checks if path exists.
|
||||
*
|
||||
* @param {string} path
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
function exists(path) {
|
||||
return (0, _fsExtra.existsSync)(path);
|
||||
}
|
||||
/**
|
||||
* Copies file source to destination.
|
||||
*
|
||||
* @param {string} source
|
||||
* @param {string} destination
|
||||
*/
|
||||
|
||||
|
||||
function copyFile(source, destination) {
|
||||
(0, _fsExtra.copyFileSync)(source, destination);
|
||||
}
|
||||
/**
|
||||
* Gets file content.
|
||||
*
|
||||
* @param {string} path
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
|
||||
function readFile(path) {
|
||||
return (0, _fsExtra.readFileSync)(path, 'utf-8');
|
||||
}
|
||||
/**
|
||||
* Writes content to file.
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string} content
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
|
||||
function writeFile(path, content) {
|
||||
(0, _fsExtra.ensureFileSync)(path);
|
||||
return (0, _fsExtra.outputFileSync)(path, content);
|
||||
}
|
||||
/**
|
||||
* Strips leading ./ from path
|
||||
*
|
||||
* @param {string} path
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
|
||||
function getSimplePath(path) {
|
||||
return (0, _lodash.startsWith)(path, './') ? path.slice(2) : path;
|
||||
}
|
||||
29
CTOAsYouGo/node_modules/tailwindcss/lib/constants.js
generated
vendored
Normal file
29
CTOAsYouGo/node_modules/tailwindcss/lib/constants.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.defaultPostCssConfigStubFile = exports.simpleConfigStubFile = exports.defaultConfigStubFile = exports.defaultPostCssConfigFile = exports.defaultConfigFile = exports.cli = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const cli = 'tailwind';
|
||||
exports.cli = cli;
|
||||
const defaultConfigFile = './tailwind.config.js';
|
||||
exports.defaultConfigFile = defaultConfigFile;
|
||||
const defaultPostCssConfigFile = './postcss.config.js';
|
||||
exports.defaultPostCssConfigFile = defaultPostCssConfigFile;
|
||||
|
||||
const defaultConfigStubFile = _path.default.resolve(__dirname, '../stubs/defaultConfig.stub.js');
|
||||
|
||||
exports.defaultConfigStubFile = defaultConfigStubFile;
|
||||
|
||||
const simpleConfigStubFile = _path.default.resolve(__dirname, '../stubs/simpleConfig.stub.js');
|
||||
|
||||
exports.simpleConfigStubFile = simpleConfigStubFile;
|
||||
|
||||
const defaultPostCssConfigStubFile = _path.default.resolve(__dirname, '../stubs/defaultPostCssConfig.stub.js');
|
||||
|
||||
exports.defaultPostCssConfigStubFile = defaultPostCssConfigStubFile;
|
||||
189
CTOAsYouGo/node_modules/tailwindcss/lib/corePluginList.js
generated
vendored
189
CTOAsYouGo/node_modules/tailwindcss/lib/corePluginList.js
generated
vendored
@@ -1,187 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _default = [
|
||||
"preflight",
|
||||
"container",
|
||||
"accessibility",
|
||||
"pointerEvents",
|
||||
"visibility",
|
||||
"position",
|
||||
"inset",
|
||||
"isolation",
|
||||
"zIndex",
|
||||
"order",
|
||||
"gridColumn",
|
||||
"gridColumnStart",
|
||||
"gridColumnEnd",
|
||||
"gridRow",
|
||||
"gridRowStart",
|
||||
"gridRowEnd",
|
||||
"float",
|
||||
"clear",
|
||||
"margin",
|
||||
"boxSizing",
|
||||
"lineClamp",
|
||||
"display",
|
||||
"aspectRatio",
|
||||
"height",
|
||||
"maxHeight",
|
||||
"minHeight",
|
||||
"width",
|
||||
"minWidth",
|
||||
"maxWidth",
|
||||
"flex",
|
||||
"flexShrink",
|
||||
"flexGrow",
|
||||
"flexBasis",
|
||||
"tableLayout",
|
||||
"captionSide",
|
||||
"borderCollapse",
|
||||
"borderSpacing",
|
||||
"transformOrigin",
|
||||
"translate",
|
||||
"rotate",
|
||||
"skew",
|
||||
"scale",
|
||||
"transform",
|
||||
"animation",
|
||||
"cursor",
|
||||
"touchAction",
|
||||
"userSelect",
|
||||
"resize",
|
||||
"scrollSnapType",
|
||||
"scrollSnapAlign",
|
||||
"scrollSnapStop",
|
||||
"scrollMargin",
|
||||
"scrollPadding",
|
||||
"listStylePosition",
|
||||
"listStyleType",
|
||||
"listStyleImage",
|
||||
"appearance",
|
||||
"columns",
|
||||
"breakBefore",
|
||||
"breakInside",
|
||||
"breakAfter",
|
||||
"gridAutoColumns",
|
||||
"gridAutoFlow",
|
||||
"gridAutoRows",
|
||||
"gridTemplateColumns",
|
||||
"gridTemplateRows",
|
||||
"flexDirection",
|
||||
"flexWrap",
|
||||
"placeContent",
|
||||
"placeItems",
|
||||
"alignContent",
|
||||
"alignItems",
|
||||
"justifyContent",
|
||||
"justifyItems",
|
||||
"gap",
|
||||
"space",
|
||||
"divideWidth",
|
||||
"divideStyle",
|
||||
"divideColor",
|
||||
"divideOpacity",
|
||||
"placeSelf",
|
||||
"alignSelf",
|
||||
"justifySelf",
|
||||
"overflow",
|
||||
"overscrollBehavior",
|
||||
"scrollBehavior",
|
||||
"textOverflow",
|
||||
"hyphens",
|
||||
"whitespace",
|
||||
"wordBreak",
|
||||
"borderRadius",
|
||||
"borderWidth",
|
||||
"borderStyle",
|
||||
"borderColor",
|
||||
"borderOpacity",
|
||||
"backgroundColor",
|
||||
"backgroundOpacity",
|
||||
"backgroundImage",
|
||||
"gradientColorStops",
|
||||
"boxDecorationBreak",
|
||||
"backgroundSize",
|
||||
"backgroundAttachment",
|
||||
"backgroundClip",
|
||||
"backgroundPosition",
|
||||
"backgroundRepeat",
|
||||
"backgroundOrigin",
|
||||
"fill",
|
||||
"stroke",
|
||||
"strokeWidth",
|
||||
"objectFit",
|
||||
"objectPosition",
|
||||
"padding",
|
||||
"textAlign",
|
||||
"textIndent",
|
||||
"verticalAlign",
|
||||
"fontFamily",
|
||||
"fontSize",
|
||||
"fontWeight",
|
||||
"textTransform",
|
||||
"fontStyle",
|
||||
"fontVariantNumeric",
|
||||
"lineHeight",
|
||||
"letterSpacing",
|
||||
"textColor",
|
||||
"textOpacity",
|
||||
"textDecoration",
|
||||
"textDecorationColor",
|
||||
"textDecorationStyle",
|
||||
"textDecorationThickness",
|
||||
"textUnderlineOffset",
|
||||
"fontSmoothing",
|
||||
"placeholderColor",
|
||||
"placeholderOpacity",
|
||||
"caretColor",
|
||||
"accentColor",
|
||||
"opacity",
|
||||
"backgroundBlendMode",
|
||||
"mixBlendMode",
|
||||
"boxShadow",
|
||||
"boxShadowColor",
|
||||
"outlineStyle",
|
||||
"outlineWidth",
|
||||
"outlineOffset",
|
||||
"outlineColor",
|
||||
"ringWidth",
|
||||
"ringColor",
|
||||
"ringOpacity",
|
||||
"ringOffsetWidth",
|
||||
"ringOffsetColor",
|
||||
"blur",
|
||||
"brightness",
|
||||
"contrast",
|
||||
"dropShadow",
|
||||
"grayscale",
|
||||
"hueRotate",
|
||||
"invert",
|
||||
"saturate",
|
||||
"sepia",
|
||||
"filter",
|
||||
"backdropBlur",
|
||||
"backdropBrightness",
|
||||
"backdropContrast",
|
||||
"backdropGrayscale",
|
||||
"backdropHueRotate",
|
||||
"backdropInvert",
|
||||
"backdropOpacity",
|
||||
"backdropSaturate",
|
||||
"backdropSepia",
|
||||
"backdropFilter",
|
||||
"transitionProperty",
|
||||
"transitionDelay",
|
||||
"transitionDuration",
|
||||
"transitionTimingFunction",
|
||||
"willChange",
|
||||
"content"
|
||||
];
|
||||
exports.corePluginList = void 0;
|
||||
const corePluginList = ['preflight', 'container', 'space', 'divideWidth', 'divideColor', 'divideStyle', 'divideOpacity', 'accessibility', 'appearance', 'backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'gradientColorStops', 'backgroundOpacity', 'backgroundPosition', 'backgroundRepeat', 'backgroundSize', 'borderCollapse', 'borderColor', 'borderOpacity', 'borderRadius', 'borderStyle', 'borderWidth', 'boxSizing', 'cursor', 'display', 'flexDirection', 'flexWrap', 'placeItems', 'placeContent', 'placeSelf', 'alignItems', 'alignContent', 'alignSelf', 'justifyItems', 'justifyContent', 'justifySelf', 'flex', 'flexGrow', 'flexShrink', 'order', 'float', 'clear', 'fontFamily', 'fontWeight', 'height', 'fontSize', 'lineHeight', 'listStylePosition', 'listStyleType', 'margin', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'objectFit', 'objectPosition', 'opacity', 'outline', 'overflow', 'overscrollBehavior', 'padding', 'placeholderColor', 'placeholderOpacity', 'pointerEvents', 'position', 'inset', 'resize', 'boxShadow', 'fill', 'stroke', 'strokeWidth', 'tableLayout', 'textAlign', 'textColor', 'textOpacity', 'fontStyle', 'textTransform', 'textDecoration', 'fontSmoothing', 'fontVariantNumeric', 'letterSpacing', 'userSelect', 'verticalAlign', 'visibility', 'whitespace', 'wordBreak', 'width', 'zIndex', 'gap', 'gridAutoFlow', 'gridTemplateColumns', 'gridAutoColumns', 'gridColumn', 'gridColumnStart', 'gridColumnEnd', 'gridTemplateRows', 'gridAutoRows', 'gridRow', 'gridRowStart', 'gridRowEnd', 'transform', 'transformOrigin', 'scale', 'rotate', 'translate', 'skew', 'transitionProperty', 'transitionTimingFunction', 'transitionDuration', 'transitionDelay', 'animation'];
|
||||
exports.corePluginList = corePluginList;
|
||||
4193
CTOAsYouGo/node_modules/tailwindcss/lib/corePlugins.js
generated
vendored
4193
CTOAsYouGo/node_modules/tailwindcss/lib/corePlugins.js
generated
vendored
File diff suppressed because it is too large
Load Diff
25
CTOAsYouGo/node_modules/tailwindcss/lib/css/LICENSE
generated
vendored
25
CTOAsYouGo/node_modules/tailwindcss/lib/css/LICENSE
generated
vendored
@@ -1,25 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Nicolas Gallagher
|
||||
Copyright (c) Jonathan Neal
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Adam Wathan
|
||||
Copyright (c) Jonathan Reinink
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
369
CTOAsYouGo/node_modules/tailwindcss/lib/css/preflight.css
generated
vendored
369
CTOAsYouGo/node_modules/tailwindcss/lib/css/preflight.css
generated
vendored
@@ -1,369 +0,0 @@
|
||||
/*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box; /* 1 */
|
||||
border-width: 0; /* 2 */
|
||||
border-style: solid; /* 2 */
|
||||
border-color: theme('borderColor.DEFAULT', currentColor); /* 2 */
|
||||
}
|
||||
|
||||
::before,
|
||||
::after {
|
||||
--tw-content: '';
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use a consistent sensible line-height in all browsers.
|
||||
2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
3. Use a more readable tab size.
|
||||
4. Use the user's configured `sans` font-family by default.
|
||||
5. Use the user's configured `sans` font-feature-settings by default.
|
||||
6. Use the user's configured `sans` font-variation-settings by default.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.5; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-moz-tab-size: 4; /* 3 */
|
||||
tab-size: 4; /* 3 */
|
||||
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
|
||||
font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
|
||||
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove the margin in all browsers.
|
||||
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0; /* 1 */
|
||||
line-height: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Add the correct height in Firefox.
|
||||
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
||||
3. Ensure horizontal rules are visible by default.
|
||||
*/
|
||||
|
||||
hr {
|
||||
height: 0; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
border-top-width: 1px; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr:where([title]) {
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the default font size and weight for headings.
|
||||
*/
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset links to optimize for opt-in styling instead of opt-out.
|
||||
*/
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font weight in Edge and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use the user's configured `mono` font family by default.
|
||||
2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
||||
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
3. Remove gaps between table borders by default.
|
||||
*/
|
||||
|
||||
table {
|
||||
text-indent: 0; /* 1 */
|
||||
border-color: inherit; /* 2 */
|
||||
border-collapse: collapse; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
3. Remove default padding in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
font-weight: inherit; /* 1 */
|
||||
line-height: inherit; /* 1 */
|
||||
color: inherit; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
padding: 0; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inheritance of text transform in Edge and Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Remove default button styles.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
background-color: transparent; /* 2 */
|
||||
background-image: none; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Use the modern Firefox focus style for all focusable elements.
|
||||
*/
|
||||
|
||||
:-moz-focusring {
|
||||
outline: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
||||
*/
|
||||
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/*
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
Removes the default spacing and border for appropriate elements.
|
||||
*/
|
||||
|
||||
blockquote,
|
||||
dl,
|
||||
dd,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
hr,
|
||||
figure,
|
||||
p,
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
menu {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent resizing textareas horizontally by default.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
opacity: 1; /* 1 */
|
||||
color: theme('colors.gray.400', #9ca3af); /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Set the default cursor for buttons.
|
||||
*/
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
Make sure disabled buttons don't get the pointer cursor.
|
||||
*/
|
||||
:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
||||
This can trigger a poorly considered lint error in some tools but is included by design.
|
||||
*/
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
audio,
|
||||
iframe,
|
||||
embed,
|
||||
object {
|
||||
display: block; /* 1 */
|
||||
vertical-align: middle; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
*/
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Make elements with the HTML hidden attribute stay hidden by default */
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
119
CTOAsYouGo/node_modules/tailwindcss/lib/featureFlags.js
generated
vendored
119
CTOAsYouGo/node_modules/tailwindcss/lib/featureFlags.js
generated
vendored
@@ -1,83 +1,56 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
flagEnabled: function() {
|
||||
return flagEnabled;
|
||||
},
|
||||
issueFlagNotices: function() {
|
||||
return issueFlagNotices;
|
||||
},
|
||||
default: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("./util/log"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let defaults = {
|
||||
optimizeUniversalDefaults: false,
|
||||
generalizedModifiers: true,
|
||||
get disableColorOpacityUtilitiesByDefault () {
|
||||
return false;
|
||||
},
|
||||
get relativeContentPathsByDefault () {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
let featureFlags = {
|
||||
future: [
|
||||
"hoverOnlyWhenSupported",
|
||||
"respectDefaultRingColorOpacity",
|
||||
"disableColorOpacityUtilitiesByDefault",
|
||||
"relativeContentPathsByDefault"
|
||||
],
|
||||
experimental: [
|
||||
"optimizeUniversalDefaults",
|
||||
"generalizedModifiers"
|
||||
]
|
||||
exports.flagEnabled = flagEnabled;
|
||||
exports.issueFlagNotices = issueFlagNotices;
|
||||
exports.default = void 0;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _chalk = _interopRequireDefault(require("chalk"));
|
||||
|
||||
var _log = _interopRequireDefault(require("./util/log"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const featureFlags = {
|
||||
future: ['removeDeprecatedGapUtilities', 'purgeLayersByDefault', 'defaultLineHeights', 'standardFontWeights'],
|
||||
experimental: ['uniformColorPalette', 'extendedSpacingScale', 'extendedFontSizeScale', 'applyComplexClasses', 'darkModeVariant', 'additionalBreakpoint']
|
||||
};
|
||||
|
||||
function flagEnabled(config, flag) {
|
||||
if (featureFlags.future.includes(flag)) {
|
||||
var _config_future;
|
||||
var _config_future_flag, _ref;
|
||||
return config.future === "all" || ((_ref = (_config_future_flag = config === null || config === void 0 ? void 0 : (_config_future = config.future) === null || _config_future === void 0 ? void 0 : _config_future[flag]) !== null && _config_future_flag !== void 0 ? _config_future_flag : defaults[flag]) !== null && _ref !== void 0 ? _ref : false);
|
||||
}
|
||||
if (featureFlags.experimental.includes(flag)) {
|
||||
var _config_experimental;
|
||||
var _config_experimental_flag, _ref1;
|
||||
return config.experimental === "all" || ((_ref1 = (_config_experimental_flag = config === null || config === void 0 ? void 0 : (_config_experimental = config.experimental) === null || _config_experimental === void 0 ? void 0 : _config_experimental[flag]) !== null && _config_experimental_flag !== void 0 ? _config_experimental_flag : defaults[flag]) !== null && _ref1 !== void 0 ? _ref1 : false);
|
||||
}
|
||||
return false;
|
||||
if (featureFlags.future.includes(flag)) {
|
||||
return config.future === 'all' || _lodash.default.get(config, ['future', flag], false);
|
||||
}
|
||||
|
||||
if (featureFlags.experimental.includes(flag)) {
|
||||
return config.experimental === 'all' || _lodash.default.get(config, ['experimental', flag], false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function experimentalFlagsEnabled(config) {
|
||||
if (config.experimental === "all") {
|
||||
return featureFlags.experimental;
|
||||
}
|
||||
var _config_experimental;
|
||||
return Object.keys((_config_experimental = config === null || config === void 0 ? void 0 : config.experimental) !== null && _config_experimental !== void 0 ? _config_experimental : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
|
||||
if (config.experimental === 'all') {
|
||||
return featureFlags.experimental;
|
||||
}
|
||||
|
||||
return Object.keys(_lodash.default.get(config, 'experimental', {})).filter(flag => featureFlags.experimental.includes(flag) && config.experimental[flag]);
|
||||
}
|
||||
|
||||
function issueFlagNotices(config) {
|
||||
if (process.env.JEST_WORKER_ID !== undefined) {
|
||||
return;
|
||||
}
|
||||
if (experimentalFlagsEnabled(config).length > 0) {
|
||||
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", ");
|
||||
_log.default.warn("experimental-flags-enabled", [
|
||||
`You have enabled experimental features: ${changes}`,
|
||||
"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time."
|
||||
]);
|
||||
}
|
||||
if (process.env.JEST_WORKER_ID !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (experimentalFlagsEnabled(config).length > 0) {
|
||||
const changes = experimentalFlagsEnabled(config).map(s => _chalk.default.yellow(s)).join(', ');
|
||||
|
||||
_log.default.warn([`You have enabled experimental features: ${changes}`, 'Experimental features are not covered by semver, may introduce breaking changes, and can change at any time.']);
|
||||
}
|
||||
}
|
||||
const _default = featureFlags;
|
||||
|
||||
var _default = featureFlags;
|
||||
exports.default = _default;
|
||||
18
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/additionalBreakpoint.js
generated
vendored
Normal file
18
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/additionalBreakpoint.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
screens: {
|
||||
sm: '640px',
|
||||
md: '768px',
|
||||
lg: '1024px',
|
||||
xl: '1280px',
|
||||
'2xl': '1536px'
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
294
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/applyComplexClasses.js
generated
vendored
Normal file
294
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/applyComplexClasses.js
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyComplexClasses;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _substituteTailwindAtRules = _interopRequireDefault(require("../lib/substituteTailwindAtRules"));
|
||||
|
||||
var _evaluateTailwindFunctions = _interopRequireDefault(require("../lib/evaluateTailwindFunctions"));
|
||||
|
||||
var _substituteVariantsAtRules = _interopRequireDefault(require("../lib/substituteVariantsAtRules"));
|
||||
|
||||
var _substituteResponsiveAtRules = _interopRequireDefault(require("../lib/substituteResponsiveAtRules"));
|
||||
|
||||
var _convertLayerAtRulesToControlComments = _interopRequireDefault(require("../lib/convertLayerAtRulesToControlComments"));
|
||||
|
||||
var _substituteScreenAtRules = _interopRequireDefault(require("../lib/substituteScreenAtRules"));
|
||||
|
||||
var _prefixSelector = _interopRequireDefault(require("../util/prefixSelector"));
|
||||
|
||||
var _useMemo = require("../util/useMemo");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function hasAtRule(css, atRule) {
|
||||
let foundAtRule = false;
|
||||
css.walkAtRules(atRule, () => {
|
||||
foundAtRule = true;
|
||||
return false;
|
||||
});
|
||||
return foundAtRule;
|
||||
}
|
||||
|
||||
function cloneWithoutChildren(node) {
|
||||
if (node.type === 'atrule') {
|
||||
return _postcss.default.atRule({
|
||||
name: node.name,
|
||||
params: node.params
|
||||
});
|
||||
}
|
||||
|
||||
if (node.type === 'rule') {
|
||||
return _postcss.default.rule({
|
||||
name: node.name,
|
||||
selectors: node.selectors
|
||||
});
|
||||
}
|
||||
|
||||
const clone = node.clone();
|
||||
clone.removeAll();
|
||||
return clone;
|
||||
}
|
||||
|
||||
const tailwindApplyPlaceholder = _postcssSelectorParser.default.attribute({
|
||||
attribute: '__TAILWIND-APPLY-PLACEHOLDER__'
|
||||
});
|
||||
|
||||
function generateRulesFromApply({
|
||||
rule,
|
||||
utilityName: className,
|
||||
classPosition
|
||||
}, replaceWiths) {
|
||||
const parser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
let i = 0;
|
||||
selectors.walkClasses(c => {
|
||||
if (classPosition === i++ && c.value === className) {
|
||||
c.replaceWith(tailwindApplyPlaceholder);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const processedSelectors = _lodash.default.flatMap(rule.selectors, selector => {
|
||||
// You could argue we should make this replacement at the AST level, but if we believe
|
||||
// the placeholder string is safe from collisions then it is safe to do this is a simple
|
||||
// string replacement, and much, much faster.
|
||||
return replaceWiths.map(replaceWith => parser.processSync(selector).replace('[__TAILWIND-APPLY-PLACEHOLDER__]', replaceWith));
|
||||
});
|
||||
|
||||
const cloned = rule.clone();
|
||||
let current = cloned;
|
||||
let parent = rule.parent;
|
||||
|
||||
while (parent && parent.type !== 'root') {
|
||||
const parentClone = cloneWithoutChildren(parent);
|
||||
parentClone.append(current);
|
||||
current.parent = parentClone;
|
||||
current = parentClone;
|
||||
parent = parent.parent;
|
||||
}
|
||||
|
||||
cloned.selectors = processedSelectors;
|
||||
return current;
|
||||
}
|
||||
|
||||
const extractUtilityNamesParser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
let classes = [];
|
||||
selectors.walkClasses(c => classes.push(c.value));
|
||||
return classes;
|
||||
});
|
||||
const extractUtilityNames = (0, _useMemo.useMemo)(selector => extractUtilityNamesParser.transformSync(selector), selector => selector);
|
||||
const cloneRuleWithParent = (0, _useMemo.useMemo)(rule => rule.clone({
|
||||
parent: rule.parent
|
||||
}), rule => rule);
|
||||
|
||||
function buildUtilityMap(css, lookupTree) {
|
||||
let index = 0;
|
||||
const utilityMap = {};
|
||||
|
||||
function handle(rule) {
|
||||
const utilityNames = extractUtilityNames(rule.selector);
|
||||
utilityNames.forEach((utilityName, i) => {
|
||||
if (utilityMap[utilityName] === undefined) {
|
||||
utilityMap[utilityName] = [];
|
||||
}
|
||||
|
||||
utilityMap[utilityName].push({
|
||||
index,
|
||||
utilityName,
|
||||
classPosition: i,
|
||||
|
||||
get rule() {
|
||||
return cloneRuleWithParent(rule);
|
||||
}
|
||||
|
||||
});
|
||||
index++;
|
||||
});
|
||||
}
|
||||
|
||||
lookupTree.walkRules(handle);
|
||||
css.walkRules(handle);
|
||||
return utilityMap;
|
||||
}
|
||||
|
||||
function mergeAdjacentRules(initialRule, rulesToInsert) {
|
||||
let previousRule = initialRule;
|
||||
rulesToInsert.forEach(toInsert => {
|
||||
if (toInsert.type === 'rule' && previousRule.type === 'rule' && toInsert.selector === previousRule.selector) {
|
||||
previousRule.append(toInsert.nodes);
|
||||
} else if (toInsert.type === 'atrule' && previousRule.type === 'atrule' && toInsert.params === previousRule.params) {
|
||||
const merged = mergeAdjacentRules(previousRule.nodes[previousRule.nodes.length - 1], toInsert.nodes);
|
||||
previousRule.append(merged);
|
||||
} else {
|
||||
previousRule = toInsert;
|
||||
}
|
||||
|
||||
toInsert.walk(n => {
|
||||
if (n.nodes && n.nodes.length === 0) {
|
||||
n.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
return rulesToInsert.filter(r => r.nodes.length > 0);
|
||||
}
|
||||
|
||||
function makeExtractUtilityRules(css, lookupTree, config) {
|
||||
const utilityMap = buildUtilityMap(css, lookupTree);
|
||||
return function extractUtilityRules(utilityNames, rule) {
|
||||
const combined = [];
|
||||
utilityNames.forEach(utilityName => {
|
||||
if (utilityMap[utilityName] === undefined) {
|
||||
// Look for prefixed utility in case the user has goofed
|
||||
const prefixedUtility = (0, _prefixSelector.default)(config.prefix, `.${utilityName}`).slice(1);
|
||||
|
||||
if (utilityMap[prefixedUtility] !== undefined) {
|
||||
throw rule.error(`The \`${utilityName}\` class does not exist, but \`${prefixedUtility}\` does. Did you forget the prefix?`);
|
||||
}
|
||||
|
||||
throw rule.error(`The \`${utilityName}\` class does not exist. If you're sure that \`${utilityName}\` exists, make sure that any \`@import\` statements are being properly processed before Tailwind CSS sees your CSS, as \`@apply\` can only be used for classes in the same CSS tree.`, {
|
||||
word: utilityName
|
||||
});
|
||||
}
|
||||
|
||||
combined.push(...utilityMap[utilityName]);
|
||||
});
|
||||
return combined.sort((a, b) => a.index - b.index);
|
||||
};
|
||||
}
|
||||
|
||||
function findParent(rule, predicate) {
|
||||
let parent = rule.parent;
|
||||
|
||||
while (parent) {
|
||||
if (predicate(parent)) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
parent = parent.parent;
|
||||
}
|
||||
|
||||
throw new Error('No parent could be found');
|
||||
}
|
||||
|
||||
function processApplyAtRules(css, lookupTree, config) {
|
||||
const extractUtilityRules = makeExtractUtilityRules(css, lookupTree, config);
|
||||
|
||||
do {
|
||||
css.walkAtRules('apply', applyRule => {
|
||||
const parent = applyRule.parent; // Direct parent
|
||||
|
||||
const nearestParentRule = findParent(applyRule, r => r.type === 'rule');
|
||||
const currentUtilityNames = extractUtilityNames(nearestParentRule.selector);
|
||||
|
||||
const [importantEntries, applyUtilityNames, important = importantEntries.length > 0] = _lodash.default.partition(applyRule.params.split(/[\s\t\n]+/g), n => n === '!important');
|
||||
|
||||
if (_lodash.default.intersection(applyUtilityNames, currentUtilityNames).length > 0) {
|
||||
const currentUtilityName = _lodash.default.intersection(applyUtilityNames, currentUtilityNames)[0];
|
||||
|
||||
throw parent.error(`You cannot \`@apply\` the \`${currentUtilityName}\` utility here because it creates a circular dependency.`);
|
||||
} // Extract any post-apply declarations and re-insert them after apply rules
|
||||
|
||||
|
||||
const afterRule = parent.clone({
|
||||
raws: {}
|
||||
});
|
||||
afterRule.nodes = afterRule.nodes.slice(parent.index(applyRule) + 1);
|
||||
parent.nodes = parent.nodes.slice(0, parent.index(applyRule) + 1); // Sort applys to match CSS source order
|
||||
|
||||
const applys = extractUtilityRules(applyUtilityNames, applyRule); // Get new rules with the utility portion of the selector replaced with the new selector
|
||||
|
||||
const rulesToInsert = [];
|
||||
applys.forEach(nearestParentRule === parent ? util => rulesToInsert.push(generateRulesFromApply(util, parent.selectors)) : util => util.rule.nodes.forEach(n => afterRule.append(n.clone())));
|
||||
|
||||
const {
|
||||
nodes
|
||||
} = _lodash.default.tap(_postcss.default.root({
|
||||
nodes: rulesToInsert
|
||||
}), root => root.walkDecls(d => {
|
||||
d.important = important;
|
||||
}));
|
||||
|
||||
const mergedRules = mergeAdjacentRules(nearestParentRule, [...nodes, afterRule]);
|
||||
applyRule.remove();
|
||||
parent.after(mergedRules); // If the base rule has nothing in it (all applys were pseudo or responsive variants),
|
||||
// remove the rule fuggit.
|
||||
|
||||
if (parent.nodes.length === 0) {
|
||||
parent.remove();
|
||||
}
|
||||
}); // We already know that we have at least 1 @apply rule. Otherwise this
|
||||
// function would not have been called. Therefore we can execute this code
|
||||
// at least once. This also means that in the best case scenario we only
|
||||
// call this 2 times, instead of 3 times.
|
||||
// 1st time -> before we call this function
|
||||
// 2nd time -> when we check if we have to do this loop again (because do {} while (check))
|
||||
// .. instead of
|
||||
// 1st time -> before we call this function
|
||||
// 2nd time -> when we check the first time (because while (check) do {})
|
||||
// 3rd time -> when we re-check to see if we should do this loop again
|
||||
} while (hasAtRule(css, 'apply'));
|
||||
|
||||
return css;
|
||||
}
|
||||
|
||||
let defaultTailwindTree = null;
|
||||
|
||||
function applyComplexClasses(config, getProcessedPlugins, configChanged) {
|
||||
return function (css) {
|
||||
// We can stop already when we don't have any @apply rules. Vue users: you're welcome!
|
||||
if (!hasAtRule(css, 'apply')) {
|
||||
return css;
|
||||
} // Tree already contains @tailwind rules, don't prepend default Tailwind tree
|
||||
|
||||
|
||||
if (hasAtRule(css, 'tailwind')) {
|
||||
return processApplyAtRules(css, _postcss.default.root(), config);
|
||||
} // Tree contains no @tailwind rules, so generate all of Tailwind's styles and
|
||||
// prepend them to the user's CSS. Important for <style> blocks in Vue components.
|
||||
|
||||
|
||||
const generateLookupTree = configChanged || defaultTailwindTree === null ? () => {
|
||||
return (0, _postcss.default)([(0, _substituteTailwindAtRules.default)(config, getProcessedPlugins()), (0, _evaluateTailwindFunctions.default)(config), (0, _substituteVariantsAtRules.default)(config, getProcessedPlugins()), (0, _substituteResponsiveAtRules.default)(config), (0, _convertLayerAtRulesToControlComments.default)(config), (0, _substituteScreenAtRules.default)(config)]).process(`
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
`, {
|
||||
from: undefined
|
||||
}).then(result => {
|
||||
defaultTailwindTree = result;
|
||||
return defaultTailwindTree;
|
||||
});
|
||||
} : () => Promise.resolve(defaultTailwindTree);
|
||||
return generateLookupTree().then(result => {
|
||||
return processApplyAtRules(css, result.root, config);
|
||||
});
|
||||
};
|
||||
}
|
||||
23
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/darkModeVariant.js
generated
vendored
Normal file
23
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/darkModeVariant.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _defaultConfig = _interopRequireDefault(require("../../defaultConfig"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = {
|
||||
dark: 'media',
|
||||
variants: {
|
||||
backgroundColor: [..._defaultConfig.default.variants.backgroundColor, 'dark'],
|
||||
gradientColorStops: [..._defaultConfig.default.variants.gradientColorStops, 'dark'],
|
||||
borderColor: [..._defaultConfig.default.variants.borderColor, 'dark'],
|
||||
divideColor: [..._defaultConfig.default.variants.divideColor, 'dark'],
|
||||
placeholderColor: [..._defaultConfig.default.variants.placeholderColor, 'dark'],
|
||||
textColor: [..._defaultConfig.default.variants.textColor, 'dark']
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
64
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/darkModeVariantPlugin.js
generated
vendored
Normal file
64
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/darkModeVariantPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _buildSelectorVariant = _interopRequireDefault(require("../util/buildSelectorVariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default({
|
||||
addVariant,
|
||||
config,
|
||||
postcss,
|
||||
prefix
|
||||
}) {
|
||||
addVariant('dark', ({
|
||||
container,
|
||||
separator,
|
||||
modifySelectors
|
||||
}) => {
|
||||
if (config('dark') === false) {
|
||||
return postcss.root();
|
||||
}
|
||||
|
||||
if (config('dark') === 'media') {
|
||||
const modified = modifySelectors(({
|
||||
selector
|
||||
}) => {
|
||||
return (0, _buildSelectorVariant.default)(selector, 'dark', separator, message => {
|
||||
throw container.error(message);
|
||||
});
|
||||
});
|
||||
const mediaQuery = postcss.atRule({
|
||||
name: 'media',
|
||||
params: '(prefers-color-scheme: dark)'
|
||||
});
|
||||
mediaQuery.append(modified);
|
||||
container.append(mediaQuery);
|
||||
return container;
|
||||
}
|
||||
|
||||
if (config('dark') === 'class') {
|
||||
const modified = modifySelectors(({
|
||||
selector
|
||||
}) => {
|
||||
return (0, _buildSelectorVariant.default)(selector, 'dark', separator, message => {
|
||||
throw container.error(message);
|
||||
});
|
||||
});
|
||||
modified.walkRules(rule => {
|
||||
rule.selectors = rule.selectors.map(selector => {
|
||||
return `${prefix('.dark')} ${selector}`;
|
||||
});
|
||||
});
|
||||
return modified;
|
||||
}
|
||||
|
||||
throw new Error("The `dark` config option must be either 'media' or 'class'.");
|
||||
}, {
|
||||
unstable_stack: true
|
||||
});
|
||||
}
|
||||
43
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/defaultLineHeights.js
generated
vendored
Normal file
43
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/defaultLineHeights.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
fontSize: {
|
||||
xs: ['0.75rem', {
|
||||
lineHeight: '1rem'
|
||||
}],
|
||||
sm: ['0.875rem', {
|
||||
lineHeight: '1.25rem'
|
||||
}],
|
||||
base: ['1rem', {
|
||||
lineHeight: '1.5rem'
|
||||
}],
|
||||
lg: ['1.125rem', {
|
||||
lineHeight: '1.75rem'
|
||||
}],
|
||||
xl: ['1.25rem', {
|
||||
lineHeight: '1.75rem'
|
||||
}],
|
||||
'2xl': ['1.5rem', {
|
||||
lineHeight: '2rem'
|
||||
}],
|
||||
'3xl': ['1.875rem', {
|
||||
lineHeight: '2.25rem'
|
||||
}],
|
||||
'4xl': ['2.25rem', {
|
||||
lineHeight: '2.5rem'
|
||||
}],
|
||||
'5xl': ['3rem', {
|
||||
lineHeight: '1'
|
||||
}],
|
||||
'6xl': ['4rem', {
|
||||
lineHeight: '1'
|
||||
}]
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
24
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/extendedFontSizeScale.js
generated
vendored
Normal file
24
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/extendedFontSizeScale.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
extend: {
|
||||
fontSize: {
|
||||
'7xl': ['5rem', {
|
||||
lineHeight: '1'
|
||||
}],
|
||||
'8xl': ['6rem', {
|
||||
lineHeight: '1'
|
||||
}],
|
||||
'9xl': ['8rem', {
|
||||
lineHeight: '1'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
122
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/extendedSpacingScale.js
generated
vendored
Normal file
122
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/extendedSpacingScale.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
spacing: {
|
||||
px: '1px',
|
||||
'0': '0',
|
||||
'0.5': '0.125rem',
|
||||
'1': '0.25rem',
|
||||
'1.5': '0.375rem',
|
||||
'2': '0.5rem',
|
||||
'2.5': '0.625rem',
|
||||
'3': '0.75rem',
|
||||
'3.5': '0.875rem',
|
||||
'4': '1rem',
|
||||
'5': '1.25rem',
|
||||
'6': '1.5rem',
|
||||
'7': '1.75rem',
|
||||
'8': '2rem',
|
||||
'9': '2.25rem',
|
||||
'10': '2.5rem',
|
||||
'11': '2.75rem',
|
||||
'12': '3rem',
|
||||
'13': '3.25rem',
|
||||
'14': '3.5rem',
|
||||
'15': '3.75rem',
|
||||
'16': '4rem',
|
||||
'20': '5rem',
|
||||
'24': '6rem',
|
||||
'28': '7rem',
|
||||
'32': '8rem',
|
||||
'36': '9rem',
|
||||
'40': '10rem',
|
||||
'44': '11rem',
|
||||
'48': '12rem',
|
||||
'52': '13rem',
|
||||
'56': '14rem',
|
||||
'60': '15rem',
|
||||
'64': '16rem',
|
||||
'72': '18rem',
|
||||
'80': '20rem',
|
||||
'96': '24rem',
|
||||
'1/2': '50%',
|
||||
'1/3': '33.333333%',
|
||||
'2/3': '66.666667%',
|
||||
'1/4': '25%',
|
||||
'2/4': '50%',
|
||||
'3/4': '75%',
|
||||
'1/5': '20%',
|
||||
'2/5': '40%',
|
||||
'3/5': '60%',
|
||||
'4/5': '80%',
|
||||
'1/6': '16.666667%',
|
||||
'2/6': '33.333333%',
|
||||
'3/6': '50%',
|
||||
'4/6': '66.666667%',
|
||||
'5/6': '83.333333%',
|
||||
'1/12': '8.333333%',
|
||||
'2/12': '16.666667%',
|
||||
'3/12': '25%',
|
||||
'4/12': '33.333333%',
|
||||
'5/12': '41.666667%',
|
||||
'6/12': '50%',
|
||||
'7/12': '58.333333%',
|
||||
'8/12': '66.666667%',
|
||||
'9/12': '75%',
|
||||
'10/12': '83.333333%',
|
||||
'11/12': '91.666667%',
|
||||
full: '100%'
|
||||
},
|
||||
inset: (theme, {
|
||||
negative
|
||||
}) => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
...negative(theme('spacing'))
|
||||
}),
|
||||
minWidth: {
|
||||
'0': '0',
|
||||
full: '100%',
|
||||
min: 'min-content',
|
||||
max: 'max-content'
|
||||
},
|
||||
width: theme => ({
|
||||
auto: 'auto',
|
||||
...theme('spacing'),
|
||||
screen: '100vw',
|
||||
min: 'min-content',
|
||||
max: 'max-content'
|
||||
}),
|
||||
maxWidth: (theme, {
|
||||
breakpoints
|
||||
}) => ({
|
||||
none: 'none',
|
||||
'0': '0rem',
|
||||
xs: '20rem',
|
||||
sm: '24rem',
|
||||
md: '28rem',
|
||||
lg: '32rem',
|
||||
xl: '36rem',
|
||||
'2xl': '42rem',
|
||||
'3xl': '48rem',
|
||||
'4xl': '56rem',
|
||||
'5xl': '64rem',
|
||||
'6xl': '72rem',
|
||||
'7xl': '80rem',
|
||||
full: '100%',
|
||||
min: 'min-content',
|
||||
max: 'max-content',
|
||||
...breakpoints(theme('screens'))
|
||||
}),
|
||||
maxHeight: theme => ({
|
||||
screen: '100vh',
|
||||
...theme('spacing')
|
||||
})
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
22
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/standardFontWeights.js
generated
vendored
Normal file
22
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/standardFontWeights.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
fontWeight: {
|
||||
thin: '100',
|
||||
extralight: '200',
|
||||
light: '300',
|
||||
normal: '400',
|
||||
medium: '500',
|
||||
semibold: '600',
|
||||
bold: '700',
|
||||
extrabold: '800',
|
||||
black: '900'
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
137
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/uniformColorPalette.js
generated
vendored
Normal file
137
CTOAsYouGo/node_modules/tailwindcss/lib/flagged/uniformColorPalette.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
theme: {
|
||||
colors: {
|
||||
transparent: 'transparent',
|
||||
current: 'currentColor',
|
||||
black: '#000000',
|
||||
white: '#ffffff',
|
||||
gray: {
|
||||
'50': '#f9fafb',
|
||||
'100': '#f4f5f7',
|
||||
'200': '#e5e7eb',
|
||||
'300': '#d2d6dc',
|
||||
'400': '#9fa6b2',
|
||||
'500': '#6b7280',
|
||||
'600': '#4b5563',
|
||||
'700': '#374151',
|
||||
'800': '#252f3f',
|
||||
'900': '#161e2e'
|
||||
},
|
||||
red: {
|
||||
'50': '#fdf2f2',
|
||||
'100': '#fde8e8',
|
||||
'200': '#fbd5d5',
|
||||
'300': '#f8b4b4',
|
||||
'400': '#f98080',
|
||||
'500': '#f05252',
|
||||
'600': '#e02424',
|
||||
'700': '#c81e1e',
|
||||
'800': '#9b1c1c',
|
||||
'900': '#771d1d'
|
||||
},
|
||||
orange: {
|
||||
'50': '#fff8f1',
|
||||
'100': '#feecdc',
|
||||
'200': '#fcd9bd',
|
||||
'300': '#fdba8c',
|
||||
'400': '#ff8a4c',
|
||||
'500': '#ff5a1f',
|
||||
'600': '#d03801',
|
||||
'700': '#b43403',
|
||||
'800': '#8a2c0d',
|
||||
'900': '#73230d'
|
||||
},
|
||||
yellow: {
|
||||
'50': '#fdfdea',
|
||||
'100': '#fdf6b2',
|
||||
'200': '#fce96a',
|
||||
'300': '#faca15',
|
||||
'400': '#e3a008',
|
||||
'500': '#c27803',
|
||||
'600': '#9f580a',
|
||||
'700': '#8e4b10',
|
||||
'800': '#723b13',
|
||||
'900': '#633112'
|
||||
},
|
||||
green: {
|
||||
'50': '#f3faf7',
|
||||
'100': '#def7ec',
|
||||
'200': '#bcf0da',
|
||||
'300': '#84e1bc',
|
||||
'400': '#31c48d',
|
||||
'500': '#0e9f6e',
|
||||
'600': '#057a55',
|
||||
'700': '#046c4e',
|
||||
'800': '#03543f',
|
||||
'900': '#014737'
|
||||
},
|
||||
teal: {
|
||||
'50': '#edfafa',
|
||||
'100': '#d5f5f6',
|
||||
'200': '#afecef',
|
||||
'300': '#7edce2',
|
||||
'400': '#16bdca',
|
||||
'500': '#0694a2',
|
||||
'600': '#047481',
|
||||
'700': '#036672',
|
||||
'800': '#05505c',
|
||||
'900': '#014451'
|
||||
},
|
||||
blue: {
|
||||
'50': '#ebf5ff',
|
||||
'100': '#e1effe',
|
||||
'200': '#c3ddfd',
|
||||
'300': '#a4cafe',
|
||||
'400': '#76a9fa',
|
||||
'500': '#3f83f8',
|
||||
'600': '#1c64f2',
|
||||
'700': '#1a56db',
|
||||
'800': '#1e429f',
|
||||
'900': '#233876'
|
||||
},
|
||||
indigo: {
|
||||
'50': '#f0f5ff',
|
||||
'100': '#e5edff',
|
||||
'200': '#cddbfe',
|
||||
'300': '#b4c6fc',
|
||||
'400': '#8da2fb',
|
||||
'500': '#6875f5',
|
||||
'600': '#5850ec',
|
||||
'700': '#5145cd',
|
||||
'800': '#42389d',
|
||||
'900': '#362f78'
|
||||
},
|
||||
purple: {
|
||||
'50': '#f6f5ff',
|
||||
'100': '#edebfe',
|
||||
'200': '#dcd7fe',
|
||||
'300': '#cabffd',
|
||||
'400': '#ac94fa',
|
||||
'500': '#9061f9',
|
||||
'600': '#7e3af2',
|
||||
'700': '#6c2bd9',
|
||||
'800': '#5521b5',
|
||||
'900': '#4a1d96'
|
||||
},
|
||||
pink: {
|
||||
'50': '#fdf2f8',
|
||||
'100': '#fce8f3',
|
||||
'200': '#fad1e8',
|
||||
'300': '#f8b4d9',
|
||||
'400': '#f17eb8',
|
||||
'500': '#e74694',
|
||||
'600': '#d61f69',
|
||||
'700': '#bf125d',
|
||||
'800': '#99154b',
|
||||
'900': '#751a3d'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
91
CTOAsYouGo/node_modules/tailwindcss/lib/index.js
generated
vendored
91
CTOAsYouGo/node_modules/tailwindcss/lib/index.js
generated
vendored
@@ -1,2 +1,91 @@
|
||||
"use strict";
|
||||
module.exports = require("./plugin");
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _getModuleDependencies = _interopRequireDefault(require("./lib/getModuleDependencies"));
|
||||
|
||||
var _registerConfigAsDependency = _interopRequireDefault(require("./lib/registerConfigAsDependency"));
|
||||
|
||||
var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
|
||||
|
||||
var _formatCSS = _interopRequireDefault(require("./lib/formatCSS"));
|
||||
|
||||
var _resolveConfig = _interopRequireDefault(require("./util/resolveConfig"));
|
||||
|
||||
var _getAllConfigs = _interopRequireDefault(require("./util/getAllConfigs"));
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
var _defaultConfigStub = _interopRequireDefault(require("../stubs/defaultConfig.stub.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function resolveConfigPath(filePath) {
|
||||
// require('tailwindcss')({ theme: ..., variants: ... })
|
||||
if (_lodash.default.isObject(filePath) && !_lodash.default.has(filePath, 'config') && !_lodash.default.isEmpty(filePath)) {
|
||||
return undefined;
|
||||
} // require('tailwindcss')({ config: 'custom-config.js' })
|
||||
|
||||
|
||||
if (_lodash.default.isObject(filePath) && _lodash.default.has(filePath, 'config') && _lodash.default.isString(filePath.config)) {
|
||||
return _path.default.resolve(filePath.config);
|
||||
} // require('tailwindcss')({ config: { theme: ..., variants: ... } })
|
||||
|
||||
|
||||
if (_lodash.default.isObject(filePath) && _lodash.default.has(filePath, 'config') && _lodash.default.isObject(filePath.config)) {
|
||||
return undefined;
|
||||
} // require('tailwindcss')('custom-config.js')
|
||||
|
||||
|
||||
if (_lodash.default.isString(filePath)) {
|
||||
return _path.default.resolve(filePath);
|
||||
} // require('tailwindcss')
|
||||
|
||||
|
||||
try {
|
||||
const defaultConfigPath = _path.default.resolve(_constants.defaultConfigFile);
|
||||
|
||||
_fs.default.accessSync(defaultConfigPath);
|
||||
|
||||
return defaultConfigPath;
|
||||
} catch (err) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const getConfigFunction = config => () => {
|
||||
if (_lodash.default.isUndefined(config)) {
|
||||
return (0, _resolveConfig.default)([...(0, _getAllConfigs.default)(_defaultConfigStub.default)]);
|
||||
} // Skip this if Jest is running: https://github.com/facebook/jest/pull/9841#issuecomment-621417584
|
||||
|
||||
|
||||
if (process.env.JEST_WORKER_ID === undefined) {
|
||||
if (!_lodash.default.isObject(config)) {
|
||||
(0, _getModuleDependencies.default)(config).forEach(mdl => {
|
||||
delete require.cache[require.resolve(mdl.file)];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const configObject = _lodash.default.isObject(config) ? _lodash.default.get(config, 'config', config) : require(config);
|
||||
return (0, _resolveConfig.default)([...(0, _getAllConfigs.default)(configObject)]);
|
||||
};
|
||||
|
||||
const plugin = _postcss.default.plugin('tailwind', config => {
|
||||
const plugins = [];
|
||||
const resolvedConfigPath = resolveConfigPath(config);
|
||||
|
||||
if (!_lodash.default.isUndefined(resolvedConfigPath)) {
|
||||
plugins.push((0, _registerConfigAsDependency.default)(resolvedConfigPath));
|
||||
}
|
||||
|
||||
return (0, _postcss.default)([...plugins, (0, _processTailwindFeatures.default)(getConfigFunction(resolvedConfigPath || config)), _formatCSS.default]);
|
||||
});
|
||||
|
||||
module.exports = plugin;
|
||||
26
CTOAsYouGo/node_modules/tailwindcss/lib/lib/applyImportantConfiguration.js
generated
vendored
Normal file
26
CTOAsYouGo/node_modules/tailwindcss/lib/lib/applyImportantConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyImportantConfiguration;
|
||||
|
||||
function applyImportantConfiguration(_config) {
|
||||
return function (css) {
|
||||
css.walkRules(rule => {
|
||||
const important = rule.__tailwind ? rule.__tailwind.important : false;
|
||||
|
||||
if (!important) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof important === 'string') {
|
||||
rule.selectors = rule.selectors.map(selector => {
|
||||
return `${rule.__tailwind.important} ${selector}`;
|
||||
});
|
||||
} else {
|
||||
rule.walkDecls(decl => decl.important = true);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
92
CTOAsYouGo/node_modules/tailwindcss/lib/lib/cacheInvalidation.js
generated
vendored
92
CTOAsYouGo/node_modules/tailwindcss/lib/lib/cacheInvalidation.js
generated
vendored
@@ -1,92 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "hasContentChanged", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return hasContentChanged;
|
||||
}
|
||||
});
|
||||
const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
|
||||
const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
/**
|
||||
* Calculate the hash of a string.
|
||||
*
|
||||
* This doesn't need to be cryptographically secure or
|
||||
* anything like that since it's used only to detect
|
||||
* when the CSS changes to invalidate the context.
|
||||
*
|
||||
* This is wrapped in a try/catch because it's really dependent
|
||||
* on how Node itself is build and the environment and OpenSSL
|
||||
* version / build that is installed on the user's machine.
|
||||
*
|
||||
* Based on the environment this can just outright fail.
|
||||
*
|
||||
* See https://github.com/nodejs/node/issues/40455
|
||||
*
|
||||
* @param {string} str
|
||||
*/ function getHash(str) {
|
||||
try {
|
||||
return _crypto.default.createHash("md5").update(str, "utf-8").digest("binary");
|
||||
} catch (err) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function hasContentChanged(sourcePath, root) {
|
||||
let css = root.toString();
|
||||
// We only care about files with @tailwind directives
|
||||
// Other files use an existing context
|
||||
if (!css.includes("@tailwind")) {
|
||||
return false;
|
||||
}
|
||||
let existingHash = _sharedState.sourceHashMap.get(sourcePath);
|
||||
let rootHash = getHash(css);
|
||||
let didChange = existingHash !== rootHash;
|
||||
_sharedState.sourceHashMap.set(sourcePath, rootHash);
|
||||
return didChange;
|
||||
}
|
||||
61
CTOAsYouGo/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js
generated
vendored
61
CTOAsYouGo/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js
generated
vendored
@@ -1,61 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return collapseAdjacentRules;
|
||||
}
|
||||
});
|
||||
let comparisonMap = {
|
||||
atrule: [
|
||||
"name",
|
||||
"params"
|
||||
],
|
||||
rule: [
|
||||
"selector"
|
||||
]
|
||||
};
|
||||
let types = new Set(Object.keys(comparisonMap));
|
||||
function collapseAdjacentRules() {
|
||||
function collapseRulesIn(root) {
|
||||
let currentRule = null;
|
||||
root.each((node)=>{
|
||||
if (!types.has(node.type)) {
|
||||
currentRule = null;
|
||||
return;
|
||||
}
|
||||
if (currentRule === null) {
|
||||
currentRule = node;
|
||||
return;
|
||||
}
|
||||
let properties = comparisonMap[node.type];
|
||||
var _node_property, _currentRule_property;
|
||||
if (node.type === "atrule" && node.name === "font-face") {
|
||||
currentRule = node;
|
||||
} else if (properties.every((property)=>((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : "").replace(/\s+/g, " ") === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : "").replace(/\s+/g, " "))) {
|
||||
// An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
|
||||
if (node.nodes) {
|
||||
currentRule.append(node.nodes);
|
||||
}
|
||||
node.remove();
|
||||
} else {
|
||||
currentRule = node;
|
||||
}
|
||||
});
|
||||
// After we've collapsed adjacent rules & at-rules, we need to collapse
|
||||
// adjacent rules & at-rules that are children of at-rules.
|
||||
// We do not care about nesting rules because Tailwind CSS
|
||||
// explicitly does not handle rule nesting on its own as
|
||||
// the user is expected to use a nesting plugin
|
||||
root.each((node)=>{
|
||||
if (node.type === "atrule") {
|
||||
collapseRulesIn(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (root)=>{
|
||||
collapseRulesIn(root);
|
||||
};
|
||||
}
|
||||
85
CTOAsYouGo/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js
generated
vendored
85
CTOAsYouGo/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js
generated
vendored
@@ -1,85 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return collapseDuplicateDeclarations;
|
||||
}
|
||||
});
|
||||
function collapseDuplicateDeclarations() {
|
||||
return (root)=>{
|
||||
root.walkRules((node)=>{
|
||||
let seen = new Map();
|
||||
let droppable = new Set([]);
|
||||
let byProperty = new Map();
|
||||
node.walkDecls((decl)=>{
|
||||
// This could happen if we have nested selectors. In that case the
|
||||
// parent will loop over all its declarations but also the declarations
|
||||
// of nested rules. With this we ensure that we are shallowly checking
|
||||
// declarations.
|
||||
if (decl.parent !== node) {
|
||||
return;
|
||||
}
|
||||
if (seen.has(decl.prop)) {
|
||||
// Exact same value as what we have seen so far
|
||||
if (seen.get(decl.prop).value === decl.value) {
|
||||
// Keep the last one, drop the one we've seen so far
|
||||
droppable.add(seen.get(decl.prop));
|
||||
// Override the existing one with the new value. This is necessary
|
||||
// so that if we happen to have more than one declaration with the
|
||||
// same value, that we keep removing the previous one. Otherwise we
|
||||
// will only remove the *first* one.
|
||||
seen.set(decl.prop, decl);
|
||||
return;
|
||||
}
|
||||
// Not the same value, so we need to check if we can merge it so
|
||||
// let's collect it first.
|
||||
if (!byProperty.has(decl.prop)) {
|
||||
byProperty.set(decl.prop, new Set());
|
||||
}
|
||||
byProperty.get(decl.prop).add(seen.get(decl.prop));
|
||||
byProperty.get(decl.prop).add(decl);
|
||||
}
|
||||
seen.set(decl.prop, decl);
|
||||
});
|
||||
// Drop all the duplicate declarations with the exact same value we've
|
||||
// already seen so far.
|
||||
for (let decl of droppable){
|
||||
decl.remove();
|
||||
}
|
||||
// Analyze the declarations based on its unit, drop all the declarations
|
||||
// with the same unit but the last one in the list.
|
||||
for (let declarations of byProperty.values()){
|
||||
let byUnit = new Map();
|
||||
for (let decl of declarations){
|
||||
let unit = resolveUnit(decl.value);
|
||||
if (unit === null) {
|
||||
continue;
|
||||
}
|
||||
if (!byUnit.has(unit)) {
|
||||
byUnit.set(unit, new Set());
|
||||
}
|
||||
byUnit.get(unit).add(decl);
|
||||
}
|
||||
for (let declarations of byUnit.values()){
|
||||
// Get all but the last one
|
||||
let removableDeclarations = Array.from(declarations).slice(0, -1);
|
||||
for (let decl of removableDeclarations){
|
||||
decl.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
let UNITLESS_NUMBER = Symbol("unitless-number");
|
||||
function resolveUnit(input) {
|
||||
let result = /^-?\d*.?\d+([\w%]+)?$/g.exec(input);
|
||||
if (result) {
|
||||
var _result_;
|
||||
return (_result_ = result[1]) !== null && _result_ !== void 0 ? _result_ : UNITLESS_NUMBER;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
181
CTOAsYouGo/node_modules/tailwindcss/lib/lib/content.js
generated
vendored
181
CTOAsYouGo/node_modules/tailwindcss/lib/lib/content.js
generated
vendored
@@ -1,181 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
parseCandidateFiles: function() {
|
||||
return parseCandidateFiles;
|
||||
},
|
||||
resolvedChangedContent: function() {
|
||||
return resolvedChangedContent;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
|
||||
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
||||
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
||||
const _parseGlob = require("../util/parseGlob");
|
||||
const _sharedState = require("./sharedState");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function parseCandidateFiles(context, tailwindConfig) {
|
||||
let files = tailwindConfig.content.files;
|
||||
// Normalize the file globs
|
||||
files = files.filter((filePath)=>typeof filePath === "string");
|
||||
files = files.map(_normalizepath.default);
|
||||
// Split into included and excluded globs
|
||||
let tasks = _fastglob.default.generateTasks(files);
|
||||
/** @type {ContentPath[]} */ let included = [];
|
||||
/** @type {ContentPath[]} */ let excluded = [];
|
||||
for (const task of tasks){
|
||||
included.push(...task.positive.map((filePath)=>parseFilePath(filePath, false)));
|
||||
excluded.push(...task.negative.map((filePath)=>parseFilePath(filePath, true)));
|
||||
}
|
||||
let paths = [
|
||||
...included,
|
||||
...excluded
|
||||
];
|
||||
// Resolve paths relative to the config file or cwd
|
||||
paths = resolveRelativePaths(context, paths);
|
||||
// Resolve symlinks if possible
|
||||
paths = paths.flatMap(resolvePathSymlinks);
|
||||
// Update cached patterns
|
||||
paths = paths.map(resolveGlobPattern);
|
||||
return paths;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {string} filePath
|
||||
* @param {boolean} ignore
|
||||
* @returns {ContentPath}
|
||||
*/ function parseFilePath(filePath, ignore) {
|
||||
let contentPath = {
|
||||
original: filePath,
|
||||
base: filePath,
|
||||
ignore,
|
||||
pattern: filePath,
|
||||
glob: null
|
||||
};
|
||||
if ((0, _isglob.default)(filePath)) {
|
||||
Object.assign(contentPath, (0, _parseGlob.parseGlob)(filePath));
|
||||
}
|
||||
return contentPath;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {ContentPath} contentPath
|
||||
* @returns {ContentPath}
|
||||
*/ function resolveGlobPattern(contentPath) {
|
||||
// This is required for Windows support to properly pick up Glob paths.
|
||||
// Afaik, this technically shouldn't be needed but there's probably
|
||||
// some internal, direct path matching with a normalized path in
|
||||
// a package which can't handle mixed directory separators
|
||||
let base = (0, _normalizepath.default)(contentPath.base);
|
||||
// If the user's file path contains any special characters (like parens) for instance fast-glob
|
||||
// is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
|
||||
base = _fastglob.default.escapePath(base);
|
||||
contentPath.pattern = contentPath.glob ? `${base}/${contentPath.glob}` : base;
|
||||
contentPath.pattern = contentPath.ignore ? `!${contentPath.pattern}` : contentPath.pattern;
|
||||
return contentPath;
|
||||
}
|
||||
/**
|
||||
* Resolve each path relative to the config file (when possible) if the experimental flag is enabled
|
||||
* Otherwise, resolve relative to the current working directory
|
||||
*
|
||||
* @param {any} context
|
||||
* @param {ContentPath[]} contentPaths
|
||||
* @returns {ContentPath[]}
|
||||
*/ function resolveRelativePaths(context, contentPaths) {
|
||||
let resolveFrom = [];
|
||||
// Resolve base paths relative to the config file (when possible) if the experimental flag is enabled
|
||||
if (context.userConfigPath && context.tailwindConfig.content.relative) {
|
||||
resolveFrom = [
|
||||
_path.default.dirname(context.userConfigPath)
|
||||
];
|
||||
}
|
||||
return contentPaths.map((contentPath)=>{
|
||||
contentPath.base = _path.default.resolve(...resolveFrom, contentPath.base);
|
||||
return contentPath;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Resolve the symlink for the base directory / file in each path
|
||||
* These are added as additional dependencies to watch for changes because
|
||||
* some tools (like webpack) will only watch the actual file or directory
|
||||
* but not the symlink itself even in projects that use monorepos.
|
||||
*
|
||||
* @param {ContentPath} contentPath
|
||||
* @returns {ContentPath[]}
|
||||
*/ function resolvePathSymlinks(contentPath) {
|
||||
let paths = [
|
||||
contentPath
|
||||
];
|
||||
try {
|
||||
let resolvedPath = _fs.default.realpathSync(contentPath.base);
|
||||
if (resolvedPath !== contentPath.base) {
|
||||
paths.push({
|
||||
...contentPath,
|
||||
base: resolvedPath
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// TODO: log this?
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
function resolvedChangedContent(context, candidateFiles, fileModifiedMap) {
|
||||
let changedContent = context.tailwindConfig.content.files.filter((item)=>typeof item.raw === "string").map(({ raw , extension ="html" })=>({
|
||||
content: raw,
|
||||
extension
|
||||
}));
|
||||
let [changedFiles, mTimesToCommit] = resolveChangedFiles(candidateFiles, fileModifiedMap);
|
||||
for (let changedFile of changedFiles){
|
||||
let extension = _path.default.extname(changedFile).slice(1);
|
||||
changedContent.push({
|
||||
file: changedFile,
|
||||
extension
|
||||
});
|
||||
}
|
||||
return [
|
||||
changedContent,
|
||||
mTimesToCommit
|
||||
];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {ContentPath[]} candidateFiles
|
||||
* @param {Map<string, number>} fileModifiedMap
|
||||
* @returns {[Set<string>, Map<string, number>]}
|
||||
*/ function resolveChangedFiles(candidateFiles, fileModifiedMap) {
|
||||
let paths = candidateFiles.map((contentPath)=>contentPath.pattern);
|
||||
let mTimesToCommit = new Map();
|
||||
let changedFiles = new Set();
|
||||
_sharedState.env.DEBUG && console.time("Finding changed files");
|
||||
let files = _fastglob.default.sync(paths, {
|
||||
absolute: true
|
||||
});
|
||||
for (let file of files){
|
||||
let prevModified = fileModifiedMap.get(file) || -Infinity;
|
||||
let modified = _fs.default.statSync(file).mtimeMs;
|
||||
if (modified > prevModified) {
|
||||
changedFiles.add(file);
|
||||
mTimesToCommit.set(file, modified);
|
||||
}
|
||||
}
|
||||
_sharedState.env.DEBUG && console.timeEnd("Finding changed files");
|
||||
return [
|
||||
changedFiles,
|
||||
mTimesToCommit
|
||||
];
|
||||
}
|
||||
31
CTOAsYouGo/node_modules/tailwindcss/lib/lib/convertLayerAtRulesToControlComments.js
generated
vendored
Normal file
31
CTOAsYouGo/node_modules/tailwindcss/lib/lib/convertLayerAtRulesToControlComments.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = convertLayerAtRulesToControlComments;
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function convertLayerAtRulesToControlComments() {
|
||||
return function (css) {
|
||||
css.walkAtRules('layer', atRule => {
|
||||
const layer = atRule.params;
|
||||
|
||||
if (!['base', 'components', 'utilities'].includes(layer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
atRule.before(_postcss.default.comment({
|
||||
text: `tailwind start ${layer}`
|
||||
}));
|
||||
atRule.before(atRule.nodes);
|
||||
atRule.before(_postcss.default.comment({
|
||||
text: `tailwind end ${layer}`
|
||||
}));
|
||||
atRule.remove();
|
||||
});
|
||||
};
|
||||
}
|
||||
243
CTOAsYouGo/node_modules/tailwindcss/lib/lib/defaultExtractor.js
generated
vendored
243
CTOAsYouGo/node_modules/tailwindcss/lib/lib/defaultExtractor.js
generated
vendored
@@ -1,243 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "defaultExtractor", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return defaultExtractor;
|
||||
}
|
||||
});
|
||||
const _featureFlags = require("../featureFlags");
|
||||
const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
function defaultExtractor(context) {
|
||||
let patterns = Array.from(buildRegExps(context));
|
||||
/**
|
||||
* @param {string} content
|
||||
*/ return (content)=>{
|
||||
/** @type {(string|string)[]} */ let results = [];
|
||||
for (let pattern of patterns){
|
||||
var _content_match;
|
||||
results = [
|
||||
...results,
|
||||
...(_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []
|
||||
];
|
||||
}
|
||||
return results.filter((v)=>v !== undefined).map(clipAtBalancedParens);
|
||||
};
|
||||
}
|
||||
function* buildRegExps(context) {
|
||||
let separator = context.tailwindConfig.separator;
|
||||
let variantGroupingEnabled = (0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping");
|
||||
let prefix = context.tailwindConfig.prefix !== "" ? _regex.optional(_regex.pattern([
|
||||
/-?/,
|
||||
_regex.escape(context.tailwindConfig.prefix)
|
||||
])) : "";
|
||||
let utility = _regex.any([
|
||||
// Arbitrary properties (without square brackets)
|
||||
/\[[^\s:'"`]+:[^\s\[\]]+\]/,
|
||||
// Arbitrary properties with balanced square brackets
|
||||
// This is a targeted fix to continue to allow theme()
|
||||
// with square brackets to work in arbitrary properties
|
||||
// while fixing a problem with the regex matching too much
|
||||
/\[[^\s:'"`]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
|
||||
// Utilities
|
||||
_regex.pattern([
|
||||
// Utility Name / Group Name
|
||||
/-?(?:\w+)/,
|
||||
// Normal/Arbitrary values
|
||||
_regex.optional(_regex.any([
|
||||
_regex.pattern([
|
||||
// Arbitrary values
|
||||
/-(?:\w+-)*\[[^\s:]+\]/,
|
||||
// Not immediately followed by an `{[(`
|
||||
/(?![{([]])/,
|
||||
// optionally followed by an opacity modifier
|
||||
/(?:\/[^\s'"`\\><$]*)?/
|
||||
]),
|
||||
_regex.pattern([
|
||||
// Arbitrary values
|
||||
/-(?:\w+-)*\[[^\s]+\]/,
|
||||
// Not immediately followed by an `{[(`
|
||||
/(?![{([]])/,
|
||||
// optionally followed by an opacity modifier
|
||||
/(?:\/[^\s'"`\\$]*)?/
|
||||
]),
|
||||
// Normal values w/o quotes — may include an opacity modifier
|
||||
/[-\/][^\s'"`\\$={><]*/
|
||||
]))
|
||||
])
|
||||
]);
|
||||
let variantPatterns = [
|
||||
// Without quotes
|
||||
_regex.any([
|
||||
// This is here to provide special support for the `@` variant
|
||||
_regex.pattern([
|
||||
/@\[[^\s"'`]+\](\/[^\s"'`]+)?/,
|
||||
separator
|
||||
]),
|
||||
_regex.pattern([
|
||||
/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/,
|
||||
separator
|
||||
]),
|
||||
_regex.pattern([
|
||||
/[^\s"'`\[\\]+/,
|
||||
separator
|
||||
])
|
||||
]),
|
||||
// With quotes allowed
|
||||
_regex.any([
|
||||
_regex.pattern([
|
||||
/([^\s"'`\[\\]+-)?\[[^\s`]+\]/,
|
||||
separator
|
||||
]),
|
||||
_regex.pattern([
|
||||
/[^\s`\[\\]+/,
|
||||
separator
|
||||
])
|
||||
])
|
||||
];
|
||||
for (const variantPattern of variantPatterns){
|
||||
yield _regex.pattern([
|
||||
// Variants
|
||||
"((?=((",
|
||||
variantPattern,
|
||||
")+))\\2)?",
|
||||
// Important (optional)
|
||||
/!?/,
|
||||
prefix,
|
||||
variantGroupingEnabled ? _regex.any([
|
||||
// Or any of those things but grouped separated by commas
|
||||
_regex.pattern([
|
||||
/\(/,
|
||||
utility,
|
||||
_regex.zeroOrMore([
|
||||
/,/,
|
||||
utility
|
||||
]),
|
||||
/\)/
|
||||
]),
|
||||
// Arbitrary properties, constrained utilities, arbitrary values, etc…
|
||||
utility
|
||||
]) : utility
|
||||
]);
|
||||
}
|
||||
// 5. Inner matches
|
||||
yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
|
||||
}
|
||||
// We want to capture any "special" characters
|
||||
// AND the characters immediately following them (if there is one)
|
||||
let SPECIALS = /([\[\]'"`])([^\[\]'"`])?/g;
|
||||
let ALLOWED_CLASS_CHARACTERS = /[^"'`\s<>\]]+/;
|
||||
/**
|
||||
* Clips a string ensuring that parentheses, quotes, etc… are balanced
|
||||
* Used for arbitrary values only
|
||||
*
|
||||
* We will go past the end of the balanced parens until we find a non-class character
|
||||
*
|
||||
* Depth matching behavior:
|
||||
* w-[calc(100%-theme('spacing[some_key][1.5]'))]']
|
||||
* ┬ ┬ ┬┬ ┬ ┬┬ ┬┬┬┬┬┬┬
|
||||
* 1 2 3 4 34 3 210 END
|
||||
* ╰────┴──────────┴────────┴────────┴┴───┴─┴┴┴
|
||||
*
|
||||
* @param {string} input
|
||||
*/ function clipAtBalancedParens(input) {
|
||||
// We are care about this for arbitrary values
|
||||
if (!input.includes("-[")) {
|
||||
return input;
|
||||
}
|
||||
let depth = 0;
|
||||
let openStringTypes = [];
|
||||
// Find all parens, brackets, quotes, etc
|
||||
// Stop when we end at a balanced pair
|
||||
// This is naive and will treat mismatched parens as balanced
|
||||
// This shouldn't be a problem in practice though
|
||||
let matches = input.matchAll(SPECIALS);
|
||||
// We can't use lookbehind assertions because we have to support Safari
|
||||
// So, instead, we've emulated it using capture groups and we'll re-work the matches to accommodate
|
||||
matches = Array.from(matches).flatMap((match)=>{
|
||||
const [, ...groups] = match;
|
||||
return groups.map((group, idx)=>Object.assign([], match, {
|
||||
index: match.index + idx,
|
||||
0: group
|
||||
}));
|
||||
});
|
||||
for (let match of matches){
|
||||
let char = match[0];
|
||||
let inStringType = openStringTypes[openStringTypes.length - 1];
|
||||
if (char === inStringType) {
|
||||
openStringTypes.pop();
|
||||
} else if (char === "'" || char === '"' || char === "`") {
|
||||
openStringTypes.push(char);
|
||||
}
|
||||
if (inStringType) {
|
||||
continue;
|
||||
} else if (char === "[") {
|
||||
depth++;
|
||||
continue;
|
||||
} else if (char === "]") {
|
||||
depth--;
|
||||
continue;
|
||||
}
|
||||
// We've gone one character past the point where we should stop
|
||||
// This means that there was an extra closing `]`
|
||||
// We'll clip to just before it
|
||||
if (depth < 0) {
|
||||
return input.substring(0, match.index - 1);
|
||||
}
|
||||
// We've finished balancing the brackets but there still may be characters that can be included
|
||||
// For example in the class `text-[#336699]/[.35]`
|
||||
// The depth goes to `0` at the closing `]` but goes up again at the `[`
|
||||
// If we're at zero and encounter a non-class character then we clip the class there
|
||||
if (depth === 0 && !ALLOWED_CLASS_CHARACTERS.test(char)) {
|
||||
return input.substring(0, match.index);
|
||||
}
|
||||
}
|
||||
return input;
|
||||
} // Regular utilities
|
||||
// {{modifier}:}*{namespace}{-{suffix}}*{/{opacityModifier}}?
|
||||
// Arbitrary values
|
||||
// {{modifier}:}*{namespace}-[{arbitraryValue}]{/{opacityModifier}}?
|
||||
// arbitraryValue: no whitespace, balanced quotes unless within quotes, balanced brackets unless within quotes
|
||||
// Arbitrary properties
|
||||
// {{modifier}:}*[{validCssPropertyName}:{arbitraryValue}]
|
||||
45
CTOAsYouGo/node_modules/tailwindcss/lib/lib/detectNesting.js
generated
vendored
45
CTOAsYouGo/node_modules/tailwindcss/lib/lib/detectNesting.js
generated
vendored
@@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
function isRoot(node) {
|
||||
return node.type === "root";
|
||||
}
|
||||
function isAtLayer(node) {
|
||||
return node.type === "atrule" && node.name === "layer";
|
||||
}
|
||||
function _default(_context) {
|
||||
return (root, result)=>{
|
||||
let found = false;
|
||||
root.walkAtRules("tailwind", (node)=>{
|
||||
if (found) return false;
|
||||
if (node.parent && !(isRoot(node.parent) || isAtLayer(node.parent))) {
|
||||
found = true;
|
||||
node.warn(result, [
|
||||
"Nested @tailwind rules were detected, but are not supported.",
|
||||
"Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix",
|
||||
"Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy"
|
||||
].join("\n"));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
root.walkRules((rule)=>{
|
||||
if (found) return false;
|
||||
rule.walkRules((nestedRule)=>{
|
||||
found = true;
|
||||
nestedRule.warn(result, [
|
||||
"Nested CSS was detected, but CSS nesting has not been configured correctly.",
|
||||
"Please enable a CSS nesting plugin *before* Tailwind in your configuration.",
|
||||
"See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting"
|
||||
].join("\n"));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
268
CTOAsYouGo/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js
generated
vendored
268
CTOAsYouGo/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js
generated
vendored
@@ -1,236 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv"));
|
||||
const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean"));
|
||||
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue"));
|
||||
const _postcssvalueparser = /*#__PURE__*/ _interop_require_default(require("postcss-value-parser"));
|
||||
const _normalizeScreens = require("../util/normalizeScreens");
|
||||
const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
|
||||
const _toPath = require("../util/toPath");
|
||||
const _withAlphaVariable = require("../util/withAlphaVariable");
|
||||
const _pluginUtils = require("../util/pluginUtils");
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isObject(input) {
|
||||
return typeof input === "object" && input !== null;
|
||||
}
|
||||
function findClosestExistingPath(theme, path) {
|
||||
let parts = (0, _toPath.toPath)(path);
|
||||
do {
|
||||
parts.pop();
|
||||
if ((0, _dlv.default)(theme, parts) !== undefined) break;
|
||||
}while (parts.length);
|
||||
return parts.length ? parts : undefined;
|
||||
}
|
||||
function pathToString(path) {
|
||||
if (typeof path === "string") return path;
|
||||
return path.reduce((acc, cur, i)=>{
|
||||
if (cur.includes(".")) return `${acc}[${cur}]`;
|
||||
return i === 0 ? cur : `${acc}.${cur}`;
|
||||
}, "");
|
||||
}
|
||||
function list(items) {
|
||||
return items.map((key)=>`'${key}'`).join(", ");
|
||||
}
|
||||
function listKeys(obj) {
|
||||
return list(Object.keys(obj));
|
||||
}
|
||||
function validatePath(config, path, defaultValue, themeOpts = {}) {
|
||||
const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, "");
|
||||
const pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString);
|
||||
const value = (0, _dlv.default)(config.theme, pathSegments, defaultValue);
|
||||
if (value === undefined) {
|
||||
let error = `'${pathString}' does not exist in your theme config.`;
|
||||
const parentSegments = pathSegments.slice(0, -1);
|
||||
const parentValue = (0, _dlv.default)(config.theme, parentSegments);
|
||||
if (isObject(parentValue)) {
|
||||
const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [
|
||||
...parentSegments,
|
||||
key
|
||||
]).isValid);
|
||||
const suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys);
|
||||
if (suggestion) {
|
||||
error += ` Did you mean '${pathToString([
|
||||
...parentSegments,
|
||||
suggestion
|
||||
])}'?`;
|
||||
} else if (validKeys.length > 0) {
|
||||
error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`;
|
||||
}
|
||||
} else {
|
||||
const closestPath = findClosestExistingPath(config.theme, pathString);
|
||||
if (closestPath) {
|
||||
const closestValue = (0, _dlv.default)(config.theme, closestPath);
|
||||
if (isObject(closestValue)) {
|
||||
error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`;
|
||||
} else {
|
||||
error += ` '${pathToString(closestPath)}' is not an object.`;
|
||||
}
|
||||
} else {
|
||||
error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`;
|
||||
}
|
||||
}
|
||||
return {
|
||||
isValid: false,
|
||||
error
|
||||
};
|
||||
}
|
||||
if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) {
|
||||
let error = `'${pathString}' was found but does not resolve to a string.`;
|
||||
if (isObject(value)) {
|
||||
let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
|
||||
...pathSegments,
|
||||
key
|
||||
]).isValid);
|
||||
if (validKeys.length) {
|
||||
error += ` Did you mean something like '${pathToString([
|
||||
...pathSegments,
|
||||
validKeys[0]
|
||||
])}'?`;
|
||||
}
|
||||
}
|
||||
return {
|
||||
isValid: false,
|
||||
error
|
||||
};
|
||||
}
|
||||
const [themeSection] = pathSegments;
|
||||
return {
|
||||
isValid: true,
|
||||
value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts)
|
||||
};
|
||||
}
|
||||
function extractArgs(node, vNodes, functions) {
|
||||
vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions));
|
||||
let args = [
|
||||
""
|
||||
];
|
||||
for (let vNode of vNodes){
|
||||
if (vNode.type === "div" && vNode.value === ",") {
|
||||
args.push("");
|
||||
} else {
|
||||
args[args.length - 1] += _postcssvalueparser.default.stringify(vNode);
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
function resolveVNode(node, vNode, functions) {
|
||||
if (vNode.type === "function" && functions[vNode.value] !== undefined) {
|
||||
let args = extractArgs(node, vNode.nodes, functions);
|
||||
vNode.type = "word";
|
||||
vNode.value = functions[vNode.value](node, ...args);
|
||||
}
|
||||
return vNode;
|
||||
}
|
||||
function resolveFunctions(node, input, functions) {
|
||||
return (0, _postcssvalueparser.default)(input).walk((vNode)=>{
|
||||
resolveVNode(node, vNode, functions);
|
||||
}).toString();
|
||||
}
|
||||
let nodeTypePropertyMap = {
|
||||
atrule: "params",
|
||||
decl: "value"
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcssFunctions = _interopRequireDefault(require("postcss-functions"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const themeTransforms = {
|
||||
fontSize(value) {
|
||||
return Array.isArray(value) ? value[0] : value;
|
||||
},
|
||||
|
||||
outline(value) {
|
||||
return Array.isArray(value) ? value[0] : value;
|
||||
}
|
||||
|
||||
};
|
||||
/**
|
||||
* @param {string} path
|
||||
* @returns {Iterable<[path: string, alpha: string|undefined]>}
|
||||
*/ function* toPaths(path) {
|
||||
// Strip quotes from beginning and end of string
|
||||
// This allows the alpha value to be present inside of quotes
|
||||
path = path.replace(/^['"]+|['"]+$/g, "");
|
||||
let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/);
|
||||
let alpha = undefined;
|
||||
yield [
|
||||
path,
|
||||
undefined
|
||||
];
|
||||
if (matches) {
|
||||
path = matches[1];
|
||||
alpha = matches[2];
|
||||
yield [
|
||||
path,
|
||||
alpha
|
||||
];
|
||||
|
||||
function defaultTransform(value) {
|
||||
return Array.isArray(value) ? value.join(', ') : value;
|
||||
}
|
||||
|
||||
function _default(config) {
|
||||
return (0, _postcssFunctions.default)({
|
||||
functions: {
|
||||
theme: (path, ...defaultValue) => {
|
||||
const trimmedPath = _lodash.default.trim(path, `'"`);
|
||||
|
||||
return _lodash.default.thru(_lodash.default.get(config.theme, trimmedPath, defaultValue), value => {
|
||||
const [themeSection] = trimmedPath.split('.');
|
||||
return _lodash.default.get(themeTransforms, themeSection, defaultTransform)(value);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {any} config
|
||||
* @param {string} path
|
||||
* @param {any} defaultValue
|
||||
*/ function resolvePath(config, path, defaultValue) {
|
||||
const results = Array.from(toPaths(path)).map(([path, alpha])=>{
|
||||
return Object.assign(validatePath(config, path, defaultValue, {
|
||||
opacityValue: alpha
|
||||
}), {
|
||||
resolvedPath: path,
|
||||
alpha
|
||||
});
|
||||
});
|
||||
var _results_find;
|
||||
return (_results_find = results.find((result)=>result.isValid)) !== null && _results_find !== void 0 ? _results_find : results[0];
|
||||
}
|
||||
function _default(context) {
|
||||
let config = context.tailwindConfig;
|
||||
let functions = {
|
||||
theme: (node, path, ...defaultValue)=>{
|
||||
let { isValid , value , error , alpha } = resolvePath(config, path, defaultValue.length ? defaultValue : undefined);
|
||||
if (!isValid) {
|
||||
var _parentNode_raws_tailwind;
|
||||
let parentNode = node.parent;
|
||||
let candidate = (_parentNode_raws_tailwind = parentNode === null || parentNode === void 0 ? void 0 : parentNode.raws.tailwind) === null || _parentNode_raws_tailwind === void 0 ? void 0 : _parentNode_raws_tailwind.candidate;
|
||||
if (parentNode && candidate !== undefined) {
|
||||
// Remove this utility from any caches
|
||||
context.markInvalidUtilityNode(parentNode);
|
||||
// Remove the CSS node from the markup
|
||||
parentNode.remove();
|
||||
// Show a warning
|
||||
_log.default.warn("invalid-theme-key-in-class", [
|
||||
`The utility \`${candidate}\` contains an invalid theme value and was not generated.`
|
||||
]);
|
||||
return;
|
||||
}
|
||||
throw node.error(error);
|
||||
}
|
||||
let maybeColor = (0, _pluginUtils.parseColorFormat)(value);
|
||||
let isColorFunction = maybeColor !== undefined && typeof maybeColor === "function";
|
||||
if (alpha !== undefined || isColorFunction) {
|
||||
if (alpha === undefined) {
|
||||
alpha = 1.0;
|
||||
}
|
||||
value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
screen: (node, screen)=>{
|
||||
screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, "");
|
||||
let screens = (0, _normalizeScreens.normalizeScreens)(config.theme.screens);
|
||||
let screenDefinition = screens.find(({ name })=>name === screen);
|
||||
if (!screenDefinition) {
|
||||
throw node.error(`The '${screen}' screen does not exist in your theme.`);
|
||||
}
|
||||
return (0, _buildMediaQuery.default)(screenDefinition);
|
||||
}
|
||||
};
|
||||
return (root)=>{
|
||||
root.walk((node)=>{
|
||||
let property = nodeTypePropertyMap[node.type];
|
||||
if (property === undefined) {
|
||||
return;
|
||||
}
|
||||
node[property] = resolveFunctions(node, node[property], functions);
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
534
CTOAsYouGo/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js
generated
vendored
534
CTOAsYouGo/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js
generated
vendored
@@ -1,534 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return expandApplyAtRules;
|
||||
}
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
||||
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
||||
const _generateRules = require("./generateRules");
|
||||
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
|
||||
const _applyImportantSelector = require("../util/applyImportantSelector");
|
||||
const _pseudoElements = require("../util/pseudoElements");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
/** @typedef {Map<string, [any, import('postcss').Rule[]]>} ApplyCache */ function extractClasses(node) {
|
||||
/** @type {Map<string, Set<string>>} */ let groups = new Map();
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
node.clone()
|
||||
]
|
||||
});
|
||||
container.walkRules((rule)=>{
|
||||
(0, _postcssselectorparser.default)((selectors)=>{
|
||||
selectors.walkClasses((classSelector)=>{
|
||||
let parentSelector = classSelector.parent.toString();
|
||||
let classes = groups.get(parentSelector);
|
||||
if (!classes) {
|
||||
groups.set(parentSelector, classes = new Set());
|
||||
}
|
||||
classes.add(classSelector.value);
|
||||
});
|
||||
}).processSync(rule.selector);
|
||||
});
|
||||
let normalizedGroups = Array.from(groups.values(), (classes)=>Array.from(classes));
|
||||
let classes = normalizedGroups.flat();
|
||||
return Object.assign(classes, {
|
||||
groups: normalizedGroups
|
||||
});
|
||||
}
|
||||
let selectorExtractor = (0, _postcssselectorparser.default)();
|
||||
/**
|
||||
* @param {string} ruleSelectors
|
||||
*/ function extractSelectors(ruleSelectors) {
|
||||
return selectorExtractor.astSync(ruleSelectors);
|
||||
}
|
||||
function extractBaseCandidates(candidates, separator) {
|
||||
let baseClasses = new Set();
|
||||
for (let candidate of candidates){
|
||||
baseClasses.add(candidate.split(separator).pop());
|
||||
}
|
||||
return Array.from(baseClasses);
|
||||
}
|
||||
function prefix(context, selector) {
|
||||
let prefix = context.tailwindConfig.prefix;
|
||||
return typeof prefix === "function" ? prefix(selector) : prefix + selector;
|
||||
}
|
||||
function* pathToRoot(node) {
|
||||
yield node;
|
||||
while(node.parent){
|
||||
yield node.parent;
|
||||
node = node.parent;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Only clone the node itself and not its children
|
||||
*
|
||||
* @param {*} node
|
||||
* @param {*} overrides
|
||||
* @returns
|
||||
*/ function shallowClone(node, overrides = {}) {
|
||||
let children = node.nodes;
|
||||
node.nodes = [];
|
||||
let tmp = node.clone(overrides);
|
||||
node.nodes = children;
|
||||
return tmp;
|
||||
}
|
||||
/**
|
||||
* Clone just the nodes all the way to the top that are required to represent
|
||||
* this singular rule in the tree.
|
||||
*
|
||||
* For example, if we have CSS like this:
|
||||
* ```css
|
||||
* @media (min-width: 768px) {
|
||||
* @supports (display: grid) {
|
||||
* .foo {
|
||||
* display: grid;
|
||||
* grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @supports (backdrop-filter: blur(1px)) {
|
||||
* .bar {
|
||||
* backdrop-filter: blur(1px);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* .baz {
|
||||
* color: orange;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* And we're cloning `.bar` it'll return a cloned version of what's required for just that single node:
|
||||
*
|
||||
* ```css
|
||||
* @media (min-width: 768px) {
|
||||
* @supports (backdrop-filter: blur(1px)) {
|
||||
* .bar {
|
||||
* backdrop-filter: blur(1px);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param {import('postcss').Node} node
|
||||
*/ function nestedClone(node) {
|
||||
for (let parent of pathToRoot(node)){
|
||||
if (node === parent) {
|
||||
continue;
|
||||
}
|
||||
if (parent.type === "root") {
|
||||
break;
|
||||
}
|
||||
node = shallowClone(parent, {
|
||||
nodes: [
|
||||
node
|
||||
]
|
||||
});
|
||||
}
|
||||
return node;
|
||||
}
|
||||
/**
|
||||
* @param {import('postcss').Root} root
|
||||
*/ function buildLocalApplyCache(root, context) {
|
||||
/** @type {ApplyCache} */ let cache = new Map();
|
||||
root.walkRules((rule)=>{
|
||||
// Ignore rules generated by Tailwind
|
||||
for (let node of pathToRoot(rule)){
|
||||
var _node_raws_tailwind;
|
||||
if (((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.layer) !== undefined) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Clone what's required to represent this singular rule in the tree
|
||||
let container = nestedClone(rule);
|
||||
let sort = context.offsets.create("user");
|
||||
for (let className of extractClasses(rule)){
|
||||
let list = cache.get(className) || [];
|
||||
cache.set(className, list);
|
||||
list.push([
|
||||
{
|
||||
layer: "user",
|
||||
sort,
|
||||
important: false
|
||||
},
|
||||
container
|
||||
]);
|
||||
}
|
||||
});
|
||||
return cache;
|
||||
}
|
||||
/**
|
||||
* @returns {ApplyCache}
|
||||
*/ function buildApplyCache(applyCandidates, context) {
|
||||
for (let candidate of applyCandidates){
|
||||
if (context.notClassCache.has(candidate) || context.applyClassCache.has(candidate)) {
|
||||
continue;
|
||||
}
|
||||
if (context.classCache.has(candidate)) {
|
||||
context.applyClassCache.set(candidate, context.classCache.get(candidate).map(([meta, rule])=>[
|
||||
meta,
|
||||
rule.clone()
|
||||
]));
|
||||
continue;
|
||||
}
|
||||
let matches = Array.from((0, _generateRules.resolveMatches)(candidate, context));
|
||||
if (matches.length === 0) {
|
||||
context.notClassCache.add(candidate);
|
||||
continue;
|
||||
}
|
||||
context.applyClassCache.set(candidate, matches);
|
||||
}
|
||||
return context.applyClassCache;
|
||||
}
|
||||
/**
|
||||
* Build a cache only when it's first used
|
||||
*
|
||||
* @param {() => ApplyCache} buildCacheFn
|
||||
* @returns {ApplyCache}
|
||||
*/ function lazyCache(buildCacheFn) {
|
||||
let cache = null;
|
||||
return {
|
||||
get: (name)=>{
|
||||
cache = cache || buildCacheFn();
|
||||
return cache.get(name);
|
||||
},
|
||||
has: (name)=>{
|
||||
cache = cache || buildCacheFn();
|
||||
return cache.has(name);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Take a series of multiple caches and merge
|
||||
* them so they act like one large cache
|
||||
*
|
||||
* @param {ApplyCache[]} caches
|
||||
* @returns {ApplyCache}
|
||||
*/ function combineCaches(caches) {
|
||||
return {
|
||||
get: (name)=>caches.flatMap((cache)=>cache.get(name) || []),
|
||||
has: (name)=>caches.some((cache)=>cache.has(name))
|
||||
};
|
||||
}
|
||||
function extractApplyCandidates(params) {
|
||||
let candidates = params.split(/[\s\t\n]+/g);
|
||||
if (candidates[candidates.length - 1] === "!important") {
|
||||
return [
|
||||
candidates.slice(0, -1),
|
||||
true
|
||||
];
|
||||
}
|
||||
return [
|
||||
candidates,
|
||||
false
|
||||
];
|
||||
}
|
||||
function processApply(root, context, localCache) {
|
||||
let applyCandidates = new Set();
|
||||
// Collect all @apply rules and candidates
|
||||
let applies = [];
|
||||
root.walkAtRules("apply", (rule)=>{
|
||||
let [candidates] = extractApplyCandidates(rule.params);
|
||||
for (let util of candidates){
|
||||
applyCandidates.add(util);
|
||||
}
|
||||
applies.push(rule);
|
||||
});
|
||||
// Start the @apply process if we have rules with @apply in them
|
||||
if (applies.length === 0) {
|
||||
return;
|
||||
}
|
||||
// Fill up some caches!
|
||||
let applyClassCache = combineCaches([
|
||||
localCache,
|
||||
buildApplyCache(applyCandidates, context)
|
||||
]);
|
||||
/**
|
||||
* When we have an apply like this:
|
||||
*
|
||||
* .abc {
|
||||
* @apply hover:font-bold;
|
||||
* }
|
||||
*
|
||||
* What we essentially will do is resolve to this:
|
||||
*
|
||||
* .abc {
|
||||
* @apply .hover\:font-bold:hover {
|
||||
* font-weight: 500;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* Notice that the to-be-applied class is `.hover\:font-bold:hover` and that the utility candidate was `hover:font-bold`.
|
||||
* What happens in this function is that we prepend a `.` and escape the candidate.
|
||||
* This will result in `.hover\:font-bold`
|
||||
* Which means that we can replace `.hover\:font-bold` with `.abc` in `.hover\:font-bold:hover` resulting in `.abc:hover`
|
||||
*
|
||||
* @param {string} selector
|
||||
* @param {string} utilitySelectors
|
||||
* @param {string} candidate
|
||||
*/ function replaceSelector(selector, utilitySelectors, candidate) {
|
||||
let selectorList = extractSelectors(selector);
|
||||
let utilitySelectorsList = extractSelectors(utilitySelectors);
|
||||
let candidateList = extractSelectors(`.${(0, _escapeClassName.default)(candidate)}`);
|
||||
let candidateClass = candidateList.nodes[0].nodes[0];
|
||||
selectorList.each((sel)=>{
|
||||
/** @type {Set<import('postcss-selector-parser').Selector>} */ let replaced = new Set();
|
||||
utilitySelectorsList.each((utilitySelector)=>{
|
||||
let hasReplaced = false;
|
||||
utilitySelector = utilitySelector.clone();
|
||||
utilitySelector.walkClasses((node)=>{
|
||||
if (node.value !== candidateClass.value) {
|
||||
return;
|
||||
}
|
||||
// Don't replace multiple instances of the same class
|
||||
// This is theoretically correct but only partially
|
||||
// We'd need to generate every possible permutation of the replacement
|
||||
// For example with `.foo + .foo { … }` and `section { @apply foo; }`
|
||||
// We'd need to generate all of these:
|
||||
// - `.foo + .foo`
|
||||
// - `.foo + section`
|
||||
// - `section + .foo`
|
||||
// - `section + section`
|
||||
if (hasReplaced) {
|
||||
return;
|
||||
}
|
||||
// Since you can only `@apply` class names this is sufficient
|
||||
// We want to replace the matched class name with the selector the user is using
|
||||
// Ex: Replace `.text-blue-500` with `.foo.bar:is(.something-cool)`
|
||||
node.replaceWith(...sel.nodes.map((node)=>node.clone()));
|
||||
// Record that we did something and we want to use this new selector
|
||||
replaced.add(utilitySelector);
|
||||
hasReplaced = true;
|
||||
});
|
||||
});
|
||||
// Sort tag names before class names (but only sort each group (separated by a combinator)
|
||||
// separately and not in total)
|
||||
// This happens when replacing `.bar` in `.foo.bar` with a tag like `section`
|
||||
for (let sel of replaced){
|
||||
let groups = [
|
||||
[]
|
||||
];
|
||||
for (let node of sel.nodes){
|
||||
if (node.type === "combinator") {
|
||||
groups.push(node);
|
||||
groups.push([]);
|
||||
} else {
|
||||
let last = groups[groups.length - 1];
|
||||
last.push(node);
|
||||
}
|
||||
}
|
||||
sel.nodes = [];
|
||||
for (let group of groups){
|
||||
if (Array.isArray(group)) {
|
||||
group.sort((a, b)=>{
|
||||
if (a.type === "tag" && b.type === "class") {
|
||||
return -1;
|
||||
} else if (a.type === "class" && b.type === "tag") {
|
||||
return 1;
|
||||
} else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) {
|
||||
return -1;
|
||||
} else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
sel.nodes = sel.nodes.concat(group);
|
||||
}
|
||||
}
|
||||
sel.replaceWith(...replaced);
|
||||
});
|
||||
return selectorList.toString();
|
||||
}
|
||||
let perParentApplies = new Map();
|
||||
// Collect all apply candidates and their rules
|
||||
for (let apply of applies){
|
||||
let [candidates] = perParentApplies.get(apply.parent) || [
|
||||
[],
|
||||
apply.source
|
||||
];
|
||||
perParentApplies.set(apply.parent, [
|
||||
candidates,
|
||||
apply.source
|
||||
]);
|
||||
let [applyCandidates, important] = extractApplyCandidates(apply.params);
|
||||
if (apply.parent.type === "atrule") {
|
||||
if (apply.parent.name === "screen") {
|
||||
let screenType = apply.parent.params;
|
||||
throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates.map((c)=>`${screenType}:${c}`).join(" ")} instead.`);
|
||||
}
|
||||
throw apply.error(`@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.`);
|
||||
}
|
||||
for (let applyCandidate of applyCandidates){
|
||||
if ([
|
||||
prefix(context, "group"),
|
||||
prefix(context, "peer")
|
||||
].includes(applyCandidate)) {
|
||||
// TODO: Link to specific documentation page with error code.
|
||||
throw apply.error(`@apply should not be used with the '${applyCandidate}' utility`);
|
||||
}
|
||||
if (!applyClassCache.has(applyCandidate)) {
|
||||
throw apply.error(`The \`${applyCandidate}\` class does not exist. If \`${applyCandidate}\` is a custom class, make sure it is defined within a \`@layer\` directive.`);
|
||||
}
|
||||
let rules = applyClassCache.get(applyCandidate);
|
||||
candidates.push([
|
||||
applyCandidate,
|
||||
important,
|
||||
rules
|
||||
]);
|
||||
}
|
||||
}
|
||||
for (let [parent, [candidates, atApplySource]] of perParentApplies){
|
||||
let siblings = [];
|
||||
for (let [applyCandidate, important, rules] of candidates){
|
||||
let potentialApplyCandidates = [
|
||||
applyCandidate,
|
||||
...extractBaseCandidates([
|
||||
applyCandidate
|
||||
], context.tailwindConfig.separator)
|
||||
];
|
||||
for (let [meta, node] of rules){
|
||||
let parentClasses = extractClasses(parent);
|
||||
let nodeClasses = extractClasses(node);
|
||||
// When we encounter a rule like `.dark .a, .b { … }` we only want to be left with `[.dark, .a]` if the base applyCandidate is `.a` or with `[.b]` if the base applyCandidate is `.b`
|
||||
// So we've split them into groups
|
||||
nodeClasses = nodeClasses.groups.filter((classList)=>classList.some((className)=>potentialApplyCandidates.includes(className))).flat();
|
||||
// Add base utility classes from the @apply node to the list of
|
||||
// classes to check whether it intersects and therefore results in a
|
||||
// circular dependency or not.
|
||||
//
|
||||
// E.g.:
|
||||
// .foo {
|
||||
// @apply hover:a; // This applies "a" but with a modifier
|
||||
// }
|
||||
//
|
||||
// We only have to do that with base classes of the `node`, not of the `parent`
|
||||
// E.g.:
|
||||
// .hover\:foo {
|
||||
// @apply bar;
|
||||
// }
|
||||
// .bar {
|
||||
// @apply foo;
|
||||
// }
|
||||
//
|
||||
// This should not result in a circular dependency because we are
|
||||
// just applying `.foo` and the rule above is `.hover\:foo` which is
|
||||
// unrelated. However, if we were to apply `hover:foo` then we _did_
|
||||
// have to include this one.
|
||||
nodeClasses = nodeClasses.concat(extractBaseCandidates(nodeClasses, context.tailwindConfig.separator));
|
||||
let intersects = parentClasses.some((selector)=>nodeClasses.includes(selector));
|
||||
if (intersects) {
|
||||
throw node.error(`You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.`);
|
||||
}
|
||||
let root = _postcss.default.root({
|
||||
nodes: [
|
||||
node.clone()
|
||||
]
|
||||
});
|
||||
// Make sure every node in the entire tree points back at the @apply rule that generated it
|
||||
root.walk((node)=>{
|
||||
node.source = atApplySource;
|
||||
});
|
||||
let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes";
|
||||
if (canRewriteSelector) {
|
||||
root.walkRules((rule)=>{
|
||||
// Let's imagine you have the following structure:
|
||||
//
|
||||
// .foo {
|
||||
// @apply bar;
|
||||
// }
|
||||
//
|
||||
// @supports (a: b) {
|
||||
// .bar {
|
||||
// color: blue
|
||||
// }
|
||||
//
|
||||
// .something-unrelated {}
|
||||
// }
|
||||
//
|
||||
// In this case we want to apply `.bar` but it happens to be in
|
||||
// an atrule node. We clone that node instead of the nested one
|
||||
// because we still want that @supports rule to be there once we
|
||||
// applied everything.
|
||||
//
|
||||
// However it happens to be that the `.something-unrelated` is
|
||||
// also in that same shared @supports atrule. This is not good,
|
||||
// and this should not be there. The good part is that this is
|
||||
// a clone already and it can be safely removed. The question is
|
||||
// how do we know we can remove it. Basically what we can do is
|
||||
// match it against the applyCandidate that you want to apply. If
|
||||
// it doesn't match the we can safely delete it.
|
||||
//
|
||||
// If we didn't do this, then the `replaceSelector` function
|
||||
// would have replaced this with something that didn't exist and
|
||||
// therefore it removed the selector altogether. In this specific
|
||||
// case it would result in `{}` instead of `.something-unrelated {}`
|
||||
if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate)) {
|
||||
rule.remove();
|
||||
return;
|
||||
}
|
||||
// Strip the important selector from the parent selector if at the beginning
|
||||
let importantSelector = typeof context.tailwindConfig.important === "string" ? context.tailwindConfig.important : null;
|
||||
// We only want to move the "important" selector if this is a Tailwind-generated utility
|
||||
// We do *not* want to do this for user CSS that happens to be structured the same
|
||||
let isGenerated = parent.raws.tailwind !== undefined;
|
||||
let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector;
|
||||
rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate);
|
||||
// And then re-add it if it was removed
|
||||
if (importantSelector && parentSelector !== parent.selector) {
|
||||
rule.selector = (0, _applyImportantSelector.applyImportantSelector)(rule.selector, importantSelector);
|
||||
}
|
||||
rule.walkDecls((d)=>{
|
||||
d.important = meta.important || important;
|
||||
});
|
||||
// Move pseudo elements to the end of the selector (if necessary)
|
||||
let selector = (0, _postcssselectorparser.default)().astSync(rule.selector);
|
||||
selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
|
||||
rule.selector = selector.toString();
|
||||
});
|
||||
}
|
||||
// It could be that the node we were inserted was removed because the class didn't match
|
||||
// If that was the *only* rule in the parent, then we have nothing add so we skip it
|
||||
if (!root.nodes[0]) {
|
||||
continue;
|
||||
}
|
||||
// Insert it
|
||||
siblings.push([
|
||||
meta.sort,
|
||||
root.nodes[0]
|
||||
]);
|
||||
}
|
||||
}
|
||||
// Inject the rules, sorted, correctly
|
||||
let nodes = context.offsets.sort(siblings).map((s)=>s[1]);
|
||||
// `parent` refers to the node at `.abc` in: .abc { @apply mt-2 }
|
||||
parent.after(nodes);
|
||||
}
|
||||
for (let apply of applies){
|
||||
// If there are left-over declarations, just remove the @apply
|
||||
if (apply.parent.nodes.length > 1) {
|
||||
apply.remove();
|
||||
} else {
|
||||
// The node is empty, drop the full node
|
||||
apply.parent.remove();
|
||||
}
|
||||
}
|
||||
// Do it again, in case we have other `@apply` rules
|
||||
processApply(root, context, localCache);
|
||||
}
|
||||
function expandApplyAtRules(context) {
|
||||
return (root)=>{
|
||||
// Build a cache of the user's CSS so we can use it to resolve classes used by @apply
|
||||
let localCache = lazyCache(()=>buildLocalApplyCache(root, context));
|
||||
processApply(root, context, localCache);
|
||||
};
|
||||
}
|
||||
274
CTOAsYouGo/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js
generated
vendored
274
CTOAsYouGo/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js
generated
vendored
@@ -1,274 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return expandTailwindAtRules;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru"));
|
||||
const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
|
||||
const _generateRules = require("./generateRules");
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
|
||||
const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes"));
|
||||
const _defaultExtractor = require("./defaultExtractor");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
let env = _sharedState.env;
|
||||
const builtInExtractors = {
|
||||
DEFAULT: _defaultExtractor.defaultExtractor
|
||||
};
|
||||
const builtInTransformers = {
|
||||
DEFAULT: (content)=>content,
|
||||
svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ")
|
||||
};
|
||||
function getExtractor(context, fileExtension) {
|
||||
let extractors = context.tailwindConfig.content.extract;
|
||||
return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context);
|
||||
}
|
||||
function getTransformer(tailwindConfig, fileExtension) {
|
||||
let transformers = tailwindConfig.content.transform;
|
||||
return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT;
|
||||
}
|
||||
let extractorCache = new WeakMap();
|
||||
// Scans template contents for possible classes. This is a hot path on initial build but
|
||||
// not too important for subsequent builds. The faster the better though — if we can speed
|
||||
// up these regexes by 50% that could cut initial build time by like 20%.
|
||||
function getClassCandidates(content, extractor, candidates, seen) {
|
||||
if (!extractorCache.has(extractor)) {
|
||||
extractorCache.set(extractor, new _quicklru.default({
|
||||
maxSize: 25000
|
||||
}));
|
||||
}
|
||||
for (let line of content.split("\n")){
|
||||
line = line.trim();
|
||||
if (seen.has(line)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(line);
|
||||
if (extractorCache.get(extractor).has(line)) {
|
||||
for (let match of extractorCache.get(extractor).get(line)){
|
||||
candidates.add(match);
|
||||
}
|
||||
} else {
|
||||
let extractorMatches = extractor(line).filter((s)=>s !== "!*");
|
||||
let lineMatchesSet = new Set(extractorMatches);
|
||||
for (let match of lineMatchesSet){
|
||||
candidates.add(match);
|
||||
}
|
||||
extractorCache.get(extractor).set(line, lineMatchesSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules
|
||||
* @param {*} context
|
||||
*/ function buildStylesheet(rules, context) {
|
||||
let sortedRules = context.offsets.sort(rules);
|
||||
let returnValue = {
|
||||
base: new Set(),
|
||||
defaults: new Set(),
|
||||
components: new Set(),
|
||||
utilities: new Set(),
|
||||
variants: new Set()
|
||||
};
|
||||
for (let [sort, rule] of sortedRules){
|
||||
returnValue[sort.layer].add(rule);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
function expandTailwindAtRules(context) {
|
||||
return (root)=>{
|
||||
let layerNodes = {
|
||||
base: null,
|
||||
components: null,
|
||||
utilities: null,
|
||||
variants: null
|
||||
};
|
||||
root.walkAtRules((rule)=>{
|
||||
// Make sure this file contains Tailwind directives. If not, we can save
|
||||
// a lot of work and bail early. Also we don't have to register our touch
|
||||
// file as a dependency since the output of this CSS does not depend on
|
||||
// the source of any templates. Think Vue <style> blocks for example.
|
||||
if (rule.name === "tailwind") {
|
||||
if (Object.keys(layerNodes).includes(rule.params)) {
|
||||
layerNodes[rule.params] = rule;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (Object.values(layerNodes).every((n)=>n === null)) {
|
||||
return root;
|
||||
}
|
||||
var _context_candidates;
|
||||
// ---
|
||||
// Find potential rules in changed files
|
||||
let candidates = new Set([
|
||||
...(_context_candidates = context.candidates) !== null && _context_candidates !== void 0 ? _context_candidates : [],
|
||||
_sharedState.NOT_ON_DEMAND
|
||||
]);
|
||||
let seen = new Set();
|
||||
env.DEBUG && console.time("Reading changed files");
|
||||
if (false) {
|
||||
// TODO: Pass through or implement `extractor`
|
||||
for (let candidate of require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)){
|
||||
candidates.add(candidate);
|
||||
}
|
||||
// for (let { file, content, extension } of context.changedContent) {
|
||||
// let transformer = getTransformer(context.tailwindConfig, extension)
|
||||
// let extractor = getExtractor(context, extension)
|
||||
// getClassCandidatesOxide(file, transformer(content), extractor, candidates, seen)
|
||||
// }
|
||||
} else {
|
||||
for (let { file , content , extension } of context.changedContent){
|
||||
let transformer = getTransformer(context.tailwindConfig, extension);
|
||||
let extractor = getExtractor(context, extension);
|
||||
content = file ? _fs.default.readFileSync(file, "utf8") : content;
|
||||
getClassCandidates(transformer(content), extractor, candidates, seen);
|
||||
}
|
||||
}
|
||||
env.DEBUG && console.timeEnd("Reading changed files");
|
||||
// ---
|
||||
// Generate the actual CSS
|
||||
let classCacheCount = context.classCache.size;
|
||||
env.DEBUG && console.time("Generate rules");
|
||||
env.DEBUG && console.time("Sorting candidates");
|
||||
let sortedCandidates = false ? candidates : new Set([
|
||||
...candidates
|
||||
].sort((a, z)=>{
|
||||
if (a === z) return 0;
|
||||
if (a < z) return -1;
|
||||
return 1;
|
||||
}));
|
||||
env.DEBUG && console.timeEnd("Sorting candidates");
|
||||
(0, _generateRules.generateRules)(sortedCandidates, context);
|
||||
env.DEBUG && console.timeEnd("Generate rules");
|
||||
// We only ever add to the classCache, so if it didn't grow, there is nothing new.
|
||||
env.DEBUG && console.time("Build stylesheet");
|
||||
if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) {
|
||||
context.stylesheetCache = buildStylesheet([
|
||||
...context.ruleCache
|
||||
], context);
|
||||
}
|
||||
env.DEBUG && console.timeEnd("Build stylesheet");
|
||||
let { defaults: defaultNodes , base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes } = context.stylesheetCache;
|
||||
// ---
|
||||
// Replace any Tailwind directives with generated CSS
|
||||
if (layerNodes.base) {
|
||||
layerNodes.base.before((0, _cloneNodes.default)([
|
||||
...baseNodes,
|
||||
...defaultNodes
|
||||
], layerNodes.base.source, {
|
||||
layer: "base"
|
||||
}));
|
||||
layerNodes.base.remove();
|
||||
}
|
||||
if (layerNodes.components) {
|
||||
layerNodes.components.before((0, _cloneNodes.default)([
|
||||
...componentNodes
|
||||
], layerNodes.components.source, {
|
||||
layer: "components"
|
||||
}));
|
||||
layerNodes.components.remove();
|
||||
}
|
||||
if (layerNodes.utilities) {
|
||||
layerNodes.utilities.before((0, _cloneNodes.default)([
|
||||
...utilityNodes
|
||||
], layerNodes.utilities.source, {
|
||||
layer: "utilities"
|
||||
}));
|
||||
layerNodes.utilities.remove();
|
||||
}
|
||||
// We do post-filtering to not alter the emitted order of the variants
|
||||
const variantNodes = Array.from(screenNodes).filter((node)=>{
|
||||
var _node_raws_tailwind;
|
||||
const parentLayer = (_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer;
|
||||
if (parentLayer === "components") {
|
||||
return layerNodes.components !== null;
|
||||
}
|
||||
if (parentLayer === "utilities") {
|
||||
return layerNodes.utilities !== null;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (layerNodes.variants) {
|
||||
layerNodes.variants.before((0, _cloneNodes.default)(variantNodes, layerNodes.variants.source, {
|
||||
layer: "variants"
|
||||
}));
|
||||
layerNodes.variants.remove();
|
||||
} else if (variantNodes.length > 0) {
|
||||
root.append((0, _cloneNodes.default)(variantNodes, root.source, {
|
||||
layer: "variants"
|
||||
}));
|
||||
}
|
||||
// If we've got a utility layer and no utilities are generated there's likely something wrong
|
||||
const hasUtilityVariants = variantNodes.some((node)=>{
|
||||
var _node_raws_tailwind;
|
||||
return ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer) === "utilities";
|
||||
});
|
||||
if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) {
|
||||
_log.default.warn("content-problems", [
|
||||
"No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.",
|
||||
"https://tailwindcss.com/docs/content-configuration"
|
||||
]);
|
||||
}
|
||||
// ---
|
||||
if (env.DEBUG) {
|
||||
console.log("Potential classes: ", candidates.size);
|
||||
console.log("Active contexts: ", _sharedState.contextSourcesMap.size);
|
||||
}
|
||||
// Clear the cache for the changed files
|
||||
context.changedContent = [];
|
||||
// Cleanup any leftover @layer atrules
|
||||
root.walkAtRules("layer", (rule)=>{
|
||||
if (Object.keys(layerNodes).includes(rule.params)) {
|
||||
rule.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
46
CTOAsYouGo/node_modules/tailwindcss/lib/lib/findAtConfigPath.js
generated
vendored
46
CTOAsYouGo/node_modules/tailwindcss/lib/lib/findAtConfigPath.js
generated
vendored
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "findAtConfigPath", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return findAtConfigPath;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function findAtConfigPath(root, result) {
|
||||
let configPath = null;
|
||||
let relativeTo = null;
|
||||
root.walkAtRules("config", (rule)=>{
|
||||
var _rule_source;
|
||||
var _rule_source_input_file, _ref;
|
||||
relativeTo = (_ref = (_rule_source_input_file = (_rule_source = rule.source) === null || _rule_source === void 0 ? void 0 : _rule_source.input.file) !== null && _rule_source_input_file !== void 0 ? _rule_source_input_file : result.opts.from) !== null && _ref !== void 0 ? _ref : null;
|
||||
if (relativeTo === null) {
|
||||
throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
|
||||
}
|
||||
if (configPath) {
|
||||
throw rule.error("Only one `@config` directive is allowed per file.");
|
||||
}
|
||||
let matches = rule.params.match(/(['"])(.*?)\1/);
|
||||
if (!matches) {
|
||||
throw rule.error("A path is required when using the `@config` directive.");
|
||||
}
|
||||
let inputPath = matches[2];
|
||||
if (_path.default.isAbsolute(inputPath)) {
|
||||
throw rule.error("The `@config` directive cannot be used with an absolute path.");
|
||||
}
|
||||
configPath = _path.default.resolve(_path.default.dirname(relativeTo), inputPath);
|
||||
if (!_fs.default.existsSync(configPath)) {
|
||||
throw rule.error(`The config file at "${inputPath}" does not exist. Make sure the path is correct and the file exists.`);
|
||||
}
|
||||
rule.remove();
|
||||
});
|
||||
return configPath ? configPath : null;
|
||||
}
|
||||
25
CTOAsYouGo/node_modules/tailwindcss/lib/lib/formatCSS.js
generated
vendored
Normal file
25
CTOAsYouGo/node_modules/tailwindcss/lib/lib/formatCSS.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = formatNodes;
|
||||
|
||||
function indentRecursive(node, indent = 0) {
|
||||
node.each && node.each((child, i) => {
|
||||
if (!child.raws.before || child.raws.before.includes('\n')) {
|
||||
child.raws.before = `\n${node.type !== 'rule' && i > 0 ? '\n' : ''}${' '.repeat(indent)}`;
|
||||
}
|
||||
|
||||
child.raws.after = `\n${' '.repeat(indent)}`;
|
||||
indentRecursive(child, indent + 1);
|
||||
});
|
||||
}
|
||||
|
||||
function formatNodes(root) {
|
||||
indentRecursive(root);
|
||||
|
||||
if (root.first) {
|
||||
root.first.raws.before = '';
|
||||
}
|
||||
}
|
||||
882
CTOAsYouGo/node_modules/tailwindcss/lib/lib/generateRules.js
generated
vendored
882
CTOAsYouGo/node_modules/tailwindcss/lib/lib/generateRules.js
generated
vendored
@@ -1,882 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getClassNameFromSelector: function() {
|
||||
return getClassNameFromSelector;
|
||||
},
|
||||
resolveMatches: function() {
|
||||
return resolveMatches;
|
||||
},
|
||||
generateRules: function() {
|
||||
return generateRules;
|
||||
}
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
||||
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
||||
const _parseObjectStyles = /*#__PURE__*/ _interop_require_default(require("../util/parseObjectStyles"));
|
||||
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("../util/isPlainObject"));
|
||||
const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
|
||||
const _pluginUtils = require("../util/pluginUtils");
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
|
||||
const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
|
||||
const _formatVariantSelector = require("../util/formatVariantSelector");
|
||||
const _nameClass = require("../util/nameClass");
|
||||
const _dataTypes = require("../util/dataTypes");
|
||||
const _setupContextUtils = require("./setupContextUtils");
|
||||
const _isSyntacticallyValidPropertyValue = /*#__PURE__*/ _interop_require_default(require("../util/isSyntacticallyValidPropertyValue"));
|
||||
const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly.js");
|
||||
const _featureFlags = require("../featureFlags");
|
||||
const _applyImportantSelector = require("../util/applyImportantSelector");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
let classNameParser = (0, _postcssselectorparser.default)((selectors)=>{
|
||||
return selectors.first.filter(({ type })=>type === "class").pop().value;
|
||||
});
|
||||
function getClassNameFromSelector(selector) {
|
||||
return classNameParser.transformSync(selector);
|
||||
}
|
||||
// Generate match permutations for a class candidate, like:
|
||||
// ['ring-offset-blue', '100']
|
||||
// ['ring-offset', 'blue-100']
|
||||
// ['ring', 'offset-blue-100']
|
||||
// Example with dynamic classes:
|
||||
// ['grid-cols', '[[linename],1fr,auto]']
|
||||
// ['grid', 'cols-[[linename],1fr,auto]']
|
||||
function* candidatePermutations(candidate) {
|
||||
let lastIndex = Infinity;
|
||||
while(lastIndex >= 0){
|
||||
let dashIdx;
|
||||
let wasSlash = false;
|
||||
if (lastIndex === Infinity && candidate.endsWith("]")) {
|
||||
let bracketIdx = candidate.indexOf("[");
|
||||
// If character before `[` isn't a dash or a slash, this isn't a dynamic class
|
||||
// eg. string[]
|
||||
if (candidate[bracketIdx - 1] === "-") {
|
||||
dashIdx = bracketIdx - 1;
|
||||
} else if (candidate[bracketIdx - 1] === "/") {
|
||||
dashIdx = bracketIdx - 1;
|
||||
wasSlash = true;
|
||||
} else {
|
||||
dashIdx = -1;
|
||||
}
|
||||
} else if (lastIndex === Infinity && candidate.includes("/")) {
|
||||
dashIdx = candidate.lastIndexOf("/");
|
||||
wasSlash = true;
|
||||
} else {
|
||||
dashIdx = candidate.lastIndexOf("-", lastIndex);
|
||||
}
|
||||
if (dashIdx < 0) {
|
||||
break;
|
||||
}
|
||||
let prefix = candidate.slice(0, dashIdx);
|
||||
let modifier = candidate.slice(wasSlash ? dashIdx : dashIdx + 1);
|
||||
lastIndex = dashIdx - 1;
|
||||
// TODO: This feels a bit hacky
|
||||
if (prefix === "" || modifier === "/") {
|
||||
continue;
|
||||
}
|
||||
yield [
|
||||
prefix,
|
||||
modifier
|
||||
];
|
||||
}
|
||||
}
|
||||
function applyPrefix(matches, context) {
|
||||
if (matches.length === 0 || context.tailwindConfig.prefix === "") {
|
||||
return matches;
|
||||
}
|
||||
for (let match of matches){
|
||||
let [meta] = match;
|
||||
if (meta.options.respectPrefix) {
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
match[1].clone()
|
||||
]
|
||||
});
|
||||
let classCandidate = match[1].raws.tailwind.classCandidate;
|
||||
container.walkRules((r)=>{
|
||||
// If this is a negative utility with a dash *before* the prefix we
|
||||
// have to ensure that the generated selector matches the candidate
|
||||
// Not doing this will cause `-tw-top-1` to generate the class `.tw--top-1`
|
||||
// The disconnect between candidate <-> class can cause @apply to hard crash.
|
||||
let shouldPrependNegative = classCandidate.startsWith("-");
|
||||
r.selector = (0, _prefixSelector.default)(context.tailwindConfig.prefix, r.selector, shouldPrependNegative);
|
||||
});
|
||||
match[1] = container.nodes[0];
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
}
|
||||
function applyImportant(matches, classCandidate) {
|
||||
if (matches.length === 0) {
|
||||
return matches;
|
||||
}
|
||||
let result = [];
|
||||
for (let [meta, rule] of matches){
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
rule.clone()
|
||||
]
|
||||
});
|
||||
container.walkRules((r)=>{
|
||||
let ast = (0, _postcssselectorparser.default)().astSync(r.selector);
|
||||
// Remove extraneous selectors that do not include the base candidate
|
||||
ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
|
||||
// Update all instances of the base candidate to include the important marker
|
||||
(0, _pluginUtils.updateAllClasses)(ast, (className)=>className === classCandidate ? `!${className}` : className);
|
||||
r.selector = ast.toString();
|
||||
r.walkDecls((d)=>d.important = true);
|
||||
});
|
||||
result.push([
|
||||
{
|
||||
...meta,
|
||||
important: true
|
||||
},
|
||||
container.nodes[0]
|
||||
]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Takes a list of rule tuples and applies a variant like `hover`, sm`,
|
||||
// whatever to it. We used to do some extra caching here to avoid generating
|
||||
// a variant of the same rule more than once, but this was never hit because
|
||||
// we cache at the entire selector level further up the tree.
|
||||
//
|
||||
// Technically you can get a cache hit if you have `hover:focus:text-center`
|
||||
// and `focus:hover:text-center` in the same project, but it doesn't feel
|
||||
// worth the complexity for that case.
|
||||
function applyVariant(variant, matches, context) {
|
||||
if (matches.length === 0) {
|
||||
return matches;
|
||||
}
|
||||
/** @type {{modifier: string | null, value: string | null}} */ let args = {
|
||||
modifier: null,
|
||||
value: _sharedState.NONE
|
||||
};
|
||||
// Retrieve "modifier"
|
||||
{
|
||||
let [baseVariant, ...modifiers] = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(variant, "/");
|
||||
// This is a hack to support variants with `/` in them, like `ar-1/10/20:text-red-500`
|
||||
// In this case 1/10 is a value but /20 is a modifier
|
||||
if (modifiers.length > 1) {
|
||||
baseVariant = baseVariant + "/" + modifiers.slice(0, -1).join("/");
|
||||
modifiers = modifiers.slice(-1);
|
||||
}
|
||||
if (modifiers.length && !context.variantMap.has(variant)) {
|
||||
variant = baseVariant;
|
||||
args.modifier = modifiers[0];
|
||||
if (!(0, _featureFlags.flagEnabled)(context.tailwindConfig, "generalizedModifiers")) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Retrieve "arbitrary value"
|
||||
if (variant.endsWith("]") && !variant.startsWith("[")) {
|
||||
// We either have:
|
||||
// @[200px]
|
||||
// group-[:hover]
|
||||
//
|
||||
// But we don't want:
|
||||
// @-[200px] (`-` is incorrect)
|
||||
// group[:hover] (`-` is missing)
|
||||
let match = /(.)(-?)\[(.*)\]/g.exec(variant);
|
||||
if (match) {
|
||||
let [, char, seperator, value] = match;
|
||||
// @-[200px] case
|
||||
if (char === "@" && seperator === "-") return [];
|
||||
// group[:hover] case
|
||||
if (char !== "@" && seperator === "") return [];
|
||||
variant = variant.replace(`${seperator}[${value}]`, "");
|
||||
args.value = value;
|
||||
}
|
||||
}
|
||||
// Register arbitrary variants
|
||||
if (isArbitraryValue(variant) && !context.variantMap.has(variant)) {
|
||||
let sort = context.offsets.recordVariant(variant);
|
||||
let selector = (0, _dataTypes.normalize)(variant.slice(1, -1));
|
||||
let selectors = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(selector, ",");
|
||||
// We do not support multiple selectors for arbitrary variants
|
||||
if (selectors.length > 1) {
|
||||
return [];
|
||||
}
|
||||
if (!selectors.every(_setupContextUtils.isValidVariantFormatString)) {
|
||||
return [];
|
||||
}
|
||||
let records = selectors.map((sel, idx)=>[
|
||||
context.offsets.applyParallelOffset(sort, idx),
|
||||
(0, _setupContextUtils.parseVariant)(sel.trim())
|
||||
]);
|
||||
context.variantMap.set(variant, records);
|
||||
}
|
||||
if (context.variantMap.has(variant)) {
|
||||
let isArbitraryVariant = isArbitraryValue(variant);
|
||||
let variantFunctionTuples = context.variantMap.get(variant).slice();
|
||||
let result = [];
|
||||
for (let [meta, rule] of matches){
|
||||
// Don't generate variants for user css
|
||||
if (meta.layer === "user") {
|
||||
continue;
|
||||
}
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
rule.clone()
|
||||
]
|
||||
});
|
||||
for (let [variantSort, variantFunction, containerFromArray] of variantFunctionTuples){
|
||||
let clone = (containerFromArray !== null && containerFromArray !== void 0 ? containerFromArray : container).clone();
|
||||
let collectedFormats = [];
|
||||
function prepareBackup() {
|
||||
// Already prepared, chicken out
|
||||
if (clone.raws.neededBackup) {
|
||||
return;
|
||||
}
|
||||
clone.raws.neededBackup = true;
|
||||
clone.walkRules((rule)=>rule.raws.originalSelector = rule.selector);
|
||||
}
|
||||
function modifySelectors(modifierFunction) {
|
||||
prepareBackup();
|
||||
clone.each((rule)=>{
|
||||
if (rule.type !== "rule") {
|
||||
return;
|
||||
}
|
||||
rule.selectors = rule.selectors.map((selector)=>{
|
||||
return modifierFunction({
|
||||
get className () {
|
||||
return getClassNameFromSelector(selector);
|
||||
},
|
||||
selector
|
||||
});
|
||||
});
|
||||
});
|
||||
return clone;
|
||||
}
|
||||
let ruleWithVariant = variantFunction({
|
||||
// Public API
|
||||
get container () {
|
||||
prepareBackup();
|
||||
return clone;
|
||||
},
|
||||
separator: context.tailwindConfig.separator,
|
||||
modifySelectors,
|
||||
// Private API for now
|
||||
wrap (wrapper) {
|
||||
let nodes = clone.nodes;
|
||||
clone.removeAll();
|
||||
wrapper.append(nodes);
|
||||
clone.append(wrapper);
|
||||
},
|
||||
format (selectorFormat) {
|
||||
collectedFormats.push({
|
||||
format: selectorFormat,
|
||||
isArbitraryVariant
|
||||
});
|
||||
},
|
||||
args
|
||||
});
|
||||
// It can happen that a list of format strings is returned from within the function. In that
|
||||
// case, we have to process them as well. We can use the existing `variantSort`.
|
||||
if (Array.isArray(ruleWithVariant)) {
|
||||
for (let [idx, variantFunction] of ruleWithVariant.entries()){
|
||||
// This is a little bit scary since we are pushing to an array of items that we are
|
||||
// currently looping over. However, you can also think of it like a processing queue
|
||||
// where you keep handling jobs until everything is done and each job can queue more
|
||||
// jobs if needed.
|
||||
variantFunctionTuples.push([
|
||||
context.offsets.applyParallelOffset(variantSort, idx),
|
||||
variantFunction,
|
||||
// If the clone has been modified we have to pass that back
|
||||
// though so each rule can use the modified container
|
||||
clone.clone()
|
||||
]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (typeof ruleWithVariant === "string") {
|
||||
collectedFormats.push({
|
||||
format: ruleWithVariant,
|
||||
isArbitraryVariant
|
||||
});
|
||||
}
|
||||
if (ruleWithVariant === null) {
|
||||
continue;
|
||||
}
|
||||
// We had to backup selectors, therefore we assume that somebody touched
|
||||
// `container` or `modifySelectors`. Let's see if they did, so that we
|
||||
// can restore the selectors, and collect the format strings.
|
||||
if (clone.raws.neededBackup) {
|
||||
delete clone.raws.neededBackup;
|
||||
clone.walkRules((rule)=>{
|
||||
let before = rule.raws.originalSelector;
|
||||
if (!before) return;
|
||||
delete rule.raws.originalSelector;
|
||||
if (before === rule.selector) return; // No mutation happened
|
||||
let modified = rule.selector;
|
||||
// Rebuild the base selector, this is what plugin authors would do
|
||||
// as well. E.g.: `${variant}${separator}${className}`.
|
||||
// However, plugin authors probably also prepend or append certain
|
||||
// classes, pseudos, ids, ...
|
||||
let rebuiltBase = (0, _postcssselectorparser.default)((selectors)=>{
|
||||
selectors.walkClasses((classNode)=>{
|
||||
classNode.value = `${variant}${context.tailwindConfig.separator}${classNode.value}`;
|
||||
});
|
||||
}).processSync(before);
|
||||
// Now that we know the original selector, the new selector, and
|
||||
// the rebuild part in between, we can replace the part that plugin
|
||||
// authors need to rebuild with `&`, and eventually store it in the
|
||||
// collectedFormats. Similar to what `format('...')` would do.
|
||||
//
|
||||
// E.g.:
|
||||
// variant: foo
|
||||
// selector: .markdown > p
|
||||
// modified (by plugin): .foo .foo\\:markdown > p
|
||||
// rebuiltBase (internal): .foo\\:markdown > p
|
||||
// format: .foo &
|
||||
collectedFormats.push({
|
||||
format: modified.replace(rebuiltBase, "&"),
|
||||
isArbitraryVariant
|
||||
});
|
||||
rule.selector = before;
|
||||
});
|
||||
}
|
||||
// This tracks the originating layer for the variant
|
||||
// For example:
|
||||
// .sm:underline {} is a variant of something in the utilities layer
|
||||
// .sm:container {} is a variant of the container component
|
||||
clone.nodes[0].raws.tailwind = {
|
||||
...clone.nodes[0].raws.tailwind,
|
||||
parentLayer: meta.layer
|
||||
};
|
||||
var _meta_collectedFormats;
|
||||
let withOffset = [
|
||||
{
|
||||
...meta,
|
||||
sort: context.offsets.applyVariantOffset(meta.sort, variantSort, Object.assign(args, context.variantOptions.get(variant))),
|
||||
collectedFormats: ((_meta_collectedFormats = meta.collectedFormats) !== null && _meta_collectedFormats !== void 0 ? _meta_collectedFormats : []).concat(collectedFormats)
|
||||
},
|
||||
clone.nodes[0]
|
||||
];
|
||||
result.push(withOffset);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function parseRules(rule, cache, options = {}) {
|
||||
// PostCSS node
|
||||
if (!(0, _isPlainObject.default)(rule) && !Array.isArray(rule)) {
|
||||
return [
|
||||
[
|
||||
rule
|
||||
],
|
||||
options
|
||||
];
|
||||
}
|
||||
// Tuple
|
||||
if (Array.isArray(rule)) {
|
||||
return parseRules(rule[0], cache, rule[1]);
|
||||
}
|
||||
// Simple object
|
||||
if (!cache.has(rule)) {
|
||||
cache.set(rule, (0, _parseObjectStyles.default)(rule));
|
||||
}
|
||||
return [
|
||||
cache.get(rule),
|
||||
options
|
||||
];
|
||||
}
|
||||
const IS_VALID_PROPERTY_NAME = /^[a-z_-]/;
|
||||
function isValidPropName(name) {
|
||||
return IS_VALID_PROPERTY_NAME.test(name);
|
||||
}
|
||||
/**
|
||||
* @param {string} declaration
|
||||
* @returns {boolean}
|
||||
*/ function looksLikeUri(declaration) {
|
||||
// Quick bailout for obvious non-urls
|
||||
// This doesn't support schemes that don't use a leading // but that's unlikely to be a problem
|
||||
if (!declaration.includes("://")) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
const url = new URL(declaration);
|
||||
return url.scheme !== "" && url.host !== "";
|
||||
} catch (err) {
|
||||
// Definitely not a valid url
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isParsableNode(node) {
|
||||
let isParsable = true;
|
||||
node.walkDecls((decl)=>{
|
||||
if (!isParsableCssValue(decl.prop, decl.value)) {
|
||||
isParsable = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return isParsable;
|
||||
}
|
||||
function isParsableCssValue(property, value) {
|
||||
// We don't want to to treat [https://example.com] as a custom property
|
||||
// Even though, according to the CSS grammar, it's a totally valid CSS declaration
|
||||
// So we short-circuit here by checking if the custom property looks like a url
|
||||
if (looksLikeUri(`${property}:${value}`)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
_postcss.default.parse(`a{${property}:${value}}`).toResult();
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function extractArbitraryProperty(classCandidate, context) {
|
||||
var _classCandidate_match;
|
||||
let [, property, value] = (_classCandidate_match = classCandidate.match(/^\[([a-zA-Z0-9-_]+):(\S+)\]$/)) !== null && _classCandidate_match !== void 0 ? _classCandidate_match : [];
|
||||
if (value === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (!isValidPropName(property)) {
|
||||
return null;
|
||||
}
|
||||
if (!(0, _isSyntacticallyValidPropertyValue.default)(value)) {
|
||||
return null;
|
||||
}
|
||||
let normalized = (0, _dataTypes.normalize)(value);
|
||||
if (!isParsableCssValue(property, normalized)) {
|
||||
return null;
|
||||
}
|
||||
let sort = context.offsets.arbitraryProperty();
|
||||
return [
|
||||
[
|
||||
{
|
||||
sort,
|
||||
layer: "utilities"
|
||||
},
|
||||
()=>({
|
||||
[(0, _nameClass.asClass)(classCandidate)]: {
|
||||
[property]: normalized
|
||||
}
|
||||
})
|
||||
]
|
||||
];
|
||||
}
|
||||
function* resolveMatchedPlugins(classCandidate, context) {
|
||||
if (context.candidateRuleMap.has(classCandidate)) {
|
||||
yield [
|
||||
context.candidateRuleMap.get(classCandidate),
|
||||
"DEFAULT"
|
||||
];
|
||||
}
|
||||
yield* function*(arbitraryPropertyRule) {
|
||||
if (arbitraryPropertyRule !== null) {
|
||||
yield [
|
||||
arbitraryPropertyRule,
|
||||
"DEFAULT"
|
||||
];
|
||||
}
|
||||
}(extractArbitraryProperty(classCandidate, context));
|
||||
let candidatePrefix = classCandidate;
|
||||
let negative = false;
|
||||
const twConfigPrefix = context.tailwindConfig.prefix;
|
||||
const twConfigPrefixLen = twConfigPrefix.length;
|
||||
const hasMatchingPrefix = candidatePrefix.startsWith(twConfigPrefix) || candidatePrefix.startsWith(`-${twConfigPrefix}`);
|
||||
if (candidatePrefix[twConfigPrefixLen] === "-" && hasMatchingPrefix) {
|
||||
negative = true;
|
||||
candidatePrefix = twConfigPrefix + candidatePrefix.slice(twConfigPrefixLen + 1);
|
||||
}
|
||||
if (negative && context.candidateRuleMap.has(candidatePrefix)) {
|
||||
yield [
|
||||
context.candidateRuleMap.get(candidatePrefix),
|
||||
"-DEFAULT"
|
||||
];
|
||||
}
|
||||
for (let [prefix, modifier] of candidatePermutations(candidatePrefix)){
|
||||
if (context.candidateRuleMap.has(prefix)) {
|
||||
yield [
|
||||
context.candidateRuleMap.get(prefix),
|
||||
negative ? `-${modifier}` : modifier
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
function splitWithSeparator(input, separator) {
|
||||
if (input === _sharedState.NOT_ON_DEMAND) {
|
||||
return [
|
||||
_sharedState.NOT_ON_DEMAND
|
||||
];
|
||||
}
|
||||
return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(input, separator);
|
||||
}
|
||||
function* recordCandidates(matches, classCandidate) {
|
||||
for (const match of matches){
|
||||
var _match__options;
|
||||
var _match__options_preserveSource;
|
||||
match[1].raws.tailwind = {
|
||||
...match[1].raws.tailwind,
|
||||
classCandidate,
|
||||
preserveSource: (_match__options_preserveSource = (_match__options = match[0].options) === null || _match__options === void 0 ? void 0 : _match__options.preserveSource) !== null && _match__options_preserveSource !== void 0 ? _match__options_preserveSource : false
|
||||
};
|
||||
yield match;
|
||||
}
|
||||
}
|
||||
function* resolveMatches(candidate, context, original = candidate) {
|
||||
let separator = context.tailwindConfig.separator;
|
||||
let [classCandidate, ...variants] = splitWithSeparator(candidate, separator).reverse();
|
||||
let important = false;
|
||||
if (classCandidate.startsWith("!")) {
|
||||
important = true;
|
||||
classCandidate = classCandidate.slice(1);
|
||||
}
|
||||
if ((0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping")) {
|
||||
if (classCandidate.startsWith("(") && classCandidate.endsWith(")")) {
|
||||
let base = variants.slice().reverse().join(separator);
|
||||
for (let part of (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(classCandidate.slice(1, -1), ",")){
|
||||
yield* resolveMatches(base + separator + part, context, original);
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: Reintroduce this in ways that doesn't break on false positives
|
||||
// function sortAgainst(toSort, against) {
|
||||
// return toSort.slice().sort((a, z) => {
|
||||
// return bigSign(against.get(a)[0] - against.get(z)[0])
|
||||
// })
|
||||
// }
|
||||
// let sorted = sortAgainst(variants, context.variantMap)
|
||||
// if (sorted.toString() !== variants.toString()) {
|
||||
// let corrected = sorted.reverse().concat(classCandidate).join(':')
|
||||
// throw new Error(`Class ${candidate} should be written as ${corrected}`)
|
||||
// }
|
||||
for (let matchedPlugins of resolveMatchedPlugins(classCandidate, context)){
|
||||
let matches = [];
|
||||
let typesByMatches = new Map();
|
||||
let [plugins, modifier] = matchedPlugins;
|
||||
let isOnlyPlugin = plugins.length === 1;
|
||||
for (let [sort, plugin] of plugins){
|
||||
let matchesPerPlugin = [];
|
||||
if (typeof plugin === "function") {
|
||||
for (let ruleSet of [].concat(plugin(modifier, {
|
||||
isOnlyPlugin
|
||||
}))){
|
||||
let [rules, options] = parseRules(ruleSet, context.postCssNodeCache);
|
||||
for (let rule of rules){
|
||||
matchesPerPlugin.push([
|
||||
{
|
||||
...sort,
|
||||
options: {
|
||||
...sort.options,
|
||||
...options
|
||||
}
|
||||
},
|
||||
rule
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else if (modifier === "DEFAULT" || modifier === "-DEFAULT") {
|
||||
let ruleSet = plugin;
|
||||
let [rules, options] = parseRules(ruleSet, context.postCssNodeCache);
|
||||
for (let rule of rules){
|
||||
matchesPerPlugin.push([
|
||||
{
|
||||
...sort,
|
||||
options: {
|
||||
...sort.options,
|
||||
...options
|
||||
}
|
||||
},
|
||||
rule
|
||||
]);
|
||||
}
|
||||
}
|
||||
if (matchesPerPlugin.length > 0) {
|
||||
var _sort_options;
|
||||
var _sort_options_types, _sort_options1;
|
||||
let matchingTypes = Array.from((0, _pluginUtils.getMatchingTypes)((_sort_options_types = (_sort_options = sort.options) === null || _sort_options === void 0 ? void 0 : _sort_options.types) !== null && _sort_options_types !== void 0 ? _sort_options_types : [], modifier, (_sort_options1 = sort.options) !== null && _sort_options1 !== void 0 ? _sort_options1 : {}, context.tailwindConfig)).map(([_, type])=>type);
|
||||
if (matchingTypes.length > 0) {
|
||||
typesByMatches.set(matchesPerPlugin, matchingTypes);
|
||||
}
|
||||
matches.push(matchesPerPlugin);
|
||||
}
|
||||
}
|
||||
if (isArbitraryValue(modifier)) {
|
||||
if (matches.length > 1) {
|
||||
// Partition plugins in 2 categories so that we can start searching in the plugins that
|
||||
// don't have `any` as a type first.
|
||||
let [withAny, withoutAny] = matches.reduce((group, plugin)=>{
|
||||
let hasAnyType = plugin.some(([{ options }])=>options.types.some(({ type })=>type === "any"));
|
||||
if (hasAnyType) {
|
||||
group[0].push(plugin);
|
||||
} else {
|
||||
group[1].push(plugin);
|
||||
}
|
||||
return group;
|
||||
}, [
|
||||
[],
|
||||
[]
|
||||
]);
|
||||
function findFallback(matches) {
|
||||
// If only a single plugin matches, let's take that one
|
||||
if (matches.length === 1) {
|
||||
return matches[0];
|
||||
}
|
||||
// Otherwise, find the plugin that creates a valid rule given the arbitrary value, and
|
||||
// also has the correct type which preferOnConflicts the plugin in case of clashes.
|
||||
return matches.find((rules)=>{
|
||||
let matchingTypes = typesByMatches.get(rules);
|
||||
return rules.some(([{ options }, rule])=>{
|
||||
if (!isParsableNode(rule)) {
|
||||
return false;
|
||||
}
|
||||
return options.types.some(({ type , preferOnConflict })=>matchingTypes.includes(type) && preferOnConflict);
|
||||
});
|
||||
});
|
||||
}
|
||||
var _findFallback;
|
||||
// Try to find a fallback plugin, because we already know that multiple plugins matched for
|
||||
// the given arbitrary value.
|
||||
let fallback = (_findFallback = findFallback(withoutAny)) !== null && _findFallback !== void 0 ? _findFallback : findFallback(withAny);
|
||||
if (fallback) {
|
||||
matches = [
|
||||
fallback
|
||||
];
|
||||
} else {
|
||||
var _typesByMatches_get;
|
||||
let typesPerPlugin = matches.map((match)=>new Set([
|
||||
...(_typesByMatches_get = typesByMatches.get(match)) !== null && _typesByMatches_get !== void 0 ? _typesByMatches_get : []
|
||||
]));
|
||||
// Remove duplicates, so that we can detect proper unique types for each plugin.
|
||||
for (let pluginTypes of typesPerPlugin){
|
||||
for (let type of pluginTypes){
|
||||
let removeFromOwnGroup = false;
|
||||
for (let otherGroup of typesPerPlugin){
|
||||
if (pluginTypes === otherGroup) continue;
|
||||
if (otherGroup.has(type)) {
|
||||
otherGroup.delete(type);
|
||||
removeFromOwnGroup = true;
|
||||
}
|
||||
}
|
||||
if (removeFromOwnGroup) pluginTypes.delete(type);
|
||||
}
|
||||
}
|
||||
let messages = [];
|
||||
for (let [idx, group] of typesPerPlugin.entries()){
|
||||
for (let type of group){
|
||||
let rules = matches[idx].map(([, rule])=>rule).flat().map((rule)=>rule.toString().split("\n").slice(1, -1) // Remove selector and closing '}'
|
||||
.map((line)=>line.trim()).map((x)=>` ${x}`) // Re-indent
|
||||
.join("\n")).join("\n\n");
|
||||
messages.push(` Use \`${candidate.replace("[", `[${type}:`)}\` for \`${rules.trim()}\``);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_log.default.warn([
|
||||
`The class \`${candidate}\` is ambiguous and matches multiple utilities.`,
|
||||
...messages,
|
||||
`If this is content and not a class, replace it with \`${candidate.replace("[", "[").replace("]", "]")}\` to silence this warning.`
|
||||
]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
matches = matches.map((list)=>list.filter((match)=>isParsableNode(match[1])));
|
||||
}
|
||||
matches = matches.flat();
|
||||
matches = Array.from(recordCandidates(matches, classCandidate));
|
||||
matches = applyPrefix(matches, context);
|
||||
if (important) {
|
||||
matches = applyImportant(matches, classCandidate);
|
||||
}
|
||||
for (let variant of variants){
|
||||
matches = applyVariant(variant, matches, context);
|
||||
}
|
||||
for (let match of matches){
|
||||
match[1].raws.tailwind = {
|
||||
...match[1].raws.tailwind,
|
||||
candidate
|
||||
};
|
||||
// Apply final format selector
|
||||
match = applyFinalFormat(match, {
|
||||
context,
|
||||
candidate,
|
||||
original
|
||||
});
|
||||
// Skip rules with invalid selectors
|
||||
// This will cause the candidate to be added to the "not class"
|
||||
// cache skipping it entirely for future builds
|
||||
if (match === null) {
|
||||
continue;
|
||||
}
|
||||
yield match;
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyFinalFormat(match, { context , candidate , original }) {
|
||||
if (!match[0].collectedFormats) {
|
||||
return match;
|
||||
}
|
||||
let isValid = true;
|
||||
let finalFormat;
|
||||
try {
|
||||
finalFormat = (0, _formatVariantSelector.formatVariantSelector)(match[0].collectedFormats, {
|
||||
context,
|
||||
candidate
|
||||
});
|
||||
} catch {
|
||||
// The format selector we produced is invalid
|
||||
// This could be because:
|
||||
// - A bug exists
|
||||
// - A plugin introduced an invalid variant selector (ex: `addVariant('foo', '&;foo')`)
|
||||
// - The user used an invalid arbitrary variant (ex: `[&;foo]:underline`)
|
||||
// Either way the build will fail because of this
|
||||
// We would rather that the build pass "silently" given that this could
|
||||
// happen because of picking up invalid things when scanning content
|
||||
// So we'll throw out the candidate instead
|
||||
return null;
|
||||
}
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
match[1].clone()
|
||||
]
|
||||
});
|
||||
container.walkRules((rule)=>{
|
||||
if (inKeyframes(rule)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
rule.selector = (0, _formatVariantSelector.finalizeSelector)(rule.selector, finalFormat, {
|
||||
candidate: original,
|
||||
context
|
||||
});
|
||||
} catch {
|
||||
// If this selector is invalid we also want to skip it
|
||||
// But it's likely that being invalid here means there's a bug in a plugin rather than too loosely matching content
|
||||
isValid = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (!isValid) {
|
||||
return null;
|
||||
}
|
||||
match[1] = container.nodes[0];
|
||||
return match;
|
||||
}
|
||||
function inKeyframes(rule) {
|
||||
return rule.parent && rule.parent.type === "atrule" && rule.parent.name === "keyframes";
|
||||
}
|
||||
function getImportantStrategy(important) {
|
||||
if (important === true) {
|
||||
return (rule)=>{
|
||||
if (inKeyframes(rule)) {
|
||||
return;
|
||||
}
|
||||
rule.walkDecls((d)=>{
|
||||
if (d.parent.type === "rule" && !inKeyframes(d.parent)) {
|
||||
d.important = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
if (typeof important === "string") {
|
||||
return (rule)=>{
|
||||
if (inKeyframes(rule)) {
|
||||
return;
|
||||
}
|
||||
rule.selectors = rule.selectors.map((selector)=>{
|
||||
return (0, _applyImportantSelector.applyImportantSelector)(selector, important);
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
function generateRules(candidates, context) {
|
||||
let allRules = [];
|
||||
let strategy = getImportantStrategy(context.tailwindConfig.important);
|
||||
for (let candidate of candidates){
|
||||
if (context.notClassCache.has(candidate)) {
|
||||
continue;
|
||||
}
|
||||
if (context.candidateRuleCache.has(candidate)) {
|
||||
allRules = allRules.concat(Array.from(context.candidateRuleCache.get(candidate)));
|
||||
continue;
|
||||
}
|
||||
let matches = Array.from(resolveMatches(candidate, context));
|
||||
if (matches.length === 0) {
|
||||
context.notClassCache.add(candidate);
|
||||
continue;
|
||||
}
|
||||
context.classCache.set(candidate, matches);
|
||||
var _context_candidateRuleCache_get;
|
||||
let rules = (_context_candidateRuleCache_get = context.candidateRuleCache.get(candidate)) !== null && _context_candidateRuleCache_get !== void 0 ? _context_candidateRuleCache_get : new Set();
|
||||
context.candidateRuleCache.set(candidate, rules);
|
||||
for (const match of matches){
|
||||
let [{ sort , options }, rule] = match;
|
||||
if (options.respectImportant && strategy) {
|
||||
let container = _postcss.default.root({
|
||||
nodes: [
|
||||
rule.clone()
|
||||
]
|
||||
});
|
||||
container.walkRules(strategy);
|
||||
rule = container.nodes[0];
|
||||
}
|
||||
let newEntry = [
|
||||
sort,
|
||||
rule
|
||||
];
|
||||
rules.add(newEntry);
|
||||
context.ruleCache.add(newEntry);
|
||||
allRules.push(newEntry);
|
||||
}
|
||||
}
|
||||
return allRules;
|
||||
}
|
||||
function isArbitraryValue(input) {
|
||||
return input.startsWith("[") && input.endsWith("]");
|
||||
}
|
||||
144
CTOAsYouGo/node_modules/tailwindcss/lib/lib/getModuleDependencies.js
generated
vendored
144
CTOAsYouGo/node_modules/tailwindcss/lib/lib/getModuleDependencies.js
generated
vendored
@@ -1,99 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getModuleDependencies;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let jsExtensions = [
|
||||
".js",
|
||||
".cjs",
|
||||
".mjs"
|
||||
];
|
||||
// Given the current file `a.ts`, we want to make sure that when importing `b` that we resolve
|
||||
// `b.ts` before `b.js`
|
||||
//
|
||||
// E.g.:
|
||||
//
|
||||
// a.ts
|
||||
// b // .ts
|
||||
// c // .ts
|
||||
// a.js
|
||||
// b // .js or .ts
|
||||
let jsResolutionOrder = [
|
||||
"",
|
||||
".js",
|
||||
".cjs",
|
||||
".mjs",
|
||||
".ts",
|
||||
".cts",
|
||||
".mts",
|
||||
".jsx",
|
||||
".tsx"
|
||||
];
|
||||
let tsResolutionOrder = [
|
||||
"",
|
||||
".ts",
|
||||
".cts",
|
||||
".mts",
|
||||
".tsx",
|
||||
".js",
|
||||
".cjs",
|
||||
".mjs",
|
||||
".jsx"
|
||||
];
|
||||
function resolveWithExtension(file, extensions) {
|
||||
// Try to find `./a.ts`, `./a.ts`, ... from `./a`
|
||||
for (let ext of extensions){
|
||||
let full = `${file}${ext}`;
|
||||
if (_fs.default.existsSync(full) && _fs.default.statSync(full).isFile()) {
|
||||
return full;
|
||||
}
|
||||
}
|
||||
// Try to find `./a/index.js` from `./a`
|
||||
for (let ext of extensions){
|
||||
let full = `${file}/index${ext}`;
|
||||
if (_fs.default.existsSync(full)) {
|
||||
return full;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function* _getModuleDependencies(filename, base, seen, ext = _path.default.extname(filename)) {
|
||||
// Try to find the file
|
||||
let absoluteFile = resolveWithExtension(_path.default.resolve(base, filename), jsExtensions.includes(ext) ? jsResolutionOrder : tsResolutionOrder);
|
||||
if (absoluteFile === null) return; // File doesn't exist
|
||||
// Prevent infinite loops when there are circular dependencies
|
||||
if (seen.has(absoluteFile)) return; // Already seen
|
||||
seen.add(absoluteFile);
|
||||
// Mark the file as a dependency
|
||||
yield absoluteFile;
|
||||
// Resolve new base for new imports/requires
|
||||
base = _path.default.dirname(absoluteFile);
|
||||
ext = _path.default.extname(absoluteFile);
|
||||
let contents = _fs.default.readFileSync(absoluteFile, "utf-8");
|
||||
// Find imports/requires
|
||||
for (let match of [
|
||||
...contents.matchAll(/import[\s\S]*?['"](.{3,}?)['"]/gi),
|
||||
...contents.matchAll(/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi),
|
||||
...contents.matchAll(/require\(['"`](.+)['"`]\)/gi)
|
||||
]){
|
||||
// Bail out if it's not a relative file
|
||||
if (!match[1].startsWith(".")) continue;
|
||||
yield* _getModuleDependencies(match[1], base, seen, ext);
|
||||
}
|
||||
}
|
||||
function getModuleDependencies(absoluteFilePath) {
|
||||
if (absoluteFilePath === null) return new Set();
|
||||
return new Set(_getModuleDependencies(absoluteFilePath, _path.default.dirname(absoluteFilePath), new Set()));
|
||||
exports.default = getModuleDependencies;
|
||||
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _resolve = _interopRequireDefault(require("resolve"));
|
||||
|
||||
var _detective = _interopRequireDefault(require("detective"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function createModule(file) {
|
||||
const source = _fs.default.readFileSync(file, 'utf-8');
|
||||
|
||||
const requires = (0, _detective.default)(source);
|
||||
return {
|
||||
file,
|
||||
requires
|
||||
};
|
||||
}
|
||||
|
||||
function getModuleDependencies(entryFile) {
|
||||
const rootModule = createModule(entryFile);
|
||||
const modules = [rootModule]; // Iterate over the modules, even when new
|
||||
// ones are being added
|
||||
|
||||
for (const mdl of modules) {
|
||||
mdl.requires.filter(dep => {
|
||||
// Only track local modules, not node_modules
|
||||
return dep.startsWith('./') || dep.startsWith('../');
|
||||
}).forEach(dep => {
|
||||
try {
|
||||
const basedir = _path.default.dirname(mdl.file);
|
||||
|
||||
const depPath = _resolve.default.sync(dep, {
|
||||
basedir
|
||||
});
|
||||
|
||||
const depModule = createModule(depPath);
|
||||
modules.push(depModule);
|
||||
} catch (_err) {// eslint-disable-next-line no-empty
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return modules;
|
||||
}
|
||||
42
CTOAsYouGo/node_modules/tailwindcss/lib/lib/load-config.js
generated
vendored
42
CTOAsYouGo/node_modules/tailwindcss/lib/lib/load-config.js
generated
vendored
@@ -1,42 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "loadConfig", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return loadConfig;
|
||||
}
|
||||
});
|
||||
const _jiti = /*#__PURE__*/ _interop_require_default(require("jiti"));
|
||||
const _sucrase = require("sucrase");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let jiti = null;
|
||||
function lazyJiti() {
|
||||
return jiti !== null && jiti !== void 0 ? jiti : jiti = (0, _jiti.default)(__filename, {
|
||||
interopDefault: true,
|
||||
transform: (opts)=>{
|
||||
return (0, _sucrase.transform)(opts.source, {
|
||||
transforms: [
|
||||
"typescript",
|
||||
"imports"
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function loadConfig(path) {
|
||||
let config = function() {
|
||||
try {
|
||||
return path ? require(path) : {};
|
||||
} catch {
|
||||
return lazyJiti()(path);
|
||||
}
|
||||
}();
|
||||
var _config_default;
|
||||
return (_config_default = config.default) !== null && _config_default !== void 0 ? _config_default : config;
|
||||
}
|
||||
89
CTOAsYouGo/node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js
generated
vendored
89
CTOAsYouGo/node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js
generated
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return normalizeTailwindDirectives;
|
||||
}
|
||||
});
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function normalizeTailwindDirectives(root) {
|
||||
let tailwindDirectives = new Set();
|
||||
let layerDirectives = new Set();
|
||||
let applyDirectives = new Set();
|
||||
root.walkAtRules((atRule)=>{
|
||||
if (atRule.name === "apply") {
|
||||
applyDirectives.add(atRule);
|
||||
}
|
||||
if (atRule.name === "import") {
|
||||
if (atRule.params === '"tailwindcss/base"' || atRule.params === "'tailwindcss/base'") {
|
||||
atRule.name = "tailwind";
|
||||
atRule.params = "base";
|
||||
} else if (atRule.params === '"tailwindcss/components"' || atRule.params === "'tailwindcss/components'") {
|
||||
atRule.name = "tailwind";
|
||||
atRule.params = "components";
|
||||
} else if (atRule.params === '"tailwindcss/utilities"' || atRule.params === "'tailwindcss/utilities'") {
|
||||
atRule.name = "tailwind";
|
||||
atRule.params = "utilities";
|
||||
} else if (atRule.params === '"tailwindcss/screens"' || atRule.params === "'tailwindcss/screens'" || atRule.params === '"tailwindcss/variants"' || atRule.params === "'tailwindcss/variants'") {
|
||||
atRule.name = "tailwind";
|
||||
atRule.params = "variants";
|
||||
}
|
||||
}
|
||||
if (atRule.name === "tailwind") {
|
||||
if (atRule.params === "screens") {
|
||||
atRule.params = "variants";
|
||||
}
|
||||
tailwindDirectives.add(atRule.params);
|
||||
}
|
||||
if ([
|
||||
"layer",
|
||||
"responsive",
|
||||
"variants"
|
||||
].includes(atRule.name)) {
|
||||
if ([
|
||||
"responsive",
|
||||
"variants"
|
||||
].includes(atRule.name)) {
|
||||
_log.default.warn(`${atRule.name}-at-rule-deprecated`, [
|
||||
`The \`@${atRule.name}\` directive has been deprecated in Tailwind CSS v3.0.`,
|
||||
`Use \`@layer utilities\` or \`@layer components\` instead.`,
|
||||
"https://tailwindcss.com/docs/upgrade-guide#replace-variants-with-layer"
|
||||
]);
|
||||
}
|
||||
layerDirectives.add(atRule);
|
||||
}
|
||||
});
|
||||
if (!tailwindDirectives.has("base") || !tailwindDirectives.has("components") || !tailwindDirectives.has("utilities")) {
|
||||
for (let rule of layerDirectives){
|
||||
if (rule.name === "layer" && [
|
||||
"base",
|
||||
"components",
|
||||
"utilities"
|
||||
].includes(rule.params)) {
|
||||
if (!tailwindDirectives.has(rule.params)) {
|
||||
throw rule.error(`\`@layer ${rule.params}\` is used but no matching \`@tailwind ${rule.params}\` directive is present.`);
|
||||
}
|
||||
} else if (rule.name === "responsive") {
|
||||
if (!tailwindDirectives.has("utilities")) {
|
||||
throw rule.error("`@responsive` is used but `@tailwind utilities` is missing.");
|
||||
}
|
||||
} else if (rule.name === "variants") {
|
||||
if (!tailwindDirectives.has("utilities")) {
|
||||
throw rule.error("`@variants` is used but `@tailwind utilities` is missing.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
tailwindDirectives,
|
||||
applyDirectives
|
||||
};
|
||||
}
|
||||
306
CTOAsYouGo/node_modules/tailwindcss/lib/lib/offsets.js
generated
vendored
306
CTOAsYouGo/node_modules/tailwindcss/lib/lib/offsets.js
generated
vendored
@@ -1,306 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "Offsets", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return Offsets;
|
||||
}
|
||||
});
|
||||
const _bigSign = /*#__PURE__*/ _interop_require_default(require("../util/bigSign"));
|
||||
const _remapbitfield = require("./remap-bitfield.js");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
class Offsets {
|
||||
constructor(){
|
||||
/**
|
||||
* Offsets for the next rule in a given layer
|
||||
*
|
||||
* @type {Record<Layer, bigint>}
|
||||
*/ this.offsets = {
|
||||
defaults: 0n,
|
||||
base: 0n,
|
||||
components: 0n,
|
||||
utilities: 0n,
|
||||
variants: 0n,
|
||||
user: 0n
|
||||
};
|
||||
/**
|
||||
* Positions for a given layer
|
||||
*
|
||||
* @type {Record<Layer, bigint>}
|
||||
*/ this.layerPositions = {
|
||||
defaults: 0n,
|
||||
base: 1n,
|
||||
components: 2n,
|
||||
utilities: 3n,
|
||||
// There isn't technically a "user" layer, but we need to give it a position
|
||||
// Because it's used for ordering user-css from @apply
|
||||
user: 4n,
|
||||
variants: 5n
|
||||
};
|
||||
/**
|
||||
* The total number of functions currently registered across all variants (including arbitrary variants)
|
||||
*
|
||||
* @type {bigint}
|
||||
*/ this.reservedVariantBits = 0n;
|
||||
/**
|
||||
* Positions for a given variant
|
||||
*
|
||||
* @type {Map<string, bigint>}
|
||||
*/ this.variantOffsets = new Map();
|
||||
}
|
||||
/**
|
||||
* @param {Layer} layer
|
||||
* @returns {RuleOffset}
|
||||
*/ create(layer) {
|
||||
return {
|
||||
layer,
|
||||
parentLayer: layer,
|
||||
arbitrary: 0n,
|
||||
variants: 0n,
|
||||
parallelIndex: 0n,
|
||||
index: this.offsets[layer]++,
|
||||
options: []
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @returns {RuleOffset}
|
||||
*/ arbitraryProperty() {
|
||||
return {
|
||||
...this.create("utilities"),
|
||||
arbitrary: 1n
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Get the offset for a variant
|
||||
*
|
||||
* @param {string} variant
|
||||
* @param {number} index
|
||||
* @returns {RuleOffset}
|
||||
*/ forVariant(variant, index = 0) {
|
||||
let offset = this.variantOffsets.get(variant);
|
||||
if (offset === undefined) {
|
||||
throw new Error(`Cannot find offset for unknown variant ${variant}`);
|
||||
}
|
||||
return {
|
||||
...this.create("variants"),
|
||||
variants: offset << BigInt(index)
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @param {RuleOffset} rule
|
||||
* @param {RuleOffset} variant
|
||||
* @param {VariantOption} options
|
||||
* @returns {RuleOffset}
|
||||
*/ applyVariantOffset(rule, variant, options) {
|
||||
options.variant = variant.variants;
|
||||
return {
|
||||
...rule,
|
||||
layer: "variants",
|
||||
parentLayer: rule.layer === "variants" ? rule.parentLayer : rule.layer,
|
||||
variants: rule.variants | variant.variants,
|
||||
options: options.sort ? [].concat(options, rule.options) : rule.options,
|
||||
// TODO: Technically this is wrong. We should be handling parallel index on a per variant basis.
|
||||
// We'll take the max of all the parallel indexes for now.
|
||||
// @ts-ignore
|
||||
parallelIndex: max([
|
||||
rule.parallelIndex,
|
||||
variant.parallelIndex
|
||||
])
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @param {RuleOffset} offset
|
||||
* @param {number} parallelIndex
|
||||
* @returns {RuleOffset}
|
||||
*/ applyParallelOffset(offset, parallelIndex) {
|
||||
return {
|
||||
...offset,
|
||||
parallelIndex: BigInt(parallelIndex)
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Each variant gets 1 bit per function / rule registered.
|
||||
* This is because multiple variants can be applied to a single rule and we need to know which ones are present and which ones are not.
|
||||
* Additionally, every unique group of variants is grouped together in the stylesheet.
|
||||
*
|
||||
* This grouping is order-independent. For instance, we do not differentiate between `hover:focus` and `focus:hover`.
|
||||
*
|
||||
* @param {string[]} variants
|
||||
* @param {(name: string) => number} getLength
|
||||
*/ recordVariants(variants, getLength) {
|
||||
for (let variant of variants){
|
||||
this.recordVariant(variant, getLength(variant));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The same as `recordVariants` but for a single arbitrary variant at runtime.
|
||||
* @param {string} variant
|
||||
* @param {number} fnCount
|
||||
*
|
||||
* @returns {RuleOffset} The highest offset for this variant
|
||||
*/ recordVariant(variant, fnCount = 1) {
|
||||
this.variantOffsets.set(variant, 1n << this.reservedVariantBits);
|
||||
// Ensure space is reserved for each "function" in the parallel variant
|
||||
// by offsetting the next variant by the number of parallel variants
|
||||
// in the one we just added.
|
||||
// Single functions that return parallel variants are NOT handled separately here
|
||||
// They're offset by 1 (or the number of functions) as usual
|
||||
// And each rule returned is tracked separately since the functions are evaluated lazily.
|
||||
// @see `RuleOffset.parallelIndex`
|
||||
this.reservedVariantBits += BigInt(fnCount);
|
||||
return {
|
||||
...this.create("variants"),
|
||||
variants: this.variantOffsets.get(variant)
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @param {RuleOffset} a
|
||||
* @param {RuleOffset} b
|
||||
* @returns {bigint}
|
||||
*/ compare(a, b) {
|
||||
// Sort layers together
|
||||
if (a.layer !== b.layer) {
|
||||
return this.layerPositions[a.layer] - this.layerPositions[b.layer];
|
||||
}
|
||||
// When sorting the `variants` layer, we need to sort based on the parent layer as well within
|
||||
// this variants layer.
|
||||
if (a.parentLayer !== b.parentLayer) {
|
||||
return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer];
|
||||
}
|
||||
// Sort based on the sorting function
|
||||
for (let aOptions of a.options){
|
||||
for (let bOptions of b.options){
|
||||
if (aOptions.id !== bOptions.id) continue;
|
||||
if (!aOptions.sort || !bOptions.sort) continue;
|
||||
var _max;
|
||||
let maxFnVariant = (_max = max([
|
||||
aOptions.variant,
|
||||
bOptions.variant
|
||||
])) !== null && _max !== void 0 ? _max : 0n;
|
||||
// Create a mask of 0s from bits 1..N where N represents the mask of the Nth bit
|
||||
let mask = ~(maxFnVariant | maxFnVariant - 1n);
|
||||
let aVariantsAfterFn = a.variants & mask;
|
||||
let bVariantsAfterFn = b.variants & mask;
|
||||
// If the variants the same, we _can_ sort them
|
||||
if (aVariantsAfterFn !== bVariantsAfterFn) {
|
||||
continue;
|
||||
}
|
||||
let result = aOptions.sort({
|
||||
value: aOptions.value,
|
||||
modifier: aOptions.modifier
|
||||
}, {
|
||||
value: bOptions.value,
|
||||
modifier: bOptions.modifier
|
||||
});
|
||||
if (result !== 0) return result;
|
||||
}
|
||||
}
|
||||
// Sort variants in the order they were registered
|
||||
if (a.variants !== b.variants) {
|
||||
return a.variants - b.variants;
|
||||
}
|
||||
// Make sure each rule returned by a parallel variant is sorted in ascending order
|
||||
if (a.parallelIndex !== b.parallelIndex) {
|
||||
return a.parallelIndex - b.parallelIndex;
|
||||
}
|
||||
// Always sort arbitrary properties after other utilities
|
||||
if (a.arbitrary !== b.arbitrary) {
|
||||
return a.arbitrary - b.arbitrary;
|
||||
}
|
||||
// Sort utilities, components, etc… in the order they were registered
|
||||
return a.index - b.index;
|
||||
}
|
||||
/**
|
||||
* Arbitrary variants are recorded in the order they're encountered.
|
||||
* This means that the order is not stable between environments and sets of content files.
|
||||
*
|
||||
* In order to make the order stable, we need to remap the arbitrary variant offsets to
|
||||
* be in alphabetical order starting from the offset of the first arbitrary variant.
|
||||
*/ recalculateVariantOffsets() {
|
||||
// Sort the variants by their name
|
||||
let variants = Array.from(this.variantOffsets.entries()).filter(([v])=>v.startsWith("[")).sort(([a], [z])=>fastCompare(a, z));
|
||||
// Sort the list of offsets
|
||||
// This is not necessarily a discrete range of numbers which is why
|
||||
// we're using sort instead of creating a range from min/max
|
||||
let newOffsets = variants.map(([, offset])=>offset).sort((a, z)=>(0, _bigSign.default)(a - z));
|
||||
// Create a map from the old offsets to the new offsets in the new sort order
|
||||
/** @type {[bigint, bigint][]} */ let mapping = variants.map(([, oldOffset], i)=>[
|
||||
oldOffset,
|
||||
newOffsets[i]
|
||||
]);
|
||||
// Remove any variants that will not move letting us skip
|
||||
// remapping if everything happens to be in order
|
||||
return mapping.filter(([a, z])=>a !== z);
|
||||
}
|
||||
/**
|
||||
* @template T
|
||||
* @param {[RuleOffset, T][]} list
|
||||
* @returns {[RuleOffset, T][]}
|
||||
*/ remapArbitraryVariantOffsets(list) {
|
||||
let mapping = this.recalculateVariantOffsets();
|
||||
// No arbitrary variants? Nothing to do.
|
||||
// Everyhing already in order? Nothing to do.
|
||||
if (mapping.length === 0) {
|
||||
return list;
|
||||
}
|
||||
// Remap every variant offset in the list
|
||||
return list.map((item)=>{
|
||||
let [offset, rule] = item;
|
||||
offset = {
|
||||
...offset,
|
||||
variants: (0, _remapbitfield.remapBitfield)(offset.variants, mapping)
|
||||
};
|
||||
return [
|
||||
offset,
|
||||
rule
|
||||
];
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @template T
|
||||
* @param {[RuleOffset, T][]} list
|
||||
* @returns {[RuleOffset, T][]}
|
||||
*/ sort(list) {
|
||||
list = this.remapArbitraryVariantOffsets(list);
|
||||
return list.sort(([a], [b])=>(0, _bigSign.default)(this.compare(a, b)));
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {bigint[]} nums
|
||||
* @returns {bigint|null}
|
||||
*/ function max(nums) {
|
||||
let max = null;
|
||||
for (const num of nums){
|
||||
max = max !== null && max !== void 0 ? max : num;
|
||||
max = max > num ? max : num;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
/**
|
||||
* A fast ASCII order string comparison function.
|
||||
*
|
||||
* Using `.sort()` without a custom compare function is faster
|
||||
* But you can only use that if you're sorting an array of
|
||||
* only strings. If you're sorting strings inside objects
|
||||
* or arrays, you need must use a custom compare function.
|
||||
*
|
||||
* @param {string} a
|
||||
* @param {string} b
|
||||
*/ function fastCompare(a, b) {
|
||||
let aLen = a.length;
|
||||
let bLen = b.length;
|
||||
let minLen = aLen < bLen ? aLen : bLen;
|
||||
for(let i = 0; i < minLen; i++){
|
||||
let cmp = a.charCodeAt(i) - b.charCodeAt(i);
|
||||
if (cmp !== 0) return cmp;
|
||||
}
|
||||
return aLen - bLen;
|
||||
}
|
||||
58
CTOAsYouGo/node_modules/tailwindcss/lib/lib/partitionApplyAtRules.js
generated
vendored
58
CTOAsYouGo/node_modules/tailwindcss/lib/lib/partitionApplyAtRules.js
generated
vendored
@@ -1,58 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return expandApplyAtRules;
|
||||
}
|
||||
});
|
||||
function partitionRules(root) {
|
||||
if (!root.walkAtRules) return;
|
||||
let applyParents = new Set();
|
||||
root.walkAtRules("apply", (rule)=>{
|
||||
applyParents.add(rule.parent);
|
||||
});
|
||||
if (applyParents.size === 0) {
|
||||
return;
|
||||
}
|
||||
for (let rule of applyParents){
|
||||
let nodeGroups = [];
|
||||
let lastGroup = [];
|
||||
for (let node of rule.nodes){
|
||||
if (node.type === "atrule" && node.name === "apply") {
|
||||
if (lastGroup.length > 0) {
|
||||
nodeGroups.push(lastGroup);
|
||||
lastGroup = [];
|
||||
}
|
||||
nodeGroups.push([
|
||||
node
|
||||
]);
|
||||
} else {
|
||||
lastGroup.push(node);
|
||||
}
|
||||
}
|
||||
if (lastGroup.length > 0) {
|
||||
nodeGroups.push(lastGroup);
|
||||
}
|
||||
if (nodeGroups.length === 1) {
|
||||
continue;
|
||||
}
|
||||
for (let group of [
|
||||
...nodeGroups
|
||||
].reverse()){
|
||||
let clone = rule.clone({
|
||||
nodes: []
|
||||
});
|
||||
clone.append(group);
|
||||
rule.after(clone);
|
||||
}
|
||||
rule.remove();
|
||||
}
|
||||
}
|
||||
function expandApplyAtRules() {
|
||||
return (root)=>{
|
||||
partitionRules(root);
|
||||
};
|
||||
}
|
||||
133
CTOAsYouGo/node_modules/tailwindcss/lib/lib/purgeUnusedStyles.js
generated
vendored
Normal file
133
CTOAsYouGo/node_modules/tailwindcss/lib/lib/purgeUnusedStyles.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = purgeUnusedUtilities;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssPurgecss = _interopRequireDefault(require("@fullhuman/postcss-purgecss"));
|
||||
|
||||
var _log = _interopRequireDefault(require("../util/log"));
|
||||
|
||||
var _htmlTags = _interopRequireDefault(require("html-tags"));
|
||||
|
||||
var _featureFlags = require("../featureFlags");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function removeTailwindMarkers(css) {
|
||||
css.walkAtRules('tailwind', rule => rule.remove());
|
||||
css.walkComments(comment => {
|
||||
switch (comment.text.trim()) {
|
||||
case 'tailwind start base':
|
||||
case 'tailwind end base':
|
||||
case 'tailwind start components':
|
||||
case 'tailwind start utilities':
|
||||
case 'tailwind end components':
|
||||
case 'tailwind end utilities':
|
||||
comment.remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function purgeUnusedUtilities(config, configChanged) {
|
||||
const purgeEnabled = _lodash.default.get(config, 'purge.enabled', config.purge !== false && config.purge !== undefined && process.env.NODE_ENV === 'production');
|
||||
|
||||
if (!purgeEnabled) {
|
||||
return removeTailwindMarkers;
|
||||
} // Skip if `purge: []` since that's part of the default config
|
||||
|
||||
|
||||
if (Array.isArray(config.purge) && config.purge.length === 0) {
|
||||
if (configChanged) {
|
||||
_log.default.warn(['Tailwind is not purging unused styles because no template paths have been provided.', 'If you have manually configured PurgeCSS outside of Tailwind or are deliberately not removing unused styles, set `purge: false` in your Tailwind config file to silence this warning.', 'https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css']);
|
||||
}
|
||||
|
||||
return removeTailwindMarkers;
|
||||
}
|
||||
|
||||
return (0, _postcss.default)([function (css) {
|
||||
const mode = _lodash.default.get(config, 'purge.mode', (0, _featureFlags.flagEnabled)(config, 'purgeLayersByDefault') ? 'layers' : 'conservative');
|
||||
|
||||
if (!['all', 'layers', 'conservative'].includes(mode)) {
|
||||
throw new Error('Purge `mode` must be one of `layers` or `all`.');
|
||||
}
|
||||
|
||||
if (mode === 'all') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode === 'conservative') {
|
||||
if (configChanged) {
|
||||
_log.default.warn(['The `conservative` purge mode will be removed in Tailwind 2.0.', 'Please switch to the new `layers` mode instead.']);
|
||||
}
|
||||
}
|
||||
|
||||
const layers = mode === 'conservative' ? ['utilities'] : _lodash.default.get(config, 'purge.layers', ['base', 'components', 'utilities']);
|
||||
css.walkComments(comment => {
|
||||
switch (comment.text.trim()) {
|
||||
case `purgecss start ignore`:
|
||||
comment.before(_postcss.default.comment({
|
||||
text: 'purgecss end ignore'
|
||||
}));
|
||||
break;
|
||||
|
||||
case `purgecss end ignore`:
|
||||
comment.before(_postcss.default.comment({
|
||||
text: 'purgecss end ignore'
|
||||
}));
|
||||
comment.text = 'purgecss start ignore';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
layers.forEach(layer => {
|
||||
switch (comment.text.trim()) {
|
||||
case `tailwind start ${layer}`:
|
||||
comment.text = 'purgecss end ignore';
|
||||
break;
|
||||
|
||||
case `tailwind end ${layer}`:
|
||||
comment.text = 'purgecss start ignore';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
css.prepend(_postcss.default.comment({
|
||||
text: 'purgecss start ignore'
|
||||
}));
|
||||
css.append(_postcss.default.comment({
|
||||
text: 'purgecss end ignore'
|
||||
}));
|
||||
}, removeTailwindMarkers, (0, _postcssPurgecss.default)({
|
||||
content: Array.isArray(config.purge) ? config.purge : config.purge.content,
|
||||
defaultExtractor: content => {
|
||||
// Capture as liberally as possible, including things like `h-(screen-1.5)`
|
||||
const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [];
|
||||
const broadMatchesWithoutTrailingSlash = broadMatches.map(match => _lodash.default.trimEnd(match, '\\')); // Capture classes within other delimiters like .block(class="w-1/2") in Pug
|
||||
|
||||
const innerMatches = content.match(/[^<>"'`\s.(){}[\]#=%]*[^<>"'`\s.(){}[\]#=%:]/g) || [];
|
||||
const matches = broadMatches.concat(broadMatchesWithoutTrailingSlash).concat(innerMatches);
|
||||
|
||||
if (_lodash.default.get(config, 'purge.preserveHtmlElements', true)) {
|
||||
return [..._htmlTags.default].concat(matches);
|
||||
} else {
|
||||
return matches;
|
||||
}
|
||||
},
|
||||
...config.purge.options
|
||||
})]);
|
||||
}
|
||||
74
CTOAsYouGo/node_modules/tailwindcss/lib/lib/regex.js
generated
vendored
74
CTOAsYouGo/node_modules/tailwindcss/lib/lib/regex.js
generated
vendored
@@ -1,74 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
pattern: function() {
|
||||
return pattern;
|
||||
},
|
||||
withoutCapturing: function() {
|
||||
return withoutCapturing;
|
||||
},
|
||||
any: function() {
|
||||
return any;
|
||||
},
|
||||
optional: function() {
|
||||
return optional;
|
||||
},
|
||||
zeroOrMore: function() {
|
||||
return zeroOrMore;
|
||||
},
|
||||
nestedBrackets: function() {
|
||||
return nestedBrackets;
|
||||
},
|
||||
escape: function() {
|
||||
return escape;
|
||||
}
|
||||
});
|
||||
const REGEX_SPECIAL = /[\\^$.*+?()[\]{}|]/g;
|
||||
const REGEX_HAS_SPECIAL = RegExp(REGEX_SPECIAL.source);
|
||||
/**
|
||||
* @param {string|RegExp|Array<string|RegExp>} source
|
||||
*/ function toSource(source) {
|
||||
source = Array.isArray(source) ? source : [
|
||||
source
|
||||
];
|
||||
source = source.map((item)=>item instanceof RegExp ? item.source : item);
|
||||
return source.join("");
|
||||
}
|
||||
function pattern(source) {
|
||||
return new RegExp(toSource(source), "g");
|
||||
}
|
||||
function withoutCapturing(source) {
|
||||
return new RegExp(`(?:${toSource(source)})`, "g");
|
||||
}
|
||||
function any(sources) {
|
||||
return `(?:${sources.map(toSource).join("|")})`;
|
||||
}
|
||||
function optional(source) {
|
||||
return `(?:${toSource(source)})?`;
|
||||
}
|
||||
function zeroOrMore(source) {
|
||||
return `(?:${toSource(source)})*`;
|
||||
}
|
||||
function nestedBrackets(open, close, depth = 1) {
|
||||
return withoutCapturing([
|
||||
escape(open),
|
||||
/[^\s]*/,
|
||||
depth === 1 ? `[^${escape(open)}${escape(close)}\s]*` : any([
|
||||
`[^${escape(open)}${escape(close)}\s]*`,
|
||||
nestedBrackets(open, close, depth - 1)
|
||||
]),
|
||||
/[^\s]*/,
|
||||
escape(close)
|
||||
]);
|
||||
}
|
||||
function escape(string) {
|
||||
return string && REGEX_HAS_SPECIAL.test(string) ? string.replace(REGEX_SPECIAL, "\\$&") : string || "";
|
||||
}
|
||||
28
CTOAsYouGo/node_modules/tailwindcss/lib/lib/registerConfigAsDependency.js
generated
vendored
Normal file
28
CTOAsYouGo/node_modules/tailwindcss/lib/lib/registerConfigAsDependency.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
|
||||
var _getModuleDependencies = _interopRequireDefault(require("./getModuleDependencies"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default(configFile) {
|
||||
if (!_fs.default.existsSync(configFile)) {
|
||||
throw new Error(`Specified Tailwind config file "${configFile}" doesn't exist.`);
|
||||
}
|
||||
|
||||
return function (css, opts) {
|
||||
(0, _getModuleDependencies.default)(configFile).forEach(mdl => {
|
||||
opts.messages.push({
|
||||
type: 'dependency',
|
||||
parent: css.source.input.file,
|
||||
file: mdl.file
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
89
CTOAsYouGo/node_modules/tailwindcss/lib/lib/remap-bitfield.js
generated
vendored
89
CTOAsYouGo/node_modules/tailwindcss/lib/lib/remap-bitfield.js
generated
vendored
@@ -1,89 +0,0 @@
|
||||
// @ts-check
|
||||
/**
|
||||
* We must remap all the old bits to new bits for each set variant
|
||||
* Only arbitrary variants are considered as those are the only
|
||||
* ones that need to be re-sorted at this time
|
||||
*
|
||||
* An iterated process that removes and sets individual bits simultaneously
|
||||
* will not work because we may have a new bit that is also a later old bit
|
||||
* This means that we would be removing a previously set bit which we don't
|
||||
* want to do
|
||||
*
|
||||
* For example (assume `bN` = `1<<N`)
|
||||
* Given the "total" mapping `[[b1, b3], [b2, b4], [b3, b1], [b4, b2]]`
|
||||
* The mapping is "total" because:
|
||||
* 1. Every input and output is accounted for
|
||||
* 2. All combinations are unique
|
||||
* 3. No one input maps to multiple outputs and vice versa
|
||||
* And, given an offset with all bits set:
|
||||
* V = b1 | b2 | b3 | b4
|
||||
*
|
||||
* Let's explore the issue with removing and setting bits simultaneously:
|
||||
* V & ~b1 | b3 = b2 | b3 | b4
|
||||
* V & ~b2 | b4 = b3 | b4
|
||||
* V & ~b3 | b1 = b1 | b4
|
||||
* V & ~b4 | b2 = b1 | b2
|
||||
*
|
||||
* As you can see, we end up with the wrong result.
|
||||
* This is because we're removing a bit that was previously set.
|
||||
* And, thus the final result is missing b3 and b4.
|
||||
*
|
||||
* Now, let's explore the issue with removing the bits first:
|
||||
* V & ~b1 = b2 | b3 | b4
|
||||
* V & ~b2 = b3 | b4
|
||||
* V & ~b3 = b4
|
||||
* V & ~b4 = 0
|
||||
*
|
||||
* And then setting the bits:
|
||||
* V | b3 = b3
|
||||
* V | b4 = b3 | b4
|
||||
* V | b1 = b1 | b3 | b4
|
||||
* V | b2 = b1 | b2 | b3 | b4
|
||||
*
|
||||
* We get the correct result because we're not removing any bits that were
|
||||
* previously set thus properly remapping the bits to the new order
|
||||
*
|
||||
* To collect this into a single operation that can be done simultaneously
|
||||
* we must first create a mask for the old bits that are set and a mask for
|
||||
* the new bits that are set. Then we can remove the old bits and set the new
|
||||
* bits simultaneously in a "single" operation like so:
|
||||
* OldMask = b1 | b2 | b3 | b4
|
||||
* NewMask = b3 | b4 | b1 | b2
|
||||
*
|
||||
* So this:
|
||||
* V & ~oldMask | newMask
|
||||
*
|
||||
* Expands to this:
|
||||
* V & ~b1 & ~b2 & ~b3 & ~b4 | b3 | b4 | b1 | b2
|
||||
*
|
||||
* Which becomes this:
|
||||
* b1 | b2 | b3 | b4
|
||||
*
|
||||
* Which is the correct result!
|
||||
*
|
||||
* @param {bigint} num
|
||||
* @param {[bigint, bigint][]} mapping
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "remapBitfield", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return remapBitfield;
|
||||
}
|
||||
});
|
||||
function remapBitfield(num, mapping) {
|
||||
// Create masks for the old and new bits that are set
|
||||
let oldMask = 0n;
|
||||
let newMask = 0n;
|
||||
for (let [oldBit, newBit] of mapping){
|
||||
if (num & oldBit) {
|
||||
oldMask = oldMask | oldBit;
|
||||
newMask = newMask | newBit;
|
||||
}
|
||||
}
|
||||
// Remove all old bits
|
||||
// Set all new bits
|
||||
return num & ~oldMask | newMask;
|
||||
}
|
||||
165
CTOAsYouGo/node_modules/tailwindcss/lib/lib/resolveDefaultsAtRules.js
generated
vendored
165
CTOAsYouGo/node_modules/tailwindcss/lib/lib/resolveDefaultsAtRules.js
generated
vendored
@@ -1,165 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
elementSelectorParser: function() {
|
||||
return elementSelectorParser;
|
||||
},
|
||||
default: function() {
|
||||
return resolveDefaultsAtRules;
|
||||
}
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
||||
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
||||
const _featureFlags = require("../featureFlags");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let getNode = {
|
||||
id (node) {
|
||||
return _postcssselectorparser.default.attribute({
|
||||
attribute: "id",
|
||||
operator: "=",
|
||||
value: node.value,
|
||||
quoteMark: '"'
|
||||
});
|
||||
}
|
||||
};
|
||||
function minimumImpactSelector(nodes) {
|
||||
let rest = nodes.filter((node)=>{
|
||||
// Keep non-pseudo nodes
|
||||
if (node.type !== "pseudo") return true;
|
||||
// Keep pseudo nodes that have subnodes
|
||||
// E.g.: `:not()` contains subnodes inside the parentheses
|
||||
if (node.nodes.length > 0) return true;
|
||||
// Keep pseudo `elements`
|
||||
// This implicitly means that we ignore pseudo `classes`
|
||||
return node.value.startsWith("::") || [
|
||||
":before",
|
||||
":after",
|
||||
":first-line",
|
||||
":first-letter"
|
||||
].includes(node.value);
|
||||
}).reverse();
|
||||
let searchFor = new Set([
|
||||
"tag",
|
||||
"class",
|
||||
"id",
|
||||
"attribute"
|
||||
]);
|
||||
let splitPointIdx = rest.findIndex((n)=>searchFor.has(n.type));
|
||||
if (splitPointIdx === -1) return rest.reverse().join("").trim();
|
||||
let node = rest[splitPointIdx];
|
||||
let bestNode = getNode[node.type] ? getNode[node.type](node) : node;
|
||||
rest = rest.slice(0, splitPointIdx);
|
||||
let combinatorIdx = rest.findIndex((n)=>n.type === "combinator" && n.value === ">");
|
||||
if (combinatorIdx !== -1) {
|
||||
rest.splice(0, combinatorIdx);
|
||||
rest.unshift(_postcssselectorparser.default.universal());
|
||||
}
|
||||
return [
|
||||
bestNode,
|
||||
...rest.reverse()
|
||||
].join("").trim();
|
||||
}
|
||||
let elementSelectorParser = (0, _postcssselectorparser.default)((selectors)=>{
|
||||
return selectors.map((s)=>{
|
||||
let nodes = s.split((n)=>n.type === "combinator" && n.value === " ").pop();
|
||||
return minimumImpactSelector(nodes);
|
||||
});
|
||||
});
|
||||
let cache = new Map();
|
||||
function extractElementSelector(selector) {
|
||||
if (!cache.has(selector)) {
|
||||
cache.set(selector, elementSelectorParser.transformSync(selector));
|
||||
}
|
||||
return cache.get(selector);
|
||||
}
|
||||
function resolveDefaultsAtRules({ tailwindConfig }) {
|
||||
return (root)=>{
|
||||
let variableNodeMap = new Map();
|
||||
/** @type {Set<import('postcss').AtRule>} */ let universals = new Set();
|
||||
root.walkAtRules("defaults", (rule)=>{
|
||||
if (rule.nodes && rule.nodes.length > 0) {
|
||||
universals.add(rule);
|
||||
return;
|
||||
}
|
||||
let variable = rule.params;
|
||||
if (!variableNodeMap.has(variable)) {
|
||||
variableNodeMap.set(variable, new Set());
|
||||
}
|
||||
variableNodeMap.get(variable).add(rule.parent);
|
||||
rule.remove();
|
||||
});
|
||||
if ((0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) {
|
||||
for (let universal of universals){
|
||||
/** @type {Map<string, Set<string>>} */ let selectorGroups = new Map();
|
||||
var _variableNodeMap_get;
|
||||
let rules = (_variableNodeMap_get = variableNodeMap.get(universal.params)) !== null && _variableNodeMap_get !== void 0 ? _variableNodeMap_get : [];
|
||||
for (let rule of rules){
|
||||
for (let selector of extractElementSelector(rule.selector)){
|
||||
// If selector contains a vendor prefix after a pseudo element or class,
|
||||
// we consider them separately because merging the declarations into
|
||||
// a single rule will cause browsers that do not understand the
|
||||
// vendor prefix to throw out the whole rule
|
||||
let selectorGroupName = selector.includes(":-") || selector.includes("::-") ? selector : "__DEFAULT__";
|
||||
var _selectorGroups_get;
|
||||
let selectors = (_selectorGroups_get = selectorGroups.get(selectorGroupName)) !== null && _selectorGroups_get !== void 0 ? _selectorGroups_get : new Set();
|
||||
selectorGroups.set(selectorGroupName, selectors);
|
||||
selectors.add(selector);
|
||||
}
|
||||
}
|
||||
if ((0, _featureFlags.flagEnabled)(tailwindConfig, "optimizeUniversalDefaults")) {
|
||||
if (selectorGroups.size === 0) {
|
||||
universal.remove();
|
||||
continue;
|
||||
}
|
||||
for (let [, selectors] of selectorGroups){
|
||||
let universalRule = _postcss.default.rule({
|
||||
source: universal.source
|
||||
});
|
||||
universalRule.selectors = [
|
||||
...selectors
|
||||
];
|
||||
universalRule.append(universal.nodes.map((node)=>node.clone()));
|
||||
universal.before(universalRule);
|
||||
}
|
||||
}
|
||||
universal.remove();
|
||||
}
|
||||
} else if (universals.size) {
|
||||
let universalRule = _postcss.default.rule({
|
||||
selectors: [
|
||||
"*",
|
||||
"::before",
|
||||
"::after"
|
||||
]
|
||||
});
|
||||
for (let universal of universals){
|
||||
universalRule.append(universal.nodes);
|
||||
if (!universalRule.parent) {
|
||||
universal.before(universalRule);
|
||||
}
|
||||
if (!universalRule.source) {
|
||||
universalRule.source = universal.source;
|
||||
}
|
||||
universal.remove();
|
||||
}
|
||||
let backdropRule = universalRule.clone({
|
||||
selectors: [
|
||||
"::backdrop"
|
||||
]
|
||||
});
|
||||
universalRule.after(backdropRule);
|
||||
}
|
||||
};
|
||||
}
|
||||
1255
CTOAsYouGo/node_modules/tailwindcss/lib/lib/setupContextUtils.js
generated
vendored
1255
CTOAsYouGo/node_modules/tailwindcss/lib/lib/setupContextUtils.js
generated
vendored
File diff suppressed because it is too large
Load Diff
165
CTOAsYouGo/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
generated
vendored
165
CTOAsYouGo/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
generated
vendored
@@ -1,165 +0,0 @@
|
||||
// @ts-check
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, // DISABLE_TOUCH = TRUE
|
||||
// Retrieve an existing context from cache if possible (since contexts are unique per
|
||||
// source path), or set up a new one (including setting up watchers and registering
|
||||
// plugins) then return it
|
||||
"default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return setupTrackingContext;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru"));
|
||||
const _hashConfig = /*#__PURE__*/ _interop_require_default(require("../util/hashConfig"));
|
||||
const _resolveconfig = /*#__PURE__*/ _interop_require_default(require("../public/resolve-config"));
|
||||
const _resolveConfigPath = /*#__PURE__*/ _interop_require_default(require("../util/resolveConfigPath"));
|
||||
const _setupContextUtils = require("./setupContextUtils");
|
||||
const _parseDependency = /*#__PURE__*/ _interop_require_default(require("../util/parseDependency"));
|
||||
const _validateConfig = require("../util/validateConfig.js");
|
||||
const _content = require("./content.js");
|
||||
const _loadconfig = require("../lib/load-config");
|
||||
const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("./getModuleDependencies"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let configPathCache = new _quicklru.default({
|
||||
maxSize: 100
|
||||
});
|
||||
let candidateFilesCache = new WeakMap();
|
||||
function getCandidateFiles(context, tailwindConfig) {
|
||||
if (candidateFilesCache.has(context)) {
|
||||
return candidateFilesCache.get(context);
|
||||
}
|
||||
let candidateFiles = (0, _content.parseCandidateFiles)(context, tailwindConfig);
|
||||
return candidateFilesCache.set(context, candidateFiles).get(context);
|
||||
}
|
||||
// Get the config object based on a path
|
||||
function getTailwindConfig(configOrPath) {
|
||||
let userConfigPath = (0, _resolveConfigPath.default)(configOrPath);
|
||||
if (userConfigPath !== null) {
|
||||
let [prevConfig, prevConfigHash, prevDeps, prevModified] = configPathCache.get(userConfigPath) || [];
|
||||
let newDeps = (0, _getModuleDependencies.default)(userConfigPath);
|
||||
let modified = false;
|
||||
let newModified = new Map();
|
||||
for (let file of newDeps){
|
||||
let time = _fs.default.statSync(file).mtimeMs;
|
||||
newModified.set(file, time);
|
||||
if (!prevModified || !prevModified.has(file) || time > prevModified.get(file)) {
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
// It hasn't changed (based on timestamps)
|
||||
if (!modified) {
|
||||
return [
|
||||
prevConfig,
|
||||
userConfigPath,
|
||||
prevConfigHash,
|
||||
prevDeps
|
||||
];
|
||||
}
|
||||
// It has changed (based on timestamps), or first run
|
||||
for (let file of newDeps){
|
||||
delete require.cache[file];
|
||||
}
|
||||
let newConfig = (0, _validateConfig.validateConfig)((0, _resolveconfig.default)((0, _loadconfig.loadConfig)(userConfigPath)));
|
||||
let newHash = (0, _hashConfig.default)(newConfig);
|
||||
configPathCache.set(userConfigPath, [
|
||||
newConfig,
|
||||
newHash,
|
||||
newDeps,
|
||||
newModified
|
||||
]);
|
||||
return [
|
||||
newConfig,
|
||||
userConfigPath,
|
||||
newHash,
|
||||
newDeps
|
||||
];
|
||||
}
|
||||
// It's a plain object, not a path
|
||||
let newConfig = (0, _resolveconfig.default)(configOrPath.config === undefined ? configOrPath : configOrPath.config);
|
||||
newConfig = (0, _validateConfig.validateConfig)(newConfig);
|
||||
return [
|
||||
newConfig,
|
||||
null,
|
||||
(0, _hashConfig.default)(newConfig),
|
||||
[]
|
||||
];
|
||||
}
|
||||
function setupTrackingContext(configOrPath) {
|
||||
return ({ tailwindDirectives , registerDependency })=>{
|
||||
return (root, result)=>{
|
||||
let [tailwindConfig, userConfigPath, tailwindConfigHash, configDependencies] = getTailwindConfig(configOrPath);
|
||||
let contextDependencies = new Set(configDependencies);
|
||||
// If there are no @tailwind or @apply rules, we don't consider this CSS
|
||||
// file or its dependencies to be dependencies of the context. Can reuse
|
||||
// the context even if they change. We may want to think about `@layer`
|
||||
// being part of this trigger too, but it's tough because it's impossible
|
||||
// for a layer in one file to end up in the actual @tailwind rule in
|
||||
// another file since independent sources are effectively isolated.
|
||||
if (tailwindDirectives.size > 0) {
|
||||
// Add current css file as a context dependencies.
|
||||
contextDependencies.add(result.opts.from);
|
||||
// Add all css @import dependencies as context dependencies.
|
||||
for (let message of result.messages){
|
||||
if (message.type === "dependency") {
|
||||
contextDependencies.add(message.file);
|
||||
}
|
||||
}
|
||||
}
|
||||
let [context, , mTimesToCommit] = (0, _setupContextUtils.getContext)(root, result, tailwindConfig, userConfigPath, tailwindConfigHash, contextDependencies);
|
||||
let fileModifiedMap = (0, _setupContextUtils.getFileModifiedMap)(context);
|
||||
let candidateFiles = getCandidateFiles(context, tailwindConfig);
|
||||
// If there are no @tailwind or @apply rules, we don't consider this CSS file or it's
|
||||
// dependencies to be dependencies of the context. Can reuse the context even if they change.
|
||||
// We may want to think about `@layer` being part of this trigger too, but it's tough
|
||||
// because it's impossible for a layer in one file to end up in the actual @tailwind rule
|
||||
// in another file since independent sources are effectively isolated.
|
||||
if (tailwindDirectives.size > 0) {
|
||||
// Add template paths as postcss dependencies.
|
||||
for (let contentPath of candidateFiles){
|
||||
for (let dependency of (0, _parseDependency.default)(contentPath)){
|
||||
registerDependency(dependency);
|
||||
}
|
||||
}
|
||||
let [changedContent, contentMTimesToCommit] = (0, _content.resolvedChangedContent)(context, candidateFiles, fileModifiedMap);
|
||||
for (let content of changedContent){
|
||||
context.changedContent.push(content);
|
||||
}
|
||||
// Add the mtimes of the content files to the commit list
|
||||
// We can overwrite the existing values because unconditionally
|
||||
// This is because:
|
||||
// 1. Most of the files here won't be in the map yet
|
||||
// 2. If they are that means it's a context dependency
|
||||
// and we're reading this after the context. This means
|
||||
// that the mtime we just read is strictly >= the context
|
||||
// mtime. Unless the user / os is doing something weird
|
||||
// in which the mtime would be going backwards. If that
|
||||
// happens there's already going to be problems.
|
||||
for (let [path, mtime] of contentMTimesToCommit.entries()){
|
||||
mTimesToCommit.set(path, mtime);
|
||||
}
|
||||
}
|
||||
for (let file of configDependencies){
|
||||
registerDependency({
|
||||
type: "dependency",
|
||||
file
|
||||
});
|
||||
}
|
||||
// "commit" the new modified time for all context deps
|
||||
// We do this here because we want content tracking to
|
||||
// read the "old" mtime even when it's a context dependency.
|
||||
for (let [path, mtime] of mTimesToCommit.entries()){
|
||||
fileModifiedMap.set(path, mtime);
|
||||
}
|
||||
return context;
|
||||
};
|
||||
};
|
||||
}
|
||||
87
CTOAsYouGo/node_modules/tailwindcss/lib/lib/sharedState.js
generated
vendored
87
CTOAsYouGo/node_modules/tailwindcss/lib/lib/sharedState.js
generated
vendored
@@ -1,87 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
env: function() {
|
||||
return env;
|
||||
},
|
||||
contextMap: function() {
|
||||
return contextMap;
|
||||
},
|
||||
configContextMap: function() {
|
||||
return configContextMap;
|
||||
},
|
||||
contextSourcesMap: function() {
|
||||
return contextSourcesMap;
|
||||
},
|
||||
sourceHashMap: function() {
|
||||
return sourceHashMap;
|
||||
},
|
||||
NOT_ON_DEMAND: function() {
|
||||
return NOT_ON_DEMAND;
|
||||
},
|
||||
NONE: function() {
|
||||
return NONE;
|
||||
},
|
||||
resolveDebug: function() {
|
||||
return resolveDebug;
|
||||
}
|
||||
});
|
||||
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../package.json"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const env = typeof process !== "undefined" ? {
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
DEBUG: resolveDebug(process.env.DEBUG),
|
||||
ENGINE: _packagejson.default.tailwindcss.engine
|
||||
} : {
|
||||
NODE_ENV: "production",
|
||||
DEBUG: false,
|
||||
ENGINE: _packagejson.default.tailwindcss.engine
|
||||
};
|
||||
const contextMap = new Map();
|
||||
const configContextMap = new Map();
|
||||
const contextSourcesMap = new Map();
|
||||
const sourceHashMap = new Map();
|
||||
const NOT_ON_DEMAND = new String("*");
|
||||
const NONE = Symbol("__NONE__");
|
||||
function resolveDebug(debug) {
|
||||
if (debug === undefined) {
|
||||
return false;
|
||||
}
|
||||
// Environment variables are strings, so convert to boolean
|
||||
if (debug === "true" || debug === "1") {
|
||||
return true;
|
||||
}
|
||||
if (debug === "false" || debug === "0") {
|
||||
return false;
|
||||
}
|
||||
// Keep the debug convention into account:
|
||||
// DEBUG=* -> This enables all debug modes
|
||||
// DEBUG=projectA,projectB,projectC -> This enables debug for projectA, projectB and projectC
|
||||
// DEBUG=projectA:* -> This enables all debug modes for projectA (if you have sub-types)
|
||||
// DEBUG=projectA,-projectB -> This enables debug for projectA and explicitly disables it for projectB
|
||||
if (debug === "*") {
|
||||
return true;
|
||||
}
|
||||
let debuggers = debug.split(",").map((d)=>d.split(":")[0]);
|
||||
// Ignoring tailwindcss
|
||||
if (debuggers.includes("-tailwindcss")) {
|
||||
return false;
|
||||
}
|
||||
// Including tailwindcss
|
||||
if (debuggers.includes("tailwindcss")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
141
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js
generated
vendored
Normal file
141
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _escapeClassName = _interopRequireDefault(require("../util/escapeClassName"));
|
||||
|
||||
var _prefixSelector = _interopRequireDefault(require("../util/prefixSelector"));
|
||||
|
||||
var _increaseSpecificity = _interopRequireDefault(require("../util/increaseSpecificity"));
|
||||
|
||||
var _featureFlags = require("../featureFlags");
|
||||
|
||||
var _applyComplexClasses = _interopRequireDefault(require("../flagged/applyComplexClasses"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function buildClassTable(css) {
|
||||
const classTable = {};
|
||||
css.walkRules(rule => {
|
||||
if (!_lodash.default.has(classTable, rule.selector)) {
|
||||
classTable[rule.selector] = [];
|
||||
}
|
||||
|
||||
classTable[rule.selector].push(rule);
|
||||
});
|
||||
return classTable;
|
||||
}
|
||||
|
||||
function buildShadowTable(generatedUtilities) {
|
||||
const utilities = _postcss.default.root();
|
||||
|
||||
_postcss.default.root({
|
||||
nodes: generatedUtilities
|
||||
}).walkAtRules('variants', atRule => {
|
||||
utilities.append(atRule.clone().nodes);
|
||||
});
|
||||
|
||||
return buildClassTable(utilities);
|
||||
}
|
||||
|
||||
function normalizeClassName(className) {
|
||||
return `.${(0, _escapeClassName.default)(_lodash.default.trimStart(className, '.'))}`;
|
||||
}
|
||||
|
||||
function findClass(classToApply, classTable, onError) {
|
||||
const matches = _lodash.default.get(classTable, classToApply, []);
|
||||
|
||||
if (_lodash.default.isEmpty(matches)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (matches.length > 1) {
|
||||
// prettier-ignore
|
||||
throw onError(`\`@apply\` cannot be used with ${classToApply} because ${classToApply} is included in multiple rulesets.`);
|
||||
}
|
||||
|
||||
const [match] = matches;
|
||||
|
||||
if (match.parent.type !== 'root') {
|
||||
// prettier-ignore
|
||||
throw onError(`\`@apply\` cannot be used with ${classToApply} because ${classToApply} is nested inside of an at-rule (@${match.parent.name}).`);
|
||||
}
|
||||
|
||||
return match.clone().nodes;
|
||||
}
|
||||
|
||||
let shadowLookup = null;
|
||||
|
||||
function _default(config, getProcessedPlugins, configChanged) {
|
||||
if ((0, _featureFlags.flagEnabled)(config, 'applyComplexClasses')) {
|
||||
return (0, _applyComplexClasses.default)(config, getProcessedPlugins, configChanged);
|
||||
}
|
||||
|
||||
return function (css) {
|
||||
const classLookup = buildClassTable(css);
|
||||
shadowLookup = configChanged || !shadowLookup ? buildShadowTable(getProcessedPlugins().utilities) : shadowLookup;
|
||||
css.walkRules(rule => {
|
||||
rule.walkAtRules('apply', atRule => {
|
||||
const classesAndProperties = _postcss.default.list.space(atRule.params);
|
||||
/*
|
||||
* Don't wreck CSSNext-style @apply rules:
|
||||
* http://cssnext.io/features/#custom-properties-set-apply
|
||||
*
|
||||
* These are deprecated in CSSNext but still playing it safe for now.
|
||||
* We might consider renaming this at-rule.
|
||||
*/
|
||||
|
||||
|
||||
const [customProperties, classes] = _lodash.default.partition(classesAndProperties, classOrProperty => {
|
||||
return _lodash.default.startsWith(classOrProperty, '--');
|
||||
});
|
||||
|
||||
const decls = (0, _lodash.default)(classes).reject(cssClass => cssClass === '!important').flatMap(cssClass => {
|
||||
const classToApply = normalizeClassName(cssClass);
|
||||
|
||||
const onError = message => {
|
||||
return atRule.error(message);
|
||||
};
|
||||
|
||||
return _lodash.default.reduce([// Find exact class match in user's CSS
|
||||
() => {
|
||||
return findClass(classToApply, classLookup, onError);
|
||||
}, // Find exact class match in shadow lookup
|
||||
() => {
|
||||
return findClass(classToApply, shadowLookup, onError);
|
||||
}, // Find prefixed version of class in shadow lookup
|
||||
() => {
|
||||
return findClass((0, _prefixSelector.default)(config.prefix, classToApply), shadowLookup, onError);
|
||||
}, // Find important-scoped version of class in shadow lookup
|
||||
() => {
|
||||
return findClass((0, _increaseSpecificity.default)(config.important, classToApply), shadowLookup, onError);
|
||||
}, // Find important-scoped and prefixed version of class in shadow lookup
|
||||
() => {
|
||||
return findClass((0, _increaseSpecificity.default)(config.important, (0, _prefixSelector.default)(config.prefix, classToApply)), shadowLookup, onError);
|
||||
}, () => {
|
||||
// prettier-ignore
|
||||
throw onError(`\`@apply\` cannot be used with \`${classToApply}\` because \`${classToApply}\` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that \`${classToApply}\` exists, make sure that any \`@import\` statements are being properly processed *before* Tailwind CSS sees your CSS, as \`@apply\` can only be used for classes in the same CSS tree.`);
|
||||
}], (classDecls, candidate) => !_lodash.default.isEmpty(classDecls) ? classDecls : candidate(), []);
|
||||
}).value();
|
||||
|
||||
_lodash.default.tap(_lodash.default.last(classesAndProperties) === '!important', important => {
|
||||
decls.forEach(decl => decl.important = important);
|
||||
});
|
||||
|
||||
atRule.before(decls);
|
||||
atRule.params = customProperties.join(' ');
|
||||
|
||||
if (_lodash.default.isEmpty(customProperties)) {
|
||||
atRule.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
104
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteResponsiveAtRules.js
generated
vendored
Normal file
104
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteResponsiveAtRules.js
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _cloneNodes = _interopRequireDefault(require("../util/cloneNodes"));
|
||||
|
||||
var _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery"));
|
||||
|
||||
var _buildSelectorVariant = _interopRequireDefault(require("../util/buildSelectorVariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isLayer(node) {
|
||||
if (Array.isArray(node)) {
|
||||
return node.length === 1 && isLayer(node[0]);
|
||||
}
|
||||
|
||||
return node.type === 'atrule' && node.name === 'layer';
|
||||
}
|
||||
|
||||
function layerNodes(nodes) {
|
||||
return isLayer(nodes) ? nodes[0].nodes : nodes;
|
||||
}
|
||||
|
||||
function _default(config) {
|
||||
return function (css) {
|
||||
// Wrap any `responsive` rules with a copy of their parent `layer` to
|
||||
// ensure the layer isn't lost when copying to the `screens` location.
|
||||
css.walkAtRules('layer', layerAtRule => {
|
||||
const layer = layerAtRule.params;
|
||||
layerAtRule.walkAtRules('responsive', responsiveAtRule => {
|
||||
const nestedlayerAtRule = _postcss.default.atRule({
|
||||
name: 'layer',
|
||||
params: layer
|
||||
});
|
||||
|
||||
nestedlayerAtRule.prepend(responsiveAtRule.nodes);
|
||||
responsiveAtRule.removeAll();
|
||||
responsiveAtRule.prepend(nestedlayerAtRule);
|
||||
});
|
||||
});
|
||||
const {
|
||||
theme: {
|
||||
screens
|
||||
},
|
||||
separator
|
||||
} = config;
|
||||
|
||||
const responsiveRules = _postcss.default.root();
|
||||
|
||||
const finalRules = [];
|
||||
css.walkAtRules('responsive', atRule => {
|
||||
const nodes = atRule.nodes;
|
||||
responsiveRules.append(...(0, _cloneNodes.default)(nodes)); // If the parent is already a `layer` (this is true for anything coming from
|
||||
// a plugin, including core plugins) we don't want to create a double nested
|
||||
// layer, so only insert the layer children. If there is no parent layer,
|
||||
// preserve the layer information when inserting the nodes.
|
||||
|
||||
if (isLayer(atRule.parent)) {
|
||||
atRule.before(layerNodes(nodes));
|
||||
} else {
|
||||
atRule.before(nodes);
|
||||
}
|
||||
|
||||
atRule.remove();
|
||||
});
|
||||
|
||||
_lodash.default.keys(screens).forEach(screen => {
|
||||
const mediaQuery = _postcss.default.atRule({
|
||||
name: 'media',
|
||||
params: (0, _buildMediaQuery.default)(screens[screen])
|
||||
});
|
||||
|
||||
mediaQuery.append(_lodash.default.tap(responsiveRules.clone(), clonedRoot => {
|
||||
clonedRoot.walkRules(rule => {
|
||||
rule.selectors = _lodash.default.map(rule.selectors, selector => (0, _buildSelectorVariant.default)(selector, screen, separator, message => {
|
||||
throw rule.error(message);
|
||||
}));
|
||||
});
|
||||
}));
|
||||
finalRules.push(mediaQuery);
|
||||
});
|
||||
|
||||
const hasScreenRules = finalRules.some(i => i.nodes.length !== 0);
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params !== 'screens') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasScreenRules) {
|
||||
atRule.before(finalRules);
|
||||
}
|
||||
|
||||
atRule.remove();
|
||||
});
|
||||
};
|
||||
}
|
||||
54
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteScreenAtRules.js
generated
vendored
54
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteScreenAtRules.js
generated
vendored
@@ -1,31 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _normalizeScreens = require("../util/normalizeScreens");
|
||||
const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _default({ tailwindConfig: { theme } }) {
|
||||
return function(css) {
|
||||
css.walkAtRules("screen", (atRule)=>{
|
||||
let screen = atRule.params;
|
||||
let screens = (0, _normalizeScreens.normalizeScreens)(theme.screens);
|
||||
let screenDefinition = screens.find(({ name })=>name === screen);
|
||||
if (!screenDefinition) {
|
||||
throw atRule.error(`No \`${screen}\` screen found.`);
|
||||
}
|
||||
atRule.name = "media";
|
||||
atRule.params = (0, _buildMediaQuery.default)(screenDefinition);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default({
|
||||
theme
|
||||
}) {
|
||||
return function (css) {
|
||||
css.walkAtRules('screen', atRule => {
|
||||
const screen = atRule.params;
|
||||
|
||||
if (!_lodash.default.has(theme.screens, screen)) {
|
||||
throw atRule.error(`No \`${screen}\` screen found.`);
|
||||
}
|
||||
|
||||
atRule.name = 'media';
|
||||
atRule.params = (0, _buildMediaQuery.default)(theme.screens[screen]);
|
||||
});
|
||||
};
|
||||
}
|
||||
97
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteTailwindAtRules.js
generated
vendored
Normal file
97
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteTailwindAtRules.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function updateSource(nodes, source) {
|
||||
return _lodash.default.tap(Array.isArray(nodes) ? _postcss.default.root({
|
||||
nodes
|
||||
}) : nodes, tree => {
|
||||
tree.walk(node => node.source = source);
|
||||
});
|
||||
}
|
||||
|
||||
function _default(_config, {
|
||||
base: pluginBase,
|
||||
components: pluginComponents,
|
||||
utilities: pluginUtilities
|
||||
}) {
|
||||
return function (css) {
|
||||
css.walkAtRules('import', atRule => {
|
||||
if (atRule.params === '"tailwindcss/base"' || atRule.params === "'tailwindcss/base'") {
|
||||
atRule.name = 'tailwind';
|
||||
atRule.params = 'base';
|
||||
}
|
||||
|
||||
if (atRule.params === '"tailwindcss/components"' || atRule.params === "'tailwindcss/components'") {
|
||||
atRule.name = 'tailwind';
|
||||
atRule.params = 'components';
|
||||
}
|
||||
|
||||
if (atRule.params === '"tailwindcss/utilities"' || atRule.params === "'tailwindcss/utilities'") {
|
||||
atRule.name = 'tailwind';
|
||||
atRule.params = 'utilities';
|
||||
}
|
||||
|
||||
if (atRule.params === '"tailwindcss/screens"' || atRule.params === "'tailwindcss/screens'") {
|
||||
atRule.name = 'tailwind';
|
||||
atRule.params = 'screens';
|
||||
}
|
||||
});
|
||||
let includesScreensExplicitly = false;
|
||||
const layers = {
|
||||
base: [],
|
||||
components: [],
|
||||
utilities: []
|
||||
};
|
||||
css.walkAtRules('layer', atRule => {
|
||||
if (!['base', 'components', 'utilities'].includes(atRule.params)) {
|
||||
return;
|
||||
}
|
||||
|
||||
layers[atRule.params].push(atRule);
|
||||
});
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params === 'preflight') {
|
||||
// prettier-ignore
|
||||
throw atRule.error("`@tailwind preflight` is not a valid at-rule in Tailwind v1.0, use `@tailwind base` instead.", {
|
||||
word: 'preflight'
|
||||
});
|
||||
}
|
||||
|
||||
if (atRule.params === 'base') {
|
||||
atRule.after(layers.base);
|
||||
atRule.after(updateSource(pluginBase, atRule.source));
|
||||
}
|
||||
|
||||
if (atRule.params === 'components') {
|
||||
atRule.after(layers.components);
|
||||
atRule.after(updateSource(pluginComponents, atRule.source));
|
||||
}
|
||||
|
||||
if (atRule.params === 'utilities') {
|
||||
atRule.after(layers.utilities);
|
||||
atRule.after(updateSource(pluginUtilities, atRule.source));
|
||||
}
|
||||
|
||||
if (atRule.params === 'screens') {
|
||||
includesScreensExplicitly = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (!includesScreensExplicitly) {
|
||||
css.append([_postcss.default.atRule({
|
||||
name: 'tailwind',
|
||||
params: 'screens'
|
||||
})]);
|
||||
}
|
||||
};
|
||||
}
|
||||
197
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteVariantsAtRules.js
generated
vendored
Normal file
197
CTOAsYouGo/node_modules/tailwindcss/lib/lib/substituteVariantsAtRules.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _generateVariantFunction = _interopRequireDefault(require("../util/generateVariantFunction"));
|
||||
|
||||
var _prefixSelector = _interopRequireDefault(require("../util/prefixSelector"));
|
||||
|
||||
var _buildSelectorVariant = _interopRequireDefault(require("../util/buildSelectorVariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function generatePseudoClassVariant(pseudoClass, selectorPrefix = pseudoClass) {
|
||||
return (0, _generateVariantFunction.default)(({
|
||||
modifySelectors,
|
||||
separator
|
||||
}) => {
|
||||
const parser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
selectors.walkClasses(sel => {
|
||||
sel.value = `${selectorPrefix}${separator}${sel.value}`;
|
||||
sel.parent.insertAfter(sel, _postcssSelectorParser.default.pseudo({
|
||||
value: `:${pseudoClass}`
|
||||
}));
|
||||
});
|
||||
});
|
||||
return modifySelectors(({
|
||||
selector
|
||||
}) => parser.processSync(selector));
|
||||
});
|
||||
}
|
||||
|
||||
function ensureIncludesDefault(variants) {
|
||||
return variants.includes('default') ? variants : ['default', ...variants];
|
||||
}
|
||||
|
||||
const defaultVariantGenerators = config => ({
|
||||
default: (0, _generateVariantFunction.default)(() => {}),
|
||||
'motion-safe': (0, _generateVariantFunction.default)(({
|
||||
container,
|
||||
separator,
|
||||
modifySelectors
|
||||
}) => {
|
||||
const modified = modifySelectors(({
|
||||
selector
|
||||
}) => {
|
||||
return (0, _buildSelectorVariant.default)(selector, 'motion-safe', separator, message => {
|
||||
throw container.error(message);
|
||||
});
|
||||
});
|
||||
|
||||
const mediaQuery = _postcss.default.atRule({
|
||||
name: 'media',
|
||||
params: '(prefers-reduced-motion: no-preference)'
|
||||
});
|
||||
|
||||
mediaQuery.append(modified);
|
||||
container.append(mediaQuery);
|
||||
}, {
|
||||
unstable_stack: true
|
||||
}),
|
||||
'motion-reduce': (0, _generateVariantFunction.default)(({
|
||||
container,
|
||||
separator,
|
||||
modifySelectors
|
||||
}) => {
|
||||
const modified = modifySelectors(({
|
||||
selector
|
||||
}) => {
|
||||
return (0, _buildSelectorVariant.default)(selector, 'motion-reduce', separator, message => {
|
||||
throw container.error(message);
|
||||
});
|
||||
});
|
||||
|
||||
const mediaQuery = _postcss.default.atRule({
|
||||
name: 'media',
|
||||
params: '(prefers-reduced-motion: reduce)'
|
||||
});
|
||||
|
||||
mediaQuery.append(modified);
|
||||
container.append(mediaQuery);
|
||||
}, {
|
||||
unstable_stack: true
|
||||
}),
|
||||
'group-hover': (0, _generateVariantFunction.default)(({
|
||||
modifySelectors,
|
||||
separator
|
||||
}) => {
|
||||
const parser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
selectors.walkClasses(sel => {
|
||||
sel.value = `group-hover${separator}${sel.value}`;
|
||||
sel.parent.insertBefore(sel, (0, _postcssSelectorParser.default)().astSync((0, _prefixSelector.default)(config.prefix, '.group:hover ')));
|
||||
});
|
||||
});
|
||||
return modifySelectors(({
|
||||
selector
|
||||
}) => parser.processSync(selector));
|
||||
}),
|
||||
'group-focus': (0, _generateVariantFunction.default)(({
|
||||
modifySelectors,
|
||||
separator
|
||||
}) => {
|
||||
const parser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
selectors.walkClasses(sel => {
|
||||
sel.value = `group-focus${separator}${sel.value}`;
|
||||
sel.parent.insertBefore(sel, (0, _postcssSelectorParser.default)().astSync((0, _prefixSelector.default)(config.prefix, '.group:focus ')));
|
||||
});
|
||||
});
|
||||
return modifySelectors(({
|
||||
selector
|
||||
}) => parser.processSync(selector));
|
||||
}),
|
||||
hover: generatePseudoClassVariant('hover'),
|
||||
'focus-within': generatePseudoClassVariant('focus-within'),
|
||||
'focus-visible': generatePseudoClassVariant('focus-visible'),
|
||||
focus: generatePseudoClassVariant('focus'),
|
||||
active: generatePseudoClassVariant('active'),
|
||||
visited: generatePseudoClassVariant('visited'),
|
||||
disabled: generatePseudoClassVariant('disabled'),
|
||||
checked: generatePseudoClassVariant('checked'),
|
||||
first: generatePseudoClassVariant('first-child', 'first'),
|
||||
last: generatePseudoClassVariant('last-child', 'last'),
|
||||
odd: generatePseudoClassVariant('nth-child(odd)', 'odd'),
|
||||
even: generatePseudoClassVariant('nth-child(even)', 'even')
|
||||
});
|
||||
|
||||
function prependStackableVariants(atRule, variants, stackableVariants) {
|
||||
if (!_lodash.default.some(variants, v => stackableVariants.includes(v))) {
|
||||
return variants;
|
||||
}
|
||||
|
||||
if (_lodash.default.every(variants, v => stackableVariants.includes(v))) {
|
||||
return variants;
|
||||
}
|
||||
|
||||
const variantsParent = _postcss.default.atRule({
|
||||
name: 'variants',
|
||||
params: variants.filter(v => stackableVariants.includes(v)).join(', ')
|
||||
});
|
||||
|
||||
atRule.before(variantsParent);
|
||||
variantsParent.append(atRule);
|
||||
variants = _lodash.default.without(variants, ...stackableVariants);
|
||||
return variants;
|
||||
}
|
||||
|
||||
function _default(config, {
|
||||
variantGenerators: pluginVariantGenerators
|
||||
}) {
|
||||
return function (css) {
|
||||
const variantGenerators = { ...defaultVariantGenerators(config),
|
||||
...pluginVariantGenerators
|
||||
};
|
||||
const stackableVariants = Object.entries(variantGenerators).filter(([_variant, {
|
||||
options
|
||||
}]) => options.unstable_stack).map(([variant]) => variant);
|
||||
let variantsFound = false;
|
||||
|
||||
do {
|
||||
variantsFound = false;
|
||||
css.walkAtRules('variants', atRule => {
|
||||
variantsFound = true;
|
||||
|
||||
let variants = _postcss.default.list.comma(atRule.params).filter(variant => variant !== '');
|
||||
|
||||
if (variants.includes('responsive')) {
|
||||
const responsiveParent = _postcss.default.atRule({
|
||||
name: 'responsive'
|
||||
});
|
||||
|
||||
atRule.before(responsiveParent);
|
||||
responsiveParent.append(atRule);
|
||||
}
|
||||
|
||||
const remainingVariants = prependStackableVariants(atRule, variants, stackableVariants);
|
||||
|
||||
_lodash.default.forEach(_lodash.default.without(ensureIncludesDefault(remainingVariants), 'responsive'), variant => {
|
||||
if (!variantGenerators[variant]) {
|
||||
throw new Error(`Your config mentions the "${variant}" variant, but "${variant}" doesn't appear to be a variant. Did you forget or misconfigure a plugin that supplies that variant?`);
|
||||
}
|
||||
|
||||
variantGenerators[variant].handler(atRule, config);
|
||||
});
|
||||
|
||||
atRule.remove();
|
||||
});
|
||||
} while (variantsFound);
|
||||
};
|
||||
}
|
||||
5
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli.js
generated
vendored
5
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli.js
generated
vendored
@@ -1,5 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
require("./cli/index");
|
||||
89
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/deps.js
generated
vendored
89
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/deps.js
generated
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
lazyLightningCss: function() {
|
||||
return lazyLightningCss;
|
||||
},
|
||||
lightningcss: function() {
|
||||
return lightningcss;
|
||||
},
|
||||
loadPostcss: function() {
|
||||
return loadPostcss;
|
||||
},
|
||||
loadPostcssImport: function() {
|
||||
return loadPostcssImport;
|
||||
}
|
||||
});
|
||||
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../../package.json"));
|
||||
const _browserslist = /*#__PURE__*/ _interop_require_default(require("browserslist"));
|
||||
const _index = require("../../../../peers/index");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function lazyLightningCss() {
|
||||
// TODO: Make this lazy/bundled
|
||||
return require("lightningcss");
|
||||
}
|
||||
let lightningCss;
|
||||
function loadLightningCss() {
|
||||
if (lightningCss) {
|
||||
return lightningCss;
|
||||
}
|
||||
// Try to load a local version first
|
||||
try {
|
||||
return lightningCss = require("lightningcss");
|
||||
} catch {}
|
||||
return lightningCss = lazyLightningCss();
|
||||
}
|
||||
async function lightningcss(shouldMinify, result) {
|
||||
let css = loadLightningCss();
|
||||
try {
|
||||
let transformed = css.transform({
|
||||
filename: result.opts.from || "input.css",
|
||||
code: Buffer.from(result.css, "utf-8"),
|
||||
minify: shouldMinify,
|
||||
sourceMap: !!result.map,
|
||||
inputSourceMap: result.map ? result.map.toString() : undefined,
|
||||
targets: css.browserslistToTargets((0, _browserslist.default)(_packagejson.default.browserslist)),
|
||||
drafts: {
|
||||
nesting: true
|
||||
}
|
||||
});
|
||||
return Object.assign(result, {
|
||||
css: transformed.code.toString("utf8"),
|
||||
map: result.map ? Object.assign(result.map, {
|
||||
toString () {
|
||||
return transformed.map.toString();
|
||||
}
|
||||
}) : result.map
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("Unable to use Lightning CSS. Using raw version instead.");
|
||||
console.error(err);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
function loadPostcss() {
|
||||
// Try to load a local `postcss` version first
|
||||
try {
|
||||
return require("postcss");
|
||||
} catch {}
|
||||
return (0, _index.lazyPostcss)();
|
||||
}
|
||||
function loadPostcssImport() {
|
||||
// Try to load a local `postcss-import` version first
|
||||
try {
|
||||
return require("postcss-import");
|
||||
} catch {}
|
||||
return (0, _index.lazyPostcssImport)();
|
||||
}
|
||||
53
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/index.js
generated
vendored
53
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/index.js
generated
vendored
@@ -1,53 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "build", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return build;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _resolveConfigPath = require("../../../util/resolveConfigPath");
|
||||
const _plugin = require("./plugin");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function build(args) {
|
||||
let input = args["--input"];
|
||||
let shouldWatch = args["--watch"];
|
||||
// TODO: Deprecate this in future versions
|
||||
if (!input && args["_"][1]) {
|
||||
console.error("[deprecation] Running tailwindcss without -i, please provide an input file.");
|
||||
input = args["--input"] = args["_"][1];
|
||||
}
|
||||
if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
||||
console.error(`Specified input file ${args["--input"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) {
|
||||
console.error(`Specified config file ${args["--config"]} does not exist.`);
|
||||
process.exit(9);
|
||||
}
|
||||
// TODO: Reference the @config path here if exists
|
||||
let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)();
|
||||
let processor = await (0, _plugin.createProcessor)(args, configPath);
|
||||
if (shouldWatch) {
|
||||
// Abort the watcher if stdin is closed to avoid zombie processes
|
||||
// You can disable this behavior with --watch=always
|
||||
if (args["--watch"] !== "always") {
|
||||
process.stdin.on("end", ()=>process.exit(0));
|
||||
}
|
||||
process.stdin.resume();
|
||||
await processor.watch();
|
||||
} else {
|
||||
await processor.build().catch((e)=>{
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
375
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/plugin.js
generated
vendored
375
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/plugin.js
generated
vendored
@@ -1,375 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createProcessor", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createProcessor;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _postcssloadconfig = /*#__PURE__*/ _interop_require_default(require("postcss-load-config"));
|
||||
const _lilconfig = require("lilconfig");
|
||||
const _plugins = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API
|
||||
));
|
||||
const _options = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API
|
||||
));
|
||||
const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("../../../processTailwindFeatures"));
|
||||
const _deps = require("./deps");
|
||||
const _utils = require("./utils");
|
||||
const _sharedState = require("../../../lib/sharedState");
|
||||
const _resolveConfig = /*#__PURE__*/ _interop_require_default(require("../../../../resolveConfig"));
|
||||
const _content = require("../../../lib/content");
|
||||
const _watching = require("./watching");
|
||||
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
||||
const _findAtConfigPath = require("../../../lib/findAtConfigPath");
|
||||
const _log = /*#__PURE__*/ _interop_require_default(require("../../../util/log"));
|
||||
const _loadconfig = require("../../../lib/load-config");
|
||||
const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("../../../lib/getModuleDependencies"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {string} [customPostCssPath ]
|
||||
* @returns
|
||||
*/ async function loadPostCssPlugins(customPostCssPath) {
|
||||
let config = customPostCssPath ? await (async ()=>{
|
||||
let file = _path.default.resolve(customPostCssPath);
|
||||
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
|
||||
// @ts-ignore
|
||||
let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
|
||||
if (typeof config === "function") {
|
||||
config = config();
|
||||
} else {
|
||||
config = Object.assign({}, config);
|
||||
}
|
||||
if (!config.plugins) {
|
||||
config.plugins = [];
|
||||
}
|
||||
return {
|
||||
file,
|
||||
plugins: (0, _plugins.default)(config, file),
|
||||
options: (0, _options.default)(config, file)
|
||||
};
|
||||
})() : await (0, _postcssloadconfig.default)();
|
||||
let configPlugins = config.plugins;
|
||||
let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{
|
||||
if (typeof plugin === "function" && plugin.name === "tailwindcss") {
|
||||
return true;
|
||||
}
|
||||
if (typeof plugin === "object" && plugin !== null && plugin.postcssPlugin === "tailwindcss") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
let beforePlugins = configPluginTailwindIdx === -1 ? [] : configPlugins.slice(0, configPluginTailwindIdx);
|
||||
let afterPlugins = configPluginTailwindIdx === -1 ? configPlugins : configPlugins.slice(configPluginTailwindIdx + 1);
|
||||
return [
|
||||
beforePlugins,
|
||||
afterPlugins,
|
||||
config.options
|
||||
];
|
||||
}
|
||||
function loadBuiltinPostcssPlugins() {
|
||||
let postcss = (0, _deps.loadPostcss)();
|
||||
let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
|
||||
return [
|
||||
[
|
||||
(root)=>{
|
||||
root.walkAtRules("import", (rule)=>{
|
||||
if (rule.params.slice(1).startsWith("tailwindcss/")) {
|
||||
rule.after(postcss.comment({
|
||||
text: IMPORT_COMMENT + rule.params
|
||||
}));
|
||||
rule.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
(0, _deps.loadPostcssImport)(),
|
||||
(root)=>{
|
||||
root.walkComments((rule)=>{
|
||||
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
||||
rule.after(postcss.atRule({
|
||||
name: "import",
|
||||
params: rule.text.replace(IMPORT_COMMENT, "")
|
||||
}));
|
||||
rule.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
],
|
||||
[],
|
||||
{}
|
||||
];
|
||||
}
|
||||
let state = {
|
||||
/** @type {any} */ context: null,
|
||||
/** @type {ReturnType<typeof createWatcher> | null} */ watcher: null,
|
||||
/** @type {{content: string, extension: string}[]} */ changedContent: [],
|
||||
/** @type {{config: Config, dependencies: Set<string>, dispose: Function } | null} */ configBag: null,
|
||||
contextDependencies: new Set(),
|
||||
/** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [],
|
||||
refreshContentPaths () {
|
||||
var _this_context;
|
||||
this.contentPaths = (0, _content.parseCandidateFiles)(this.context, (_this_context = this.context) === null || _this_context === void 0 ? void 0 : _this_context.tailwindConfig);
|
||||
},
|
||||
get config () {
|
||||
return this.context.tailwindConfig;
|
||||
},
|
||||
get contentPatterns () {
|
||||
return {
|
||||
all: this.contentPaths.map((contentPath)=>contentPath.pattern),
|
||||
dynamic: this.contentPaths.filter((contentPath)=>contentPath.glob !== undefined).map((contentPath)=>contentPath.pattern)
|
||||
};
|
||||
},
|
||||
loadConfig (configPath, content) {
|
||||
if (this.watcher && configPath) {
|
||||
this.refreshConfigDependencies();
|
||||
}
|
||||
let config = (0, _loadconfig.loadConfig)(configPath);
|
||||
let dependencies = (0, _getModuleDependencies.default)(configPath);
|
||||
this.configBag = {
|
||||
config,
|
||||
dependencies,
|
||||
dispose () {
|
||||
for (let file of dependencies){
|
||||
delete require.cache[require.resolve(file)];
|
||||
}
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, {
|
||||
content: {
|
||||
files: []
|
||||
}
|
||||
});
|
||||
// Override content files if `--content` has been passed explicitly
|
||||
if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
|
||||
this.configBag.config.content.files = content;
|
||||
}
|
||||
return this.configBag.config;
|
||||
},
|
||||
refreshConfigDependencies (configPath) {
|
||||
var _this_configBag;
|
||||
_sharedState.env.DEBUG && console.time("Module dependencies");
|
||||
(_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Module dependencies");
|
||||
},
|
||||
readContentPaths () {
|
||||
let content = [];
|
||||
// Resolve globs from the content config
|
||||
// TODO: When we make the postcss plugin async-capable this can become async
|
||||
let files = _fastglob.default.sync(this.contentPatterns.all);
|
||||
for (let file of files){
|
||||
if (false) {
|
||||
content.push({
|
||||
file,
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
} else {
|
||||
content.push({
|
||||
content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"),
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
}
|
||||
}
|
||||
// Resolve raw content in the tailwind config
|
||||
let rawContent = this.config.content.files.filter((file)=>{
|
||||
return file !== null && typeof file === "object";
|
||||
});
|
||||
for (let { raw: htmlContent , extension ="html" } of rawContent){
|
||||
content.push({
|
||||
content: htmlContent,
|
||||
extension
|
||||
});
|
||||
}
|
||||
return content;
|
||||
},
|
||||
getContext ({ createContext , cliConfigPath , root , result , content }) {
|
||||
if (this.context) {
|
||||
this.context.changedContent = this.changedContent.splice(0);
|
||||
return this.context;
|
||||
}
|
||||
_sharedState.env.DEBUG && console.time("Searching for config");
|
||||
var _findAtConfigPath1;
|
||||
let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath;
|
||||
_sharedState.env.DEBUG && console.timeEnd("Searching for config");
|
||||
_sharedState.env.DEBUG && console.time("Loading config");
|
||||
let config = this.loadConfig(configPath, content);
|
||||
_sharedState.env.DEBUG && console.timeEnd("Loading config");
|
||||
_sharedState.env.DEBUG && console.time("Creating context");
|
||||
this.context = createContext(config, []);
|
||||
Object.assign(this.context, {
|
||||
userConfigPath: configPath
|
||||
});
|
||||
_sharedState.env.DEBUG && console.timeEnd("Creating context");
|
||||
_sharedState.env.DEBUG && console.time("Resolving content paths");
|
||||
this.refreshContentPaths();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Resolving content paths");
|
||||
if (this.watcher) {
|
||||
_sharedState.env.DEBUG && console.time("Watch new files");
|
||||
this.watcher.refreshWatchedFiles();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Watch new files");
|
||||
}
|
||||
for (let file of this.readContentPaths()){
|
||||
this.context.changedContent.push(file);
|
||||
}
|
||||
return this.context;
|
||||
}
|
||||
};
|
||||
async function createProcessor(args, cliConfigPath) {
|
||||
var _args_content;
|
||||
let postcss = (0, _deps.loadPostcss)();
|
||||
let input = args["--input"];
|
||||
let output = args["--output"];
|
||||
let includePostCss = args["--postcss"];
|
||||
let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
|
||||
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) : loadBuiltinPostcssPlugins();
|
||||
if (args["--purge"]) {
|
||||
_log.default.warn("purge-flag-deprecated", [
|
||||
"The `--purge` flag has been deprecated.",
|
||||
"Please use `--content` instead."
|
||||
]);
|
||||
if (!args["--content"]) {
|
||||
args["--content"] = args["--purge"];
|
||||
}
|
||||
}
|
||||
var _args_content_split;
|
||||
let content = (_args_content_split = (_args_content = args["--content"]) === null || _args_content === void 0 ? void 0 : _args_content.split(/(?<!{[^}]+),/)) !== null && _args_content_split !== void 0 ? _args_content_split : [];
|
||||
let tailwindPlugin = ()=>{
|
||||
return {
|
||||
postcssPlugin: "tailwindcss",
|
||||
Once (root, { result }) {
|
||||
_sharedState.env.DEBUG && console.time("Compiling CSS");
|
||||
(0, _processTailwindFeatures.default)(({ createContext })=>{
|
||||
console.error();
|
||||
console.error("Rebuilding...");
|
||||
return ()=>{
|
||||
return state.getContext({
|
||||
createContext,
|
||||
cliConfigPath,
|
||||
root,
|
||||
result,
|
||||
content
|
||||
});
|
||||
};
|
||||
})(root, result);
|
||||
_sharedState.env.DEBUG && console.timeEnd("Compiling CSS");
|
||||
}
|
||||
};
|
||||
};
|
||||
tailwindPlugin.postcss = true;
|
||||
let plugins = [
|
||||
...beforePlugins,
|
||||
tailwindPlugin,
|
||||
!args["--minify"] && _utils.formatNodes,
|
||||
...afterPlugins
|
||||
].filter(Boolean);
|
||||
/** @type {import('postcss').Processor} */ // @ts-ignore
|
||||
let processor = postcss(plugins);
|
||||
async function readInput() {
|
||||
// Piping in data, let's drain the stdin
|
||||
if (input === "-") {
|
||||
return (0, _utils.drainStdin)();
|
||||
}
|
||||
// Input file has been provided
|
||||
if (input) {
|
||||
return _fs.default.promises.readFile(_path.default.resolve(input), "utf8");
|
||||
}
|
||||
// No input file provided, fallback to default atrules
|
||||
return "@tailwind base; @tailwind components; @tailwind utilities";
|
||||
}
|
||||
async function build() {
|
||||
let start = process.hrtime.bigint();
|
||||
return readInput().then((css)=>processor.process(css, {
|
||||
...postcssOptions,
|
||||
from: input,
|
||||
to: output
|
||||
})).then((result)=>(0, _deps.lightningcss)(!!args["--minify"], result)).then((result)=>{
|
||||
if (!state.watcher) {
|
||||
return result;
|
||||
}
|
||||
_sharedState.env.DEBUG && console.time("Recording PostCSS dependencies");
|
||||
for (let message of result.messages){
|
||||
if (message.type === "dependency") {
|
||||
state.contextDependencies.add(message.file);
|
||||
}
|
||||
}
|
||||
_sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
|
||||
// TODO: This needs to be in a different spot
|
||||
_sharedState.env.DEBUG && console.time("Watch new files");
|
||||
state.watcher.refreshWatchedFiles();
|
||||
_sharedState.env.DEBUG && console.timeEnd("Watch new files");
|
||||
return result;
|
||||
}).then((result)=>{
|
||||
if (!output) {
|
||||
process.stdout.write(result.css);
|
||||
return;
|
||||
}
|
||||
return Promise.all([
|
||||
(0, _utils.outputFile)(result.opts.to, result.css),
|
||||
result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString())
|
||||
]);
|
||||
}).then(()=>{
|
||||
let end = process.hrtime.bigint();
|
||||
console.error();
|
||||
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
||||
}).then(()=>{}, (err)=>{
|
||||
// TODO: If an initial build fails we can't easily pick up any PostCSS dependencies
|
||||
// that were collected before the error occurred
|
||||
// The result is not stored on the error so we have to store it externally
|
||||
// and pull the messages off of it here somehow
|
||||
// This results in a less than ideal DX because the watcher will not pick up
|
||||
// changes to imported CSS if one of them caused an error during the initial build
|
||||
// If you fix it and then save the main CSS file so there's no error
|
||||
// The watcher will start watching the imported CSS files and will be
|
||||
// resilient to future errors.
|
||||
if (state.watcher) {
|
||||
console.error(err);
|
||||
} else {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
||||
*/ async function parseChanges(changes) {
|
||||
return Promise.all(changes.map(async (change)=>({
|
||||
content: await change.content(),
|
||||
extension: change.extension
|
||||
})));
|
||||
}
|
||||
if (input !== undefined && input !== "-") {
|
||||
state.contextDependencies.add(_path.default.resolve(input));
|
||||
}
|
||||
return {
|
||||
build,
|
||||
watch: async ()=>{
|
||||
state.watcher = (0, _watching.createWatcher)(args, {
|
||||
state,
|
||||
/**
|
||||
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
||||
*/ async rebuild (changes) {
|
||||
let needsNewContext = changes.some((change)=>{
|
||||
var _state_configBag;
|
||||
return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file);
|
||||
});
|
||||
if (needsNewContext) {
|
||||
state.context = null;
|
||||
} else {
|
||||
for (let change of (await parseChanges(changes))){
|
||||
state.changedContent.push(change);
|
||||
}
|
||||
}
|
||||
return build();
|
||||
}
|
||||
});
|
||||
await build();
|
||||
}
|
||||
};
|
||||
}
|
||||
87
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/utils.js
generated
vendored
87
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/utils.js
generated
vendored
@@ -1,87 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
indentRecursive: function() {
|
||||
return indentRecursive;
|
||||
},
|
||||
formatNodes: function() {
|
||||
return formatNodes;
|
||||
},
|
||||
readFileWithRetries: function() {
|
||||
return readFileWithRetries;
|
||||
},
|
||||
drainStdin: function() {
|
||||
return drainStdin;
|
||||
},
|
||||
outputFile: function() {
|
||||
return outputFile;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function indentRecursive(node, indent = 0) {
|
||||
node.each && node.each((child, i)=>{
|
||||
if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) {
|
||||
child.raws.before = `\n${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`;
|
||||
}
|
||||
child.raws.after = `\n${" ".repeat(indent)}`;
|
||||
indentRecursive(child, indent + 1);
|
||||
});
|
||||
}
|
||||
function formatNodes(root) {
|
||||
indentRecursive(root);
|
||||
if (root.first) {
|
||||
root.first.raws.before = "";
|
||||
}
|
||||
}
|
||||
async function readFileWithRetries(path, tries = 5) {
|
||||
for(let n = 0; n <= tries; n++){
|
||||
try {
|
||||
return await _fs.default.promises.readFile(path, "utf8");
|
||||
} catch (err) {
|
||||
if (n !== tries) {
|
||||
if (err.code === "ENOENT" || err.code === "EBUSY") {
|
||||
await new Promise((resolve)=>setTimeout(resolve, 10));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
function drainStdin() {
|
||||
return new Promise((resolve, reject)=>{
|
||||
let result = "";
|
||||
process.stdin.on("data", (chunk)=>{
|
||||
result += chunk;
|
||||
});
|
||||
process.stdin.on("end", ()=>resolve(result));
|
||||
process.stdin.on("error", (err)=>reject(err));
|
||||
});
|
||||
}
|
||||
async function outputFile(file, newContents) {
|
||||
try {
|
||||
let currentContents = await _fs.default.promises.readFile(file, "utf8");
|
||||
if (currentContents === newContents) {
|
||||
return; // Skip writing the file
|
||||
}
|
||||
} catch {}
|
||||
// Write the file
|
||||
await _fs.default.promises.mkdir(_path.default.dirname(file), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.default.promises.writeFile(file, newContents, "utf8");
|
||||
}
|
||||
179
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/watching.js
generated
vendored
179
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/build/watching.js
generated
vendored
@@ -1,179 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createWatcher", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createWatcher;
|
||||
}
|
||||
});
|
||||
const _chokidar = /*#__PURE__*/ _interop_require_default(require("chokidar"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch"));
|
||||
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _utils = require("./utils");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function createWatcher(args, { state , rebuild }) {
|
||||
let shouldPoll = args["--poll"];
|
||||
let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
|
||||
// Polling interval in milliseconds
|
||||
// Used only when polling or coalescing add/change events on Windows
|
||||
let pollInterval = 10;
|
||||
let watcher = _chokidar.default.watch([], {
|
||||
// Force checking for atomic writes in all situations
|
||||
// This causes chokidar to wait up to 100ms for a file to re-added after it's been unlinked
|
||||
// This only works when watching directories though
|
||||
atomic: true,
|
||||
usePolling: shouldPoll,
|
||||
interval: shouldPoll ? pollInterval : undefined,
|
||||
ignoreInitial: true,
|
||||
awaitWriteFinish: shouldCoalesceWriteEvents ? {
|
||||
stabilityThreshold: 50,
|
||||
pollInterval: pollInterval
|
||||
} : false
|
||||
});
|
||||
// A queue of rebuilds, file reads, etc… to run
|
||||
let chain = Promise.resolve();
|
||||
/**
|
||||
* A list of files that have been changed since the last rebuild
|
||||
*
|
||||
* @type {{file: string, content: () => Promise<string>, extension: string}[]}
|
||||
*/ let changedContent = [];
|
||||
/**
|
||||
* A list of files for which a rebuild has already been queued.
|
||||
* This is used to prevent duplicate rebuilds when multiple events are fired for the same file.
|
||||
* The rebuilt file is cleared from this list when it's associated rebuild has _started_
|
||||
* This is because if the file is changed during a rebuild it won't trigger a new rebuild which it should
|
||||
**/ let pendingRebuilds = new Set();
|
||||
let _timer;
|
||||
let _reject;
|
||||
/**
|
||||
* Rebuilds the changed files and resolves when the rebuild is
|
||||
* complete regardless of whether it was successful or not
|
||||
*/ async function rebuildAndContinue() {
|
||||
let changes = changedContent.splice(0);
|
||||
// There are no changes to rebuild so we can just do nothing
|
||||
if (changes.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Clear all pending rebuilds for the about-to-be-built files
|
||||
changes.forEach((change)=>pendingRebuilds.delete(change.file));
|
||||
// Resolve the promise even when the rebuild fails
|
||||
return rebuild(changes).then(()=>{}, ()=>{});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} file
|
||||
* @param {(() => Promise<string>) | null} content
|
||||
* @param {boolean} skipPendingCheck
|
||||
* @returns {Promise<void>}
|
||||
*/ function recordChangedFile(file, content = null, skipPendingCheck = false) {
|
||||
file = _path.default.resolve(file);
|
||||
// Applications like Vim/Neovim fire both rename and change events in succession for atomic writes
|
||||
// In that case rebuild has already been queued by rename, so can be skipped in change
|
||||
if (pendingRebuilds.has(file) && !skipPendingCheck) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Mark that a rebuild of this file is going to happen
|
||||
// It MUST happen synchronously before the rebuild is queued for this to be effective
|
||||
pendingRebuilds.add(file);
|
||||
changedContent.push({
|
||||
file,
|
||||
content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, "utf8"),
|
||||
extension: _path.default.extname(file).slice(1)
|
||||
});
|
||||
if (_timer) {
|
||||
clearTimeout(_timer);
|
||||
_reject();
|
||||
}
|
||||
// If a rebuild is already in progress we don't want to start another one until the 10ms timer has expired
|
||||
chain = chain.then(()=>new Promise((resolve, reject)=>{
|
||||
_timer = setTimeout(resolve, 10);
|
||||
_reject = reject;
|
||||
}));
|
||||
// Resolves once this file has been rebuilt (or the rebuild for this file has failed)
|
||||
// This queues as many rebuilds as there are changed files
|
||||
// But those rebuilds happen after some delay
|
||||
// And will immediately resolve if there are no changes
|
||||
chain = chain.then(rebuildAndContinue, rebuildAndContinue);
|
||||
return chain;
|
||||
}
|
||||
watcher.on("change", (file)=>recordChangedFile(file));
|
||||
watcher.on("add", (file)=>recordChangedFile(file));
|
||||
// Restore watching any files that are "removed"
|
||||
// This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed)
|
||||
// TODO: An an optimization we should allow removal when the config changes
|
||||
watcher.on("unlink", (file)=>{
|
||||
file = (0, _normalizepath.default)(file);
|
||||
// Only re-add the file if it's not covered by a dynamic pattern
|
||||
if (!_micromatch.default.some([
|
||||
file
|
||||
], state.contentPatterns.dynamic)) {
|
||||
watcher.add(file);
|
||||
}
|
||||
});
|
||||
// Some applications such as Visual Studio (but not VS Code)
|
||||
// will only fire a rename event for atomic writes and not a change event
|
||||
// This is very likely a chokidar bug but it's one we need to work around
|
||||
// We treat this as a change event and rebuild the CSS
|
||||
watcher.on("raw", (evt, filePath, meta)=>{
|
||||
if (evt !== "rename") {
|
||||
return;
|
||||
}
|
||||
let watchedPath = meta.watchedPath;
|
||||
// Watched path might be the file itself
|
||||
// Or the directory it is in
|
||||
filePath = watchedPath.endsWith(filePath) ? watchedPath : _path.default.join(watchedPath, filePath);
|
||||
// Skip this event since the files it is for does not match any of the registered content globs
|
||||
if (!_micromatch.default.some([
|
||||
filePath
|
||||
], state.contentPatterns.all)) {
|
||||
return;
|
||||
}
|
||||
// Skip since we've already queued a rebuild for this file that hasn't happened yet
|
||||
if (pendingRebuilds.has(filePath)) {
|
||||
return;
|
||||
}
|
||||
// We'll go ahead and add the file to the pending rebuilds list here
|
||||
// It'll be removed when the rebuild starts unless the read fails
|
||||
// which will be taken care of as well
|
||||
pendingRebuilds.add(filePath);
|
||||
async function enqueue() {
|
||||
try {
|
||||
// We need to read the file as early as possible outside of the chain
|
||||
// because it may be gone by the time we get to it. doing the read
|
||||
// immediately increases the chance that the file is still there
|
||||
let content = await (0, _utils.readFileWithRetries)(_path.default.resolve(filePath));
|
||||
if (content === undefined) {
|
||||
return;
|
||||
}
|
||||
// This will push the rebuild onto the chain
|
||||
// We MUST skip the rebuild check here otherwise the rebuild will never happen on Linux
|
||||
// This is because the order of events and timing is different on Linux
|
||||
// @ts-ignore: TypeScript isn't picking up that content is a string here
|
||||
await recordChangedFile(filePath, ()=>content, true);
|
||||
} catch {
|
||||
// If reading the file fails, it's was probably a deleted temporary file
|
||||
// So we can ignore it and no rebuild is needed
|
||||
}
|
||||
}
|
||||
enqueue().then(()=>{
|
||||
// If the file read fails we still need to make sure the file isn't stuck in the pending rebuilds list
|
||||
pendingRebuilds.delete(filePath);
|
||||
});
|
||||
});
|
||||
return {
|
||||
fswatcher: watcher,
|
||||
refreshWatchedFiles () {
|
||||
watcher.add(Array.from(state.contextDependencies));
|
||||
watcher.add(Array.from(state.configBag.dependencies));
|
||||
watcher.add(state.contentPatterns.all);
|
||||
}
|
||||
};
|
||||
}
|
||||
72
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/help/index.js
generated
vendored
72
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/help/index.js
generated
vendored
@@ -1,72 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "help", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return help;
|
||||
}
|
||||
});
|
||||
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../../package.json"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function help({ message , usage , commands , options }) {
|
||||
let indent = 2;
|
||||
// Render header
|
||||
console.log();
|
||||
console.log(`${_packagejson.default.name} v${_packagejson.default.version}`);
|
||||
// Render message
|
||||
if (message) {
|
||||
console.log();
|
||||
for (let msg of message.split("\n")){
|
||||
console.log(msg);
|
||||
}
|
||||
}
|
||||
// Render usage
|
||||
if (usage && usage.length > 0) {
|
||||
console.log();
|
||||
console.log("Usage:");
|
||||
for (let example of usage){
|
||||
console.log(" ".repeat(indent), example);
|
||||
}
|
||||
}
|
||||
// Render commands
|
||||
if (commands && commands.length > 0) {
|
||||
console.log();
|
||||
console.log("Commands:");
|
||||
for (let command of commands){
|
||||
console.log(" ".repeat(indent), command);
|
||||
}
|
||||
}
|
||||
// Render options
|
||||
if (options) {
|
||||
let groupedOptions = {};
|
||||
for (let [key, value] of Object.entries(options)){
|
||||
if (typeof value === "object") {
|
||||
groupedOptions[key] = {
|
||||
...value,
|
||||
flags: [
|
||||
key
|
||||
]
|
||||
};
|
||||
} else {
|
||||
groupedOptions[value].flags.push(key);
|
||||
}
|
||||
}
|
||||
console.log();
|
||||
console.log("Options:");
|
||||
for (let { flags , description , deprecated } of Object.values(groupedOptions)){
|
||||
if (deprecated) continue;
|
||||
if (flags.length === 1) {
|
||||
console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
|
||||
} else {
|
||||
console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log();
|
||||
}
|
||||
214
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/index.js
generated
vendored
214
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/index.js
generated
vendored
@@ -1,214 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _arg = /*#__PURE__*/ _interop_require_default(require("arg"));
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _build = require("./build");
|
||||
const _help = require("./help");
|
||||
const _init = require("./init");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
// ---
|
||||
function oneOf(...options) {
|
||||
return Object.assign((value = true)=>{
|
||||
for (let option of options){
|
||||
let parsed = option(value);
|
||||
if (parsed === value) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
throw new Error("...");
|
||||
}, {
|
||||
manualParsing: true
|
||||
});
|
||||
}
|
||||
let commands = {
|
||||
init: {
|
||||
run: _init.init,
|
||||
args: {
|
||||
"--esm": {
|
||||
type: Boolean,
|
||||
description: `Initialize configuration file as ESM`
|
||||
},
|
||||
"--ts": {
|
||||
type: Boolean,
|
||||
description: `Initialize configuration file as TypeScript`
|
||||
},
|
||||
"--full": {
|
||||
type: Boolean,
|
||||
description: `Include the default values for all options in the generated configuration file`
|
||||
},
|
||||
"-f": "--full"
|
||||
}
|
||||
},
|
||||
build: {
|
||||
run: _build.build,
|
||||
args: {
|
||||
"--input": {
|
||||
type: String,
|
||||
description: "Input file"
|
||||
},
|
||||
"--output": {
|
||||
type: String,
|
||||
description: "Output file"
|
||||
},
|
||||
"--watch": {
|
||||
type: oneOf(String, Boolean),
|
||||
description: "Watch for changes and rebuild as needed"
|
||||
},
|
||||
"--poll": {
|
||||
type: Boolean,
|
||||
description: "Use polling instead of filesystem events when watching"
|
||||
},
|
||||
"--content": {
|
||||
type: String,
|
||||
description: "Content paths to use for removing unused classes"
|
||||
},
|
||||
"--minify": {
|
||||
type: Boolean,
|
||||
description: "Minify the output"
|
||||
},
|
||||
"--config": {
|
||||
type: String,
|
||||
description: "Path to a custom config file"
|
||||
},
|
||||
"-c": "--config",
|
||||
"-i": "--input",
|
||||
"-o": "--output",
|
||||
"-m": "--minify",
|
||||
"-w": "--watch",
|
||||
"-p": "--poll"
|
||||
}
|
||||
}
|
||||
};
|
||||
let sharedFlags = {
|
||||
"--help": {
|
||||
type: Boolean,
|
||||
description: "Display usage information"
|
||||
},
|
||||
"-h": "--help"
|
||||
};
|
||||
if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
|
||||
(0, _help.help)({
|
||||
usage: [
|
||||
"tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
|
||||
"tailwindcss init [--full] [options...]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: {
|
||||
...commands.build.args,
|
||||
...sharedFlags
|
||||
}
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
|
||||
if (commands[command] === undefined) {
|
||||
if (_fs.default.existsSync(_path.default.resolve(command))) {
|
||||
// TODO: Deprecate this in future versions
|
||||
// Check if non-existing command, might be a file.
|
||||
command = "build";
|
||||
} else {
|
||||
(0, _help.help)({
|
||||
message: `Invalid command: ${command}`,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// Execute command
|
||||
let { args: flags , run } = commands[command];
|
||||
let args = (()=>{
|
||||
try {
|
||||
let result = (0, _arg.default)(Object.fromEntries(Object.entries({
|
||||
...flags,
|
||||
...sharedFlags
|
||||
}).filter(([_key, value])=>{
|
||||
var _value_type;
|
||||
return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
|
||||
}).map(([key, value])=>[
|
||||
key,
|
||||
typeof value === "object" ? value.type : value
|
||||
])), {
|
||||
permissive: true
|
||||
});
|
||||
// Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
|
||||
for(let i = result["_"].length - 1; i >= 0; --i){
|
||||
let flag = result["_"][i];
|
||||
if (!flag.startsWith("-")) continue;
|
||||
let [flagName, flagValue] = flag.split("=");
|
||||
let handler = flags[flagName];
|
||||
// Resolve flagName & handler
|
||||
while(typeof handler === "string"){
|
||||
flagName = handler;
|
||||
handler = flags[handler];
|
||||
}
|
||||
if (!handler) continue;
|
||||
let args = [];
|
||||
let offset = i + 1;
|
||||
// --flag value syntax was used so we need to pull `value` from `args`
|
||||
if (flagValue === undefined) {
|
||||
// Parse args for current flag
|
||||
while(result["_"][offset] && !result["_"][offset].startsWith("-")){
|
||||
args.push(result["_"][offset++]);
|
||||
}
|
||||
// Cleanup manually parsed flags + args
|
||||
result["_"].splice(i, 1 + args.length);
|
||||
// No args were provided, use default value defined in handler
|
||||
// One arg was provided, use that directly
|
||||
// Multiple args were provided so pass them all in an array
|
||||
flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args;
|
||||
} else {
|
||||
// Remove the whole flag from the args array
|
||||
result["_"].splice(i, 1);
|
||||
}
|
||||
// Set the resolved value in the `result` object
|
||||
result[flagName] = handler.type(flagValue, flagName);
|
||||
}
|
||||
// Ensure that the `command` is always the first argument in the `args`.
|
||||
// This is important so that we don't have to check if a default command
|
||||
// (build) was used or not from within each plugin.
|
||||
//
|
||||
// E.g.: tailwindcss input.css -> _: ['build', 'input.css']
|
||||
// E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
|
||||
if (result["_"][0] !== command) {
|
||||
result["_"].unshift(command);
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
if (err.code === "ARG_UNKNOWN_OPTION") {
|
||||
(0, _help.help)({
|
||||
message: err.message,
|
||||
usage: [
|
||||
"tailwindcss <command> [options]"
|
||||
],
|
||||
options: sharedFlags
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
})();
|
||||
if (args["--help"]) {
|
||||
(0, _help.help)({
|
||||
options: {
|
||||
...flags,
|
||||
...sharedFlags
|
||||
},
|
||||
usage: [
|
||||
`tailwindcss ${command} [options]`
|
||||
]
|
||||
});
|
||||
process.exit(0);
|
||||
}
|
||||
run(args);
|
||||
52
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/init/index.js
generated
vendored
52
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/cli/init/index.js
generated
vendored
@@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "init", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return init;
|
||||
}
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isESM() {
|
||||
const pkgPath = _path.default.resolve("./package.json");
|
||||
try {
|
||||
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
||||
return pkg.type && pkg.type === "module";
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function init(args) {
|
||||
let messages = [];
|
||||
let isProjectESM = args["--ts"] || args["--esm"] || isESM();
|
||||
let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
|
||||
let extension = args["--ts"] ? "ts" : "js";
|
||||
var _args___;
|
||||
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
|
||||
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
||||
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
||||
} else {
|
||||
let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../../stubs/config.simple.js"), "utf8");
|
||||
let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../../stubs/tailwind.config.${syntax}`), "utf8");
|
||||
// Change colors import
|
||||
stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
|
||||
// Replace contents of {ts,js,cjs} file with the stub {simple,full}.
|
||||
stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
|
||||
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
||||
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
||||
}
|
||||
if (messages.length > 0) {
|
||||
console.log();
|
||||
for (let message of messages){
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/postcss-plugin.js
generated
vendored
2
CTOAsYouGo/node_modules/tailwindcss/lib/oxide/postcss-plugin.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = require("../plugin.js");
|
||||
98
CTOAsYouGo/node_modules/tailwindcss/lib/plugin.js
generated
vendored
98
CTOAsYouGo/node_modules/tailwindcss/lib/plugin.js
generated
vendored
@@ -1,98 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const _setupTrackingContext = /*#__PURE__*/ _interop_require_default(require("./lib/setupTrackingContext"));
|
||||
const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("./processTailwindFeatures"));
|
||||
const _sharedState = require("./lib/sharedState");
|
||||
const _findAtConfigPath = require("./lib/findAtConfigPath");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
module.exports = function tailwindcss(configOrPath) {
|
||||
return {
|
||||
postcssPlugin: "tailwindcss",
|
||||
plugins: [
|
||||
_sharedState.env.DEBUG && function(root) {
|
||||
console.log("\n");
|
||||
console.time("JIT TOTAL");
|
||||
return root;
|
||||
},
|
||||
function(root, result) {
|
||||
var _findAtConfigPath1;
|
||||
// Use the path for the `@config` directive if it exists, otherwise use the
|
||||
// path for the file being processed
|
||||
configOrPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : configOrPath;
|
||||
let context = (0, _setupTrackingContext.default)(configOrPath);
|
||||
if (root.type === "document") {
|
||||
let roots = root.nodes.filter((node)=>node.type === "root");
|
||||
for (const root of roots){
|
||||
if (root.type === "root") {
|
||||
(0, _processTailwindFeatures.default)(context)(root, result);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
(0, _processTailwindFeatures.default)(context)(root, result);
|
||||
},
|
||||
false && function lightningCssPlugin(_root, result) {
|
||||
let postcss = require("postcss");
|
||||
let lightningcss = require("lightningcss");
|
||||
let browserslist = require("browserslist");
|
||||
try {
|
||||
let transformed = lightningcss.transform({
|
||||
filename: result.opts.from,
|
||||
code: Buffer.from(result.root.toString()),
|
||||
minify: false,
|
||||
sourceMap: !!result.map,
|
||||
inputSourceMap: result.map ? result.map.toString() : undefined,
|
||||
targets: typeof process !== "undefined" && process.env.JEST_WORKER_ID ? {
|
||||
chrome: 106 << 16
|
||||
} : lightningcss.browserslistToTargets(browserslist(require("../package.json").browserslist)),
|
||||
drafts: {
|
||||
nesting: true,
|
||||
customMedia: true
|
||||
}
|
||||
});
|
||||
var _result_map;
|
||||
result.map = Object.assign((_result_map = result.map) !== null && _result_map !== void 0 ? _result_map : {}, {
|
||||
toJSON () {
|
||||
return transformed.map.toJSON();
|
||||
},
|
||||
toString () {
|
||||
return transformed.map.toString();
|
||||
}
|
||||
});
|
||||
result.root = postcss.parse(transformed.code.toString("utf8"));
|
||||
} catch (err) {
|
||||
if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) {
|
||||
let lines = err.source.split("\n");
|
||||
err = new Error([
|
||||
"Error formatting using Lightning CSS:",
|
||||
"",
|
||||
...[
|
||||
"```css",
|
||||
...lines.slice(Math.max(err.loc.line - 3, 0), err.loc.line),
|
||||
" ".repeat(err.loc.column - 1) + "^-- " + err.toString(),
|
||||
...lines.slice(err.loc.line, err.loc.line + 2),
|
||||
"```"
|
||||
]
|
||||
].join("\n"));
|
||||
}
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(err, lightningCssPlugin);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
_sharedState.env.DEBUG && function(root) {
|
||||
console.timeEnd("JIT TOTAL");
|
||||
console.log("\n");
|
||||
return root;
|
||||
}
|
||||
].filter(Boolean)
|
||||
};
|
||||
};
|
||||
module.exports.postcss = true;
|
||||
37
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/accessibility.js
generated
vendored
Normal file
37
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/accessibility.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _default() {
|
||||
return function ({
|
||||
addUtilities,
|
||||
variants
|
||||
}) {
|
||||
addUtilities({
|
||||
'.sr-only': {
|
||||
position: 'absolute',
|
||||
width: '1px',
|
||||
height: '1px',
|
||||
padding: '0',
|
||||
margin: '-1px',
|
||||
overflow: 'hidden',
|
||||
clip: 'rect(0, 0, 0, 0)',
|
||||
whiteSpace: 'nowrap',
|
||||
borderWidth: '0'
|
||||
},
|
||||
'.not-sr-only': {
|
||||
position: 'static',
|
||||
width: 'auto',
|
||||
height: 'auto',
|
||||
padding: '0',
|
||||
margin: '0',
|
||||
overflow: 'visible',
|
||||
clip: 'auto',
|
||||
whiteSpace: 'normal'
|
||||
}
|
||||
}, variants('accessibility'));
|
||||
};
|
||||
}
|
||||
34
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/alignContent.js
generated
vendored
Normal file
34
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/alignContent.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _default() {
|
||||
return function ({
|
||||
addUtilities,
|
||||
variants
|
||||
}) {
|
||||
addUtilities({
|
||||
'.content-center': {
|
||||
'align-content': 'center'
|
||||
},
|
||||
'.content-start': {
|
||||
'align-content': 'flex-start'
|
||||
},
|
||||
'.content-end': {
|
||||
'align-content': 'flex-end'
|
||||
},
|
||||
'.content-between': {
|
||||
'align-content': 'space-between'
|
||||
},
|
||||
'.content-around': {
|
||||
'align-content': 'space-around'
|
||||
},
|
||||
'.content-evenly': {
|
||||
'align-content': 'space-evenly'
|
||||
}
|
||||
}, variants('alignContent'));
|
||||
};
|
||||
}
|
||||
31
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/alignItems.js
generated
vendored
Normal file
31
CTOAsYouGo/node_modules/tailwindcss/lib/plugins/alignItems.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _default() {
|
||||
return function ({
|
||||
addUtilities,
|
||||
variants
|
||||
}) {
|
||||
addUtilities({
|
||||
'.items-start': {
|
||||
'align-items': 'flex-start'
|
||||
},
|
||||
'.items-end': {
|
||||
'align-items': 'flex-end'
|
||||
},
|
||||
'.items-center': {
|
||||
'align-items': 'center'
|
||||
},
|
||||
'.items-baseline': {
|
||||
'align-items': 'baseline'
|
||||
},
|
||||
'.items-stretch': {
|
||||
'align-items': 'stretch'
|
||||
}
|
||||
}, variants('alignItems'));
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user