@fluixi-css/core 0.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/base.css +4 -0
- package/components.css +1 -0
- package/dist/base.css +4 -0
- package/dist/components.css +1 -0
- package/dist/index.css +2 -0
- package/dist/package.json +139 -0
- package/dist/reset.css +168 -0
- package/dist/src/ast.d.ts +298 -0
- package/dist/src/ast.js +2240 -0
- package/dist/src/ast.js.map +1 -0
- package/dist/src/commons/constants.d.ts +1193 -0
- package/dist/src/commons/constants.js +1323 -0
- package/dist/src/commons/constants.js.map +1 -0
- package/dist/src/commons/helper.d.ts +1298 -0
- package/dist/src/commons/helper.js +1310 -0
- package/dist/src/commons/helper.js.map +1 -0
- package/dist/src/commons/index.d.ts +3 -0
- package/dist/src/commons/index.js +4 -0
- package/dist/src/commons/index.js.map +1 -0
- package/dist/src/commons/properties.d.ts +1431 -0
- package/dist/src/commons/properties.js +2855 -0
- package/dist/src/commons/properties.js.map +1 -0
- package/dist/src/commons/types.d.ts +359 -0
- package/dist/src/commons/types.js +4 -0
- package/dist/src/commons/types.js.map +1 -0
- package/dist/src/components/avatar/index.d.ts +19 -0
- package/dist/src/components/avatar/index.js +22 -0
- package/dist/src/components/avatar/index.js.map +1 -0
- package/dist/src/components/button/index.d.ts +48 -0
- package/dist/src/components/button/index.js +51 -0
- package/dist/src/components/button/index.js.map +1 -0
- package/dist/src/components/card/index.d.ts +44 -0
- package/dist/src/components/card/index.js +47 -0
- package/dist/src/components/card/index.js.map +1 -0
- package/dist/src/components/checkbox/index.d.ts +69 -0
- package/dist/src/components/checkbox/index.js +80 -0
- package/dist/src/components/checkbox/index.js.map +1 -0
- package/dist/src/components/daterangepicker/index.d.ts +147 -0
- package/dist/src/components/daterangepicker/index.js +150 -0
- package/dist/src/components/daterangepicker/index.js.map +1 -0
- package/dist/src/components/dialog/index.d.ts +71 -0
- package/dist/src/components/dialog/index.js +74 -0
- package/dist/src/components/dialog/index.js.map +1 -0
- package/dist/src/components/drawer/index.d.ts +26 -0
- package/dist/src/components/drawer/index.js +29 -0
- package/dist/src/components/drawer/index.js.map +1 -0
- package/dist/src/components/dropdown/index.d.ts +101 -0
- package/dist/src/components/dropdown/index.js +104 -0
- package/dist/src/components/dropdown/index.js.map +1 -0
- package/dist/src/components/forms/index.d.ts +58 -0
- package/dist/src/components/forms/index.js +62 -0
- package/dist/src/components/forms/index.js.map +1 -0
- package/dist/src/components/index.d.ts +1228 -0
- package/dist/src/components/index.js +64 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/layout/index.d.ts +28 -0
- package/dist/src/components/layout/index.js +33 -0
- package/dist/src/components/layout/index.js.map +1 -0
- package/dist/src/components/list/index.d.ts +65 -0
- package/dist/src/components/list/index.js +68 -0
- package/dist/src/components/list/index.js.map +1 -0
- package/dist/src/components/popover/index.d.ts +79 -0
- package/dist/src/components/popover/index.js +82 -0
- package/dist/src/components/popover/index.js.map +1 -0
- package/dist/src/components/radio/index.d.ts +77 -0
- package/dist/src/components/radio/index.js +80 -0
- package/dist/src/components/radio/index.js.map +1 -0
- package/dist/src/components/select/index.d.ts +102 -0
- package/dist/src/components/select/index.js +105 -0
- package/dist/src/components/select/index.js.map +1 -0
- package/dist/src/components/sidenav/index.d.ts +98 -0
- package/dist/src/components/sidenav/index.js +101 -0
- package/dist/src/components/sidenav/index.js.map +1 -0
- package/dist/src/components/table/index.d.ts +95 -0
- package/dist/src/components/table/index.js +98 -0
- package/dist/src/components/table/index.js.map +1 -0
- package/dist/src/constants.d.ts +3 -0
- package/dist/src/constants.js +29 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/css-ast.d.ts +48 -0
- package/dist/src/css-ast.js +2 -0
- package/dist/src/css-ast.js.map +1 -0
- package/dist/src/css-generator.d.ts +29 -0
- package/dist/src/css-generator.js +104 -0
- package/dist/src/css-generator.js.map +1 -0
- package/dist/src/css-helpers.d.ts +76 -0
- package/dist/src/css-helpers.js +272 -0
- package/dist/src/css-helpers.js.map +1 -0
- package/dist/src/css-lexer.d.ts +48 -0
- package/dist/src/css-lexer.js +255 -0
- package/dist/src/css-lexer.js.map +1 -0
- package/dist/src/css-parser.cjs +2047 -0
- package/dist/src/css-parser.cjs.map +1 -0
- package/dist/src/css-parser.d.ts +100 -0
- package/dist/src/css-parser.js +1098 -0
- package/dist/src/css-parser.js.map +1 -0
- package/dist/src/css-parser.mjs +2028 -0
- package/dist/src/css-parser.mjs.map +1 -0
- package/dist/src/design-system.d.ts +210 -0
- package/dist/src/design-system.js +1034 -0
- package/dist/src/design-system.js.map +1 -0
- package/dist/src/engine/ast.d.ts +44 -0
- package/dist/src/engine/ast.js +92 -0
- package/dist/src/engine/ast.js.map +1 -0
- package/dist/src/engine/atom.d.ts +74 -0
- package/dist/src/engine/atom.js +227 -0
- package/dist/src/engine/atom.js.map +1 -0
- package/dist/src/engine/compile.d.ts +5 -0
- package/dist/src/engine/compile.js +79 -0
- package/dist/src/engine/compile.js.map +1 -0
- package/dist/src/engine/defaults.d.ts +2 -0
- package/dist/src/engine/defaults.js +14 -0
- package/dist/src/engine/defaults.js.map +1 -0
- package/dist/src/engine/directives.d.ts +2 -0
- package/dist/src/engine/directives.js +191 -0
- package/dist/src/engine/directives.js.map +1 -0
- package/dist/src/engine/index.d.ts +41 -0
- package/dist/src/engine/index.js +88 -0
- package/dist/src/engine/index.js.map +1 -0
- package/dist/src/engine/registry.d.ts +46 -0
- package/dist/src/engine/registry.js +49 -0
- package/dist/src/engine/registry.js.map +1 -0
- package/dist/src/engine/scanner.d.ts +1 -0
- package/dist/src/engine/scanner.js +45 -0
- package/dist/src/engine/scanner.js.map +1 -0
- package/dist/src/engine/source.d.ts +12 -0
- package/dist/src/engine/source.js +81 -0
- package/dist/src/engine/source.js.map +1 -0
- package/dist/src/engine/theme-defaults.d.ts +2 -0
- package/dist/src/engine/theme-defaults.js +54 -0
- package/dist/src/engine/theme-defaults.js.map +1 -0
- package/dist/src/engine/theme-source.d.ts +5 -0
- package/dist/src/engine/theme-source.js +71 -0
- package/dist/src/engine/theme-source.js.map +1 -0
- package/dist/src/engine/theme.d.ts +10 -0
- package/dist/src/engine/theme.js +42 -0
- package/dist/src/engine/theme.js.map +1 -0
- package/dist/src/engine/transform.d.ts +25 -0
- package/dist/src/engine/transform.js +91 -0
- package/dist/src/engine/transform.js.map +1 -0
- package/dist/src/engine/ui-preset.d.ts +4 -0
- package/dist/src/engine/ui-preset.js +56 -0
- package/dist/src/engine/ui-preset.js.map +1 -0
- package/dist/src/engine/utilities/backgrounds.d.ts +2 -0
- package/dist/src/engine/utilities/backgrounds.js +32 -0
- package/dist/src/engine/utilities/backgrounds.js.map +1 -0
- package/dist/src/engine/utilities/borders.d.ts +2 -0
- package/dist/src/engine/utilities/borders.js +95 -0
- package/dist/src/engine/utilities/borders.js.map +1 -0
- package/dist/src/engine/utilities/effects.d.ts +2 -0
- package/dist/src/engine/utilities/effects.js +61 -0
- package/dist/src/engine/utilities/effects.js.map +1 -0
- package/dist/src/engine/utilities/flexgrid.d.ts +2 -0
- package/dist/src/engine/utilities/flexgrid.js +125 -0
- package/dist/src/engine/utilities/flexgrid.js.map +1 -0
- package/dist/src/engine/utilities/index.d.ts +3 -0
- package/dist/src/engine/utilities/index.js +20 -0
- package/dist/src/engine/utilities/index.js.map +1 -0
- package/dist/src/engine/utilities/layout.d.ts +2 -0
- package/dist/src/engine/utilities/layout.js +84 -0
- package/dist/src/engine/utilities/layout.js.map +1 -0
- package/dist/src/engine/utilities/sizing.d.ts +2 -0
- package/dist/src/engine/utilities/sizing.js +21 -0
- package/dist/src/engine/utilities/sizing.js.map +1 -0
- package/dist/src/engine/utilities/spacing.d.ts +2 -0
- package/dist/src/engine/utilities/spacing.js +39 -0
- package/dist/src/engine/utilities/spacing.js.map +1 -0
- package/dist/src/engine/utilities/typography.d.ts +2 -0
- package/dist/src/engine/utilities/typography.js +120 -0
- package/dist/src/engine/utilities/typography.js.map +1 -0
- package/dist/src/engine/utilities/values.d.ts +16 -0
- package/dist/src/engine/utilities/values.js +91 -0
- package/dist/src/engine/utilities/values.js.map +1 -0
- package/dist/src/engine/variants.d.ts +2 -0
- package/dist/src/engine/variants.js +99 -0
- package/dist/src/engine/variants.js.map +1 -0
- package/dist/src/extractor.d.ts +146 -0
- package/dist/src/extractor.js +3862 -0
- package/dist/src/extractor.js.map +1 -0
- package/dist/src/index.cjs +4518 -0
- package/dist/src/index.cjs.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.mjs +4480 -0
- package/dist/src/index.mjs.map +1 -0
- package/dist/src/keyframes.cjs +367 -0
- package/dist/src/keyframes.cjs.map +1 -0
- package/dist/src/keyframes.d.ts +27 -0
- package/dist/src/keyframes.js +188 -0
- package/dist/src/keyframes.js.map +1 -0
- package/dist/src/keyframes.mjs +362 -0
- package/dist/src/keyframes.mjs.map +1 -0
- package/dist/src/logger.d.ts +2 -0
- package/dist/src/logger.js +31 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/plugin.cjs +43 -0
- package/dist/src/plugin.cjs.map +1 -0
- package/dist/src/plugin.d.ts +12 -0
- package/dist/src/plugin.js +39 -0
- package/dist/src/plugin.js.map +1 -0
- package/dist/src/plugin.mjs +41 -0
- package/dist/src/plugin.mjs.map +1 -0
- package/dist/src/presets-plugins.cjs +99 -0
- package/dist/src/presets-plugins.cjs.map +1 -0
- package/dist/src/presets-plugins.d.ts +1 -0
- package/dist/src/presets-plugins.js +56 -0
- package/dist/src/presets-plugins.js.map +1 -0
- package/dist/src/presets-plugins.mjs +97 -0
- package/dist/src/presets-plugins.mjs.map +1 -0
- package/dist/src/state.d.ts +76 -0
- package/dist/src/state.js +314 -0
- package/dist/src/state.js.map +1 -0
- package/dist/src/theme/constants.d.ts +22 -0
- package/dist/src/theme/constants.js +17 -0
- package/dist/src/theme/constants.js.map +1 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/theme/index.js +48 -0
- package/dist/src/theme/index.js.map +1 -0
- package/dist/src/theme/types.d.ts +13 -0
- package/dist/src/theme/types.js +2 -0
- package/dist/src/theme/types.js.map +1 -0
- package/dist/src/types/ast.d.ts +23 -0
- package/dist/src/types/ast.js +2 -0
- package/dist/src/types/ast.js.map +1 -0
- package/dist/src/types/base-types.d.ts +53 -0
- package/dist/src/types/base-types.js +2 -0
- package/dist/src/types/base-types.js.map +1 -0
- package/dist/src/types/components-types.d.ts +28 -0
- package/dist/src/types/components-types.js +2 -0
- package/dist/src/types/components-types.js.map +1 -0
- package/dist/src/types/config.d.ts +90 -0
- package/dist/src/types/config.js +3 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/css-parser.d.ts +361 -0
- package/dist/src/types/css-parser.js +2 -0
- package/dist/src/types/css-parser.js.map +1 -0
- package/dist/src/types/keyframes-type.d.ts +47 -0
- package/dist/src/types/keyframes-type.js +2 -0
- package/dist/src/types/keyframes-type.js.map +1 -0
- package/dist/src/types/plugin.d.ts +10 -0
- package/dist/src/types/plugin.js +2 -0
- package/dist/src/types/plugin.js.map +1 -0
- package/dist/src/types/screens-types.d.ts +47 -0
- package/dist/src/types/screens-types.js +2 -0
- package/dist/src/types/screens-types.js.map +1 -0
- package/dist/src/types/utilities-types.d.ts +147 -0
- package/dist/src/types/utilities-types.js +2 -0
- package/dist/src/types/utilities-types.js.map +1 -0
- package/dist/src/types.d.ts +77 -0
- package/dist/src/types.js +12 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/units/constants.d.ts +35 -0
- package/dist/src/units/constants.js +9 -0
- package/dist/src/units/constants.js.map +1 -0
- package/dist/src/units/index.d.ts +15 -0
- package/dist/src/units/index.js +7 -0
- package/dist/src/units/index.js.map +1 -0
- package/dist/src/units/types.d.ts +9 -0
- package/dist/src/units/types.js +2 -0
- package/dist/src/units/types.js.map +1 -0
- package/dist/src/utilities/backgrounds/constants.d.ts +2810 -0
- package/dist/src/utilities/backgrounds/constants.js +119 -0
- package/dist/src/utilities/backgrounds/constants.js.map +1 -0
- package/dist/src/utilities/backgrounds/index.d.ts +1 -0
- package/dist/src/utilities/backgrounds/index.js +2 -0
- package/dist/src/utilities/backgrounds/index.js.map +1 -0
- package/dist/src/utilities/borders/constants.d.ts +10586 -0
- package/dist/src/utilities/borders/constants.js +309 -0
- package/dist/src/utilities/borders/constants.js.map +1 -0
- package/dist/src/utilities/borders/index.d.ts +1 -0
- package/dist/src/utilities/borders/index.js +2 -0
- package/dist/src/utilities/borders/index.js.map +1 -0
- package/dist/src/utilities/breakpoints/constants.d.ts +330 -0
- package/dist/src/utilities/breakpoints/constants.js +269 -0
- package/dist/src/utilities/breakpoints/constants.js.map +1 -0
- package/dist/src/utilities/breakpoints/index.d.ts +2 -0
- package/dist/src/utilities/breakpoints/index.js +3 -0
- package/dist/src/utilities/breakpoints/index.js.map +1 -0
- package/dist/src/utilities/breakpoints/types.d.ts +8 -0
- package/dist/src/utilities/breakpoints/types.js +2 -0
- package/dist/src/utilities/breakpoints/types.js.map +1 -0
- package/dist/src/utilities/colors/base.d.ts +778 -0
- package/dist/src/utilities/colors/base.js +872 -0
- package/dist/src/utilities/colors/base.js.map +1 -0
- package/dist/src/utilities/colors/color.d.ts +1122 -0
- package/dist/src/utilities/colors/color.js +957 -0
- package/dist/src/utilities/colors/color.js.map +1 -0
- package/dist/src/utilities/colors/constants.d.ts +1 -0
- package/dist/src/utilities/colors/constants.js +2 -0
- package/dist/src/utilities/colors/constants.js.map +1 -0
- package/dist/src/utilities/colors/index.d.ts +4 -0
- package/dist/src/utilities/colors/index.js +29 -0
- package/dist/src/utilities/colors/index.js.map +1 -0
- package/dist/src/utilities/colors/types.d.ts +3 -0
- package/dist/src/utilities/colors/types.js +2 -0
- package/dist/src/utilities/colors/types.js.map +1 -0
- package/dist/src/utilities/effects/constants.d.ts +641 -0
- package/dist/src/utilities/effects/constants.js +83 -0
- package/dist/src/utilities/effects/constants.js.map +1 -0
- package/dist/src/utilities/effects/index.d.ts +1 -0
- package/dist/src/utilities/effects/index.js +2 -0
- package/dist/src/utilities/effects/index.js.map +1 -0
- package/dist/src/utilities/filters/constants.d.ts +406 -0
- package/dist/src/utilities/filters/constants.js +206 -0
- package/dist/src/utilities/filters/constants.js.map +1 -0
- package/dist/src/utilities/filters/index.d.ts +1 -0
- package/dist/src/utilities/filters/index.js +2 -0
- package/dist/src/utilities/filters/index.js.map +1 -0
- package/dist/src/utilities/flex/constants.d.ts +934 -0
- package/dist/src/utilities/flex/constants.js +221 -0
- package/dist/src/utilities/flex/constants.js.map +1 -0
- package/dist/src/utilities/flex/index.d.ts +1 -0
- package/dist/src/utilities/flex/index.js +2 -0
- package/dist/src/utilities/flex/index.js.map +1 -0
- package/dist/src/utilities/flex/types.d.ts +0 -0
- package/dist/src/utilities/flex/types.js +4 -0
- package/dist/src/utilities/flex/types.js.map +1 -0
- package/dist/src/utilities/index.d.ts +31338 -0
- package/dist/src/utilities/index.js +333 -0
- package/dist/src/utilities/index.js.map +1 -0
- package/dist/src/utilities/interactivity/constants.d.ts +1244 -0
- package/dist/src/utilities/interactivity/constants.js +165 -0
- package/dist/src/utilities/interactivity/constants.js.map +1 -0
- package/dist/src/utilities/interactivity/index.d.ts +1 -0
- package/dist/src/utilities/interactivity/index.js +2 -0
- package/dist/src/utilities/interactivity/index.js.map +1 -0
- package/dist/src/utilities/layout/constants.d.ts +837 -0
- package/dist/src/utilities/layout/constants.js +159 -0
- package/dist/src/utilities/layout/constants.js.map +1 -0
- package/dist/src/utilities/layout/index.d.ts +1 -0
- package/dist/src/utilities/layout/index.js +2 -0
- package/dist/src/utilities/layout/index.js.map +1 -0
- package/dist/src/utilities/layout/types.d.ts +0 -0
- package/dist/src/utilities/layout/types.js +2 -0
- package/dist/src/utilities/layout/types.js.map +1 -0
- package/dist/src/utilities/sizing/constants.d.ts +989 -0
- package/dist/src/utilities/sizing/constants.js +53 -0
- package/dist/src/utilities/sizing/constants.js.map +1 -0
- package/dist/src/utilities/sizing/index.d.ts +2 -0
- package/dist/src/utilities/sizing/index.js +3 -0
- package/dist/src/utilities/sizing/index.js.map +1 -0
- package/dist/src/utilities/sizing/types.d.ts +10 -0
- package/dist/src/utilities/sizing/types.js +2 -0
- package/dist/src/utilities/sizing/types.js.map +1 -0
- package/dist/src/utilities/spacing/constants.d.ts +1779 -0
- package/dist/src/utilities/spacing/constants.js +142 -0
- package/dist/src/utilities/spacing/constants.js.map +1 -0
- package/dist/src/utilities/spacing/index.d.ts +2 -0
- package/dist/src/utilities/spacing/index.js +3 -0
- package/dist/src/utilities/spacing/index.js.map +1 -0
- package/dist/src/utilities/spacing/types.d.ts +15 -0
- package/dist/src/utilities/spacing/types.js +8 -0
- package/dist/src/utilities/spacing/types.js.map +1 -0
- package/dist/src/utilities/svg/constants.d.ts +1062 -0
- package/dist/src/utilities/svg/constants.js +34 -0
- package/dist/src/utilities/svg/constants.js.map +1 -0
- package/dist/src/utilities/transforms/constants.d.ts +247 -0
- package/dist/src/utilities/transforms/constants.js +74 -0
- package/dist/src/utilities/transforms/constants.js.map +1 -0
- package/dist/src/utilities/transforms/index.d.ts +1 -0
- package/dist/src/utilities/transforms/index.js +2 -0
- package/dist/src/utilities/transforms/index.js.map +1 -0
- package/dist/src/utilities/transitions/constants.d.ts +116 -0
- package/dist/src/utilities/transitions/constants.js +91 -0
- package/dist/src/utilities/transitions/constants.js.map +1 -0
- package/dist/src/utilities/transitions/index.d.ts +1 -0
- package/dist/src/utilities/transitions/index.js +2 -0
- package/dist/src/utilities/transitions/index.js.map +1 -0
- package/dist/src/utilities/typography/constants.d.ts +2401 -0
- package/dist/src/utilities/typography/constants.js +401 -0
- package/dist/src/utilities/typography/constants.js.map +1 -0
- package/dist/src/utilities/typography/index.d.ts +1 -0
- package/dist/src/utilities/typography/index.js +2 -0
- package/dist/src/utilities/typography/index.js.map +1 -0
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.js +282 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/src/watcher.d.ts +15 -0
- package/dist/src/watcher.js +62 -0
- package/dist/src/watcher.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utilities.css +1 -0
- package/index.css +2 -0
- package/package.json +139 -0
- package/reset.css +168 -0
- package/utilities.css +1 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function createPlugin(callback) {
|
|
4
|
+
// const insertions: PlugnInsertions = {} as PlugnInsertions;
|
|
5
|
+
/** API Interface */
|
|
6
|
+
var api = {
|
|
7
|
+
addBase: function addBase(styles) {},
|
|
8
|
+
addVariant: function addVariant(name, transform) {},
|
|
9
|
+
addUtilities: function addUtilities(utilities) {},
|
|
10
|
+
// theme: (t: string)=>t
|
|
11
|
+
theme: function theme(_theme) {
|
|
12
|
+
// return getNestedValue(`${theme}`)
|
|
13
|
+
return "".concat(_theme);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Execute the User-Defined Callback */
|
|
18
|
+
// callback(api);
|
|
19
|
+
|
|
20
|
+
/** Return Collected Rules */
|
|
21
|
+
// return insertions;
|
|
22
|
+
return function (helpers) {
|
|
23
|
+
if (!helpers.addUtilities) {
|
|
24
|
+
helpers.addUtilities = api.addUtilities;
|
|
25
|
+
}
|
|
26
|
+
if (!helpers.addBase) {
|
|
27
|
+
helpers.addBase = api.addBase;
|
|
28
|
+
}
|
|
29
|
+
if (!helpers.addVariant) {
|
|
30
|
+
helpers.addVariant = api.addVariant;
|
|
31
|
+
}
|
|
32
|
+
if (!helpers.addComponents) {
|
|
33
|
+
helpers.addComponents = api.addVariant;
|
|
34
|
+
}
|
|
35
|
+
if (!helpers.theme) {
|
|
36
|
+
helpers.theme = api.theme;
|
|
37
|
+
}
|
|
38
|
+
return callback(helpers);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function DefaultPresets() {
|
|
43
|
+
return createPlugin(function (_ref) {
|
|
44
|
+
var addUtilities = _ref.addUtilities;
|
|
45
|
+
addUtilities({
|
|
46
|
+
'.sr-only': {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
width: '1px',
|
|
49
|
+
height: '1px',
|
|
50
|
+
padding: '0',
|
|
51
|
+
margin: '-1px',
|
|
52
|
+
overflow: 'hidden',
|
|
53
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
54
|
+
whiteSpace: 'nowrap',
|
|
55
|
+
borderWidth: '0'
|
|
56
|
+
},
|
|
57
|
+
'.not-sr-only': {
|
|
58
|
+
position: 'static',
|
|
59
|
+
width: 'auto',
|
|
60
|
+
height: 'auto',
|
|
61
|
+
padding: '0',
|
|
62
|
+
margin: '0',
|
|
63
|
+
overflow: 'visible',
|
|
64
|
+
clip: 'auto',
|
|
65
|
+
whiteSpace: 'normal'
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// export function DefaultPresets(): PluginFunction{
|
|
71
|
+
// return (({addUtilities})=>{
|
|
72
|
+
// addUtilities({
|
|
73
|
+
// '.sr-only': {
|
|
74
|
+
// position: 'absolute',
|
|
75
|
+
// width: '1px',
|
|
76
|
+
// height: '1px',
|
|
77
|
+
// padding: '0',
|
|
78
|
+
// margin: '-1px',
|
|
79
|
+
// overflow: 'hidden',
|
|
80
|
+
// clip: 'rect(0, 0, 0, 0)',
|
|
81
|
+
// whiteSpace: 'nowrap',
|
|
82
|
+
// borderWidth: '0',
|
|
83
|
+
// },
|
|
84
|
+
// '.not-sr-only': {
|
|
85
|
+
// position: 'static',
|
|
86
|
+
// width: 'auto',
|
|
87
|
+
// height: 'auto',
|
|
88
|
+
// padding: '0',
|
|
89
|
+
// margin: '0',
|
|
90
|
+
// overflow: 'visible',
|
|
91
|
+
// clip: 'auto',
|
|
92
|
+
// whiteSpace: 'normal',
|
|
93
|
+
// }
|
|
94
|
+
// })
|
|
95
|
+
// })
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
exports.DefaultPresets = DefaultPresets;
|
|
99
|
+
//# sourceMappingURL=presets-plugins.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets-plugins.cjs","sources":["../../src/plugin.ts","../../src/presets-plugins.ts"],"sourcesContent":["export type ThemeGetter = (path: string) => any;\n\ninterface PluginHelpers {\n addBase?: (styles: Record<string, any>) => void;\n addComponents?: (styles: Record<string, any>) => void;\n addUtilities: (styles: Record<string, any>) => void;\n theme?: ThemeGetter;\n}\n\ntype PluginFunction = (helpers: PluginHelpers) => void;\n\nfunction createPlugin(callback: PluginFunction) {\n // const insertions: PlugnInsertions = {} as PlugnInsertions;\n /** API Interface */\n const api = {\n addBase(styles) {},\n\n addVariant(name, transform) {},\n\n addUtilities(utilities) {},\n addComponents(components) {},\n // theme: (t: string)=>t\n theme: (theme) => {\n // return getNestedValue(`${theme}`)\n return `${theme}`\n }\n };\n\n /** Execute the User-Defined Callback */\n // callback(api);\n\n /** Return Collected Rules */\n // return insertions;\n return (helpers) => {\n if(!helpers.addUtilities){\n helpers.addUtilities = api.addUtilities\n }\n if(!helpers.addBase){\n helpers.addBase = api.addBase\n }\n if(!helpers.addVariant){\n helpers.addVariant = api.addVariant\n }\n if(!helpers.addComponents){\n helpers.addComponents = api.addVariant\n }\n if(!helpers.theme){\n helpers.theme = api.theme;\n }\n\n return callback(helpers);\n };\n \n}\n\ntype Plugin = ReturnType<typeof createPlugin>;\n \nexport type { PluginFunction, PluginHelpers, Plugin };\nexport default createPlugin;","import createPlugin, { PluginFunction } from \"./plugin.js\";\n\nexport function DefaultPresets(){\n return createPlugin((({addUtilities})=>{\n addUtilities({\n '.sr-only': {\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: '0',\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n borderWidth: '0',\n },\n '.not-sr-only': {\n position: 'static',\n width: 'auto',\n height: 'auto',\n padding: '0',\n margin: '0',\n overflow: 'visible',\n clip: 'auto',\n whiteSpace: 'normal',\n }\n })\n }))\n}\n// export function DefaultPresets(): PluginFunction{\n// return (({addUtilities})=>{\n// addUtilities({\n// '.sr-only': {\n// position: 'absolute',\n// width: '1px',\n// height: '1px',\n// padding: '0',\n// margin: '-1px',\n// overflow: 'hidden',\n// clip: 'rect(0, 0, 0, 0)',\n// whiteSpace: 'nowrap',\n// borderWidth: '0',\n// },\n// '.not-sr-only': {\n// position: 'static',\n// width: 'auto',\n// height: 'auto',\n// padding: '0',\n// margin: '0',\n// overflow: 'visible',\n// clip: 'auto',\n// whiteSpace: 'normal',\n// }\n// })\n// })\n// }"],"names":["createPlugin","callback","api","addBase","styles","addVariant","name","transform","addUtilities","utilities","addComponents","theme","concat","helpers","DefaultPresets","_ref","position","width","height","padding","margin","overflow","clip","whiteSpace","borderWidth"],"mappings":";;AAWA,SAASA,YAAYA,CAACC,QAAwB,EAAE;AAC5C;AACA;AACA,EAAA,IAAMC,GAAG,GAAG;AACRC,IAAAA,OAAO,WAAPA,OAAOA,CAACC,MAAM,EAAE,CAAC,CAAC;IAElBC,UAAU,EAAA,SAAVA,UAAUA,CAACC,IAAI,EAAEC,SAAS,EAAE,CAAC,CAAC;AAE9BC,IAAAA,YAAY,WAAZA,YAAYA,CAACC,SAAS,EAAE,CAAC,CAAC;AAC1BC,IACA;AACAC,IAAAA,KAAK,EAAE,SAAPA,KAAKA,CAAGA,MAAK,EAAK;AAChB;MACA,OAAA,EAAA,CAAAC,MAAA,CAAUD,MAAK,CAAA;AACjB,IAAA;GACH;;AAED;AACA;;AAEA;AACA;EACA,OAAO,UAACE,OAAO,EAAK;AAClB,IAAA,IAAG,CAACA,OAAO,CAACL,YAAY,EAAC;AACrBK,MAAAA,OAAO,CAACL,YAAY,GAAGN,GAAG,CAACM,YAAY;AAC3C,IAAA;AACA,IAAA,IAAG,CAACK,OAAO,CAACV,OAAO,EAAC;AAChBU,MAAAA,OAAO,CAACV,OAAO,GAAGD,GAAG,CAACC,OAAO;AACjC,IAAA;AACA,IAAA,IAAG,CAACU,OAAO,CAACR,UAAU,EAAC;AACnBQ,MAAAA,OAAO,CAACR,UAAU,GAAGH,GAAG,CAACG,UAAU;AACvC,IAAA;AACA,IAAA,IAAG,CAACQ,OAAO,CAACH,aAAa,EAAC;AACtBG,MAAAA,OAAO,CAACH,aAAa,GAAGR,GAAG,CAACG,UAAU;AAC1C,IAAA;AACA,IAAA,IAAG,CAACQ,OAAO,CAACF,KAAK,EAAC;AAChBE,MAAAA,OAAO,CAACF,KAAK,GAAGT,GAAG,CAACS,KAAK;AAC3B,IAAA;IAEA,OAAOV,QAAQ,CAACY,OAAO,CAAC;EAC1B,CAAC;AAEL;;ACnDO,SAASC,cAAcA,GAAE;AAC5B,EAAA,OAAOd,YAAY,CAAE,UAAAe,IAAA,EAAkB;AAAA,IAAA,IAAhBP,YAAY,GAAAO,IAAA,CAAZP,YAAY;AAC/BA,IAAAA,YAAY,CAAC;AACT,MAAA,UAAU,EAAE;AACRQ,QAAAA,QAAQ,EAAE,UAAU;AACpBC,QAAAA,KAAK,EAAE,KAAK;AACZC,QAAAA,MAAM,EAAE,KAAK;AACbC,QAAAA,OAAO,EAAE,GAAG;AAChBC,QAAAA,MAAM,EAAE,MAAM;AACdC,QAAAA,QAAQ,EAAE,QAAQ;AAClBC,QAAAA,IAAI,EAAE,kBAAkB;AACxBC,QAAAA,UAAU,EAAE,QAAQ;AACpBC,QAAAA,WAAW,EAAE;OAChB;AACD,MAAA,cAAc,EAAE;AACZR,QAAAA,QAAQ,EAAE,QAAQ;AAClBC,QAAAA,KAAK,EAAE,MAAM;AACbC,QAAAA,MAAM,EAAE,MAAM;AACdC,QAAAA,OAAO,EAAE,GAAG;AACZC,QAAAA,MAAM,EAAE,GAAG;AACXC,QAAAA,QAAQ,EAAE,SAAS;AACnBC,QAAAA,IAAI,EAAE,MAAM;AACZC,QAAAA,UAAU,EAAE;AAChB;AACJ,KAAC,CAAC;AACF,EAAA,CAAE,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DefaultPresets(): (helpers: any) => void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import createPlugin from "./plugin.js";
|
|
2
|
+
export function DefaultPresets() {
|
|
3
|
+
return createPlugin((({ addUtilities }) => {
|
|
4
|
+
addUtilities({
|
|
5
|
+
'.sr-only': {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
width: '1px',
|
|
8
|
+
height: '1px',
|
|
9
|
+
padding: '0',
|
|
10
|
+
margin: '-1px',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
13
|
+
whiteSpace: 'nowrap',
|
|
14
|
+
borderWidth: '0',
|
|
15
|
+
},
|
|
16
|
+
'.not-sr-only': {
|
|
17
|
+
position: 'static',
|
|
18
|
+
width: 'auto',
|
|
19
|
+
height: 'auto',
|
|
20
|
+
padding: '0',
|
|
21
|
+
margin: '0',
|
|
22
|
+
overflow: 'visible',
|
|
23
|
+
clip: 'auto',
|
|
24
|
+
whiteSpace: 'normal',
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
// export function DefaultPresets(): PluginFunction{
|
|
30
|
+
// return (({addUtilities})=>{
|
|
31
|
+
// addUtilities({
|
|
32
|
+
// '.sr-only': {
|
|
33
|
+
// position: 'absolute',
|
|
34
|
+
// width: '1px',
|
|
35
|
+
// height: '1px',
|
|
36
|
+
// padding: '0',
|
|
37
|
+
// margin: '-1px',
|
|
38
|
+
// overflow: 'hidden',
|
|
39
|
+
// clip: 'rect(0, 0, 0, 0)',
|
|
40
|
+
// whiteSpace: 'nowrap',
|
|
41
|
+
// borderWidth: '0',
|
|
42
|
+
// },
|
|
43
|
+
// '.not-sr-only': {
|
|
44
|
+
// position: 'static',
|
|
45
|
+
// width: 'auto',
|
|
46
|
+
// height: 'auto',
|
|
47
|
+
// padding: '0',
|
|
48
|
+
// margin: '0',
|
|
49
|
+
// overflow: 'visible',
|
|
50
|
+
// clip: 'auto',
|
|
51
|
+
// whiteSpace: 'normal',
|
|
52
|
+
// }
|
|
53
|
+
// })
|
|
54
|
+
// })
|
|
55
|
+
// }
|
|
56
|
+
//# sourceMappingURL=presets-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets-plugins.js","sourceRoot":"","sources":["../../src/presets-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,YAAgC,MAAM,aAAa,CAAC;AAE3D,MAAM,UAAU,cAAc;IAC1B,OAAO,YAAY,CAAC,CAAC,CAAC,EAAC,YAAY,EAAC,EAAC,EAAE;QACnC,YAAY,CAAC;YACT,UAAU,EAAE;gBACR,QAAQ,EAAE,UAAU;gBACpB,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,GAAG;gBAChB,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,QAAQ;gBAClB,IAAI,EAAE,kBAAkB;gBACxB,UAAU,EAAE,QAAQ;gBACpB,WAAW,EAAE,GAAG;aACnB;YACD,cAAc,EAAE;gBACZ,QAAQ,EAAE,QAAQ;gBAClB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,GAAG;gBACZ,MAAM,EAAE,GAAG;gBACX,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,QAAQ;aACvB;SACJ,CAAC,CAAA;IACF,CAAC,CAAC,CAAC,CAAA;AACP,CAAC;AACD,oDAAoD;AACpD,kCAAkC;AAClC,yBAAyB;AACzB,4BAA4B;AAC5B,wCAAwC;AACxC,gCAAgC;AAChC,iCAAiC;AACjC,gCAAgC;AAChC,8BAA8B;AAC9B,kCAAkC;AAClC,wCAAwC;AACxC,oCAAoC;AACpC,gCAAgC;AAChC,aAAa;AACb,4BAA4B;AAC5B,kCAAkC;AAClC,6BAA6B;AAC7B,8BAA8B;AAC9B,4BAA4B;AAC5B,2BAA2B;AAC3B,mCAAmC;AACnC,4BAA4B;AAC5B,oCAAoC;AACpC,YAAY;AACZ,SAAS;AACT,KAAK;AACL,IAAI","sourcesContent":["import createPlugin, { PluginFunction } from \"./plugin.js\";\n\nexport function DefaultPresets(){\n return createPlugin((({addUtilities})=>{\n addUtilities({\n '.sr-only': {\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: '0',\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n borderWidth: '0',\n },\n '.not-sr-only': {\n position: 'static',\n width: 'auto',\n height: 'auto',\n padding: '0',\n margin: '0',\n overflow: 'visible',\n clip: 'auto',\n whiteSpace: 'normal',\n }\n })\n }))\n}\n// export function DefaultPresets(): PluginFunction{\n// return (({addUtilities})=>{\n// addUtilities({\n// '.sr-only': {\n// position: 'absolute',\n// width: '1px',\n// height: '1px',\n// padding: '0',\n// margin: '-1px',\n// overflow: 'hidden',\n// clip: 'rect(0, 0, 0, 0)',\n// whiteSpace: 'nowrap',\n// borderWidth: '0',\n// },\n// '.not-sr-only': {\n// position: 'static',\n// width: 'auto',\n// height: 'auto',\n// padding: '0',\n// margin: '0',\n// overflow: 'visible',\n// clip: 'auto',\n// whiteSpace: 'normal',\n// }\n// })\n// })\n// }"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function createPlugin(callback) {
|
|
2
|
+
// const insertions: PlugnInsertions = {} as PlugnInsertions;
|
|
3
|
+
/** API Interface */
|
|
4
|
+
var api = {
|
|
5
|
+
addBase: function addBase(styles) {},
|
|
6
|
+
addVariant: function addVariant(name, transform) {},
|
|
7
|
+
addUtilities: function addUtilities(utilities) {},
|
|
8
|
+
// theme: (t: string)=>t
|
|
9
|
+
theme: function theme(_theme) {
|
|
10
|
+
// return getNestedValue(`${theme}`)
|
|
11
|
+
return "".concat(_theme);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Execute the User-Defined Callback */
|
|
16
|
+
// callback(api);
|
|
17
|
+
|
|
18
|
+
/** Return Collected Rules */
|
|
19
|
+
// return insertions;
|
|
20
|
+
return function (helpers) {
|
|
21
|
+
if (!helpers.addUtilities) {
|
|
22
|
+
helpers.addUtilities = api.addUtilities;
|
|
23
|
+
}
|
|
24
|
+
if (!helpers.addBase) {
|
|
25
|
+
helpers.addBase = api.addBase;
|
|
26
|
+
}
|
|
27
|
+
if (!helpers.addVariant) {
|
|
28
|
+
helpers.addVariant = api.addVariant;
|
|
29
|
+
}
|
|
30
|
+
if (!helpers.addComponents) {
|
|
31
|
+
helpers.addComponents = api.addVariant;
|
|
32
|
+
}
|
|
33
|
+
if (!helpers.theme) {
|
|
34
|
+
helpers.theme = api.theme;
|
|
35
|
+
}
|
|
36
|
+
return callback(helpers);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function DefaultPresets() {
|
|
41
|
+
return createPlugin(function (_ref) {
|
|
42
|
+
var addUtilities = _ref.addUtilities;
|
|
43
|
+
addUtilities({
|
|
44
|
+
'.sr-only': {
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
width: '1px',
|
|
47
|
+
height: '1px',
|
|
48
|
+
padding: '0',
|
|
49
|
+
margin: '-1px',
|
|
50
|
+
overflow: 'hidden',
|
|
51
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
borderWidth: '0'
|
|
54
|
+
},
|
|
55
|
+
'.not-sr-only': {
|
|
56
|
+
position: 'static',
|
|
57
|
+
width: 'auto',
|
|
58
|
+
height: 'auto',
|
|
59
|
+
padding: '0',
|
|
60
|
+
margin: '0',
|
|
61
|
+
overflow: 'visible',
|
|
62
|
+
clip: 'auto',
|
|
63
|
+
whiteSpace: 'normal'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// export function DefaultPresets(): PluginFunction{
|
|
69
|
+
// return (({addUtilities})=>{
|
|
70
|
+
// addUtilities({
|
|
71
|
+
// '.sr-only': {
|
|
72
|
+
// position: 'absolute',
|
|
73
|
+
// width: '1px',
|
|
74
|
+
// height: '1px',
|
|
75
|
+
// padding: '0',
|
|
76
|
+
// margin: '-1px',
|
|
77
|
+
// overflow: 'hidden',
|
|
78
|
+
// clip: 'rect(0, 0, 0, 0)',
|
|
79
|
+
// whiteSpace: 'nowrap',
|
|
80
|
+
// borderWidth: '0',
|
|
81
|
+
// },
|
|
82
|
+
// '.not-sr-only': {
|
|
83
|
+
// position: 'static',
|
|
84
|
+
// width: 'auto',
|
|
85
|
+
// height: 'auto',
|
|
86
|
+
// padding: '0',
|
|
87
|
+
// margin: '0',
|
|
88
|
+
// overflow: 'visible',
|
|
89
|
+
// clip: 'auto',
|
|
90
|
+
// whiteSpace: 'normal',
|
|
91
|
+
// }
|
|
92
|
+
// })
|
|
93
|
+
// })
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
export { DefaultPresets };
|
|
97
|
+
//# sourceMappingURL=presets-plugins.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets-plugins.mjs","sources":["../../src/plugin.ts","../../src/presets-plugins.ts"],"sourcesContent":["export type ThemeGetter = (path: string) => any;\n\ninterface PluginHelpers {\n addBase?: (styles: Record<string, any>) => void;\n addComponents?: (styles: Record<string, any>) => void;\n addUtilities: (styles: Record<string, any>) => void;\n theme?: ThemeGetter;\n}\n\ntype PluginFunction = (helpers: PluginHelpers) => void;\n\nfunction createPlugin(callback: PluginFunction) {\n // const insertions: PlugnInsertions = {} as PlugnInsertions;\n /** API Interface */\n const api = {\n addBase(styles) {},\n\n addVariant(name, transform) {},\n\n addUtilities(utilities) {},\n addComponents(components) {},\n // theme: (t: string)=>t\n theme: (theme) => {\n // return getNestedValue(`${theme}`)\n return `${theme}`\n }\n };\n\n /** Execute the User-Defined Callback */\n // callback(api);\n\n /** Return Collected Rules */\n // return insertions;\n return (helpers) => {\n if(!helpers.addUtilities){\n helpers.addUtilities = api.addUtilities\n }\n if(!helpers.addBase){\n helpers.addBase = api.addBase\n }\n if(!helpers.addVariant){\n helpers.addVariant = api.addVariant\n }\n if(!helpers.addComponents){\n helpers.addComponents = api.addVariant\n }\n if(!helpers.theme){\n helpers.theme = api.theme;\n }\n\n return callback(helpers);\n };\n \n}\n\ntype Plugin = ReturnType<typeof createPlugin>;\n \nexport type { PluginFunction, PluginHelpers, Plugin };\nexport default createPlugin;","import createPlugin, { PluginFunction } from \"./plugin.js\";\n\nexport function DefaultPresets(){\n return createPlugin((({addUtilities})=>{\n addUtilities({\n '.sr-only': {\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: '0',\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n borderWidth: '0',\n },\n '.not-sr-only': {\n position: 'static',\n width: 'auto',\n height: 'auto',\n padding: '0',\n margin: '0',\n overflow: 'visible',\n clip: 'auto',\n whiteSpace: 'normal',\n }\n })\n }))\n}\n// export function DefaultPresets(): PluginFunction{\n// return (({addUtilities})=>{\n// addUtilities({\n// '.sr-only': {\n// position: 'absolute',\n// width: '1px',\n// height: '1px',\n// padding: '0',\n// margin: '-1px',\n// overflow: 'hidden',\n// clip: 'rect(0, 0, 0, 0)',\n// whiteSpace: 'nowrap',\n// borderWidth: '0',\n// },\n// '.not-sr-only': {\n// position: 'static',\n// width: 'auto',\n// height: 'auto',\n// padding: '0',\n// margin: '0',\n// overflow: 'visible',\n// clip: 'auto',\n// whiteSpace: 'normal',\n// }\n// })\n// })\n// }"],"names":["createPlugin","callback","api","addBase","styles","addVariant","name","transform","addUtilities","utilities","addComponents","theme","concat","helpers","DefaultPresets","_ref","position","width","height","padding","margin","overflow","clip","whiteSpace","borderWidth"],"mappings":"AAWA,SAASA,YAAYA,CAACC,QAAwB,EAAE;AAC5C;AACA;AACA,EAAA,IAAMC,GAAG,GAAG;AACRC,IAAAA,OAAO,WAAPA,OAAOA,CAACC,MAAM,EAAE,CAAC,CAAC;IAElBC,UAAU,EAAA,SAAVA,UAAUA,CAACC,IAAI,EAAEC,SAAS,EAAE,CAAC,CAAC;AAE9BC,IAAAA,YAAY,WAAZA,YAAYA,CAACC,SAAS,EAAE,CAAC,CAAC;AAC1BC,IACA;AACAC,IAAAA,KAAK,EAAE,SAAPA,KAAKA,CAAGA,MAAK,EAAK;AAChB;MACA,OAAA,EAAA,CAAAC,MAAA,CAAUD,MAAK,CAAA;AACjB,IAAA;GACH;;AAED;AACA;;AAEA;AACA;EACA,OAAO,UAACE,OAAO,EAAK;AAClB,IAAA,IAAG,CAACA,OAAO,CAACL,YAAY,EAAC;AACrBK,MAAAA,OAAO,CAACL,YAAY,GAAGN,GAAG,CAACM,YAAY;AAC3C,IAAA;AACA,IAAA,IAAG,CAACK,OAAO,CAACV,OAAO,EAAC;AAChBU,MAAAA,OAAO,CAACV,OAAO,GAAGD,GAAG,CAACC,OAAO;AACjC,IAAA;AACA,IAAA,IAAG,CAACU,OAAO,CAACR,UAAU,EAAC;AACnBQ,MAAAA,OAAO,CAACR,UAAU,GAAGH,GAAG,CAACG,UAAU;AACvC,IAAA;AACA,IAAA,IAAG,CAACQ,OAAO,CAACH,aAAa,EAAC;AACtBG,MAAAA,OAAO,CAACH,aAAa,GAAGR,GAAG,CAACG,UAAU;AAC1C,IAAA;AACA,IAAA,IAAG,CAACQ,OAAO,CAACF,KAAK,EAAC;AAChBE,MAAAA,OAAO,CAACF,KAAK,GAAGT,GAAG,CAACS,KAAK;AAC3B,IAAA;IAEA,OAAOV,QAAQ,CAACY,OAAO,CAAC;EAC1B,CAAC;AAEL;;ACnDO,SAASC,cAAcA,GAAE;AAC5B,EAAA,OAAOd,YAAY,CAAE,UAAAe,IAAA,EAAkB;AAAA,IAAA,IAAhBP,YAAY,GAAAO,IAAA,CAAZP,YAAY;AAC/BA,IAAAA,YAAY,CAAC;AACT,MAAA,UAAU,EAAE;AACRQ,QAAAA,QAAQ,EAAE,UAAU;AACpBC,QAAAA,KAAK,EAAE,KAAK;AACZC,QAAAA,MAAM,EAAE,KAAK;AACbC,QAAAA,OAAO,EAAE,GAAG;AAChBC,QAAAA,MAAM,EAAE,MAAM;AACdC,QAAAA,QAAQ,EAAE,QAAQ;AAClBC,QAAAA,IAAI,EAAE,kBAAkB;AACxBC,QAAAA,UAAU,EAAE,QAAQ;AACpBC,QAAAA,WAAW,EAAE;OAChB;AACD,MAAA,cAAc,EAAE;AACZR,QAAAA,QAAQ,EAAE,QAAQ;AAClBC,QAAAA,KAAK,EAAE,MAAM;AACbC,QAAAA,MAAM,EAAE,MAAM;AACdC,QAAAA,OAAO,EAAE,GAAG;AACZC,QAAAA,MAAM,EAAE,GAAG;AACXC,QAAAA,QAAQ,EAAE,SAAS;AACnBC,QAAAA,IAAI,EAAE,MAAM;AACZC,QAAAA,UAAU,EAAE;AAChB;AACJ,KAAC,CAAC;AACF,EAAA,CAAE,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { JitSelector, Config, ThemeUtilities, FileContent } from "./types";
|
|
2
|
+
import { PluginFunction } from "./types/plugin";
|
|
3
|
+
import Cache, { Options } from "@alloc/quick-lru";
|
|
4
|
+
interface ThemeState {
|
|
5
|
+
utilities?: ThemeUtilities;
|
|
6
|
+
config?: Config;
|
|
7
|
+
extracted_classes?: string[];
|
|
8
|
+
utilities_classes?: string[];
|
|
9
|
+
files: FileContent[];
|
|
10
|
+
atomic_css?: string;
|
|
11
|
+
space?: string;
|
|
12
|
+
mode?: {
|
|
13
|
+
light?: string;
|
|
14
|
+
dark?: string;
|
|
15
|
+
};
|
|
16
|
+
variants?: JitSelector[];
|
|
17
|
+
cache?: Map<string, any>;
|
|
18
|
+
cachedJit?: Map<string, any>;
|
|
19
|
+
plugins?: PluginFunction[];
|
|
20
|
+
configPath?: string;
|
|
21
|
+
pluginInit?: boolean;
|
|
22
|
+
loaded_cache?: any;
|
|
23
|
+
}
|
|
24
|
+
export declare class GlobalStateManager {
|
|
25
|
+
cache_state?: Cache<string, ThemeState>;
|
|
26
|
+
encoded_ast_tokens: Map<string, any>;
|
|
27
|
+
listeners: any;
|
|
28
|
+
instance: any;
|
|
29
|
+
get state(): ThemeState | undefined;
|
|
30
|
+
set state(value: ThemeState | undefined);
|
|
31
|
+
constructor(options?: Options<string, any>);
|
|
32
|
+
get variants(): JitSelector[] | null | undefined;
|
|
33
|
+
get cachedJit(): Map<string, any>;
|
|
34
|
+
get cache(): Map<string, any>;
|
|
35
|
+
get plugins(): PluginFunction[];
|
|
36
|
+
get configPath(): string | undefined;
|
|
37
|
+
get pluginInit(): boolean;
|
|
38
|
+
updateCssUtilities(value: any): void;
|
|
39
|
+
setPluginInit(value: boolean): void;
|
|
40
|
+
setPlugins(value?: PluginFunction[]): void;
|
|
41
|
+
setConfigPath(value?: string | null): void;
|
|
42
|
+
setVariants(_variants: JitSelector[]): void;
|
|
43
|
+
subscribe(listener: any): () => any;
|
|
44
|
+
setState(newState: any): void;
|
|
45
|
+
notify(): void;
|
|
46
|
+
getState(): ThemeState;
|
|
47
|
+
updateObject(key: any, value: any): void;
|
|
48
|
+
removeObject(key: any): void;
|
|
49
|
+
getThemeUtilities(key: keyof ThemeUtilities): any;
|
|
50
|
+
setThemeUtilities(value: any): void;
|
|
51
|
+
setConfig(value: Config): void;
|
|
52
|
+
get ThemeUtilities(): ThemeUtilities | undefined;
|
|
53
|
+
set loaded_cache(value: any);
|
|
54
|
+
get loaded_cache(): any;
|
|
55
|
+
getObject(key: any): any;
|
|
56
|
+
clearState(): void;
|
|
57
|
+
setExtractedClasses(value: any): void;
|
|
58
|
+
setUtilitiesClasses(value: any): void;
|
|
59
|
+
setFiles(value: FileContent[]): void;
|
|
60
|
+
setAtomicCSS(value: any): void;
|
|
61
|
+
setMode(value?: {
|
|
62
|
+
light?: string;
|
|
63
|
+
dark?: string;
|
|
64
|
+
}): void;
|
|
65
|
+
getMode(): {
|
|
66
|
+
light?: string;
|
|
67
|
+
dark?: string;
|
|
68
|
+
};
|
|
69
|
+
get config(): Config | undefined;
|
|
70
|
+
get atomic_css(): string | undefined;
|
|
71
|
+
get files(): FileContent[] | undefined;
|
|
72
|
+
get extracted_classes(): string[] | undefined;
|
|
73
|
+
get utilities_classes(): string[] | undefined;
|
|
74
|
+
get utilities(): ThemeUtilities | undefined;
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import Cache from "@alloc/quick-lru";
|
|
2
|
+
export class GlobalStateManager {
|
|
3
|
+
get state() {
|
|
4
|
+
if (!this.cache_state)
|
|
5
|
+
return undefined;
|
|
6
|
+
return this.cache_state.get("state");
|
|
7
|
+
}
|
|
8
|
+
set state(value) {
|
|
9
|
+
if (!this.cache_state)
|
|
10
|
+
return;
|
|
11
|
+
if (!value) {
|
|
12
|
+
this.cache_state.clear();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
this.cache_state.set("state", value);
|
|
16
|
+
}
|
|
17
|
+
constructor(options = { maxSize: 50, maxAge: 500 * 1000 }) {
|
|
18
|
+
this.encoded_ast_tokens = new Map();
|
|
19
|
+
if (this.instance)
|
|
20
|
+
return this.instance;
|
|
21
|
+
this.cache_state = new Cache(options);
|
|
22
|
+
this.cache_state.set("state", {
|
|
23
|
+
utilities: undefined,
|
|
24
|
+
config: undefined,
|
|
25
|
+
extracted_classes: [],
|
|
26
|
+
utilities_classes: [],
|
|
27
|
+
files: [],
|
|
28
|
+
atomic_css: undefined,
|
|
29
|
+
space: ' ',
|
|
30
|
+
variants: [],
|
|
31
|
+
cache: new Map(),
|
|
32
|
+
cachedJit: new Map(),
|
|
33
|
+
plugins: [],
|
|
34
|
+
pluginInit: false
|
|
35
|
+
});
|
|
36
|
+
// this.state = initialState;
|
|
37
|
+
this.listeners = new Set();
|
|
38
|
+
this.instance = this; // Singleton instance
|
|
39
|
+
}
|
|
40
|
+
get variants() {
|
|
41
|
+
if (!this.state)
|
|
42
|
+
return null;
|
|
43
|
+
return Object.assign({}, this.state).variants;
|
|
44
|
+
}
|
|
45
|
+
get cachedJit() {
|
|
46
|
+
if (!this.state) {
|
|
47
|
+
this.state = {};
|
|
48
|
+
}
|
|
49
|
+
if (!this.state.cachedJit) {
|
|
50
|
+
this.state.cachedJit = new Map();
|
|
51
|
+
}
|
|
52
|
+
return this.state.cachedJit;
|
|
53
|
+
}
|
|
54
|
+
get cache() {
|
|
55
|
+
if (!this.state) {
|
|
56
|
+
this.state = {};
|
|
57
|
+
}
|
|
58
|
+
;
|
|
59
|
+
if (!this.state.cache) {
|
|
60
|
+
this.state.cache = new Map();
|
|
61
|
+
}
|
|
62
|
+
return this.state.cache;
|
|
63
|
+
}
|
|
64
|
+
get plugins() {
|
|
65
|
+
if (!this.state) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
return this.state.plugins || [];
|
|
69
|
+
}
|
|
70
|
+
get configPath() {
|
|
71
|
+
if (!this.state)
|
|
72
|
+
return undefined;
|
|
73
|
+
return this.state.configPath;
|
|
74
|
+
}
|
|
75
|
+
get pluginInit() {
|
|
76
|
+
if (!this.state)
|
|
77
|
+
return false;
|
|
78
|
+
return this.state.pluginInit || false;
|
|
79
|
+
}
|
|
80
|
+
updateCssUtilities(value) {
|
|
81
|
+
if (!this.state)
|
|
82
|
+
this.state = {};
|
|
83
|
+
if (!this.state.utilities)
|
|
84
|
+
this.state.utilities = {};
|
|
85
|
+
if (!this.state.utilities.utilitiesMap)
|
|
86
|
+
this.state.utilities.utilitiesMap = {};
|
|
87
|
+
for (const key in value) {
|
|
88
|
+
if (value.hasOwnProperty(key)) {
|
|
89
|
+
this.state.utilities.utilitiesMap[key] = value[key];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
this.notify();
|
|
93
|
+
}
|
|
94
|
+
setPluginInit(value) {
|
|
95
|
+
if (!this.state)
|
|
96
|
+
this.state = {};
|
|
97
|
+
this.state.pluginInit = value;
|
|
98
|
+
this.notify();
|
|
99
|
+
}
|
|
100
|
+
setPlugins(value) {
|
|
101
|
+
if (!value)
|
|
102
|
+
return;
|
|
103
|
+
if (!this.state)
|
|
104
|
+
this.state = {};
|
|
105
|
+
this.state.plugins = [...value];
|
|
106
|
+
this.notify();
|
|
107
|
+
}
|
|
108
|
+
setConfigPath(value) {
|
|
109
|
+
if (!value)
|
|
110
|
+
return;
|
|
111
|
+
if (!this.state)
|
|
112
|
+
this.state = {};
|
|
113
|
+
this.state.configPath = value;
|
|
114
|
+
this.notify();
|
|
115
|
+
}
|
|
116
|
+
setVariants(_variants) {
|
|
117
|
+
const current = this.state ? Object.assign({}, this.state).variants || [] : [];
|
|
118
|
+
_variants.slice().forEach(_variant => {
|
|
119
|
+
if (!(current === null || current === void 0 ? void 0 : current.some(v => v.name === _variant.name))) {
|
|
120
|
+
current.push(_variant);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
if (!this.state)
|
|
124
|
+
this.state = {};
|
|
125
|
+
this.state.variants = current.slice();
|
|
126
|
+
}
|
|
127
|
+
// Subscribe to global state changes
|
|
128
|
+
subscribe(listener) {
|
|
129
|
+
this.listeners.add(listener);
|
|
130
|
+
return () => this.listeners.delete(listener);
|
|
131
|
+
}
|
|
132
|
+
// Update global state and notify listeners
|
|
133
|
+
setState(newState) {
|
|
134
|
+
if (!this.state)
|
|
135
|
+
this.state = {};
|
|
136
|
+
this.state = Object.assign(Object.assign({}, this.state), newState);
|
|
137
|
+
this.notify();
|
|
138
|
+
}
|
|
139
|
+
// Notify listeners
|
|
140
|
+
notify() {
|
|
141
|
+
this.listeners.forEach(listener => listener(Object.assign({}, this.state)));
|
|
142
|
+
}
|
|
143
|
+
// Get current global state
|
|
144
|
+
getState() {
|
|
145
|
+
return Object.assign({}, this.state);
|
|
146
|
+
}
|
|
147
|
+
updateObject(key, value) {
|
|
148
|
+
if (!this.state)
|
|
149
|
+
this.state = {}; // Return if key is not found
|
|
150
|
+
this.state[key] = value;
|
|
151
|
+
this.notify();
|
|
152
|
+
}
|
|
153
|
+
removeObject(key) {
|
|
154
|
+
if (this.state) {
|
|
155
|
+
delete this.state[key];
|
|
156
|
+
this.notify();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
getThemeUtilities(key) {
|
|
160
|
+
var _a;
|
|
161
|
+
if (!this.state || !this.state.utilities)
|
|
162
|
+
return undefined;
|
|
163
|
+
// Return undefined if key is not found
|
|
164
|
+
return (_a = Object.assign({}, this.state).utilities) === null || _a === void 0 ? void 0 : _a[key];
|
|
165
|
+
}
|
|
166
|
+
setThemeUtilities(value) {
|
|
167
|
+
Object.keys(value).forEach(key => {
|
|
168
|
+
if (!this.state)
|
|
169
|
+
this.state = {};
|
|
170
|
+
if (!this.state.utilities)
|
|
171
|
+
this.state.utilities = {};
|
|
172
|
+
this.state.utilities[key] = value[key];
|
|
173
|
+
});
|
|
174
|
+
this.notify();
|
|
175
|
+
}
|
|
176
|
+
setConfig(value) {
|
|
177
|
+
Object.keys(value).forEach(key => {
|
|
178
|
+
if (!this.state)
|
|
179
|
+
this.state = {};
|
|
180
|
+
if (!this.state.config)
|
|
181
|
+
this.state.config = {};
|
|
182
|
+
this.state.config[key] = value[key];
|
|
183
|
+
});
|
|
184
|
+
this.notify();
|
|
185
|
+
}
|
|
186
|
+
get ThemeUtilities() {
|
|
187
|
+
if (!this.state || !this.state.utilities)
|
|
188
|
+
return undefined;
|
|
189
|
+
return Object.assign({}, this.state).utilities;
|
|
190
|
+
}
|
|
191
|
+
set loaded_cache(value) {
|
|
192
|
+
if (!this.state)
|
|
193
|
+
this.state = {};
|
|
194
|
+
this.state.loaded_cache = value;
|
|
195
|
+
this.notify();
|
|
196
|
+
}
|
|
197
|
+
get loaded_cache() {
|
|
198
|
+
if (!this.state)
|
|
199
|
+
return undefined;
|
|
200
|
+
return Object.assign({}, this.state).loaded_cache;
|
|
201
|
+
}
|
|
202
|
+
getObject(key) {
|
|
203
|
+
if (!this.state)
|
|
204
|
+
return undefined;
|
|
205
|
+
return Object.assign({}, this.state)[key];
|
|
206
|
+
}
|
|
207
|
+
clearState() {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
this.cache.clear();
|
|
210
|
+
this.encoded_ast_tokens.clear();
|
|
211
|
+
if (this.cache_state) {
|
|
212
|
+
this.cache_state.clear();
|
|
213
|
+
}
|
|
214
|
+
if (this.state) {
|
|
215
|
+
(_a = this.state.cachedJit) === null || _a === void 0 ? void 0 : _a.clear();
|
|
216
|
+
(_b = this.state.cache) === null || _b === void 0 ? void 0 : _b.clear();
|
|
217
|
+
this.state.config = undefined;
|
|
218
|
+
this.state.extracted_classes = undefined;
|
|
219
|
+
this.state.utilities_classes = undefined;
|
|
220
|
+
this.state.utilities = undefined;
|
|
221
|
+
this.state.atomic_css = undefined;
|
|
222
|
+
this.state.files = [];
|
|
223
|
+
this.state.variants = undefined;
|
|
224
|
+
this.state.pluginInit = false;
|
|
225
|
+
this.state = undefined;
|
|
226
|
+
}
|
|
227
|
+
this.notify();
|
|
228
|
+
}
|
|
229
|
+
setExtractedClasses(value) {
|
|
230
|
+
if (!this.state)
|
|
231
|
+
this.state = {};
|
|
232
|
+
if (!this.state.extracted_classes)
|
|
233
|
+
this.state.extracted_classes = [];
|
|
234
|
+
// const initial = this.cache_state.get("extracted_classes") || []
|
|
235
|
+
this.state.extracted_classes = [...new Set([...value, ...this.state.extracted_classes.slice()])];
|
|
236
|
+
this.notify();
|
|
237
|
+
}
|
|
238
|
+
setUtilitiesClasses(value) {
|
|
239
|
+
if (!this.state)
|
|
240
|
+
this.state = {};
|
|
241
|
+
if (!this.state.utilities_classes)
|
|
242
|
+
this.state.utilities_classes = [];
|
|
243
|
+
this.state.utilities_classes = [...new Set([...value, ...this.state.utilities_classes.slice()])];
|
|
244
|
+
this.notify();
|
|
245
|
+
}
|
|
246
|
+
setFiles(value) {
|
|
247
|
+
if (!this.state)
|
|
248
|
+
this.state = {};
|
|
249
|
+
if (!this.state.files)
|
|
250
|
+
this.state.files = [];
|
|
251
|
+
Array.from(value).forEach(file => {
|
|
252
|
+
var _a, _b;
|
|
253
|
+
if (!((_a = this.state) === null || _a === void 0 ? void 0 : _a.files.some(f => f.file === file.file))) {
|
|
254
|
+
(_b = this.state) === null || _b === void 0 ? void 0 : _b.files.push({ file: file.file, content: file.content });
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
this.notify();
|
|
258
|
+
}
|
|
259
|
+
setAtomicCSS(value) {
|
|
260
|
+
if (!this.state)
|
|
261
|
+
this.state = {};
|
|
262
|
+
this.state.atomic_css = value;
|
|
263
|
+
this.notify();
|
|
264
|
+
}
|
|
265
|
+
setMode(value) {
|
|
266
|
+
if (!value)
|
|
267
|
+
return;
|
|
268
|
+
if (!this.state)
|
|
269
|
+
this.state = {};
|
|
270
|
+
this.state.mode = value;
|
|
271
|
+
this.notify();
|
|
272
|
+
}
|
|
273
|
+
getMode() {
|
|
274
|
+
if (!this.state || !this.state.mode)
|
|
275
|
+
return { light: 'light', dark: 'dark' };
|
|
276
|
+
return Object.assign({}, this.state).mode || { light: 'light', dark: 'dark' };
|
|
277
|
+
}
|
|
278
|
+
// setUtilities(value: any) {
|
|
279
|
+
// if (!this.state) this.state = {} as ThemeState;
|
|
280
|
+
// this.state.utilities = value;
|
|
281
|
+
// this.notify();
|
|
282
|
+
// }
|
|
283
|
+
get config() {
|
|
284
|
+
if (!this.state || !this.state.config)
|
|
285
|
+
return undefined;
|
|
286
|
+
return Object.assign({}, this.state).config;
|
|
287
|
+
}
|
|
288
|
+
get atomic_css() {
|
|
289
|
+
if (!this.state || !this.state.atomic_css)
|
|
290
|
+
return undefined;
|
|
291
|
+
return Object.assign({}, this.state).atomic_css;
|
|
292
|
+
}
|
|
293
|
+
get files() {
|
|
294
|
+
if (!this.state || !this.state.files)
|
|
295
|
+
return undefined;
|
|
296
|
+
return Object.assign({}, this.state).files;
|
|
297
|
+
}
|
|
298
|
+
get extracted_classes() {
|
|
299
|
+
if (!this.state || !this.state.extracted_classes)
|
|
300
|
+
return undefined;
|
|
301
|
+
return Object.assign({}, this.state).extracted_classes;
|
|
302
|
+
}
|
|
303
|
+
get utilities_classes() {
|
|
304
|
+
if (!this.state || !this.state.utilities_classes)
|
|
305
|
+
return undefined;
|
|
306
|
+
return Object.assign({}, this.state).utilities_classes;
|
|
307
|
+
}
|
|
308
|
+
get utilities() {
|
|
309
|
+
if (!this.state || !this.state.utilities)
|
|
310
|
+
return undefined;
|
|
311
|
+
return Object.assign({}, this.state).utilities;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=state.js.map
|