From a3cf5d31653ed36f2133c3fbdc13c4eefc4d87e4 Mon Sep 17 00:00:00 2001 From: Daniel P Z Date: Mon, 27 Jun 2022 12:16:32 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Directive=20display=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOCS.md | 87 ++++++++++++++++++++--------- README.md | 1 + dist/config/display.d.ts | 66 ++++++++++++++++++++++ dist/config/processors.d.ts | 4 +- dist/layouter.es.js | 91 ++++++++++++++++++++++++++++++- dist/layouter.es.js.map | 2 +- dist/layouter.umd.js | 2 +- dist/layouter.umd.js.map | 2 +- dist/methods/buildDisplay.d.ts | 3 + index.html | 2 + package.json | 2 +- src/config/display.ts | 46 ++++++++++++++++ src/config/processors.ts | 13 ++++- src/methods/buildDisplay.ts | 60 ++++++++++++++++++++ src/methods/setDisplay.ts | 10 ++++ test/methods/buildDisplay.test.ts | 65 ++++++++++++++++++++++ test/methods/setDisplay.test.ts | 38 +++++++++++++ 17 files changed, 457 insertions(+), 37 deletions(-) create mode 100644 dist/config/display.d.ts create mode 100644 dist/methods/buildDisplay.d.ts create mode 100644 src/config/display.ts create mode 100644 src/methods/buildDisplay.ts create mode 100644 src/methods/setDisplay.ts create mode 100644 test/methods/buildDisplay.test.ts create mode 100644 test/methods/setDisplay.test.ts diff --git a/DOCS.md b/DOCS.md index 8e04bf2..b4028a1 100644 --- a/DOCS.md +++ b/DOCS.md @@ -97,31 +97,32 @@ Ese alias definidos se usará para determinar el breakpoint en cada valor de las ## Directivas -| Nombre | Alias | Ejemplos | Descripción | -| ---------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -| [Cols](DOCS.md#cols) | `c` | `cols="13/15"`, `c="5/10"` | Determinará las columnas, osea el 'width' de manera porcentual. | -| [Mart](DOCS.md#mart) | `mt`, `margin-top` | `mart="10"`, `mt="20"`, `margin-top="12"` | Determina el **margen** superior de un nodo. | -| [Marr](DOCS.md#marr-marb-marl) | `mr`, `margin-right` | `marr="2/15"`, `mr="5/10"`, `margin-right="3/5"` | Determinar el **margen** derecho de un nodo. | -| [Marb](DOCS.md#marr-marb-marl) | `mb`, `margin-bottom` | `marb="30"`, `mb="50"`, `margin-bottom="25"` | Determinar el **margen** inferior de un nodo. | -| [Marl](DOCS.md#marr-marb-marl) | `ml`, `margin-left` | `marl="3/15"`, `ml="5/10"`, `margin-left="3/5"` | Determinar el **margen** izquierdo de un nodo. | -| [Mar](DOCS.md#mar) | `m`, `margin` | `mar="20-2/15-30-3/15"`, `m="20-2/15-30-3/15"`, `margin="20-2/15-30-3/15"` | Es un shorthand de las directivas: [mart](DOCS.md#mart), [marr, marb, y marl](DOCS.md#marr-marb-marl). | -| [Padt](DOCS.md#padt) | `pt`, `padding-top` | `padt="10"`, `pt="20"`, `padding-top="30"` | Determina el **padding** superior de un nodo. | -| [Padr](DOCS.md#padr-padb-padl) | `pr`, `padding-right` | `padr="2/15"`, `pr="3/16"`, `padding-right="4/17"` | Determinar el **padding** derecho de un nodo. | -| [Padb](DOCS.md#padr-padb-padl) | `pb`, `padding-bottom` | `padb="30"`, `pb="40"`, `padding-bottom="50"` | Determinar el **padding** inferior de un nodo. | -| [Padl](DOCS.md#padr-padb-padl) | `pl`, `padding-left` | `padl="3/15"`, `pl="4/16"`, `padding-left="5/17"` | Determinar el **padding** izquierdo de un nodo. | -| [Pad](DOCS.md#pad) | `p`, `padding` | `pad="20-2/15-30-3/15"`, `p="20-2/15-30-3/15"`, `padding="20-2/15-30-3/15"` | Es un shorthand de las directivas: [padt](DOCS.md#padt), [padr, padb, y padl](DOCS.md#padr-padb-padl). | -| [Flex](DOCS.md#flex) | `fx` | `flex="jc:ce ai:fs fd:co"`, `flex="jc:fe ai:fs`, `fx="align-items:center flex-wrap:wrap"` | Determina el **display flex** del nodo y sus derivados. | -| [Wdh](DOCS.md#width) | `w`, `width` | `wdh="100"`, `w="200"`, `width="300"` | Determina el **ancho** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Hgt](DOCS.md#height) | `h`, `height` | `hgt="100"`, `h="200"`, `height="300"` | Determina el **alto** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Mxw](DOCS.md#maxwidth) | `max-width` | `mxw="200"`, `max-width="300"` | Determina el **máximo ancho** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Mxh](DOCS.md#maxheight) | `max-height` | `mxh="200"`, `max-height="300"` | Determina el **máximo alto** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Miw](DOCS.md#minwidth) | `min-width` | `miw="300"`, `min-width="400"` | Determina el **mínimo ancho** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Mih](DOCS.md#minheight) | `min-height` | `mih="300"`, `min-height="400"` | Determina el **mínimo alto** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [Pos](DOCS.md#position) | `position` | `pos="re"`, `position="relative"` | Determina la **posición** del nodo. | -| [T](DOCS.md#top-right-bottom-left) | `top` | `t="10"`, `top="20"` | Determina el **top** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [R](DOCS.md#top-right-bottom-left) | `right` | `r="10"`, `right="20"` | Determina el **right** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [B](DOCS.md#top-right-bottom-left) | `bottom` | `b="10"`, `bottom="20"` | Determina el **bottom** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | -| [L](DOCS.md#top-right-bottom-left) | `left` | `l="10"`, `left="20"` | Determina el **left** del nodo en píxeles u otra [unidad de medida](DOCS.md#unidades-de-medida-definidas). | +| Nombre | Alias | Ejemplos | Descripción | +| --------------------------- | ---------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| [Cols](#cols) | `c` | `cols="13/15"`, `c="5/10"` | Determinará las columnas, osea el 'width' de manera porcentual. | +| [d](#display) | `display` | `d="bl"`, `display="inline"` | Determina el **display** que tendrá el nodo. | +| [Mart](#mart) | `mt`, `margin-top` | `mart="10"`, `mt="20"`, `margin-top="12"` | Determina el **margen** superior de un nodo. | +| [Marr](#marr-marb-marl) | `mr`, `margin-right` | `marr="2/15"`, `mr="5/10"`, `margin-right="3/5"` | Determinar el **margen** derecho de un nodo. | +| [Marb](#marr-marb-marl) | `mb`, `margin-bottom` | `marb="30"`, `mb="50"`, `margin-bottom="25"` | Determinar el **margen** inferior de un nodo. | +| [Marl](#marr-marb-marl) | `ml`, `margin-left` | `marl="3/15"`, `ml="5/10"`, `margin-left="3/5"` | Determinar el **margen** izquierdo de un nodo. | +| [Mar](#mar) | `m`, `margin` | `mar="20-2/15-30-3/15"`, `m="20-2/15-30-3/15"`, `margin="20-2/15-30-3/15"` | Es un shorthand de las directivas: [mart](#mart), [marr, marb, y marl](#marr-marb-marl). | +| [Padt](#padt) | `pt`, `padding-top` | `padt="10"`, `pt="20"`, `padding-top="30"` | Determina el **padding** superior de un nodo. | +| [Padr](#padr-padb-padl) | `pr`, `padding-right` | `padr="2/15"`, `pr="3/16"`, `padding-right="4/17"` | Determinar el **padding** derecho de un nodo. | +| [Padb](#padr-padb-padl) | `pb`, `padding-bottom` | `padb="30"`, `pb="40"`, `padding-bottom="50"` | Determinar el **padding** inferior de un nodo. | +| [Padl](#padr-padb-padl) | `pl`, `padding-left` | `padl="3/15"`, `pl="4/16"`, `padding-left="5/17"` | Determinar el **padding** izquierdo de un nodo. | +| [Pad](#pad) | `p`, `padding` | `pad="20-2/15-30-3/15"`, `p="20-2/15-30-3/15"`, `padding="20-2/15-30-3/15"` | Es un shorthand de las directivas: [padt](#padt), [padr, padb, y padl](#padr-padb-padl). | +| [Flex](#flex) | `fx` | `flex="jc:ce ai:fs fd:co"`, `flex="jc:fe ai:fs`, `fx="align-items:center flex-wrap:wrap"` | Determina el **display flex** del nodo y sus derivados. | +| [Wdh](#width) | `w`, `width` | `wdh="100"`, `w="200"`, `width="300"` | Determina el **ancho** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Hgt](#height) | `h`, `height` | `hgt="100"`, `h="200"`, `height="300"` | Determina el **alto** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Mxw](#maxwidth) | `max-width` | `mxw="200"`, `max-width="300"` | Determina el **máximo ancho** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Mxh](#maxheight) | `max-height` | `mxh="200"`, `max-height="300"` | Determina el **máximo alto** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Miw](#minwidth) | `min-width` | `miw="300"`, `min-width="400"` | Determina el **mínimo ancho** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Mih](#minheight) | `min-height` | `mih="300"`, `min-height="400"` | Determina el **mínimo alto** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [Pos](#position) | `position` | `pos="re"`, `position="relative"` | Determina la **posición** del nodo. | +| [T](#top-right-bottom-left) | `top` | `t="10"`, `top="20"` | Determina el **top** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [R](#top-right-bottom-left) | `right` | `r="10"`, `right="20"` | Determina el **right** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [B](#top-right-bottom-left) | `bottom` | `b="10"`, `bottom="20"` | Determina el **bottom** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | +| [L](#top-right-bottom-left) | `left` | `l="10"`, `left="20"` | Determina el **left** del nodo en píxeles u otra [unidad de medida](#unidades-de-medida-definidas). | ## Métodos @@ -373,6 +374,40 @@ Este método de columnas explicitas solo es para ahorrarnos un poco de tiempo al [↑ Volver Arriba](#directivas) +### Display + +Sirve para determinar el **display** que tendrá el nodo. + +### Valores disponibles + +- **bl**: display +- **il**: inline +- **ib**: inline-block +- **fx**: flex +- **if**: inline-flex +- **no**: none +- **in**: in +- **ih**: inherit + +#### Ejemplo: + +```html +
...
+``` + +o en modo más semántico + +```html +
...
+``` + +No hay mucho que explicar acá, utiliza las mismas reglas que las demás directivas, solo que está enfocado a la definición del display. + +- En el primer ejemplo se define `display: relative` para el breakpoint **'xs'** (mobile) +- En el segundo ejemplo, un poco más extenso, se definió que en el breakpoint **'xs'** el display será **'block'**, luego para el breakpoint **'sm'** será **'inline'** y finalmente para el breakpoint **'md'** el display será **'none'** + +[↑ Volver Arriba](#directivas) + ### Mar Es una abreviación del shorthand 'margin' **(y a su vez es un shorthand de las directivas: mart, marr, marb, y marl)** y sirve para determinar los margenes superiores, derechos, inferiores e izquierdos de un elemento. @@ -1455,7 +1490,7 @@ layouter.styles = { "cols-15\\/27@md": "@media screen and (min-width: 900px){.cols-15\\/27\\@md{width:55.556%}}" "flex-jc\\:c": ".flex-jc\\:c{justify-content:center;display: flex}", } -layouter.version = '1.4.0' +layouter.version = '1.5.0' ``` [↑ Volver Arriba](#utils) diff --git a/README.md b/README.md index 5b86220..db043c0 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ Uno puede escribir su propia configuración creando una variable llamada **'layo | Nombre | Alias | Ejemplos | Descripción | | ---------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | [Cols](DOCS.md#cols) | `c` | `cols="13/15"`, `c="5/10"` | Determinará las columnas, osea el 'width' de manera porcentual. | +| [d](DOCS.md#display) | `display` | `d="bl"`, `display="inline"` | Determina el **display** que tendrá el nodo. | | [Mart](DOCS.md#mart) | `mt`, `margin-top` | `mart="10"`, `mt="20"`, `margin-top="12"` | Determina el **margen** superior de un nodo. | | [Marr](DOCS.md#marr-marb-marl) | `mr`, `margin-right` | `marr="2/15"`, `mr="5/10"`, `margin-right="3/5"` | Determinar el **margen** derecho de un nodo. | | [Marb](DOCS.md#marr-marb-marl) | `mb`, `margin-bottom` | `marb="30"`, `mb="50"`, `margin-bottom="25"` | Determinar el **margen** inferior de un nodo. | diff --git a/dist/config/display.d.ts b/dist/config/display.d.ts new file mode 100644 index 0000000..6bd0814 --- /dev/null +++ b/dist/config/display.d.ts @@ -0,0 +1,66 @@ +export declare const displayProsAndVals: { + block: { + ruleCss: string; + classPrefix: string; + }; + inline: { + ruleCss: string; + classPrefix: string; + }; + 'inline-block': { + ruleCss: string; + classPrefix: string; + }; + flex: { + ruleCss: string; + classPrefix: string; + }; + 'inline-flex': { + ruleCss: string; + classPrefix: string; + }; + none: { + ruleCss: string; + classPrefix: string; + }; + initial: { + ruleCss: string; + classPrefix: string; + }; + inherit: { + ruleCss: string; + classPrefix: string; + }; + bl: { + ruleCss: string; + classPrefix: string; + }; + il: { + ruleCss: string; + classPrefix: string; + }; + ib: { + ruleCss: string; + classPrefix: string; + }; + fx: { + ruleCss: string; + classPrefix: string; + }; + if: { + ruleCss: string; + classPrefix: string; + }; + no: { + ruleCss: string; + classPrefix: string; + }; + in: { + ruleCss: string; + classPrefix: string; + }; + ih: { + ruleCss: string; + classPrefix: string; + }; +}; diff --git a/dist/config/processors.d.ts b/dist/config/processors.d.ts index b90a459..228cec2 100644 --- a/dist/config/processors.d.ts +++ b/dist/config/processors.d.ts @@ -1,6 +1,6 @@ import { IStyles } from '../helpers/createStyles'; -declare type TDirectiveNameBase = 'cols' | 'pad' | 'padt' | 'padr' | 'padb' | 'padl' | 'mar' | 'mart' | 'marr' | 'marb' | 'marl' | 'flex' | 'mxw' | 'mxh' | 'miw' | 'mih' | 'wdh' | 'hgt' | 'pos' | 't' | 'r' | 'b' | 'l'; -declare type TDirectiveNameExtended = 'c' | 'fx' | 'p' | 'padding' | 'pt' | 'padding-top' | 'pr' | 'padding-right' | 'pb' | 'padding-bottom' | 'pl' | 'padding-left' | 'm' | 'margin' | 'mt' | 'margin-top' | 'mr' | 'margin-right' | 'mb' | 'margin-bottom' | 'ml' | 'margin-left' | 'w' | 'width' | 'h' | 'height' | 'max-width' | 'max-height' | 'min-width' | 'min-height' | 'position' | 'top' | 'right' | 'bottom' | 'left'; +declare type TDirectiveNameBase = 'cols' | 'pad' | 'padt' | 'padr' | 'padb' | 'padl' | 'mar' | 'mart' | 'marr' | 'marb' | 'marl' | 'flex' | 'mxw' | 'mxh' | 'miw' | 'mih' | 'wdh' | 'hgt' | 'pos' | 't' | 'r' | 'b' | 'l' | 'd'; +declare type TDirectiveNameExtended = 'c' | 'fx' | 'p' | 'padding' | 'pt' | 'padding-top' | 'pr' | 'padding-right' | 'pb' | 'padding-bottom' | 'pl' | 'padding-left' | 'm' | 'margin' | 'mt' | 'margin-top' | 'mr' | 'margin-right' | 'mb' | 'margin-bottom' | 'ml' | 'margin-left' | 'w' | 'width' | 'h' | 'height' | 'max-width' | 'max-height' | 'min-width' | 'min-height' | 'position' | 'top' | 'right' | 'bottom' | 'left' | 'display'; export declare type TDirectiveName = TDirectiveNameBase | TDirectiveNameExtended; export interface IProcessor { build: (values: string, insertStyles: boolean) => IStyles | Error; diff --git a/dist/layouter.es.js b/dist/layouter.es.js index 70b03d2..d18ce84 100644 --- a/dist/layouter.es.js +++ b/dist/layouter.es.js @@ -85,7 +85,7 @@ const breakpointsOrdered = (bps, sizes) => { Object.keys(sizes).forEach((bpName) => bpsOrdered[bpName] = bps[bpName]); return bpsOrdered; }; -const version = "1.4.0"; +const version = "1.5.0"; const breakpointsInit = { xs: { width: 360, @@ -741,7 +741,7 @@ const buildPosition = (valPos, insertStyles = false) => { break; } propVal = positionProsAndVals[nameProp].ruleCss; - let className = positionProsAndVals[nameProp].classPrefix; + const className = positionProsAndVals[nameProp].classPrefix; let sufixBp = bpNames === firstBp ? "" : "@" + bpNames; if (paramPrepared.important) { propVal += " !important"; @@ -772,6 +772,85 @@ const buildBottom = (val, insertStyles = false) => { const buildLeft = (val, insertStyles = false) => { return buildAttr(val, "l", insertStyles); }; +const displayProsAndValsBase = { + bl: { + ruleCss: "block", + classPrefix: "bl" + }, + il: { + ruleCss: "inline", + classPrefix: "il" + }, + ib: { + ruleCss: "inline-block", + classPrefix: "ib" + }, + fx: { + ruleCss: "flex", + classPrefix: "fx" + }, + if: { + ruleCss: "inline-flex", + classPrefix: "if" + }, + no: { + ruleCss: "none", + classPrefix: "no" + }, + in: { + ruleCss: "initial", + classPrefix: "in" + }, + ih: { + ruleCss: "inherit", + classPrefix: "ih" + } +}; +const displayProsAndVals = { + ...displayProsAndValsBase, + block: displayProsAndValsBase.bl, + inline: displayProsAndValsBase.il, + "inline-block": displayProsAndValsBase.ib, + flex: displayProsAndValsBase.fx, + "inline-flex": displayProsAndValsBase.if, + none: displayProsAndValsBase.no, + initial: displayProsAndValsBase.in, + inherit: displayProsAndValsBase.ih +}; +const buildDisplay = (valDisplay, insertStyles = false) => { + const bpCals = {}; + let err = false; + const config2 = getConfig(); + const firstBp = Object.keys(config2.breakpoints)[0]; + for (const param of valDisplay.split(" ")) { + let propVal; + const paramPrepared = prepareParam(param); + const bpNames = paramPrepared.breakPoints; + const nameProp = paramPrepared.numbers; + if (!displayProsAndVals[nameProp]) { + err = regError("Non-existent Alias", "Don't exists the alias '" + nameProp + "' in display vault."); + break; + } + propVal = displayProsAndVals[nameProp].ruleCss; + const className = displayProsAndVals[nameProp].classPrefix; + let sufixBp = bpNames === firstBp ? "" : "@" + bpNames; + if (paramPrepared.important) { + propVal += " !important"; + sufixBp += "!"; + } + bpCals[bpNames] = { + name: className + sufixBp, + value: propVal + }; + } + if (err) + return err; + return buildCss({ + type: "d", + bps: bpCals, + deep: insertStyles + }); +}; const processorsBase = { cols: { build: buildCols, @@ -887,6 +966,11 @@ const processorsBase = { build: buildLeft, ruleCss: "left", classPrefix: "l" + }, + d: { + build: buildDisplay, + ruleCss: "display", + classPrefix: "d" } }; const processors = { @@ -925,7 +1009,8 @@ const processors = { top: processorsBase.t, right: processorsBase.r, bottom: processorsBase.b, - left: processorsBase.l + left: processorsBase.l, + display: processorsBase.d }; const getParameters = (Node) => { const params = {}; diff --git a/dist/layouter.es.js.map b/dist/layouter.es.js.map index d3f2318..2338208 100644 --- a/dist/layouter.es.js.map +++ b/dist/layouter.es.js.map @@ -1 +1 @@ -{"version":3,"file":"layouter.es.js","sources":["../src/helpers/breakpointsNums.ts","../src/helpers/createScopeStyles.ts","../src/helpers/scopesStylesBuilder.ts","../src/helpers/breakpointsOrdered.ts","../src/config/main.ts","../src/helpers/prepareParam.ts","../src/helpers/regError.ts","../src/helpers/calPercentage.ts","../src/helpers/getScopeByclassName.ts","../src/methods/insertRules.ts","../src/config/flex.ts","../src/helpers/percentageConverter.ts","../src/helpers/createStyles.ts","../src/helpers/nameCleaner.ts","../src/helpers/buildCss.ts","../src/methods/buildCols.ts","../src/methods/buildFlex.ts","../src/helpers/processedNumber.ts","../src/helpers/buildAttr.ts","../src/methods/buildPad.ts","../src/methods/buildPadTop.ts","../src/methods/buildPadRight.ts","../src/methods/buildPadBottom.ts","../src/methods/buildPadLeft.ts","../src/methods/buildMar.ts","../src/methods/buildMarTop.ts","../src/methods/buildMarRight.ts","../src/methods/buildMarBottom.ts","../src/methods/buildMarLeft.ts","../src/methods/buildMaxWidth.ts","../src/methods/buildMaxHeight.ts","../src/methods/buildMinWidth.ts","../src/methods/buildMinHeight.ts","../src/methods/buildHeight.ts","../src/methods/buildWidth.ts","../src/config/position.ts","../src/methods/buildPosition.ts","../src/methods/buildTop.ts","../src/methods/buildRight.ts","../src/methods/buildBottom.ts","../src/methods/buildLeft.ts","../src/config/processors.ts","../src/methods/getParameters.ts","../src/methods/build.ts","../src/utils/addClasses.ts","../src/utils/removeAttr.ts","../src/helpers/eventReady.ts","../src/methods/set.ts","../src/methods/setFlex.ts","../src/methods/SetCols.ts","../src/methods/setAttr.ts","../src/methods/setHeight.ts","../src/methods/setMarBottom.ts","../src/methods/setMarLeft.ts","../src/methods/setMarRight.ts","../src/methods/setMar.ts","../src/methods/setMarTop.ts","../src/methods/setMaxWidth.ts","../src/methods/setMinHeight.ts","../src/methods/setMinWidth.ts","../src/methods/setPadBottom.ts","../src/methods/setPadLeft.ts","../src/methods/setPadRight.ts","../src/methods/setPad.ts","../src/methods/setPadTop.ts","../src/methods/setWidth.ts","../src/methods/setMaxHeight.ts","../src/methods/setPosition.ts","../src/methods/setTop.ts","../src/methods/setRight.ts","../src/methods/setBottom.ts","../src/methods/setLeft.ts","../src/methods/reset.ts","../src/helpers/searchAndProcess.ts","../src/helpers/mainObserver.ts","../src/layouter.ts"],"sourcesContent":["export type TNumProp = 'width' | 'cols';\r\n\r\nexport interface IBreakpoint {\r\n alias: string;\r\n width: number;\r\n}\r\n\r\nexport interface IBreakpoints {\r\n [alias: string]: {\r\n width: number;\r\n cols: number;\r\n };\r\n}\r\n\r\nexport interface IBreakpointObj {\r\n [alias: string]: number;\r\n}\r\n\r\nconst breakpointsNums = (\r\n objBps: IBreakpoints,\r\n propName: TNumProp\r\n): IBreakpointObj => {\r\n const sizes: IBreakpointObj = {};\r\n\r\n if (propName === 'width') {\r\n Object.keys(objBps)\r\n .map((bp: string) => {\r\n return {\r\n alias: bp,\r\n width: objBps[bp].width,\r\n };\r\n })\r\n .sort((a: IBreakpoint, b: IBreakpoint) =>\r\n a.width > b.width ? 1 : b.width > a.width ? -1 : 0\r\n )\r\n .forEach((bp: IBreakpoint, index: number) => {\r\n sizes[bp.alias] = !index ? 0 : objBps[bp.alias][propName];\r\n });\r\n } else {\r\n Object.keys(objBps).forEach((bp) => {\r\n sizes[bp] = objBps[bp][propName];\r\n });\r\n }\r\n\r\n return sizes;\r\n};\r\n\r\nexport default breakpointsNums;\r\n","export type TInsertion = 'before' | 'after' | 'append';\n\nexport interface ICreateScopeStyles {\n bridge?: boolean;\n bp: string;\n insertionType: TInsertion;\n node: HTMLElement;\n context: Window & typeof globalThis;\n}\n\nexport interface IRCreateScopeStyles {\n method:\n | CSSStyleSheet\n | {\n insertRule: (ruleCss: string) => void;\n rules: string[];\n };\n node: HTMLElement;\n}\n\nconst createScopeStyles = ({\n bridge: withBridge,\n bp,\n insertionType,\n node,\n context,\n}: ICreateScopeStyles): IRCreateScopeStyles => {\n let stylesScope = context.document.getElementById('layouter-' + bp);\n if (!stylesScope) {\n stylesScope = context.document.createElement('style');\n stylesScope.appendChild(context.document.createTextNode('')); // WebKit hack :(\n const nodeParent = node.parentNode as HTMLDivElement;\n switch (insertionType) {\n case 'before':\n nodeParent.insertBefore(stylesScope, node);\n break;\n case 'after':\n node.nextSibling\n ? nodeParent.insertBefore(stylesScope, node.nextSibling)\n : nodeParent.appendChild(stylesScope);\n break;\n case 'append':\n node.appendChild(stylesScope);\n break;\n }\n stylesScope.id = 'layouter-' + bp;\n }\n\n let bridge: IRCreateScopeStyles;\n if (withBridge) {\n bridge = {\n method: (stylesScope as HTMLStyleElement).sheet as CSSStyleSheet,\n node: stylesScope,\n };\n } else {\n bridge = {\n method: {\n insertRule: (ruleCss: string) => {\n (stylesScope as HTMLDivElement).appendChild(\n context.document.createTextNode(ruleCss)\n );\n },\n rules: [],\n },\n node: stylesScope,\n };\n }\n return bridge;\n};\n\nexport default createScopeStyles;\n","import { IBreakpoints } from './breakpointsNums';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nexport interface IScopes {\n [name: string]: IRCreateScopeStyles;\n}\n\nexport interface IScopesStylesBuilder {\n breakpoints: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\nexport const scopesStylesBuilder = ({\n breakpoints,\n bridge,\n scope,\n context,\n}: IScopesStylesBuilder): IScopes => {\n const scopes: IScopes = scope || {};\n Object.keys(breakpoints).forEach((bp: string) => {\n if (!scopes[bp]) {\n scopes[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'append',\n node: context.document.body,\n context,\n });\n }\n });\n return scopes;\n};\n","import { ICols } from '../config/main';\r\nimport { IBreakpoints } from './breakpointsNums';\r\n\r\nconst breakpointsOrdered = (bps: IBreakpoints, sizes: ICols) => {\r\n const bpsOrdered: IBreakpoints = {};\r\n Object.keys(sizes).forEach((bpName) => (bpsOrdered[bpName] = bps[bpName]));\r\n return bpsOrdered;\r\n};\r\n\r\nexport default breakpointsOrdered;\r\n","import { ILayouter } from './../layouter';\nimport breakpointsNums, { IBreakpoints } from '../helpers/breakpointsNums';\nimport { IScopes, scopesStylesBuilder } from '../helpers/scopesStylesBuilder';\nimport breakpointsOrdered from '../helpers/breakpointsOrdered';\nimport { version } from '../../package.json';\n\nexport interface ICols {\n [colAlias: string]: number;\n}\n\nexport interface IConfigUser {\n prefix: string;\n breakpoints: IBreakpoints;\n bridge: boolean;\n debug?: boolean;\n ready?: (instance: ILayouter) => void;\n}\n\ninterface IConfigNumsIn {\n bps: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\ninterface IConfigNumsOut {\n scope: IScopes;\n cols: ICols;\n sizes: ICols;\n breakpoints: IBreakpoints;\n}\n\nexport interface IConfig\n extends Omit,\n IConfigNumsOut {\n context: Window & typeof globalThis;\n styles: {\n [className: string]: string;\n };\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouterConfig: Partial;\n }\n}\n\nconst breakpointsInit: IBreakpoints = {\n xs: {\n width: 360,\n cols: 15,\n },\n sm: {\n width: 600,\n cols: 25,\n },\n md: {\n width: 900,\n cols: 31,\n },\n lg: {\n width: 1200,\n cols: 41,\n },\n xlg: {\n width: 1536,\n cols: 51,\n },\n};\n\nexport let baseConfig: IConfigUser = {\n prefix: '',\n breakpoints: breakpointsInit,\n bridge: true,\n debug: true,\n};\n\nlet config: IConfig;\n\nconst configNums = ({\n bps,\n bridge,\n scope,\n context,\n}: IConfigNumsIn): IConfigNumsOut => {\n const sizes = breakpointsNums(bps, 'width');\n const finalBps = breakpointsOrdered(bps, sizes);\n return {\n sizes,\n cols: breakpointsNums(bps, 'cols'),\n scope: scopesStylesBuilder({\n breakpoints: finalBps,\n bridge,\n scope: scope,\n context,\n }),\n breakpoints: finalBps,\n };\n};\n\nexport const setConfig = (\n context: Window & typeof globalThis,\n customCfg: Partial = {}\n): IConfig => {\n const contextConfig = context.layouterConfig || {};\n\n baseConfig = {\n ...baseConfig,\n ...customCfg,\n ...contextConfig,\n };\n\n config = {\n context,\n ...baseConfig,\n ...configNums({\n bps: baseConfig.breakpoints,\n bridge: baseConfig.bridge,\n context,\n }),\n styles: {},\n version,\n };\n\n return config;\n};\n\nconst getConfig = (): IConfig => {\n return config;\n};\n\nexport const setStyles = (className: string, value: string) => {\n config.styles[className] = value;\n};\n\nexport const updateConfig = (userConfig: Partial): IConfig => {\n config = {\n ...config,\n ...userConfig,\n };\n\n if (userConfig.breakpoints) {\n config = {\n ...config,\n ...configNums({\n bps: config.breakpoints,\n bridge: config.bridge,\n scope: config.scope,\n context: config.context,\n }),\n };\n }\n\n return config;\n};\n\nexport default getConfig;\n","import getConfig from '../config/main';\n\nexport interface IPrepareParamObj {\n widthBp: boolean;\n numbers: string;\n breakPoints: string;\n important: boolean;\n}\n\nconst prepareParam = (param: string): IPrepareParamObj => {\n let bp: string;\n let argParam = param;\n let important = false;\n const haveBp = argParam.includes('@');\n if (haveBp) {\n const bpSplited = argParam.split('@');\n argParam = bpSplited[0];\n bp = bpSplited[1];\n } else {\n const config = getConfig();\n bp = Object.keys(config.breakpoints)[0];\n }\n\n if (param.includes('!')) {\n important = true;\n bp = bp.replace(/!/g, '');\n argParam = argParam.replace(/!/g, '');\n }\n\n return {\n widthBp: haveBp,\n numbers: argParam,\n breakPoints: bp,\n important,\n };\n};\n\nexport default prepareParam;\n","import config from '../config/main';\r\n\r\nconst regError = (\r\n name: string,\r\n message: string,\r\n Node?: Element | HTMLElement\r\n): Error => {\r\n const err = new Error();\r\n err.name = name;\r\n err.message = message;\r\n const intConfig = config();\r\n if (intConfig.debug) {\r\n console.error(err);\r\n if (Node) console.log(Node);\r\n }\r\n return err;\r\n};\r\n\r\nexport default regError;\r\n","const calPercentage = (n1: number, n2: number): string => {\r\n const cal = (n1 * 100) / n2;\r\n const haveDecimal = cal - Math.floor(cal) !== 0;\r\n const result = haveDecimal ? cal.toFixed(3) : cal;\r\n return result + '%';\r\n};\r\n\r\nexport default calPercentage;\r\n","import config from '../config/main';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nconst getScopeByclassName = (className: string): IRCreateScopeStyles => {\n const nameClass = className.replace(/!/g, '');\n const atIndex = nameClass.indexOf('@');\n const intConfig = config();\n const scope = intConfig.scope;\n const bridge = intConfig.bridge;\n const context = intConfig.context;\n\n // Haven´t a BP designed\n if (atIndex === -1) {\n const firstBp = Object.keys(intConfig.breakpoints)[0];\n return scope[firstBp as string];\n }\n\n // Have a BP designed, a normal BP.\n const bp = nameClass.substring(atIndex + 1);\n if (!bp.includes('-')) return scope[bp]; // A simple BP (13/15@lg), not compound (like this: 13/15@sm-md).\n\n // A BP until. Example 13/15@-md\n if (bp.substring(0, 1) === '-') {\n if (scope[bp]) return scope[bp]; // exists the Scope.\n const bpUntil = bp.substring(1);\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'before',\n node: scope[bpUntil].node,\n context,\n });\n return scope[bp]; // returning a new scope created\n }\n\n // A BP from and until (a BP compound). Example: Example 13/15@sm-md\n if (scope[bp]) {\n return scope[bp]; // exists the Scope.\n }\n\n const fromBp = bp.split('-')[0];\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'after',\n node: scope[fromBp].node,\n context,\n });\n\n return scope[bp]; // returning a new scope compounded created\n};\n\nexport default getScopeByclassName;\n","import config, { setStyles } from '../config/main';\nimport { IStyles } from '../helpers/createStyles';\nimport getScopeByclassName from '../helpers/getScopeByclassName';\n\nconst insertRules = (objStyles: IStyles) => {\n const intConfig = config();\n\n for (const className in objStyles) {\n if (!intConfig.styles[className]) {\n const nodeScope = getScopeByclassName(className);\n const valClass = objStyles[className];\n const rules = nodeScope.method.rules;\n nodeScope.method.insertRule(valClass, rules ? rules.length : 0);\n setStyles(className, valClass); // saving in styles vault\n }\n }\n};\n\nexport default insertRules;\n","const flexProsAndValsBase = {\n jc: {\n ruleCss: 'justify-content',\n classPrefix: 'jc'\n },\n ai: {\n ruleCss: 'align-items',\n classPrefix: 'ai'\n },\n ce: {\n ruleCss: 'center',\n classPrefix: 'ce'\n },\n fs: {\n ruleCss: 'flex-start',\n classPrefix: 'fs'\n },\n fe: {\n ruleCss: 'flex-end',\n classPrefix: 'fe'\n },\n sb: {\n ruleCss: 'space-between',\n classPrefix: 'sb'\n },\n sa: {\n ruleCss: 'space-around',\n classPrefix: 'sa'\n },\n fw: {\n ruleCss: 'flex-wrap',\n classPrefix: 'fw'\n },\n nw: {\n ruleCss: 'nowrap',\n classPrefix: 'nw'\n },\n w: {\n ruleCss: 'wrap',\n classPrefix: 'w'\n },\n wr: {\n ruleCss: 'wrap-reverse',\n classPrefix: 'wr'\n },\n fd: {\n ruleCss: 'flex-direction',\n classPrefix: 'fd'\n },\n r: {\n ruleCss: 'row',\n classPrefix: 'r'\n },\n rr: {\n ruleCss: 'row-reverse',\n classPrefix: 'rr'\n },\n co: {\n ruleCss: 'column',\n classPrefix: 'co'\n },\n cor: {\n ruleCss: 'column-reverse',\n classPrefix: 'co'\n },\n au: {\n ruleCss: 'auto',\n classPrefix: 'au'\n },\n st: {\n ruleCss: 'stretch',\n classPrefix: 'st'\n },\n bl: {\n ruleCss: 'baseline',\n classPrefix: 'bl'\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in'\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih'\n },\n}\n\nconst flexPropsAndValsSelfBase = {\n fg: {\n ruleCss: 'flex-grow',\n classPrefix: 'fg'\n },\n fh: {\n ruleCss: 'flex-shrink',\n classPrefix: 'fh'\n },\n as: {\n ruleCss: 'align-self',\n classPrefix: 'as'\n },\n or: {\n ruleCss: 'order',\n classPrefix: 'or'\n },\n}\n\nconst flexPropsAndValsSelf = {\n ...flexPropsAndValsSelfBase,\n 'flex-grow': flexPropsAndValsSelfBase.fg,\n 'flex-shrink': flexPropsAndValsSelfBase.fh,\n 'align-self': flexPropsAndValsSelfBase.as,\n order: flexPropsAndValsSelfBase.or,\n}\n\nexport const flexProsAndVals = {\n ...flexProsAndValsBase,\n ...flexPropsAndValsSelf,\n 'justify-content': flexProsAndValsBase.jc,\n 'align-items': flexProsAndValsBase.ai,\n center: flexProsAndValsBase.ce,\n 'flex-start': flexProsAndValsBase.fs,\n 'flex-end': flexProsAndValsBase.fe,\n 'space-between': flexProsAndValsBase.sb,\n 'space-around': flexProsAndValsBase.fs,\n 'flex-wrap': flexProsAndValsBase.fw,\n nowrap: flexProsAndValsBase.nw,\n w: flexProsAndValsBase.w,\n 'wrap-reverse': flexProsAndValsBase.wr,\n 'flex-direction': flexProsAndValsBase.fd,\n row: flexProsAndValsBase.r,\n 'row-reverse': flexProsAndValsBase.rr,\n column: flexProsAndValsBase.co,\n 'column-reverse': flexProsAndValsBase.cor,\n auto: flexProsAndValsBase.au,\n stretch: flexProsAndValsBase.st,\n baseline: flexProsAndValsBase.bl,\n initial: flexProsAndValsBase.in,\n inherit: flexProsAndValsBase.ih,\n};\n\nexport const flexAttrsSelf = Object.keys(flexPropsAndValsSelf);\n","const percentageConverter = (percentage: string) => {\r\n return '0¯' + percentage.replace('%', '');\r\n};\r\n\r\nexport default percentageConverter;\r\n","import { flexAttrsSelf } from '../config/flex';\nimport config from '../config/main';\nimport { processors, TDirectiveName } from '../config/processors';\nimport { IBpCals } from './buildCss';\nimport percentageConverter from './percentageConverter';\n\nexport interface IStyles {\n [name: string]: string;\n}\n\nconst createStyles = (directive: TDirectiveName, bps: IBpCals): IStyles => {\n const intConfig = config();\n const sizes = intConfig.sizes;\n const prefix = intConfig.prefix;\n const prop = processors[directive].ruleCss;\n const styles: IStyles = {};\n\n Object.keys(bps).forEach((bp) => {\n // preparing the className\n const shortNameClass = bps[bp].name;\n\n // just if have a percentage\n let nameClass = shortNameClass;\n if (shortNameClass.includes('%')) {\n nameClass = shortNameClass.replace( shortNameClass, percentageConverter(shortNameClass));\n }\n\n const finalPrefix = prefix ? prefix + '-' : '';\n nameClass = finalPrefix + processors[directive].classPrefix + '-' + nameClass.replace(/\\//g, '\\\\/').replace(/:/g, '\\\\:').replace('@', '\\\\@').split('.').join('_');\n\n if (!intConfig.styles[nameClass]) {\n // Property and value\n let propAndVal;\n if (directive === 'flex') {\n propAndVal = bps[bp].value;\n const flexImportant = shortNameClass.includes('!') ? ';display:flex !important;' : ';display:flex;';\n\n // Searching a flex self inside. ['as' for 'align-self']\n const attrsFlexSelfs = flexAttrsSelf.filter((nameAttrFlex) => shortNameClass.includes(nameAttrFlex + ':'));\n if (attrsFlexSelfs.length) {\n // if the items number of flex selft (+1) is diferrent so exists other flex attribute. Example: as:ce jc:ce\n if (attrsFlexSelfs.length + 1 !== shortNameClass.split(':').length) {\n propAndVal += flexImportant;\n }\n } else {\n propAndVal += flexImportant;\n }\n } else {\n propAndVal = prop + ':' + bps[bp].value;\n }\n\n let rule = '@media screen and ';\n let direct = false;\n if (!bp.includes('-')) {\n // no tiene until\n if (sizes[bp]) {\n rule += '(min-width: ' + sizes[bp] + 'px)';\n } else {\n rule = '.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}';\n direct = true;\n }\n } else {\n const bpSplited = bp.split('-');\n const bp1 = bpSplited[0];\n if (bp1) rule += '(min-width: ' + sizes[bp1] + 'px) and ';\n const bp2 = bpSplited[1];\n rule += '(max-width: ' + (sizes[bp2] - 1) + 'px)';\n }\n\n if (!direct) {\n rule += '{.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}}';\n }\n\n styles[nameClass] = rule;\n } else {\n styles[nameClass] = intConfig.styles[nameClass]\n }\n });\n return styles;\n};\n\nexport default createStyles;\n","import { IStyles } from './createStyles';\n\nconst replaceList = [\n ['/', ''],\n ['\\\\', '/'],\n ['/:', ':'],\n ['\\\\:', ':'],\n ['\\\\@', '@'],\n ['/@', '@'],\n];\n\nconst nameCleaner = (objStyles: IStyles): IStyles => {\n const obj: IStyles = {};\n for (const name in objStyles) {\n let newName = name;\n replaceList.forEach((reItem) => {\n newName = newName.split(reItem[0]).join(reItem[1]);\n });\n obj[newName] = objStyles[name];\n }\n return obj;\n};\n\nexport default nameCleaner;\n","import { TDirectiveName } from '../config/processors';\nimport insertRules from '../methods/insertRules';\nimport createStyles, { IStyles } from './createStyles';\nimport nameCleaner from './nameCleaner';\n\nexport interface IRBuildStyles {\n name: string;\n value: string;\n}\n\nexport interface IBpCals {\n [bpName: string]: IRBuildStyles;\n}\n\nexport interface IBuildCss {\n type: TDirectiveName;\n bps: IBpCals;\n deep: boolean;\n}\n\nconst buildCss = (data: IBuildCss): IStyles => {\n // creating the styles\n const objStyles = createStyles(data.type, data.bps);\n\n // Inserting CSS rules\n if (data.deep) {\n insertRules(objStyles);\n }\n\n // name classes cleaner\n return nameCleaner(objStyles);\n};\n\nexport default buildCss;\n","import prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\nimport calPercentage from '../helpers/calPercentage';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport getConfig from '../config/main';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildCols = (values: string, insertStyles = false): IStyles | Error => {\r\n let cols: number[];\r\n let bp;\r\n const bpCals: IBpCals = {};\r\n const config = getConfig();\r\n\r\n // Getting numbers\r\n let selectorName, propValue, paramPrepared;\r\n const directBp = Object.keys(config.breakpoints)[0];\r\n\r\n let err: boolean | Error = false;\r\n\r\n for (const item of values.split(' ')) {\r\n let param = item;\r\n selectorName = param;\r\n paramPrepared = prepareParam(param);\r\n bp = paramPrepared.breakPoints;\r\n param = paramPrepared.numbers;\r\n\r\n if (param.includes('/')) {\r\n const paramSplited = param.split('/');\r\n cols = [Number(paramSplited[0]), Number(paramSplited[1])];\r\n } else {\r\n if (paramPrepared.widthBp) {\r\n if (bp.includes('-')) {\r\n err = regError(\r\n 'SyntaxError',\r\n \"You can't determine a 'until breakpoint' when use the explicit columns max: \" +\r\n values\r\n );\r\n break;\r\n } else {\r\n cols = [Number(param), config.cols[bp] as number];\r\n }\r\n } else {\r\n cols = [Number(param), config.cols[directBp] as number];\r\n }\r\n }\r\n\r\n propValue = calPercentage(cols[0], cols[1]);\r\n if (paramPrepared.important) propValue += ' !important';\r\n\r\n bpCals[bp] = {\r\n name: selectorName,\r\n value: propValue,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'cols',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildCols;\r\n","import { flexAttrsSelf, flexProsAndVals } from '../config/flex';\nimport getConfig from '../config/main';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildFlex = (valFlex: string, insertStyles = false): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valFlex.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const flexSplited = paramPrepared.numbers.split(':');\n const nameProp = flexSplited[0] as keyof typeof flexProsAndVals; // 'fc' o 'or'\n const valProp = flexSplited[1] as keyof typeof flexProsAndVals; // 'ce' o '1'\n let valAlias: string;\n\n if (!flexAttrsSelf.includes(nameProp)) {\n if (!flexProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in Flex vault.\"\n );\n break;\n }\n if (!flexProsAndVals[valProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + valProp + \"' in Flex vault.\"\n );\n break;\n }\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + flexProsAndVals[valProp].ruleCss;\n valAlias = flexProsAndVals[valProp].classPrefix;\n } else {\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + valProp;\n valAlias = valProp;\n }\n\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!'\n }\n\n let selectorName = flexProsAndVals[nameProp].classPrefix + ':' + valAlias + sufixBp;\n\n if (!bpCals[bpNames]) {\n bpCals[bpNames] = {\n name: selectorName,\n value: propVal,\n };\n } else {\n if (selectorName.includes('@')) selectorName = selectorName.split('@')[0]; // just here because will be contact with the other className\n let prevName = bpCals[bpNames].name.split('@')[0];\n if (bpCals[bpNames].name.includes('!') && !prevName.includes('!')) prevName += '!';\n\n bpCals[bpNames].name = prevName + '-' + selectorName + sufixBp;\n bpCals[bpNames].value += ';' + propVal;\n }\n }\n\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'flex',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildFlex;\n","import calPercentage from './calPercentage';\n\nconst relativeMeasures = ['%', 'rem', 'em', 'ex', 'vw', 'vh', 'pt', 'cm', 'pc'];\n\nconst processedNumber = (n: string) => {\n let nProcessed;\n if (n.includes('/')) {\n nProcessed = n.split('/');\n nProcessed = calPercentage(\n parseFloat(nProcessed[0]),\n parseFloat(nProcessed[1])\n );\n } else if (n === 'auto') {\n nProcessed = 'auto';\n } else {\n const relativeUnits = relativeMeasures.filter((unit) => {\n return n.includes(unit);\n });\n if (relativeUnits.length) {\n nProcessed = n;\n } else {\n nProcessed = n === '0' ? n : n + 'px';\n }\n }\n return nProcessed;\n};\n\nexport default processedNumber;\n","import { TDirectiveName } from '../config/processors';\nimport buildCss, { IBpCals } from './buildCss';\nimport { IStyles } from './createStyles';\nimport prepareParam from './prepareParam';\nimport processedNumber from './processedNumber';\n\nconst buildAttr = (\n values: string,\n directive: TDirectiveName,\n insertStyles = false\n): IStyles => {\n const bpCals: IBpCals = {};\n\n values.split(' ').forEach((param) => {\n const paramProcessed = prepareParam(param);\n const bpNames = paramProcessed.breakPoints;\n\n // processing number values\n let propValue = paramProcessed.numbers\n .split('-')\n .map((n) => processedNumber(n))\n .join(' ');\n if (paramProcessed.important) propValue += ' !important';\n bpCals[bpNames] = {\n name: param,\n value: propValue,\n };\n });\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: directive,\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildAttr;\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPad = (valPads: string, insertStyles = false) => {\r\n return buildAttr(valPads, 'pad', insertStyles);\r\n};\r\n\r\nexport default buildPad;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadTop = (valPadTop: string, insertStyles = false) => {\r\n return buildAttr(valPadTop, 'padt', insertStyles);\r\n};\r\n\r\nexport default buildPadTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadRight = (valPadRight: string, insertStyles = false) => {\r\n return buildAttr(valPadRight, 'padr', insertStyles);\r\n};\r\n\r\nexport default buildPadRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadBottom = (valPadBottom: string, insertStyles = false) => {\r\n return buildAttr(valPadBottom, 'padb', insertStyles);\r\n};\r\n\r\nexport default buildPadBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadLeft = (valPadLeft: string, insertStyles = false) => {\r\n return buildAttr(valPadLeft, 'padl', insertStyles);\r\n};\r\n\r\nexport default buildPadLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMar = (valMars: string, insertStyles = false) => {\r\n return buildAttr(valMars, 'mar', insertStyles);\r\n};\r\n\r\nexport default buildMar;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarTop = (valMarTop: string, insertStyles = false) => {\r\n return buildAttr(valMarTop, 'mart', insertStyles);\r\n};\r\n\r\nexport default buildMarTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarRight = (valMarRight: string, insertStyles = false) => {\r\n return buildAttr(valMarRight, 'marr', insertStyles);\r\n};\r\n\r\nexport default buildMarRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarBottom = (valMarBottom: string, insertStyles = false) => {\r\n return buildAttr(valMarBottom, 'marb', insertStyles);\r\n};\r\n\r\nexport default buildMarBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarLeft = (valMarLeft: string, insertStyles = false) => {\r\n return buildAttr(valMarLeft, 'marl', insertStyles);\r\n};\r\n\r\nexport default buildMarLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxWidth = (valMaxWidth: string, insertStyles = false) => {\r\n return buildAttr(valMaxWidth, 'mxw', insertStyles);\r\n};\r\n\r\nexport default buildMaxWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxHeight = (valMaxHeight: string, insertStyles = false) => {\r\n return buildAttr(valMaxHeight, 'mxh', insertStyles);\r\n};\r\n\r\nexport default buildMaxHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinWidth = (valMinWidth: string, insertStyles = false) => {\r\n return buildAttr(valMinWidth, 'miw', insertStyles);\r\n};\r\n\r\nexport default buildMinWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinHeight = (valMinHeight: string, insertStyles = false) => {\r\n return buildAttr(valMinHeight, 'mih', insertStyles);\r\n};\r\n\r\nexport default buildMinHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildHeight = (valHeight: string, insertStyles = false) => {\r\n return buildAttr(valHeight, 'hgt', insertStyles);\r\n};\r\n\r\nexport default buildHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildWidth = (valWidth: string, insertStyles = false) => {\r\n return buildAttr(valWidth, 'wdh', insertStyles);\r\n};\r\n\r\nexport default buildWidth;\r\n","const positionProsAndValsBase = {\n st: {\n ruleCss: 'static',\n classPrefix: 'st',\n },\n ab: {\n ruleCss: 'absolute',\n classPrefix: 'ab',\n },\n fi: {\n ruleCss: 'fixed',\n classPrefix: 'fi',\n },\n re: {\n ruleCss: 'relative',\n classPrefix: 're',\n },\n si: {\n ruleCss: 'sticky',\n classPrefix: 'si',\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in',\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih',\n },\n}\n\n\nexport const positionProsAndVals = {\n ...positionProsAndValsBase,\n static: positionProsAndValsBase.st,\n absolute: positionProsAndValsBase.ab,\n fixed: positionProsAndValsBase.fi,\n relative: positionProsAndValsBase.re,\n sticky: positionProsAndValsBase.si,\n initial: positionProsAndValsBase.in,\n inherit: positionProsAndValsBase.ih,\n};\n","import getConfig from '../config/main';\nimport { positionProsAndVals } from '../config/position';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildPosition = (\n valPos: string,\n insertStyles = false\n): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valPos.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const nameProp = paramPrepared.numbers as keyof typeof positionProsAndVals;\n\n if (!positionProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in Position vault.\"\n );\n break;\n }\n\n propVal = positionProsAndVals[nameProp].ruleCss;\n let className = positionProsAndVals[nameProp].classPrefix;\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!'\n }\n\n bpCals[bpNames] = {\n name: className + sufixBp,\n value: propVal,\n };\n }\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'pos',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildPosition;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildTop = (val: string, insertStyles = false) => {\n return buildAttr(val, 't', insertStyles);\n};\n\nexport default buildTop;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildRight = (val: string, insertStyles = false) => {\n return buildAttr(val, 'r', insertStyles);\n};\n\nexport default buildRight;\n","import buildAttr from '../helpers/buildAttr';\nimport { IStyles } from '../helpers/createStyles';\n\nconst buildBottom = (val: string, insertStyles = false): IStyles => {\n return buildAttr(val, 'b', insertStyles);\n};\n\nexport default buildBottom;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildLeft = (val: string, insertStyles = false) => {\n return buildAttr(val, 'l', insertStyles);\n};\n\nexport default buildLeft;\n","import buildCols from '../methods/buildCols';\nimport buildFlex from '../methods/buildFlex';\nimport buildPad from '../methods/buildPad';\nimport buildPadTop from '../methods/buildPadTop';\nimport buildPadRight from '../methods/buildPadRight';\nimport buildPadBottom from '../methods/buildPadBottom';\nimport buildPadLeft from '../methods/buildPadLeft';\nimport buildMar from '../methods/buildMar';\nimport buildMarTop from '../methods/buildMarTop';\nimport buildMarRight from '../methods/buildMarRight';\nimport buildMarBottom from '../methods/buildMarBottom';\nimport buildMarLeft from '../methods/buildMarLeft';\nimport buildMaxWidth from '../methods/buildMaxWidth';\nimport buildMaxHeight from '../methods/buildMaxHeight';\nimport buildMinWidth from '../methods/buildMinWidth';\nimport buildMinHeight from '../methods/buildMinHeight';\nimport buildHeight from '../methods/buildHeight';\nimport buildWidth from '../methods/buildWidth';\nimport buildPosition from '../methods/buildPosition';\nimport buildTop from '../methods/buildTop';\nimport buildRight from '../methods/buildRight';\nimport buildBottom from '../methods/buildBottom';\nimport buildLeft from '../methods/buildLeft';\n\nimport { IStyles } from '../helpers/createStyles';\n\ntype TDirectiveNameBase =\n | 'cols'\n | 'pad'\n | 'padt'\n | 'padr'\n | 'padb'\n | 'padl'\n | 'mar'\n | 'mart'\n | 'marr'\n | 'marb'\n | 'marl'\n | 'flex'\n | 'mxw'\n | 'mxh'\n | 'miw'\n | 'mih'\n | 'wdh'\n | 'hgt'\n | 'pos'\n | 't'\n | 'r'\n | 'b'\n | 'l';\n\ntype TDirectiveNameExtended =\n | 'c'\n | 'fx'\n | 'p'\n | 'padding'\n | 'pt'\n | 'padding-top'\n | 'pr'\n | 'padding-right'\n | 'pb'\n | 'padding-bottom'\n | 'pl'\n | 'padding-left'\n | 'm'\n | 'margin'\n | 'mt'\n | 'margin-top'\n | 'mr'\n | 'margin-right'\n | 'mb'\n | 'margin-bottom'\n | 'ml'\n | 'margin-left'\n | 'w'\n | 'width'\n | 'h'\n | 'height'\n | 'max-width'\n | 'max-height'\n | 'min-width'\n | 'min-height'\n | 'position'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left';\n\nexport type TDirectiveName = TDirectiveNameBase | TDirectiveNameExtended;\n\nexport interface IProcessor {\n build: (values: string, insertStyles: boolean) => IStyles | Error;\n ruleCss: string;\n classPrefix: string;\n}\n\nconst processorsBase: Record = {\n cols: {\n build: buildCols,\n ruleCss: 'width',\n classPrefix: 'c'\n },\n\n // Paddings\n pad: {\n build: buildPad,\n ruleCss: 'padding',\n classPrefix: 'p'\n },\n padt: {\n build: buildPadTop,\n ruleCss: 'padding-top',\n classPrefix: 'pt'\n },\n padr: {\n build: buildPadRight,\n ruleCss: 'padding-right',\n classPrefix: 'pr'\n },\n padb: {\n build: buildPadBottom,\n ruleCss: 'padding-bottom',\n classPrefix: 'pb'\n },\n padl: {\n build: buildPadLeft,\n ruleCss: 'padding-left',\n classPrefix: 'pl'\n },\n\n // Margin\n mar: {\n build: buildMar,\n ruleCss: 'margin',\n classPrefix: 'm'\n },\n mart: {\n build: buildMarTop,\n ruleCss: 'margin-top',\n classPrefix: 'mt'\n },\n marr: {\n build: buildMarRight,\n ruleCss: 'margin-right',\n classPrefix: 'mr'\n },\n marb: {\n build: buildMarBottom,\n ruleCss: 'margin-bottom',\n classPrefix: 'mb'\n },\n marl: {\n build: buildMarLeft,\n ruleCss: 'margin-left',\n classPrefix: 'ml'\n },\n\n // Flex Box\n flex: {\n build: buildFlex,\n ruleCss: 'display: flex',\n classPrefix: 'fx'\n },\n\n // Max & Min Width & Height\n mxw: {\n build: buildMaxWidth,\n ruleCss: 'max-width',\n classPrefix: 'mxw'\n },\n\n mxh: {\n build: buildMaxHeight,\n ruleCss: 'max-height',\n classPrefix: 'mxh'\n },\n\n miw: {\n build: buildMinWidth,\n ruleCss: 'min-width',\n classPrefix: 'miw'\n },\n\n mih: {\n build: buildMinHeight,\n ruleCss: 'min-height',\n classPrefix: 'mih'\n },\n\n // Width & Height\n wdh: {\n build: buildWidth,\n ruleCss: 'width',\n classPrefix: 'w'\n },\n\n hgt: {\n build: buildHeight,\n ruleCss: 'height',\n classPrefix: 'h'\n },\n\n // Position\n pos: {\n build: buildPosition,\n ruleCss: 'position',\n classPrefix: 'pos'\n },\n t: {\n build: buildTop,\n ruleCss: 'top',\n classPrefix: 't'\n },\n r: {\n build: buildRight,\n ruleCss: 'right',\n classPrefix: 'r'\n },\n b: {\n build: buildBottom,\n ruleCss: 'bottom',\n classPrefix: 'b'\n },\n l: {\n build: buildLeft,\n ruleCss: 'left',\n classPrefix: 'l'\n }\n};\n\nexport const processors: Record = {\n ...processorsBase,\n c: processorsBase.cols,\n fx: processorsBase.flex,\n p: processorsBase.pad,\n padding: processorsBase.pad,\n pt: processorsBase.padt,\n 'padding-top': processorsBase.padt,\n pr: processorsBase.padr,\n 'padding-right': processorsBase.padr,\n pb: processorsBase.padb,\n 'padding-bottom': processorsBase.padb,\n pl: processorsBase.padl,\n 'padding-left': processorsBase.padl,\n m: processorsBase.mar,\n margin: processorsBase.mar,\n mt: processorsBase.mart,\n 'margin-top': processorsBase.mart,\n mr: processorsBase.marr,\n 'margin-right': processorsBase.marr,\n mb: processorsBase.marb,\n 'margin-bottom': processorsBase.marb,\n ml: processorsBase.marl,\n 'margin-left': processorsBase.marl,\n w: processorsBase.wdh,\n width: processorsBase.wdh,\n h: processorsBase.hgt,\n height: processorsBase.hgt,\n 'max-width': processorsBase.mxw,\n 'max-height': processorsBase.mxh,\n 'min-width': processorsBase.miw,\n 'min-height': processorsBase.mih,\n position: processorsBase.pos,\n top: processorsBase.t,\n right: processorsBase.r,\n bottom: processorsBase.b,\n left: processorsBase.l,\n};\n","import { processors, TDirectiveName } from '../config/processors';\r\n\r\nconst getParameters = (\r\n Node: HTMLElement | Element\r\n): Partial> => {\r\n const params: Partial> = {};\r\n const attrs = Node.attributes;\r\n const paramNames = Object.keys(processors);\r\n Array.prototype.forEach.call(attrs, (attr) => {\r\n if (paramNames.includes(attr.name)) {\r\n if (attr.value !== '')\r\n params[attr.name as TDirectiveName] = attr.value\r\n .trim()\r\n .split(' ')\r\n .filter((item: string) => item)\r\n .join(' ');\r\n }\r\n });\r\n return params;\r\n};\r\n\r\nexport default getParameters;\r\n","import { processors, TDirectiveName } from '../config/processors';\nimport { IStyles } from '../helpers/createStyles';\n\nexport interface IBuildResult {\n [prop: string]: IStyles | boolean;\n}\n\nconst build = (\n obj: Partial>,\n insertStyles = false\n): Partial | Error => {\n const rObj: Partial = {};\n let err: Error | boolean = false;\n for (const prop in obj) {\n const propData = processors[prop as TDirectiveName];\n const objStyles: IStyles | Error = propData.build(\n obj[prop as TDirectiveName] as string,\n insertStyles\n );\n if (objStyles instanceof Error) {\n err = objStyles;\n break;\n } else {\n rObj[prop] = objStyles;\n }\n }\n\n if (err) return err;\n return rObj;\n};\n\nexport default build;\n","import getConfig from '../config/main';\n\nconst addClasses = (\n Node: HTMLElement | Element,\n classesNames: string,\n overwrite?: boolean\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n const names = classesNames.split(' ');\n let classesToAdd: string[] = names;\n if (!overwrite) {\n classesToAdd = names.filter((name) => !Node.classList.contains(name));\n if (!classesToAdd.length) {\n resolve();\n return;\n }\n }\n\n const obsNode = new config.context.MutationObserver((mutations) => {\n const target = mutations[0].target;\n const currentClasses = (target as Element).className.split(' ');\n const containsAll = names.every((element) =>\n currentClasses.includes(element)\n );\n if (containsAll) {\n obsNode.disconnect();\n resolve();\n }\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: ['class'],\n characterData: false,\n });\n\n if (overwrite) {\n Node.className = classesNames;\n } else {\n const space = Node.hasAttribute('class') ? ' ' : '';\n Node.className += space + classesToAdd.join(' ');\n }\n });\n};\n\nexport default addClasses;\n","import getConfig from '../config/main';\n\nexport const removeProp = (\n Node: HTMLElement | Element,\n propName: string,\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n if (!Node.hasAttribute(propName)) {\n resolve();\n return;\n }\n const obsNode = new context.MutationObserver(() => {\n obsNode.disconnect();\n resolve();\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: [propName],\n characterData: false,\n });\n Node.removeAttribute(propName);\n });\n};\n\nexport const removeProps = (\n Node: HTMLElement | Element,\n propNames: string[],\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n const promises = propNames.map((name) => removeProp(Node, name, context));\n Promise.all(promises).then(() => resolve());\n });\n};\n\nconst removeAttr = (\n Node: HTMLElement | Element,\n propNames: string | string[]\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n if (Array.isArray(propNames)) {\n removeProps(Node, propNames, config.context).then(resolve);\n } else {\n removeProp(Node, propNames, config.context).then(resolve);\n }\n });\n};\n\nexport default removeAttr;\n","import getConfig from '../config/main';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nexport interface IEventReady {\n node: HTMLElement | Element;\n directive: string | string[];\n classes: string;\n resolve: (value: void | Error | PromiseLike) => void;\n}\n\nconst eventReady = ({ node, directive, classes, resolve }: IEventReady) => {\n const config = getConfig();\n removeAttr(node, directive)\n .then(() => addClasses(node, classes))\n .then(() => {\n resolve();\n const event = new config.context.CustomEvent('layout:ready');\n node.dispatchEvent(event);\n });\n};\n\nexport default eventReady;\n","import { IStyles } from '../helpers/createStyles';\nimport regError from '../helpers/regError';\nimport build, { IBuildResult } from './build';\nimport getParameters from './getParameters';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst set = (\n Node: HTMLElement | Element,\n parameters?: Partial>\n): Promise => {\n return new Promise((resolve, reject) => {\n const params = parameters || getParameters(Node);\n const arrParams = Object.keys(params);\n if (!arrParams.length) {\n const err = regError(\n 'Parameter Missing',\n \"don't exists any parameter to process\",\n Node\n );\n reject(err);\n return;\n }\n\n const toBuild: Partial> = {};\n for (const prop in params) {\n toBuild[prop as TDirectiveName] = params[prop as TDirectiveName];\n }\n\n // creating classes names and inserting that classes to the core\n const classesObj = build(toBuild as Record, true);\n if (classesObj instanceof Error) {\n reject(classesObj);\n return;\n }\n\n // adding classes\n const classes = classesObj as Partial;\n const classesNames = Object.keys(classes)\n .map((name: string) => Object.keys(classes[name] as IStyles))\n .flat()\n .join(' ');\n\n // removing unnecessary props\n eventReady({\n node: Node,\n directive: arrParams,\n classes: classesNames,\n resolve,\n });\n });\n};\n\nexport default set;\n","import regError from '../helpers/regError';\nimport buildFlex from './buildFlex';\nimport eventReady from '../helpers/eventReady';\n\nconst setFlex = (\n Node: HTMLElement | Element,\n flexValues?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = flexValues || Node.getAttribute('flex');\n if (!values) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"flex\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildFlex(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'flex',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setFlex;\n","import regError from '../helpers/regError';\nimport buildCols from './buildCols';\nimport eventReady from '../helpers/eventReady';\n\nconst setCols = (\n Node: HTMLElement | Element,\n columns?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = columns || Node.getAttribute('cols');\n if (!values) {\n const err = regError(\n 'Empty',\n \"The value of the directive 'cols' is empty\",\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildCols(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'cols',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setCols;\n","import buildAttr from '../helpers/buildAttr';\nimport regError from '../helpers/regError';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst setAttr = (\n Node: HTMLElement | Element,\n directive: TDirectiveName,\n values?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const directiveValues = values || Node.getAttribute(directive);\n if (!directiveValues) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"' + directive + '\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildAttr(directiveValues, directive, true);\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive,\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setAttr;\n","import setAttr from './setAttr';\r\n\r\nconst setHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'hgt', values);\r\n};\r\n\r\nexport default setHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marb', values);\r\n};\r\n\r\nexport default setMarBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marl', values);\r\n};\r\n\r\nexport default setMarLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marr', values);\r\n};\r\n\r\nexport default setMarRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMar = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mar', values);\r\n};\r\n\r\nexport default setMar;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mart', values);\r\n};\r\n\r\nexport default setMarTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxw', values);\r\n};\r\n\r\nexport default setMaxWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mih', values);\r\n};\r\n\r\nexport default setMinHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'miw', values);\r\n};\r\n\r\nexport default setMinWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padb', values);\r\n};\r\n\r\nexport default setPadBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padl', values);\r\n};\r\n\r\nexport default setPadLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padr', values);\r\n};\r\n\r\nexport default setPadRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPad = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'pad', values);\r\n};\r\n\r\nexport default setPad;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padt', values);\r\n};\r\n\r\nexport default setPadTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'wdh', values);\r\n};\r\n\r\nexport default setWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxh', values);\r\n};\r\n\r\nexport default setMaxHeight;\r\n","import setAttr from './setAttr';\n\nconst setPosition = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'pos', values);\n};\n\nexport default setPosition;\n","import setAttr from './setAttr';\n\nconst setTop = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 't', values);\n};\n\nexport default setTop;\n","import setAttr from './setAttr';\n\nconst setRight = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'r', values);\n};\n\nexport default setRight;\n","import setAttr from './setAttr';\n\nconst setBottom = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'b', values);\n};\n\nexport default setBottom;\n","import setAttr from './setAttr';\n\nconst setLeft = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'l', values);\n};\n\nexport default setLeft;\n","import { TDirectiveName } from './../config/processors';\nimport { processors } from '../config/processors';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nconst reset = (Node: HTMLElement | Element): Promise => {\n return new Promise((resolve) => {\n const classPrefixes = new Set(Object.keys(processors).map( item => processors[item as TDirectiveName].classPrefix));\n const layouterClasses = [ ...classPrefixes];\n const restClass = Node.className.split(' ').filter((name) => {\n if ( !name.includes('-')) {\n return true;\n } else {\n const findClass = layouterClasses.find( item => {\n const nLength = item.length;\n const namePrefix = name.substring(0, nLength + 1);\n return namePrefix === item + '-'\n })\n return !findClass\n }\n });\n\n if (restClass.length) {\n const classesName = restClass.join(' ');\n addClasses(Node, classesName, true).then(() => {\n resolve();\n });\n } else {\n removeAttr(Node, 'class').then(() => {\n resolve();\n });\n }\n\n });\n};\n\nexport default reset;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\n\nconst searchAndProcess = (\n layouter: ILayouter,\n context: Document | HTMLElement | Element\n) => {\n return new Promise((resolve) => {\n const props = Object.keys(processors);\n const attrs = props.map((prop) => `[${prop}]`).join(', ');\n const nodes = context.querySelectorAll(attrs);\n if (!nodes.length) {\n resolve(layouter);\n return;\n }\n\n const setNodes = new Set();\n Array.prototype.forEach.call(nodes, (itemNode) => {\n setNodes.add(itemNode);\n });\n const promises: Promise[] = [];\n setNodes.forEach((node) => {\n promises.push(layouter.set(node as Element | HTMLElement));\n });\n Promise.all(promises).then(resolve);\n });\n};\n\nexport default searchAndProcess;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\nimport getConfig from '../config/main';\nimport searchAndProcess from './searchAndProcess';\n\nconst mainObserver = (layouter: ILayouter) => {\n const config = getConfig();\n const props = Object.keys(processors);\n const obsBody = new layouter.context.MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n if (!mutation.addedNodes.length) {\n continue;\n }\n mutation.addedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n searchAndProcess(layouter, node);\n }\n });\n } else if (mutation.type === 'attributes') {\n const node = mutation.target;\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n }\n }\n }\n });\n const observerOptions = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: props,\n characterData: false,\n };\n obsBody.observe(config.context.document.body, observerOptions);\n};\n\nexport default mainObserver;\n","import { IConfig, IConfigUser, setConfig, updateConfig } from './config/main';\nimport getParameters from './methods/getParameters';\n\nimport build from './methods/build';\nimport buildCols from './methods/buildCols';\nimport buildFlex from './methods/buildFlex';\nimport buildPad from './methods/buildPad';\nimport buildPadTop from './methods/buildPadTop';\nimport buildPadRight from './methods/buildPadRight';\nimport buildPadBottom from './methods/buildPadBottom';\nimport buildPadLeft from './methods/buildPadLeft';\nimport buildMar from './methods/buildMar';\nimport buildMarTop from './methods/buildMarTop';\nimport buildMarRight from './methods/buildMarRight';\nimport buildMarBottom from './methods/buildMarBottom';\nimport buildMarLeft from './methods/buildMarLeft';\nimport buildMaxWidth from './methods/buildMaxWidth';\nimport buildMaxHeight from './methods/buildMaxHeight';\nimport buildMinWidth from './methods/buildMinWidth';\nimport buildMinHeight from './methods/buildMinHeight';\nimport buildHeight from './methods/buildHeight';\nimport buildWidth from './methods/buildWidth';\nimport buildPosition from './methods/buildPosition';\nimport buildTop from './methods/buildTop';\nimport buildRight from './methods/buildRight';\nimport buildBottom from './methods/buildBottom';\nimport buildLeft from './methods/buildLeft';\n\nimport set from './methods/set';\nimport setFlex from './methods/setFlex';\nimport setCols from './methods/SetCols';\nimport setHeight from './methods/setHeight';\nimport setMarBottom from './methods/setMarBottom';\nimport setMarLeft from './methods/setMarLeft';\nimport setMarRight from './methods/setMarRight';\nimport setMar from './methods/setMar';\nimport setMarTop from './methods/setMarTop';\nimport setMaxWidth from './methods/setMaxWidth';\nimport setMinHeight from './methods/setMinHeight';\nimport setMinWidth from './methods/setMinWidth';\nimport setPadBottom from './methods/setPadBottom';\nimport setPadLeft from './methods/setPadLeft';\nimport setPadRight from './methods/setPadRight';\nimport setPad from './methods/setPad';\nimport setPadTop from './methods/setPadTop';\nimport setWidth from './methods/setWidth';\nimport setMaxHeight from './methods/setMaxHeight';\nimport setPosition from './methods/setPosition';\nimport setTop from './methods/setTop';\nimport setRight from './methods/setRight';\nimport setBottom from './methods/setBottom';\nimport setLeft from './methods/setLeft';\n\nimport insertRules from './methods/insertRules';\nimport reset from './methods/reset';\n\nimport { IStyles } from './helpers/createStyles';\nimport { IBuildResult } from './methods/build';\nimport searchAndProcess from './helpers/searchAndProcess';\nimport mainObserver from './helpers/mainObserver';\nimport { TDirectiveName } from './config/processors';\n\nexport interface ILayouter extends IConfig {\n getParameters: (\n Node: HTMLElement | Element\n ) => Partial>;\n updateConfig: (userConfig: Partial>) => IConfig;\n build: (\n obj: Partial>,\n insertStyles?: boolean\n ) => Partial | Error;\n buildCols: (valCols: string, insertStyles?: boolean) => IStyles | Error;\n buildFlex: (valFlex: string, insertStyles?: boolean) => IStyles | Error;\n buildPad: (valPads: string, insertStyles?: boolean) => IStyles;\n buildPadTop: (valPadTop: string, insertStyles?: boolean) => IStyles;\n buildPadRight: (valPadRight: string, insertStyles?: boolean) => IStyles;\n buildPadBottom: (valPadBottom: string, insertStyles?: boolean) => IStyles;\n buildPadLeft: (valPadLeft: string, insertStyles?: boolean) => IStyles;\n buildMar: (valMars: string, insertStyles?: boolean) => IStyles;\n buildMarTop: (valMarTop: string, insertStyles?: boolean) => IStyles;\n buildMarRight: (valMarRight: string, insertStyles?: boolean) => IStyles;\n buildMarBottom: (valMarBottom: string, insertStyles?: boolean) => IStyles;\n buildMarLeft: (valMarLeft: string, insertStyles?: boolean) => IStyles;\n buildMaxWidth: (valMaxWidth: string, insertStyles?: boolean) => IStyles;\n buildMaxHeight: (valMaxHeight: string, insertStyles?: boolean) => IStyles;\n buildMinWidth: (valMinWidth: string, insertStyles?: boolean) => IStyles;\n buildMinHeight: (valMinHeight: string, insertStyles?: boolean) => IStyles;\n buildHeight: (valHeight: string, insertStyles?: boolean) => IStyles;\n buildWidth: (valWidth: string, insertStyles?: boolean) => IStyles;\n buildPosition: (\n valPosition: string,\n insertStyles?: boolean\n ) => IStyles | Error;\n buildTop: (valTop: string, insertStyles?: boolean) => IStyles | Error;\n buildRight: (valRight: string, insertStyles?: boolean) => IStyles | Error;\n buildBottom: (valBottom: string, insertStyles?: boolean) => IStyles | Error;\n buildLeft: (valLeft: string, insertStyles?: boolean) => IStyles | Error;\n\n set: (\n Node: HTMLElement | Element,\n parameters?: Partial>\n ) => Promise;\n setCols: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setFlex: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMar: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPad: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPosition: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n setTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n insertRules: (objStyles: IStyles) => void;\n reset: (Node: HTMLElement | Element) => Promise;\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouter: ILayouter;\n }\n}\n\nconst layouter = (\n context: Window & typeof globalThis,\n userConfig: Partial = {}\n): ILayouter => {\n const config = setConfig(context, userConfig);\n\n const instance = {\n ...config,\n getParameters,\n updateConfig,\n insertRules,\n build,\n buildCols,\n buildFlex,\n buildPad,\n buildPadTop,\n buildPadRight,\n buildPadBottom,\n buildPadLeft,\n buildMar,\n buildMarTop,\n buildMarRight,\n buildMarBottom,\n buildMarLeft,\n buildMaxWidth,\n buildMaxHeight,\n buildMinWidth,\n buildMinHeight,\n buildHeight,\n buildWidth,\n set,\n setCols,\n setFlex,\n setMar,\n setMarTop,\n setMarRight,\n setMarBottom,\n setMarLeft,\n setPad,\n setPadTop,\n setPadRight,\n setPadBottom,\n setPadLeft,\n setWidth,\n setMinWidth,\n setMaxWidth,\n setHeight,\n setMinHeight,\n setMaxHeight,\n reset,\n buildPosition,\n buildTop,\n buildRight,\n buildBottom,\n buildLeft,\n setPosition,\n setTop,\n setRight,\n setBottom,\n setLeft,\n };\n\n // Auto init process\n searchAndProcess(instance, context.document).then(() => {\n if (instance.ready) instance.ready(instance);\n mainObserver(instance);\n });\n\n return instance;\n};\n\nif (typeof window !== 'undefined' && typeof exports === 'undefined') {\n window.layouter = layouter(window);\n}\n\nexport default layouter;\n"],"names":["config"],"mappings":"AAkBA,MAAM,kBAAkB,CACtB,QACA,aACmB;AACnB,QAAM,QAAwB,CAAA;AAE9B,MAAI,aAAa,SAAS;AACxB,WAAO,KAAK,MAAM,EACf,IAAI,CAAC,OAAe;AACZ,aAAA;AAAA,QACL,OAAO;AAAA,QACP,OAAO,OAAO,IAAI;A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;AACT;AAEA,IAAI,OAAO,WAAW,eAAe,OAAO,YAAY,aAAa;AAC5D,SAAA,WAAW,SAAS,MAAM;AACnC;;"} \ No newline at end of file +{"version":3,"file":"layouter.es.js","sources":["../src/helpers/breakpointsNums.ts","../src/helpers/createScopeStyles.ts","../src/helpers/scopesStylesBuilder.ts","../src/helpers/breakpointsOrdered.ts","../src/config/main.ts","../src/helpers/prepareParam.ts","../src/helpers/regError.ts","../src/helpers/calPercentage.ts","../src/helpers/getScopeByclassName.ts","../src/methods/insertRules.ts","../src/config/flex.ts","../src/helpers/percentageConverter.ts","../src/helpers/createStyles.ts","../src/helpers/nameCleaner.ts","../src/helpers/buildCss.ts","../src/methods/buildCols.ts","../src/methods/buildFlex.ts","../src/helpers/processedNumber.ts","../src/helpers/buildAttr.ts","../src/methods/buildPad.ts","../src/methods/buildPadTop.ts","../src/methods/buildPadRight.ts","../src/methods/buildPadBottom.ts","../src/methods/buildPadLeft.ts","../src/methods/buildMar.ts","../src/methods/buildMarTop.ts","../src/methods/buildMarRight.ts","../src/methods/buildMarBottom.ts","../src/methods/buildMarLeft.ts","../src/methods/buildMaxWidth.ts","../src/methods/buildMaxHeight.ts","../src/methods/buildMinWidth.ts","../src/methods/buildMinHeight.ts","../src/methods/buildHeight.ts","../src/methods/buildWidth.ts","../src/config/position.ts","../src/methods/buildPosition.ts","../src/methods/buildTop.ts","../src/methods/buildRight.ts","../src/methods/buildBottom.ts","../src/methods/buildLeft.ts","../src/config/display.ts","../src/methods/buildDisplay.ts","../src/config/processors.ts","../src/methods/getParameters.ts","../src/methods/build.ts","../src/utils/addClasses.ts","../src/utils/removeAttr.ts","../src/helpers/eventReady.ts","../src/methods/set.ts","../src/methods/setFlex.ts","../src/methods/SetCols.ts","../src/methods/setAttr.ts","../src/methods/setHeight.ts","../src/methods/setMarBottom.ts","../src/methods/setMarLeft.ts","../src/methods/setMarRight.ts","../src/methods/setMar.ts","../src/methods/setMarTop.ts","../src/methods/setMaxWidth.ts","../src/methods/setMinHeight.ts","../src/methods/setMinWidth.ts","../src/methods/setPadBottom.ts","../src/methods/setPadLeft.ts","../src/methods/setPadRight.ts","../src/methods/setPad.ts","../src/methods/setPadTop.ts","../src/methods/setWidth.ts","../src/methods/setMaxHeight.ts","../src/methods/setPosition.ts","../src/methods/setTop.ts","../src/methods/setRight.ts","../src/methods/setBottom.ts","../src/methods/setLeft.ts","../src/methods/reset.ts","../src/helpers/searchAndProcess.ts","../src/helpers/mainObserver.ts","../src/layouter.ts"],"sourcesContent":["export type TNumProp = 'width' | 'cols';\r\n\r\nexport interface IBreakpoint {\r\n alias: string;\r\n width: number;\r\n}\r\n\r\nexport interface IBreakpoints {\r\n [alias: string]: {\r\n width: number;\r\n cols: number;\r\n };\r\n}\r\n\r\nexport interface IBreakpointObj {\r\n [alias: string]: number;\r\n}\r\n\r\nconst breakpointsNums = (\r\n objBps: IBreakpoints,\r\n propName: TNumProp\r\n): IBreakpointObj => {\r\n const sizes: IBreakpointObj = {};\r\n\r\n if (propName === 'width') {\r\n Object.keys(objBps)\r\n .map((bp: string) => {\r\n return {\r\n alias: bp,\r\n width: objBps[bp].width,\r\n };\r\n })\r\n .sort((a: IBreakpoint, b: IBreakpoint) =>\r\n a.width > b.width ? 1 : b.width > a.width ? -1 : 0\r\n )\r\n .forEach((bp: IBreakpoint, index: number) => {\r\n sizes[bp.alias] = !index ? 0 : objBps[bp.alias][propName];\r\n });\r\n } else {\r\n Object.keys(objBps).forEach((bp) => {\r\n sizes[bp] = objBps[bp][propName];\r\n });\r\n }\r\n\r\n return sizes;\r\n};\r\n\r\nexport default breakpointsNums;\r\n","export type TInsertion = 'before' | 'after' | 'append';\n\nexport interface ICreateScopeStyles {\n bridge?: boolean;\n bp: string;\n insertionType: TInsertion;\n node: HTMLElement;\n context: Window & typeof globalThis;\n}\n\nexport interface IRCreateScopeStyles {\n method:\n | CSSStyleSheet\n | {\n insertRule: (ruleCss: string) => void;\n rules: string[];\n };\n node: HTMLElement;\n}\n\nconst createScopeStyles = ({\n bridge: withBridge,\n bp,\n insertionType,\n node,\n context,\n}: ICreateScopeStyles): IRCreateScopeStyles => {\n let stylesScope = context.document.getElementById('layouter-' + bp);\n if (!stylesScope) {\n stylesScope = context.document.createElement('style');\n stylesScope.appendChild(context.document.createTextNode('')); // WebKit hack :(\n const nodeParent = node.parentNode as HTMLDivElement;\n switch (insertionType) {\n case 'before':\n nodeParent.insertBefore(stylesScope, node);\n break;\n case 'after':\n node.nextSibling\n ? nodeParent.insertBefore(stylesScope, node.nextSibling)\n : nodeParent.appendChild(stylesScope);\n break;\n case 'append':\n node.appendChild(stylesScope);\n break;\n }\n stylesScope.id = 'layouter-' + bp;\n }\n\n let bridge: IRCreateScopeStyles;\n if (withBridge) {\n bridge = {\n method: (stylesScope as HTMLStyleElement).sheet as CSSStyleSheet,\n node: stylesScope,\n };\n } else {\n bridge = {\n method: {\n insertRule: (ruleCss: string) => {\n (stylesScope as HTMLDivElement).appendChild(\n context.document.createTextNode(ruleCss)\n );\n },\n rules: [],\n },\n node: stylesScope,\n };\n }\n return bridge;\n};\n\nexport default createScopeStyles;\n","import { IBreakpoints } from './breakpointsNums';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nexport interface IScopes {\n [name: string]: IRCreateScopeStyles;\n}\n\nexport interface IScopesStylesBuilder {\n breakpoints: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\nexport const scopesStylesBuilder = ({\n breakpoints,\n bridge,\n scope,\n context,\n}: IScopesStylesBuilder): IScopes => {\n const scopes: IScopes = scope || {};\n Object.keys(breakpoints).forEach((bp: string) => {\n if (!scopes[bp]) {\n scopes[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'append',\n node: context.document.body,\n context,\n });\n }\n });\n return scopes;\n};\n","import { ICols } from '../config/main';\r\nimport { IBreakpoints } from './breakpointsNums';\r\n\r\nconst breakpointsOrdered = (bps: IBreakpoints, sizes: ICols) => {\r\n const bpsOrdered: IBreakpoints = {};\r\n Object.keys(sizes).forEach((bpName) => (bpsOrdered[bpName] = bps[bpName]));\r\n return bpsOrdered;\r\n};\r\n\r\nexport default breakpointsOrdered;\r\n","import { ILayouter } from './../layouter';\nimport breakpointsNums, { IBreakpoints } from '../helpers/breakpointsNums';\nimport { IScopes, scopesStylesBuilder } from '../helpers/scopesStylesBuilder';\nimport breakpointsOrdered from '../helpers/breakpointsOrdered';\nimport { version } from '../../package.json';\n\nexport interface ICols {\n [colAlias: string]: number;\n}\n\nexport interface IConfigUser {\n prefix: string;\n breakpoints: IBreakpoints;\n bridge: boolean;\n debug?: boolean;\n ready?: (instance: ILayouter) => void;\n}\n\ninterface IConfigNumsIn {\n bps: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\ninterface IConfigNumsOut {\n scope: IScopes;\n cols: ICols;\n sizes: ICols;\n breakpoints: IBreakpoints;\n}\n\nexport interface IConfig\n extends Omit,\n IConfigNumsOut {\n context: Window & typeof globalThis;\n styles: {\n [className: string]: string;\n };\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouterConfig: Partial;\n }\n}\n\nconst breakpointsInit: IBreakpoints = {\n xs: {\n width: 360,\n cols: 15,\n },\n sm: {\n width: 600,\n cols: 25,\n },\n md: {\n width: 900,\n cols: 31,\n },\n lg: {\n width: 1200,\n cols: 41,\n },\n xlg: {\n width: 1536,\n cols: 51,\n },\n};\n\nexport let baseConfig: IConfigUser = {\n prefix: '',\n breakpoints: breakpointsInit,\n bridge: true,\n debug: true,\n};\n\nlet config: IConfig;\n\nconst configNums = ({\n bps,\n bridge,\n scope,\n context,\n}: IConfigNumsIn): IConfigNumsOut => {\n const sizes = breakpointsNums(bps, 'width');\n const finalBps = breakpointsOrdered(bps, sizes);\n return {\n sizes,\n cols: breakpointsNums(bps, 'cols'),\n scope: scopesStylesBuilder({\n breakpoints: finalBps,\n bridge,\n scope: scope,\n context,\n }),\n breakpoints: finalBps,\n };\n};\n\nexport const setConfig = (\n context: Window & typeof globalThis,\n customCfg: Partial = {}\n): IConfig => {\n const contextConfig = context.layouterConfig || {};\n\n baseConfig = {\n ...baseConfig,\n ...customCfg,\n ...contextConfig,\n };\n\n config = {\n context,\n ...baseConfig,\n ...configNums({\n bps: baseConfig.breakpoints,\n bridge: baseConfig.bridge,\n context,\n }),\n styles: {},\n version,\n };\n\n return config;\n};\n\nconst getConfig = (): IConfig => {\n return config;\n};\n\nexport const setStyles = (className: string, value: string) => {\n config.styles[className] = value;\n};\n\nexport const updateConfig = (userConfig: Partial): IConfig => {\n config = {\n ...config,\n ...userConfig,\n };\n\n if (userConfig.breakpoints) {\n config = {\n ...config,\n ...configNums({\n bps: config.breakpoints,\n bridge: config.bridge,\n scope: config.scope,\n context: config.context,\n }),\n };\n }\n\n return config;\n};\n\nexport default getConfig;\n","import getConfig from '../config/main';\n\nexport interface IPrepareParamObj {\n widthBp: boolean;\n numbers: string;\n breakPoints: string;\n important: boolean;\n}\n\nconst prepareParam = (param: string): IPrepareParamObj => {\n let bp: string;\n let argParam = param;\n let important = false;\n const haveBp = argParam.includes('@');\n if (haveBp) {\n const bpSplited = argParam.split('@');\n argParam = bpSplited[0];\n bp = bpSplited[1];\n } else {\n const config = getConfig();\n bp = Object.keys(config.breakpoints)[0];\n }\n\n if (param.includes('!')) {\n important = true;\n bp = bp.replace(/!/g, '');\n argParam = argParam.replace(/!/g, '');\n }\n\n return {\n widthBp: haveBp,\n numbers: argParam,\n breakPoints: bp,\n important,\n };\n};\n\nexport default prepareParam;\n","import config from '../config/main';\r\n\r\nconst regError = (\r\n name: string,\r\n message: string,\r\n Node?: Element | HTMLElement\r\n): Error => {\r\n const err = new Error();\r\n err.name = name;\r\n err.message = message;\r\n const intConfig = config();\r\n if (intConfig.debug) {\r\n console.error(err);\r\n if (Node) console.log(Node);\r\n }\r\n return err;\r\n};\r\n\r\nexport default regError;\r\n","const calPercentage = (n1: number, n2: number): string => {\r\n const cal = (n1 * 100) / n2;\r\n const haveDecimal = cal - Math.floor(cal) !== 0;\r\n const result = haveDecimal ? cal.toFixed(3) : cal;\r\n return result + '%';\r\n};\r\n\r\nexport default calPercentage;\r\n","import config from '../config/main';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nconst getScopeByclassName = (className: string): IRCreateScopeStyles => {\n const nameClass = className.replace(/!/g, '');\n const atIndex = nameClass.indexOf('@');\n const intConfig = config();\n const scope = intConfig.scope;\n const bridge = intConfig.bridge;\n const context = intConfig.context;\n\n // Haven´t a BP designed\n if (atIndex === -1) {\n const firstBp = Object.keys(intConfig.breakpoints)[0];\n return scope[firstBp as string];\n }\n\n // Have a BP designed, a normal BP.\n const bp = nameClass.substring(atIndex + 1);\n if (!bp.includes('-')) return scope[bp]; // A simple BP (13/15@lg), not compound (like this: 13/15@sm-md).\n\n // A BP until. Example 13/15@-md\n if (bp.substring(0, 1) === '-') {\n if (scope[bp]) return scope[bp]; // exists the Scope.\n const bpUntil = bp.substring(1);\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'before',\n node: scope[bpUntil].node,\n context,\n });\n return scope[bp]; // returning a new scope created\n }\n\n // A BP from and until (a BP compound). Example: Example 13/15@sm-md\n if (scope[bp]) {\n return scope[bp]; // exists the Scope.\n }\n\n const fromBp = bp.split('-')[0];\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'after',\n node: scope[fromBp].node,\n context,\n });\n\n return scope[bp]; // returning a new scope compounded created\n};\n\nexport default getScopeByclassName;\n","import config, { setStyles } from '../config/main';\nimport { IStyles } from '../helpers/createStyles';\nimport getScopeByclassName from '../helpers/getScopeByclassName';\n\nconst insertRules = (objStyles: IStyles) => {\n const intConfig = config();\n\n for (const className in objStyles) {\n if (!intConfig.styles[className]) {\n const nodeScope = getScopeByclassName(className);\n const valClass = objStyles[className];\n const rules = nodeScope.method.rules;\n nodeScope.method.insertRule(valClass, rules ? rules.length : 0);\n setStyles(className, valClass); // saving in styles vault\n }\n }\n};\n\nexport default insertRules;\n","const flexProsAndValsBase = {\r\n jc: {\r\n ruleCss: 'justify-content',\r\n classPrefix: 'jc',\r\n },\r\n ai: {\r\n ruleCss: 'align-items',\r\n classPrefix: 'ai',\r\n },\r\n ce: {\r\n ruleCss: 'center',\r\n classPrefix: 'ce',\r\n },\r\n fs: {\r\n ruleCss: 'flex-start',\r\n classPrefix: 'fs',\r\n },\r\n fe: {\r\n ruleCss: 'flex-end',\r\n classPrefix: 'fe',\r\n },\r\n sb: {\r\n ruleCss: 'space-between',\r\n classPrefix: 'sb',\r\n },\r\n sa: {\r\n ruleCss: 'space-around',\r\n classPrefix: 'sa',\r\n },\r\n fw: {\r\n ruleCss: 'flex-wrap',\r\n classPrefix: 'fw',\r\n },\r\n nw: {\r\n ruleCss: 'nowrap',\r\n classPrefix: 'nw',\r\n },\r\n w: {\r\n ruleCss: 'wrap',\r\n classPrefix: 'w',\r\n },\r\n wr: {\r\n ruleCss: 'wrap-reverse',\r\n classPrefix: 'wr',\r\n },\r\n fd: {\r\n ruleCss: 'flex-direction',\r\n classPrefix: 'fd',\r\n },\r\n r: {\r\n ruleCss: 'row',\r\n classPrefix: 'r',\r\n },\r\n rr: {\r\n ruleCss: 'row-reverse',\r\n classPrefix: 'rr',\r\n },\r\n co: {\r\n ruleCss: 'column',\r\n classPrefix: 'co',\r\n },\r\n cor: {\r\n ruleCss: 'column-reverse',\r\n classPrefix: 'co',\r\n },\r\n au: {\r\n ruleCss: 'auto',\r\n classPrefix: 'au',\r\n },\r\n st: {\r\n ruleCss: 'stretch',\r\n classPrefix: 'st',\r\n },\r\n bl: {\r\n ruleCss: 'baseline',\r\n classPrefix: 'bl',\r\n },\r\n in: {\r\n ruleCss: 'initial',\r\n classPrefix: 'in',\r\n },\r\n ih: {\r\n ruleCss: 'inherit',\r\n classPrefix: 'ih',\r\n },\r\n};\r\n\r\nconst flexPropsAndValsSelfBase = {\r\n fg: {\r\n ruleCss: 'flex-grow',\r\n classPrefix: 'fg',\r\n },\r\n fh: {\r\n ruleCss: 'flex-shrink',\r\n classPrefix: 'fh',\r\n },\r\n as: {\r\n ruleCss: 'align-self',\r\n classPrefix: 'as',\r\n },\r\n or: {\r\n ruleCss: 'order',\r\n classPrefix: 'or',\r\n },\r\n};\r\n\r\nconst flexPropsAndValsSelf = {\r\n ...flexPropsAndValsSelfBase,\r\n 'flex-grow': flexPropsAndValsSelfBase.fg,\r\n 'flex-shrink': flexPropsAndValsSelfBase.fh,\r\n 'align-self': flexPropsAndValsSelfBase.as,\r\n order: flexPropsAndValsSelfBase.or,\r\n};\r\n\r\nexport const flexProsAndVals = {\r\n ...flexProsAndValsBase,\r\n ...flexPropsAndValsSelf,\r\n 'justify-content': flexProsAndValsBase.jc,\r\n 'align-items': flexProsAndValsBase.ai,\r\n center: flexProsAndValsBase.ce,\r\n 'flex-start': flexProsAndValsBase.fs,\r\n 'flex-end': flexProsAndValsBase.fe,\r\n 'space-between': flexProsAndValsBase.sb,\r\n 'space-around': flexProsAndValsBase.fs,\r\n 'flex-wrap': flexProsAndValsBase.fw,\r\n nowrap: flexProsAndValsBase.nw,\r\n w: flexProsAndValsBase.w,\r\n 'wrap-reverse': flexProsAndValsBase.wr,\r\n 'flex-direction': flexProsAndValsBase.fd,\r\n row: flexProsAndValsBase.r,\r\n 'row-reverse': flexProsAndValsBase.rr,\r\n column: flexProsAndValsBase.co,\r\n 'column-reverse': flexProsAndValsBase.cor,\r\n auto: flexProsAndValsBase.au,\r\n stretch: flexProsAndValsBase.st,\r\n baseline: flexProsAndValsBase.bl,\r\n initial: flexProsAndValsBase.in,\r\n inherit: flexProsAndValsBase.ih,\r\n};\r\n\r\nexport const flexAttrsSelf = Object.keys(flexPropsAndValsSelf);\r\n","const percentageConverter = (percentage: string) => {\r\n return '0¯' + percentage.replace('%', '');\r\n};\r\n\r\nexport default percentageConverter;\r\n","import { flexAttrsSelf } from '../config/flex';\r\nimport config from '../config/main';\r\nimport { processors, TDirectiveName } from '../config/processors';\r\nimport { IBpCals } from './buildCss';\r\nimport percentageConverter from './percentageConverter';\r\n\r\nexport interface IStyles {\r\n [name: string]: string;\r\n}\r\n\r\nconst createStyles = (directive: TDirectiveName, bps: IBpCals): IStyles => {\r\n const intConfig = config();\r\n const sizes = intConfig.sizes;\r\n const prefix = intConfig.prefix;\r\n const prop = processors[directive].ruleCss;\r\n const styles: IStyles = {};\r\n\r\n Object.keys(bps).forEach((bp) => {\r\n // preparing the className\r\n const shortNameClass = bps[bp].name;\r\n\r\n // just if have a percentage\r\n let nameClass = shortNameClass;\r\n if (shortNameClass.includes('%')) {\r\n nameClass = shortNameClass.replace(\r\n shortNameClass,\r\n percentageConverter(shortNameClass)\r\n );\r\n }\r\n\r\n const finalPrefix = prefix ? prefix + '-' : '';\r\n nameClass =\r\n finalPrefix +\r\n processors[directive].classPrefix +\r\n '-' +\r\n nameClass\r\n .replace(/\\//g, '\\\\/')\r\n .replace(/:/g, '\\\\:')\r\n .replace('@', '\\\\@')\r\n .split('.')\r\n .join('_');\r\n\r\n if (!intConfig.styles[nameClass]) {\r\n // Property and value\r\n let propAndVal;\r\n if (directive === 'flex') {\r\n propAndVal = bps[bp].value;\r\n const flexImportant = shortNameClass.includes('!')\r\n ? ';display:flex !important;'\r\n : ';display:flex;';\r\n\r\n // Searching a flex self inside. ['as' for 'align-self']\r\n const attrsFlexSelfs = flexAttrsSelf.filter((nameAttrFlex) =>\r\n shortNameClass.includes(nameAttrFlex + ':')\r\n );\r\n if (attrsFlexSelfs.length) {\r\n // if the items number of flex selft (+1) is diferrent so exists other flex attribute. Example: as:ce jc:ce\r\n if (attrsFlexSelfs.length + 1 !== shortNameClass.split(':').length) {\r\n propAndVal += flexImportant;\r\n }\r\n } else {\r\n propAndVal += flexImportant;\r\n }\r\n } else {\r\n propAndVal = prop + ':' + bps[bp].value;\r\n }\r\n\r\n let rule = '@media screen and ';\r\n let direct = false;\r\n if (!bp.includes('-')) {\r\n // no tiene until\r\n if (sizes[bp]) {\r\n rule += '(min-width: ' + sizes[bp] + 'px)';\r\n } else {\r\n rule = '.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}';\r\n direct = true;\r\n }\r\n } else {\r\n const bpSplited = bp.split('-');\r\n const bp1 = bpSplited[0];\r\n if (bp1) rule += '(min-width: ' + sizes[bp1] + 'px) and ';\r\n const bp2 = bpSplited[1];\r\n rule += '(max-width: ' + (sizes[bp2] - 1) + 'px)';\r\n }\r\n\r\n if (!direct) {\r\n rule += '{.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}}';\r\n }\r\n\r\n styles[nameClass] = rule;\r\n } else {\r\n styles[nameClass] = intConfig.styles[nameClass];\r\n }\r\n });\r\n return styles;\r\n};\r\n\r\nexport default createStyles;\r\n","import { IStyles } from './createStyles';\n\nconst replaceList = [\n ['/', ''],\n ['\\\\', '/'],\n ['/:', ':'],\n ['\\\\:', ':'],\n ['\\\\@', '@'],\n ['/@', '@'],\n];\n\nconst nameCleaner = (objStyles: IStyles): IStyles => {\n const obj: IStyles = {};\n for (const name in objStyles) {\n let newName = name;\n replaceList.forEach((reItem) => {\n newName = newName.split(reItem[0]).join(reItem[1]);\n });\n obj[newName] = objStyles[name];\n }\n return obj;\n};\n\nexport default nameCleaner;\n","import { TDirectiveName } from '../config/processors';\nimport insertRules from '../methods/insertRules';\nimport createStyles, { IStyles } from './createStyles';\nimport nameCleaner from './nameCleaner';\n\nexport interface IRBuildStyles {\n name: string;\n value: string;\n}\n\nexport interface IBpCals {\n [bpName: string]: IRBuildStyles;\n}\n\nexport interface IBuildCss {\n type: TDirectiveName;\n bps: IBpCals;\n deep: boolean;\n}\n\nconst buildCss = (data: IBuildCss): IStyles => {\n // creating the styles\n const objStyles = createStyles(data.type, data.bps);\n\n // Inserting CSS rules\n if (data.deep) {\n insertRules(objStyles);\n }\n\n // name classes cleaner\n return nameCleaner(objStyles);\n};\n\nexport default buildCss;\n","import prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\nimport calPercentage from '../helpers/calPercentage';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport getConfig from '../config/main';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildCols = (values: string, insertStyles = false): IStyles | Error => {\r\n let cols: number[];\r\n let bp;\r\n const bpCals: IBpCals = {};\r\n const config = getConfig();\r\n\r\n // Getting numbers\r\n let selectorName, propValue, paramPrepared;\r\n const directBp = Object.keys(config.breakpoints)[0];\r\n\r\n let err: boolean | Error = false;\r\n\r\n for (const item of values.split(' ')) {\r\n let param = item;\r\n selectorName = param;\r\n paramPrepared = prepareParam(param);\r\n bp = paramPrepared.breakPoints;\r\n param = paramPrepared.numbers;\r\n\r\n if (param.includes('/')) {\r\n const paramSplited = param.split('/');\r\n cols = [Number(paramSplited[0]), Number(paramSplited[1])];\r\n } else {\r\n if (paramPrepared.widthBp) {\r\n if (bp.includes('-')) {\r\n err = regError(\r\n 'SyntaxError',\r\n \"You can't determine a 'until breakpoint' when use the explicit columns max: \" +\r\n values\r\n );\r\n break;\r\n } else {\r\n cols = [Number(param), config.cols[bp] as number];\r\n }\r\n } else {\r\n cols = [Number(param), config.cols[directBp] as number];\r\n }\r\n }\r\n\r\n propValue = calPercentage(cols[0], cols[1]);\r\n if (paramPrepared.important) propValue += ' !important';\r\n\r\n bpCals[bp] = {\r\n name: selectorName,\r\n value: propValue,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'cols',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildCols;\r\n","import { flexAttrsSelf, flexProsAndVals } from '../config/flex';\r\nimport getConfig from '../config/main';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport { IStyles } from '../helpers/createStyles';\r\nimport prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\n\r\nconst buildFlex = (valFlex: string, insertStyles = false): IStyles | Error => {\r\n const bpCals: IBpCals = {};\r\n\r\n // Getting numbers\r\n let err: boolean | Error = false;\r\n const config = getConfig();\r\n const firstBp = Object.keys(config.breakpoints)[0];\r\n\r\n for (const param of valFlex.split(' ')) {\r\n let propVal;\r\n const paramPrepared = prepareParam(param);\r\n const bpNames = paramPrepared.breakPoints;\r\n const flexSplited = paramPrepared.numbers.split(':');\r\n const nameProp = flexSplited[0] as keyof typeof flexProsAndVals; // 'fc' o 'or'\r\n const valProp = flexSplited[1] as keyof typeof flexProsAndVals; // 'ce' o '1'\r\n let valAlias: string;\r\n\r\n if (!flexAttrsSelf.includes(nameProp)) {\r\n if (!flexProsAndVals[nameProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + nameProp + \"' in Flex vault.\"\r\n );\r\n break;\r\n }\r\n if (!flexProsAndVals[valProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + valProp + \"' in Flex vault.\"\r\n );\r\n break;\r\n }\r\n propVal =\r\n flexProsAndVals[nameProp].ruleCss +\r\n ':' +\r\n flexProsAndVals[valProp].ruleCss;\r\n valAlias = flexProsAndVals[valProp].classPrefix;\r\n } else {\r\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + valProp;\r\n valAlias = valProp;\r\n }\r\n\r\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\r\n if (paramPrepared.important) {\r\n propVal += ' !important';\r\n sufixBp += '!';\r\n }\r\n\r\n let selectorName =\r\n flexProsAndVals[nameProp].classPrefix + ':' + valAlias + sufixBp;\r\n\r\n if (!bpCals[bpNames]) {\r\n bpCals[bpNames] = {\r\n name: selectorName,\r\n value: propVal,\r\n };\r\n } else {\r\n if (selectorName.includes('@')) selectorName = selectorName.split('@')[0]; // just here because will be contact with the other className\r\n let prevName = bpCals[bpNames].name.split('@')[0];\r\n if (bpCals[bpNames].name.includes('!') && !prevName.includes('!'))\r\n prevName += '!';\r\n\r\n bpCals[bpNames].name = prevName + '-' + selectorName + sufixBp;\r\n bpCals[bpNames].value += ';' + propVal;\r\n }\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'flex',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildFlex;\r\n","import calPercentage from './calPercentage';\n\nconst relativeMeasures = ['%', 'rem', 'em', 'ex', 'vw', 'vh', 'pt', 'cm', 'pc'];\n\nconst processedNumber = (n: string) => {\n let nProcessed;\n if (n.includes('/')) {\n nProcessed = n.split('/');\n nProcessed = calPercentage(\n parseFloat(nProcessed[0]),\n parseFloat(nProcessed[1])\n );\n } else if (n === 'auto') {\n nProcessed = 'auto';\n } else {\n const relativeUnits = relativeMeasures.filter((unit) => {\n return n.includes(unit);\n });\n if (relativeUnits.length) {\n nProcessed = n;\n } else {\n nProcessed = n === '0' ? n : n + 'px';\n }\n }\n return nProcessed;\n};\n\nexport default processedNumber;\n","import { TDirectiveName } from '../config/processors';\nimport buildCss, { IBpCals } from './buildCss';\nimport { IStyles } from './createStyles';\nimport prepareParam from './prepareParam';\nimport processedNumber from './processedNumber';\n\nconst buildAttr = (\n values: string,\n directive: TDirectiveName,\n insertStyles = false\n): IStyles => {\n const bpCals: IBpCals = {};\n\n values.split(' ').forEach((param) => {\n const paramProcessed = prepareParam(param);\n const bpNames = paramProcessed.breakPoints;\n\n // processing number values\n let propValue = paramProcessed.numbers\n .split('-')\n .map((n) => processedNumber(n))\n .join(' ');\n if (paramProcessed.important) propValue += ' !important';\n bpCals[bpNames] = {\n name: param,\n value: propValue,\n };\n });\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: directive,\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildAttr;\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPad = (valPads: string, insertStyles = false) => {\r\n return buildAttr(valPads, 'pad', insertStyles);\r\n};\r\n\r\nexport default buildPad;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadTop = (valPadTop: string, insertStyles = false) => {\r\n return buildAttr(valPadTop, 'padt', insertStyles);\r\n};\r\n\r\nexport default buildPadTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadRight = (valPadRight: string, insertStyles = false) => {\r\n return buildAttr(valPadRight, 'padr', insertStyles);\r\n};\r\n\r\nexport default buildPadRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadBottom = (valPadBottom: string, insertStyles = false) => {\r\n return buildAttr(valPadBottom, 'padb', insertStyles);\r\n};\r\n\r\nexport default buildPadBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadLeft = (valPadLeft: string, insertStyles = false) => {\r\n return buildAttr(valPadLeft, 'padl', insertStyles);\r\n};\r\n\r\nexport default buildPadLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMar = (valMars: string, insertStyles = false) => {\r\n return buildAttr(valMars, 'mar', insertStyles);\r\n};\r\n\r\nexport default buildMar;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarTop = (valMarTop: string, insertStyles = false) => {\r\n return buildAttr(valMarTop, 'mart', insertStyles);\r\n};\r\n\r\nexport default buildMarTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarRight = (valMarRight: string, insertStyles = false) => {\r\n return buildAttr(valMarRight, 'marr', insertStyles);\r\n};\r\n\r\nexport default buildMarRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarBottom = (valMarBottom: string, insertStyles = false) => {\r\n return buildAttr(valMarBottom, 'marb', insertStyles);\r\n};\r\n\r\nexport default buildMarBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarLeft = (valMarLeft: string, insertStyles = false) => {\r\n return buildAttr(valMarLeft, 'marl', insertStyles);\r\n};\r\n\r\nexport default buildMarLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxWidth = (valMaxWidth: string, insertStyles = false) => {\r\n return buildAttr(valMaxWidth, 'mxw', insertStyles);\r\n};\r\n\r\nexport default buildMaxWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxHeight = (valMaxHeight: string, insertStyles = false) => {\r\n return buildAttr(valMaxHeight, 'mxh', insertStyles);\r\n};\r\n\r\nexport default buildMaxHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinWidth = (valMinWidth: string, insertStyles = false) => {\r\n return buildAttr(valMinWidth, 'miw', insertStyles);\r\n};\r\n\r\nexport default buildMinWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinHeight = (valMinHeight: string, insertStyles = false) => {\r\n return buildAttr(valMinHeight, 'mih', insertStyles);\r\n};\r\n\r\nexport default buildMinHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildHeight = (valHeight: string, insertStyles = false) => {\r\n return buildAttr(valHeight, 'hgt', insertStyles);\r\n};\r\n\r\nexport default buildHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildWidth = (valWidth: string, insertStyles = false) => {\r\n return buildAttr(valWidth, 'wdh', insertStyles);\r\n};\r\n\r\nexport default buildWidth;\r\n","const positionProsAndValsBase = {\r\n st: {\r\n ruleCss: 'static',\r\n classPrefix: 'st',\r\n },\r\n ab: {\r\n ruleCss: 'absolute',\r\n classPrefix: 'ab',\r\n },\r\n fi: {\r\n ruleCss: 'fixed',\r\n classPrefix: 'fi',\r\n },\r\n re: {\r\n ruleCss: 'relative',\r\n classPrefix: 're',\r\n },\r\n si: {\r\n ruleCss: 'sticky',\r\n classPrefix: 'si',\r\n },\r\n in: {\r\n ruleCss: 'initial',\r\n classPrefix: 'in',\r\n },\r\n ih: {\r\n ruleCss: 'inherit',\r\n classPrefix: 'ih',\r\n },\r\n};\r\n\r\nexport const positionProsAndVals = {\r\n ...positionProsAndValsBase,\r\n static: positionProsAndValsBase.st,\r\n absolute: positionProsAndValsBase.ab,\r\n fixed: positionProsAndValsBase.fi,\r\n relative: positionProsAndValsBase.re,\r\n sticky: positionProsAndValsBase.si,\r\n initial: positionProsAndValsBase.in,\r\n inherit: positionProsAndValsBase.ih,\r\n};\r\n","import getConfig from '../config/main';\r\nimport { positionProsAndVals } from '../config/position';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport { IStyles } from '../helpers/createStyles';\r\nimport prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\n\r\nconst buildPosition = (\r\n valPos: string,\r\n insertStyles = false\r\n): IStyles | Error => {\r\n const bpCals: IBpCals = {};\r\n\r\n // Getting numbers\r\n let err: boolean | Error = false;\r\n const config = getConfig();\r\n const firstBp = Object.keys(config.breakpoints)[0];\r\n\r\n for (const param of valPos.split(' ')) {\r\n let propVal;\r\n const paramPrepared = prepareParam(param);\r\n const bpNames = paramPrepared.breakPoints;\r\n const nameProp = paramPrepared.numbers as keyof typeof positionProsAndVals;\r\n\r\n if (!positionProsAndVals[nameProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + nameProp + \"' in Position vault.\"\r\n );\r\n break;\r\n }\r\n\r\n propVal = positionProsAndVals[nameProp].ruleCss;\r\n const className = positionProsAndVals[nameProp].classPrefix;\r\n\r\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\r\n\r\n if (paramPrepared.important) {\r\n propVal += ' !important';\r\n sufixBp += '!';\r\n }\r\n\r\n bpCals[bpNames] = {\r\n name: className + sufixBp,\r\n value: propVal,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'pos',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildPosition;\r\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildTop = (val: string, insertStyles = false) => {\n return buildAttr(val, 't', insertStyles);\n};\n\nexport default buildTop;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildRight = (val: string, insertStyles = false) => {\n return buildAttr(val, 'r', insertStyles);\n};\n\nexport default buildRight;\n","import buildAttr from '../helpers/buildAttr';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildBottom = (val: string, insertStyles = false): IStyles => {\r\n return buildAttr(val, 'b', insertStyles);\r\n};\r\n\r\nexport default buildBottom;\r\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildLeft = (val: string, insertStyles = false) => {\n return buildAttr(val, 'l', insertStyles);\n};\n\nexport default buildLeft;\n","const displayProsAndValsBase = {\n bl: {\n ruleCss: 'block',\n classPrefix: 'bl',\n },\n il: {\n ruleCss: 'inline',\n classPrefix: 'il',\n },\n ib: {\n ruleCss: 'inline-block',\n classPrefix: 'ib',\n },\n fx: {\n ruleCss: 'flex',\n classPrefix: 'fx',\n },\n if: {\n ruleCss: 'inline-flex',\n classPrefix: 'if',\n },\n no: {\n ruleCss: 'none',\n classPrefix: 'no',\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in',\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih',\n },\n};\n\nexport const displayProsAndVals = {\n ...displayProsAndValsBase,\n block: displayProsAndValsBase.bl,\n inline: displayProsAndValsBase.il,\n 'inline-block': displayProsAndValsBase.ib,\n flex: displayProsAndValsBase.fx,\n 'inline-flex': displayProsAndValsBase.if,\n none: displayProsAndValsBase.no,\n initial: displayProsAndValsBase.in,\n inherit: displayProsAndValsBase.ih,\n};\n","import getConfig from '../config/main';\nimport { displayProsAndVals } from '../config/display';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildDisplay = (\n valDisplay: string,\n insertStyles = false\n): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valDisplay.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const nameProp = paramPrepared.numbers as keyof typeof displayProsAndVals;\n\n if (!displayProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in display vault.\"\n );\n break;\n }\n\n propVal = displayProsAndVals[nameProp].ruleCss;\n const className = displayProsAndVals[nameProp].classPrefix;\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!';\n }\n\n bpCals[bpNames] = {\n name: className + sufixBp,\n value: propVal,\n };\n }\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'd',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildDisplay;\n","import buildCols from '../methods/buildCols';\nimport buildFlex from '../methods/buildFlex';\nimport buildPad from '../methods/buildPad';\nimport buildPadTop from '../methods/buildPadTop';\nimport buildPadRight from '../methods/buildPadRight';\nimport buildPadBottom from '../methods/buildPadBottom';\nimport buildPadLeft from '../methods/buildPadLeft';\nimport buildMar from '../methods/buildMar';\nimport buildMarTop from '../methods/buildMarTop';\nimport buildMarRight from '../methods/buildMarRight';\nimport buildMarBottom from '../methods/buildMarBottom';\nimport buildMarLeft from '../methods/buildMarLeft';\nimport buildMaxWidth from '../methods/buildMaxWidth';\nimport buildMaxHeight from '../methods/buildMaxHeight';\nimport buildMinWidth from '../methods/buildMinWidth';\nimport buildMinHeight from '../methods/buildMinHeight';\nimport buildHeight from '../methods/buildHeight';\nimport buildWidth from '../methods/buildWidth';\nimport buildPosition from '../methods/buildPosition';\nimport buildTop from '../methods/buildTop';\nimport buildRight from '../methods/buildRight';\nimport buildBottom from '../methods/buildBottom';\nimport buildLeft from '../methods/buildLeft';\n\nimport { IStyles } from '../helpers/createStyles';\nimport buildDisplay from '../methods/buildDisplay';\n\ntype TDirectiveNameBase =\n | 'cols'\n | 'pad'\n | 'padt'\n | 'padr'\n | 'padb'\n | 'padl'\n | 'mar'\n | 'mart'\n | 'marr'\n | 'marb'\n | 'marl'\n | 'flex'\n | 'mxw'\n | 'mxh'\n | 'miw'\n | 'mih'\n | 'wdh'\n | 'hgt'\n | 'pos'\n | 't'\n | 'r'\n | 'b'\n | 'l'\n | 'd';\n\ntype TDirectiveNameExtended =\n | 'c'\n | 'fx'\n | 'p'\n | 'padding'\n | 'pt'\n | 'padding-top'\n | 'pr'\n | 'padding-right'\n | 'pb'\n | 'padding-bottom'\n | 'pl'\n | 'padding-left'\n | 'm'\n | 'margin'\n | 'mt'\n | 'margin-top'\n | 'mr'\n | 'margin-right'\n | 'mb'\n | 'margin-bottom'\n | 'ml'\n | 'margin-left'\n | 'w'\n | 'width'\n | 'h'\n | 'height'\n | 'max-width'\n | 'max-height'\n | 'min-width'\n | 'min-height'\n | 'position'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'display';\n\nexport type TDirectiveName = TDirectiveNameBase | TDirectiveNameExtended;\n\nexport interface IProcessor {\n build: (values: string, insertStyles: boolean) => IStyles | Error;\n ruleCss: string;\n classPrefix: string;\n}\n\nconst processorsBase: Record = {\n cols: {\n build: buildCols,\n ruleCss: 'width',\n classPrefix: 'c',\n },\n\n // Paddings\n pad: {\n build: buildPad,\n ruleCss: 'padding',\n classPrefix: 'p',\n },\n padt: {\n build: buildPadTop,\n ruleCss: 'padding-top',\n classPrefix: 'pt',\n },\n padr: {\n build: buildPadRight,\n ruleCss: 'padding-right',\n classPrefix: 'pr',\n },\n padb: {\n build: buildPadBottom,\n ruleCss: 'padding-bottom',\n classPrefix: 'pb',\n },\n padl: {\n build: buildPadLeft,\n ruleCss: 'padding-left',\n classPrefix: 'pl',\n },\n\n // Margin\n mar: {\n build: buildMar,\n ruleCss: 'margin',\n classPrefix: 'm',\n },\n mart: {\n build: buildMarTop,\n ruleCss: 'margin-top',\n classPrefix: 'mt',\n },\n marr: {\n build: buildMarRight,\n ruleCss: 'margin-right',\n classPrefix: 'mr',\n },\n marb: {\n build: buildMarBottom,\n ruleCss: 'margin-bottom',\n classPrefix: 'mb',\n },\n marl: {\n build: buildMarLeft,\n ruleCss: 'margin-left',\n classPrefix: 'ml',\n },\n\n // Flex Box\n flex: {\n build: buildFlex,\n ruleCss: 'display: flex',\n classPrefix: 'fx',\n },\n\n // Max & Min Width & Height\n mxw: {\n build: buildMaxWidth,\n ruleCss: 'max-width',\n classPrefix: 'mxw',\n },\n\n mxh: {\n build: buildMaxHeight,\n ruleCss: 'max-height',\n classPrefix: 'mxh',\n },\n\n miw: {\n build: buildMinWidth,\n ruleCss: 'min-width',\n classPrefix: 'miw',\n },\n\n mih: {\n build: buildMinHeight,\n ruleCss: 'min-height',\n classPrefix: 'mih',\n },\n\n // Width & Height\n wdh: {\n build: buildWidth,\n ruleCss: 'width',\n classPrefix: 'w',\n },\n\n hgt: {\n build: buildHeight,\n ruleCss: 'height',\n classPrefix: 'h',\n },\n\n // Position\n pos: {\n build: buildPosition,\n ruleCss: 'position',\n classPrefix: 'pos',\n },\n t: {\n build: buildTop,\n ruleCss: 'top',\n classPrefix: 't',\n },\n r: {\n build: buildRight,\n ruleCss: 'right',\n classPrefix: 'r',\n },\n b: {\n build: buildBottom,\n ruleCss: 'bottom',\n classPrefix: 'b',\n },\n l: {\n build: buildLeft,\n ruleCss: 'left',\n classPrefix: 'l',\n },\n d: {\n build: buildDisplay,\n ruleCss: 'display',\n classPrefix: 'd',\n }\n};\n\nexport const processors: Record = {\n ...processorsBase,\n c: processorsBase.cols,\n fx: processorsBase.flex,\n p: processorsBase.pad,\n padding: processorsBase.pad,\n pt: processorsBase.padt,\n 'padding-top': processorsBase.padt,\n pr: processorsBase.padr,\n 'padding-right': processorsBase.padr,\n pb: processorsBase.padb,\n 'padding-bottom': processorsBase.padb,\n pl: processorsBase.padl,\n 'padding-left': processorsBase.padl,\n m: processorsBase.mar,\n margin: processorsBase.mar,\n mt: processorsBase.mart,\n 'margin-top': processorsBase.mart,\n mr: processorsBase.marr,\n 'margin-right': processorsBase.marr,\n mb: processorsBase.marb,\n 'margin-bottom': processorsBase.marb,\n ml: processorsBase.marl,\n 'margin-left': processorsBase.marl,\n w: processorsBase.wdh,\n width: processorsBase.wdh,\n h: processorsBase.hgt,\n height: processorsBase.hgt,\n 'max-width': processorsBase.mxw,\n 'max-height': processorsBase.mxh,\n 'min-width': processorsBase.miw,\n 'min-height': processorsBase.mih,\n position: processorsBase.pos,\n top: processorsBase.t,\n right: processorsBase.r,\n bottom: processorsBase.b,\n left: processorsBase.l,\n display: processorsBase.d,\n};\n","import { processors, TDirectiveName } from '../config/processors';\r\n\r\nconst getParameters = (\r\n Node: HTMLElement | Element\r\n): Partial> => {\r\n const params: Partial> = {};\r\n const attrs = Node.attributes;\r\n const paramNames = Object.keys(processors);\r\n Array.prototype.forEach.call(attrs, (attr) => {\r\n if (paramNames.includes(attr.name)) {\r\n if (attr.value !== '')\r\n params[attr.name as TDirectiveName] = attr.value\r\n .trim()\r\n .split(' ')\r\n .filter((item: string) => item)\r\n .join(' ');\r\n }\r\n });\r\n return params;\r\n};\r\n\r\nexport default getParameters;\r\n","import { processors, TDirectiveName } from '../config/processors';\nimport { IStyles } from '../helpers/createStyles';\n\nexport interface IBuildResult {\n [prop: string]: IStyles | boolean;\n}\n\nconst build = (\n obj: Partial>,\n insertStyles = false\n): Partial | Error => {\n const rObj: Partial = {};\n let err: Error | boolean = false;\n for (const prop in obj) {\n const propData = processors[prop as TDirectiveName];\n const objStyles: IStyles | Error = propData.build(\n obj[prop as TDirectiveName] as string,\n insertStyles\n );\n if (objStyles instanceof Error) {\n err = objStyles;\n break;\n } else {\n rObj[prop] = objStyles;\n }\n }\n\n if (err) return err;\n return rObj;\n};\n\nexport default build;\n","import getConfig from '../config/main';\n\nconst addClasses = (\n Node: HTMLElement | Element,\n classesNames: string,\n overwrite?: boolean\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n const names = classesNames.split(' ');\n let classesToAdd: string[] = names;\n if (!overwrite) {\n classesToAdd = names.filter((name) => !Node.classList.contains(name));\n if (!classesToAdd.length) {\n resolve();\n return;\n }\n }\n\n const obsNode = new config.context.MutationObserver((mutations) => {\n const target = mutations[0].target;\n const currentClasses = (target as Element).className.split(' ');\n const containsAll = names.every((element) =>\n currentClasses.includes(element)\n );\n if (containsAll) {\n obsNode.disconnect();\n resolve();\n }\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: ['class'],\n characterData: false,\n });\n\n if (overwrite) {\n Node.className = classesNames;\n } else {\n const space = Node.hasAttribute('class') ? ' ' : '';\n Node.className += space + classesToAdd.join(' ');\n }\n });\n};\n\nexport default addClasses;\n","import getConfig from '../config/main';\n\nexport const removeProp = (\n Node: HTMLElement | Element,\n propName: string,\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n if (!Node.hasAttribute(propName)) {\n resolve();\n return;\n }\n const obsNode = new context.MutationObserver(() => {\n obsNode.disconnect();\n resolve();\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: [propName],\n characterData: false,\n });\n Node.removeAttribute(propName);\n });\n};\n\nexport const removeProps = (\n Node: HTMLElement | Element,\n propNames: string[],\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n const promises = propNames.map((name) => removeProp(Node, name, context));\n Promise.all(promises).then(() => resolve());\n });\n};\n\nconst removeAttr = (\n Node: HTMLElement | Element,\n propNames: string | string[]\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n if (Array.isArray(propNames)) {\n removeProps(Node, propNames, config.context).then(resolve);\n } else {\n removeProp(Node, propNames, config.context).then(resolve);\n }\n });\n};\n\nexport default removeAttr;\n","import getConfig from '../config/main';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nexport interface IEventReady {\n node: HTMLElement | Element;\n directive: string | string[];\n classes: string;\n resolve: (value: void | Error | PromiseLike) => void;\n}\n\nconst eventReady = ({ node, directive, classes, resolve }: IEventReady) => {\n const config = getConfig();\n removeAttr(node, directive)\n .then(() => addClasses(node, classes))\n .then(() => {\n resolve();\n const event = new config.context.CustomEvent('layout:ready');\n node.dispatchEvent(event);\n });\n};\n\nexport default eventReady;\n","import { IStyles } from '../helpers/createStyles';\nimport regError from '../helpers/regError';\nimport build, { IBuildResult } from './build';\nimport getParameters from './getParameters';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst set = (\n Node: HTMLElement | Element,\n parameters?: Partial>\n): Promise => {\n return new Promise((resolve, reject) => {\n const params = parameters || getParameters(Node);\n const arrParams = Object.keys(params);\n if (!arrParams.length) {\n const err = regError(\n 'Parameter Missing',\n \"don't exists any parameter to process\",\n Node\n );\n reject(err);\n return;\n }\n\n const toBuild: Partial> = {};\n for (const prop in params) {\n toBuild[prop as TDirectiveName] = params[prop as TDirectiveName];\n }\n\n // creating classes names and inserting that classes to the core\n const classesObj = build(toBuild as Record, true);\n if (classesObj instanceof Error) {\n reject(classesObj);\n return;\n }\n\n // adding classes\n const classes = classesObj as Partial;\n const classesNames = Object.keys(classes)\n .map((name: string) => Object.keys(classes[name] as IStyles))\n .flat()\n .join(' ');\n\n // removing unnecessary props\n eventReady({\n node: Node,\n directive: arrParams,\n classes: classesNames,\n resolve,\n });\n });\n};\n\nexport default set;\n","import regError from '../helpers/regError';\nimport buildFlex from './buildFlex';\nimport eventReady from '../helpers/eventReady';\n\nconst setFlex = (\n Node: HTMLElement | Element,\n flexValues?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = flexValues || Node.getAttribute('flex');\n if (!values) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"flex\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildFlex(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'flex',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setFlex;\n","import regError from '../helpers/regError';\nimport buildCols from './buildCols';\nimport eventReady from '../helpers/eventReady';\n\nconst setCols = (\n Node: HTMLElement | Element,\n columns?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = columns || Node.getAttribute('cols');\n if (!values) {\n const err = regError(\n 'Empty',\n \"The value of the directive 'cols' is empty\",\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildCols(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'cols',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setCols;\n","import buildAttr from '../helpers/buildAttr';\nimport regError from '../helpers/regError';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst setAttr = (\n Node: HTMLElement | Element,\n directive: TDirectiveName,\n values?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const directiveValues = values || Node.getAttribute(directive);\n if (!directiveValues) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"' + directive + '\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildAttr(directiveValues, directive, true);\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive,\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setAttr;\n","import setAttr from './setAttr';\r\n\r\nconst setHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'hgt', values);\r\n};\r\n\r\nexport default setHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marb', values);\r\n};\r\n\r\nexport default setMarBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marl', values);\r\n};\r\n\r\nexport default setMarLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marr', values);\r\n};\r\n\r\nexport default setMarRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMar = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mar', values);\r\n};\r\n\r\nexport default setMar;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mart', values);\r\n};\r\n\r\nexport default setMarTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxw', values);\r\n};\r\n\r\nexport default setMaxWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mih', values);\r\n};\r\n\r\nexport default setMinHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'miw', values);\r\n};\r\n\r\nexport default setMinWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padb', values);\r\n};\r\n\r\nexport default setPadBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padl', values);\r\n};\r\n\r\nexport default setPadLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padr', values);\r\n};\r\n\r\nexport default setPadRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPad = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'pad', values);\r\n};\r\n\r\nexport default setPad;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padt', values);\r\n};\r\n\r\nexport default setPadTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'wdh', values);\r\n};\r\n\r\nexport default setWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxh', values);\r\n};\r\n\r\nexport default setMaxHeight;\r\n","import setAttr from './setAttr';\n\nconst setPosition = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'pos', values);\n};\n\nexport default setPosition;\n","import setAttr from './setAttr';\n\nconst setTop = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 't', values);\n};\n\nexport default setTop;\n","import setAttr from './setAttr';\n\nconst setRight = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'r', values);\n};\n\nexport default setRight;\n","import setAttr from './setAttr';\n\nconst setBottom = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'b', values);\n};\n\nexport default setBottom;\n","import setAttr from './setAttr';\n\nconst setLeft = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'l', values);\n};\n\nexport default setLeft;\n","import { TDirectiveName } from './../config/processors';\r\nimport { processors } from '../config/processors';\r\nimport addClasses from '../utils/addClasses';\r\nimport removeAttr from '../utils/removeAttr';\r\n\r\nconst reset = (Node: HTMLElement | Element): Promise => {\r\n return new Promise((resolve) => {\r\n const classPrefixes = new Set(\r\n Object.keys(processors).map(\r\n (item) => processors[item as TDirectiveName].classPrefix\r\n )\r\n );\r\n const layouterClasses = [...classPrefixes];\r\n const restClass = Node.className.split(' ').filter((name) => {\r\n if (!name.includes('-')) {\r\n return true;\r\n } else {\r\n const findClass = layouterClasses.find((item) => {\r\n const nLength = item.length;\r\n const namePrefix = name.substring(0, nLength + 1);\r\n return namePrefix === item + '-';\r\n });\r\n return !findClass;\r\n }\r\n });\r\n\r\n if (restClass.length) {\r\n const classesName = restClass.join(' ');\r\n addClasses(Node, classesName, true).then(() => {\r\n resolve();\r\n });\r\n } else {\r\n removeAttr(Node, 'class').then(() => {\r\n resolve();\r\n });\r\n }\r\n });\r\n};\r\n\r\nexport default reset;\r\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\n\nconst searchAndProcess = (\n layouter: ILayouter,\n context: Document | HTMLElement | Element\n) => {\n return new Promise((resolve) => {\n const props = Object.keys(processors);\n const attrs = props.map((prop) => `[${prop}]`).join(', ');\n const nodes = context.querySelectorAll(attrs);\n if (!nodes.length) {\n resolve(layouter);\n return;\n }\n\n const setNodes = new Set();\n Array.prototype.forEach.call(nodes, (itemNode) => {\n setNodes.add(itemNode);\n });\n const promises: Promise[] = [];\n setNodes.forEach((node) => {\n promises.push(layouter.set(node as Element | HTMLElement));\n });\n Promise.all(promises).then(resolve);\n });\n};\n\nexport default searchAndProcess;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\nimport getConfig from '../config/main';\nimport searchAndProcess from './searchAndProcess';\n\nconst mainObserver = (layouter: ILayouter) => {\n const config = getConfig();\n const props = Object.keys(processors);\n const obsBody = new layouter.context.MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n if (!mutation.addedNodes.length) {\n continue;\n }\n mutation.addedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n searchAndProcess(layouter, node);\n }\n });\n } else if (mutation.type === 'attributes') {\n const node = mutation.target;\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n }\n }\n }\n });\n const observerOptions = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: props,\n characterData: false,\n };\n obsBody.observe(config.context.document.body, observerOptions);\n};\n\nexport default mainObserver;\n","import { IConfig, IConfigUser, setConfig, updateConfig } from './config/main';\nimport getParameters from './methods/getParameters';\n\nimport build from './methods/build';\nimport buildCols from './methods/buildCols';\nimport buildFlex from './methods/buildFlex';\nimport buildPad from './methods/buildPad';\nimport buildPadTop from './methods/buildPadTop';\nimport buildPadRight from './methods/buildPadRight';\nimport buildPadBottom from './methods/buildPadBottom';\nimport buildPadLeft from './methods/buildPadLeft';\nimport buildMar from './methods/buildMar';\nimport buildMarTop from './methods/buildMarTop';\nimport buildMarRight from './methods/buildMarRight';\nimport buildMarBottom from './methods/buildMarBottom';\nimport buildMarLeft from './methods/buildMarLeft';\nimport buildMaxWidth from './methods/buildMaxWidth';\nimport buildMaxHeight from './methods/buildMaxHeight';\nimport buildMinWidth from './methods/buildMinWidth';\nimport buildMinHeight from './methods/buildMinHeight';\nimport buildHeight from './methods/buildHeight';\nimport buildWidth from './methods/buildWidth';\nimport buildPosition from './methods/buildPosition';\nimport buildTop from './methods/buildTop';\nimport buildRight from './methods/buildRight';\nimport buildBottom from './methods/buildBottom';\nimport buildLeft from './methods/buildLeft';\n\nimport set from './methods/set';\nimport setFlex from './methods/setFlex';\nimport setCols from './methods/SetCols';\nimport setHeight from './methods/setHeight';\nimport setMarBottom from './methods/setMarBottom';\nimport setMarLeft from './methods/setMarLeft';\nimport setMarRight from './methods/setMarRight';\nimport setMar from './methods/setMar';\nimport setMarTop from './methods/setMarTop';\nimport setMaxWidth from './methods/setMaxWidth';\nimport setMinHeight from './methods/setMinHeight';\nimport setMinWidth from './methods/setMinWidth';\nimport setPadBottom from './methods/setPadBottom';\nimport setPadLeft from './methods/setPadLeft';\nimport setPadRight from './methods/setPadRight';\nimport setPad from './methods/setPad';\nimport setPadTop from './methods/setPadTop';\nimport setWidth from './methods/setWidth';\nimport setMaxHeight from './methods/setMaxHeight';\nimport setPosition from './methods/setPosition';\nimport setTop from './methods/setTop';\nimport setRight from './methods/setRight';\nimport setBottom from './methods/setBottom';\nimport setLeft from './methods/setLeft';\n\nimport insertRules from './methods/insertRules';\nimport reset from './methods/reset';\n\nimport { IStyles } from './helpers/createStyles';\nimport { IBuildResult } from './methods/build';\nimport searchAndProcess from './helpers/searchAndProcess';\nimport mainObserver from './helpers/mainObserver';\nimport { TDirectiveName } from './config/processors';\n\nexport interface ILayouter extends IConfig {\n getParameters: (\n Node: HTMLElement | Element\n ) => Partial>;\n updateConfig: (userConfig: Partial>) => IConfig;\n build: (\n obj: Partial>,\n insertStyles?: boolean\n ) => Partial | Error;\n buildCols: (valCols: string, insertStyles?: boolean) => IStyles | Error;\n buildFlex: (valFlex: string, insertStyles?: boolean) => IStyles | Error;\n buildPad: (valPads: string, insertStyles?: boolean) => IStyles;\n buildPadTop: (valPadTop: string, insertStyles?: boolean) => IStyles;\n buildPadRight: (valPadRight: string, insertStyles?: boolean) => IStyles;\n buildPadBottom: (valPadBottom: string, insertStyles?: boolean) => IStyles;\n buildPadLeft: (valPadLeft: string, insertStyles?: boolean) => IStyles;\n buildMar: (valMars: string, insertStyles?: boolean) => IStyles;\n buildMarTop: (valMarTop: string, insertStyles?: boolean) => IStyles;\n buildMarRight: (valMarRight: string, insertStyles?: boolean) => IStyles;\n buildMarBottom: (valMarBottom: string, insertStyles?: boolean) => IStyles;\n buildMarLeft: (valMarLeft: string, insertStyles?: boolean) => IStyles;\n buildMaxWidth: (valMaxWidth: string, insertStyles?: boolean) => IStyles;\n buildMaxHeight: (valMaxHeight: string, insertStyles?: boolean) => IStyles;\n buildMinWidth: (valMinWidth: string, insertStyles?: boolean) => IStyles;\n buildMinHeight: (valMinHeight: string, insertStyles?: boolean) => IStyles;\n buildHeight: (valHeight: string, insertStyles?: boolean) => IStyles;\n buildWidth: (valWidth: string, insertStyles?: boolean) => IStyles;\n buildPosition: (\n valPosition: string,\n insertStyles?: boolean\n ) => IStyles | Error;\n buildTop: (valTop: string, insertStyles?: boolean) => IStyles | Error;\n buildRight: (valRight: string, insertStyles?: boolean) => IStyles | Error;\n buildBottom: (valBottom: string, insertStyles?: boolean) => IStyles | Error;\n buildLeft: (valLeft: string, insertStyles?: boolean) => IStyles | Error;\n\n set: (\n Node: HTMLElement | Element,\n parameters?: Partial>\n ) => Promise;\n setCols: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setFlex: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMar: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPad: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPosition: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n setTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n insertRules: (objStyles: IStyles) => void;\n reset: (Node: HTMLElement | Element) => Promise;\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouter: ILayouter;\n }\n}\n\nconst layouter = (\n context: Window & typeof globalThis,\n userConfig: Partial = {}\n): ILayouter => {\n const config = setConfig(context, userConfig);\n\n const instance = {\n ...config,\n getParameters,\n updateConfig,\n insertRules,\n build,\n buildCols,\n buildFlex,\n buildPad,\n buildPadTop,\n buildPadRight,\n buildPadBottom,\n buildPadLeft,\n buildMar,\n buildMarTop,\n buildMarRight,\n buildMarBottom,\n buildMarLeft,\n buildMaxWidth,\n buildMaxHeight,\n buildMinWidth,\n buildMinHeight,\n buildHeight,\n buildWidth,\n set,\n setCols,\n setFlex,\n setMar,\n setMarTop,\n setMarRight,\n setMarBottom,\n setMarLeft,\n setPad,\n setPadTop,\n setPadRight,\n setPadBottom,\n setPadLeft,\n setWidth,\n setMinWidth,\n setMaxWidth,\n setHeight,\n setMinHeight,\n setMaxHeight,\n reset,\n buildPosition,\n buildTop,\n buildRight,\n buildBottom,\n buildLeft,\n setPosition,\n setTop,\n setRight,\n setBottom,\n setLeft,\n };\n\n // Auto init process\n searchAndProcess(instance, context.document).then(() => {\n if (instance.ready) instance.ready(instance);\n mainObserver(instance);\n });\n\n return instance;\n};\n\nif (typeof window !== 'undefined' && typeof exports === 'undefined') {\n window.layouter = layouter(window);\n}\n\nexport default layouter;\n"],"names":["config"],"mappings":"AAkBA,MAAM,kBAAkB,CACtB,QACA,aACmB;AACnB,QAAM,QAAwB,CAAA;AAE9B,MAAI,aAAa,SAAS;AACxB,WAAO,KAAK,MAAM,EACf,IAAI,CAAC,OAAe;AACZ,aAAA;AAAA,QACL,OAAO;AAAA,QACP,OAAO,OAAO,IAAI;AAAA,MAAA;AAAA,IACpB,CACD,EACA,KAAK,CAAC,GAAgB,MACrB,EAAE,QAAQ,EAAE,QAAQ,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,CACnD,EACC,QAAQ,CAAC,IAAiB,UAAkB;AAC3C,YAAM,GAAG,SAAS,CAAC,QAAQ,IAAI,OAAO,GAAG,OAAO;AAAA,IAAA,CACjD;AAAA,EAAA,OACE;AACL,WAAO,KAAK,MAAM,EAAE,QAAQ,CAAC,OAAO;AAC5B,YAAA,MAAM,OAAO,IAAI;AAAA,IAAA,CACxB;AAAA,EACH;AAEO,SAAA;AACT;ACzBA,MAAM,oBAAoB,CAAC;AAAA,EACzB,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAC6C;AAC7C,MAAI,cAAc,QAAQ,SAAS,eAAe,cAAc,EAAE;AAClE,MAAI,CAAC,aAAa;AACF,kBAAA,QAAQ,SAAS,cAAc,OAAO;AACpD,gBAAY,YAAY,QAAQ,SAAS,eAAe,EAAE,CAAC;AAC3D,UAAM,aAAa,KAAK;AAChB,YAAA;AAAA,WACD;AACQ,mBAAA,aAAa,aAAa,IAAI;AACzC;AAAA,WACG;AACE,aAAA,cACD,WAAW,aAAa,aAAa,KAAK,WAAW,IACrD,WAAW,YAAY,WAAW;AACtC;AAAA,WACG;AACH,aAAK,YAAY,WAAW;AAC5B;AAAA;AAEJ,gBAAY,KAAK,cAAc;AAAA,EACjC;AAEI,MAAA;AACJ,MAAI,YAAY;AACL,aAAA;AA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ACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAIF,mBAAiB,UAAU,QAAQ,QAAQ,EAAE,KAAK,MAAM;AACtD,QAAI,SAAS;AAAO,eAAS,MAAM,QAAQ;AAC3C,iBAAa,QAAQ;AAAA,EAAA,CACtB;AAEM,SAAA;AACT;AAEA,IAAI,OAAO,WAAW,eAAe,OAAO,YAAY,aAAa;AAC5D,SAAA,WAAW,SAAS,MAAM;AACnC;;"} \ No newline at end of file diff --git a/dist/layouter.umd.js b/dist/layouter.umd.js index d84d8c3..b5dc5e8 100644 --- a/dist/layouter.umd.js +++ b/dist/layouter.umd.js @@ -1,2 +1,2 @@ -(function(E,j){typeof exports=="object"&&typeof module!="undefined"?module.exports=j():typeof define=="function"&&define.amd?define(j):(E=typeof globalThis!="undefined"?globalThis:E||self,E.Layouter=j())})(this,function(){"use strict";const E=(e,s)=>{const r={};return s==="width"?Object.keys(e).map(t=>({alias:t,width:e[t].width})).sort((t,n)=>t.width>n.width?1:n.width>t.width?-1:0).forEach((t,n)=>{r[t.alias]=n?e[t.alias][s]:0}):Object.keys(e).forEach(t=>{r[t]=e[t][s]}),r},j=({bridge:e,bp:s,insertionType:r,node:t,context:n})=>{let i=n.document.getElementById("layouter-"+s);if(!i){i=n.document.createElement("style"),i.appendChild(n.document.createTextNode(""));const l=t.parentNode;switch(r){case"before":l.insertBefore(i,t);break;case"after":t.nextSibling?l.insertBefore(i,t.nextSibling):l.appendChild(i);break;case"append":t.appendChild(i);break}i.id="layouter-"+s}let o;return e?o={method:i.sheet,node:i}:o={method:{insertRule:l=>{i.appendChild(n.document.createTextNode(l))},rules:[]},node:i},o},he=({breakpoints:e,bridge:s,scope:r,context:t})=>{const n=r||{};return Object.keys(e).forEach(i=>{n[i]||(n[i]=j({bridge:s,bp:i,insertionType:"append",node:t.document.body,context:t}))}),n},xe=(e,s)=>{const r={};return Object.keys(s).forEach(t=>r[t]=e[t]),r},ge="1.4.0";let M={prefix:"",breakpoints:{xs:{width:360,cols:15},sm:{width:600,cols:25},md:{width:900,cols:31},lg:{width:1200,cols:41},xlg:{width:1536,cols:51}},bridge:!0,debug:!0},x;const N=({bps:e,bridge:s,scope:r,context:t})=>{const n=E(e,"width"),i=xe(e,n);return{sizes:n,cols:E(e,"cols"),scope:he({breakpoints:i,bridge:s,scope:r,context:t}),breakpoints:i}},Pe=(e,s={})=>{const r=e.layouterConfig||{};return M={...M,...s,...r},x={context:e,...M,...N({bps:M.breakpoints,bridge:M.bridge,context:e}),styles:{},version:ge},x},g=()=>x,we=(e,s)=>{x.styles[e]=s},Ce=e=>(x={...x,...e},e.breakpoints&&(x={...x,...N({bps:x.breakpoints,bridge:x.bridge,scope:x.scope,context:x.context})}),x),B=e=>{let s,r=e,t=!1;const n=r.includes("@");if(n){const i=r.split("@");r=i[0],s=i[1]}else{const i=g();s=Object.keys(i.breakpoints)[0]}return e.includes("!")&&(t=!0,s=s.replace(/!/g,""),r=r.replace(/!/g,"")),{widthBp:n,numbers:r,breakPoints:s,important:t}},y=(e,s,r)=>{const t=new Error;return t.name=e,t.message=s,g().debug&&(console.error(t),r&&console.log(r)),t},R=(e,s)=>{const r=e*100/s;return(r-Math.floor(r)!==0?r.toFixed(3):r)+"%"},ye=e=>{const s=e.replace(/!/g,""),r=s.indexOf("@"),t=g(),n=t.scope,i=t.bridge,o=t.context;if(r===-1){const u=Object.keys(t.breakpoints)[0];return n[u]}const l=s.substring(r+1);if(!l.includes("-"))return n[l];if(l.substring(0,1)==="-"){if(n[l])return n[l];const u=l.substring(1);return n[l]=j({bridge:i,bp:l,insertionType:"before",node:n[u].node,context:o}),n[l]}if(n[l])return n[l];const a=l.split("-")[0];return n[l]=j({bridge:i,bp:l,insertionType:"after",node:n[a].node,context:o}),n[l]},H=e=>{const s=g();for(const r in e)if(!s.styles[r]){const t=ye(r),n=e[r],i=t.method.rules;t.method.insertRule(n,i?i.length:0),we(r,n)}},d={jc:{ruleCss:"justify-content",classPrefix:"jc"},ai:{ruleCss:"align-items",classPrefix:"ai"},ce:{ruleCss:"center",classPrefix:"ce"},fs:{ruleCss:"flex-start",classPrefix:"fs"},fe:{ruleCss:"flex-end",classPrefix:"fe"},sb:{ruleCss:"space-between",classPrefix:"sb"},sa:{ruleCss:"space-around",classPrefix:"sa"},fw:{ruleCss:"flex-wrap",classPrefix:"fw"},nw:{ruleCss:"nowrap",classPrefix:"nw"},w:{ruleCss:"wrap",classPrefix:"w"},wr:{ruleCss:"wrap-reverse",classPrefix:"wr"},fd:{ruleCss:"flex-direction",classPrefix:"fd"},r:{ruleCss:"row",classPrefix:"r"},rr:{ruleCss:"row-reverse",classPrefix:"rr"},co:{ruleCss:"column",classPrefix:"co"},cor:{ruleCss:"column-reverse",classPrefix:"co"},au:{ruleCss:"auto",classPrefix:"au"},st:{ruleCss:"stretch",classPrefix:"st"},bl:{ruleCss:"baseline",classPrefix:"bl"},in:{ruleCss:"initial",classPrefix:"in"},ih:{ruleCss:"inherit",classPrefix:"ih"}},S={fg:{ruleCss:"flex-grow",classPrefix:"fg"},fh:{ruleCss:"flex-shrink",classPrefix:"fh"},as:{ruleCss:"align-self",classPrefix:"as"},or:{ruleCss:"order",classPrefix:"or"}},W={...S,"flex-grow":S.fg,"flex-shrink":S.fh,"align-self":S.as,order:S.or},A={...d,...W,"justify-content":d.jc,"align-items":d.ai,center:d.ce,"flex-start":d.fs,"flex-end":d.fe,"space-between":d.sb,"space-around":d.fs,"flex-wrap":d.fw,nowrap:d.nw,w:d.w,"wrap-reverse":d.wr,"flex-direction":d.fd,row:d.r,"row-reverse":d.rr,column:d.co,"column-reverse":d.cor,auto:d.au,stretch:d.st,baseline:d.bl,initial:d.in,inherit:d.ih},z=Object.keys(W),ke=e=>"0\xAF"+e.replace("%",""),ve=(e,s)=>{const r=g(),t=r.sizes,n=r.prefix,i=v[e].ruleCss,o={};return Object.keys(s).forEach(l=>{const a=s[l].name;let u=a;if(a.includes("%")&&(u=a.replace(a,ke(a))),u=(n?n+"-":"")+v[e].classPrefix+"-"+u.replace(/\//g,"\\/").replace(/:/g,"\\:").replace("@","\\@").split(".").join("_"),r.styles[u])o[u]=r.styles[u];else{let h;if(e==="flex"){h=s[l].value;const C=a.includes("!")?";display:flex !important;":";display:flex;",P=z.filter(O=>a.includes(O+":"));P.length?P.length+1!==a.split(":").length&&(h+=C):h+=C}else h=i+":"+s[l].value;let f="@media screen and ",w=!1;if(!l.includes("-"))t[l]?f+="(min-width: "+t[l]+"px)":(f="."+u.replace(/!/g,"\\!")+"{"+h+"}",w=!0);else{const C=l.split("-"),P=C[0];P&&(f+="(min-width: "+t[P]+"px) and ");const O=C[1];f+="(max-width: "+(t[O]-1)+"px)"}w||(f+="{."+u.replace(/!/g,"\\!")+"{"+h+"}}"),o[u]=f}}),o},je=[["/",""],["\\","/"],["/:",":"],["\\:",":"],["\\@","@"],["/@","@"]],Ae=e=>{const s={};for(const r in e){let t=r;je.forEach(n=>{t=t.split(n[0]).join(n[1])}),s[t]=e[r]}return s},T=e=>{const s=ve(e.type,e.bps);return e.deep&&H(s),Ae(s)},F=(e,s=!1)=>{let r,t;const n={},i=g();let o,l,a;const u=Object.keys(i.breakpoints)[0];let b=!1;for(const h of e.split(" ")){let f=h;if(o=f,a=B(f),t=a.breakPoints,f=a.numbers,f.includes("/")){const w=f.split("/");r=[Number(w[0]),Number(w[1])]}else if(a.widthBp)if(t.includes("-")){b=y("SyntaxError","You can't determine a 'until breakpoint' when use the explicit columns max: "+e);break}else r=[Number(f),i.cols[t]];else r=[Number(f),i.cols[u]];l=R(r[0],r[1]),a.important&&(l+=" !important"),n[t]={name:o,value:l}}return b||T({type:"cols",bps:n,deep:s})},V=(e,s=!1)=>{const r={};let t=!1;const n=g(),i=Object.keys(n.breakpoints)[0];for(const o of e.split(" ")){let l;const a=B(o),u=a.breakPoints,b=a.numbers.split(":"),h=b[0],f=b[1];let w;if(z.includes(h))l=A[h].ruleCss+":"+f,w=f;else{if(!A[h]){t=y("Non-existent Alias","Don't exists the alias '"+h+"' in Flex vault.");break}if(!A[f]){t=y("Non-existent Alias","Don't exists the alias '"+f+"' in Flex vault.");break}l=A[h].ruleCss+":"+A[f].ruleCss,w=A[f].classPrefix}let C=u===i?"":"@"+u;a.important&&(l+=" !important",C+="!");let P=A[h].classPrefix+":"+w+C;if(!r[u])r[u]={name:P,value:l};else{P.includes("@")&&(P=P.split("@")[0]);let O=r[u].name.split("@")[0];r[u].name.includes("!")&&!O.includes("!")&&(O+="!"),r[u].name=O+"-"+P+C,r[u].value+=";"+l}}return t||T({type:"flex",bps:r,deep:s})},Oe=["%","rem","em","ex","vw","vh","pt","cm","pc"],Ee=e=>{let s;return e.includes("/")?(s=e.split("/"),s=R(parseFloat(s[0]),parseFloat(s[1]))):e==="auto"?s="auto":Oe.filter(t=>e.includes(t)).length?s=e:s=e==="0"?e:e+"px",s},p=(e,s,r=!1)=>{const t={};return e.split(" ").forEach(n=>{const i=B(n),o=i.breakPoints;let l=i.numbers.split("-").map(a=>Ee(a)).join(" ");i.important&&(l+=" !important"),t[o]={name:n,value:l}}),T({type:s,bps:t,deep:r})},I=(e,s=!1)=>p(e,"pad",s),U=(e,s=!1)=>p(e,"padt",s),q=(e,s=!1)=>p(e,"padr",s),Y=(e,s=!1)=>p(e,"padb",s),_=(e,s=!1)=>p(e,"padl",s),$=(e,s=!1)=>p(e,"mar",s),G=(e,s=!1)=>p(e,"mart",s),J=(e,s=!1)=>p(e,"marr",s),K=(e,s=!1)=>p(e,"marb",s),Q=(e,s=!1)=>p(e,"marl",s),X=(e,s=!1)=>p(e,"mxw",s),Z=(e,s=!1)=>p(e,"mxh",s),ee=(e,s=!1)=>p(e,"miw",s),se=(e,s=!1)=>p(e,"mih",s),te=(e,s=!1)=>p(e,"hgt",s),re=(e,s=!1)=>p(e,"wdh",s),k={st:{ruleCss:"static",classPrefix:"st"},ab:{ruleCss:"absolute",classPrefix:"ab"},fi:{ruleCss:"fixed",classPrefix:"fi"},re:{ruleCss:"relative",classPrefix:"re"},si:{ruleCss:"sticky",classPrefix:"si"},in:{ruleCss:"initial",classPrefix:"in"},ih:{ruleCss:"inherit",classPrefix:"ih"}},D={...k,static:k.st,absolute:k.ab,fixed:k.fi,relative:k.re,sticky:k.si,initial:k.in,inherit:k.ih},ne=(e,s=!1)=>{const r={};let t=!1;const n=g(),i=Object.keys(n.breakpoints)[0];for(const o of e.split(" ")){let l;const a=B(o),u=a.breakPoints,b=a.numbers;if(!D[b]){t=y("Non-existent Alias","Don't exists the alias '"+b+"' in Position vault.");break}l=D[b].ruleCss;let h=D[b].classPrefix,f=u===i?"":"@"+u;a.important&&(l+=" !important",f+="!"),r[u]={name:h+f,value:l}}return t||T({type:"pos",bps:r,deep:s})},ie=(e,s=!1)=>p(e,"t",s),le=(e,s=!1)=>p(e,"r",s),ae=(e,s=!1)=>p(e,"b",s),oe=(e,s=!1)=>p(e,"l",s),c={cols:{build:F,ruleCss:"width",classPrefix:"c"},pad:{build:I,ruleCss:"padding",classPrefix:"p"},padt:{build:U,ruleCss:"padding-top",classPrefix:"pt"},padr:{build:q,ruleCss:"padding-right",classPrefix:"pr"},padb:{build:Y,ruleCss:"padding-bottom",classPrefix:"pb"},padl:{build:_,ruleCss:"padding-left",classPrefix:"pl"},mar:{build:$,ruleCss:"margin",classPrefix:"m"},mart:{build:G,ruleCss:"margin-top",classPrefix:"mt"},marr:{build:J,ruleCss:"margin-right",classPrefix:"mr"},marb:{build:K,ruleCss:"margin-bottom",classPrefix:"mb"},marl:{build:Q,ruleCss:"margin-left",classPrefix:"ml"},flex:{build:V,ruleCss:"display: flex",classPrefix:"fx"},mxw:{build:X,ruleCss:"max-width",classPrefix:"mxw"},mxh:{build:Z,ruleCss:"max-height",classPrefix:"mxh"},miw:{build:ee,ruleCss:"min-width",classPrefix:"miw"},mih:{build:se,ruleCss:"min-height",classPrefix:"mih"},wdh:{build:re,ruleCss:"width",classPrefix:"w"},hgt:{build:te,ruleCss:"height",classPrefix:"h"},pos:{build:ne,ruleCss:"position",classPrefix:"pos"},t:{build:ie,ruleCss:"top",classPrefix:"t"},r:{build:le,ruleCss:"right",classPrefix:"r"},b:{build:ae,ruleCss:"bottom",classPrefix:"b"},l:{build:oe,ruleCss:"left",classPrefix:"l"}},v={...c,c:c.cols,fx:c.flex,p:c.pad,padding:c.pad,pt:c.padt,"padding-top":c.padt,pr:c.padr,"padding-right":c.padr,pb:c.padb,"padding-bottom":c.padb,pl:c.padl,"padding-left":c.padl,m:c.mar,margin:c.mar,mt:c.mart,"margin-top":c.mart,mr:c.marr,"margin-right":c.marr,mb:c.marb,"margin-bottom":c.marb,ml:c.marl,"margin-left":c.marl,w:c.wdh,width:c.wdh,h:c.hgt,height:c.hgt,"max-width":c.mxw,"max-height":c.mxh,"min-width":c.miw,"min-height":c.mih,position:c.pos,top:c.t,right:c.r,bottom:c.b,left:c.l},ce=e=>{const s={},r=e.attributes,t=Object.keys(v);return Array.prototype.forEach.call(r,n=>{t.includes(n.name)&&n.value!==""&&(s[n.name]=n.value.trim().split(" ").filter(i=>i).join(" "))}),s},ue=(e,s=!1)=>{const r={};let t=!1;for(const n in e){const o=v[n].build(e[n],s);if(o instanceof Error){t=o;break}else r[n]=o}return t||r},fe=(e,s,r)=>new Promise(t=>{const n=g(),i=s.split(" ");let o=i;if(!r&&(o=i.filter(a=>!e.classList.contains(a)),!o.length)){t();return}const l=new n.context.MutationObserver(a=>{const b=a[0].target.className.split(" ");i.every(f=>b.includes(f))&&(l.disconnect(),t())});if(l.observe(e,{childList:!1,subtree:!1,attributes:!0,attributeFilter:["class"],characterData:!1}),r)e.className=s;else{const a=e.hasAttribute("class")?" ":"";e.className+=a+o.join(" ")}}),de=(e,s,r)=>new Promise(t=>{if(!e.hasAttribute(s)){t();return}const n=new r.MutationObserver(()=>{n.disconnect(),t()});n.observe(e,{childList:!1,subtree:!1,attributes:!0,attributeFilter:[s],characterData:!1}),e.removeAttribute(s)}),Me=(e,s,r)=>new Promise(t=>{const n=s.map(i=>de(e,i,r));Promise.all(n).then(()=>t())}),pe=(e,s)=>new Promise(r=>{const t=g();Array.isArray(s)?Me(e,s,t.context).then(r):de(e,s,t.context).then(r)}),L=({node:e,directive:s,classes:r,resolve:t})=>{const n=g();pe(e,s).then(()=>fe(e,r)).then(()=>{t();const i=new n.context.CustomEvent("layout:ready");e.dispatchEvent(i)})},Se=(e,s)=>new Promise((r,t)=>{const n=s||ce(e),i=Object.keys(n);if(!i.length){const b=y("Parameter Missing","don't exists any parameter to process",e);t(b);return}const o={};for(const b in n)o[b]=n[b];const l=ue(o,!0);if(l instanceof Error){t(l);return}const a=l,u=Object.keys(a).map(b=>Object.keys(a[b])).flat().join(" ");L({node:e,directive:i,classes:u,resolve:r})}),Be=(e,s)=>new Promise((r,t)=>{const n=s||e.getAttribute("flex");if(!n){const l=y("Empty",'The value of the directive "flex" is empty',e);t(l);return}const i=V(n,!0);if(i instanceof Error){t(i);return}const o=Object.keys(i).join(" ");L({node:e,directive:"flex",classes:o,resolve:r})}),Te=(e,s)=>new Promise((r,t)=>{const n=s||e.getAttribute("cols");if(!n){const l=y("Empty","The value of the directive 'cols' is empty",e);t(l);return}const i=F(n,!0);if(i instanceof Error){t(i);return}const o=Object.keys(i).join(" ");L({node:e,directive:"cols",classes:o,resolve:r})}),m=(e,s,r)=>new Promise((t,n)=>{const i=r||e.getAttribute(s);if(!i){const a=y("Empty",'The value of the directive "'+s+'" is empty',e);n(a);return}const o=p(i,s,!0),l=Object.keys(o).join(" ");L({node:e,directive:s,classes:l,resolve:t})}),Le=(e,s)=>m(e,"hgt",s),Fe=(e,s)=>m(e,"marb",s),Ve=(e,s)=>m(e,"marl",s),De=(e,s)=>m(e,"marr",s),Ne=(e,s)=>m(e,"mar",s),Re=(e,s)=>m(e,"mart",s),He=(e,s)=>m(e,"mxw",s),We=(e,s)=>m(e,"mih",s),ze=(e,s)=>m(e,"miw",s),Ie=(e,s)=>m(e,"padb",s),Ue=(e,s)=>m(e,"padl",s),qe=(e,s)=>m(e,"padr",s),Ye=(e,s)=>m(e,"pad",s),_e=(e,s)=>m(e,"padt",s),$e=(e,s)=>m(e,"wdh",s),Ge=(e,s)=>m(e,"mxh",s),Je=(e,s)=>m(e,"pos",s),Ke=(e,s)=>m(e,"t",s),Qe=(e,s)=>m(e,"r",s),Xe=(e,s)=>m(e,"b",s),Ze=(e,s)=>m(e,"l",s),es=e=>new Promise(s=>{const t=[...new Set(Object.keys(v).map(i=>v[i].classPrefix))],n=e.className.split(" ").filter(i=>i.includes("-")?!t.find(l=>{const a=l.length;return i.substring(0,a+1)===l+"-"}):!0);if(n.length){const i=n.join(" ");fe(e,i,!0).then(()=>{s()})}else pe(e,"class").then(()=>{s()})}),me=(e,s)=>new Promise(r=>{const n=Object.keys(v).map(a=>`[${a}]`).join(", "),i=s.querySelectorAll(n);if(!i.length){r(e);return}const o=new Set;Array.prototype.forEach.call(i,a=>{o.add(a)});const l=[];o.forEach(a=>{l.push(e.set(a))}),Promise.all(l).then(r)}),ss=e=>{const s=g(),r=Object.keys(v),t=new e.context.MutationObserver(i=>{for(const o of i)if(o.type==="childList"){if(!o.addedNodes.length)continue;o.addedNodes.forEach(l=>{if(l instanceof HTMLElement){const a=e.getParameters(l);Object.keys(a).length&&e.set(l,a),me(e,l)}})}else if(o.type==="attributes"){const l=o.target;if(l instanceof HTMLElement){const a=e.getParameters(l);Object.keys(a).length&&e.set(l,a)}}}),n={childList:!0,subtree:!0,attributes:!0,attributeFilter:r,characterData:!1};t.observe(s.context.document.body,n)},be=(e,s={})=>{const t={...Pe(e,s),getParameters:ce,updateConfig:Ce,insertRules:H,build:ue,buildCols:F,buildFlex:V,buildPad:I,buildPadTop:U,buildPadRight:q,buildPadBottom:Y,buildPadLeft:_,buildMar:$,buildMarTop:G,buildMarRight:J,buildMarBottom:K,buildMarLeft:Q,buildMaxWidth:X,buildMaxHeight:Z,buildMinWidth:ee,buildMinHeight:se,buildHeight:te,buildWidth:re,set:Se,setCols:Te,setFlex:Be,setMar:Ne,setMarTop:Re,setMarRight:De,setMarBottom:Fe,setMarLeft:Ve,setPad:Ye,setPadTop:_e,setPadRight:qe,setPadBottom:Ie,setPadLeft:Ue,setWidth:$e,setMinWidth:ze,setMaxWidth:He,setHeight:Le,setMinHeight:We,setMaxHeight:Ge,reset:es,buildPosition:ne,buildTop:ie,buildRight:le,buildBottom:ae,buildLeft:oe,setPosition:Je,setTop:Ke,setRight:Qe,setBottom:Xe,setLeft:Ze};return me(t,e.document).then(()=>{t.ready&&t.ready(t),ss(t)}),t};return typeof window!="undefined"&&typeof exports=="undefined"&&(window.layouter=be(window)),be}); +(function(E,A){typeof exports=="object"&&typeof module!="undefined"?module.exports=A():typeof define=="function"&&define.amd?define(A):(E=typeof globalThis!="undefined"?globalThis:E||self,E.Layouter=A())})(this,function(){"use strict";const E=(e,s)=>{const r={};return s==="width"?Object.keys(e).map(t=>({alias:t,width:e[t].width})).sort((t,n)=>t.width>n.width?1:n.width>t.width?-1:0).forEach((t,n)=>{r[t.alias]=n?e[t.alias][s]:0}):Object.keys(e).forEach(t=>{r[t]=e[t][s]}),r},A=({bridge:e,bp:s,insertionType:r,node:t,context:n})=>{let i=n.document.getElementById("layouter-"+s);if(!i){i=n.document.createElement("style"),i.appendChild(n.document.createTextNode(""));const l=t.parentNode;switch(r){case"before":l.insertBefore(i,t);break;case"after":t.nextSibling?l.insertBefore(i,t.nextSibling):l.appendChild(i);break;case"append":t.appendChild(i);break}i.id="layouter-"+s}let o;return e?o={method:i.sheet,node:i}:o={method:{insertRule:l=>{i.appendChild(n.document.createTextNode(l))},rules:[]},node:i},o},ge=({breakpoints:e,bridge:s,scope:r,context:t})=>{const n=r||{};return Object.keys(e).forEach(i=>{n[i]||(n[i]=A({bridge:s,bp:i,insertionType:"append",node:t.document.body,context:t}))}),n},Pe=(e,s)=>{const r={};return Object.keys(s).forEach(t=>r[t]=e[t]),r},Ce="1.5.0";let M={prefix:"",breakpoints:{xs:{width:360,cols:15},sm:{width:600,cols:25},md:{width:900,cols:31},lg:{width:1200,cols:41},xlg:{width:1536,cols:51}},bridge:!0,debug:!0},x;const H=({bps:e,bridge:s,scope:r,context:t})=>{const n=E(e,"width"),i=Pe(e,n);return{sizes:n,cols:E(e,"cols"),scope:ge({breakpoints:i,bridge:s,scope:r,context:t}),breakpoints:i}},we=(e,s={})=>{const r=e.layouterConfig||{};return M={...M,...s,...r},x={context:e,...M,...H({bps:M.breakpoints,bridge:M.bridge,context:e}),styles:{},version:Ce},x},g=()=>x,ye=(e,s)=>{x.styles[e]=s},ke=e=>(x={...x,...e},e.breakpoints&&(x={...x,...H({bps:x.breakpoints,bridge:x.bridge,scope:x.scope,context:x.context})}),x),S=e=>{let s,r=e,t=!1;const n=r.includes("@");if(n){const i=r.split("@");r=i[0],s=i[1]}else{const i=g();s=Object.keys(i.breakpoints)[0]}return e.includes("!")&&(t=!0,s=s.replace(/!/g,""),r=r.replace(/!/g,"")),{widthBp:n,numbers:r,breakPoints:s,important:t}},C=(e,s,r)=>{const t=new Error;return t.name=e,t.message=s,g().debug&&(console.error(t),r&&console.log(r)),t},W=(e,s)=>{const r=e*100/s;return(r-Math.floor(r)!==0?r.toFixed(3):r)+"%"},ve=e=>{const s=e.replace(/!/g,""),r=s.indexOf("@"),t=g(),n=t.scope,i=t.bridge,o=t.context;if(r===-1){const f=Object.keys(t.breakpoints)[0];return n[f]}const l=s.substring(r+1);if(!l.includes("-"))return n[l];if(l.substring(0,1)==="-"){if(n[l])return n[l];const f=l.substring(1);return n[l]=A({bridge:i,bp:l,insertionType:"before",node:n[f].node,context:o}),n[l]}if(n[l])return n[l];const a=l.split("-")[0];return n[l]=A({bridge:i,bp:l,insertionType:"after",node:n[a].node,context:o}),n[l]},z=e=>{const s=g();for(const r in e)if(!s.styles[r]){const t=ve(r),n=e[r],i=t.method.rules;t.method.insertRule(n,i?i.length:0),ye(r,n)}},p={jc:{ruleCss:"justify-content",classPrefix:"jc"},ai:{ruleCss:"align-items",classPrefix:"ai"},ce:{ruleCss:"center",classPrefix:"ce"},fs:{ruleCss:"flex-start",classPrefix:"fs"},fe:{ruleCss:"flex-end",classPrefix:"fe"},sb:{ruleCss:"space-between",classPrefix:"sb"},sa:{ruleCss:"space-around",classPrefix:"sa"},fw:{ruleCss:"flex-wrap",classPrefix:"fw"},nw:{ruleCss:"nowrap",classPrefix:"nw"},w:{ruleCss:"wrap",classPrefix:"w"},wr:{ruleCss:"wrap-reverse",classPrefix:"wr"},fd:{ruleCss:"flex-direction",classPrefix:"fd"},r:{ruleCss:"row",classPrefix:"r"},rr:{ruleCss:"row-reverse",classPrefix:"rr"},co:{ruleCss:"column",classPrefix:"co"},cor:{ruleCss:"column-reverse",classPrefix:"co"},au:{ruleCss:"auto",classPrefix:"au"},st:{ruleCss:"stretch",classPrefix:"st"},bl:{ruleCss:"baseline",classPrefix:"bl"},in:{ruleCss:"initial",classPrefix:"in"},ih:{ruleCss:"inherit",classPrefix:"ih"}},T={fg:{ruleCss:"flex-grow",classPrefix:"fg"},fh:{ruleCss:"flex-shrink",classPrefix:"fh"},as:{ruleCss:"align-self",classPrefix:"as"},or:{ruleCss:"order",classPrefix:"or"}},I={...T,"flex-grow":T.fg,"flex-shrink":T.fh,"align-self":T.as,order:T.or},O={...p,...I,"justify-content":p.jc,"align-items":p.ai,center:p.ce,"flex-start":p.fs,"flex-end":p.fe,"space-between":p.sb,"space-around":p.fs,"flex-wrap":p.fw,nowrap:p.nw,w:p.w,"wrap-reverse":p.wr,"flex-direction":p.fd,row:p.r,"row-reverse":p.rr,column:p.co,"column-reverse":p.cor,auto:p.au,stretch:p.st,baseline:p.bl,initial:p.in,inherit:p.ih},U=Object.keys(I),je=e=>"0\xAF"+e.replace("%",""),Ae=(e,s)=>{const r=g(),t=r.sizes,n=r.prefix,i=j[e].ruleCss,o={};return Object.keys(s).forEach(l=>{const a=s[l].name;let f=a;if(a.includes("%")&&(f=a.replace(a,je(a))),f=(n?n+"-":"")+j[e].classPrefix+"-"+f.replace(/\//g,"\\/").replace(/:/g,"\\:").replace("@","\\@").split(".").join("_"),r.styles[f])o[f]=r.styles[f];else{let h;if(e==="flex"){h=s[l].value;const k=a.includes("!")?";display:flex !important;":";display:flex;",P=U.filter(B=>a.includes(B+":"));P.length?P.length+1!==a.split(":").length&&(h+=k):h+=k}else h=i+":"+s[l].value;let u="@media screen and ",y=!1;if(!l.includes("-"))t[l]?u+="(min-width: "+t[l]+"px)":(u="."+f.replace(/!/g,"\\!")+"{"+h+"}",y=!0);else{const k=l.split("-"),P=k[0];P&&(u+="(min-width: "+t[P]+"px) and ");const B=k[1];u+="(max-width: "+(t[B]-1)+"px)"}y||(u+="{."+f.replace(/!/g,"\\!")+"{"+h+"}}"),o[f]=u}}),o},Oe=[["/",""],["\\","/"],["/:",":"],["\\:",":"],["\\@","@"],["/@","@"]],Be=e=>{const s={};for(const r in e){let t=r;Oe.forEach(n=>{t=t.split(n[0]).join(n[1])}),s[t]=e[r]}return s},L=e=>{const s=Ae(e.type,e.bps);return e.deep&&z(s),Be(s)},D=(e,s=!1)=>{let r,t;const n={},i=g();let o,l,a;const f=Object.keys(i.breakpoints)[0];let d=!1;for(const h of e.split(" ")){let u=h;if(o=u,a=S(u),t=a.breakPoints,u=a.numbers,u.includes("/")){const y=u.split("/");r=[Number(y[0]),Number(y[1])]}else if(a.widthBp)if(t.includes("-")){d=C("SyntaxError","You can't determine a 'until breakpoint' when use the explicit columns max: "+e);break}else r=[Number(u),i.cols[t]];else r=[Number(u),i.cols[f]];l=W(r[0],r[1]),a.important&&(l+=" !important"),n[t]={name:o,value:l}}return d||L({type:"cols",bps:n,deep:s})},N=(e,s=!1)=>{const r={};let t=!1;const n=g(),i=Object.keys(n.breakpoints)[0];for(const o of e.split(" ")){let l;const a=S(o),f=a.breakPoints,d=a.numbers.split(":"),h=d[0],u=d[1];let y;if(U.includes(h))l=O[h].ruleCss+":"+u,y=u;else{if(!O[h]){t=C("Non-existent Alias","Don't exists the alias '"+h+"' in Flex vault.");break}if(!O[u]){t=C("Non-existent Alias","Don't exists the alias '"+u+"' in Flex vault.");break}l=O[h].ruleCss+":"+O[u].ruleCss,y=O[u].classPrefix}let k=f===i?"":"@"+f;a.important&&(l+=" !important",k+="!");let P=O[h].classPrefix+":"+y+k;if(!r[f])r[f]={name:P,value:l};else{P.includes("@")&&(P=P.split("@")[0]);let B=r[f].name.split("@")[0];r[f].name.includes("!")&&!B.includes("!")&&(B+="!"),r[f].name=B+"-"+P+k,r[f].value+=";"+l}}return t||L({type:"flex",bps:r,deep:s})},Ee=["%","rem","em","ex","vw","vh","pt","cm","pc"],Me=e=>{let s;return e.includes("/")?(s=e.split("/"),s=W(parseFloat(s[0]),parseFloat(s[1]))):e==="auto"?s="auto":Ee.filter(t=>e.includes(t)).length?s=e:s=e==="0"?e:e+"px",s},m=(e,s,r=!1)=>{const t={};return e.split(" ").forEach(n=>{const i=S(n),o=i.breakPoints;let l=i.numbers.split("-").map(a=>Me(a)).join(" ");i.important&&(l+=" !important"),t[o]={name:n,value:l}}),L({type:s,bps:t,deep:r})},q=(e,s=!1)=>m(e,"pad",s),Y=(e,s=!1)=>m(e,"padt",s),_=(e,s=!1)=>m(e,"padr",s),$=(e,s=!1)=>m(e,"padb",s),G=(e,s=!1)=>m(e,"padl",s),J=(e,s=!1)=>m(e,"mar",s),K=(e,s=!1)=>m(e,"mart",s),Q=(e,s=!1)=>m(e,"marr",s),X=(e,s=!1)=>m(e,"marb",s),Z=(e,s=!1)=>m(e,"marl",s),ee=(e,s=!1)=>m(e,"mxw",s),se=(e,s=!1)=>m(e,"mxh",s),te=(e,s=!1)=>m(e,"miw",s),re=(e,s=!1)=>m(e,"mih",s),ne=(e,s=!1)=>m(e,"hgt",s),ie=(e,s=!1)=>m(e,"wdh",s),v={st:{ruleCss:"static",classPrefix:"st"},ab:{ruleCss:"absolute",classPrefix:"ab"},fi:{ruleCss:"fixed",classPrefix:"fi"},re:{ruleCss:"relative",classPrefix:"re"},si:{ruleCss:"sticky",classPrefix:"si"},in:{ruleCss:"initial",classPrefix:"in"},ih:{ruleCss:"inherit",classPrefix:"ih"}},F={...v,static:v.st,absolute:v.ab,fixed:v.fi,relative:v.re,sticky:v.si,initial:v.in,inherit:v.ih},le=(e,s=!1)=>{const r={};let t=!1;const n=g(),i=Object.keys(n.breakpoints)[0];for(const o of e.split(" ")){let l;const a=S(o),f=a.breakPoints,d=a.numbers;if(!F[d]){t=C("Non-existent Alias","Don't exists the alias '"+d+"' in Position vault.");break}l=F[d].ruleCss;const h=F[d].classPrefix;let u=f===i?"":"@"+f;a.important&&(l+=" !important",u+="!"),r[f]={name:h+u,value:l}}return t||L({type:"pos",bps:r,deep:s})},ae=(e,s=!1)=>m(e,"t",s),oe=(e,s=!1)=>m(e,"r",s),ce=(e,s=!1)=>m(e,"b",s),fe=(e,s=!1)=>m(e,"l",s),w={bl:{ruleCss:"block",classPrefix:"bl"},il:{ruleCss:"inline",classPrefix:"il"},ib:{ruleCss:"inline-block",classPrefix:"ib"},fx:{ruleCss:"flex",classPrefix:"fx"},if:{ruleCss:"inline-flex",classPrefix:"if"},no:{ruleCss:"none",classPrefix:"no"},in:{ruleCss:"initial",classPrefix:"in"},ih:{ruleCss:"inherit",classPrefix:"ih"}},R={...w,block:w.bl,inline:w.il,"inline-block":w.ib,flex:w.fx,"inline-flex":w.if,none:w.no,initial:w.in,inherit:w.ih},c={cols:{build:D,ruleCss:"width",classPrefix:"c"},pad:{build:q,ruleCss:"padding",classPrefix:"p"},padt:{build:Y,ruleCss:"padding-top",classPrefix:"pt"},padr:{build:_,ruleCss:"padding-right",classPrefix:"pr"},padb:{build:$,ruleCss:"padding-bottom",classPrefix:"pb"},padl:{build:G,ruleCss:"padding-left",classPrefix:"pl"},mar:{build:J,ruleCss:"margin",classPrefix:"m"},mart:{build:K,ruleCss:"margin-top",classPrefix:"mt"},marr:{build:Q,ruleCss:"margin-right",classPrefix:"mr"},marb:{build:X,ruleCss:"margin-bottom",classPrefix:"mb"},marl:{build:Z,ruleCss:"margin-left",classPrefix:"ml"},flex:{build:N,ruleCss:"display: flex",classPrefix:"fx"},mxw:{build:ee,ruleCss:"max-width",classPrefix:"mxw"},mxh:{build:se,ruleCss:"max-height",classPrefix:"mxh"},miw:{build:te,ruleCss:"min-width",classPrefix:"miw"},mih:{build:re,ruleCss:"min-height",classPrefix:"mih"},wdh:{build:ie,ruleCss:"width",classPrefix:"w"},hgt:{build:ne,ruleCss:"height",classPrefix:"h"},pos:{build:le,ruleCss:"position",classPrefix:"pos"},t:{build:ae,ruleCss:"top",classPrefix:"t"},r:{build:oe,ruleCss:"right",classPrefix:"r"},b:{build:ce,ruleCss:"bottom",classPrefix:"b"},l:{build:fe,ruleCss:"left",classPrefix:"l"},d:{build:(e,s=!1)=>{const r={};let t=!1;const n=g(),i=Object.keys(n.breakpoints)[0];for(const o of e.split(" ")){let l;const a=S(o),f=a.breakPoints,d=a.numbers;if(!R[d]){t=C("Non-existent Alias","Don't exists the alias '"+d+"' in display vault.");break}l=R[d].ruleCss;const h=R[d].classPrefix;let u=f===i?"":"@"+f;a.important&&(l+=" !important",u+="!"),r[f]={name:h+u,value:l}}return t||L({type:"d",bps:r,deep:s})},ruleCss:"display",classPrefix:"d"}},j={...c,c:c.cols,fx:c.flex,p:c.pad,padding:c.pad,pt:c.padt,"padding-top":c.padt,pr:c.padr,"padding-right":c.padr,pb:c.padb,"padding-bottom":c.padb,pl:c.padl,"padding-left":c.padl,m:c.mar,margin:c.mar,mt:c.mart,"margin-top":c.mart,mr:c.marr,"margin-right":c.marr,mb:c.marb,"margin-bottom":c.marb,ml:c.marl,"margin-left":c.marl,w:c.wdh,width:c.wdh,h:c.hgt,height:c.hgt,"max-width":c.mxw,"max-height":c.mxh,"min-width":c.miw,"min-height":c.mih,position:c.pos,top:c.t,right:c.r,bottom:c.b,left:c.l,display:c.d},ue=e=>{const s={},r=e.attributes,t=Object.keys(j);return Array.prototype.forEach.call(r,n=>{t.includes(n.name)&&n.value!==""&&(s[n.name]=n.value.trim().split(" ").filter(i=>i).join(" "))}),s},de=(e,s=!1)=>{const r={};let t=!1;for(const n in e){const o=j[n].build(e[n],s);if(o instanceof Error){t=o;break}else r[n]=o}return t||r},pe=(e,s,r)=>new Promise(t=>{const n=g(),i=s.split(" ");let o=i;if(!r&&(o=i.filter(a=>!e.classList.contains(a)),!o.length)){t();return}const l=new n.context.MutationObserver(a=>{const d=a[0].target.className.split(" ");i.every(u=>d.includes(u))&&(l.disconnect(),t())});if(l.observe(e,{childList:!1,subtree:!1,attributes:!0,attributeFilter:["class"],characterData:!1}),r)e.className=s;else{const a=e.hasAttribute("class")?" ":"";e.className+=a+o.join(" ")}}),me=(e,s,r)=>new Promise(t=>{if(!e.hasAttribute(s)){t();return}const n=new r.MutationObserver(()=>{n.disconnect(),t()});n.observe(e,{childList:!1,subtree:!1,attributes:!0,attributeFilter:[s],characterData:!1}),e.removeAttribute(s)}),Se=(e,s,r)=>new Promise(t=>{const n=s.map(i=>me(e,i,r));Promise.all(n).then(()=>t())}),be=(e,s)=>new Promise(r=>{const t=g();Array.isArray(s)?Se(e,s,t.context).then(r):me(e,s,t.context).then(r)}),V=({node:e,directive:s,classes:r,resolve:t})=>{const n=g();be(e,s).then(()=>pe(e,r)).then(()=>{t();const i=new n.context.CustomEvent("layout:ready");e.dispatchEvent(i)})},Te=(e,s)=>new Promise((r,t)=>{const n=s||ue(e),i=Object.keys(n);if(!i.length){const d=C("Parameter Missing","don't exists any parameter to process",e);t(d);return}const o={};for(const d in n)o[d]=n[d];const l=de(o,!0);if(l instanceof Error){t(l);return}const a=l,f=Object.keys(a).map(d=>Object.keys(a[d])).flat().join(" ");V({node:e,directive:i,classes:f,resolve:r})}),Le=(e,s)=>new Promise((r,t)=>{const n=s||e.getAttribute("flex");if(!n){const l=C("Empty",'The value of the directive "flex" is empty',e);t(l);return}const i=N(n,!0);if(i instanceof Error){t(i);return}const o=Object.keys(i).join(" ");V({node:e,directive:"flex",classes:o,resolve:r})}),Ve=(e,s)=>new Promise((r,t)=>{const n=s||e.getAttribute("cols");if(!n){const l=C("Empty","The value of the directive 'cols' is empty",e);t(l);return}const i=D(n,!0);if(i instanceof Error){t(i);return}const o=Object.keys(i).join(" ");V({node:e,directive:"cols",classes:o,resolve:r})}),b=(e,s,r)=>new Promise((t,n)=>{const i=r||e.getAttribute(s);if(!i){const a=C("Empty",'The value of the directive "'+s+'" is empty',e);n(a);return}const o=m(i,s,!0),l=Object.keys(o).join(" ");V({node:e,directive:s,classes:l,resolve:t})}),De=(e,s)=>b(e,"hgt",s),Ne=(e,s)=>b(e,"marb",s),Fe=(e,s)=>b(e,"marl",s),Re=(e,s)=>b(e,"marr",s),He=(e,s)=>b(e,"mar",s),We=(e,s)=>b(e,"mart",s),ze=(e,s)=>b(e,"mxw",s),Ie=(e,s)=>b(e,"mih",s),Ue=(e,s)=>b(e,"miw",s),qe=(e,s)=>b(e,"padb",s),Ye=(e,s)=>b(e,"padl",s),_e=(e,s)=>b(e,"padr",s),$e=(e,s)=>b(e,"pad",s),Ge=(e,s)=>b(e,"padt",s),Je=(e,s)=>b(e,"wdh",s),Ke=(e,s)=>b(e,"mxh",s),Qe=(e,s)=>b(e,"pos",s),Xe=(e,s)=>b(e,"t",s),Ze=(e,s)=>b(e,"r",s),es=(e,s)=>b(e,"b",s),ss=(e,s)=>b(e,"l",s),ts=e=>new Promise(s=>{const t=[...new Set(Object.keys(j).map(i=>j[i].classPrefix))],n=e.className.split(" ").filter(i=>i.includes("-")?!t.find(l=>{const a=l.length;return i.substring(0,a+1)===l+"-"}):!0);if(n.length){const i=n.join(" ");pe(e,i,!0).then(()=>{s()})}else be(e,"class").then(()=>{s()})}),he=(e,s)=>new Promise(r=>{const n=Object.keys(j).map(a=>`[${a}]`).join(", "),i=s.querySelectorAll(n);if(!i.length){r(e);return}const o=new Set;Array.prototype.forEach.call(i,a=>{o.add(a)});const l=[];o.forEach(a=>{l.push(e.set(a))}),Promise.all(l).then(r)}),rs=e=>{const s=g(),r=Object.keys(j),t=new e.context.MutationObserver(i=>{for(const o of i)if(o.type==="childList"){if(!o.addedNodes.length)continue;o.addedNodes.forEach(l=>{if(l instanceof HTMLElement){const a=e.getParameters(l);Object.keys(a).length&&e.set(l,a),he(e,l)}})}else if(o.type==="attributes"){const l=o.target;if(l instanceof HTMLElement){const a=e.getParameters(l);Object.keys(a).length&&e.set(l,a)}}}),n={childList:!0,subtree:!0,attributes:!0,attributeFilter:r,characterData:!1};t.observe(s.context.document.body,n)},xe=(e,s={})=>{const t={...we(e,s),getParameters:ue,updateConfig:ke,insertRules:z,build:de,buildCols:D,buildFlex:N,buildPad:q,buildPadTop:Y,buildPadRight:_,buildPadBottom:$,buildPadLeft:G,buildMar:J,buildMarTop:K,buildMarRight:Q,buildMarBottom:X,buildMarLeft:Z,buildMaxWidth:ee,buildMaxHeight:se,buildMinWidth:te,buildMinHeight:re,buildHeight:ne,buildWidth:ie,set:Te,setCols:Ve,setFlex:Le,setMar:He,setMarTop:We,setMarRight:Re,setMarBottom:Ne,setMarLeft:Fe,setPad:$e,setPadTop:Ge,setPadRight:_e,setPadBottom:qe,setPadLeft:Ye,setWidth:Je,setMinWidth:Ue,setMaxWidth:ze,setHeight:De,setMinHeight:Ie,setMaxHeight:Ke,reset:ts,buildPosition:le,buildTop:ae,buildRight:oe,buildBottom:ce,buildLeft:fe,setPosition:Qe,setTop:Xe,setRight:Ze,setBottom:es,setLeft:ss};return he(t,e.document).then(()=>{t.ready&&t.ready(t),rs(t)}),t};return typeof window!="undefined"&&typeof exports=="undefined"&&(window.layouter=xe(window)),xe}); //# sourceMappingURL=layouter.umd.js.map diff --git a/dist/layouter.umd.js.map b/dist/layouter.umd.js.map index 7859771..6435298 100644 --- a/dist/layouter.umd.js.map +++ b/dist/layouter.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"layouter.umd.js","sources":["../src/helpers/breakpointsNums.ts","../src/helpers/createScopeStyles.ts","../src/helpers/scopesStylesBuilder.ts","../src/helpers/breakpointsOrdered.ts","../src/config/main.ts","../src/helpers/prepareParam.ts","../src/helpers/regError.ts","../src/helpers/calPercentage.ts","../src/helpers/getScopeByclassName.ts","../src/methods/insertRules.ts","../src/config/flex.ts","../src/helpers/percentageConverter.ts","../src/helpers/createStyles.ts","../src/helpers/nameCleaner.ts","../src/helpers/buildCss.ts","../src/methods/buildCols.ts","../src/methods/buildFlex.ts","../src/helpers/processedNumber.ts","../src/helpers/buildAttr.ts","../src/methods/buildPad.ts","../src/methods/buildPadTop.ts","../src/methods/buildPadRight.ts","../src/methods/buildPadBottom.ts","../src/methods/buildPadLeft.ts","../src/methods/buildMar.ts","../src/methods/buildMarTop.ts","../src/methods/buildMarRight.ts","../src/methods/buildMarBottom.ts","../src/methods/buildMarLeft.ts","../src/methods/buildMaxWidth.ts","../src/methods/buildMaxHeight.ts","../src/methods/buildMinWidth.ts","../src/methods/buildMinHeight.ts","../src/methods/buildHeight.ts","../src/methods/buildWidth.ts","../src/config/position.ts","../src/methods/buildPosition.ts","../src/methods/buildTop.ts","../src/methods/buildRight.ts","../src/methods/buildBottom.ts","../src/methods/buildLeft.ts","../src/config/processors.ts","../src/methods/getParameters.ts","../src/methods/build.ts","../src/utils/addClasses.ts","../src/utils/removeAttr.ts","../src/helpers/eventReady.ts","../src/methods/set.ts","../src/methods/setFlex.ts","../src/methods/SetCols.ts","../src/methods/setAttr.ts","../src/methods/setHeight.ts","../src/methods/setMarBottom.ts","../src/methods/setMarLeft.ts","../src/methods/setMarRight.ts","../src/methods/setMar.ts","../src/methods/setMarTop.ts","../src/methods/setMaxWidth.ts","../src/methods/setMinHeight.ts","../src/methods/setMinWidth.ts","../src/methods/setPadBottom.ts","../src/methods/setPadLeft.ts","../src/methods/setPadRight.ts","../src/methods/setPad.ts","../src/methods/setPadTop.ts","../src/methods/setWidth.ts","../src/methods/setMaxHeight.ts","../src/methods/setPosition.ts","../src/methods/setTop.ts","../src/methods/setRight.ts","../src/methods/setBottom.ts","../src/methods/setLeft.ts","../src/methods/reset.ts","../src/helpers/searchAndProcess.ts","../src/helpers/mainObserver.ts","../src/layouter.ts"],"sourcesContent":["export type TNumProp = 'width' | 'cols';\r\n\r\nexport interface IBreakpoint {\r\n alias: string;\r\n width: number;\r\n}\r\n\r\nexport interface IBreakpoints {\r\n [alias: string]: {\r\n width: number;\r\n cols: number;\r\n };\r\n}\r\n\r\nexport interface IBreakpointObj {\r\n [alias: string]: number;\r\n}\r\n\r\nconst breakpointsNums = (\r\n objBps: IBreakpoints,\r\n propName: TNumProp\r\n): IBreakpointObj => {\r\n const sizes: IBreakpointObj = {};\r\n\r\n if (propName === 'width') {\r\n Object.keys(objBps)\r\n .map((bp: string) => {\r\n return {\r\n alias: bp,\r\n width: objBps[bp].width,\r\n };\r\n })\r\n .sort((a: IBreakpoint, b: IBreakpoint) =>\r\n a.width > b.width ? 1 : b.width > a.width ? -1 : 0\r\n )\r\n .forEach((bp: IBreakpoint, index: number) => {\r\n sizes[bp.alias] = !index ? 0 : objBps[bp.alias][propName];\r\n });\r\n } else {\r\n Object.keys(objBps).forEach((bp) => {\r\n sizes[bp] = objBps[bp][propName];\r\n });\r\n }\r\n\r\n return sizes;\r\n};\r\n\r\nexport default breakpointsNums;\r\n","export type TInsertion = 'before' | 'after' | 'append';\n\nexport interface ICreateScopeStyles {\n bridge?: boolean;\n bp: string;\n insertionType: TInsertion;\n node: HTMLElement;\n context: Window & typeof globalThis;\n}\n\nexport interface IRCreateScopeStyles {\n method:\n | CSSStyleSheet\n | {\n insertRule: (ruleCss: string) => void;\n rules: string[];\n };\n node: HTMLElement;\n}\n\nconst createScopeStyles = ({\n bridge: withBridge,\n bp,\n insertionType,\n node,\n context,\n}: ICreateScopeStyles): IRCreateScopeStyles => {\n let stylesScope = context.document.getElementById('layouter-' + bp);\n if (!stylesScope) {\n stylesScope = context.document.createElement('style');\n stylesScope.appendChild(context.document.createTextNode('')); // WebKit hack :(\n const nodeParent = node.parentNode as HTMLDivElement;\n switch (insertionType) {\n case 'before':\n nodeParent.insertBefore(stylesScope, node);\n break;\n case 'after':\n node.nextSibling\n ? nodeParent.insertBefore(stylesScope, node.nextSibling)\n : nodeParent.appendChild(stylesScope);\n break;\n case 'append':\n node.appendChild(stylesScope);\n break;\n }\n stylesScope.id = 'layouter-' + bp;\n }\n\n let bridge: IRCreateScopeStyles;\n if (withBridge) {\n bridge = {\n method: (stylesScope as HTMLStyleElement).sheet as CSSStyleSheet,\n node: stylesScope,\n };\n } else {\n bridge = {\n method: {\n insertRule: (ruleCss: string) => {\n (stylesScope as HTMLDivElement).appendChild(\n context.document.createTextNode(ruleCss)\n );\n },\n rules: [],\n },\n node: stylesScope,\n };\n }\n return bridge;\n};\n\nexport default createScopeStyles;\n","import { IBreakpoints } from './breakpointsNums';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nexport interface IScopes {\n [name: string]: IRCreateScopeStyles;\n}\n\nexport interface IScopesStylesBuilder {\n breakpoints: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\nexport const scopesStylesBuilder = ({\n breakpoints,\n bridge,\n scope,\n context,\n}: IScopesStylesBuilder): IScopes => {\n const scopes: IScopes = scope || {};\n Object.keys(breakpoints).forEach((bp: string) => {\n if (!scopes[bp]) {\n scopes[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'append',\n node: context.document.body,\n context,\n });\n }\n });\n return scopes;\n};\n","import { ICols } from '../config/main';\r\nimport { IBreakpoints } from './breakpointsNums';\r\n\r\nconst breakpointsOrdered = (bps: IBreakpoints, sizes: ICols) => {\r\n const bpsOrdered: IBreakpoints = {};\r\n Object.keys(sizes).forEach((bpName) => (bpsOrdered[bpName] = bps[bpName]));\r\n return bpsOrdered;\r\n};\r\n\r\nexport default breakpointsOrdered;\r\n","import { ILayouter } from './../layouter';\nimport breakpointsNums, { IBreakpoints } from '../helpers/breakpointsNums';\nimport { IScopes, scopesStylesBuilder } from '../helpers/scopesStylesBuilder';\nimport breakpointsOrdered from '../helpers/breakpointsOrdered';\nimport { version } from '../../package.json';\n\nexport interface ICols {\n [colAlias: string]: number;\n}\n\nexport interface IConfigUser {\n prefix: string;\n breakpoints: IBreakpoints;\n bridge: boolean;\n debug?: boolean;\n ready?: (instance: ILayouter) => void;\n}\n\ninterface IConfigNumsIn {\n bps: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\ninterface IConfigNumsOut {\n scope: IScopes;\n cols: ICols;\n sizes: ICols;\n breakpoints: IBreakpoints;\n}\n\nexport interface IConfig\n extends Omit,\n IConfigNumsOut {\n context: Window & typeof globalThis;\n styles: {\n [className: string]: string;\n };\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouterConfig: Partial;\n }\n}\n\nconst breakpointsInit: IBreakpoints = {\n xs: {\n width: 360,\n cols: 15,\n },\n sm: {\n width: 600,\n cols: 25,\n },\n md: {\n width: 900,\n cols: 31,\n },\n lg: {\n width: 1200,\n cols: 41,\n },\n xlg: {\n width: 1536,\n cols: 51,\n },\n};\n\nexport let baseConfig: IConfigUser = {\n prefix: '',\n breakpoints: breakpointsInit,\n bridge: true,\n debug: true,\n};\n\nlet config: IConfig;\n\nconst configNums = ({\n bps,\n bridge,\n scope,\n context,\n}: IConfigNumsIn): IConfigNumsOut => {\n const sizes = breakpointsNums(bps, 'width');\n const finalBps = breakpointsOrdered(bps, sizes);\n return {\n sizes,\n cols: breakpointsNums(bps, 'cols'),\n scope: scopesStylesBuilder({\n breakpoints: finalBps,\n bridge,\n scope: scope,\n context,\n }),\n breakpoints: finalBps,\n };\n};\n\nexport const setConfig = (\n context: Window & typeof globalThis,\n customCfg: Partial = {}\n): IConfig => {\n const contextConfig = context.layouterConfig || {};\n\n baseConfig = {\n ...baseConfig,\n ...customCfg,\n ...contextConfig,\n };\n\n config = {\n context,\n ...baseConfig,\n ...configNums({\n bps: baseConfig.breakpoints,\n bridge: baseConfig.bridge,\n context,\n }),\n styles: {},\n version,\n };\n\n return config;\n};\n\nconst getConfig = (): IConfig => {\n return config;\n};\n\nexport const setStyles = (className: string, value: string) => {\n config.styles[className] = value;\n};\n\nexport const updateConfig = (userConfig: Partial): IConfig => {\n config = {\n ...config,\n ...userConfig,\n };\n\n if (userConfig.breakpoints) {\n config = {\n ...config,\n ...configNums({\n bps: config.breakpoints,\n bridge: config.bridge,\n scope: config.scope,\n context: config.context,\n }),\n };\n }\n\n return config;\n};\n\nexport default getConfig;\n","import getConfig from '../config/main';\n\nexport interface IPrepareParamObj {\n widthBp: boolean;\n numbers: string;\n breakPoints: string;\n important: boolean;\n}\n\nconst prepareParam = (param: string): IPrepareParamObj => {\n let bp: string;\n let argParam = param;\n let important = false;\n const haveBp = argParam.includes('@');\n if (haveBp) {\n const bpSplited = argParam.split('@');\n argParam = bpSplited[0];\n bp = bpSplited[1];\n } else {\n const config = getConfig();\n bp = Object.keys(config.breakpoints)[0];\n }\n\n if (param.includes('!')) {\n important = true;\n bp = bp.replace(/!/g, '');\n argParam = argParam.replace(/!/g, '');\n }\n\n return {\n widthBp: haveBp,\n numbers: argParam,\n breakPoints: bp,\n important,\n };\n};\n\nexport default prepareParam;\n","import config from '../config/main';\r\n\r\nconst regError = (\r\n name: string,\r\n message: string,\r\n Node?: Element | HTMLElement\r\n): Error => {\r\n const err = new Error();\r\n err.name = name;\r\n err.message = message;\r\n const intConfig = config();\r\n if (intConfig.debug) {\r\n console.error(err);\r\n if (Node) console.log(Node);\r\n }\r\n return err;\r\n};\r\n\r\nexport default regError;\r\n","const calPercentage = (n1: number, n2: number): string => {\r\n const cal = (n1 * 100) / n2;\r\n const haveDecimal = cal - Math.floor(cal) !== 0;\r\n const result = haveDecimal ? cal.toFixed(3) : cal;\r\n return result + '%';\r\n};\r\n\r\nexport default calPercentage;\r\n","import config from '../config/main';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nconst getScopeByclassName = (className: string): IRCreateScopeStyles => {\n const nameClass = className.replace(/!/g, '');\n const atIndex = nameClass.indexOf('@');\n const intConfig = config();\n const scope = intConfig.scope;\n const bridge = intConfig.bridge;\n const context = intConfig.context;\n\n // Haven´t a BP designed\n if (atIndex === -1) {\n const firstBp = Object.keys(intConfig.breakpoints)[0];\n return scope[firstBp as string];\n }\n\n // Have a BP designed, a normal BP.\n const bp = nameClass.substring(atIndex + 1);\n if (!bp.includes('-')) return scope[bp]; // A simple BP (13/15@lg), not compound (like this: 13/15@sm-md).\n\n // A BP until. Example 13/15@-md\n if (bp.substring(0, 1) === '-') {\n if (scope[bp]) return scope[bp]; // exists the Scope.\n const bpUntil = bp.substring(1);\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'before',\n node: scope[bpUntil].node,\n context,\n });\n return scope[bp]; // returning a new scope created\n }\n\n // A BP from and until (a BP compound). Example: Example 13/15@sm-md\n if (scope[bp]) {\n return scope[bp]; // exists the Scope.\n }\n\n const fromBp = bp.split('-')[0];\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'after',\n node: scope[fromBp].node,\n context,\n });\n\n return scope[bp]; // returning a new scope compounded created\n};\n\nexport default getScopeByclassName;\n","import config, { setStyles } from '../config/main';\nimport { IStyles } from '../helpers/createStyles';\nimport getScopeByclassName from '../helpers/getScopeByclassName';\n\nconst insertRules = (objStyles: IStyles) => {\n const intConfig = config();\n\n for (const className in objStyles) {\n if (!intConfig.styles[className]) {\n const nodeScope = getScopeByclassName(className);\n const valClass = objStyles[className];\n const rules = nodeScope.method.rules;\n nodeScope.method.insertRule(valClass, rules ? rules.length : 0);\n setStyles(className, valClass); // saving in styles vault\n }\n }\n};\n\nexport default insertRules;\n","const flexProsAndValsBase = {\n jc: {\n ruleCss: 'justify-content',\n classPrefix: 'jc'\n },\n ai: {\n ruleCss: 'align-items',\n classPrefix: 'ai'\n },\n ce: {\n ruleCss: 'center',\n classPrefix: 'ce'\n },\n fs: {\n ruleCss: 'flex-start',\n classPrefix: 'fs'\n },\n fe: {\n ruleCss: 'flex-end',\n classPrefix: 'fe'\n },\n sb: {\n ruleCss: 'space-between',\n classPrefix: 'sb'\n },\n sa: {\n ruleCss: 'space-around',\n classPrefix: 'sa'\n },\n fw: {\n ruleCss: 'flex-wrap',\n classPrefix: 'fw'\n },\n nw: {\n ruleCss: 'nowrap',\n classPrefix: 'nw'\n },\n w: {\n ruleCss: 'wrap',\n classPrefix: 'w'\n },\n wr: {\n ruleCss: 'wrap-reverse',\n classPrefix: 'wr'\n },\n fd: {\n ruleCss: 'flex-direction',\n classPrefix: 'fd'\n },\n r: {\n ruleCss: 'row',\n classPrefix: 'r'\n },\n rr: {\n ruleCss: 'row-reverse',\n classPrefix: 'rr'\n },\n co: {\n ruleCss: 'column',\n classPrefix: 'co'\n },\n cor: {\n ruleCss: 'column-reverse',\n classPrefix: 'co'\n },\n au: {\n ruleCss: 'auto',\n classPrefix: 'au'\n },\n st: {\n ruleCss: 'stretch',\n classPrefix: 'st'\n },\n bl: {\n ruleCss: 'baseline',\n classPrefix: 'bl'\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in'\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih'\n },\n}\n\nconst flexPropsAndValsSelfBase = {\n fg: {\n ruleCss: 'flex-grow',\n classPrefix: 'fg'\n },\n fh: {\n ruleCss: 'flex-shrink',\n classPrefix: 'fh'\n },\n as: {\n ruleCss: 'align-self',\n classPrefix: 'as'\n },\n or: {\n ruleCss: 'order',\n classPrefix: 'or'\n },\n}\n\nconst flexPropsAndValsSelf = {\n ...flexPropsAndValsSelfBase,\n 'flex-grow': flexPropsAndValsSelfBase.fg,\n 'flex-shrink': flexPropsAndValsSelfBase.fh,\n 'align-self': flexPropsAndValsSelfBase.as,\n order: flexPropsAndValsSelfBase.or,\n}\n\nexport const flexProsAndVals = {\n ...flexProsAndValsBase,\n ...flexPropsAndValsSelf,\n 'justify-content': flexProsAndValsBase.jc,\n 'align-items': flexProsAndValsBase.ai,\n center: flexProsAndValsBase.ce,\n 'flex-start': flexProsAndValsBase.fs,\n 'flex-end': flexProsAndValsBase.fe,\n 'space-between': flexProsAndValsBase.sb,\n 'space-around': flexProsAndValsBase.fs,\n 'flex-wrap': flexProsAndValsBase.fw,\n nowrap: flexProsAndValsBase.nw,\n w: flexProsAndValsBase.w,\n 'wrap-reverse': flexProsAndValsBase.wr,\n 'flex-direction': flexProsAndValsBase.fd,\n row: flexProsAndValsBase.r,\n 'row-reverse': flexProsAndValsBase.rr,\n column: flexProsAndValsBase.co,\n 'column-reverse': flexProsAndValsBase.cor,\n auto: flexProsAndValsBase.au,\n stretch: flexProsAndValsBase.st,\n baseline: flexProsAndValsBase.bl,\n initial: flexProsAndValsBase.in,\n inherit: flexProsAndValsBase.ih,\n};\n\nexport const flexAttrsSelf = Object.keys(flexPropsAndValsSelf);\n","const percentageConverter = (percentage: string) => {\r\n return '0¯' + percentage.replace('%', '');\r\n};\r\n\r\nexport default percentageConverter;\r\n","import { flexAttrsSelf } from '../config/flex';\nimport config from '../config/main';\nimport { processors, TDirectiveName } from '../config/processors';\nimport { IBpCals } from './buildCss';\nimport percentageConverter from './percentageConverter';\n\nexport interface IStyles {\n [name: string]: string;\n}\n\nconst createStyles = (directive: TDirectiveName, bps: IBpCals): IStyles => {\n const intConfig = config();\n const sizes = intConfig.sizes;\n const prefix = intConfig.prefix;\n const prop = processors[directive].ruleCss;\n const styles: IStyles = {};\n\n Object.keys(bps).forEach((bp) => {\n // preparing the className\n const shortNameClass = bps[bp].name;\n\n // just if have a percentage\n let nameClass = shortNameClass;\n if (shortNameClass.includes('%')) {\n nameClass = shortNameClass.replace( shortNameClass, percentageConverter(shortNameClass));\n }\n\n const finalPrefix = prefix ? prefix + '-' : '';\n nameClass = finalPrefix + processors[directive].classPrefix + '-' + nameClass.replace(/\\//g, '\\\\/').replace(/:/g, '\\\\:').replace('@', '\\\\@').split('.').join('_');\n\n if (!intConfig.styles[nameClass]) {\n // Property and value\n let propAndVal;\n if (directive === 'flex') {\n propAndVal = bps[bp].value;\n const flexImportant = shortNameClass.includes('!') ? ';display:flex !important;' : ';display:flex;';\n\n // Searching a flex self inside. ['as' for 'align-self']\n const attrsFlexSelfs = flexAttrsSelf.filter((nameAttrFlex) => shortNameClass.includes(nameAttrFlex + ':'));\n if (attrsFlexSelfs.length) {\n // if the items number of flex selft (+1) is diferrent so exists other flex attribute. Example: as:ce jc:ce\n if (attrsFlexSelfs.length + 1 !== shortNameClass.split(':').length) {\n propAndVal += flexImportant;\n }\n } else {\n propAndVal += flexImportant;\n }\n } else {\n propAndVal = prop + ':' + bps[bp].value;\n }\n\n let rule = '@media screen and ';\n let direct = false;\n if (!bp.includes('-')) {\n // no tiene until\n if (sizes[bp]) {\n rule += '(min-width: ' + sizes[bp] + 'px)';\n } else {\n rule = '.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}';\n direct = true;\n }\n } else {\n const bpSplited = bp.split('-');\n const bp1 = bpSplited[0];\n if (bp1) rule += '(min-width: ' + sizes[bp1] + 'px) and ';\n const bp2 = bpSplited[1];\n rule += '(max-width: ' + (sizes[bp2] - 1) + 'px)';\n }\n\n if (!direct) {\n rule += '{.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}}';\n }\n\n styles[nameClass] = rule;\n } else {\n styles[nameClass] = intConfig.styles[nameClass]\n }\n });\n return styles;\n};\n\nexport default createStyles;\n","import { IStyles } from './createStyles';\n\nconst replaceList = [\n ['/', ''],\n ['\\\\', '/'],\n ['/:', ':'],\n ['\\\\:', ':'],\n ['\\\\@', '@'],\n ['/@', '@'],\n];\n\nconst nameCleaner = (objStyles: IStyles): IStyles => {\n const obj: IStyles = {};\n for (const name in objStyles) {\n let newName = name;\n replaceList.forEach((reItem) => {\n newName = newName.split(reItem[0]).join(reItem[1]);\n });\n obj[newName] = objStyles[name];\n }\n return obj;\n};\n\nexport default nameCleaner;\n","import { TDirectiveName } from '../config/processors';\nimport insertRules from '../methods/insertRules';\nimport createStyles, { IStyles } from './createStyles';\nimport nameCleaner from './nameCleaner';\n\nexport interface IRBuildStyles {\n name: string;\n value: string;\n}\n\nexport interface IBpCals {\n [bpName: string]: IRBuildStyles;\n}\n\nexport interface IBuildCss {\n type: TDirectiveName;\n bps: IBpCals;\n deep: boolean;\n}\n\nconst buildCss = (data: IBuildCss): IStyles => {\n // creating the styles\n const objStyles = createStyles(data.type, data.bps);\n\n // Inserting CSS rules\n if (data.deep) {\n insertRules(objStyles);\n }\n\n // name classes cleaner\n return nameCleaner(objStyles);\n};\n\nexport default buildCss;\n","import prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\nimport calPercentage from '../helpers/calPercentage';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport getConfig from '../config/main';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildCols = (values: string, insertStyles = false): IStyles | Error => {\r\n let cols: number[];\r\n let bp;\r\n const bpCals: IBpCals = {};\r\n const config = getConfig();\r\n\r\n // Getting numbers\r\n let selectorName, propValue, paramPrepared;\r\n const directBp = Object.keys(config.breakpoints)[0];\r\n\r\n let err: boolean | Error = false;\r\n\r\n for (const item of values.split(' ')) {\r\n let param = item;\r\n selectorName = param;\r\n paramPrepared = prepareParam(param);\r\n bp = paramPrepared.breakPoints;\r\n param = paramPrepared.numbers;\r\n\r\n if (param.includes('/')) {\r\n const paramSplited = param.split('/');\r\n cols = [Number(paramSplited[0]), Number(paramSplited[1])];\r\n } else {\r\n if (paramPrepared.widthBp) {\r\n if (bp.includes('-')) {\r\n err = regError(\r\n 'SyntaxError',\r\n \"You can't determine a 'until breakpoint' when use the explicit columns max: \" +\r\n values\r\n );\r\n break;\r\n } else {\r\n cols = [Number(param), config.cols[bp] as number];\r\n }\r\n } else {\r\n cols = [Number(param), config.cols[directBp] as number];\r\n }\r\n }\r\n\r\n propValue = calPercentage(cols[0], cols[1]);\r\n if (paramPrepared.important) propValue += ' !important';\r\n\r\n bpCals[bp] = {\r\n name: selectorName,\r\n value: propValue,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'cols',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildCols;\r\n","import { flexAttrsSelf, flexProsAndVals } from '../config/flex';\nimport getConfig from '../config/main';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildFlex = (valFlex: string, insertStyles = false): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valFlex.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const flexSplited = paramPrepared.numbers.split(':');\n const nameProp = flexSplited[0] as keyof typeof flexProsAndVals; // 'fc' o 'or'\n const valProp = flexSplited[1] as keyof typeof flexProsAndVals; // 'ce' o '1'\n let valAlias: string;\n\n if (!flexAttrsSelf.includes(nameProp)) {\n if (!flexProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in Flex vault.\"\n );\n break;\n }\n if (!flexProsAndVals[valProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + valProp + \"' in Flex vault.\"\n );\n break;\n }\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + flexProsAndVals[valProp].ruleCss;\n valAlias = flexProsAndVals[valProp].classPrefix;\n } else {\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + valProp;\n valAlias = valProp;\n }\n\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!'\n }\n\n let selectorName = flexProsAndVals[nameProp].classPrefix + ':' + valAlias + sufixBp;\n\n if (!bpCals[bpNames]) {\n bpCals[bpNames] = {\n name: selectorName,\n value: propVal,\n };\n } else {\n if (selectorName.includes('@')) selectorName = selectorName.split('@')[0]; // just here because will be contact with the other className\n let prevName = bpCals[bpNames].name.split('@')[0];\n if (bpCals[bpNames].name.includes('!') && !prevName.includes('!')) prevName += '!';\n\n bpCals[bpNames].name = prevName + '-' + selectorName + sufixBp;\n bpCals[bpNames].value += ';' + propVal;\n }\n }\n\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'flex',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildFlex;\n","import calPercentage from './calPercentage';\n\nconst relativeMeasures = ['%', 'rem', 'em', 'ex', 'vw', 'vh', 'pt', 'cm', 'pc'];\n\nconst processedNumber = (n: string) => {\n let nProcessed;\n if (n.includes('/')) {\n nProcessed = n.split('/');\n nProcessed = calPercentage(\n parseFloat(nProcessed[0]),\n parseFloat(nProcessed[1])\n );\n } else if (n === 'auto') {\n nProcessed = 'auto';\n } else {\n const relativeUnits = relativeMeasures.filter((unit) => {\n return n.includes(unit);\n });\n if (relativeUnits.length) {\n nProcessed = n;\n } else {\n nProcessed = n === '0' ? n : n + 'px';\n }\n }\n return nProcessed;\n};\n\nexport default processedNumber;\n","import { TDirectiveName } from '../config/processors';\nimport buildCss, { IBpCals } from './buildCss';\nimport { IStyles } from './createStyles';\nimport prepareParam from './prepareParam';\nimport processedNumber from './processedNumber';\n\nconst buildAttr = (\n values: string,\n directive: TDirectiveName,\n insertStyles = false\n): IStyles => {\n const bpCals: IBpCals = {};\n\n values.split(' ').forEach((param) => {\n const paramProcessed = prepareParam(param);\n const bpNames = paramProcessed.breakPoints;\n\n // processing number values\n let propValue = paramProcessed.numbers\n .split('-')\n .map((n) => processedNumber(n))\n .join(' ');\n if (paramProcessed.important) propValue += ' !important';\n bpCals[bpNames] = {\n name: param,\n value: propValue,\n };\n });\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: directive,\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildAttr;\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPad = (valPads: string, insertStyles = false) => {\r\n return buildAttr(valPads, 'pad', insertStyles);\r\n};\r\n\r\nexport default buildPad;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadTop = (valPadTop: string, insertStyles = false) => {\r\n return buildAttr(valPadTop, 'padt', insertStyles);\r\n};\r\n\r\nexport default buildPadTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadRight = (valPadRight: string, insertStyles = false) => {\r\n return buildAttr(valPadRight, 'padr', insertStyles);\r\n};\r\n\r\nexport default buildPadRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadBottom = (valPadBottom: string, insertStyles = false) => {\r\n return buildAttr(valPadBottom, 'padb', insertStyles);\r\n};\r\n\r\nexport default buildPadBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadLeft = (valPadLeft: string, insertStyles = false) => {\r\n return buildAttr(valPadLeft, 'padl', insertStyles);\r\n};\r\n\r\nexport default buildPadLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMar = (valMars: string, insertStyles = false) => {\r\n return buildAttr(valMars, 'mar', insertStyles);\r\n};\r\n\r\nexport default buildMar;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarTop = (valMarTop: string, insertStyles = false) => {\r\n return buildAttr(valMarTop, 'mart', insertStyles);\r\n};\r\n\r\nexport default buildMarTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarRight = (valMarRight: string, insertStyles = false) => {\r\n return buildAttr(valMarRight, 'marr', insertStyles);\r\n};\r\n\r\nexport default buildMarRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarBottom = (valMarBottom: string, insertStyles = false) => {\r\n return buildAttr(valMarBottom, 'marb', insertStyles);\r\n};\r\n\r\nexport default buildMarBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarLeft = (valMarLeft: string, insertStyles = false) => {\r\n return buildAttr(valMarLeft, 'marl', insertStyles);\r\n};\r\n\r\nexport default buildMarLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxWidth = (valMaxWidth: string, insertStyles = false) => {\r\n return buildAttr(valMaxWidth, 'mxw', insertStyles);\r\n};\r\n\r\nexport default buildMaxWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxHeight = (valMaxHeight: string, insertStyles = false) => {\r\n return buildAttr(valMaxHeight, 'mxh', insertStyles);\r\n};\r\n\r\nexport default buildMaxHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinWidth = (valMinWidth: string, insertStyles = false) => {\r\n return buildAttr(valMinWidth, 'miw', insertStyles);\r\n};\r\n\r\nexport default buildMinWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinHeight = (valMinHeight: string, insertStyles = false) => {\r\n return buildAttr(valMinHeight, 'mih', insertStyles);\r\n};\r\n\r\nexport default buildMinHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildHeight = (valHeight: string, insertStyles = false) => {\r\n return buildAttr(valHeight, 'hgt', insertStyles);\r\n};\r\n\r\nexport default buildHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildWidth = (valWidth: string, insertStyles = false) => {\r\n return buildAttr(valWidth, 'wdh', insertStyles);\r\n};\r\n\r\nexport default buildWidth;\r\n","const positionProsAndValsBase = {\n st: {\n ruleCss: 'static',\n classPrefix: 'st',\n },\n ab: {\n ruleCss: 'absolute',\n classPrefix: 'ab',\n },\n fi: {\n ruleCss: 'fixed',\n classPrefix: 'fi',\n },\n re: {\n ruleCss: 'relative',\n classPrefix: 're',\n },\n si: {\n ruleCss: 'sticky',\n classPrefix: 'si',\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in',\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih',\n },\n}\n\n\nexport const positionProsAndVals = {\n ...positionProsAndValsBase,\n static: positionProsAndValsBase.st,\n absolute: positionProsAndValsBase.ab,\n fixed: positionProsAndValsBase.fi,\n relative: positionProsAndValsBase.re,\n sticky: positionProsAndValsBase.si,\n initial: positionProsAndValsBase.in,\n inherit: positionProsAndValsBase.ih,\n};\n","import getConfig from '../config/main';\nimport { positionProsAndVals } from '../config/position';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildPosition = (\n valPos: string,\n insertStyles = false\n): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valPos.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const nameProp = paramPrepared.numbers as keyof typeof positionProsAndVals;\n\n if (!positionProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in Position vault.\"\n );\n break;\n }\n\n propVal = positionProsAndVals[nameProp].ruleCss;\n let className = positionProsAndVals[nameProp].classPrefix;\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!'\n }\n\n bpCals[bpNames] = {\n name: className + sufixBp,\n value: propVal,\n };\n }\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'pos',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildPosition;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildTop = (val: string, insertStyles = false) => {\n return buildAttr(val, 't', insertStyles);\n};\n\nexport default buildTop;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildRight = (val: string, insertStyles = false) => {\n return buildAttr(val, 'r', insertStyles);\n};\n\nexport default buildRight;\n","import buildAttr from '../helpers/buildAttr';\nimport { IStyles } from '../helpers/createStyles';\n\nconst buildBottom = (val: string, insertStyles = false): IStyles => {\n return buildAttr(val, 'b', insertStyles);\n};\n\nexport default buildBottom;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildLeft = (val: string, insertStyles = false) => {\n return buildAttr(val, 'l', insertStyles);\n};\n\nexport default buildLeft;\n","import buildCols from '../methods/buildCols';\nimport buildFlex from '../methods/buildFlex';\nimport buildPad from '../methods/buildPad';\nimport buildPadTop from '../methods/buildPadTop';\nimport buildPadRight from '../methods/buildPadRight';\nimport buildPadBottom from '../methods/buildPadBottom';\nimport buildPadLeft from '../methods/buildPadLeft';\nimport buildMar from '../methods/buildMar';\nimport buildMarTop from '../methods/buildMarTop';\nimport buildMarRight from '../methods/buildMarRight';\nimport buildMarBottom from '../methods/buildMarBottom';\nimport buildMarLeft from '../methods/buildMarLeft';\nimport buildMaxWidth from '../methods/buildMaxWidth';\nimport buildMaxHeight from '../methods/buildMaxHeight';\nimport buildMinWidth from '../methods/buildMinWidth';\nimport buildMinHeight from '../methods/buildMinHeight';\nimport buildHeight from '../methods/buildHeight';\nimport buildWidth from '../methods/buildWidth';\nimport buildPosition from '../methods/buildPosition';\nimport buildTop from '../methods/buildTop';\nimport buildRight from '../methods/buildRight';\nimport buildBottom from '../methods/buildBottom';\nimport buildLeft from '../methods/buildLeft';\n\nimport { IStyles } from '../helpers/createStyles';\n\ntype TDirectiveNameBase =\n | 'cols'\n | 'pad'\n | 'padt'\n | 'padr'\n | 'padb'\n | 'padl'\n | 'mar'\n | 'mart'\n | 'marr'\n | 'marb'\n | 'marl'\n | 'flex'\n | 'mxw'\n | 'mxh'\n | 'miw'\n | 'mih'\n | 'wdh'\n | 'hgt'\n | 'pos'\n | 't'\n | 'r'\n | 'b'\n | 'l';\n\ntype TDirectiveNameExtended =\n | 'c'\n | 'fx'\n | 'p'\n | 'padding'\n | 'pt'\n | 'padding-top'\n | 'pr'\n | 'padding-right'\n | 'pb'\n | 'padding-bottom'\n | 'pl'\n | 'padding-left'\n | 'm'\n | 'margin'\n | 'mt'\n | 'margin-top'\n | 'mr'\n | 'margin-right'\n | 'mb'\n | 'margin-bottom'\n | 'ml'\n | 'margin-left'\n | 'w'\n | 'width'\n | 'h'\n | 'height'\n | 'max-width'\n | 'max-height'\n | 'min-width'\n | 'min-height'\n | 'position'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left';\n\nexport type TDirectiveName = TDirectiveNameBase | TDirectiveNameExtended;\n\nexport interface IProcessor {\n build: (values: string, insertStyles: boolean) => IStyles | Error;\n ruleCss: string;\n classPrefix: string;\n}\n\nconst processorsBase: Record = {\n cols: {\n build: buildCols,\n ruleCss: 'width',\n classPrefix: 'c'\n },\n\n // Paddings\n pad: {\n build: buildPad,\n ruleCss: 'padding',\n classPrefix: 'p'\n },\n padt: {\n build: buildPadTop,\n ruleCss: 'padding-top',\n classPrefix: 'pt'\n },\n padr: {\n build: buildPadRight,\n ruleCss: 'padding-right',\n classPrefix: 'pr'\n },\n padb: {\n build: buildPadBottom,\n ruleCss: 'padding-bottom',\n classPrefix: 'pb'\n },\n padl: {\n build: buildPadLeft,\n ruleCss: 'padding-left',\n classPrefix: 'pl'\n },\n\n // Margin\n mar: {\n build: buildMar,\n ruleCss: 'margin',\n classPrefix: 'm'\n },\n mart: {\n build: buildMarTop,\n ruleCss: 'margin-top',\n classPrefix: 'mt'\n },\n marr: {\n build: buildMarRight,\n ruleCss: 'margin-right',\n classPrefix: 'mr'\n },\n marb: {\n build: buildMarBottom,\n ruleCss: 'margin-bottom',\n classPrefix: 'mb'\n },\n marl: {\n build: buildMarLeft,\n ruleCss: 'margin-left',\n classPrefix: 'ml'\n },\n\n // Flex Box\n flex: {\n build: buildFlex,\n ruleCss: 'display: flex',\n classPrefix: 'fx'\n },\n\n // Max & Min Width & Height\n mxw: {\n build: buildMaxWidth,\n ruleCss: 'max-width',\n classPrefix: 'mxw'\n },\n\n mxh: {\n build: buildMaxHeight,\n ruleCss: 'max-height',\n classPrefix: 'mxh'\n },\n\n miw: {\n build: buildMinWidth,\n ruleCss: 'min-width',\n classPrefix: 'miw'\n },\n\n mih: {\n build: buildMinHeight,\n ruleCss: 'min-height',\n classPrefix: 'mih'\n },\n\n // Width & Height\n wdh: {\n build: buildWidth,\n ruleCss: 'width',\n classPrefix: 'w'\n },\n\n hgt: {\n build: buildHeight,\n ruleCss: 'height',\n classPrefix: 'h'\n },\n\n // Position\n pos: {\n build: buildPosition,\n ruleCss: 'position',\n classPrefix: 'pos'\n },\n t: {\n build: buildTop,\n ruleCss: 'top',\n classPrefix: 't'\n },\n r: {\n build: buildRight,\n ruleCss: 'right',\n classPrefix: 'r'\n },\n b: {\n build: buildBottom,\n ruleCss: 'bottom',\n classPrefix: 'b'\n },\n l: {\n build: buildLeft,\n ruleCss: 'left',\n classPrefix: 'l'\n }\n};\n\nexport const processors: Record = {\n ...processorsBase,\n c: processorsBase.cols,\n fx: processorsBase.flex,\n p: processorsBase.pad,\n padding: processorsBase.pad,\n pt: processorsBase.padt,\n 'padding-top': processorsBase.padt,\n pr: processorsBase.padr,\n 'padding-right': processorsBase.padr,\n pb: processorsBase.padb,\n 'padding-bottom': processorsBase.padb,\n pl: processorsBase.padl,\n 'padding-left': processorsBase.padl,\n m: processorsBase.mar,\n margin: processorsBase.mar,\n mt: processorsBase.mart,\n 'margin-top': processorsBase.mart,\n mr: processorsBase.marr,\n 'margin-right': processorsBase.marr,\n mb: processorsBase.marb,\n 'margin-bottom': processorsBase.marb,\n ml: processorsBase.marl,\n 'margin-left': processorsBase.marl,\n w: processorsBase.wdh,\n width: processorsBase.wdh,\n h: processorsBase.hgt,\n height: processorsBase.hgt,\n 'max-width': processorsBase.mxw,\n 'max-height': processorsBase.mxh,\n 'min-width': processorsBase.miw,\n 'min-height': processorsBase.mih,\n position: processorsBase.pos,\n top: processorsBase.t,\n right: processorsBase.r,\n bottom: processorsBase.b,\n left: processorsBase.l,\n};\n","import { processors, TDirectiveName } from '../config/processors';\r\n\r\nconst getParameters = (\r\n Node: HTMLElement | Element\r\n): Partial> => {\r\n const params: Partial> = {};\r\n const attrs = Node.attributes;\r\n const paramNames = Object.keys(processors);\r\n Array.prototype.forEach.call(attrs, (attr) => {\r\n if (paramNames.includes(attr.name)) {\r\n if (attr.value !== '')\r\n params[attr.name as TDirectiveName] = attr.value\r\n .trim()\r\n .split(' ')\r\n .filter((item: string) => item)\r\n .join(' ');\r\n }\r\n });\r\n return params;\r\n};\r\n\r\nexport default getParameters;\r\n","import { processors, TDirectiveName } from '../config/processors';\nimport { IStyles } from '../helpers/createStyles';\n\nexport interface IBuildResult {\n [prop: string]: IStyles | boolean;\n}\n\nconst build = (\n obj: Partial>,\n insertStyles = false\n): Partial | Error => {\n const rObj: Partial = {};\n let err: Error | boolean = false;\n for (const prop in obj) {\n const propData = processors[prop as TDirectiveName];\n const objStyles: IStyles | Error = propData.build(\n obj[prop as TDirectiveName] as string,\n insertStyles\n );\n if (objStyles instanceof Error) {\n err = objStyles;\n break;\n } else {\n rObj[prop] = objStyles;\n }\n }\n\n if (err) return err;\n return rObj;\n};\n\nexport default build;\n","import getConfig from '../config/main';\n\nconst addClasses = (\n Node: HTMLElement | Element,\n classesNames: string,\n overwrite?: boolean\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n const names = classesNames.split(' ');\n let classesToAdd: string[] = names;\n if (!overwrite) {\n classesToAdd = names.filter((name) => !Node.classList.contains(name));\n if (!classesToAdd.length) {\n resolve();\n return;\n }\n }\n\n const obsNode = new config.context.MutationObserver((mutations) => {\n const target = mutations[0].target;\n const currentClasses = (target as Element).className.split(' ');\n const containsAll = names.every((element) =>\n currentClasses.includes(element)\n );\n if (containsAll) {\n obsNode.disconnect();\n resolve();\n }\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: ['class'],\n characterData: false,\n });\n\n if (overwrite) {\n Node.className = classesNames;\n } else {\n const space = Node.hasAttribute('class') ? ' ' : '';\n Node.className += space + classesToAdd.join(' ');\n }\n });\n};\n\nexport default addClasses;\n","import getConfig from '../config/main';\n\nexport const removeProp = (\n Node: HTMLElement | Element,\n propName: string,\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n if (!Node.hasAttribute(propName)) {\n resolve();\n return;\n }\n const obsNode = new context.MutationObserver(() => {\n obsNode.disconnect();\n resolve();\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: [propName],\n characterData: false,\n });\n Node.removeAttribute(propName);\n });\n};\n\nexport const removeProps = (\n Node: HTMLElement | Element,\n propNames: string[],\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n const promises = propNames.map((name) => removeProp(Node, name, context));\n Promise.all(promises).then(() => resolve());\n });\n};\n\nconst removeAttr = (\n Node: HTMLElement | Element,\n propNames: string | string[]\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n if (Array.isArray(propNames)) {\n removeProps(Node, propNames, config.context).then(resolve);\n } else {\n removeProp(Node, propNames, config.context).then(resolve);\n }\n });\n};\n\nexport default removeAttr;\n","import getConfig from '../config/main';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nexport interface IEventReady {\n node: HTMLElement | Element;\n directive: string | string[];\n classes: string;\n resolve: (value: void | Error | PromiseLike) => void;\n}\n\nconst eventReady = ({ node, directive, classes, resolve }: IEventReady) => {\n const config = getConfig();\n removeAttr(node, directive)\n .then(() => addClasses(node, classes))\n .then(() => {\n resolve();\n const event = new config.context.CustomEvent('layout:ready');\n node.dispatchEvent(event);\n });\n};\n\nexport default eventReady;\n","import { IStyles } from '../helpers/createStyles';\nimport regError from '../helpers/regError';\nimport build, { IBuildResult } from './build';\nimport getParameters from './getParameters';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst set = (\n Node: HTMLElement | Element,\n parameters?: Partial>\n): Promise => {\n return new Promise((resolve, reject) => {\n const params = parameters || getParameters(Node);\n const arrParams = Object.keys(params);\n if (!arrParams.length) {\n const err = regError(\n 'Parameter Missing',\n \"don't exists any parameter to process\",\n Node\n );\n reject(err);\n return;\n }\n\n const toBuild: Partial> = {};\n for (const prop in params) {\n toBuild[prop as TDirectiveName] = params[prop as TDirectiveName];\n }\n\n // creating classes names and inserting that classes to the core\n const classesObj = build(toBuild as Record, true);\n if (classesObj instanceof Error) {\n reject(classesObj);\n return;\n }\n\n // adding classes\n const classes = classesObj as Partial;\n const classesNames = Object.keys(classes)\n .map((name: string) => Object.keys(classes[name] as IStyles))\n .flat()\n .join(' ');\n\n // removing unnecessary props\n eventReady({\n node: Node,\n directive: arrParams,\n classes: classesNames,\n resolve,\n });\n });\n};\n\nexport default set;\n","import regError from '../helpers/regError';\nimport buildFlex from './buildFlex';\nimport eventReady from '../helpers/eventReady';\n\nconst setFlex = (\n Node: HTMLElement | Element,\n flexValues?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = flexValues || Node.getAttribute('flex');\n if (!values) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"flex\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildFlex(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'flex',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setFlex;\n","import regError from '../helpers/regError';\nimport buildCols from './buildCols';\nimport eventReady from '../helpers/eventReady';\n\nconst setCols = (\n Node: HTMLElement | Element,\n columns?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = columns || Node.getAttribute('cols');\n if (!values) {\n const err = regError(\n 'Empty',\n \"The value of the directive 'cols' is empty\",\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildCols(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'cols',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setCols;\n","import buildAttr from '../helpers/buildAttr';\nimport regError from '../helpers/regError';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst setAttr = (\n Node: HTMLElement | Element,\n directive: TDirectiveName,\n values?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const directiveValues = values || Node.getAttribute(directive);\n if (!directiveValues) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"' + directive + '\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildAttr(directiveValues, directive, true);\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive,\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setAttr;\n","import setAttr from './setAttr';\r\n\r\nconst setHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'hgt', values);\r\n};\r\n\r\nexport default setHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marb', values);\r\n};\r\n\r\nexport default setMarBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marl', values);\r\n};\r\n\r\nexport default setMarLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marr', values);\r\n};\r\n\r\nexport default setMarRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMar = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mar', values);\r\n};\r\n\r\nexport default setMar;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mart', values);\r\n};\r\n\r\nexport default setMarTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxw', values);\r\n};\r\n\r\nexport default setMaxWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mih', values);\r\n};\r\n\r\nexport default setMinHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'miw', values);\r\n};\r\n\r\nexport default setMinWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padb', values);\r\n};\r\n\r\nexport default setPadBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padl', values);\r\n};\r\n\r\nexport default setPadLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padr', values);\r\n};\r\n\r\nexport default setPadRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPad = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'pad', values);\r\n};\r\n\r\nexport default setPad;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padt', values);\r\n};\r\n\r\nexport default setPadTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'wdh', values);\r\n};\r\n\r\nexport default setWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxh', values);\r\n};\r\n\r\nexport default setMaxHeight;\r\n","import setAttr from './setAttr';\n\nconst setPosition = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'pos', values);\n};\n\nexport default setPosition;\n","import setAttr from './setAttr';\n\nconst setTop = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 't', values);\n};\n\nexport default setTop;\n","import setAttr from './setAttr';\n\nconst setRight = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'r', values);\n};\n\nexport default setRight;\n","import setAttr from './setAttr';\n\nconst setBottom = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'b', values);\n};\n\nexport default setBottom;\n","import setAttr from './setAttr';\n\nconst setLeft = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'l', values);\n};\n\nexport default setLeft;\n","import { TDirectiveName } from './../config/processors';\nimport { processors } from '../config/processors';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nconst reset = (Node: HTMLElement | Element): Promise => {\n return new Promise((resolve) => {\n const classPrefixes = new Set(Object.keys(processors).map( item => processors[item as TDirectiveName].classPrefix));\n const layouterClasses = [ ...classPrefixes];\n const restClass = Node.className.split(' ').filter((name) => {\n if ( !name.includes('-')) {\n return true;\n } else {\n const findClass = layouterClasses.find( item => {\n const nLength = item.length;\n const namePrefix = name.substring(0, nLength + 1);\n return namePrefix === item + '-'\n })\n return !findClass\n }\n });\n\n if (restClass.length) {\n const classesName = restClass.join(' ');\n addClasses(Node, classesName, true).then(() => {\n resolve();\n });\n } else {\n removeAttr(Node, 'class').then(() => {\n resolve();\n });\n }\n\n });\n};\n\nexport default reset;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\n\nconst searchAndProcess = (\n layouter: ILayouter,\n context: Document | HTMLElement | Element\n) => {\n return new Promise((resolve) => {\n const props = Object.keys(processors);\n const attrs = props.map((prop) => `[${prop}]`).join(', ');\n const nodes = context.querySelectorAll(attrs);\n if (!nodes.length) {\n resolve(layouter);\n return;\n }\n\n const setNodes = new Set();\n Array.prototype.forEach.call(nodes, (itemNode) => {\n setNodes.add(itemNode);\n });\n const promises: Promise[] = [];\n setNodes.forEach((node) => {\n promises.push(layouter.set(node as Element | HTMLElement));\n });\n Promise.all(promises).then(resolve);\n });\n};\n\nexport default searchAndProcess;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\nimport getConfig from '../config/main';\nimport searchAndProcess from './searchAndProcess';\n\nconst mainObserver = (layouter: ILayouter) => {\n const config = getConfig();\n const props = Object.keys(processors);\n const obsBody = new layouter.context.MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n if (!mutation.addedNodes.length) {\n continue;\n }\n mutation.addedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n searchAndProcess(layouter, node);\n }\n });\n } else if (mutation.type === 'attributes') {\n const node = mutation.target;\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n }\n }\n }\n });\n const observerOptions = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: props,\n characterData: false,\n };\n obsBody.observe(config.context.document.body, observerOptions);\n};\n\nexport default mainObserver;\n","import { IConfig, IConfigUser, setConfig, updateConfig } from './config/main';\nimport getParameters from './methods/getParameters';\n\nimport build from './methods/build';\nimport buildCols from './methods/buildCols';\nimport buildFlex from './methods/buildFlex';\nimport buildPad from './methods/buildPad';\nimport buildPadTop from './methods/buildPadTop';\nimport buildPadRight from './methods/buildPadRight';\nimport buildPadBottom from './methods/buildPadBottom';\nimport buildPadLeft from './methods/buildPadLeft';\nimport buildMar from './methods/buildMar';\nimport buildMarTop from './methods/buildMarTop';\nimport buildMarRight from './methods/buildMarRight';\nimport buildMarBottom from './methods/buildMarBottom';\nimport buildMarLeft from './methods/buildMarLeft';\nimport buildMaxWidth from './methods/buildMaxWidth';\nimport buildMaxHeight from './methods/buildMaxHeight';\nimport buildMinWidth from './methods/buildMinWidth';\nimport buildMinHeight from './methods/buildMinHeight';\nimport buildHeight from './methods/buildHeight';\nimport buildWidth from './methods/buildWidth';\nimport buildPosition from './methods/buildPosition';\nimport buildTop from './methods/buildTop';\nimport buildRight from './methods/buildRight';\nimport buildBottom from './methods/buildBottom';\nimport buildLeft from './methods/buildLeft';\n\nimport set from './methods/set';\nimport setFlex from './methods/setFlex';\nimport setCols from './methods/SetCols';\nimport setHeight from './methods/setHeight';\nimport setMarBottom from './methods/setMarBottom';\nimport setMarLeft from './methods/setMarLeft';\nimport setMarRight from './methods/setMarRight';\nimport setMar from './methods/setMar';\nimport setMarTop from './methods/setMarTop';\nimport setMaxWidth from './methods/setMaxWidth';\nimport setMinHeight from './methods/setMinHeight';\nimport setMinWidth from './methods/setMinWidth';\nimport setPadBottom from './methods/setPadBottom';\nimport setPadLeft from './methods/setPadLeft';\nimport setPadRight from './methods/setPadRight';\nimport setPad from './methods/setPad';\nimport setPadTop from './methods/setPadTop';\nimport setWidth from './methods/setWidth';\nimport setMaxHeight from './methods/setMaxHeight';\nimport setPosition from './methods/setPosition';\nimport setTop from './methods/setTop';\nimport setRight from './methods/setRight';\nimport setBottom from './methods/setBottom';\nimport setLeft from './methods/setLeft';\n\nimport insertRules from './methods/insertRules';\nimport reset from './methods/reset';\n\nimport { IStyles } from './helpers/createStyles';\nimport { IBuildResult } from './methods/build';\nimport searchAndProcess from './helpers/searchAndProcess';\nimport mainObserver from './helpers/mainObserver';\nimport { TDirectiveName } from './config/processors';\n\nexport interface ILayouter extends IConfig {\n getParameters: (\n Node: HTMLElement | Element\n ) => Partial>;\n updateConfig: (userConfig: Partial>) => IConfig;\n build: (\n obj: Partial>,\n insertStyles?: boolean\n ) => Partial | Error;\n buildCols: (valCols: string, insertStyles?: boolean) => IStyles | Error;\n buildFlex: (valFlex: string, insertStyles?: boolean) => IStyles | Error;\n buildPad: (valPads: string, insertStyles?: boolean) => IStyles;\n buildPadTop: (valPadTop: string, insertStyles?: boolean) => IStyles;\n buildPadRight: (valPadRight: string, insertStyles?: boolean) => IStyles;\n buildPadBottom: (valPadBottom: string, insertStyles?: boolean) => IStyles;\n buildPadLeft: (valPadLeft: string, insertStyles?: boolean) => IStyles;\n buildMar: (valMars: string, insertStyles?: boolean) => IStyles;\n buildMarTop: (valMarTop: string, insertStyles?: boolean) => IStyles;\n buildMarRight: (valMarRight: string, insertStyles?: boolean) => IStyles;\n buildMarBottom: (valMarBottom: string, insertStyles?: boolean) => IStyles;\n buildMarLeft: (valMarLeft: string, insertStyles?: boolean) => IStyles;\n buildMaxWidth: (valMaxWidth: string, insertStyles?: boolean) => IStyles;\n buildMaxHeight: (valMaxHeight: string, insertStyles?: boolean) => IStyles;\n buildMinWidth: (valMinWidth: string, insertStyles?: boolean) => IStyles;\n buildMinHeight: (valMinHeight: string, insertStyles?: boolean) => IStyles;\n buildHeight: (valHeight: string, insertStyles?: boolean) => IStyles;\n buildWidth: (valWidth: string, insertStyles?: boolean) => IStyles;\n buildPosition: (\n valPosition: string,\n insertStyles?: boolean\n ) => IStyles | Error;\n buildTop: (valTop: string, insertStyles?: boolean) => IStyles | Error;\n buildRight: (valRight: string, insertStyles?: boolean) => IStyles | Error;\n buildBottom: (valBottom: string, insertStyles?: boolean) => IStyles | Error;\n buildLeft: (valLeft: string, insertStyles?: boolean) => IStyles | Error;\n\n set: (\n Node: HTMLElement | Element,\n parameters?: Partial>\n ) => Promise;\n setCols: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setFlex: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMar: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPad: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPosition: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n setTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n insertRules: (objStyles: IStyles) => void;\n reset: (Node: HTMLElement | Element) => Promise;\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouter: ILayouter;\n }\n}\n\nconst layouter = (\n context: Window & typeof globalThis,\n userConfig: Partial = {}\n): ILayouter => {\n const config = setConfig(context, userConfig);\n\n const instance = {\n ...config,\n getParameters,\n updateConfig,\n insertRules,\n build,\n buildCols,\n buildFlex,\n buildPad,\n buildPadTop,\n buildPadRight,\n buildPadBottom,\n buildPadLeft,\n buildMar,\n buildMarTop,\n buildMarRight,\n buildMarBottom,\n buildMarLeft,\n buildMaxWidth,\n buildMaxHeight,\n buildMinWidth,\n buildMinHeight,\n buildHeight,\n buildWidth,\n set,\n setCols,\n setFlex,\n setMar,\n setMarTop,\n setMarRight,\n setMarBottom,\n setMarLeft,\n setPad,\n setPadTop,\n setPadRight,\n setPadBottom,\n setPadLeft,\n setWidth,\n setMinWidth,\n setMaxWidth,\n setHeight,\n setMinHeight,\n setMaxHeight,\n reset,\n buildPosition,\n buildTop,\n buildRight,\n buildBottom,\n buildLeft,\n setPosition,\n setTop,\n setRight,\n setBottom,\n setLeft,\n };\n\n // Auto init process\n searchAndProcess(instance, context.document).then(() => {\n if (instance.ready) instance.ready(instance);\n mainObserver(instance);\n });\n\n return instance;\n};\n\nif (typeof window !== 'undefined' && typeof exports === 'undefined') {\n window.layouter = layouter(window);\n}\n\nexport default layouter;\n"],"names":["config"],"mappings":"2OAkBA,KAAM,GAA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AAW,GACX,QAAS,GACT,WAAY,GACZ,gBAAiB,EACjB,cAAe,EAAA,EAEjB,EAAQ,QAAQ,EAAO,QAAQ,SAAS,KAAM,CAAe,CAC/D,ECqKM,GAAW,CACf,EACA,EAAmC,KACrB,CAGd,KAAM,GAAW,CACf,GAHa,GAAU,EAAS,CAAU,EAI1C,iBACA,gBACA,cACA,SACA,YACA,YACA,WACA,cACA,gBACA,iBACA,eACA,WACA,cACA,gBACA,iBACA,eACA,gBACA,iBACA,iBACA,kBACA,eACA,cACA,OACA,WACA,WACA,UACA,aACA,eACA,gBACA,cACA,UACA,aACA,eACA,gBACA,cACA,YACA,eACA,eACA,aACA,gBACA,gBACA,SACA,iBACA,YACA,cACA,eACA,aACA,eACA,UACA,YACA,aACA,UAAA,EAIF,UAAiB,EAAU,EAAQ,QAAQ,EAAE,KAAK,IAAM,CACtD,AAAI,EAAS,OAAO,EAAS,MAAM,CAAQ,EAC3C,GAAa,CAAQ,CAAA,CACtB,EAEM,CACT,EAEA,MAAI,OAAO,SAAW,aAAe,MAAO,UAAY,aAC/C,QAAA,SAAW,GAAS,MAAM"} \ No newline at end of file +{"version":3,"file":"layouter.umd.js","sources":["../src/helpers/breakpointsNums.ts","../src/helpers/createScopeStyles.ts","../src/helpers/scopesStylesBuilder.ts","../src/helpers/breakpointsOrdered.ts","../src/config/main.ts","../src/helpers/prepareParam.ts","../src/helpers/regError.ts","../src/helpers/calPercentage.ts","../src/helpers/getScopeByclassName.ts","../src/methods/insertRules.ts","../src/config/flex.ts","../src/helpers/percentageConverter.ts","../src/helpers/createStyles.ts","../src/helpers/nameCleaner.ts","../src/helpers/buildCss.ts","../src/methods/buildCols.ts","../src/methods/buildFlex.ts","../src/helpers/processedNumber.ts","../src/helpers/buildAttr.ts","../src/methods/buildPad.ts","../src/methods/buildPadTop.ts","../src/methods/buildPadRight.ts","../src/methods/buildPadBottom.ts","../src/methods/buildPadLeft.ts","../src/methods/buildMar.ts","../src/methods/buildMarTop.ts","../src/methods/buildMarRight.ts","../src/methods/buildMarBottom.ts","../src/methods/buildMarLeft.ts","../src/methods/buildMaxWidth.ts","../src/methods/buildMaxHeight.ts","../src/methods/buildMinWidth.ts","../src/methods/buildMinHeight.ts","../src/methods/buildHeight.ts","../src/methods/buildWidth.ts","../src/config/position.ts","../src/methods/buildPosition.ts","../src/methods/buildTop.ts","../src/methods/buildRight.ts","../src/methods/buildBottom.ts","../src/methods/buildLeft.ts","../src/config/display.ts","../src/config/processors.ts","../src/methods/buildDisplay.ts","../src/methods/getParameters.ts","../src/methods/build.ts","../src/utils/addClasses.ts","../src/utils/removeAttr.ts","../src/helpers/eventReady.ts","../src/methods/set.ts","../src/methods/setFlex.ts","../src/methods/SetCols.ts","../src/methods/setAttr.ts","../src/methods/setHeight.ts","../src/methods/setMarBottom.ts","../src/methods/setMarLeft.ts","../src/methods/setMarRight.ts","../src/methods/setMar.ts","../src/methods/setMarTop.ts","../src/methods/setMaxWidth.ts","../src/methods/setMinHeight.ts","../src/methods/setMinWidth.ts","../src/methods/setPadBottom.ts","../src/methods/setPadLeft.ts","../src/methods/setPadRight.ts","../src/methods/setPad.ts","../src/methods/setPadTop.ts","../src/methods/setWidth.ts","../src/methods/setMaxHeight.ts","../src/methods/setPosition.ts","../src/methods/setTop.ts","../src/methods/setRight.ts","../src/methods/setBottom.ts","../src/methods/setLeft.ts","../src/methods/reset.ts","../src/helpers/searchAndProcess.ts","../src/helpers/mainObserver.ts","../src/layouter.ts"],"sourcesContent":["export type TNumProp = 'width' | 'cols';\r\n\r\nexport interface IBreakpoint {\r\n alias: string;\r\n width: number;\r\n}\r\n\r\nexport interface IBreakpoints {\r\n [alias: string]: {\r\n width: number;\r\n cols: number;\r\n };\r\n}\r\n\r\nexport interface IBreakpointObj {\r\n [alias: string]: number;\r\n}\r\n\r\nconst breakpointsNums = (\r\n objBps: IBreakpoints,\r\n propName: TNumProp\r\n): IBreakpointObj => {\r\n const sizes: IBreakpointObj = {};\r\n\r\n if (propName === 'width') {\r\n Object.keys(objBps)\r\n .map((bp: string) => {\r\n return {\r\n alias: bp,\r\n width: objBps[bp].width,\r\n };\r\n })\r\n .sort((a: IBreakpoint, b: IBreakpoint) =>\r\n a.width > b.width ? 1 : b.width > a.width ? -1 : 0\r\n )\r\n .forEach((bp: IBreakpoint, index: number) => {\r\n sizes[bp.alias] = !index ? 0 : objBps[bp.alias][propName];\r\n });\r\n } else {\r\n Object.keys(objBps).forEach((bp) => {\r\n sizes[bp] = objBps[bp][propName];\r\n });\r\n }\r\n\r\n return sizes;\r\n};\r\n\r\nexport default breakpointsNums;\r\n","export type TInsertion = 'before' | 'after' | 'append';\n\nexport interface ICreateScopeStyles {\n bridge?: boolean;\n bp: string;\n insertionType: TInsertion;\n node: HTMLElement;\n context: Window & typeof globalThis;\n}\n\nexport interface IRCreateScopeStyles {\n method:\n | CSSStyleSheet\n | {\n insertRule: (ruleCss: string) => void;\n rules: string[];\n };\n node: HTMLElement;\n}\n\nconst createScopeStyles = ({\n bridge: withBridge,\n bp,\n insertionType,\n node,\n context,\n}: ICreateScopeStyles): IRCreateScopeStyles => {\n let stylesScope = context.document.getElementById('layouter-' + bp);\n if (!stylesScope) {\n stylesScope = context.document.createElement('style');\n stylesScope.appendChild(context.document.createTextNode('')); // WebKit hack :(\n const nodeParent = node.parentNode as HTMLDivElement;\n switch (insertionType) {\n case 'before':\n nodeParent.insertBefore(stylesScope, node);\n break;\n case 'after':\n node.nextSibling\n ? nodeParent.insertBefore(stylesScope, node.nextSibling)\n : nodeParent.appendChild(stylesScope);\n break;\n case 'append':\n node.appendChild(stylesScope);\n break;\n }\n stylesScope.id = 'layouter-' + bp;\n }\n\n let bridge: IRCreateScopeStyles;\n if (withBridge) {\n bridge = {\n method: (stylesScope as HTMLStyleElement).sheet as CSSStyleSheet,\n node: stylesScope,\n };\n } else {\n bridge = {\n method: {\n insertRule: (ruleCss: string) => {\n (stylesScope as HTMLDivElement).appendChild(\n context.document.createTextNode(ruleCss)\n );\n },\n rules: [],\n },\n node: stylesScope,\n };\n }\n return bridge;\n};\n\nexport default createScopeStyles;\n","import { IBreakpoints } from './breakpointsNums';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nexport interface IScopes {\n [name: string]: IRCreateScopeStyles;\n}\n\nexport interface IScopesStylesBuilder {\n breakpoints: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\nexport const scopesStylesBuilder = ({\n breakpoints,\n bridge,\n scope,\n context,\n}: IScopesStylesBuilder): IScopes => {\n const scopes: IScopes = scope || {};\n Object.keys(breakpoints).forEach((bp: string) => {\n if (!scopes[bp]) {\n scopes[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'append',\n node: context.document.body,\n context,\n });\n }\n });\n return scopes;\n};\n","import { ICols } from '../config/main';\r\nimport { IBreakpoints } from './breakpointsNums';\r\n\r\nconst breakpointsOrdered = (bps: IBreakpoints, sizes: ICols) => {\r\n const bpsOrdered: IBreakpoints = {};\r\n Object.keys(sizes).forEach((bpName) => (bpsOrdered[bpName] = bps[bpName]));\r\n return bpsOrdered;\r\n};\r\n\r\nexport default breakpointsOrdered;\r\n","import { ILayouter } from './../layouter';\nimport breakpointsNums, { IBreakpoints } from '../helpers/breakpointsNums';\nimport { IScopes, scopesStylesBuilder } from '../helpers/scopesStylesBuilder';\nimport breakpointsOrdered from '../helpers/breakpointsOrdered';\nimport { version } from '../../package.json';\n\nexport interface ICols {\n [colAlias: string]: number;\n}\n\nexport interface IConfigUser {\n prefix: string;\n breakpoints: IBreakpoints;\n bridge: boolean;\n debug?: boolean;\n ready?: (instance: ILayouter) => void;\n}\n\ninterface IConfigNumsIn {\n bps: IBreakpoints;\n bridge: boolean;\n scope?: IScopes;\n context: Window & typeof globalThis;\n}\n\ninterface IConfigNumsOut {\n scope: IScopes;\n cols: ICols;\n sizes: ICols;\n breakpoints: IBreakpoints;\n}\n\nexport interface IConfig\n extends Omit,\n IConfigNumsOut {\n context: Window & typeof globalThis;\n styles: {\n [className: string]: string;\n };\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouterConfig: Partial;\n }\n}\n\nconst breakpointsInit: IBreakpoints = {\n xs: {\n width: 360,\n cols: 15,\n },\n sm: {\n width: 600,\n cols: 25,\n },\n md: {\n width: 900,\n cols: 31,\n },\n lg: {\n width: 1200,\n cols: 41,\n },\n xlg: {\n width: 1536,\n cols: 51,\n },\n};\n\nexport let baseConfig: IConfigUser = {\n prefix: '',\n breakpoints: breakpointsInit,\n bridge: true,\n debug: true,\n};\n\nlet config: IConfig;\n\nconst configNums = ({\n bps,\n bridge,\n scope,\n context,\n}: IConfigNumsIn): IConfigNumsOut => {\n const sizes = breakpointsNums(bps, 'width');\n const finalBps = breakpointsOrdered(bps, sizes);\n return {\n sizes,\n cols: breakpointsNums(bps, 'cols'),\n scope: scopesStylesBuilder({\n breakpoints: finalBps,\n bridge,\n scope: scope,\n context,\n }),\n breakpoints: finalBps,\n };\n};\n\nexport const setConfig = (\n context: Window & typeof globalThis,\n customCfg: Partial = {}\n): IConfig => {\n const contextConfig = context.layouterConfig || {};\n\n baseConfig = {\n ...baseConfig,\n ...customCfg,\n ...contextConfig,\n };\n\n config = {\n context,\n ...baseConfig,\n ...configNums({\n bps: baseConfig.breakpoints,\n bridge: baseConfig.bridge,\n context,\n }),\n styles: {},\n version,\n };\n\n return config;\n};\n\nconst getConfig = (): IConfig => {\n return config;\n};\n\nexport const setStyles = (className: string, value: string) => {\n config.styles[className] = value;\n};\n\nexport const updateConfig = (userConfig: Partial): IConfig => {\n config = {\n ...config,\n ...userConfig,\n };\n\n if (userConfig.breakpoints) {\n config = {\n ...config,\n ...configNums({\n bps: config.breakpoints,\n bridge: config.bridge,\n scope: config.scope,\n context: config.context,\n }),\n };\n }\n\n return config;\n};\n\nexport default getConfig;\n","import getConfig from '../config/main';\n\nexport interface IPrepareParamObj {\n widthBp: boolean;\n numbers: string;\n breakPoints: string;\n important: boolean;\n}\n\nconst prepareParam = (param: string): IPrepareParamObj => {\n let bp: string;\n let argParam = param;\n let important = false;\n const haveBp = argParam.includes('@');\n if (haveBp) {\n const bpSplited = argParam.split('@');\n argParam = bpSplited[0];\n bp = bpSplited[1];\n } else {\n const config = getConfig();\n bp = Object.keys(config.breakpoints)[0];\n }\n\n if (param.includes('!')) {\n important = true;\n bp = bp.replace(/!/g, '');\n argParam = argParam.replace(/!/g, '');\n }\n\n return {\n widthBp: haveBp,\n numbers: argParam,\n breakPoints: bp,\n important,\n };\n};\n\nexport default prepareParam;\n","import config from '../config/main';\r\n\r\nconst regError = (\r\n name: string,\r\n message: string,\r\n Node?: Element | HTMLElement\r\n): Error => {\r\n const err = new Error();\r\n err.name = name;\r\n err.message = message;\r\n const intConfig = config();\r\n if (intConfig.debug) {\r\n console.error(err);\r\n if (Node) console.log(Node);\r\n }\r\n return err;\r\n};\r\n\r\nexport default regError;\r\n","const calPercentage = (n1: number, n2: number): string => {\r\n const cal = (n1 * 100) / n2;\r\n const haveDecimal = cal - Math.floor(cal) !== 0;\r\n const result = haveDecimal ? cal.toFixed(3) : cal;\r\n return result + '%';\r\n};\r\n\r\nexport default calPercentage;\r\n","import config from '../config/main';\nimport createScopeStyles, { IRCreateScopeStyles } from './createScopeStyles';\n\nconst getScopeByclassName = (className: string): IRCreateScopeStyles => {\n const nameClass = className.replace(/!/g, '');\n const atIndex = nameClass.indexOf('@');\n const intConfig = config();\n const scope = intConfig.scope;\n const bridge = intConfig.bridge;\n const context = intConfig.context;\n\n // Haven´t a BP designed\n if (atIndex === -1) {\n const firstBp = Object.keys(intConfig.breakpoints)[0];\n return scope[firstBp as string];\n }\n\n // Have a BP designed, a normal BP.\n const bp = nameClass.substring(atIndex + 1);\n if (!bp.includes('-')) return scope[bp]; // A simple BP (13/15@lg), not compound (like this: 13/15@sm-md).\n\n // A BP until. Example 13/15@-md\n if (bp.substring(0, 1) === '-') {\n if (scope[bp]) return scope[bp]; // exists the Scope.\n const bpUntil = bp.substring(1);\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'before',\n node: scope[bpUntil].node,\n context,\n });\n return scope[bp]; // returning a new scope created\n }\n\n // A BP from and until (a BP compound). Example: Example 13/15@sm-md\n if (scope[bp]) {\n return scope[bp]; // exists the Scope.\n }\n\n const fromBp = bp.split('-')[0];\n scope[bp] = createScopeStyles({\n bridge: bridge,\n bp,\n insertionType: 'after',\n node: scope[fromBp].node,\n context,\n });\n\n return scope[bp]; // returning a new scope compounded created\n};\n\nexport default getScopeByclassName;\n","import config, { setStyles } from '../config/main';\nimport { IStyles } from '../helpers/createStyles';\nimport getScopeByclassName from '../helpers/getScopeByclassName';\n\nconst insertRules = (objStyles: IStyles) => {\n const intConfig = config();\n\n for (const className in objStyles) {\n if (!intConfig.styles[className]) {\n const nodeScope = getScopeByclassName(className);\n const valClass = objStyles[className];\n const rules = nodeScope.method.rules;\n nodeScope.method.insertRule(valClass, rules ? rules.length : 0);\n setStyles(className, valClass); // saving in styles vault\n }\n }\n};\n\nexport default insertRules;\n","const flexProsAndValsBase = {\r\n jc: {\r\n ruleCss: 'justify-content',\r\n classPrefix: 'jc',\r\n },\r\n ai: {\r\n ruleCss: 'align-items',\r\n classPrefix: 'ai',\r\n },\r\n ce: {\r\n ruleCss: 'center',\r\n classPrefix: 'ce',\r\n },\r\n fs: {\r\n ruleCss: 'flex-start',\r\n classPrefix: 'fs',\r\n },\r\n fe: {\r\n ruleCss: 'flex-end',\r\n classPrefix: 'fe',\r\n },\r\n sb: {\r\n ruleCss: 'space-between',\r\n classPrefix: 'sb',\r\n },\r\n sa: {\r\n ruleCss: 'space-around',\r\n classPrefix: 'sa',\r\n },\r\n fw: {\r\n ruleCss: 'flex-wrap',\r\n classPrefix: 'fw',\r\n },\r\n nw: {\r\n ruleCss: 'nowrap',\r\n classPrefix: 'nw',\r\n },\r\n w: {\r\n ruleCss: 'wrap',\r\n classPrefix: 'w',\r\n },\r\n wr: {\r\n ruleCss: 'wrap-reverse',\r\n classPrefix: 'wr',\r\n },\r\n fd: {\r\n ruleCss: 'flex-direction',\r\n classPrefix: 'fd',\r\n },\r\n r: {\r\n ruleCss: 'row',\r\n classPrefix: 'r',\r\n },\r\n rr: {\r\n ruleCss: 'row-reverse',\r\n classPrefix: 'rr',\r\n },\r\n co: {\r\n ruleCss: 'column',\r\n classPrefix: 'co',\r\n },\r\n cor: {\r\n ruleCss: 'column-reverse',\r\n classPrefix: 'co',\r\n },\r\n au: {\r\n ruleCss: 'auto',\r\n classPrefix: 'au',\r\n },\r\n st: {\r\n ruleCss: 'stretch',\r\n classPrefix: 'st',\r\n },\r\n bl: {\r\n ruleCss: 'baseline',\r\n classPrefix: 'bl',\r\n },\r\n in: {\r\n ruleCss: 'initial',\r\n classPrefix: 'in',\r\n },\r\n ih: {\r\n ruleCss: 'inherit',\r\n classPrefix: 'ih',\r\n },\r\n};\r\n\r\nconst flexPropsAndValsSelfBase = {\r\n fg: {\r\n ruleCss: 'flex-grow',\r\n classPrefix: 'fg',\r\n },\r\n fh: {\r\n ruleCss: 'flex-shrink',\r\n classPrefix: 'fh',\r\n },\r\n as: {\r\n ruleCss: 'align-self',\r\n classPrefix: 'as',\r\n },\r\n or: {\r\n ruleCss: 'order',\r\n classPrefix: 'or',\r\n },\r\n};\r\n\r\nconst flexPropsAndValsSelf = {\r\n ...flexPropsAndValsSelfBase,\r\n 'flex-grow': flexPropsAndValsSelfBase.fg,\r\n 'flex-shrink': flexPropsAndValsSelfBase.fh,\r\n 'align-self': flexPropsAndValsSelfBase.as,\r\n order: flexPropsAndValsSelfBase.or,\r\n};\r\n\r\nexport const flexProsAndVals = {\r\n ...flexProsAndValsBase,\r\n ...flexPropsAndValsSelf,\r\n 'justify-content': flexProsAndValsBase.jc,\r\n 'align-items': flexProsAndValsBase.ai,\r\n center: flexProsAndValsBase.ce,\r\n 'flex-start': flexProsAndValsBase.fs,\r\n 'flex-end': flexProsAndValsBase.fe,\r\n 'space-between': flexProsAndValsBase.sb,\r\n 'space-around': flexProsAndValsBase.fs,\r\n 'flex-wrap': flexProsAndValsBase.fw,\r\n nowrap: flexProsAndValsBase.nw,\r\n w: flexProsAndValsBase.w,\r\n 'wrap-reverse': flexProsAndValsBase.wr,\r\n 'flex-direction': flexProsAndValsBase.fd,\r\n row: flexProsAndValsBase.r,\r\n 'row-reverse': flexProsAndValsBase.rr,\r\n column: flexProsAndValsBase.co,\r\n 'column-reverse': flexProsAndValsBase.cor,\r\n auto: flexProsAndValsBase.au,\r\n stretch: flexProsAndValsBase.st,\r\n baseline: flexProsAndValsBase.bl,\r\n initial: flexProsAndValsBase.in,\r\n inherit: flexProsAndValsBase.ih,\r\n};\r\n\r\nexport const flexAttrsSelf = Object.keys(flexPropsAndValsSelf);\r\n","const percentageConverter = (percentage: string) => {\r\n return '0¯' + percentage.replace('%', '');\r\n};\r\n\r\nexport default percentageConverter;\r\n","import { flexAttrsSelf } from '../config/flex';\r\nimport config from '../config/main';\r\nimport { processors, TDirectiveName } from '../config/processors';\r\nimport { IBpCals } from './buildCss';\r\nimport percentageConverter from './percentageConverter';\r\n\r\nexport interface IStyles {\r\n [name: string]: string;\r\n}\r\n\r\nconst createStyles = (directive: TDirectiveName, bps: IBpCals): IStyles => {\r\n const intConfig = config();\r\n const sizes = intConfig.sizes;\r\n const prefix = intConfig.prefix;\r\n const prop = processors[directive].ruleCss;\r\n const styles: IStyles = {};\r\n\r\n Object.keys(bps).forEach((bp) => {\r\n // preparing the className\r\n const shortNameClass = bps[bp].name;\r\n\r\n // just if have a percentage\r\n let nameClass = shortNameClass;\r\n if (shortNameClass.includes('%')) {\r\n nameClass = shortNameClass.replace(\r\n shortNameClass,\r\n percentageConverter(shortNameClass)\r\n );\r\n }\r\n\r\n const finalPrefix = prefix ? prefix + '-' : '';\r\n nameClass =\r\n finalPrefix +\r\n processors[directive].classPrefix +\r\n '-' +\r\n nameClass\r\n .replace(/\\//g, '\\\\/')\r\n .replace(/:/g, '\\\\:')\r\n .replace('@', '\\\\@')\r\n .split('.')\r\n .join('_');\r\n\r\n if (!intConfig.styles[nameClass]) {\r\n // Property and value\r\n let propAndVal;\r\n if (directive === 'flex') {\r\n propAndVal = bps[bp].value;\r\n const flexImportant = shortNameClass.includes('!')\r\n ? ';display:flex !important;'\r\n : ';display:flex;';\r\n\r\n // Searching a flex self inside. ['as' for 'align-self']\r\n const attrsFlexSelfs = flexAttrsSelf.filter((nameAttrFlex) =>\r\n shortNameClass.includes(nameAttrFlex + ':')\r\n );\r\n if (attrsFlexSelfs.length) {\r\n // if the items number of flex selft (+1) is diferrent so exists other flex attribute. Example: as:ce jc:ce\r\n if (attrsFlexSelfs.length + 1 !== shortNameClass.split(':').length) {\r\n propAndVal += flexImportant;\r\n }\r\n } else {\r\n propAndVal += flexImportant;\r\n }\r\n } else {\r\n propAndVal = prop + ':' + bps[bp].value;\r\n }\r\n\r\n let rule = '@media screen and ';\r\n let direct = false;\r\n if (!bp.includes('-')) {\r\n // no tiene until\r\n if (sizes[bp]) {\r\n rule += '(min-width: ' + sizes[bp] + 'px)';\r\n } else {\r\n rule = '.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}';\r\n direct = true;\r\n }\r\n } else {\r\n const bpSplited = bp.split('-');\r\n const bp1 = bpSplited[0];\r\n if (bp1) rule += '(min-width: ' + sizes[bp1] + 'px) and ';\r\n const bp2 = bpSplited[1];\r\n rule += '(max-width: ' + (sizes[bp2] - 1) + 'px)';\r\n }\r\n\r\n if (!direct) {\r\n rule += '{.' + nameClass.replace(/!/g, '\\\\!') + '{' + propAndVal + '}}';\r\n }\r\n\r\n styles[nameClass] = rule;\r\n } else {\r\n styles[nameClass] = intConfig.styles[nameClass];\r\n }\r\n });\r\n return styles;\r\n};\r\n\r\nexport default createStyles;\r\n","import { IStyles } from './createStyles';\n\nconst replaceList = [\n ['/', ''],\n ['\\\\', '/'],\n ['/:', ':'],\n ['\\\\:', ':'],\n ['\\\\@', '@'],\n ['/@', '@'],\n];\n\nconst nameCleaner = (objStyles: IStyles): IStyles => {\n const obj: IStyles = {};\n for (const name in objStyles) {\n let newName = name;\n replaceList.forEach((reItem) => {\n newName = newName.split(reItem[0]).join(reItem[1]);\n });\n obj[newName] = objStyles[name];\n }\n return obj;\n};\n\nexport default nameCleaner;\n","import { TDirectiveName } from '../config/processors';\nimport insertRules from '../methods/insertRules';\nimport createStyles, { IStyles } from './createStyles';\nimport nameCleaner from './nameCleaner';\n\nexport interface IRBuildStyles {\n name: string;\n value: string;\n}\n\nexport interface IBpCals {\n [bpName: string]: IRBuildStyles;\n}\n\nexport interface IBuildCss {\n type: TDirectiveName;\n bps: IBpCals;\n deep: boolean;\n}\n\nconst buildCss = (data: IBuildCss): IStyles => {\n // creating the styles\n const objStyles = createStyles(data.type, data.bps);\n\n // Inserting CSS rules\n if (data.deep) {\n insertRules(objStyles);\n }\n\n // name classes cleaner\n return nameCleaner(objStyles);\n};\n\nexport default buildCss;\n","import prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\nimport calPercentage from '../helpers/calPercentage';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport getConfig from '../config/main';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildCols = (values: string, insertStyles = false): IStyles | Error => {\r\n let cols: number[];\r\n let bp;\r\n const bpCals: IBpCals = {};\r\n const config = getConfig();\r\n\r\n // Getting numbers\r\n let selectorName, propValue, paramPrepared;\r\n const directBp = Object.keys(config.breakpoints)[0];\r\n\r\n let err: boolean | Error = false;\r\n\r\n for (const item of values.split(' ')) {\r\n let param = item;\r\n selectorName = param;\r\n paramPrepared = prepareParam(param);\r\n bp = paramPrepared.breakPoints;\r\n param = paramPrepared.numbers;\r\n\r\n if (param.includes('/')) {\r\n const paramSplited = param.split('/');\r\n cols = [Number(paramSplited[0]), Number(paramSplited[1])];\r\n } else {\r\n if (paramPrepared.widthBp) {\r\n if (bp.includes('-')) {\r\n err = regError(\r\n 'SyntaxError',\r\n \"You can't determine a 'until breakpoint' when use the explicit columns max: \" +\r\n values\r\n );\r\n break;\r\n } else {\r\n cols = [Number(param), config.cols[bp] as number];\r\n }\r\n } else {\r\n cols = [Number(param), config.cols[directBp] as number];\r\n }\r\n }\r\n\r\n propValue = calPercentage(cols[0], cols[1]);\r\n if (paramPrepared.important) propValue += ' !important';\r\n\r\n bpCals[bp] = {\r\n name: selectorName,\r\n value: propValue,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'cols',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildCols;\r\n","import { flexAttrsSelf, flexProsAndVals } from '../config/flex';\r\nimport getConfig from '../config/main';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport { IStyles } from '../helpers/createStyles';\r\nimport prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\n\r\nconst buildFlex = (valFlex: string, insertStyles = false): IStyles | Error => {\r\n const bpCals: IBpCals = {};\r\n\r\n // Getting numbers\r\n let err: boolean | Error = false;\r\n const config = getConfig();\r\n const firstBp = Object.keys(config.breakpoints)[0];\r\n\r\n for (const param of valFlex.split(' ')) {\r\n let propVal;\r\n const paramPrepared = prepareParam(param);\r\n const bpNames = paramPrepared.breakPoints;\r\n const flexSplited = paramPrepared.numbers.split(':');\r\n const nameProp = flexSplited[0] as keyof typeof flexProsAndVals; // 'fc' o 'or'\r\n const valProp = flexSplited[1] as keyof typeof flexProsAndVals; // 'ce' o '1'\r\n let valAlias: string;\r\n\r\n if (!flexAttrsSelf.includes(nameProp)) {\r\n if (!flexProsAndVals[nameProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + nameProp + \"' in Flex vault.\"\r\n );\r\n break;\r\n }\r\n if (!flexProsAndVals[valProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + valProp + \"' in Flex vault.\"\r\n );\r\n break;\r\n }\r\n propVal =\r\n flexProsAndVals[nameProp].ruleCss +\r\n ':' +\r\n flexProsAndVals[valProp].ruleCss;\r\n valAlias = flexProsAndVals[valProp].classPrefix;\r\n } else {\r\n propVal = flexProsAndVals[nameProp].ruleCss + ':' + valProp;\r\n valAlias = valProp;\r\n }\r\n\r\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\r\n if (paramPrepared.important) {\r\n propVal += ' !important';\r\n sufixBp += '!';\r\n }\r\n\r\n let selectorName =\r\n flexProsAndVals[nameProp].classPrefix + ':' + valAlias + sufixBp;\r\n\r\n if (!bpCals[bpNames]) {\r\n bpCals[bpNames] = {\r\n name: selectorName,\r\n value: propVal,\r\n };\r\n } else {\r\n if (selectorName.includes('@')) selectorName = selectorName.split('@')[0]; // just here because will be contact with the other className\r\n let prevName = bpCals[bpNames].name.split('@')[0];\r\n if (bpCals[bpNames].name.includes('!') && !prevName.includes('!'))\r\n prevName += '!';\r\n\r\n bpCals[bpNames].name = prevName + '-' + selectorName + sufixBp;\r\n bpCals[bpNames].value += ';' + propVal;\r\n }\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'flex',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildFlex;\r\n","import calPercentage from './calPercentage';\n\nconst relativeMeasures = ['%', 'rem', 'em', 'ex', 'vw', 'vh', 'pt', 'cm', 'pc'];\n\nconst processedNumber = (n: string) => {\n let nProcessed;\n if (n.includes('/')) {\n nProcessed = n.split('/');\n nProcessed = calPercentage(\n parseFloat(nProcessed[0]),\n parseFloat(nProcessed[1])\n );\n } else if (n === 'auto') {\n nProcessed = 'auto';\n } else {\n const relativeUnits = relativeMeasures.filter((unit) => {\n return n.includes(unit);\n });\n if (relativeUnits.length) {\n nProcessed = n;\n } else {\n nProcessed = n === '0' ? n : n + 'px';\n }\n }\n return nProcessed;\n};\n\nexport default processedNumber;\n","import { TDirectiveName } from '../config/processors';\nimport buildCss, { IBpCals } from './buildCss';\nimport { IStyles } from './createStyles';\nimport prepareParam from './prepareParam';\nimport processedNumber from './processedNumber';\n\nconst buildAttr = (\n values: string,\n directive: TDirectiveName,\n insertStyles = false\n): IStyles => {\n const bpCals: IBpCals = {};\n\n values.split(' ').forEach((param) => {\n const paramProcessed = prepareParam(param);\n const bpNames = paramProcessed.breakPoints;\n\n // processing number values\n let propValue = paramProcessed.numbers\n .split('-')\n .map((n) => processedNumber(n))\n .join(' ');\n if (paramProcessed.important) propValue += ' !important';\n bpCals[bpNames] = {\n name: param,\n value: propValue,\n };\n });\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: directive,\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildAttr;\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPad = (valPads: string, insertStyles = false) => {\r\n return buildAttr(valPads, 'pad', insertStyles);\r\n};\r\n\r\nexport default buildPad;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadTop = (valPadTop: string, insertStyles = false) => {\r\n return buildAttr(valPadTop, 'padt', insertStyles);\r\n};\r\n\r\nexport default buildPadTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadRight = (valPadRight: string, insertStyles = false) => {\r\n return buildAttr(valPadRight, 'padr', insertStyles);\r\n};\r\n\r\nexport default buildPadRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadBottom = (valPadBottom: string, insertStyles = false) => {\r\n return buildAttr(valPadBottom, 'padb', insertStyles);\r\n};\r\n\r\nexport default buildPadBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildPadLeft = (valPadLeft: string, insertStyles = false) => {\r\n return buildAttr(valPadLeft, 'padl', insertStyles);\r\n};\r\n\r\nexport default buildPadLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMar = (valMars: string, insertStyles = false) => {\r\n return buildAttr(valMars, 'mar', insertStyles);\r\n};\r\n\r\nexport default buildMar;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarTop = (valMarTop: string, insertStyles = false) => {\r\n return buildAttr(valMarTop, 'mart', insertStyles);\r\n};\r\n\r\nexport default buildMarTop;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarRight = (valMarRight: string, insertStyles = false) => {\r\n return buildAttr(valMarRight, 'marr', insertStyles);\r\n};\r\n\r\nexport default buildMarRight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarBottom = (valMarBottom: string, insertStyles = false) => {\r\n return buildAttr(valMarBottom, 'marb', insertStyles);\r\n};\r\n\r\nexport default buildMarBottom;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMarLeft = (valMarLeft: string, insertStyles = false) => {\r\n return buildAttr(valMarLeft, 'marl', insertStyles);\r\n};\r\n\r\nexport default buildMarLeft;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxWidth = (valMaxWidth: string, insertStyles = false) => {\r\n return buildAttr(valMaxWidth, 'mxw', insertStyles);\r\n};\r\n\r\nexport default buildMaxWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMaxHeight = (valMaxHeight: string, insertStyles = false) => {\r\n return buildAttr(valMaxHeight, 'mxh', insertStyles);\r\n};\r\n\r\nexport default buildMaxHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinWidth = (valMinWidth: string, insertStyles = false) => {\r\n return buildAttr(valMinWidth, 'miw', insertStyles);\r\n};\r\n\r\nexport default buildMinWidth;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildMinHeight = (valMinHeight: string, insertStyles = false) => {\r\n return buildAttr(valMinHeight, 'mih', insertStyles);\r\n};\r\n\r\nexport default buildMinHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildHeight = (valHeight: string, insertStyles = false) => {\r\n return buildAttr(valHeight, 'hgt', insertStyles);\r\n};\r\n\r\nexport default buildHeight;\r\n","import buildAttr from '../helpers/buildAttr';\r\n\r\nconst buildWidth = (valWidth: string, insertStyles = false) => {\r\n return buildAttr(valWidth, 'wdh', insertStyles);\r\n};\r\n\r\nexport default buildWidth;\r\n","const positionProsAndValsBase = {\r\n st: {\r\n ruleCss: 'static',\r\n classPrefix: 'st',\r\n },\r\n ab: {\r\n ruleCss: 'absolute',\r\n classPrefix: 'ab',\r\n },\r\n fi: {\r\n ruleCss: 'fixed',\r\n classPrefix: 'fi',\r\n },\r\n re: {\r\n ruleCss: 'relative',\r\n classPrefix: 're',\r\n },\r\n si: {\r\n ruleCss: 'sticky',\r\n classPrefix: 'si',\r\n },\r\n in: {\r\n ruleCss: 'initial',\r\n classPrefix: 'in',\r\n },\r\n ih: {\r\n ruleCss: 'inherit',\r\n classPrefix: 'ih',\r\n },\r\n};\r\n\r\nexport const positionProsAndVals = {\r\n ...positionProsAndValsBase,\r\n static: positionProsAndValsBase.st,\r\n absolute: positionProsAndValsBase.ab,\r\n fixed: positionProsAndValsBase.fi,\r\n relative: positionProsAndValsBase.re,\r\n sticky: positionProsAndValsBase.si,\r\n initial: positionProsAndValsBase.in,\r\n inherit: positionProsAndValsBase.ih,\r\n};\r\n","import getConfig from '../config/main';\r\nimport { positionProsAndVals } from '../config/position';\r\n\r\nimport buildCss, { IBpCals } from '../helpers/buildCss';\r\nimport { IStyles } from '../helpers/createStyles';\r\nimport prepareParam from '../helpers/prepareParam';\r\nimport regError from '../helpers/regError';\r\n\r\nconst buildPosition = (\r\n valPos: string,\r\n insertStyles = false\r\n): IStyles | Error => {\r\n const bpCals: IBpCals = {};\r\n\r\n // Getting numbers\r\n let err: boolean | Error = false;\r\n const config = getConfig();\r\n const firstBp = Object.keys(config.breakpoints)[0];\r\n\r\n for (const param of valPos.split(' ')) {\r\n let propVal;\r\n const paramPrepared = prepareParam(param);\r\n const bpNames = paramPrepared.breakPoints;\r\n const nameProp = paramPrepared.numbers as keyof typeof positionProsAndVals;\r\n\r\n if (!positionProsAndVals[nameProp]) {\r\n err = regError(\r\n 'Non-existent Alias',\r\n \"Don't exists the alias '\" + nameProp + \"' in Position vault.\"\r\n );\r\n break;\r\n }\r\n\r\n propVal = positionProsAndVals[nameProp].ruleCss;\r\n const className = positionProsAndVals[nameProp].classPrefix;\r\n\r\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\r\n\r\n if (paramPrepared.important) {\r\n propVal += ' !important';\r\n sufixBp += '!';\r\n }\r\n\r\n bpCals[bpNames] = {\r\n name: className + sufixBp,\r\n value: propVal,\r\n };\r\n }\r\n\r\n if (err) return err;\r\n\r\n // Building the classNames and the styles to use.\r\n return buildCss({\r\n type: 'pos',\r\n bps: bpCals,\r\n deep: insertStyles,\r\n });\r\n};\r\n\r\nexport default buildPosition;\r\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildTop = (val: string, insertStyles = false) => {\n return buildAttr(val, 't', insertStyles);\n};\n\nexport default buildTop;\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildRight = (val: string, insertStyles = false) => {\n return buildAttr(val, 'r', insertStyles);\n};\n\nexport default buildRight;\n","import buildAttr from '../helpers/buildAttr';\r\nimport { IStyles } from '../helpers/createStyles';\r\n\r\nconst buildBottom = (val: string, insertStyles = false): IStyles => {\r\n return buildAttr(val, 'b', insertStyles);\r\n};\r\n\r\nexport default buildBottom;\r\n","import buildAttr from '../helpers/buildAttr';\n\nconst buildLeft = (val: string, insertStyles = false) => {\n return buildAttr(val, 'l', insertStyles);\n};\n\nexport default buildLeft;\n","const displayProsAndValsBase = {\n bl: {\n ruleCss: 'block',\n classPrefix: 'bl',\n },\n il: {\n ruleCss: 'inline',\n classPrefix: 'il',\n },\n ib: {\n ruleCss: 'inline-block',\n classPrefix: 'ib',\n },\n fx: {\n ruleCss: 'flex',\n classPrefix: 'fx',\n },\n if: {\n ruleCss: 'inline-flex',\n classPrefix: 'if',\n },\n no: {\n ruleCss: 'none',\n classPrefix: 'no',\n },\n in: {\n ruleCss: 'initial',\n classPrefix: 'in',\n },\n ih: {\n ruleCss: 'inherit',\n classPrefix: 'ih',\n },\n};\n\nexport const displayProsAndVals = {\n ...displayProsAndValsBase,\n block: displayProsAndValsBase.bl,\n inline: displayProsAndValsBase.il,\n 'inline-block': displayProsAndValsBase.ib,\n flex: displayProsAndValsBase.fx,\n 'inline-flex': displayProsAndValsBase.if,\n none: displayProsAndValsBase.no,\n initial: displayProsAndValsBase.in,\n inherit: displayProsAndValsBase.ih,\n};\n","import buildCols from '../methods/buildCols';\nimport buildFlex from '../methods/buildFlex';\nimport buildPad from '../methods/buildPad';\nimport buildPadTop from '../methods/buildPadTop';\nimport buildPadRight from '../methods/buildPadRight';\nimport buildPadBottom from '../methods/buildPadBottom';\nimport buildPadLeft from '../methods/buildPadLeft';\nimport buildMar from '../methods/buildMar';\nimport buildMarTop from '../methods/buildMarTop';\nimport buildMarRight from '../methods/buildMarRight';\nimport buildMarBottom from '../methods/buildMarBottom';\nimport buildMarLeft from '../methods/buildMarLeft';\nimport buildMaxWidth from '../methods/buildMaxWidth';\nimport buildMaxHeight from '../methods/buildMaxHeight';\nimport buildMinWidth from '../methods/buildMinWidth';\nimport buildMinHeight from '../methods/buildMinHeight';\nimport buildHeight from '../methods/buildHeight';\nimport buildWidth from '../methods/buildWidth';\nimport buildPosition from '../methods/buildPosition';\nimport buildTop from '../methods/buildTop';\nimport buildRight from '../methods/buildRight';\nimport buildBottom from '../methods/buildBottom';\nimport buildLeft from '../methods/buildLeft';\n\nimport { IStyles } from '../helpers/createStyles';\nimport buildDisplay from '../methods/buildDisplay';\n\ntype TDirectiveNameBase =\n | 'cols'\n | 'pad'\n | 'padt'\n | 'padr'\n | 'padb'\n | 'padl'\n | 'mar'\n | 'mart'\n | 'marr'\n | 'marb'\n | 'marl'\n | 'flex'\n | 'mxw'\n | 'mxh'\n | 'miw'\n | 'mih'\n | 'wdh'\n | 'hgt'\n | 'pos'\n | 't'\n | 'r'\n | 'b'\n | 'l'\n | 'd';\n\ntype TDirectiveNameExtended =\n | 'c'\n | 'fx'\n | 'p'\n | 'padding'\n | 'pt'\n | 'padding-top'\n | 'pr'\n | 'padding-right'\n | 'pb'\n | 'padding-bottom'\n | 'pl'\n | 'padding-left'\n | 'm'\n | 'margin'\n | 'mt'\n | 'margin-top'\n | 'mr'\n | 'margin-right'\n | 'mb'\n | 'margin-bottom'\n | 'ml'\n | 'margin-left'\n | 'w'\n | 'width'\n | 'h'\n | 'height'\n | 'max-width'\n | 'max-height'\n | 'min-width'\n | 'min-height'\n | 'position'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'display';\n\nexport type TDirectiveName = TDirectiveNameBase | TDirectiveNameExtended;\n\nexport interface IProcessor {\n build: (values: string, insertStyles: boolean) => IStyles | Error;\n ruleCss: string;\n classPrefix: string;\n}\n\nconst processorsBase: Record = {\n cols: {\n build: buildCols,\n ruleCss: 'width',\n classPrefix: 'c',\n },\n\n // Paddings\n pad: {\n build: buildPad,\n ruleCss: 'padding',\n classPrefix: 'p',\n },\n padt: {\n build: buildPadTop,\n ruleCss: 'padding-top',\n classPrefix: 'pt',\n },\n padr: {\n build: buildPadRight,\n ruleCss: 'padding-right',\n classPrefix: 'pr',\n },\n padb: {\n build: buildPadBottom,\n ruleCss: 'padding-bottom',\n classPrefix: 'pb',\n },\n padl: {\n build: buildPadLeft,\n ruleCss: 'padding-left',\n classPrefix: 'pl',\n },\n\n // Margin\n mar: {\n build: buildMar,\n ruleCss: 'margin',\n classPrefix: 'm',\n },\n mart: {\n build: buildMarTop,\n ruleCss: 'margin-top',\n classPrefix: 'mt',\n },\n marr: {\n build: buildMarRight,\n ruleCss: 'margin-right',\n classPrefix: 'mr',\n },\n marb: {\n build: buildMarBottom,\n ruleCss: 'margin-bottom',\n classPrefix: 'mb',\n },\n marl: {\n build: buildMarLeft,\n ruleCss: 'margin-left',\n classPrefix: 'ml',\n },\n\n // Flex Box\n flex: {\n build: buildFlex,\n ruleCss: 'display: flex',\n classPrefix: 'fx',\n },\n\n // Max & Min Width & Height\n mxw: {\n build: buildMaxWidth,\n ruleCss: 'max-width',\n classPrefix: 'mxw',\n },\n\n mxh: {\n build: buildMaxHeight,\n ruleCss: 'max-height',\n classPrefix: 'mxh',\n },\n\n miw: {\n build: buildMinWidth,\n ruleCss: 'min-width',\n classPrefix: 'miw',\n },\n\n mih: {\n build: buildMinHeight,\n ruleCss: 'min-height',\n classPrefix: 'mih',\n },\n\n // Width & Height\n wdh: {\n build: buildWidth,\n ruleCss: 'width',\n classPrefix: 'w',\n },\n\n hgt: {\n build: buildHeight,\n ruleCss: 'height',\n classPrefix: 'h',\n },\n\n // Position\n pos: {\n build: buildPosition,\n ruleCss: 'position',\n classPrefix: 'pos',\n },\n t: {\n build: buildTop,\n ruleCss: 'top',\n classPrefix: 't',\n },\n r: {\n build: buildRight,\n ruleCss: 'right',\n classPrefix: 'r',\n },\n b: {\n build: buildBottom,\n ruleCss: 'bottom',\n classPrefix: 'b',\n },\n l: {\n build: buildLeft,\n ruleCss: 'left',\n classPrefix: 'l',\n },\n d: {\n build: buildDisplay,\n ruleCss: 'display',\n classPrefix: 'd',\n }\n};\n\nexport const processors: Record = {\n ...processorsBase,\n c: processorsBase.cols,\n fx: processorsBase.flex,\n p: processorsBase.pad,\n padding: processorsBase.pad,\n pt: processorsBase.padt,\n 'padding-top': processorsBase.padt,\n pr: processorsBase.padr,\n 'padding-right': processorsBase.padr,\n pb: processorsBase.padb,\n 'padding-bottom': processorsBase.padb,\n pl: processorsBase.padl,\n 'padding-left': processorsBase.padl,\n m: processorsBase.mar,\n margin: processorsBase.mar,\n mt: processorsBase.mart,\n 'margin-top': processorsBase.mart,\n mr: processorsBase.marr,\n 'margin-right': processorsBase.marr,\n mb: processorsBase.marb,\n 'margin-bottom': processorsBase.marb,\n ml: processorsBase.marl,\n 'margin-left': processorsBase.marl,\n w: processorsBase.wdh,\n width: processorsBase.wdh,\n h: processorsBase.hgt,\n height: processorsBase.hgt,\n 'max-width': processorsBase.mxw,\n 'max-height': processorsBase.mxh,\n 'min-width': processorsBase.miw,\n 'min-height': processorsBase.mih,\n position: processorsBase.pos,\n top: processorsBase.t,\n right: processorsBase.r,\n bottom: processorsBase.b,\n left: processorsBase.l,\n display: processorsBase.d,\n};\n","import getConfig from '../config/main';\nimport { displayProsAndVals } from '../config/display';\n\nimport buildCss, { IBpCals } from '../helpers/buildCss';\nimport { IStyles } from '../helpers/createStyles';\nimport prepareParam from '../helpers/prepareParam';\nimport regError from '../helpers/regError';\n\nconst buildDisplay = (\n valDisplay: string,\n insertStyles = false\n): IStyles | Error => {\n const bpCals: IBpCals = {};\n\n // Getting numbers\n let err: boolean | Error = false;\n const config = getConfig();\n const firstBp = Object.keys(config.breakpoints)[0];\n\n for (const param of valDisplay.split(' ')) {\n let propVal;\n const paramPrepared = prepareParam(param);\n const bpNames = paramPrepared.breakPoints;\n const nameProp = paramPrepared.numbers as keyof typeof displayProsAndVals;\n\n if (!displayProsAndVals[nameProp]) {\n err = regError(\n 'Non-existent Alias',\n \"Don't exists the alias '\" + nameProp + \"' in display vault.\"\n );\n break;\n }\n\n propVal = displayProsAndVals[nameProp].ruleCss;\n const className = displayProsAndVals[nameProp].classPrefix;\n\n let sufixBp = bpNames === firstBp ? '' : '@' + bpNames;\n\n if (paramPrepared.important) {\n propVal += ' !important';\n sufixBp += '!';\n }\n\n bpCals[bpNames] = {\n name: className + sufixBp,\n value: propVal,\n };\n }\n\n if (err) return err;\n\n // Building the classNames and the styles to use.\n return buildCss({\n type: 'd',\n bps: bpCals,\n deep: insertStyles,\n });\n};\n\nexport default buildDisplay;\n","import { processors, TDirectiveName } from '../config/processors';\r\n\r\nconst getParameters = (\r\n Node: HTMLElement | Element\r\n): Partial> => {\r\n const params: Partial> = {};\r\n const attrs = Node.attributes;\r\n const paramNames = Object.keys(processors);\r\n Array.prototype.forEach.call(attrs, (attr) => {\r\n if (paramNames.includes(attr.name)) {\r\n if (attr.value !== '')\r\n params[attr.name as TDirectiveName] = attr.value\r\n .trim()\r\n .split(' ')\r\n .filter((item: string) => item)\r\n .join(' ');\r\n }\r\n });\r\n return params;\r\n};\r\n\r\nexport default getParameters;\r\n","import { processors, TDirectiveName } from '../config/processors';\nimport { IStyles } from '../helpers/createStyles';\n\nexport interface IBuildResult {\n [prop: string]: IStyles | boolean;\n}\n\nconst build = (\n obj: Partial>,\n insertStyles = false\n): Partial | Error => {\n const rObj: Partial = {};\n let err: Error | boolean = false;\n for (const prop in obj) {\n const propData = processors[prop as TDirectiveName];\n const objStyles: IStyles | Error = propData.build(\n obj[prop as TDirectiveName] as string,\n insertStyles\n );\n if (objStyles instanceof Error) {\n err = objStyles;\n break;\n } else {\n rObj[prop] = objStyles;\n }\n }\n\n if (err) return err;\n return rObj;\n};\n\nexport default build;\n","import getConfig from '../config/main';\n\nconst addClasses = (\n Node: HTMLElement | Element,\n classesNames: string,\n overwrite?: boolean\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n const names = classesNames.split(' ');\n let classesToAdd: string[] = names;\n if (!overwrite) {\n classesToAdd = names.filter((name) => !Node.classList.contains(name));\n if (!classesToAdd.length) {\n resolve();\n return;\n }\n }\n\n const obsNode = new config.context.MutationObserver((mutations) => {\n const target = mutations[0].target;\n const currentClasses = (target as Element).className.split(' ');\n const containsAll = names.every((element) =>\n currentClasses.includes(element)\n );\n if (containsAll) {\n obsNode.disconnect();\n resolve();\n }\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: ['class'],\n characterData: false,\n });\n\n if (overwrite) {\n Node.className = classesNames;\n } else {\n const space = Node.hasAttribute('class') ? ' ' : '';\n Node.className += space + classesToAdd.join(' ');\n }\n });\n};\n\nexport default addClasses;\n","import getConfig from '../config/main';\n\nexport const removeProp = (\n Node: HTMLElement | Element,\n propName: string,\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n if (!Node.hasAttribute(propName)) {\n resolve();\n return;\n }\n const obsNode = new context.MutationObserver(() => {\n obsNode.disconnect();\n resolve();\n });\n obsNode.observe(Node, {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: [propName],\n characterData: false,\n });\n Node.removeAttribute(propName);\n });\n};\n\nexport const removeProps = (\n Node: HTMLElement | Element,\n propNames: string[],\n context: Window & typeof globalThis\n): Promise => {\n return new Promise((resolve) => {\n const promises = propNames.map((name) => removeProp(Node, name, context));\n Promise.all(promises).then(() => resolve());\n });\n};\n\nconst removeAttr = (\n Node: HTMLElement | Element,\n propNames: string | string[]\n): Promise => {\n return new Promise((resolve) => {\n const config = getConfig();\n if (Array.isArray(propNames)) {\n removeProps(Node, propNames, config.context).then(resolve);\n } else {\n removeProp(Node, propNames, config.context).then(resolve);\n }\n });\n};\n\nexport default removeAttr;\n","import getConfig from '../config/main';\nimport addClasses from '../utils/addClasses';\nimport removeAttr from '../utils/removeAttr';\n\nexport interface IEventReady {\n node: HTMLElement | Element;\n directive: string | string[];\n classes: string;\n resolve: (value: void | Error | PromiseLike) => void;\n}\n\nconst eventReady = ({ node, directive, classes, resolve }: IEventReady) => {\n const config = getConfig();\n removeAttr(node, directive)\n .then(() => addClasses(node, classes))\n .then(() => {\n resolve();\n const event = new config.context.CustomEvent('layout:ready');\n node.dispatchEvent(event);\n });\n};\n\nexport default eventReady;\n","import { IStyles } from '../helpers/createStyles';\nimport regError from '../helpers/regError';\nimport build, { IBuildResult } from './build';\nimport getParameters from './getParameters';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst set = (\n Node: HTMLElement | Element,\n parameters?: Partial>\n): Promise => {\n return new Promise((resolve, reject) => {\n const params = parameters || getParameters(Node);\n const arrParams = Object.keys(params);\n if (!arrParams.length) {\n const err = regError(\n 'Parameter Missing',\n \"don't exists any parameter to process\",\n Node\n );\n reject(err);\n return;\n }\n\n const toBuild: Partial> = {};\n for (const prop in params) {\n toBuild[prop as TDirectiveName] = params[prop as TDirectiveName];\n }\n\n // creating classes names and inserting that classes to the core\n const classesObj = build(toBuild as Record, true);\n if (classesObj instanceof Error) {\n reject(classesObj);\n return;\n }\n\n // adding classes\n const classes = classesObj as Partial;\n const classesNames = Object.keys(classes)\n .map((name: string) => Object.keys(classes[name] as IStyles))\n .flat()\n .join(' ');\n\n // removing unnecessary props\n eventReady({\n node: Node,\n directive: arrParams,\n classes: classesNames,\n resolve,\n });\n });\n};\n\nexport default set;\n","import regError from '../helpers/regError';\nimport buildFlex from './buildFlex';\nimport eventReady from '../helpers/eventReady';\n\nconst setFlex = (\n Node: HTMLElement | Element,\n flexValues?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = flexValues || Node.getAttribute('flex');\n if (!values) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"flex\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildFlex(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'flex',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setFlex;\n","import regError from '../helpers/regError';\nimport buildCols from './buildCols';\nimport eventReady from '../helpers/eventReady';\n\nconst setCols = (\n Node: HTMLElement | Element,\n columns?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const values = columns || Node.getAttribute('cols');\n if (!values) {\n const err = regError(\n 'Empty',\n \"The value of the directive 'cols' is empty\",\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildCols(values, true);\n if (objStyles instanceof Error) {\n reject(objStyles);\n return;\n }\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive: 'cols',\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setCols;\n","import buildAttr from '../helpers/buildAttr';\nimport regError from '../helpers/regError';\nimport { TDirectiveName } from '../config/processors';\nimport eventReady from '../helpers/eventReady';\n\nconst setAttr = (\n Node: HTMLElement | Element,\n directive: TDirectiveName,\n values?: string\n): Promise => {\n return new Promise((resolve, reject) => {\n const directiveValues = values || Node.getAttribute(directive);\n if (!directiveValues) {\n const err = regError(\n 'Empty',\n 'The value of the directive \"' + directive + '\" is empty',\n Node\n );\n reject(err);\n return;\n }\n\n // Creating, inserting, and adding classNames of rules in Node.\n const objStyles = buildAttr(directiveValues, directive, true);\n const classesToAdd = Object.keys(objStyles).join(' ');\n\n // removing prop of Node and adding the corresponding classes\n eventReady({\n node: Node,\n directive,\n classes: classesToAdd,\n resolve,\n });\n });\n};\n\nexport default setAttr;\n","import setAttr from './setAttr';\r\n\r\nconst setHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'hgt', values);\r\n};\r\n\r\nexport default setHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marb', values);\r\n};\r\n\r\nexport default setMarBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marl', values);\r\n};\r\n\r\nexport default setMarLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'marr', values);\r\n};\r\n\r\nexport default setMarRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMar = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mar', values);\r\n};\r\n\r\nexport default setMar;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMarTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mart', values);\r\n};\r\n\r\nexport default setMarTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxw', values);\r\n};\r\n\r\nexport default setMaxWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mih', values);\r\n};\r\n\r\nexport default setMinHeight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMinWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'miw', values);\r\n};\r\n\r\nexport default setMinWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadBottom = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padb', values);\r\n};\r\n\r\nexport default setPadBottom;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadLeft = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padl', values);\r\n};\r\n\r\nexport default setPadLeft;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadRight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padr', values);\r\n};\r\n\r\nexport default setPadRight;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPad = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'pad', values);\r\n};\r\n\r\nexport default setPad;\r\n","import setAttr from './setAttr';\r\n\r\nconst setPadTop = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'padt', values);\r\n};\r\n\r\nexport default setPadTop;\r\n","import setAttr from './setAttr';\r\n\r\nconst setWidth = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'wdh', values);\r\n};\r\n\r\nexport default setWidth;\r\n","import setAttr from './setAttr';\r\n\r\nconst setMaxHeight = (\r\n Node: HTMLElement | Element,\r\n values?: string\r\n): Promise => {\r\n return setAttr(Node, 'mxh', values);\r\n};\r\n\r\nexport default setMaxHeight;\r\n","import setAttr from './setAttr';\n\nconst setPosition = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'pos', values);\n};\n\nexport default setPosition;\n","import setAttr from './setAttr';\n\nconst setTop = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 't', values);\n};\n\nexport default setTop;\n","import setAttr from './setAttr';\n\nconst setRight = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'r', values);\n};\n\nexport default setRight;\n","import setAttr from './setAttr';\n\nconst setBottom = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'b', values);\n};\n\nexport default setBottom;\n","import setAttr from './setAttr';\n\nconst setLeft = (\n Node: HTMLElement | Element,\n values?: string\n): Promise => {\n return setAttr(Node, 'l', values);\n};\n\nexport default setLeft;\n","import { TDirectiveName } from './../config/processors';\r\nimport { processors } from '../config/processors';\r\nimport addClasses from '../utils/addClasses';\r\nimport removeAttr from '../utils/removeAttr';\r\n\r\nconst reset = (Node: HTMLElement | Element): Promise => {\r\n return new Promise((resolve) => {\r\n const classPrefixes = new Set(\r\n Object.keys(processors).map(\r\n (item) => processors[item as TDirectiveName].classPrefix\r\n )\r\n );\r\n const layouterClasses = [...classPrefixes];\r\n const restClass = Node.className.split(' ').filter((name) => {\r\n if (!name.includes('-')) {\r\n return true;\r\n } else {\r\n const findClass = layouterClasses.find((item) => {\r\n const nLength = item.length;\r\n const namePrefix = name.substring(0, nLength + 1);\r\n return namePrefix === item + '-';\r\n });\r\n return !findClass;\r\n }\r\n });\r\n\r\n if (restClass.length) {\r\n const classesName = restClass.join(' ');\r\n addClasses(Node, classesName, true).then(() => {\r\n resolve();\r\n });\r\n } else {\r\n removeAttr(Node, 'class').then(() => {\r\n resolve();\r\n });\r\n }\r\n });\r\n};\r\n\r\nexport default reset;\r\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\n\nconst searchAndProcess = (\n layouter: ILayouter,\n context: Document | HTMLElement | Element\n) => {\n return new Promise((resolve) => {\n const props = Object.keys(processors);\n const attrs = props.map((prop) => `[${prop}]`).join(', ');\n const nodes = context.querySelectorAll(attrs);\n if (!nodes.length) {\n resolve(layouter);\n return;\n }\n\n const setNodes = new Set();\n Array.prototype.forEach.call(nodes, (itemNode) => {\n setNodes.add(itemNode);\n });\n const promises: Promise[] = [];\n setNodes.forEach((node) => {\n promises.push(layouter.set(node as Element | HTMLElement));\n });\n Promise.all(promises).then(resolve);\n });\n};\n\nexport default searchAndProcess;\n","import { ILayouter } from './../layouter';\nimport { processors } from '../config/processors';\nimport getConfig from '../config/main';\nimport searchAndProcess from './searchAndProcess';\n\nconst mainObserver = (layouter: ILayouter) => {\n const config = getConfig();\n const props = Object.keys(processors);\n const obsBody = new layouter.context.MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n if (!mutation.addedNodes.length) {\n continue;\n }\n mutation.addedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n searchAndProcess(layouter, node);\n }\n });\n } else if (mutation.type === 'attributes') {\n const node = mutation.target;\n if (node instanceof HTMLElement) {\n const props = layouter.getParameters(node);\n if (Object.keys(props).length) {\n layouter.set(node, props);\n }\n }\n }\n }\n });\n const observerOptions = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: props,\n characterData: false,\n };\n obsBody.observe(config.context.document.body, observerOptions);\n};\n\nexport default mainObserver;\n","import { IConfig, IConfigUser, setConfig, updateConfig } from './config/main';\nimport getParameters from './methods/getParameters';\n\nimport build from './methods/build';\nimport buildCols from './methods/buildCols';\nimport buildFlex from './methods/buildFlex';\nimport buildPad from './methods/buildPad';\nimport buildPadTop from './methods/buildPadTop';\nimport buildPadRight from './methods/buildPadRight';\nimport buildPadBottom from './methods/buildPadBottom';\nimport buildPadLeft from './methods/buildPadLeft';\nimport buildMar from './methods/buildMar';\nimport buildMarTop from './methods/buildMarTop';\nimport buildMarRight from './methods/buildMarRight';\nimport buildMarBottom from './methods/buildMarBottom';\nimport buildMarLeft from './methods/buildMarLeft';\nimport buildMaxWidth from './methods/buildMaxWidth';\nimport buildMaxHeight from './methods/buildMaxHeight';\nimport buildMinWidth from './methods/buildMinWidth';\nimport buildMinHeight from './methods/buildMinHeight';\nimport buildHeight from './methods/buildHeight';\nimport buildWidth from './methods/buildWidth';\nimport buildPosition from './methods/buildPosition';\nimport buildTop from './methods/buildTop';\nimport buildRight from './methods/buildRight';\nimport buildBottom from './methods/buildBottom';\nimport buildLeft from './methods/buildLeft';\n\nimport set from './methods/set';\nimport setFlex from './methods/setFlex';\nimport setCols from './methods/SetCols';\nimport setHeight from './methods/setHeight';\nimport setMarBottom from './methods/setMarBottom';\nimport setMarLeft from './methods/setMarLeft';\nimport setMarRight from './methods/setMarRight';\nimport setMar from './methods/setMar';\nimport setMarTop from './methods/setMarTop';\nimport setMaxWidth from './methods/setMaxWidth';\nimport setMinHeight from './methods/setMinHeight';\nimport setMinWidth from './methods/setMinWidth';\nimport setPadBottom from './methods/setPadBottom';\nimport setPadLeft from './methods/setPadLeft';\nimport setPadRight from './methods/setPadRight';\nimport setPad from './methods/setPad';\nimport setPadTop from './methods/setPadTop';\nimport setWidth from './methods/setWidth';\nimport setMaxHeight from './methods/setMaxHeight';\nimport setPosition from './methods/setPosition';\nimport setTop from './methods/setTop';\nimport setRight from './methods/setRight';\nimport setBottom from './methods/setBottom';\nimport setLeft from './methods/setLeft';\n\nimport insertRules from './methods/insertRules';\nimport reset from './methods/reset';\n\nimport { IStyles } from './helpers/createStyles';\nimport { IBuildResult } from './methods/build';\nimport searchAndProcess from './helpers/searchAndProcess';\nimport mainObserver from './helpers/mainObserver';\nimport { TDirectiveName } from './config/processors';\n\nexport interface ILayouter extends IConfig {\n getParameters: (\n Node: HTMLElement | Element\n ) => Partial>;\n updateConfig: (userConfig: Partial>) => IConfig;\n build: (\n obj: Partial>,\n insertStyles?: boolean\n ) => Partial | Error;\n buildCols: (valCols: string, insertStyles?: boolean) => IStyles | Error;\n buildFlex: (valFlex: string, insertStyles?: boolean) => IStyles | Error;\n buildPad: (valPads: string, insertStyles?: boolean) => IStyles;\n buildPadTop: (valPadTop: string, insertStyles?: boolean) => IStyles;\n buildPadRight: (valPadRight: string, insertStyles?: boolean) => IStyles;\n buildPadBottom: (valPadBottom: string, insertStyles?: boolean) => IStyles;\n buildPadLeft: (valPadLeft: string, insertStyles?: boolean) => IStyles;\n buildMar: (valMars: string, insertStyles?: boolean) => IStyles;\n buildMarTop: (valMarTop: string, insertStyles?: boolean) => IStyles;\n buildMarRight: (valMarRight: string, insertStyles?: boolean) => IStyles;\n buildMarBottom: (valMarBottom: string, insertStyles?: boolean) => IStyles;\n buildMarLeft: (valMarLeft: string, insertStyles?: boolean) => IStyles;\n buildMaxWidth: (valMaxWidth: string, insertStyles?: boolean) => IStyles;\n buildMaxHeight: (valMaxHeight: string, insertStyles?: boolean) => IStyles;\n buildMinWidth: (valMinWidth: string, insertStyles?: boolean) => IStyles;\n buildMinHeight: (valMinHeight: string, insertStyles?: boolean) => IStyles;\n buildHeight: (valHeight: string, insertStyles?: boolean) => IStyles;\n buildWidth: (valWidth: string, insertStyles?: boolean) => IStyles;\n buildPosition: (\n valPosition: string,\n insertStyles?: boolean\n ) => IStyles | Error;\n buildTop: (valTop: string, insertStyles?: boolean) => IStyles | Error;\n buildRight: (valRight: string, insertStyles?: boolean) => IStyles | Error;\n buildBottom: (valBottom: string, insertStyles?: boolean) => IStyles | Error;\n buildLeft: (valLeft: string, insertStyles?: boolean) => IStyles | Error;\n\n set: (\n Node: HTMLElement | Element,\n parameters?: Partial>\n ) => Promise;\n setCols: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setFlex: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMar: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMarLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPad: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPadLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxWidth: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMinHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setMaxHeight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setPosition: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n setTop: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setRight: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setBottom: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n setLeft: (\n Node: HTMLElement | Element,\n values?: string\n ) => Promise;\n\n insertRules: (objStyles: IStyles) => void;\n reset: (Node: HTMLElement | Element) => Promise;\n version: string;\n}\n\ndeclare global {\n interface Window {\n layouter: ILayouter;\n }\n}\n\nconst layouter = (\n context: Window & typeof globalThis,\n userConfig: Partial = {}\n): ILayouter => {\n const config = setConfig(context, userConfig);\n\n const instance = {\n ...config,\n getParameters,\n updateConfig,\n insertRules,\n build,\n buildCols,\n buildFlex,\n buildPad,\n buildPadTop,\n buildPadRight,\n buildPadBottom,\n buildPadLeft,\n buildMar,\n buildMarTop,\n buildMarRight,\n buildMarBottom,\n buildMarLeft,\n buildMaxWidth,\n buildMaxHeight,\n buildMinWidth,\n buildMinHeight,\n buildHeight,\n buildWidth,\n set,\n setCols,\n setFlex,\n setMar,\n setMarTop,\n setMarRight,\n setMarBottom,\n setMarLeft,\n setPad,\n setPadTop,\n setPadRight,\n setPadBottom,\n setPadLeft,\n setWidth,\n setMinWidth,\n setMaxWidth,\n setHeight,\n setMinHeight,\n setMaxHeight,\n reset,\n buildPosition,\n buildTop,\n buildRight,\n buildBottom,\n buildLeft,\n setPosition,\n setTop,\n setRight,\n setBottom,\n setLeft,\n };\n\n // Auto init process\n searchAndProcess(instance, context.document).then(() => {\n if (instance.ready) instance.ready(instance);\n mainObserver(instance);\n });\n\n return instance;\n};\n\nif (typeof window !== 'undefined' && typeof exports === 'undefined') {\n window.layouter = layouter(window);\n}\n\nexport default layouter;\n"],"names":["config"],"mappings":"2OAkBA,KAAM,GAAkB,CACtB,EACA,IACmB,CACnB,KAAM,GAAwB,CAAA,EAE9B,MAAI,KAAa,QACf,OAAO,KAAK,CAAM,EACf,IAAI,AAAC,GACG,EACL,MAAO,EACP,MAAO,EAAO,GAAI,KAAA,EAErB,EACA,KAAK,CAAC,EAAgB,IACrB,EAAE,MAAQ,EAAE,MAAQ,EAAI,EAAE,MAAQ,EAAE,MAAQ,GAAK,CACnD,EACC,QAAQ,CAAC,EAAiB,IAAkB,CAC3C,EAAM,EAAG,OAAS,AAAC,EAAY,EAAO,EAAG,OAAO,GAArB,CAAqB,CACjD,EAEH,OAAO,KAAK,CAAM,EAAE,QAAQ,AAAC,GAAO,CAC5B,EAAA,GAAM,EAAO,GAAI,EAAA,CACxB,EAGI,CACT,ECzBM,EAAoB,CAAC,CACzB,OAAQ,EACR,KACA,gBACA,OACA,aAC6C,C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C,GAAa,CAAQ,CAAA,CACtB,EAEM,CACT,EAEA,MAAI,OAAO,SAAW,aAAe,MAAO,UAAY,aAC/C,QAAA,SAAW,GAAS,MAAM"} \ No newline at end of file diff --git a/dist/methods/buildDisplay.d.ts b/dist/methods/buildDisplay.d.ts new file mode 100644 index 0000000..55414bc --- /dev/null +++ b/dist/methods/buildDisplay.d.ts @@ -0,0 +1,3 @@ +import { IStyles } from '../helpers/createStyles'; +declare const buildDisplay: (valDisplay: string, insertStyles?: boolean) => IStyles | Error; +export default buildDisplay; diff --git a/index.html b/index.html index 44e7eba..a76192e 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,8 @@ +
...
+