@bexis2/bexis2-core-ui 0.4.58 → 0.4.59

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 (34) hide show
  1. package/README.md +7 -1
  2. package/dist/MarkdownReder.svelte +7 -0
  3. package/dist/MarkdownReder.svelte.d.ts +16 -0
  4. package/dist/components/File/FileUploader.svelte +3 -3
  5. package/dist/components/Table/TableContent.svelte +3 -3
  6. package/dist/components/page/Docs.svelte +1 -1
  7. package/dist/components/page/Page.svelte +2 -13
  8. package/dist/components/page/PageCaller.d.ts +0 -1
  9. package/dist/components/page/PageCaller.js +0 -9
  10. package/dist/components/page/menu/MenuItem.svelte +2 -2
  11. package/dist/css/themes/theme-bexis2.d.ts +2 -0
  12. package/dist/css/themes/theme-bexis2.js +229 -0
  13. package/dist/md/Images/create_party.png +0 -0
  14. package/dist/md/Images/view_parties.png +0 -0
  15. package/dist/md.d.ts +7 -0
  16. package/dist/md.js +52 -0
  17. package/dist/services/Api.js +3 -5
  18. package/dist/stores/apiStores.d.ts +0 -2
  19. package/dist/stores/apiStores.js +0 -5
  20. package/package.json +1 -1
  21. package/src/lib/MarkdownReder.svelte +8 -0
  22. package/src/lib/components/File/FileUploader.svelte +3 -3
  23. package/src/lib/components/Table/TableContent.svelte +3 -3
  24. package/src/lib/components/page/Docs.svelte +1 -1
  25. package/src/lib/components/page/Page.svelte +2 -18
  26. package/src/lib/components/page/PageCaller.js +0 -9
  27. package/src/lib/components/page/menu/MenuItem.svelte +2 -2
  28. package/src/lib/css/themes/theme-bexis2.js +229 -0
  29. package/src/lib/md/Images/create_party.png +0 -0
  30. package/src/lib/md/Images/view_parties.png +0 -0
  31. package/src/lib/md.ts +73 -0
  32. package/src/lib/services/Api.ts +3 -6
  33. package/src/lib/stores/apiStores.ts +0 -11
  34. package/src/lib/stores/pageStores.ts +0 -2
package/README.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # bexis-core-ui
2
+ ## 0.4.59
3
+ - Table
4
+ - remove static title "table"
5
+ - shorten upload text
6
+ - remove last comma allowed files list
7
+ - remove title about sorting, if not possible
8
+
2
9
  ## 0.4.49 -> 0.4.53
3
10
  - Api
4
11
  - remove __RequestVerificationToken from header
@@ -18,7 +25,6 @@
18
25
  - Add hover to menu
19
26
  - Fix Missing nowrap in menu
20
27
 
21
-
22
28
  ## 0.4.45
23
29
  - Menu
24
30
  - hide gear if settings array has no entry
