@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.
Files changed (207) hide show
  1. package/.github/workflows/main.yml +33 -0
  2. package/.idea/cssfabric.iml +11 -0
  3. package/.idea/misc.xml +9 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.vscode/settings.json +24 -0
  7. package/bin/index.js +8 -0
  8. package/cssfabric.sass.js +8 -0
  9. package/gulpfile.js +532 -0
  10. package/package.json +17 -61
  11. package/src/app.css +107 -0
  12. package/src/app.d.ts +15 -0
  13. package/src/app.html +13 -0
  14. package/src/components/Header.svelte +17 -0
  15. package/src/components/HeaderSiteTitle.svelte +12 -0
  16. package/src/components/InnerMenu.svelte +27 -0
  17. package/src/components/SubHeader.svelte +10 -0
  18. package/src/components/SubHeaderH.svelte +3 -0
  19. package/src/components/SubSubHeader.svelte +22 -0
  20. package/src/components/demo/DemoElement.svelte +86 -0
  21. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  22. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  23. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  25. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  26. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  27. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  28. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  29. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  30. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  31. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  32. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  33. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  34. package/src/components/docs/Docs.svelte +97 -0
  35. package/src/components/docs/DocsClassNames.svelte +34 -0
  36. package/src/components/docs/DocsDemo.svelte +84 -0
  37. package/src/components/header/Header.svelte +105 -0
  38. package/src/components/header/svelte-logo.svg +1 -0
  39. package/src/cssfabric/_utils.scss +203 -0
  40. package/{_generated → src/cssfabric}/index.d.ts +0 -0
  41. package/src/cssfabric/modules/_cssfabric-config.scss +173 -0
  42. package/src/cssfabric/modules/_mixins.scss +1 -0
  43. package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
  44. package/src/cssfabric/modules/animation/animation.scss +3 -0
  45. package/src/cssfabric/modules/base/_base-vars.scss +19 -0
  46. package/src/cssfabric/modules/base/base.scss +75 -0
  47. package/src/cssfabric/modules/box/_box-build.scss +306 -0
  48. package/src/cssfabric/modules/box/_box-vars.scss +121 -0
  49. package/src/cssfabric/modules/box/box-responsive.scss +18 -0
  50. package/src/cssfabric/modules/box/box.scss +3 -0
  51. package/src/cssfabric/modules/color/_color-build.scss +196 -0
  52. package/src/cssfabric/modules/color/_color-vars.scss +80 -0
  53. package/src/cssfabric/modules/color/color-responsive.scss +23 -0
  54. package/src/cssfabric/modules/color/color.scss +9 -0
  55. package/src/cssfabric/modules/css-fabric.scss +2 -0
  56. package/src/cssfabric/modules/flex/_flex-build.scss +150 -0
  57. package/src/cssfabric/modules/flex/_flex-vars.scss +84 -0
  58. package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
  59. package/src/cssfabric/modules/flex/flex.scss +3 -0
  60. package/src/cssfabric/modules/grid/_grid-build.scss +84 -0
  61. package/src/cssfabric/modules/grid/_grid-vars.scss +88 -0
  62. package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
  63. package/src/cssfabric/modules/grid/grid.scss +6 -0
  64. package/src/cssfabric/modules/menu/_menu-build.scss +120 -0
  65. package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
  66. package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
  67. package/src/cssfabric/modules/menu/menu.scss +6 -0
  68. package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
  69. package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
  70. package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
  71. package/src/cssfabric/modules/overflow/overflow.scss +7 -0
  72. package/src/cssfabric/modules/scale/_scale-build.scss +142 -0
  73. package/src/cssfabric/modules/scale/_scale-vars.scss +84 -0
  74. package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
  75. package/src/cssfabric/modules/scale/scale.scss +8 -0
  76. package/src/cssfabric/modules/table/_table-build.scss +134 -0
  77. package/src/cssfabric/modules/table/_table-vars.scss +30 -0
  78. package/src/cssfabric/modules/table/table-responsive.scss +24 -0
  79. package/src/cssfabric/modules/table/table.scss +8 -0
  80. package/src/cssfabric/modules/text/_text-build.scss +166 -0
  81. package/src/cssfabric/modules/text/_text-vars.scss +87 -0
  82. package/src/cssfabric/modules/text/text-responsive.scss +26 -0
  83. package/src/cssfabric/modules/text/text.scss +6 -0
  84. package/src/cssfabric/modules/theme/_theme-build.scss +90 -0
  85. package/src/cssfabric/modules/theme/_theme-vars.scss +46 -0
  86. package/src/cssfabric/modules/theme/theme.scss +6 -0
  87. package/src/cssfabric/modules/vars.scss +50 -0
  88. package/src/cssfabric/modules/zindex/_zindex-vars.scss +14 -0
  89. package/src/cssfabric/modules/zindex/zindex.scss +15 -0
  90. package/src/hooks.ts +27 -0
  91. package/src/index.d.ts +3 -0
  92. package/src/index.ts +4 -0
  93. package/{_generated → src/lib/_generated}/cssFabric.vars.json +0 -0
  94. package/{_generated → src/lib/_generated}/export.variables.md +0 -0
  95. package/src/lib/_generated/index.d.ts +3 -0
  96. package/{_generated → src/lib/_generated}/readme.md +0 -0
  97. package/{init/importCssVars.js → src/lib/init/importCssVars.ts} +3 -2
  98. package/src/lib/scripts/cssfabric.ts +54 -0
  99. package/{scripts/cssfabricClassNames.js → src/lib/scripts/cssfabricClassNames.ts} +112 -42
  100. package/{scripts → src/lib/scripts}/index.d.ts +0 -0
  101. package/src/lib/scripts/index.ts +8 -0
  102. package/src/lib/scripts/utils.ts +37 -0
  103. package/{styles → src/lib/styles}/animation/animation.css +0 -0
  104. package/{styles → src/lib/styles}/animation/animation.min.css +0 -0
  105. package/{styles → src/lib/styles}/base/base.css +0 -0
  106. package/{styles → src/lib/styles}/base/base.min.css +0 -0
  107. package/{styles → src/lib/styles}/box/box.css +0 -0
  108. package/{styles → src/lib/styles}/box/box.min.css +0 -0
  109. package/{styles → src/lib/styles}/box/box.responsive.css +0 -0
  110. package/{styles → src/lib/styles}/box/box.responsive.min.css +0 -0
  111. package/{styles → src/lib/styles}/color/color.css +0 -0
  112. package/{styles → src/lib/styles}/color/color.min.css +0 -0
  113. package/{styles → src/lib/styles}/color/color.responsive.css +0 -0
  114. package/{styles → src/lib/styles}/color/color.responsive.min.css +0 -0
  115. package/{styles → src/lib/styles}/cssfabric.css +0 -0
  116. package/{styles → src/lib/styles}/cssfabric.min.css +0 -0
  117. package/{styles → src/lib/styles}/cssfabric.responsive.css +0 -0
  118. package/{styles → src/lib/styles}/cssfabric.responsive.min.css +0 -0
  119. package/{styles → src/lib/styles}/flex/flex.css +0 -0
  120. package/{styles → src/lib/styles}/flex/flex.min.css +0 -0
  121. package/{styles → src/lib/styles}/flex/flex.responsive.css +0 -0
  122. package/{styles → src/lib/styles}/flex/flex.responsive.min.css +0 -0
  123. package/{styles → src/lib/styles}/grid/grid.css +0 -0
  124. package/{styles → src/lib/styles}/grid/grid.min.css +0 -0
  125. package/{styles → src/lib/styles}/grid/grid.responsive.css +0 -0
  126. package/{styles → src/lib/styles}/grid/grid.responsive.min.css +0 -0
  127. package/{styles → src/lib/styles}/menu/menu.css +0 -0
  128. package/{styles → src/lib/styles}/menu/menu.min.css +0 -0
  129. package/{styles → src/lib/styles}/menu/menu.responsive.css +0 -0
  130. package/{styles → src/lib/styles}/menu/menu.responsive.min.css +0 -0
  131. package/{styles → src/lib/styles}/overflow/overflow.css +0 -0
  132. package/{styles → src/lib/styles}/overflow/overflow.min.css +0 -0
  133. package/{styles → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  134. package/{styles → src/lib/styles}/overflow/overflow.responsive.min.css +0 -0
  135. package/{styles → src/lib/styles}/scale/scale.css +0 -0
  136. package/{styles → src/lib/styles}/scale/scale.min.css +0 -0
  137. package/{styles → src/lib/styles}/scale/scale.responsive.css +0 -0
  138. package/{styles → src/lib/styles}/scale/scale.responsive.min.css +0 -0
  139. package/{styles → src/lib/styles}/table/table.css +0 -0
  140. package/{styles → src/lib/styles}/table/table.min.css +0 -0
  141. package/{styles → src/lib/styles}/table/table.responsive.css +0 -0
  142. package/{styles → src/lib/styles}/table/table.responsive.min.css +0 -0
  143. package/{styles → src/lib/styles}/text/text.css +0 -0
  144. package/{styles → src/lib/styles}/text/text.min.css +0 -0
  145. package/{styles → src/lib/styles}/text/text.responsive.css +0 -0
  146. package/{styles → src/lib/styles}/text/text.responsive.min.css +0 -0
  147. package/{styles → src/lib/styles}/theme/theme.css +0 -0
  148. package/{styles → src/lib/styles}/theme/theme.min.css +0 -0
  149. package/{styles → src/lib/styles}/vars.css +0 -0
  150. package/{styles → src/lib/styles}/vars.min.css +0 -0
  151. package/{styles → src/lib/styles}/zindex/zindex.css +0 -0
  152. package/{styles → src/lib/styles}/zindex/zindex.min.css +0 -0
  153. package/src/routes/__layout.svelte +91 -0
  154. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  155. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  156. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  157. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  158. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  159. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  160. package/src/routes/cssfabric-modules/index.svelte +0 -0
  161. package/src/routes/index.svelte +62 -0
  162. package/src/routes/installation/__layout.svelte +1 -0
  163. package/src/routes/installation/index.svelte +28 -0
  164. package/src/scripts/utils.ts +26 -0
  165. package/src/utils.ts +71 -0
  166. package/src/vendor/index.d.ts +3 -0
  167. package/src/vendor/normalize/normalize.min.css +2 -0
  168. package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
  169. package/src/vendor/sass-json-export/Gruntfile.js +60 -0
  170. package/src/vendor/sass-json-export/LICENSE +20 -0
  171. package/src/vendor/sass-json-export/README.md +90 -0
  172. package/src/vendor/sass-json-export/package.json +60 -0
  173. package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
  174. package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
  175. package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
  176. package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
  177. package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
  178. package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
  179. package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
  180. package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
  181. package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
  182. package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
  183. package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
  184. package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
  185. package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
  186. package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
  187. package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
  188. package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
  189. package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
  190. package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
  191. package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
  192. package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
  193. package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
  194. package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
  195. package/src/vendor/sass-json-export/test/test.scss +9 -0
  196. package/static/favicon.png +0 -0
  197. package/static/robots.txt +3 -0
  198. package/svelte.config.js +25 -0
  199. package/tsconfig.json +3 -0
  200. package/webpack.config.js +55 -0
  201. package/init/importCssVars.d.ts +0 -1
  202. package/scripts/cssfabric.d.ts +0 -24
  203. package/scripts/cssfabric.js +0 -43
  204. package/scripts/cssfabricClassNames.d.ts +0 -14
  205. package/scripts/index.js +0 -4
  206. package/scripts/utils.d.ts +0 -5
  207. 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
@@ -0,0 +1,3 @@
1
+ declare const cssfabric;
2
+
3
+ export default cssfabric;
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+
2
+ import cssfabric from "./lib/scripts/cssfabric"
3
+
4
+ export default cssfabric
@@ -0,0 +1,3 @@
1
+ declare const module;
2
+
3
+ export default module;
File without changes
@@ -1,2 +1,3 @@
1
- // copy css vars file
2
- export {};
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 from "./utils";
3
- function loopIt(props) {
4
- const { module } = props;
5
- const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
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
- function cssfabricClassNames(props) {
8
- const { module, moduleAttribute, outputStyle } = props;
28
+
29
+ function loopIt(props: ILoopIt) {
30
+
31
+ const {module} = props;
9
32
  const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
10
- const fabricAttributes = moduleAttributes[moduleAttribute];
11
- const moduleTag = fabricAttributes["tag"];
12
- const moduleKeys = fabricAttributes["keys"] || undefined;
13
- const moduleLevels = fabricAttributes["levels"] || undefined;
14
- const moduleLevelsLinked = fabricAttributes["levelsLinked"] || undefined;
15
- const moduleLevelsExtended = fabricAttributes["levelsDeclin"] || undefined;
16
- const moduleClassNames = fabricAttributes["classNames"] || undefined;
17
- let finalOutput = [];
18
- let finalOutputDebug = {};
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
- function doParse(mode) {
21
- let keyList, levelList, levelListLinked, levelListDeclin;
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) === '_') ? debugKey : debugKey + '-' + level;
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 = parseClassNames();
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
- function registerDebug(tag, data, nestedTag) {
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
- function concatenateWithKey(key, levelLine) {
133
- return levelLine.map((levelTag) => {
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: function doIt(props) {
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,8 @@
1
+
2
+
3
+ function buildReadme(vars: string){
4
+ return "readme"
5
+ }
6
+
7
+
8
+ export default buildReadme;
@@ -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
@@ -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>