@medyll/cssfabric 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +33 -0
- package/.idea/cssfabric.iml +11 -0
- package/.idea/misc.xml +9 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.vscode/settings.json +24 -0
- package/bin/index.js +8 -0
- package/cssfabric.sass.js +8 -0
- package/gulpfile.js +532 -0
- package/package.json +17 -61
- package/src/app.css +107 -0
- package/src/app.d.ts +15 -0
- package/src/app.html +13 -0
- package/src/components/Header.svelte +17 -0
- package/src/components/HeaderSiteTitle.svelte +12 -0
- package/src/components/InnerMenu.svelte +27 -0
- package/src/components/SubHeader.svelte +10 -0
- package/src/components/SubHeaderH.svelte +3 -0
- package/src/components/SubSubHeader.svelte +22 -0
- package/src/components/demo/DemoElement.svelte +86 -0
- package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
- package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
- package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
- package/src/components/demo/elements/DemoElementColor.svelte +8 -0
- package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
- package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
- package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
- package/src/components/demo/elements/DemoElementScale.svelte +9 -0
- package/src/components/demo/elements/DemoElementTable.svelte +34 -0
- package/src/components/demo/elements/DemoElementText.svelte +10 -0
- package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
- package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
- package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
- package/src/components/docs/Docs.svelte +97 -0
- package/src/components/docs/DocsClassNames.svelte +34 -0
- package/src/components/docs/DocsDemo.svelte +84 -0
- package/src/components/header/Header.svelte +105 -0
- package/src/components/header/svelte-logo.svg +1 -0
- package/src/cssfabric/_utils.scss +203 -0
- package/{_generated → src/cssfabric}/index.d.ts +0 -0
- package/src/cssfabric/modules/_cssfabric-config.scss +173 -0
- package/src/cssfabric/modules/_mixins.scss +1 -0
- package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
- package/src/cssfabric/modules/animation/animation.scss +3 -0
- package/src/cssfabric/modules/base/_base-vars.scss +19 -0
- package/src/cssfabric/modules/base/base.scss +75 -0
- package/src/cssfabric/modules/box/_box-build.scss +306 -0
- package/src/cssfabric/modules/box/_box-vars.scss +121 -0
- package/src/cssfabric/modules/box/box-responsive.scss +18 -0
- package/src/cssfabric/modules/box/box.scss +3 -0
- package/src/cssfabric/modules/color/_color-build.scss +196 -0
- package/src/cssfabric/modules/color/_color-vars.scss +80 -0
- package/src/cssfabric/modules/color/color-responsive.scss +23 -0
- package/src/cssfabric/modules/color/color.scss +9 -0
- package/src/cssfabric/modules/css-fabric.scss +2 -0
- package/src/cssfabric/modules/flex/_flex-build.scss +150 -0
- package/src/cssfabric/modules/flex/_flex-vars.scss +84 -0
- package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
- package/src/cssfabric/modules/flex/flex.scss +3 -0
- package/src/cssfabric/modules/grid/_grid-build.scss +84 -0
- package/src/cssfabric/modules/grid/_grid-vars.scss +88 -0
- package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
- package/src/cssfabric/modules/grid/grid.scss +6 -0
- package/src/cssfabric/modules/menu/_menu-build.scss +120 -0
- package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
- package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
- package/src/cssfabric/modules/menu/menu.scss +6 -0
- package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
- package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
- package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
- package/src/cssfabric/modules/overflow/overflow.scss +7 -0
- package/src/cssfabric/modules/scale/_scale-build.scss +142 -0
- package/src/cssfabric/modules/scale/_scale-vars.scss +84 -0
- package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
- package/src/cssfabric/modules/scale/scale.scss +8 -0
- package/src/cssfabric/modules/table/_table-build.scss +134 -0
- package/src/cssfabric/modules/table/_table-vars.scss +30 -0
- package/src/cssfabric/modules/table/table-responsive.scss +24 -0
- package/src/cssfabric/modules/table/table.scss +8 -0
- package/src/cssfabric/modules/text/_text-build.scss +166 -0
- package/src/cssfabric/modules/text/_text-vars.scss +87 -0
- package/src/cssfabric/modules/text/text-responsive.scss +26 -0
- package/src/cssfabric/modules/text/text.scss +6 -0
- package/src/cssfabric/modules/theme/_theme-build.scss +90 -0
- package/src/cssfabric/modules/theme/_theme-vars.scss +46 -0
- package/src/cssfabric/modules/theme/theme.scss +6 -0
- package/src/cssfabric/modules/vars.scss +50 -0
- package/src/cssfabric/modules/zindex/_zindex-vars.scss +14 -0
- package/src/cssfabric/modules/zindex/zindex.scss +15 -0
- package/src/hooks.ts +27 -0
- package/src/index.d.ts +3 -0
- package/src/index.ts +4 -0
- package/{_generated → src/lib/_generated}/cssFabric.vars.json +0 -0
- package/{_generated → src/lib/_generated}/export.variables.md +0 -0
- package/src/lib/_generated/index.d.ts +3 -0
- package/{_generated → src/lib/_generated}/readme.md +0 -0
- package/{init/importCssVars.js → src/lib/init/importCssVars.ts} +3 -2
- package/src/lib/scripts/cssfabric.ts +54 -0
- package/{scripts/cssfabricClassNames.js → src/lib/scripts/cssfabricClassNames.ts} +112 -42
- package/{scripts → src/lib/scripts}/index.d.ts +0 -0
- package/src/lib/scripts/index.ts +8 -0
- package/src/lib/scripts/utils.ts +37 -0
- package/{styles → src/lib/styles}/animation/animation.css +0 -0
- package/{styles → src/lib/styles}/animation/animation.min.css +0 -0
- package/{styles → src/lib/styles}/base/base.css +0 -0
- package/{styles → src/lib/styles}/base/base.min.css +0 -0
- package/{styles → src/lib/styles}/box/box.css +0 -0
- package/{styles → src/lib/styles}/box/box.min.css +0 -0
- package/{styles → src/lib/styles}/box/box.responsive.css +0 -0
- package/{styles → src/lib/styles}/box/box.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/color/color.css +0 -0
- package/{styles → src/lib/styles}/color/color.min.css +0 -0
- package/{styles → src/lib/styles}/color/color.responsive.css +0 -0
- package/{styles → src/lib/styles}/color/color.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/cssfabric.css +0 -0
- package/{styles → src/lib/styles}/cssfabric.min.css +0 -0
- package/{styles → src/lib/styles}/cssfabric.responsive.css +0 -0
- package/{styles → src/lib/styles}/cssfabric.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/flex/flex.css +0 -0
- package/{styles → src/lib/styles}/flex/flex.min.css +0 -0
- package/{styles → src/lib/styles}/flex/flex.responsive.css +0 -0
- package/{styles → src/lib/styles}/flex/flex.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/grid/grid.css +0 -0
- package/{styles → src/lib/styles}/grid/grid.min.css +0 -0
- package/{styles → src/lib/styles}/grid/grid.responsive.css +0 -0
- package/{styles → src/lib/styles}/grid/grid.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/menu/menu.css +0 -0
- package/{styles → src/lib/styles}/menu/menu.min.css +0 -0
- package/{styles → src/lib/styles}/menu/menu.responsive.css +0 -0
- package/{styles → src/lib/styles}/menu/menu.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/overflow/overflow.css +0 -0
- package/{styles → src/lib/styles}/overflow/overflow.min.css +0 -0
- package/{styles → src/lib/styles}/overflow/overflow.responsive.css +0 -0
- package/{styles → src/lib/styles}/overflow/overflow.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/scale/scale.css +0 -0
- package/{styles → src/lib/styles}/scale/scale.min.css +0 -0
- package/{styles → src/lib/styles}/scale/scale.responsive.css +0 -0
- package/{styles → src/lib/styles}/scale/scale.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/table/table.css +0 -0
- package/{styles → src/lib/styles}/table/table.min.css +0 -0
- package/{styles → src/lib/styles}/table/table.responsive.css +0 -0
- package/{styles → src/lib/styles}/table/table.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/text/text.css +0 -0
- package/{styles → src/lib/styles}/text/text.min.css +0 -0
- package/{styles → src/lib/styles}/text/text.responsive.css +0 -0
- package/{styles → src/lib/styles}/text/text.responsive.min.css +0 -0
- package/{styles → src/lib/styles}/theme/theme.css +0 -0
- package/{styles → src/lib/styles}/theme/theme.min.css +0 -0
- package/{styles → src/lib/styles}/vars.css +0 -0
- package/{styles → src/lib/styles}/vars.min.css +0 -0
- package/{styles → src/lib/styles}/zindex/zindex.css +0 -0
- package/{styles → src/lib/styles}/zindex/zindex.min.css +0 -0
- package/src/routes/__layout.svelte +91 -0
- package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
- package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
- package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
- package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
- package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
- package/src/routes/cssfabric-modules/__layout.svelte +26 -0
- package/src/routes/cssfabric-modules/index.svelte +0 -0
- package/src/routes/index.svelte +62 -0
- package/src/routes/installation/__layout.svelte +1 -0
- package/src/routes/installation/index.svelte +28 -0
- package/src/scripts/utils.ts +26 -0
- package/src/utils.ts +71 -0
- package/src/vendor/index.d.ts +3 -0
- package/src/vendor/normalize/normalize.min.css +2 -0
- package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
- package/src/vendor/sass-json-export/Gruntfile.js +60 -0
- package/src/vendor/sass-json-export/LICENSE +20 -0
- package/src/vendor/sass-json-export/README.md +90 -0
- package/src/vendor/sass-json-export/package.json +60 -0
- package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
- package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
- package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
- package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
- package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
- package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
- package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
- package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
- package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
- package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
- package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
- package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
- package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
- package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
- package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
- package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
- package/src/vendor/sass-json-export/test/test.scss +9 -0
- package/static/favicon.png +0 -0
- package/static/robots.txt +3 -0
- package/svelte.config.js +25 -0
- package/tsconfig.json +3 -0
- package/webpack.config.js +55 -0
- package/init/importCssVars.d.ts +0 -1
- package/scripts/cssfabric.d.ts +0 -24
- package/scripts/cssfabric.js +0 -43
- package/scripts/cssfabricClassNames.d.ts +0 -14
- package/scripts/index.js +0 -4
- package/scripts/utils.d.ts +0 -5
- package/scripts/utils.js +0 -38
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
@use 'zindex-vars';
|
|
3
|
+
$zindex-config: zindex-vars.$zindex-config;
|
|
4
|
+
// load scss config file
|
|
5
|
+
@use '../../_utils';
|
|
6
|
+
|
|
7
|
+
// read variables
|
|
8
|
+
$z_groups: map-get($zindex-config, z_groups);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@for $z_value from 0 through 10 {
|
|
12
|
+
.zI-#{$z_value} {
|
|
13
|
+
z-index: (($z_value) * 100);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/hooks.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import cookie from 'cookie';
|
|
2
|
+
import {v4 as uuid} from '@lukeed/uuid';
|
|
3
|
+
import type {Handle} from '@sveltejs/kit';
|
|
4
|
+
|
|
5
|
+
export const handle: Handle = async ({event, resolve}) => {
|
|
6
|
+
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
|
|
7
|
+
event.locals.userid = cookies.userid || uuid();
|
|
8
|
+
|
|
9
|
+
const response = await resolve(event, {
|
|
10
|
+
ssr : false,
|
|
11
|
+
transformPage: ({html}) => html.replace('old', 'new')
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
if (!cookies.userid) {
|
|
15
|
+
// if this is the first time the user has visited this app,
|
|
16
|
+
// set a cookie so that we recognise them when they return
|
|
17
|
+
response.headers.set(
|
|
18
|
+
'set-cookie',
|
|
19
|
+
cookie.serialize('userid', event.locals.userid, {
|
|
20
|
+
path : '/',
|
|
21
|
+
httpOnly: true
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return response;
|
|
27
|
+
};
|
package/src/index.d.ts
ADDED
package/src/index.ts
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
// copy css vars file
|
|
2
|
-
|
|
1
|
+
// copy css vars file
|
|
2
|
+
|
|
3
|
+
export {}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import jsonConfig from "../_generated/cssFabric.vars.json" ;
|
|
2
|
+
import cssfabricClassNames from "./cssfabricClassNames";
|
|
3
|
+
|
|
4
|
+
export type IFabricConfModulePart = Record<string, any>;
|
|
5
|
+
export type IFabricConfModuleDataPart = Record<string, any>;
|
|
6
|
+
export type IFabricConfModuleMetaDataPart = Record<string, any>;
|
|
7
|
+
export type IFabricConfModuleDocsPart = Record<string, any>;
|
|
8
|
+
export type TFabricConfModuleDocsAttributesPart = Record<string, any>;
|
|
9
|
+
|
|
10
|
+
//
|
|
11
|
+
const getModuleList = (): Record<string, any> => {
|
|
12
|
+
return jsonConfig["cssfabric"]?.["modules"] || {};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getModuleConfig = (module?: string): IFabricConfModulePart => {
|
|
16
|
+
if (module) return jsonConfig["cssfabric"]?.["modules"]?.[module] || {};
|
|
17
|
+
return jsonConfig;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getModuleData = (module?: string): IFabricConfModuleDataPart => {
|
|
21
|
+
if (module) return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_data"] || {};
|
|
22
|
+
return jsonConfig;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getModuleMetaData = (module?: string): IFabricConfModuleMetaDataPart => {
|
|
26
|
+
if (module)
|
|
27
|
+
return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_metadata"] || {};
|
|
28
|
+
return jsonConfig;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const getModuleDocs = (module?: string): IFabricConfModuleDocsPart => {
|
|
32
|
+
if (module)
|
|
33
|
+
return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"] || {};
|
|
34
|
+
return jsonConfig;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const getModuleDocsAttributes = (module?: string): TFabricConfModuleDocsAttributesPart => {
|
|
38
|
+
if (module)
|
|
39
|
+
return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"]?.["attributes"] || {};
|
|
40
|
+
return jsonConfig;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
getModuleList,
|
|
45
|
+
getModuleConfig,
|
|
46
|
+
getModuleData,
|
|
47
|
+
getModuleMetaData,
|
|
48
|
+
getModuleDocs,
|
|
49
|
+
getModuleDocsAttributes,
|
|
50
|
+
getClassNames: cssfabricClassNames,
|
|
51
|
+
getModuleClassNames: cssfabricClassNames,
|
|
52
|
+
getModuleTagClassNames: cssfabricClassNames.getModuleTagClassNames,
|
|
53
|
+
getModuleTagDebug: cssfabricClassNames.getModuleTagDebug,
|
|
54
|
+
};
|
|
@@ -1,48 +1,94 @@
|
|
|
1
|
-
import cssfabric from "./cssfabric"
|
|
2
|
-
import utils
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import cssfabric from "./cssfabric"
|
|
2
|
+
import utils from "./utils";
|
|
3
|
+
|
|
4
|
+
export interface IListCssfabricClassNamesProps {
|
|
5
|
+
module: string;
|
|
6
|
+
moduleAttribute: any;
|
|
7
|
+
outputStyle?: 'default' | 'debug';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type TFabricClassName = string;
|
|
11
|
+
type TClassNameFragment = string | number;
|
|
12
|
+
|
|
13
|
+
type TCollect = string[];
|
|
14
|
+
type TFabricClassNameList = TFabricClassName[];
|
|
15
|
+
type TFabricClassNameListFragments = TClassNameFragment[];
|
|
16
|
+
|
|
17
|
+
type TGuess = any;
|
|
18
|
+
type TLevelKey = string;
|
|
19
|
+
|
|
20
|
+
type level = string[];
|
|
21
|
+
|
|
22
|
+
type IModuleLevels = level | level[] | [] | any[] | Record<string, any[]>;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export interface ILoopIt {
|
|
26
|
+
module: string;
|
|
6
27
|
}
|
|
7
|
-
|
|
8
|
-
|
|
28
|
+
|
|
29
|
+
function loopIt(props: ILoopIt) {
|
|
30
|
+
|
|
31
|
+
const {module} = props;
|
|
9
32
|
const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function cssfabricClassNames(props: IListCssfabricClassNamesProps) {
|
|
37
|
+
|
|
38
|
+
const {module, moduleAttribute, outputStyle} = props;
|
|
39
|
+
const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
|
|
40
|
+
|
|
41
|
+
const fabricAttributes = moduleAttributes[moduleAttribute];
|
|
42
|
+
const moduleTag = fabricAttributes["tag"];
|
|
43
|
+
const moduleKeys: any[] = fabricAttributes["keys"] || undefined;
|
|
44
|
+
const moduleLevels: IModuleLevels = fabricAttributes["levels"] || undefined;
|
|
45
|
+
const moduleLevelsLinked: IModuleLevels = fabricAttributes["levelsLinked"] || undefined;
|
|
46
|
+
const moduleLevelsExtended = fabricAttributes["levelsDeclin"] || undefined;
|
|
47
|
+
const moduleClassNames = fabricAttributes["classNames"] || undefined;
|
|
48
|
+
|
|
49
|
+
let finalOutput: TCollect = [];
|
|
50
|
+
let finalOutputDebug: Record<string, any> = {};
|
|
51
|
+
|
|
52
|
+
|
|
19
53
|
return doParse(outputStyle);
|
|
20
|
-
|
|
21
|
-
|
|
54
|
+
|
|
55
|
+
function doParse(mode?: string) {
|
|
56
|
+
|
|
57
|
+
let keyList,
|
|
58
|
+
levelList,
|
|
59
|
+
levelListLinked,
|
|
60
|
+
levelListDeclin;
|
|
61
|
+
|
|
22
62
|
const finalOut = [];
|
|
23
63
|
const debugOut = {};
|
|
64
|
+
|
|
24
65
|
if (moduleKeys && moduleKeys.length) {
|
|
25
66
|
// beware of any [][]
|
|
26
67
|
keyList = concatenateWithKey(moduleTag, moduleKeys);
|
|
27
68
|
}
|
|
69
|
+
|
|
28
70
|
if (moduleLevels && Object.keys(moduleLevels).length) { // object !!!
|
|
29
71
|
levelList = Object.keys(moduleLevels).map((level) => {
|
|
30
|
-
let val = moduleLevels[level]
|
|
72
|
+
let val = moduleLevels[level]
|
|
31
73
|
return concatenateWithKey(level, val);
|
|
32
74
|
}).flat();
|
|
33
75
|
}
|
|
76
|
+
|
|
34
77
|
if (moduleLevelsLinked && Object.keys(moduleLevelsLinked).length) {
|
|
35
78
|
levelListLinked = Object.keys(moduleLevelsLinked).map((level) => {
|
|
36
|
-
let val = moduleLevelsLinked[level]
|
|
79
|
+
let val = moduleLevelsLinked[level]
|
|
37
80
|
return concatenateWithKey(level, val);
|
|
38
81
|
}).flat();
|
|
39
82
|
}
|
|
83
|
+
|
|
84
|
+
|
|
40
85
|
if (moduleLevelsExtended && Object.keys(moduleLevelsExtended).length) {
|
|
41
86
|
levelListDeclin = Object.keys(moduleLevelsExtended).map((level) => {
|
|
42
|
-
let val = moduleLevelsLinked[level]
|
|
87
|
+
let val = moduleLevelsLinked[level]
|
|
43
88
|
return concatenateWithKey(level, val);
|
|
44
89
|
}).flat();
|
|
45
90
|
}
|
|
91
|
+
|
|
46
92
|
// prefix all now , and link
|
|
47
93
|
// colors :
|
|
48
94
|
if (keyList && !moduleLevels && !moduleLevelsLinked) {
|
|
@@ -50,18 +96,24 @@ function cssfabricClassNames(props) {
|
|
|
50
96
|
finalOut.push(keyList);
|
|
51
97
|
registerDebug('default', keyList);
|
|
52
98
|
}
|
|
99
|
+
|
|
53
100
|
if (moduleKeys && (moduleLevels || moduleLevelsLinked)) {
|
|
54
101
|
// base
|
|
55
102
|
if (moduleLevels) {
|
|
56
103
|
let tg = keyList.map(x => {
|
|
104
|
+
|
|
57
105
|
let tre = Object.keys(moduleLevels).map((level) => {
|
|
58
|
-
let val = moduleLevels[level]
|
|
106
|
+
let val = moduleLevels[level]
|
|
107
|
+
|
|
59
108
|
let debugKey = (x !== '_' && x.toString().charAt(0) !== '_') ? x : level;
|
|
60
|
-
debugKey = (level.toString().charAt(0)
|
|
61
|
-
registerDebug(x, concatenateWithKey(debugKey, val), level);
|
|
109
|
+
debugKey = (level.toString().charAt(0)==='_')? debugKey : debugKey + '-' + level
|
|
110
|
+
registerDebug(x, concatenateWithKey(debugKey , val), level);
|
|
111
|
+
|
|
62
112
|
return concatenateWithKey(level, val);
|
|
63
|
-
}).flat(4)
|
|
113
|
+
}).flat(4)
|
|
114
|
+
|
|
64
115
|
return concatenateWithKey(x, tre);
|
|
116
|
+
|
|
65
117
|
});
|
|
66
118
|
// is it declinated ? only colors, so nope
|
|
67
119
|
// export
|
|
@@ -71,10 +123,12 @@ function cssfabricClassNames(props) {
|
|
|
71
123
|
if (moduleLevelsLinked) {
|
|
72
124
|
//
|
|
73
125
|
let yt = Object.values(moduleKeys).map(moduleKey => {
|
|
126
|
+
|
|
74
127
|
if (moduleKeys.includes(moduleKey)) {
|
|
75
128
|
let out = [];
|
|
76
129
|
// linked are here !!
|
|
77
130
|
registerDebug('linked', concatenateWithKey(moduleTag + '-' + moduleKey, moduleLevelsLinked[moduleKey]), moduleKey);
|
|
131
|
+
|
|
78
132
|
out.push(concatenateWithKey(moduleKey, moduleLevelsLinked[moduleKey]));
|
|
79
133
|
// is it declinated ?
|
|
80
134
|
if (moduleLevelsExtended && moduleLevelsExtended[moduleKey]) {
|
|
@@ -82,65 +136,81 @@ function cssfabricClassNames(props) {
|
|
|
82
136
|
out.push(moduleLevelsLinked[moduleKey].map((z) => {
|
|
83
137
|
// iddem
|
|
84
138
|
registerDebug('declinated', concatenateWithKey(moduleTag + '-' + moduleKey + '-' + z, moduleLevelsExtended[moduleKey]), z);
|
|
139
|
+
|
|
85
140
|
return concatenateWithKey(z, moduleLevelsExtended[moduleKey]);
|
|
86
|
-
}).flat(2))
|
|
141
|
+
}).flat(2))
|
|
87
142
|
}
|
|
143
|
+
|
|
88
144
|
// flatten for group here
|
|
89
145
|
return out.flat(2);
|
|
90
146
|
}
|
|
91
147
|
}).flat();
|
|
148
|
+
|
|
92
149
|
// export
|
|
93
150
|
finalOut.push(concatenateWithKey(moduleTag, yt));
|
|
151
|
+
|
|
94
152
|
}
|
|
95
153
|
if (levelListDeclin) {
|
|
96
154
|
} // only colors ? don't go there
|
|
155
|
+
|
|
97
156
|
}
|
|
98
157
|
if (!keyList && levelList) {
|
|
99
158
|
// export
|
|
100
159
|
let kkk = concatenateWithKey(moduleTag, levelList);
|
|
101
160
|
finalOut.push(kkk);
|
|
102
161
|
}
|
|
162
|
+
|
|
103
163
|
if (moduleClassNames) {
|
|
104
|
-
let kk
|
|
164
|
+
let kk = parseClassNames();
|
|
105
165
|
let kkk = concatenateWithKey(moduleTag, kk);
|
|
166
|
+
|
|
106
167
|
registerDebug('classnames', kk);
|
|
168
|
+
|
|
107
169
|
// export
|
|
108
170
|
finalOut.push(kkk);
|
|
109
171
|
}
|
|
172
|
+
|
|
110
173
|
if (mode && mode === 'debug') {
|
|
111
|
-
return finalOutputDebug
|
|
112
|
-
|
|
113
|
-
else {
|
|
174
|
+
return finalOutputDebug
|
|
175
|
+
|
|
176
|
+
} else {
|
|
114
177
|
return finalOut.flat(2);
|
|
115
178
|
}
|
|
116
179
|
}
|
|
117
|
-
|
|
180
|
+
|
|
181
|
+
function registerDebug(tag: string, data: string[], nestedTag?: string) {
|
|
118
182
|
if (nestedTag) {
|
|
119
|
-
if (!finalOutputDebug[tag])
|
|
120
|
-
finalOutputDebug[tag] = {};
|
|
183
|
+
if (!finalOutputDebug[tag]) finalOutputDebug[tag] = {}
|
|
121
184
|
finalOutputDebug[tag][nestedTag] = finalOutputDebug[tag][nestedTag] ? finalOutputDebug[tag][nestedTag].concat(data) : data;
|
|
122
|
-
|
|
123
|
-
else {
|
|
185
|
+
|
|
186
|
+
} else {
|
|
187
|
+
|
|
124
188
|
finalOutputDebug[tag] = finalOutputDebug[tag] ? finalOutputDebug[tag].concat(data) : data;
|
|
125
189
|
}
|
|
126
190
|
}
|
|
191
|
+
|
|
127
192
|
function parseClassNames() {
|
|
128
193
|
return Object.keys(moduleClassNames).map((klass) => {
|
|
129
194
|
return concatenateWithKey(klass, moduleClassNames[klass]);
|
|
130
195
|
}).flat();
|
|
131
196
|
}
|
|
132
|
-
|
|
133
|
-
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
function concatenateWithKey(key, levelLine: string[]) {
|
|
200
|
+
return levelLine.map((levelTag: string) => {
|
|
134
201
|
return [key, levelTag].filter((val) => {
|
|
135
|
-
return (val !== '_' && val.toString().charAt(0) !== '_')
|
|
202
|
+
return (val !== '_' && val.toString().charAt(0) !== '_')
|
|
136
203
|
}).filter(x => Boolean(x)).join('-');
|
|
137
|
-
})
|
|
204
|
+
})
|
|
138
205
|
}
|
|
206
|
+
|
|
207
|
+
|
|
139
208
|
}
|
|
209
|
+
|
|
140
210
|
export default {
|
|
141
211
|
getModuleTagClassNames: cssfabricClassNames,
|
|
142
|
-
getModuleTagDebug:
|
|
143
|
-
props.outputStyle = 'debug'
|
|
212
|
+
getModuleTagDebug: function doIt(props: IListCssfabricClassNamesProps) {
|
|
213
|
+
props.outputStyle = 'debug'
|
|
144
214
|
return cssfabricClassNames(props);
|
|
145
215
|
}
|
|
146
|
-
}
|
|
216
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const utils = {
|
|
2
|
+
|
|
3
|
+
isArrayOfTypes: (arr: any): any => {
|
|
4
|
+
let ret = '';
|
|
5
|
+
|
|
6
|
+
if (!Array.isArray(arr)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (arr.every(x => Array.isArray(x))) ret = 'arrays'
|
|
10
|
+
if (arr.every(x => typeof x === 'number' || typeof x === 'string' ) ) ret = 'strings'
|
|
11
|
+
if (arr.every(x => typeof x === 'string')) ret = 'strings'
|
|
12
|
+
if (arr.every(x => typeof x === 'number')) ret = 'numbers'
|
|
13
|
+
if (arr.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
|
|
14
|
+
|
|
15
|
+
return ret;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
isObjectOfTypes: (arr: any): any => {
|
|
19
|
+
|
|
20
|
+
if (Array.isArray(arr)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let ret = '';
|
|
25
|
+
let arrValues = Object.values(arr);
|
|
26
|
+
|
|
27
|
+
if (arrValues.every(x => typeof x === 'number' || typeof x === 'string' ) ) ret = 'strings'
|
|
28
|
+
if (arrValues.every(x => Array.isArray(x))) ret = 'arrays'
|
|
29
|
+
if (arrValues.every(x => typeof x === 'string')) ret = 'strings'
|
|
30
|
+
if (arrValues.every(x => typeof x === 'number')) ret = 'numbers'
|
|
31
|
+
if (arrValues.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
|
|
32
|
+
|
|
33
|
+
return ret;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default utils;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
|
|
3
|
+
export const prerender = true;
|
|
4
|
+
</script>
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import Header from '$lib/../components/header/Header.svelte';
|
|
7
|
+
import '../app.css';
|
|
8
|
+
import HeaderSiteTitle from "../components/HeaderSiteTitle.svelte";
|
|
9
|
+
import {fabricNavigation} from "../scripts/utils";
|
|
10
|
+
|
|
11
|
+
const links: string[] = fabricNavigation.getActiveLinks();
|
|
12
|
+
|
|
13
|
+
export let moduleTag = '';
|
|
14
|
+
export let modulePage = '';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<main class={"w-full flex flex-v h-full content-start overflow-auto"}>
|
|
21
|
+
<div class={"w-full w-sm-main "}>
|
|
22
|
+
<HeaderSiteTitle
|
|
23
|
+
description={"cssFabric is an alpha cssFabric"}
|
|
24
|
+
title="cssfabric"
|
|
25
|
+
title_tag={"just.fabric.it"}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
<div class={" dsp-none"}>
|
|
30
|
+
<div class={"dsp-none dsp-sm-block"}>sm</div>
|
|
31
|
+
<div class={"dsp-md-block dsp-none "}>md</div>
|
|
32
|
+
<div class={"dsp-lg-block dsp-none"}>lg</div>
|
|
33
|
+
<div class={"dsp-none dsp-xl-block dsp-none"}>xl</div>
|
|
34
|
+
<div class={"dsp-none dsp-xxl-block dsp-none"}>xxl</div>
|
|
35
|
+
<div class={"dsp-none dsp-xxxl-block dsp-none"}>xxxl</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class={"flex flex-lg-v flex-h h-full"}>
|
|
38
|
+
<aside class={"w-lg-full w-8 pad "}>
|
|
39
|
+
<nav class={"pad pad-lg"}>
|
|
40
|
+
<ul class={"menu-lg-h menu-v"}>
|
|
41
|
+
<li class={"menu-item " }>
|
|
42
|
+
<a href={'/installation'}>
|
|
43
|
+
<span>installation</span>
|
|
44
|
+
</a>
|
|
45
|
+
</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<ul class={"menu-lg-h menu-v"}>
|
|
48
|
+
{#each Object.values(links) as key}
|
|
49
|
+
<!--{ css = (staticModule === key) ? 'active' : '';}-->
|
|
50
|
+
<li class={"menu-item " } class:active={(moduleTag === key)}>
|
|
51
|
+
<a rel="external" href={fabricNavigation.getModuleClassNamesPage(key)}>
|
|
52
|
+
<span>{`${key}`}</span>
|
|
53
|
+
</a>
|
|
54
|
+
</li>
|
|
55
|
+
{/each}
|
|
56
|
+
</ul>
|
|
57
|
+
</nav>
|
|
58
|
+
</aside>
|
|
59
|
+
<section class={"flex-main"}>
|
|
60
|
+
<slot>slot test</slot>
|
|
61
|
+
</section>
|
|
62
|
+
</div>
|
|
63
|
+
</main>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<style global lang="scss">
|
|
67
|
+
@import "src/lib/styles/cssfabric.min";
|
|
68
|
+
|
|
69
|
+
main {
|
|
70
|
+
margin: 0 auto;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
footer {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
padding: 40px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
footer a {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (min-width: 480px) {
|
|
87
|
+
footer {
|
|
88
|
+
padding: 40px 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</style>
|