@medyll/cssfabric 0.1.12 → 0.2.2

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 (159) hide show
  1. package/.github/workflows/main.yml +33 -0
  2. package/.idea/cssfabric.iml +4 -1
  3. package/README.md +38 -240
  4. package/bin/index.js +2 -1
  5. package/{cssfabric.json → cssfabric.sass.js} +3 -3
  6. package/gulpfile.js +77 -143
  7. package/package.json +69 -69
  8. package/src/app.css +107 -0
  9. package/src/app.d.ts +15 -0
  10. package/src/app.html +13 -0
  11. package/src/components/Header.svelte +17 -0
  12. package/src/components/HeaderSiteTitle.svelte +12 -0
  13. package/src/components/InnerMenu.svelte +27 -0
  14. package/src/components/SubHeader.svelte +10 -0
  15. package/src/components/SubHeaderH.svelte +3 -0
  16. package/src/components/SubSubHeader.svelte +22 -0
  17. package/src/components/demo/DemoElement.svelte +86 -0
  18. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  19. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  20. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  21. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  22. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  23. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  25. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  26. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  27. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  28. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  29. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  30. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  31. package/src/components/docs/Docs.svelte +97 -0
  32. package/src/components/docs/DocsClassNames.svelte +34 -0
  33. package/src/components/docs/DocsDemo.svelte +84 -0
  34. package/src/components/header/Header.svelte +105 -0
  35. package/src/components/header/svelte-logo.svg +1 -0
  36. package/src/cssfabric/modules/_cssfabric-config.scss +15 -5
  37. package/src/cssfabric/modules/base/base.scss +1 -6
  38. package/src/cssfabric/modules/box/_box-build.scss +20 -3
  39. package/src/cssfabric/modules/box/_box-vars.scss +1 -1
  40. package/src/cssfabric/modules/css-fabric.scss +1 -1
  41. package/src/cssfabric/modules/menu/_menu-build.scss +9 -8
  42. package/src/cssfabric/modules/vars.scss +3 -2
  43. package/src/hooks.ts +27 -0
  44. package/src/index.ts +1 -1
  45. package/src/lib/_generated/cssFabric.vars.json +13 -0
  46. package/src/{_generated → lib/_generated}/export.variables.md +0 -0
  47. package/src/{_generated → lib/_generated}/index.d.ts +0 -0
  48. package/src/{_generated → lib/_generated}/readme.md +0 -0
  49. package/src/lib/init/importCssVars.ts +3 -0
  50. package/src/{scripts → lib/scripts}/cssfabric.ts +1 -1
  51. package/src/{scripts → lib/scripts}/cssfabricClassNames.ts +0 -0
  52. package/src/{scripts → lib/scripts}/index.d.ts +0 -0
  53. package/src/{scripts → lib/scripts}/index.ts +0 -0
  54. package/src/lib/scripts/utils.ts +37 -0
  55. package/{lib/styles/core → src/lib/styles}/animation/animation.css +0 -0
  56. package/{lib/styles/core → src/lib/styles}/animation/animation.min.css +0 -0
  57. package/{lib/styles/core → src/lib/styles}/base/base.css +0 -7
  58. package/src/lib/styles/base/base.min.css +1 -0
  59. package/{lib/styles/core → src/lib/styles}/box/box.css +127 -111
  60. package/src/lib/styles/box/box.min.css +1 -0
  61. package/{lib/styles/core → src/lib/styles}/box/box.responsive.css +508 -444
  62. package/src/lib/styles/box/box.responsive.min.css +1 -0
  63. package/{lib/styles/core → src/lib/styles}/color/color.css +0 -0
  64. package/src/lib/styles/color/color.min.css +1 -0
  65. package/{lib/styles/core → src/lib/styles}/color/color.responsive.css +0 -0
  66. package/src/lib/styles/color/color.responsive.min.css +1 -0
  67. package/src/lib/styles/cssfabric.css +61792 -0
  68. package/src/lib/styles/cssfabric.min.css +168 -0
  69. package/src/lib/styles/cssfabric.responsive.css +200596 -0
  70. package/src/lib/styles/cssfabric.responsive.min.css +108 -0
  71. package/{lib/styles/core → src/lib/styles}/flex/flex.css +0 -0
  72. package/src/lib/styles/flex/flex.min.css +1 -0
  73. package/{lib/styles/core → src/lib/styles}/flex/flex.responsive.css +0 -0
  74. package/src/lib/styles/flex/flex.responsive.min.css +1 -0
  75. package/{lib/styles/core → src/lib/styles}/grid/grid.css +0 -0
  76. package/src/lib/styles/grid/grid.min.css +1 -0
  77. package/{lib/styles/core → src/lib/styles}/grid/grid.responsive.css +0 -0
  78. package/src/lib/styles/grid/grid.responsive.min.css +1 -0
  79. package/{lib/styles/core → src/lib/styles}/menu/menu.css +16 -12
  80. package/src/lib/styles/menu/menu.min.css +1 -0
  81. package/{lib/styles/core → src/lib/styles}/menu/menu.responsive.css +64 -48
  82. package/src/lib/styles/menu/menu.responsive.min.css +1 -0
  83. package/{lib/styles/core → src/lib/styles}/overflow/overflow.css +0 -0
  84. package/{lib/styles/core → src/lib/styles}/overflow/overflow.min.css +0 -0
  85. package/{lib/styles/core → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  86. package/src/lib/styles/overflow/overflow.responsive.min.css +1 -0
  87. package/{lib/styles/core → src/lib/styles}/scale/scale.css +0 -0
  88. package/{lib/styles/core → src/lib/styles}/scale/scale.min.css +0 -0
  89. package/{lib/styles/core → src/lib/styles}/scale/scale.responsive.css +0 -0
  90. package/src/lib/styles/scale/scale.responsive.min.css +1 -0
  91. package/{lib/styles/core → src/lib/styles}/table/table.css +0 -0
  92. package/src/lib/styles/table/table.min.css +1 -0
  93. package/{lib/styles/core → src/lib/styles}/table/table.responsive.css +0 -0
  94. package/src/lib/styles/table/table.responsive.min.css +1 -0
  95. package/{lib/styles/core → src/lib/styles}/text/text.css +0 -0
  96. package/src/lib/styles/text/text.min.css +1 -0
  97. package/{lib/styles/core → src/lib/styles}/text/text.responsive.css +0 -0
  98. package/src/lib/styles/text/text.responsive.min.css +1 -0
  99. package/{lib/styles/core → src/lib/styles}/theme/theme.css +0 -0
  100. package/{lib/styles/core → src/lib/styles}/theme/theme.min.css +0 -0
  101. package/{lib/styles/core → src/lib/styles}/vars.css +6 -2
  102. package/src/lib/styles/vars.min.css +1 -0
  103. package/{lib/styles/core → src/lib/styles}/zindex/zindex.css +0 -0
  104. package/{lib/styles/core → src/lib/styles}/zindex/zindex.min.css +0 -0
  105. package/src/routes/__layout.svelte +91 -0
  106. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  107. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  108. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  109. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  110. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  111. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  112. package/src/routes/cssfabric-modules/index.svelte +0 -0
  113. package/src/routes/index.svelte +62 -0
  114. package/src/routes/installation/__layout.svelte +1 -0
  115. package/src/routes/installation/index.svelte +28 -0
  116. package/src/scripts/utils.ts +26 -37
  117. package/src/utils.ts +71 -0
  118. package/static/favicon.png +0 -0
  119. package/static/robots.txt +3 -0
  120. package/svelte.config.js +25 -0
  121. package/tsconfig.json +3 -46
  122. package/cssfabric.config.js +0 -3
  123. package/lib/_generated/export.variables.json +0 -583
  124. package/lib/index.d.ts +0 -2
  125. package/lib/index.js +0 -7
  126. package/lib/scripts/cssfabric.d.ts +0 -24
  127. package/lib/scripts/cssfabric.js +0 -48
  128. package/lib/scripts/cssfabricClassNames.d.ts +0 -14
  129. package/lib/scripts/cssfabricClassNames.js +0 -150
  130. package/lib/scripts/index.d.ts +0 -2
  131. package/lib/scripts/index.js +0 -6
  132. package/lib/scripts/utils.d.ts +0 -5
  133. package/lib/scripts/utils.js +0 -40
  134. package/lib/styles/core/base/base.min.css +0 -1
  135. package/lib/styles/core/box/box.min.css +0 -1
  136. package/lib/styles/core/box/box.responsive.min.css +0 -1
  137. package/lib/styles/core/color/color.min.css +0 -1
  138. package/lib/styles/core/color/color.responsive.min.css +0 -1
  139. package/lib/styles/core/flex/flex.min.css +0 -1
  140. package/lib/styles/core/flex/flex.responsive.min.css +0 -1
  141. package/lib/styles/core/grid/grid.min.css +0 -1
  142. package/lib/styles/core/grid/grid.responsive.min.css +0 -1
  143. package/lib/styles/core/main.min.css +0 -1
  144. package/lib/styles/core/menu/menu.min.css +0 -1
  145. package/lib/styles/core/menu/menu.responsive.min.css +0 -1
  146. package/lib/styles/core/overflow/overflow.responsive.min.css +0 -1
  147. package/lib/styles/core/scale/scale.responsive.min.css +0 -1
  148. package/lib/styles/core/table/table.min.css +0 -1
  149. package/lib/styles/core/table/table.responsive.min.css +0 -1
  150. package/lib/styles/core/text/text.min.css +0 -1
  151. package/lib/styles/core/text/text.responsive.min.css +0 -1
  152. package/lib/styles/core/vars.min.css +0 -1
  153. package/lib/styles/core/vars2.css +0 -4
  154. package/lib/styles/core/vars2.min.css +0 -1
  155. package/lib/styles/cssfabric.css +0 -5147
  156. package/lib/styles/cssfabric.min.css +0 -16
  157. package/lib/styles/cssfabric.responsive.css +0 -16679
  158. package/lib/styles/cssfabric.responsive.min.css +0 -9
  159. package/src/_generated/export.variables.json +0 -759
@@ -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>
@@ -0,0 +1,75 @@
1
+ <svelte:head>
2
+
3
+ <title>{staticModule} {staticAction} cssfabric</title>
4
+ </svelte:head>
5
+ <script context="module" lang="ts">
6
+ export const prerender = true;
7
+ /** @type {import('./modules/[module]/[page]').Load} */
8
+ export async function load({params, fetch, session, stuff}) {
9
+ console.log(params)
10
+ // console.log(params, fetch, session, stuff);
11
+ return {
12
+ status: 200,
13
+ props : {
14
+ moduleTag : params.module,
15
+ modulePage: params.page
16
+ }
17
+ };
18
+ }
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import cssfabric from '../../../lib/scripts/cssfabric';
23
+ import {fabricNavigation} from '../../../scripts/utils';
24
+ import InnerMenu from '../../../components/InnerMenu.svelte';
25
+ import SubHeader from '../../../components/SubHeader.svelte';
26
+ import Header from '../../../components/Header.svelte';
27
+
28
+ export let moduleTag = '';
29
+ export let modulePage = '';
30
+
31
+ const links: string[] = fabricNavigation.getActiveLinks();
32
+
33
+ let tagProperties: Record<string, any> = {};
34
+
35
+ let staticModule: string = moduleTag;
36
+ let staticAction: string = '';
37
+
38
+ $: tagProperties = cssfabric.getModuleMetaData(moduleTag);
39
+ $: staticAction = modulePage;
40
+
41
+ </script>
42
+ <Header
43
+ description={tagProperties.description}
44
+ tag={"fabric.css." + tagProperties.title}
45
+ title={"." + tagProperties.title}
46
+ />
47
+ <div class={"flex flex-xl-v flex-h marg-t-2"}>
48
+ <div class={"marg-t-2 marg-lg-l-4 pad"}>
49
+ <div class="">
50
+ <ul class={"menu-xl-h menu-v menu-small shad-8"}>
51
+ <li class={(modulePage==='demo')? 'active':''}>
52
+ <a href={fabricNavigation.getModuleDemoPage(moduleTag)}>
53
+ <a>Demo</a>
54
+ </a>
55
+ </li>
56
+ <li class={(modulePage==='classnames')? 'active':''}>
57
+ <a href={fabricNavigation.getModuleClassNamesPage(moduleTag)}>
58
+ <a>Classnames</a>
59
+ </a>
60
+ </li>
61
+ <li class={(modulePage==='docs')? 'active':''}>
62
+ <a href={fabricNavigation.getModuleDocsPage(moduleTag)}>
63
+ <a>Docs</a>
64
+ </a>
65
+ </li>
66
+ </ul>
67
+ </div>
68
+ </div>
69
+ <div class={"pad-l-4 flex-main"}>
70
+ <SubHeader title={staticModule + '.' + staticAction}/>
71
+ <div>
72
+ <slot module={staticModule} ></slot>
73
+ </div>
74
+ </div>
75
+ </div>
@@ -0,0 +1,24 @@
1
+ <script context="module" lang="ts">
2
+ export const prerender = true;
3
+ /** @type {import('./[module]/classnames').Load} */
4
+ export async function load({params, fetch, session, stuff}) {
5
+ console.log({params})
6
+ // console.log(params, fetch, session, stuff);
7
+ return {
8
+ status: 200,
9
+ props : {
10
+ moduleTag : params.module,
11
+ modulePage: params.page
12
+ }
13
+ };
14
+ }
15
+ </script>
16
+ <script>
17
+ import DocsClassNames from "../../../../components/docs/DocsClassNames.svelte";
18
+
19
+ export let moduleTag = '';
20
+ export let modulePage = '';
21
+ </script>
22
+
23
+
24
+ <DocsClassNames module={moduleTag} />
@@ -0,0 +1,24 @@
1
+ <script context="module" lang="ts">
2
+ export const prerender = true;
3
+ /** @type {import('./[module]/classnames').Load} */
4
+ export async function load({params, fetch, session, stuff}) {
5
+ console.log({params})
6
+ // console.log(params, fetch, session, stuff);
7
+ return {
8
+ status: 200,
9
+ props : {
10
+ moduleTag : params.module,
11
+ modulePage: params.page
12
+ }
13
+ };
14
+ }
15
+ </script>
16
+ <script>
17
+ import DocsDemo from "../../../../components/docs/DocsDemo.svelte";
18
+
19
+ export let moduleTag = '';
20
+ export let modulePage = '';
21
+ </script>
22
+
23
+
24
+ <DocsDemo module={moduleTag} />
@@ -0,0 +1,30 @@
1
+
2
+ <script context="module" lang="ts">
3
+ export const prerender = true;
4
+ /** @type {import('./[module]/docs').Load} */
5
+ export async function load({params, fetch, session, stuff}) {
6
+
7
+ return {
8
+ status: 200,
9
+ props : {
10
+ moduleTag : params.module,
11
+ modulePage: params.page
12
+ }
13
+ };
14
+ }
15
+ </script>
16
+ <script lang="ts">
17
+ import { HighlightAuto } from "svelte-highlight";
18
+ import "svelte-highlight/styles/github.css";
19
+ import Docs from "../../../../components/docs/Docs.svelte";
20
+
21
+ export let moduleTag = '';
22
+ export let modulePage = 'docs';
23
+
24
+ let code = `let a = 123; let fr = 'red'; const red = function(args:any){}`
25
+ </script>
26
+ <HighlightAuto code={`<div class="noclass"></div>`} />
27
+ <HighlightAuto code={`npm i @medyll/cssfabric`} />
28
+ <HighlightAuto code={code} />
29
+
30
+ <Docs module={moduleTag} />
@@ -0,0 +1,3 @@
1
+ module index <br />
2
+ <slot></slot>
3
+ module index <br />
@@ -0,0 +1,26 @@
1
+ <script context="module" lang="ts">
2
+
3
+ export const prerender = true;
4
+ </script>
5
+ <script lang="ts">
6
+
7
+ import {fabricNavigation} from '../../scripts/utils';
8
+ import cssfabric from '../../lib/scripts/cssfabric';
9
+ import HeaderSiteTitle from '../../components/HeaderSiteTitle.svelte';
10
+
11
+ export let moduleTag = '';
12
+ export let modulePage = '';
13
+
14
+ const links: string[] = fabricNavigation.getActiveLinks();
15
+
16
+ let DynamicComponent;
17
+ let tagProperties: Record<string, any> = {};
18
+
19
+ let staticModule: string = moduleTag;
20
+ let staticPage: string = modulePage;
21
+
22
+ $: tagProperties = cssfabric.getModuleMetaData(moduleTag);
23
+ $: staticPage = modulePage;
24
+ </script>
25
+
26
+ <slot></slot>
File without changes
@@ -0,0 +1,62 @@
1
+ <script context="module" lang="ts">
2
+ export const prerender = true;
3
+ </script>
4
+
5
+ <script lang="ts">
6
+ import {fabricNavigation} from '../scripts/utils';
7
+ import github from "svelte-highlight/styles/github";
8
+ const cssfabricModules = fabricNavigation.getActiveLinks();
9
+ $: console.log({cssfabricModules});
10
+ </script>
11
+ <svelte:head>
12
+ <title>cssFabric home</title>
13
+ {@html github}
14
+ </svelte:head>
15
+ <div class={"flex-main flex-align-middle scale-w-sm-full scale-w-lg-32 scale-w-64 pad-all"}>
16
+ <div title={"a css framework"}>
17
+ <p>
18
+ <strong>cssfabric</strong> is a css framework built around css properties<br/>
19
+ it's goal is to permit you to achieve of all your design task, from single page applications to frontend web sites
20
+ </p>
21
+ </div>
22
+ <p title={"with some css in"}>
23
+ </p>
24
+ <div class={"flex-h flex-wrap flex-align-center"}>
25
+ {#each Object.values(cssfabricModules) as key, name }
26
+ <div class={"pad-4 marg-4 scale-w-8 scale-h-8 flex-v flex-align-middle text-center bg-themed-gray-200 shad-4"}>
27
+ <a href={fabricNavigation.getModuleDemoPage(key)}>
28
+ <span>{`${key}`}</span>
29
+ </a>
30
+ </div>
31
+ {/each}
32
+ </div>
33
+ </div>
34
+
35
+ <style lang="scss">
36
+ section {
37
+ display: flex;
38
+ flex-direction: column;
39
+ justify-content: center;
40
+ align-items: center;
41
+ flex: 1;
42
+ }
43
+
44
+ h1 {
45
+ width: 100%;
46
+ }
47
+
48
+ .welcome {
49
+ position: relative;
50
+ width: 100%;
51
+ height: 0;
52
+ padding: 0 0 calc(100% * 495 / 2048) 0;
53
+ }
54
+
55
+ .welcome img {
56
+ position: absolute;
57
+ width: 100%;
58
+ height: 100%;
59
+ top: 0;
60
+ display: block;
61
+ }
62
+ </style>
@@ -0,0 +1 @@
1
+ <slot></slot>
@@ -0,0 +1,28 @@
1
+ <script context="module" lang="ts">
2
+
3
+ </script>
4
+ <script>
5
+ import {HighlightAuto,Highlight} from "svelte-highlight";
6
+ import typescript from "svelte-highlight/languages/typescript";
7
+ import node from "svelte-highlight/languages/node-repl";
8
+
9
+ const code1 = `npm i @medyll/cssfabric
10
+ #or
11
+ yarn add @medyll/cssfabric`
12
+
13
+ const code2 = `npm init @medyll/cssfabric # will create configuration files`
14
+
15
+ const htmlCode = "<style></style>"
16
+ </script>
17
+
18
+
19
+ <h4>install cssfabric</h4>
20
+
21
+ <Highlight language={typescript} code={code1}/>
22
+ then
23
+ <Highlight language={node} code={code2}/>
24
+
25
+
26
+ <Highlight code={htmlCode}/>
27
+
28
+
@@ -1,37 +1,26 @@
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;
1
+ import cssfabric from '../lib/scripts/cssfabric';
2
+
3
+ export const urlModule = 'cssfabric-modules';
4
+ const pageDocsName = 'docs';
5
+ const pageDemoName = 'demo';
6
+ const pageDemoClassName = 'classnames';
7
+
8
+ export const fabricNavigation = {
9
+ getHomePages : () => {
10
+ return `/${urlModule}`;
11
+ },
12
+ getModuleDocsPage : (module: string) => {
13
+ return `/${urlModule}/${module}/${pageDocsName}`;
14
+ },
15
+ getModuleClassNamesPage: (module: string) => {
16
+ return `/${urlModule}/${module}/${pageDemoClassName}`;
17
+ },
18
+ getModuleDemoPage : (module: string) => {
19
+ return `/${urlModule}/${module}/${pageDemoName}`;
20
+ },
21
+ getActiveLinks : (): string[] => {
22
+ const cssfab = cssfabric.getModuleList();
23
+ return Object.keys(cssfab).filter((link: string) => cssfab?.[link]?._docs?.attributes);
24
+ }
25
+ };
26
+
package/src/utils.ts ADDED
@@ -0,0 +1,71 @@
1
+ import cssfabric from './lib/scripts/cssfabric';
2
+
3
+
4
+ const utils = {
5
+
6
+ isArrayOfTypes: (arr: any): any => {
7
+ let ret = '';
8
+
9
+ if (!Array.isArray(arr)) {
10
+ return false;
11
+ }
12
+ if (arr.every(x => Array.isArray(x))) ret = 'arrays'
13
+ if (arr.every(x => typeof x === 'number' || typeof x === 'string')) ret = 'strings'
14
+ if (arr.every(x => typeof x === 'string')) ret = 'strings'
15
+ if (arr.every(x => typeof x === 'number')) ret = 'numbers'
16
+ if (arr.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
17
+
18
+ return ret;
19
+ },
20
+
21
+ isObjectOfTypes: (arr: any): string | boolean => {
22
+
23
+ if (Array.isArray(arr)) {
24
+ return false;
25
+ }
26
+
27
+ let ret = '';
28
+ let arrValues = Object.values(arr);
29
+
30
+ if (arrValues.every(x => typeof x === 'number' || typeof x === 'string')) ret = 'strings'
31
+ if (arrValues.every(x => Array.isArray(x))) ret = 'arrays'
32
+ if (arrValues.every(x => typeof x === 'string')) ret = 'strings'
33
+ if (arrValues.every(x => typeof x === 'number')) ret = 'numbers'
34
+ if (arrValues.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
35
+
36
+ return ret;
37
+ }
38
+ }
39
+
40
+ export const htmlUtils = {
41
+ enclose: (content: any, tag: string = 'div') => {
42
+ return `<div className={"cell-spacing cell-padding"}>${content}</div>`
43
+ }
44
+ }
45
+ export default utils;
46
+
47
+
48
+ const urlModule = 'cssfabric-modules';
49
+ const pageDocsName = 'docs';
50
+ const pageDemoName = 'demo';
51
+ const pageDemoClassName = 'classnames';
52
+
53
+ export const fabricNavigation = {
54
+ getHomePages: () => {
55
+ return `/${urlModule}`;
56
+ },
57
+ getModuleDocsPage: (module: string) => {
58
+ return `/${urlModule}/${module}/${pageDocsName}`;
59
+ },
60
+ getModuleClassNamesPage: (module: string) => {
61
+ return `/${urlModule}/${module}/${pageDemoClassName}`;
62
+ },
63
+ getModuleDemoPage: (module: string) => {
64
+ return `/${urlModule}/${module}/${pageDemoName}`;
65
+ },
66
+ getActiveLinks: (): string[] => {
67
+ const cssfab = cssfabric.getModuleList();
68
+ return Object.keys(cssfab).filter((link: string) => cssfab?.[link]?._docs?.attributes);
69
+ }
70
+ }
71
+
Binary file
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,25 @@
1
+ import adapter from '@sveltejs/adapter-auto';
2
+ import preprocess from 'svelte-preprocess';
3
+
4
+ /** @type {import('@sveltejs/kit').Config} */
5
+ const config = {
6
+ // Consult https://github.com/sveltejs/svelte-preprocess
7
+ // for more information about preprocessors
8
+ preprocess: preprocess(),
9
+
10
+ kit: {
11
+ adapter: adapter(),
12
+
13
+ // Override http methods in the Todo forms
14
+ methodOverride: {
15
+ allowed: ['PATCH', 'DELETE']
16
+ },
17
+ vite: {
18
+ optimizeDeps: {
19
+ include: ["highlight.js", "highlight.js/lib/core"],
20
+ },
21
+ },
22
+ }
23
+ };
24
+
25
+ export default config;
package/tsconfig.json CHANGED
@@ -1,46 +1,3 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Basic Options */
6
- // "incremental": true, /* Enable incremental compilation */
7
- "target": "ESNEXT"
8
- /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
9
- "lib": [
10
- "dom",
11
- "dom.iterable",
12
- "esnext"
13
- ],
14
- "module": "commonjs"
15
- /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
16
- "allowJs": false,
17
- "skipLibCheck": true,
18
- "strict": false,
19
- "forceConsistentCasingInFileNames": true,
20
- "noEmit": false,
21
- "esModuleInterop": true,
22
- "moduleResolution": "node",
23
- "resolveJsonModule": true,
24
- "isolatedModules": true,
25
- "declaration": true
26
- /* Generates corresponding '.d.ts' file. */,
27
- "declarationDir": "./lib",
28
- /* Generates corresponding '.d.ts' file. */
29
-
30
- "outDir": "./lib"
31
- /* Redirect output structure to the directory. */,
32
- "rootDirs": [
33
- "lib/scripts"
34
- ],
35
- /* Strict Type-Checking Options */
36
-
37
- "typeRoots": [
38
- "./node_modules/@types",
39
- "./src"
40
- ]
41
- /* List of folders to include type definitions from. */
42
- // "types": ["../src/index.d.ts"], /* Type declaration files to be included in compilation. */
43
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
44
- }
45
- // "files": ["./src/index.ts"]
46
- }
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json"
3
+ }
@@ -1,3 +0,0 @@
1
-
2
-
3
- module.exports = {}