@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,362 @@
|
|
|
1
|
+
function _arrayLikeToArray(r, a) {
|
|
2
|
+
(null == a || a > r.length) && (a = r.length);
|
|
3
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(r) {
|
|
7
|
+
if (Array.isArray(r)) return r;
|
|
8
|
+
}
|
|
9
|
+
function _createForOfIteratorHelper(r, e) {
|
|
10
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
11
|
+
if (!t) {
|
|
12
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
13
|
+
t && (r = t);
|
|
14
|
+
var n = 0,
|
|
15
|
+
F = function () {};
|
|
16
|
+
return {
|
|
17
|
+
s: F,
|
|
18
|
+
n: function () {
|
|
19
|
+
return n >= r.length ? {
|
|
20
|
+
done: true
|
|
21
|
+
} : {
|
|
22
|
+
done: false,
|
|
23
|
+
value: r[n++]
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
e: function (r) {
|
|
27
|
+
throw r;
|
|
28
|
+
},
|
|
29
|
+
f: F
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
33
|
+
}
|
|
34
|
+
var o,
|
|
35
|
+
a = true,
|
|
36
|
+
u = false;
|
|
37
|
+
return {
|
|
38
|
+
s: function () {
|
|
39
|
+
t = t.call(r);
|
|
40
|
+
},
|
|
41
|
+
n: function () {
|
|
42
|
+
var r = t.next();
|
|
43
|
+
return a = r.done, r;
|
|
44
|
+
},
|
|
45
|
+
e: function (r) {
|
|
46
|
+
u = true, o = r;
|
|
47
|
+
},
|
|
48
|
+
f: function () {
|
|
49
|
+
try {
|
|
50
|
+
a || null == t.return || t.return();
|
|
51
|
+
} finally {
|
|
52
|
+
if (u) throw o;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function _defineProperty(e, r, t) {
|
|
58
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
59
|
+
value: t,
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true
|
|
63
|
+
}) : e[r] = t, e;
|
|
64
|
+
}
|
|
65
|
+
function _iterableToArrayLimit(r, l) {
|
|
66
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
67
|
+
if (null != t) {
|
|
68
|
+
var e,
|
|
69
|
+
n,
|
|
70
|
+
i,
|
|
71
|
+
u,
|
|
72
|
+
a = [],
|
|
73
|
+
f = true,
|
|
74
|
+
o = false;
|
|
75
|
+
try {
|
|
76
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
77
|
+
} catch (r) {
|
|
78
|
+
o = true, n = r;
|
|
79
|
+
} finally {
|
|
80
|
+
try {
|
|
81
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
82
|
+
} finally {
|
|
83
|
+
if (o) throw n;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return a;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function _nonIterableRest() {
|
|
90
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
91
|
+
}
|
|
92
|
+
function ownKeys(e, r) {
|
|
93
|
+
var t = Object.keys(e);
|
|
94
|
+
if (Object.getOwnPropertySymbols) {
|
|
95
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
96
|
+
r && (o = o.filter(function (r) {
|
|
97
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
98
|
+
})), t.push.apply(t, o);
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
function _objectSpread2(e) {
|
|
103
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
104
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
105
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
106
|
+
_defineProperty(e, r, t[r]);
|
|
107
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
108
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return e;
|
|
112
|
+
}
|
|
113
|
+
function _slicedToArray(r, e) {
|
|
114
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
115
|
+
}
|
|
116
|
+
function _toPrimitive(t, r) {
|
|
117
|
+
if ("object" != typeof t || !t) return t;
|
|
118
|
+
var e = t[Symbol.toPrimitive];
|
|
119
|
+
if (void 0 !== e) {
|
|
120
|
+
var i = e.call(t, r);
|
|
121
|
+
if ("object" != typeof i) return i;
|
|
122
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
123
|
+
}
|
|
124
|
+
return ("string" === r ? String : Number)(t);
|
|
125
|
+
}
|
|
126
|
+
function _toPropertyKey(t) {
|
|
127
|
+
var i = _toPrimitive(t, "string");
|
|
128
|
+
return "symbol" == typeof i ? i : i + "";
|
|
129
|
+
}
|
|
130
|
+
function _unsupportedIterableToArray(r, a) {
|
|
131
|
+
if (r) {
|
|
132
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
133
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
134
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var DEFAULT_OPTIONS = {
|
|
139
|
+
prefix: 'fluixi-',
|
|
140
|
+
useRawValues: false,
|
|
141
|
+
transformValues: true,
|
|
142
|
+
includeDefaults: true
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Converts camelCase to kebab-case
|
|
147
|
+
*/
|
|
148
|
+
function toKebabCase(str) {
|
|
149
|
+
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Formats CSS property value
|
|
154
|
+
*/
|
|
155
|
+
function formatValue(property, value, options) {
|
|
156
|
+
if (!options.transformValues) return String(value);
|
|
157
|
+
|
|
158
|
+
// Handle numeric values
|
|
159
|
+
if (typeof value === 'number') {
|
|
160
|
+
if (/^(z|opacity|flex|order|grid-row|grid-column)/.test(property)) {
|
|
161
|
+
return String(value);
|
|
162
|
+
}
|
|
163
|
+
return "".concat(value, "px");
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Handle transform functions
|
|
167
|
+
if (property === 'transform' && !value.includes('(')) {
|
|
168
|
+
return "".concat(value, "(1)");
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Validates keyframe selectors
|
|
175
|
+
*/
|
|
176
|
+
function isValidKeyframeSelector(selector) {
|
|
177
|
+
if (selector === 'from' || selector === 'to') return true;
|
|
178
|
+
if (/%$/.test(selector)) {
|
|
179
|
+
var num = parseFloat(selector);
|
|
180
|
+
return !isNaN(num) && num >= 0 && num <= 100;
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
function parseStyles(styles) {
|
|
185
|
+
if (typeof styles === 'string') {
|
|
186
|
+
var declarations = styles.split(';');
|
|
187
|
+
var styles_data = {};
|
|
188
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
189
|
+
_step;
|
|
190
|
+
try {
|
|
191
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
192
|
+
var declaration = _step.value;
|
|
193
|
+
var _declaration$split = declaration.split(':'),
|
|
194
|
+
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
195
|
+
key = _declaration$split2[0],
|
|
196
|
+
value = _declaration$split2[1];
|
|
197
|
+
styles_data[key] = value;
|
|
198
|
+
}
|
|
199
|
+
} catch (err) {
|
|
200
|
+
_iterator.e(err);
|
|
201
|
+
} finally {
|
|
202
|
+
_iterator.f();
|
|
203
|
+
}
|
|
204
|
+
return styles_data;
|
|
205
|
+
}
|
|
206
|
+
return styles;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Creates CSS rules for a keyframe definition
|
|
211
|
+
*/
|
|
212
|
+
function createKeyframeRules(definition, options) {
|
|
213
|
+
var rules = [];
|
|
214
|
+
for (var _i = 0, _Object$entries = Object.entries(definition); _i < _Object$entries.length; _i++) {
|
|
215
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
216
|
+
selector = _Object$entries$_i[0],
|
|
217
|
+
_styles = _Object$entries$_i[1];
|
|
218
|
+
var styles = parseStyles(_styles);
|
|
219
|
+
if (!isValidKeyframeSelector(selector)) {
|
|
220
|
+
console.warn("Invalid keyframe selector: ".concat(selector));
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
var styleRules = Object.entries(styles).map(function (_ref) {
|
|
224
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
225
|
+
prop = _ref2[0],
|
|
226
|
+
value = _ref2[1];
|
|
227
|
+
var kebabProp = toKebabCase(prop);
|
|
228
|
+
var formattedValue = formatValue(kebabProp, value, options);
|
|
229
|
+
return " ".concat(kebabProp, ": ").concat(formattedValue, ";");
|
|
230
|
+
}).join('\n');
|
|
231
|
+
rules.push(" ".concat(selector, " {\n").concat(styleRules, "\n }"));
|
|
232
|
+
}
|
|
233
|
+
return rules.join('\n\n');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Creates a complete keyframe rule
|
|
238
|
+
*/
|
|
239
|
+
function createKeyframeRule(name, definition) {
|
|
240
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_OPTIONS;
|
|
241
|
+
var prefix = options.prefix || '';
|
|
242
|
+
var keyframeName = "".concat(prefix).concat(name);
|
|
243
|
+
var rules = createKeyframeRules(definition, options);
|
|
244
|
+
return "@keyframes ".concat(keyframeName, " {\n").concat(rules, "\n}");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Normalizes keyframes configuration
|
|
249
|
+
*/
|
|
250
|
+
function normalizeKeyframes(keyframes) {
|
|
251
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_OPTIONS;
|
|
252
|
+
var normalized = {};
|
|
253
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(keyframes); _i2 < _Object$entries2.length; _i2++) {
|
|
254
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
255
|
+
name = _Object$entries2$_i[0],
|
|
256
|
+
definition = _Object$entries2$_i[1];
|
|
257
|
+
try {
|
|
258
|
+
normalized[name] = createKeyframeRule(name, definition, options);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
console.error("Error processing keyframe '".concat(name, "':"), error);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return normalized;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Generates animation utilities from keyframes
|
|
268
|
+
*/
|
|
269
|
+
function generateAnimationUtilities(keyframes) {
|
|
270
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_OPTIONS;
|
|
271
|
+
var utilities = {};
|
|
272
|
+
var prefix = options.prefix || '';
|
|
273
|
+
for (var _i3 = 0, _Object$keys = Object.keys(keyframes); _i3 < _Object$keys.length; _i3++) {
|
|
274
|
+
var name = _Object$keys[_i3];
|
|
275
|
+
utilities["animate-".concat(name)] = {
|
|
276
|
+
animation: "".concat(prefix).concat(name, " var(--fluixi-animation-duration, 1s) var(--fluixi-animation-timing, linear) var(--fluixi-animation-iteration, infinite)")
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return utilities;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Combines all keyframe-related processing
|
|
284
|
+
*/
|
|
285
|
+
function processKeyframes(keyframes) {
|
|
286
|
+
var _options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_OPTIONS;
|
|
287
|
+
var options = _options || DEFAULT_OPTIONS;
|
|
288
|
+
// Merge with default options
|
|
289
|
+
var mergedOptions = _objectSpread2(_objectSpread2({}, DEFAULT_OPTIONS), options);
|
|
290
|
+
|
|
291
|
+
// Process keyframes
|
|
292
|
+
var normalizedKeyframes = normalizeKeyframes(keyframes, mergedOptions);
|
|
293
|
+
var keyframeRules = Object.values(normalizedKeyframes);
|
|
294
|
+
|
|
295
|
+
// Generate utilities
|
|
296
|
+
var utilities = generateAnimationUtilities(keyframes, mergedOptions);
|
|
297
|
+
return {
|
|
298
|
+
keyframeRules: keyframeRules,
|
|
299
|
+
utilities: utilities
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// /**
|
|
304
|
+
// * Default keyframe animations
|
|
305
|
+
// */
|
|
306
|
+
// export const DEFAULT_KEYFRAMES: KeyframesConfig = {
|
|
307
|
+
// spin: {
|
|
308
|
+
// from: {
|
|
309
|
+
// transform: 'rotate(0deg)'
|
|
310
|
+
// },
|
|
311
|
+
// to: {
|
|
312
|
+
// transform: 'rotate(360deg)'
|
|
313
|
+
// }
|
|
314
|
+
// },
|
|
315
|
+
// ping: {
|
|
316
|
+
// '75%, 100%': {
|
|
317
|
+
// transform: 'scale(2)',
|
|
318
|
+
// opacity: '0'
|
|
319
|
+
// }
|
|
320
|
+
// },
|
|
321
|
+
// pulse: {
|
|
322
|
+
// '0%, 100%': {
|
|
323
|
+
// opacity: '1'
|
|
324
|
+
// },
|
|
325
|
+
// '50%': {
|
|
326
|
+
// opacity: '.5'
|
|
327
|
+
// }
|
|
328
|
+
// },
|
|
329
|
+
// bounce: {
|
|
330
|
+
// '0%, 100%': {
|
|
331
|
+
// transform: 'translateY(-25%)',
|
|
332
|
+
// animationTimingFunction: 'cubic-bezier(0.8,0,1,1)'
|
|
333
|
+
// },
|
|
334
|
+
// '50%': {
|
|
335
|
+
// transform: 'none',
|
|
336
|
+
// animationTimingFunction: 'cubic-bezier(0,0,0.2,1)'
|
|
337
|
+
// }
|
|
338
|
+
// },
|
|
339
|
+
// 'fade-in': {
|
|
340
|
+
// from: {
|
|
341
|
+
// opacity: '0'
|
|
342
|
+
// },
|
|
343
|
+
// to: {
|
|
344
|
+
// opacity: '1'
|
|
345
|
+
// }
|
|
346
|
+
// },
|
|
347
|
+
// 'slide-in': {
|
|
348
|
+
// from: {
|
|
349
|
+
// transform: 'translateX(-100%)'
|
|
350
|
+
// },
|
|
351
|
+
// to: {
|
|
352
|
+
// transform: 'translateX(0)'
|
|
353
|
+
// }
|
|
354
|
+
// }
|
|
355
|
+
// };
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Usage example
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
export { createKeyframeRule, generateAnimationUtilities, normalizeKeyframes, processKeyframes };
|
|
362
|
+
//# sourceMappingURL=keyframes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes.mjs","sources":["../../src/keyframes.ts"],"sourcesContent":["import { KeyframeDefinition, KeyframesConfig, KeyframesOptions, KeyframeStyles } from './types/keyframes-type.js';\n\nconst DEFAULT_OPTIONS: KeyframesOptions = {\n prefix: 'fluixi-',\n useRawValues: false,\n transformValues: true,\n includeDefaults: true\n};\n\n/**\n * Converts camelCase to kebab-case\n */\nfunction toKebabCase(str: string): string {\n return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Formats CSS property value\n */\nfunction formatValue(property: string, value: string | number, options: KeyframesOptions): string {\n if (!options.transformValues) return String(value);\n\n // Handle numeric values\n if (typeof value === 'number') {\n if (/^(z|opacity|flex|order|grid-row|grid-column)/.test(property)) {\n return String(value);\n }\n return `${value}px`;\n }\n\n // Handle transform functions\n if (property === 'transform' && !value.includes('(')) {\n return `${value}(1)`;\n }\n\n return value;\n}\n\n/**\n * Validates keyframe selectors\n */\nfunction isValidKeyframeSelector(selector: string): boolean {\n if (selector === 'from' || selector === 'to') return true;\n if (/%$/.test(selector)) {\n const num = parseFloat(selector);\n return !isNaN(num) && num >= 0 && num <= 100;\n }\n return false;\n}\n\nfunction parseStyles(styles: KeyframeStyles | string): KeyframeStyles {\n if (typeof styles === 'string') {\n const declarations = styles.split(';');\n const styles_data: KeyframeStyles = {};\n for(const declaration of declarations){\n const [key, value] = declaration.split(':');\n styles_data[key] = value;\n }\n return styles_data;\n }\n return styles;\n}\n\n/**\n * Creates CSS rules for a keyframe definition\n */\nfunction createKeyframeRules(definition: KeyframeDefinition, options: KeyframesOptions): string {\n let rules: string[] = [];\n\n for (const [selector, _styles] of Object.entries(definition)) {\n const styles = parseStyles(_styles);\n if (!isValidKeyframeSelector(selector)) {\n console.warn(`Invalid keyframe selector: ${selector}`);\n continue;\n }\n\n const styleRules = Object.entries(styles)\n .map(([prop, value]) => {\n const kebabProp = toKebabCase(prop);\n const formattedValue = formatValue(kebabProp, value, options);\n return ` ${kebabProp}: ${formattedValue};`;\n })\n .join('\\n');\n\n rules.push(` ${selector} {\\n${styleRules}\\n }`);\n }\n\n return rules.join('\\n\\n');\n}\n\n/**\n * Creates a complete keyframe rule\n */\nexport function createKeyframeRule(\n name: string,\n definition: KeyframeDefinition,\n options: KeyframesOptions = DEFAULT_OPTIONS\n): string {\n const prefix = options.prefix || '';\n const keyframeName = `${prefix}${name}`;\n const rules = createKeyframeRules(definition, options);\n\n return `@keyframes ${keyframeName} {\\n${rules}\\n}`;\n}\n\n/**\n * Normalizes keyframes configuration\n */\nexport function normalizeKeyframes(\n keyframes: KeyframesConfig,\n options: KeyframesOptions = DEFAULT_OPTIONS\n): Record<string, string> {\n const normalized: Record<string, string> = {};\n\n for (const [name, definition] of Object.entries(keyframes)) {\n try {\n normalized[name] = createKeyframeRule(name, definition, options);\n } catch (error) {\n console.error(`Error processing keyframe '${name}':`, error);\n }\n }\n\n return normalized;\n}\n\n/**\n * Generates animation utilities from keyframes\n */\nexport function generateAnimationUtilities(\n keyframes: KeyframesConfig,\n options: KeyframesOptions = DEFAULT_OPTIONS\n): Record<string, { animation: string }> {\n const utilities: Record<string, { animation: string }> = {};\n const prefix = options.prefix || '';\n\n for (const name of Object.keys(keyframes)) {\n utilities[`animate-${name}`] = {\n animation: `${prefix}${name} var(--fluixi-animation-duration, 1s) var(--fluixi-animation-timing, linear) var(--fluixi-animation-iteration, infinite)`\n };\n }\n\n return utilities;\n}\n\n/**\n * Combines all keyframe-related processing\n */\nexport function processKeyframes(\n keyframes: KeyframesConfig,\n _options: KeyframesOptions = DEFAULT_OPTIONS\n): {\n keyframeRules: string[];\n utilities: Record<string, { animation: string }>;\n} {\n const options = _options || DEFAULT_OPTIONS;\n // Merge with default options\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n\n // Process keyframes\n const normalizedKeyframes = normalizeKeyframes(keyframes, mergedOptions);\n const keyframeRules = Object.values(normalizedKeyframes);\n\n // Generate utilities\n const utilities = generateAnimationUtilities(keyframes, mergedOptions);\n\n return {\n keyframeRules,\n utilities\n };\n}\n\n// /**\n// * Default keyframe animations\n// */\n// export const DEFAULT_KEYFRAMES: KeyframesConfig = {\n// spin: {\n// from: {\n// transform: 'rotate(0deg)'\n// },\n// to: {\n// transform: 'rotate(360deg)'\n// }\n// },\n// ping: {\n// '75%, 100%': {\n// transform: 'scale(2)',\n// opacity: '0'\n// }\n// },\n// pulse: {\n// '0%, 100%': {\n// opacity: '1'\n// },\n// '50%': {\n// opacity: '.5'\n// }\n// },\n// bounce: {\n// '0%, 100%': {\n// transform: 'translateY(-25%)',\n// animationTimingFunction: 'cubic-bezier(0.8,0,1,1)'\n// },\n// '50%': {\n// transform: 'none',\n// animationTimingFunction: 'cubic-bezier(0,0,0.2,1)'\n// }\n// },\n// 'fade-in': {\n// from: {\n// opacity: '0'\n// },\n// to: {\n// opacity: '1'\n// }\n// },\n// 'slide-in': {\n// from: {\n// transform: 'translateX(-100%)'\n// },\n// to: {\n// transform: 'translateX(0)'\n// }\n// }\n// };\n\n/**\n * Usage example\n */\n"],"names":["DEFAULT_OPTIONS","prefix","useRawValues","transformValues","includeDefaults","toKebabCase","str","replace","toLowerCase","formatValue","property","value","options","String","test","concat","includes","isValidKeyframeSelector","selector","num","parseFloat","isNaN","parseStyles","styles","declarations","split","styles_data","_iterator","_createForOfIteratorHelper","_step","s","n","done","declaration","_declaration$split","_declaration$split2","_slicedToArray","key","err","e","f","createKeyframeRules","definition","rules","_i","_Object$entries","Object","entries","length","_Object$entries$_i","_styles","console","warn","styleRules","map","_ref","_ref2","prop","kebabProp","formattedValue","join","push","createKeyframeRule","name","arguments","undefined","keyframeName","normalizeKeyframes","keyframes","normalized","_i2","_Object$entries2","_Object$entries2$_i","error","generateAnimationUtilities","utilities","_i3","_Object$keys","keys","animation","processKeyframes","_options","mergedOptions","_objectSpread","normalizedKeyframes","keyframeRules","values"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,EAAA,0HAAA;KAC5B;AACH,EAAA;AAEA,EAAA,OAAOY,SAAS;AAClB;;AAEA;AACA;AACA;AACO,SAASK,gBAAgBA,CAC9BZ,SAA0B,EAK1B;AAAA,EAAA,IAJAa,QAA0B,GAAAjB,SAAA,CAAAhB,MAAA,GAAA,CAAA,IAAAgB,SAAA,CAAA,CAAA,CAAA,KAAAC,SAAA,GAAAD,SAAA,CAAA,CAAA,CAAA,GAAGhE,eAAe;AAK5C,EAAA,IAAMY,OAAO,GAAGqE,QAAQ,IAAIjF,eAAe;AAC3C;EACA,IAAMkF,aAAa,GAAAC,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAQnF,eAAe,CAAA,EAAKY,OAAO,CAAE;;AAExD;AACA,EAAA,IAAMwE,mBAAmB,GAAGjB,kBAAkB,CAACC,SAAS,EAAEc,aAAa,CAAC;AACxE,EAAA,IAAMG,aAAa,GAAGvC,MAAM,CAACwC,MAAM,CAACF,mBAAmB,CAAC;;AAExD;AACA,EAAA,IAAMT,SAAS,GAAGD,0BAA0B,CAACN,SAAS,EAAEc,aAAa,CAAC;EAEtE,OAAO;AACLG,IAAAA,aAAa,EAAbA,aAAa;AACbV,IAAAA,SAAS,EAATA;GACD;AACH;;AAEA;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;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;;AAEA;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const colors = {
|
|
2
|
+
green: (text) => `\x1b[32m${text}\x1b[0m`,
|
|
3
|
+
blue: (text) => `\x1b[34m${text}\x1b[0m`,
|
|
4
|
+
yellow: (text) => `\x1b[33m${text}\x1b[0m`,
|
|
5
|
+
dim: (text) => `\x1b[2m${text}\x1b[0m`,
|
|
6
|
+
};
|
|
7
|
+
function logger(type, path) {
|
|
8
|
+
const timestamp = colors.dim(new Date().toLocaleTimeString());
|
|
9
|
+
const badge = colors.green('➜');
|
|
10
|
+
let log = `${badge} ${timestamp}`;
|
|
11
|
+
if (typeof path === 'undefined' || path === null) {
|
|
12
|
+
console.log(log);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (typeof path === "string" && path.length > 0) {
|
|
16
|
+
const updateType = type.length > 0 ? path.length > 0 ? colors.blue(`[${type}]`) : colors.blue(`${type}`) : '';
|
|
17
|
+
const filePath = path.length > 0 ? colors.yellow(path) : '';
|
|
18
|
+
if (updateType.length > 0) {
|
|
19
|
+
log += ` ${updateType}`;
|
|
20
|
+
}
|
|
21
|
+
if (filePath.length > 0) {
|
|
22
|
+
log += ` ${filePath}`;
|
|
23
|
+
}
|
|
24
|
+
console.log(log);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
console.log(log, path);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export { logger };
|
|
31
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACX,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,IAAI,SAAS;IACjD,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,IAAI,SAAS;IAChD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,IAAI,SAAS;IAClD,GAAG,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,IAAI,SAAS;CACjD,CAAC;AAEF,SAAS,MAAM,CAAC,IAAY,EAAE,IAAS;IACnC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAA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x1b[32m${text}\\x1b[0m`,\n blue: (text: string) => `\\x1b[34m${text}\\x1b[0m`,\n yellow: (text: string) => `\\x1b[33m${text}\\x1b[0m`,\n dim: (text: string) => `\\x1b[2m${text}\\x1b[0m`,\n};\n\nfunction logger(type: string, path: any) {\n const timestamp = colors.dim(new Date().toLocaleTimeString());\n const badge = colors.green('➜');\n let log = `${badge} ${timestamp}`\n if(typeof path === 'undefined' || path === null){\n console.log(log)\n return\n }\n if(typeof path === \"string\" && path.length > 0){\n const updateType = type.length > 0 ? path.length > 0 ? colors.blue(`[${type}]`) : colors.blue(`${type}`) : '';\n const filePath = path.length > 0 ? colors.yellow(path) : '';\n if(updateType.length > 0){\n log += ` ${updateType}`\n }\n if(filePath.length > 0){\n log += ` ${filePath}`\n }\n console.log(log)\n }else{\n console.log(log, path)\n }\n}\n\nexport { logger };"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
module.exports = createPlugin;
|
|
43
|
+
//# sourceMappingURL=plugin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs","sources":["../../src/plugin.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;"],"names":["createPlugin","callback","api","addBase","styles","addVariant","name","transform","addUtilities","utilities","addComponents","theme","concat","helpers"],"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;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ThemeGetter = (path: string) => any;
|
|
2
|
+
interface PluginHelpers {
|
|
3
|
+
addBase?: (styles: Record<string, any>) => void;
|
|
4
|
+
addComponents?: (styles: Record<string, any>) => void;
|
|
5
|
+
addUtilities: (styles: Record<string, any>) => void;
|
|
6
|
+
theme?: ThemeGetter;
|
|
7
|
+
}
|
|
8
|
+
type PluginFunction = (helpers: PluginHelpers) => void;
|
|
9
|
+
declare function createPlugin(callback: PluginFunction): (helpers: any) => void;
|
|
10
|
+
type Plugin = ReturnType<typeof createPlugin>;
|
|
11
|
+
export type { PluginFunction, PluginHelpers, Plugin };
|
|
12
|
+
export default createPlugin;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function createPlugin(callback) {
|
|
2
|
+
// const insertions: PlugnInsertions = {} as PlugnInsertions;
|
|
3
|
+
/** API Interface */
|
|
4
|
+
const api = {
|
|
5
|
+
addBase(styles) { },
|
|
6
|
+
addVariant(name, transform) { },
|
|
7
|
+
addUtilities(utilities) { },
|
|
8
|
+
addComponents(components) { },
|
|
9
|
+
// theme: (t: string)=>t
|
|
10
|
+
theme: (theme) => {
|
|
11
|
+
// return getNestedValue(`${theme}`)
|
|
12
|
+
return `${theme}`;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** Execute the User-Defined Callback */
|
|
16
|
+
// callback(api);
|
|
17
|
+
/** Return Collected Rules */
|
|
18
|
+
// return insertions;
|
|
19
|
+
return (helpers) => {
|
|
20
|
+
if (!helpers.addUtilities) {
|
|
21
|
+
helpers.addUtilities = api.addUtilities;
|
|
22
|
+
}
|
|
23
|
+
if (!helpers.addBase) {
|
|
24
|
+
helpers.addBase = api.addBase;
|
|
25
|
+
}
|
|
26
|
+
if (!helpers.addVariant) {
|
|
27
|
+
helpers.addVariant = api.addVariant;
|
|
28
|
+
}
|
|
29
|
+
if (!helpers.addComponents) {
|
|
30
|
+
helpers.addComponents = api.addVariant;
|
|
31
|
+
}
|
|
32
|
+
if (!helpers.theme) {
|
|
33
|
+
helpers.theme = api.theme;
|
|
34
|
+
}
|
|
35
|
+
return callback(helpers);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export default createPlugin;
|
|
39
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAWA,SAAS,YAAY,CAAC,QAAwB;IAC1C,6DAA6D;IAC7D,oBAAoB;IACpB,MAAM,GAAG,GAAG;QACR,OAAO,CAAC,MAAM,IAAG,CAAC;QAElB,UAAU,CAAC,IAAI,EAAE,SAAS,IAAG,CAAC;QAE9B,YAAY,CAAC,SAAS,IAAG,CAAC;QAC1B,aAAa,CAAC,UAAU,IAAG,CAAC;QAC5B,wBAAwB;QACxB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;YACf,oCAAoC;YACpC,OAAO,GAAG,KAAK,EAAE,CAAA;QACnB,CAAC;KACJ,CAAC;IAEF,wCAAwC;IACxC,iBAAiB;IAEjB,6BAA6B;IAC7B,qBAAqB;IACrB,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,IAAG,CAAC,OAAO,CAAC,YAAY,EAAC,CAAC;YACtB,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAA;QAC3C,CAAC;QACD,IAAG,CAAC,OAAO,CAAC,OAAO,EAAC,CAAC;YACjB,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;QACjC,CAAC;QACD,IAAG,CAAC,OAAO,CAAC,UAAU,EAAC,CAAC;YACpB,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAA;QACvC,CAAC;QACD,IAAG,CAAC,OAAO,CAAC,aAAa,EAAC,CAAC;YACvB,OAAO,CAAC,aAAa,GAAG,GAAG,CAAC,UAAU,CAAA;QAC1C,CAAC;QACD,IAAG,CAAC,OAAO,CAAC,KAAK,EAAC,CAAC;YACjB,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QAC5B,CAAC;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC;AAEN,CAAC;AAKD,eAAe,YAAY,CAAC","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;"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
export { createPlugin as default };
|
|
41
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../src/plugin.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;"],"names":["createPlugin","callback","api","addBase","styles","addVariant","name","transform","addUtilities","utilities","addComponents","theme","concat","helpers"],"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;;;;"}
|