@@ -0,0 +1,7 @@
1
+ <!-- filepath: /c:/Daten/Documents/Projekte/Svelte/bexis2-core-ui/src/components/MarkdownRenderer.svelte -->
2
+ <script>import { marked } from "marked";
3
+ import { mdsvex } from "mdsvex";
4
+ export let content;
5
+ </script>
6
+
7
+ <div >{@html content}</div>
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ content: string;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type MarkdownRederProps = typeof __propDef.props;
12
+ export type MarkdownRederEvents = typeof __propDef.events;
13
+ export type MarkdownRederSlots = typeof __propDef.slots;
14
+ export default class MarkdownReder extends SvelteComponent<MarkdownRederProps, MarkdownRederEvents, MarkdownRederSlots> {
15
+ }
16
+ export {};
@@ -105,13 +105,13 @@ async function handleSubmit() {
105
105
  >
106
106
  <b style="font-size:xx-large"><Fa icon={faFileUpload} /></b>
107
107
  <span
108
- ><b>Drag 'n' drop some files here, or click to select files</b>
108
+ ><b>Drag 'n' drop or click to select files</b>
109
109
  <b>(max file size: {model.maxSize} mb)</b></span
110
110
  >
111
111
  <p>
112
112
  {#if model.accept}
113
- {#each model.accept as ext}
114
- {ext} ,
113
+ {#each model.accept as ext, i}
114
+ {ext}{#if i < model.accept.length - 1}, {/if}
115
115
  {/each}
116
116
  {/if}
117
117
  </p>
@@ -455,8 +455,8 @@ $: $hiddenColumnIds = shownColumns.filter((col) => !col.visible).map((col) => co
455
455
  {...$tableAttrs}
456
456
  class="table table-auto table-compact bg-tertiary-500/30 dark:bg-tertiary-900/10 overflow-clip"
457
457
  id="{tableId}-table"
458
- title="Table"
459
458
  >
459
+ <!-- title="Table" removed from top, as this should be handled by the surrounding container for better accessibility -->
460
460
  <!-- If table height is provided, making the top row sticky -->
461
461
  <thead class={height != null && $pageRows.length > 0 ? `sticky top-0` : ''}>
462
462
  <!-- {#if $data.length > 0} -->
@@ -503,11 +503,11 @@ $: $hiddenColumnIds = shownColumns.filter((col) => !col.visible).map((col) => co
503
503
  class:cursor-pointer={!props.sort.disabled}
504
504
  on:click={props.sort.toggle}
505
505
  on:keydown={props.sort.toggle}
506
- title={props.sort.order === 'asc'
506
+ title={props.sort.disabled ? undefined : (props.sort.order === 'asc'
507
507
  ? `Sort by ${cell.label} column in descending order`
508
508
  : props.sort.order === 'desc'
509
509
  ? `Remove sorting by ${cell.label} column`
510
- : `Sort by ${cell.label} column in ascending order`}
510
+ : `Sort by ${cell.label} column in ascending order`)}
511
511
  >
512
512
  {cell.render().replaceAll("%%%", '.')}
513
513
  </span>
@@ -29,7 +29,7 @@ const noteSettings = {
29
29
  {/if}
30
30
 
31
31
  {#each links as link}
32
- <span role="button" tabindex="0" title="link" class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
32
+ <span role="button" tabindex="0" title={link.label} class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
33
33
  <span>
34
34
  {#if link.label.toLowerCase()=='manual'}
35
35
  <Fa icon={faBook} />
@@ -10,11 +10,10 @@ import Notification from "./Notification.svelte";
10
10
  import { computePosition, autoUpdate, offset, shift, flip, arrow } from "@floating-ui/dom";
11
11
  import { storePopup } from "@skeletonlabs/skeleton";
12
12
  import { breadcrumbStore, notificationStore } from "../../stores/pageStores";
13
- import { errorStore, csrfTokenStore } from "../../stores/apiStores";
13
+ import { errorStore } from "../../stores/apiStores";
14
14
  storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
15
15
  import Docs from "./Docs.svelte";
16
16
  import GoToTop from "./GoToTop.svelte";
17
- import { getAntiForgeryToken } from "./PageCaller";
18
17
  export let title = "";
19
18
  export let note = "";
20
19
  export let links = [];
@@ -23,7 +22,6 @@ export let footer = true;
23
22
  export let help = false;
24
23
  export let contentLayoutType = pageContentLayoutType.center;
25
24
  export let fixLeft = true;
26
- let aftIsReady = false;
27
25
  errorStore.subscribe((error) => {
28
26
  console.log("\u{1F680} ~ errorStore.subscribe ~ value:", error.error);
29
27
  notificationStore.showNotification({
@@ -35,13 +33,6 @@ onMount(async () => {
35
33
  console.log("page");
36
34
  breadcrumbStore.clean();
37
35
  breadcrumbStore.addItem({ label: title, link: window.location.pathname });
38
- const data = await getAntiForgeryToken();
39
- csrfTokenStore.set(data.csrfToken);
40
- });
41
- csrfTokenStore.subscribe((value) => {
42
- if (value.length > 0) {
43
- aftIsReady = true;
44
- }
45
36
  });
46
37
  let app;
47
38
  function scrollToTop() {
@@ -70,8 +61,6 @@ function scrollToTop() {
70
61
 
71
62
  <slot name="description" />
72
63
 
73
- {#if aftIsReady}
74
-
75
64
  <div class="flex flex-initial space-x-5">
76
65
  {#if $$slots.left}
77
66
  <div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
@@ -100,7 +89,7 @@ function scrollToTop() {
100
89
  {/if}
101
90
  </div>
102
91
 
103
- {/if}
92
+
104
93
 
105
94
  <GoToTop/>
106
95
  <HelpPopUp active={help} />
@@ -1,3 +1,2 @@
1
1
  export function getFooter(): Promise<any>;
2
2
  export function getHeader(): Promise<any>;
3
- export function getAntiForgeryToken(): Promise<any>;
@@ -17,12 +17,3 @@ export const getHeader = async () => {
17
17
  console.error(error);
18
18
  }
19
19
  };
20
-
21
- export const getAntiForgeryToken = async () => {
22
- try {
23
- const response = await Api.get('/tokens/getAntiForgeryToken');
24
- return response.data;
25
- } catch (error) {
26
- console.error(error);
27
- }
28
- };
@@ -27,7 +27,7 @@ let popupCombobox = {
27
27
  <AccordionItem padding="p-2">
28
28
  <svelte:fragment slot="summary"
29
29
  ><button class="flex items-center gap-x-1">
30
- <span class="capitalize text-lg hover:text-primary-500">{menubarItem.Title}</span>
30
+ <span class="capitalize text-lg hover:text-secondary-500">{menubarItem.Title}</span>
31
31
  </button></svelte:fragment
32
32
  >
33
33
  <svelte:fragment slot="content"
@@ -38,7 +38,7 @@ let popupCombobox = {
38
38
  </div>
39
39
  <div class="hidden sm:block place-self-center" use:popup={popupCombobox}>
40
40
  <button class="flex items-center gap-x-1 px-2">
41
- <span class="capitalize text-lg whitespace-nowrap hover:text-primary-500">{menubarItem.Title}▾</span>
41
+ <span class="capitalize text-lg whitespace-nowrap hover:text-secondary-500">{menubarItem.Title}▾</span>
42
42
  </button>
43
43
 
44
44
  <div class="z-50 w-max" data-popup={id}>
@@ -0,0 +1,2 @@
1
+ export default cerberus;
2
+ declare const cerberus: Theme;
@@ -0,0 +1,229 @@
1
+ import type { Theme } from '@skeletonlabs/skeleton/themes';
2
+
3
+ const cerberus = {
4
+ "name": "bexis2",
5
+ "properties": {
6
+ "--type-scale-factor": "1.067",
7
+ "--type-scale-1": "calc(0.75rem * var(--type-scale-factor))",
8
+ "--type-scale-2": "calc(0.875rem * var(--type-scale-factor))",
9
+ "--type-scale-3": "calc(1rem * var(--type-scale-factor))",
10
+ "--type-scale-4": "calc(1.125rem * var(--type-scale-factor))",
11
+ "--type-scale-5": "calc(1.25rem * var(--type-scale-factor))",
12
+ "--type-scale-6": "calc(1.5rem * var(--type-scale-factor))",
13
+ "--type-scale-7": "calc(1.875rem * var(--type-scale-factor))",
14
+ "--type-scale-8": "calc(2.25rem * var(--type-scale-factor))",
15
+ "--type-scale-9": "calc(3rem * var(--type-scale-factor))",
16
+ "--type-scale-10": "calc(3.75rem * var(--type-scale-factor))",
17
+ "--type-scale-11": "calc(4.5rem * var(--type-scale-factor))",
18
+ "--type-scale-12": "calc(6rem * var(--type-scale-factor))",
19
+ "--type-scale-13": "calc(8rem * var(--type-scale-factor))",
20
+ "--base-font-color": "var(--color-surface-950)",
21
+ "--base-font-color-dark": "var(--color-surface-50)",
22
+ "--base-font-family": "system-ui",
23
+ "--base-font-size": "inherit",
24
+ "--base-line-height": "inherit",
25
+ "--base-font-weight": "normal",
26
+ "--base-font-style": "normal",
27
+ "--base-letter-spacing": "0em",
28
+ "--heading-font-color": "inherit",
29
+ "--heading-font-color-dark": "inherit",
30
+ "--heading-font-family": "inherit",
31
+ "--heading-font-weight": "bold",
32
+ "--heading-font-style": "normal",
33
+ "--heading-letter-spacing": "inherit",
34
+ "--anchor-font-color": "var(--color-primary-500)",
35
+ "--anchor-font-color-dark": "var(--color-primary-500)",
36
+ "--anchor-font-family": "inherit",
37
+ "--anchor-font-size": "inherit",
38
+ "--anchor-line-height": "inherit",
39
+ "--anchor-font-weight": "inherit",
40
+ "--anchor-font-style": "inherit",
41
+ "--anchor-letter-spacing": "inherit",
42
+ "--anchor-text-decoration": "none",
43
+ "--anchor-text-decoration-hover": "underline",
44
+ "--anchor-text-decoration-active": "none",
45
+ "--anchor-text-decoration-focus": "none",
46
+ "--space-scale-factor": "1",
47
+ "--radii-default": "6px",
48
+ "--radii-container": "6px",
49
+ "--border-width-default": "1px",
50
+ "--divide-width-default": "1px",
51
+ "--outline-width-default": "1px",
52
+ "--ring-width-default": "1px",
53
+ "--body-background-color": "var(--color-surface-50)",
54
+ "--body-background-color-dark": "var(--color-surface-950)",
55
+ "--color-primary-50": "227 243 241",
56
+ "--color-primary-100": "218 240 236",
57
+ "--color-primary-200": "209 236 232",
58
+ "--color-primary-300": "181 224 217",
59
+ "--color-primary-400": "125 201 189",
60
+ "--color-primary-500": "69 178 161",
61
+ "--color-primary-600": "62 160 145",
62
+ "--color-primary-700": "52 134 121",
63
+ "--color-primary-800": "41 107 97",
64
+ "--color-primary-900": "34 87 79",
65
+ "--color-primary-950": "9 39 80",
66
+ "--color-primary-contrast-dark": "var(--color-primary-950)",
67
+ "--color-primary-contrast-light": "var(--color-primary-50)",
68
+ "--color-primary-contrast-50": "var(--color-primary-contrast-dark)",
69
+ "--color-primary-contrast-100": "var(--color-primary-contrast-dark)",
70
+ "--color-primary-contrast-200": "var(--color-primary-contrast-dark)",
71
+ "--color-primary-contrast-300": "var(--color-primary-contrast-dark)",
72
+ "--color-primary-contrast-400": "var(--color-primary-contrast-dark)",
73
+ "--color-primary-contrast-500": "var(--color-primary-contrast-light)",
74
+ "--color-primary-contrast-600": "var(--color-primary-contrast-light)",
75
+ "--color-primary-contrast-700": "var(--color-primary-contrast-light)",
76
+ "--color-primary-contrast-800": "var(--color-primary-contrast-light)",
77
+ "--color-primary-contrast-900": "var(--color-primary-contrast-light)",
78
+ "--color-primary-contrast-950": "var(--color-primary-contrast-light)",
79
+ "--color-secondary-50": "255 239 217",
80
+ "--color-secondary-100": "255 234 204",
81
+ "--color-secondary-200": "255 229 191",
82
+ "--color-secondary-300": "255 213 153",
83
+ "--color-secondary-400": "255 182 77",
84
+ "--color-secondary-500": "255 151 0",
85
+ "--color-secondary-600": "230 136 0",
86
+ "--color-secondary-700": "191 113 0",
87
+ "--color-secondary-800": "153 91 0",
88
+ "--color-secondary-900": "125 74 0",
89
+ "--color-secondary-950": "50 25 104",
90
+ "--color-secondary-contrast-dark": "var(--color-secondary-950)",
91
+ "--color-secondary-contrast-light": "var(--color-secondary-50)",
92
+ "--color-secondary-contrast-50": "var(--color-secondary-contrast-dark)",
93
+ "--color-secondary-contrast-100": "var(--color-secondary-contrast-dark)",
94
+ "--color-secondary-contrast-200": "var(--color-secondary-contrast-dark)",
95
+ "--color-secondary-contrast-300": "var(--color-secondary-contrast-dark)",
96
+ "--color-secondary-contrast-400": "var(--color-secondary-contrast-light)",
97
+ "--color-secondary-contrast-500": "var(--color-secondary-contrast-light)",
98
+ "--color-secondary-contrast-600": "var(--color-secondary-contrast-light)",
99
+ "--color-secondary-contrast-700": "var(--color-secondary-contrast-light)",
100
+ "--color-secondary-contrast-800": "var(--color-secondary-contrast-light)",
101
+ "--color-secondary-contrast-900": "var(--color-secondary-contrast-light)",
102
+ "--color-secondary-contrast-950": "var(--color-secondary-contrast-light)",
103
+ "--color-tertiary-50": "245 251 249",
104
+ "--color-tertiary-100": "242 249 248",
105
+ "--color-tertiary-200": "239 248 246",
106
+ "--color-tertiary-300": "229 243 240",
107
+ "--color-tertiary-400": "210 234 229",
108
+ "--color-tertiary-500": "190 225 218",
109
+ "--color-tertiary-600": "171 203 196",
110
+ "--color-tertiary-700": "143 169 164",
111
+ "--color-tertiary-800": "114 135 131",
112
+ "--color-tertiary-900": "93 110 107",
113
+ "--color-tertiary-950": "118 0 67",
114
+ "--color-tertiary-contrast-dark": "var(--color-tertiary-950)",
115
+ "--color-tertiary-contrast-light": "var(--color-tertiary-50)",
116
+ "--color-tertiary-contrast-50": "var(--color-tertiary-contrast-dark)",
117
+ "--color-tertiary-contrast-100": "var(--color-tertiary-contrast-dark)",
118
+ "--color-tertiary-contrast-200": "var(--color-tertiary-contrast-dark)",
119
+ "--color-tertiary-contrast-300": "var(--color-tertiary-contrast-light)",
120
+ "--color-tertiary-contrast-400": "var(--color-tertiary-contrast-light)",
121
+ "--color-tertiary-contrast-500": "var(--color-tertiary-contrast-light)",
122
+ "--color-tertiary-contrast-600": "var(--color-tertiary-contrast-light)",
123
+ "--color-tertiary-contrast-700": "var(--color-tertiary-contrast-light)",
124
+ "--color-tertiary-contrast-800": "var(--color-tertiary-contrast-light)",
125
+ "--color-tertiary-contrast-900": "var(--color-tertiary-contrast-light)",
126
+ "--color-tertiary-contrast-950": "var(--color-tertiary-contrast-light)",
127
+ "--color-success-50": "228 244 227",
128
+ "--color-success-100": "219 240 217",
129
+ "--color-success-200": "210 237 208",
130
+ "--color-success-300": "183 225 180",
131
+ "--color-success-400": "129 203 123",
132
+ "--color-success-500": "75 181 67",
133
+ "--color-success-600": "68 163 60",
134
+ "--color-success-700": "56 136 50",
135
+ "--color-success-800": "45 109 40",
136
+ "--color-success-900": "37 89 33",
137
+ "--color-success-950": "5 46 42",
138
+ "--color-success-contrast-dark": "var(--color-success-950)",
139
+ "--color-success-contrast-light": "var(--color-success-50)",
140
+ "--color-success-contrast-50": "var(--color-success-contrast-dark)",
141
+ "--color-success-contrast-100": "var(--color-success-contrast-dark)",
142
+ "--color-success-contrast-200": "var(--color-success-contrast-dark)",
143
+ "--color-success-contrast-300": "var(--color-success-contrast-dark)",
144
+ "--color-success-contrast-400": "var(--color-success-contrast-dark)",
145
+ "--color-success-contrast-500": "var(--color-success-contrast-dark)",
146
+ "--color-success-contrast-600": "var(--color-success-contrast-light)",
147
+ "--color-success-contrast-700": "var(--color-success-contrast-light)",
148
+ "--color-success-contrast-800": "var(--color-success-contrast-light)",
149
+ "--color-success-contrast-900": "var(--color-success-contrast-light)",
150
+ "--color-success-contrast-950": "var(--color-success-contrast-light)",
151
+ "--color-warning-50": "252 244 218",
152
+ "--color-warning-100": "251 240 206",
153
+ "--color-warning-200": "250 236 193",
154
+ "--color-warning-300": "247 225 156",
155
+ "--color-warning-400": "240 202 82",
156
+ "--color-warning-500": "234 179 8",
157
+ "--color-warning-600": "211 161 7",
158
+ "--color-warning-700": "176 134 6",
159
+ "--color-warning-800": "140 107 5",
160
+ "--color-warning-900": "115 88 4",
161
+ "--color-warning-950": "161 77 5",
162
+ "--color-warning-contrast-dark": "var(--color-warning-950)",
163
+ "--color-warning-contrast-light": "var(--color-warning-50)",
164
+ "--color-warning-contrast-50": "var(--color-warning-contrast-dark)",
165
+ "--color-warning-contrast-100": "var(--color-warning-contrast-dark)",
166
+ "--color-warning-contrast-200": "var(--color-warning-contrast-dark)",
167
+ "--color-warning-contrast-300": "var(--color-warning-contrast-dark)",
168
+ "--color-warning-contrast-400": "var(--color-warning-contrast-dark)",
169
+ "--color-warning-contrast-500": "var(--color-warning-contrast-dark)",
170
+ "--color-warning-contrast-600": "var(--color-warning-contrast-light)",
171
+ "--color-warning-contrast-700": "var(--color-warning-contrast-light)",
172
+ "--color-warning-contrast-800": "var(--color-warning-contrast-light)",
173
+ "--color-warning-contrast-900": "var(--color-warning-contrast-light)",
174
+ "--color-warning-contrast-950": "var(--color-warning-contrast-light)",
175
+ "--color-error-50": "255 217 217",
176
+ "--color-error-100": "255 204 204",
177
+ "--color-error-200": "255 191 191",
178
+ "--color-error-300": "255 153 153",
179
+ "--color-error-400": "255 77 77",
180
+ "--color-error-500": "255 0 0",
181
+ "--color-error-600": "230 0 0",
182
+ "--color-error-700": "191 0 0",
183
+ "--color-error-800": "153 0 0",
184
+ "--color-error-900": "125 0 0",
185
+ "--color-error-950": "148 0 0",
186
+ "--color-error-contrast-dark": "var(--color-error-950)",
187
+ "--color-error-contrast-light": "var(--color-error-50)",
188
+ "--color-error-contrast-50": "var(--color-error-contrast-dark)",
189
+ "--color-error-contrast-100": "var(--color-error-contrast-dark)",
190
+ "--color-error-contrast-200": "var(--color-error-contrast-dark)",
191
+ "--color-error-contrast-300": "var(--color-error-contrast-dark)",
192
+ "--color-error-contrast-400": "var(--color-error-contrast-dark)",
193
+ "--color-error-contrast-500": "var(--color-error-contrast-light)",
194
+ "--color-error-contrast-600": "var(--color-error-contrast-light)",
195
+ "--color-error-contrast-700": "var(--color-error-contrast-light)",
196
+ "--color-error-contrast-800": "var(--color-error-contrast-light)",
197
+ "--color-error-contrast-900": "var(--color-error-contrast-light)",
198
+ "--color-error-contrast-950": "var(--color-error-contrast-light)",
199
+ "--color-surface-50": "247 247 247",
200
+ "--color-surface-100": "244 244 244",
201
+ "--color-surface-200": "241 241 241",
202
+ "--color-surface-300": "233 233 233",
203
+ "--color-surface-400": "216 216 216",
204
+ "--color-surface-500": "199 199 199",
205
+ "--color-surface-600": "179 179 179",
206
+ "--color-surface-700": "149 149 149",
207
+ "--color-surface-800": "119 119 119",
208
+ "--color-surface-900": "98 98 98",
209
+ "--color-surface-950": "17 17 17",
210
+ "--color-surface-contrast-dark": "var(--color-surface-950)",
211
+ "--color-surface-contrast-light": "var(--color-surface-50)",
212
+ "--color-surface-contrast-50": "var(--color-surface-contrast-dark)",
213
+ "--color-surface-contrast-100": "var(--color-surface-contrast-dark)",
214
+ "--color-surface-contrast-200": "var(--color-surface-contrast-dark)",
215
+ "--color-surface-contrast-300": "var(--color-surface-contrast-dark)",
216
+ "--color-surface-contrast-400": "var(--color-surface-contrast-light)",
217
+ "--color-surface-contrast-500": "var(--color-surface-contrast-light)",
218
+ "--color-surface-contrast-600": "var(--color-surface-contrast-light)",
219
+ "--color-surface-contrast-700": "var(--color-surface-contrast-light)",
220
+ "--color-surface-contrast-800": "var(--color-surface-contrast-light)",
221
+ "--color-surface-contrast-900": "var(--color-surface-contrast-light)",
222
+ "--color-surface-contrast-950": "var(--color-surface-contrast-light)"
223
+ },
224
+ "metadata": {
225
+ "version": "3.0.0"
226
+ }
227
+ } satisfies Theme;
228
+
229
+ export default cerberus;
Binary file
Binary file
package/dist/md.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export interface Metadata {
2
+ title: string;
3
+ }
4
+ export declare const md: {
5
+ data: any[];
6
+ allHeadings: string[][];
7
+ };
package/dist/md.js ADDED
@@ -0,0 +1,52 @@
1
+ import { all } from 'axios';
2
+ import { marked } from 'marked';
3
+ ;
4
+ let slug = '';
5
+ async function loadMDFiles() {
6
+ const repoUrl = 'https://api.github.com/repos/BEXIS2/Documents/contents/Docs';
7
+ const response = await fetch(repoUrl);
8
+ const files = await response.json();
9
+ const allHeadings = [];
10
+ const entries = await Promise.all(files.map(async (file) => {
11
+ if (file.download_url) {
12
+ const fileResponse = await fetch(file.download_url);
13
+ const content = await fileResponse.text();
14
+ slug = file.name.replace('.md', '');
15
+ // Extract metadata and content from the Markdown file
16
+ const metadata = extractMetadata(content);
17
+ allHeadings.push(metadata.headings);
18
+ return {
19
+ slug,
20
+ ...metadata,
21
+ content
22
+ };
23
+ }
24
+ else {
25
+ console.error('File has no download URL:', file);
26
+ return null;
27
+ }
28
+ }));
29
+ const data = await entries.filter(entry => entry !== null);
30
+ return { data, allHeadings };
31
+ }
32
+ function extractMetadata(content) {
33
+ // const { data, content: markdownContent } = matter(content);
34
+ // Extract headings using marked
35
+ const headings = [];
36
+ const renderer = new marked.Renderer();
37
+ renderer.heading = (text, level) => {
38
+ text.base = slug;
39
+ headings.push(text);
40
+ return `<h${level}>${text}</h${level}>`;
41
+ };
42
+ marked(content, { renderer });
43
+ return { headings };
44
+ }
45
+ function extractMetadata2(content) {
46
+ // Implement metadata extraction logic here
47
+ // For example, using front-matter or similar library
48
+ return {
49
+ title: 'Example Title' // Replace with actual metadata extraction
50
+ };
51
+ }
52
+ export const md = await loadMDFiles();
@@ -1,6 +1,6 @@
1
1
  // Api.js
2
2
  import axios from 'axios';
3
- import { host, username, password, errorStore, csrfToken } from '../stores/apiStores';
3
+ import { host, username, password, errorStore } from '../stores/apiStores';
4
4
  console.log('setup axios');
5
5
  // implement a method to execute all the request from here.
6
6
  const apiRequest = (method, url, request) => {
@@ -8,10 +8,8 @@ const apiRequest = (method, url, request) => {
8
8
  const axiosAPI = axios.create({
9
9
  baseURL: host
10
10
  });
11
- const requestVerificationToken = csrfToken;
12
11
  const headers = {
13
- authorization: 'Basic ' + btoa(username + ':' + password),
14
- '__RequestVerificationToken': requestVerificationToken
12
+ authorization: 'Basic ' + btoa(username + ':' + password)
15
13
  };
16
14
  //using the axios instance to perform the request that received from each http method
17
15
  return axiosAPI({
@@ -21,7 +19,7 @@ const apiRequest = (method, url, request) => {
21
19
  headers
22
20
  })
23
21
  .then((res) => {
24
- //console.log("res-test",res);
22
+ // console.log("res",res);
25
23
  return Promise.resolve(res);
26
24
  })
27
25
  .catch((er) => {
@@ -2,7 +2,5 @@ import { errorType } from '../models/Models';
2
2
  export declare let host: string;
3
3
  export declare let username: string;
4
4
  export declare let password: string;
5
- export declare let csrfToken: string;
6
- export declare const csrfTokenStore: import("svelte/store").Writable<string>;
7
5
  export declare const errorStore: import("svelte/store").Writable<errorType>;
8
6
  export declare function setApiConfig(_host: string, _user: string, _pw: string): void;
@@ -3,8 +3,6 @@ import { errorType } from '../models/Models';
3
3
  export let host = 'window.location.origin';
4
4
  export let username = '';
5
5
  export let password = '';
6
- export let csrfToken = '';
7
- export const csrfTokenStore = writable('');
8
6
  const hostStore = writable(''); //writable(window.location.origin);
9
7
  const usernameStore = writable('');
10
8
  const passwordStore = writable('');
@@ -12,9 +10,6 @@ export const errorStore = writable(new errorType());
12
10
  hostStore.subscribe((value) => {
13
11
  host = value;
14
12
  });
15
- csrfTokenStore.subscribe((value) => {
16
- csrfToken = value;
17
- });
18
13
  usernameStore.subscribe((value) => {
19
14
  username = value;
20
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bexis2/bexis2-core-ui",
3
- "version": "0.4.58",
3
+ "version": "0.4.59",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -0,0 +1,8 @@
1
+ <!-- filepath: /c:/Daten/Documents/Projekte/Svelte/bexis2-core-ui/src/components/MarkdownRenderer.svelte -->
2
+ <script lang="ts">
3
+ import { marked } from 'marked';
4
+ import { mdsvex } from 'mdsvex';
5
+ export let content: string;
6
+ </script>
7
+
8
+ <div >{@html content}</div>
@@ -177,13 +177,13 @@
177
177
  >
178
178
  <b style="font-size:xx-large"><Fa icon={faFileUpload} /></b>
179
179
  <span
180
- ><b>Drag 'n' drop some files here, or click to select files</b>
180
+ ><b>Drag 'n' drop or click to select files</b>
181
181
  <b>(max file size: {model.maxSize} mb)</b></span
182
182
  >
183
183
  <p>
184
184
  {#if model.accept}
185
- {#each model.accept as ext}
186
- {ext} ,
185
+ {#each model.accept as ext, i}
186
+ {ext}{#if i < model.accept.length - 1}, {/if}
187
187
  {/each}
188
188
  {/if}
189
189
  </p>
@@ -535,8 +535,8 @@
535
535
  {...$tableAttrs}
536
536
  class="table table-auto table-compact bg-tertiary-500/30 dark:bg-tertiary-900/10 overflow-clip"
537
537
  id="{tableId}-table"
538
- title="Table"
539
538
  >
539
+ <!-- title="Table" removed from top, as this should be handled by the surrounding container for better accessibility -->
540
540
  <!-- If table height is provided, making the top row sticky -->
541
541
  <thead class={height != null && $pageRows.length > 0 ? `sticky top-0` : ''}>
542
542
  <!-- {#if $data.length > 0} -->
@@ -583,11 +583,11 @@
583
583
  class:cursor-pointer={!props.sort.disabled}
584
584
  on:click={props.sort.toggle}
585
585
  on:keydown={props.sort.toggle}
586
- title={props.sort.order === 'asc'
586
+ title={props.sort.disabled ? undefined : (props.sort.order === 'asc'
587
587
  ? `Sort by ${cell.label} column in descending order`
588
588
  : props.sort.order === 'desc'
589
589
  ? `Remove sorting by ${cell.label} column`
590
- : `Sort by ${cell.label} column in ascending order`}
590
+ : `Sort by ${cell.label} column in ascending order`)}
591
591
  >
592
592
  {cell.render().replaceAll("%%%", '.')}
593
593
  </span>
@@ -39,7 +39,7 @@
39
39
  {/if}
40
40
 
41
41
  {#each links as link}
42
- <span role="button" tabindex="0" title="link" class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
42
+ <span role="button" tabindex="0" title={link.label} class="chip variant-soft hover:variant-filled" on:click={() => goTo(link.url, false)} on:keypress={() => goTo(link.url, false)}>
43
43
  <span>
44
44
  {#if link.label.toLowerCase()=='manual'}
45
45
  <Fa icon={faBook} />
@@ -17,7 +17,7 @@
17
17
  import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
18
18
  import { storePopup } from '@skeletonlabs/skeleton';
19
19
  import { breadcrumbStore,notificationStore } from '$store/pageStores';
20
- import { errorStore,csrfTokenStore } from '$store/apiStores';
20
+ import { errorStore } from '$store/apiStores';
21
21
 
22
22
  storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
23
23
 
@@ -27,8 +27,6 @@ import type { helpItemType, helpStoreType } from '$models/Models';
27
27
 
28
28
  import Docs from './Docs.svelte';
29
29
  import GoToTop from './GoToTop.svelte';
30
- import { getAntiForgeryToken } from './PageCaller';
31
-
32
30
 
33
31
  export let title = '';
34
32
  export let note = '';
@@ -41,8 +39,6 @@ import type { helpItemType, helpStoreType } from '$models/Models';
41
39
  export let contentLayoutType: pageContentLayoutType = pageContentLayoutType.center;
42
40
  export let fixLeft: boolean = true;
43
41
 
44
- let aftIsReady = false;
45
-
46
42
  errorStore.subscribe((error:errorType) => {
47
43
  console.log("🚀 ~ errorStore.subscribe ~ value:", error.error)
48
44
  notificationStore.showNotification({
@@ -55,18 +51,8 @@ import type { helpItemType, helpStoreType } from '$models/Models';
55
51
  console.log('page');
56
52
  breadcrumbStore.clean();
57
53
  breadcrumbStore.addItem({ label: title, link: window.location.pathname });
58
- const data = await getAntiForgeryToken();
59
- csrfTokenStore.set(data.csrfToken);
60
- });
61
-
62
-
63
- csrfTokenStore.subscribe(value => {
64
- if(value.length>0){
65
- aftIsReady = true;
66
- }
67
54
  });
68
55
 
69
-
70
56
  let app;
71
57
  function scrollToTop() {
72
58
  app.scrollIntoView();
@@ -95,8 +81,6 @@ import type { helpItemType, helpStoreType } from '$models/Models';
95
81
 
96
82
  <slot name="description" />
97
83
 
98
- {#if aftIsReady}
99
-
100
84
  <div class="flex flex-initial space-x-5">
101
85
  {#if $$slots.left}
102
86
  <div class="p-5 flex-shrink-0 w-96 w-min-96 border-y border-solid border-surface-500">
@@ -125,7 +109,7 @@ import type { helpItemType, helpStoreType } from '$models/Models';
125
109
  {/if}
126
110
  </div>
127
111
 
128
- {/if}
112
+
129
113
 
130
114
  <GoToTop/>
131
115
  <HelpPopUp active={help} />
@@ -17,12 +17,3 @@ export const getHeader = async () => {
17
17
  console.error(error);
18
18
  }
19
19
  };
20
-
21
- export const getAntiForgeryToken = async () => {
22
- try {
23
- const response = await Api.get('/tokens/getAntiForgeryToken');
24
- return response.data;
25
- } catch (error) {
26
- console.error(error);
27
- }
28
- };
@@ -38,7 +38,7 @@
38
38
  <AccordionItem padding="p-2">
39
39
  <svelte:fragment slot="summary"
40
40
  ><button class="flex items-center gap-x-1">
41
- <span class="capitalize text-lg hover:text-primary-500">{menubarItem.Title}</span>
41
+ <span class="capitalize text-lg hover:text-secondary-500">{menubarItem.Title}</span>
42
42
  </button></svelte:fragment
43
43
  >
44
44
  <svelte:fragment slot="content"
@@ -49,7 +49,7 @@
49
49
  </div>
50
50
  <div class="hidden sm:block place-self-center" use:popup={popupCombobox}>
51
51
  <button class="flex items-center gap-x-1 px-2">
52
- <span class="capitalize text-lg whitespace-nowrap hover:text-primary-500">{menubarItem.Title}▾</span>
52
+ <span class="capitalize text-lg whitespace-nowrap hover:text-secondary-500">{menubarItem.Title}▾</span>
53
53
  </button>
54
54
 
55
55
  <div class="z-50 w-max" data-popup={id}>
@@ -0,0 +1,229 @@
1
+ import type { Theme } from '@skeletonlabs/skeleton/themes';
2
+
3
+ const cerberus = {
4
+ "name": "bexis2",
5
+ "properties": {
6
+ "--type-scale-factor": "1.067",
7
+ "--type-scale-1": "calc(0.75rem * var(--type-scale-factor))",
8
+ "--type-scale-2": "calc(0.875rem * var(--type-scale-factor))",
9
+ "--type-scale-3": "calc(1rem * var(--type-scale-factor))",
10
+ "--type-scale-4": "calc(1.125rem * var(--type-scale-factor))",
11
+ "--type-scale-5": "calc(1.25rem * var(--type-scale-factor))",
12
+ "--type-scale-6": "calc(1.5rem * var(--type-scale-factor))",
13
+ "--type-scale-7": "calc(1.875rem * var(--type-scale-factor))",
14
+ "--type-scale-8": "calc(2.25rem * var(--type-scale-factor))",
15
+ "--type-scale-9": "calc(3rem * var(--type-scale-factor))",
16
+ "--type-scale-10": "calc(3.75rem * var(--type-scale-factor))",
17
+ "--type-scale-11": "calc(4.5rem * var(--type-scale-factor))",
18
+ "--type-scale-12": "calc(6rem * var(--type-scale-factor))",
19
+ "--type-scale-13": "calc(8rem * var(--type-scale-factor))",
20
+ "--base-font-color": "var(--color-surface-950)",
21
+ "--base-font-color-dark": "var(--color-surface-50)",
22
+ "--base-font-family": "system-ui",
23
+ "--base-font-size": "inherit",
24
+ "--base-line-height": "inherit",
25
+ "--base-font-weight": "normal",
26
+ "--base-font-style": "normal",
27
+ "--base-letter-spacing": "0em",
28
+ "--heading-font-color": "inherit",
29
+ "--heading-font-color-dark": "inherit",
30
+ "--heading-font-family": "inherit",
31
+ "--heading-font-weight": "bold",
32
+ "--heading-font-style": "normal",
33
+ "--heading-letter-spacing": "inherit",
34
+ "--anchor-font-color": "var(--color-primary-500)",
35
+ "--anchor-font-color-dark": "var(--color-primary-500)",
36
+ "--anchor-font-family": "inherit",
37
+ "--anchor-font-size": "inherit",
38
+ "--anchor-line-height": "inherit",
39
+ "--anchor-font-weight": "inherit",
40
+ "--anchor-font-style": "inherit",
41
+ "--anchor-letter-spacing": "inherit",
42
+ "--anchor-text-decoration": "none",
43
+ "--anchor-text-decoration-hover": "underline",
44
+ "--anchor-text-decoration-active": "none",
45
+ "--anchor-text-decoration-focus": "none",
46
+ "--space-scale-factor": "1",
47
+ "--radii-default": "6px",
48
+ "--radii-container": "6px",
49
+ "--border-width-default": "1px",
50
+ "--divide-width-default": "1px",
51
+ "--outline-width-default": "1px",
52
+ "--ring-width-default": "1px",
53
+ "--body-background-color": "var(--color-surface-50)",
54
+ "--body-background-color-dark": "var(--color-surface-950)",
55
+ "--color-primary-50": "227 243 241",
56
+ "--color-primary-100": "218 240 236",
57
+ "--color-primary-200": "209 236 232",
58
+ "--color-primary-300": "181 224 217",
59
+ "--color-primary-400": "125 201 189",
60
+ "--color-primary-500": "69 178 161",
61
+ "--color-primary-600": "62 160 145",
62
+ "--color-primary-700": "52 134 121",
63
+ "--color-primary-800": "41 107 97",
64
+ "--color-primary-900": "34 87 79",
65
+ "--color-primary-950": "9 39 80",
66
+ "--color-primary-contrast-dark": "var(--color-primary-950)",
67
+ "--color-primary-contrast-light": "var(--color-primary-50)",
68
+ "--color-primary-contrast-50": "var(--color-primary-contrast-dark)",
69
+ "--color-primary-contrast-100": "var(--color-primary-contrast-dark)",
70
+ "--color-primary-contrast-200": "var(--color-primary-contrast-dark)",
71
+ "--color-primary-contrast-300": "var(--color-primary-contrast-dark)",
72
+ "--color-primary-contrast-400": "var(--color-primary-contrast-dark)",
73
+ "--color-primary-contrast-500": "var(--color-primary-contrast-light)",
74
+ "--color-primary-contrast-600": "var(--color-primary-contrast-light)",
75
+ "--color-primary-contrast-700": "var(--color-primary-contrast-light)",
76
+ "--color-primary-contrast-800": "var(--color-primary-contrast-light)",
77
+ "--color-primary-contrast-900": "var(--color-primary-contrast-light)",
78
+ "--color-primary-contrast-950": "var(--color-primary-contrast-light)",
79
+ "--color-secondary-50": "255 239 217",
80
+ "--color-secondary-100": "255 234 204",
81
+ "--color-secondary-200": "255 229 191",
82
+ "--color-secondary-300": "255 213 153",
83
+ "--color-secondary-400": "255 182 77",
84
+ "--color-secondary-500": "255 151 0",
85
+ "--color-secondary-600": "230 136 0",
86
+ "--color-secondary-700": "191 113 0",
87
+ "--color-secondary-800": "153 91 0",
88
+ "--color-secondary-900": "125 74 0",
89
+ "--color-secondary-950": "50 25 104",
90
+ "--color-secondary-contrast-dark": "var(--color-secondary-950)",
91
+ "--color-secondary-contrast-light": "var(--color-secondary-50)",
92
+ "--color-secondary-contrast-50": "var(--color-secondary-contrast-dark)",
93
+ "--color-secondary-contrast-100": "var(--color-secondary-contrast-dark)",
94
+ "--color-secondary-contrast-200": "var(--color-secondary-contrast-dark)",
95
+ "--color-secondary-contrast-300": "var(--color-secondary-contrast-dark)",
96
+ "--color-secondary-contrast-400": "var(--color-secondary-contrast-light)",
97
+ "--color-secondary-contrast-500": "var(--color-secondary-contrast-light)",
98
+ "--color-secondary-contrast-600": "var(--color-secondary-contrast-light)",
99
+ "--color-secondary-contrast-700": "var(--color-secondary-contrast-light)",
100
+ "--color-secondary-contrast-800": "var(--color-secondary-contrast-light)",
101
+ "--color-secondary-contrast-900": "var(--color-secondary-contrast-light)",
102
+ "--color-secondary-contrast-950": "var(--color-secondary-contrast-light)",
103
+ "--color-tertiary-50": "245 251 249",
104
+ "--color-tertiary-100": "242 249 248",
105
+ "--color-tertiary-200": "239 248 246",
106
+ "--color-tertiary-300": "229 243 240",
107
+ "--color-tertiary-400": "210 234 229",
108
+ "--color-tertiary-500": "190 225 218",
109
+ "--color-tertiary-600": "171 203 196",
110
+ "--color-tertiary-700": "143 169 164",
111
+ "--color-tertiary-800": "114 135 131",
112
+ "--color-tertiary-900": "93 110 107",
113
+ "--color-tertiary-950": "118 0 67",
114
+ "--color-tertiary-contrast-dark": "var(--color-tertiary-950)",
115
+ "--color-tertiary-contrast-light": "var(--color-tertiary-50)",
116
+ "--color-tertiary-contrast-50": "var(--color-tertiary-contrast-dark)",
117
+ "--color-tertiary-contrast-100": "var(--color-tertiary-contrast-dark)",
118
+ "--color-tertiary-contrast-200": "var(--color-tertiary-contrast-dark)",
119
+ "--color-tertiary-contrast-300": "var(--color-tertiary-contrast-light)",
120
+ "--color-tertiary-contrast-400": "var(--color-tertiary-contrast-light)",
121
+ "--color-tertiary-contrast-500": "var(--color-tertiary-contrast-light)",
122
+ "--color-tertiary-contrast-600": "var(--color-tertiary-contrast-light)",
123
+ "--color-tertiary-contrast-700": "var(--color-tertiary-contrast-light)",
124
+ "--color-tertiary-contrast-800": "var(--color-tertiary-contrast-light)",
125
+ "--color-tertiary-contrast-900": "var(--color-tertiary-contrast-light)",
126
+ "--color-tertiary-contrast-950": "var(--color-tertiary-contrast-light)",
127
+ "--color-success-50": "228 244 227",
128
+ "--color-success-100": "219 240 217",
129
+ "--color-success-200": "210 237 208",
130
+ "--color-success-300": "183 225 180",
131
+ "--color-success-400": "129 203 123",
132
+ "--color-success-500": "75 181 67",
133
+ "--color-success-600": "68 163 60",
134
+ "--color-success-700": "56 136 50",
135
+ "--color-success-800": "45 109 40",
136
+ "--color-success-900": "37 89 33",
137
+ "--color-success-950": "5 46 42",
138
+ "--color-success-contrast-dark": "var(--color-success-950)",
139
+ "--color-success-contrast-light": "var(--color-success-50)",
140
+ "--color-success-contrast-50": "var(--color-success-contrast-dark)",
141
+ "--color-success-contrast-100": "var(--color-success-contrast-dark)",
142
+ "--color-success-contrast-200": "var(--color-success-contrast-dark)",
143
+ "--color-success-contrast-300": "var(--color-success-contrast-dark)",
144
+ "--color-success-contrast-400": "var(--color-success-contrast-dark)",
145
+ "--color-success-contrast-500": "var(--color-success-contrast-dark)",
146
+ "--color-success-contrast-600": "var(--color-success-contrast-light)",
147
+ "--color-success-contrast-700": "var(--color-success-contrast-light)",
148
+ "--color-success-contrast-800": "var(--color-success-contrast-light)",
149
+ "--color-success-contrast-900": "var(--color-success-contrast-light)",
150
+ "--color-success-contrast-950": "var(--color-success-contrast-light)",
151
+ "--color-warning-50": "252 244 218",
152
+ "--color-warning-100": "251 240 206",
153
+ "--color-warning-200": "250 236 193",
154
+ "--color-warning-300": "247 225 156",
155
+ "--color-warning-400": "240 202 82",
156
+ "--color-warning-500": "234 179 8",
157
+ "--color-warning-600": "211 161 7",
158
+ "--color-warning-700": "176 134 6",
159
+ "--color-warning-800": "140 107 5",
160
+ "--color-warning-900": "115 88 4",
161
+ "--color-warning-950": "161 77 5",
162
+ "--color-warning-contrast-dark": "var(--color-warning-950)",
163
+ "--color-warning-contrast-light": "var(--color-warning-50)",
164
+ "--color-warning-contrast-50": "var(--color-warning-contrast-dark)",
165
+ "--color-warning-contrast-100": "var(--color-warning-contrast-dark)",
166
+ "--color-warning-contrast-200": "var(--color-warning-contrast-dark)",
167
+ "--color-warning-contrast-300": "var(--color-warning-contrast-dark)",
168
+ "--color-warning-contrast-400": "var(--color-warning-contrast-dark)",
169
+ "--color-warning-contrast-500": "var(--color-warning-contrast-dark)",
170
+ "--color-warning-contrast-600": "var(--color-warning-contrast-light)",
171
+ "--color-warning-contrast-700": "var(--color-warning-contrast-light)",
172
+ "--color-warning-contrast-800": "var(--color-warning-contrast-light)",
173
+ "--color-warning-contrast-900": "var(--color-warning-contrast-light)",
174
+ "--color-warning-contrast-950": "var(--color-warning-contrast-light)",
175
+ "--color-error-50": "255 217 217",
176
+ "--color-error-100": "255 204 204",
177
+ "--color-error-200": "255 191 191",
178
+ "--color-error-300": "255 153 153",
179
+ "--color-error-400": "255 77 77",
180
+ "--color-error-500": "255 0 0",
181
+ "--color-error-600": "230 0 0",
182
+ "--color-error-700": "191 0 0",
183
+ "--color-error-800": "153 0 0",
184
+ "--color-error-900": "125 0 0",
185
+ "--color-error-950": "148 0 0",
186
+ "--color-error-contrast-dark": "var(--color-error-950)",
187
+ "--color-error-contrast-light": "var(--color-error-50)",
188
+ "--color-error-contrast-50": "var(--color-error-contrast-dark)",
189
+ "--color-error-contrast-100": "var(--color-error-contrast-dark)",
190
+ "--color-error-contrast-200": "var(--color-error-contrast-dark)",
191
+ "--color-error-contrast-300": "var(--color-error-contrast-dark)",
192
+ "--color-error-contrast-400": "var(--color-error-contrast-dark)",
193
+ "--color-error-contrast-500": "var(--color-error-contrast-light)",
194
+ "--color-error-contrast-600": "var(--color-error-contrast-light)",
195
+ "--color-error-contrast-700": "var(--color-error-contrast-light)",
196
+ "--color-error-contrast-800": "var(--color-error-contrast-light)",
197
+ "--color-error-contrast-900": "var(--color-error-contrast-light)",
198
+ "--color-error-contrast-950": "var(--color-error-contrast-light)",
199
+ "--color-surface-50": "247 247 247",
200
+ "--color-surface-100": "244 244 244",
201
+ "--color-surface-200": "241 241 241",
202
+ "--color-surface-300": "233 233 233",
203
+ "--color-surface-400": "216 216 216",
204
+ "--color-surface-500": "199 199 199",
205
+ "--color-surface-600": "179 179 179",
206
+ "--color-surface-700": "149 149 149",
207
+ "--color-surface-800": "119 119 119",
208
+ "--color-surface-900": "98 98 98",
209
+ "--color-surface-950": "17 17 17",
210
+ "--color-surface-contrast-dark": "var(--color-surface-950)",
211
+ "--color-surface-contrast-light": "var(--color-surface-50)",
212
+ "--color-surface-contrast-50": "var(--color-surface-contrast-dark)",
213
+ "--color-surface-contrast-100": "var(--color-surface-contrast-dark)",
214
+ "--color-surface-contrast-200": "var(--color-surface-contrast-dark)",
215
+ "--color-surface-contrast-300": "var(--color-surface-contrast-dark)",
216
+ "--color-surface-contrast-400": "var(--color-surface-contrast-light)",
217
+ "--color-surface-contrast-500": "var(--color-surface-contrast-light)",
218
+ "--color-surface-contrast-600": "var(--color-surface-contrast-light)",
219
+ "--color-surface-contrast-700": "var(--color-surface-contrast-light)",
220
+ "--color-surface-contrast-800": "var(--color-surface-contrast-light)",
221
+ "--color-surface-contrast-900": "var(--color-surface-contrast-light)",
222
+ "--color-surface-contrast-950": "var(--color-surface-contrast-light)"
223
+ },
224
+ "metadata": {
225
+ "version": "3.0.0"
226
+ }
227
+ } satisfies Theme;
228
+
229
+ export default cerberus;
package/src/lib/md.ts ADDED
@@ -0,0 +1,73 @@
1
+ import { all } from 'axios';
2
+ import { marked } from 'marked';
3
+
4
+ export interface Metadata {
5
+ title: string;
6
+ };
7
+
8
+ interface Md {
9
+ metadata: Metadata;
10
+ content: string;
11
+ }
12
+
13
+ let slug = '';
14
+
15
+ async function loadMDFiles() {
16
+ const repoUrl = 'https://api.github.com/repos/BEXIS2/Documents/contents/Docs';
17
+ const response = await fetch(repoUrl);
18
+ const files = await response.json();
19
+ const allHeadings: string[][] = []
20
+
21
+ const entries = await Promise.all(files.map(async (file: any) => {
22
+ if (file.download_url) {
23
+ const fileResponse = await fetch(file.download_url);
24
+ const content = await fileResponse.text();
25
+
26
+ slug = file.name.replace('.md', '');
27
+ // Extract metadata and content from the Markdown file
28
+ const metadata = extractMetadata(content);
29
+ allHeadings.push(metadata.headings);
30
+
31
+
32
+ return {
33
+ slug,
34
+ ...metadata,
35
+ content
36
+ };
37
+ } else {
38
+ console.error('File has no download URL:', file);
39
+ return null;
40
+ }
41
+ }));
42
+ const data = await entries.filter(entry => entry !== null);
43
+ return { data, allHeadings};
44
+ }
45
+
46
+ function extractMetadata(content: string): { headings: string[] } {
47
+ // const { data, content: markdownContent } = matter(content);
48
+
49
+ // Extract headings using marked
50
+ const headings: string[] = [];
51
+ const renderer = new marked.Renderer();
52
+ renderer.heading = (text, level) => {
53
+ text.base = slug
54
+ headings.push(text);
55
+ return `<h${level}>${text}</h${level}>`;
56
+ };
57
+ marked(content, { renderer });
58
+
59
+ return { headings };
60
+ }
61
+
62
+
63
+
64
+
65
+ function extractMetadata2(content: string): Metadata {
66
+ // Implement metadata extraction logic here
67
+ // For example, using front-matter or similar library
68
+ return {
69
+ title: 'Example Title' // Replace with actual metadata extraction
70
+ };
71
+ }
72
+
73
+ export const md = await loadMDFiles();
@@ -1,6 +1,6 @@
1
1
  // Api.js
2
2
  import axios from 'axios';
3
- import { host, username, password, errorStore, csrfToken } from '../stores/apiStores';
3
+ import { host, username, password, errorStore } from '../stores/apiStores';
4
4
  import type { errorType } from '$models/Models';
5
5
 
6
6
  console.log('setup axios');
@@ -12,13 +12,10 @@ const apiRequest = (method, url, request) => {
12
12
  baseURL: host
13
13
  });
14
14
 
15
- const requestVerificationToken = csrfToken;
16
15
  const headers = {
17
- authorization: 'Basic ' + btoa(username + ':' + password),
18
- '__RequestVerificationToken': requestVerificationToken
16
+ authorization: 'Basic ' + btoa(username + ':' + password)
19
17
  };
20
18
 
21
-
22
19
  //using the axios instance to perform the request that received from each http method
23
20
  return axiosAPI({
24
21
  method,
@@ -27,7 +24,7 @@ const apiRequest = (method, url, request) => {
27
24
  headers
28
25
  })
29
26
  .then((res) => {
30
- //console.log("res-test",res);
27
+ // console.log("res",res);
31
28
 
32
29
  return Promise.resolve(res);
33
30
 
@@ -4,28 +4,17 @@ import { errorType } from '$models/Models'
4
4
  export let host = 'window.location.origin';
5
5
  export let username = '';
6
6
  export let password = '';
7
- export let csrfToken = '';
8
-
9
-
10
- export const csrfTokenStore = writable('');
11
-
12
7
 
13
8
  const hostStore = writable(''); //writable(window.location.origin);
14
9
  const usernameStore = writable('');
15
10
  const passwordStore = writable('');
16
11
 
17
-
18
12
  export const errorStore = writable(new errorType());
19
13
 
20
14
  hostStore.subscribe((value) => {
21
15
  host = value;
22
16
  });
23
17
 
24
- csrfTokenStore.subscribe((value) => {
25
- csrfToken = value;
26
- });
27
-
28
-
29
18
  usernameStore.subscribe((value) => {
30
19
  username = value;
31
20
  });
@@ -214,5 +214,3 @@ function createNotificationStore() {
214
214
 
215
215
  //crate and export the instance of the store
216
216
  export const notificationStore = createNotificationStore();
217
-
218
-