@sierra-95/svelte-scaffold 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/Hooks/layout_menu.d.ts +1 -0
- package/dist/Hooks/layout_menu.js +24 -0
- package/dist/Hooks/preview.d.ts +3 -0
- package/dist/Hooks/preview.js +24 -0
- package/dist/components/Core/Alerts/Backdrop/backdrop.svelte +27 -0
- package/dist/components/Core/Alerts/Backdrop/backdrop.svelte.d.ts +15 -0
- package/dist/components/Core/Alerts/Modal/modal.svelte +40 -0
- package/dist/components/Core/Alerts/Modal/modal.svelte.d.ts +26 -0
- package/dist/components/Core/Alerts/Toast/toast.css +39 -0
- package/dist/components/Core/Alerts/Toast/toast.svelte +32 -0
- package/dist/components/Core/Alerts/Toast/toast.svelte.d.ts +26 -0
- package/dist/components/Core/Alerts/Wrapper/wrapper.svelte +19 -0
- package/dist/components/Core/Alerts/Wrapper/wrapper.svelte.d.ts +17 -0
- package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte +34 -0
- package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte.d.ts +11 -0
- package/dist/components/Core/Form/Hr/hr.svelte +11 -0
- package/dist/components/Core/Form/Hr/hr.svelte.d.ts +21 -0
- package/dist/components/Core/Form/Input/FileInput/fileInput.svelte +130 -0
- package/dist/components/Core/Form/Input/FileInput/fileInput.svelte.d.ts +6 -0
- package/dist/components/Core/Form/Input/FileInput/preview.svelte +38 -0
- package/dist/components/Core/Form/Input/FileInput/preview.svelte.d.ts +18 -0
- package/dist/components/Core/Form/Input/input/input.svelte +17 -0
- package/dist/components/Core/Form/Input/input/input.svelte.d.ts +24 -0
- package/dist/components/Core/Form/Input/password/password.svelte +27 -0
- package/dist/components/Core/Form/Input/password/password.svelte.d.ts +23 -0
- package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte +94 -0
- package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte.d.ts +9 -0
- package/dist/components/Core/Menus/MenuItem/menuItem.svelte +44 -0
- package/dist/components/Core/Menus/MenuItem/menuItem.svelte.d.ts +10 -0
- package/dist/components/Core/Menus/UserMenu/profile.svelte +35 -0
- package/dist/components/Core/Menus/UserMenu/profile.svelte.d.ts +11 -0
- package/dist/components/Core/others/Button/Flip/button.css +51 -0
- package/dist/components/Core/others/Button/Flip/button.svelte +69 -0
- package/dist/components/Core/others/Button/Flip/button.svelte.d.ts +21 -0
- package/dist/components/Core/others/Button/Marquee/button.css +37 -0
- package/dist/components/Core/others/Button/Marquee/button.svelte +45 -0
- package/dist/components/Core/others/Button/Marquee/button.svelte.d.ts +9 -0
- package/dist/components/Core/others/Button/Swipe/button.css +31 -0
- package/dist/components/Core/others/Button/Swipe/button.svelte +45 -0
- package/dist/components/Core/others/Button/Swipe/button.svelte.d.ts +17 -0
- package/dist/components/Core/others/Button/default/button.css +52 -0
- package/dist/components/Core/others/Button/default/button.svelte +112 -0
- package/dist/components/Core/others/Button/default/button.svelte.d.ts +16 -0
- package/dist/components/Core/others/Button/select/select.svelte +29 -0
- package/dist/components/Core/others/Button/select/select.svelte.d.ts +3 -0
- package/dist/components/Core/others/Button/theme/theme.css +122 -0
- package/dist/components/Core/others/Button/theme/theme.svelte +68 -0
- package/dist/components/Core/others/Button/theme/theme.svelte.d.ts +19 -0
- package/dist/components/Core/others/Button/times/times.svelte +25 -0
- package/dist/components/Core/others/Button/times/times.svelte.d.ts +6 -0
- package/dist/components/Core/others/Clock/Date/date.svelte +25 -0
- package/dist/components/Core/others/Clock/Date/date.svelte.d.ts +20 -0
- package/dist/components/Core/others/Clock/Time/time.svelte +35 -0
- package/dist/components/Core/others/Clock/Time/time.svelte.d.ts +20 -0
- package/dist/components/Core/others/Previews/Audio/audio.svelte +62 -0
- package/dist/components/Core/others/Previews/Audio/audio.svelte.d.ts +22 -0
- package/dist/components/Core/others/Previews/Document/documents.svelte +25 -0
- package/dist/components/Core/others/Previews/Document/documents.svelte.d.ts +22 -0
- package/dist/components/Core/others/Previews/Image/image.svelte +27 -0
- package/dist/components/Core/others/Previews/Image/image.svelte.d.ts +22 -0
- package/dist/components/Core/others/Previews/Video/video.svelte +29 -0
- package/dist/components/Core/others/Previews/Video/video.svelte.d.ts +24 -0
- package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte +55 -0
- package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte.d.ts +15 -0
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.css +61 -0
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte +79 -0
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte.d.ts +26 -0
- package/dist/components/Modules/Editor/Hooks/extractContent.d.ts +7 -0
- package/dist/components/Modules/Editor/Hooks/extractContent.js +15 -0
- package/dist/components/Modules/Editor/Hooks/extractImage.d.ts +7 -0
- package/dist/components/Modules/Editor/Hooks/extractImage.js +30 -0
- package/dist/components/Modules/Editor/Hooks/insertImage.d.ts +5 -0
- package/dist/components/Modules/Editor/Hooks/insertImage.js +27 -0
- package/dist/components/Modules/Editor/Hooks/insertYoutube.d.ts +6 -0
- package/dist/components/Modules/Editor/Hooks/insertYoutube.js +35 -0
- package/dist/components/Modules/Editor/Marks/Links/links.svelte +79 -0
- package/dist/components/Modules/Editor/Marks/Links/links.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte +32 -0
- package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte +58 -0
- package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/History/history.svelte +21 -0
- package/dist/components/Modules/Editor/Nodes/History/history.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/Images/images.svelte +85 -0
- package/dist/components/Modules/Editor/Nodes/Images/images.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte +30 -0
- package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte +55 -0
- package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/Nodes/TextColor/styles.css +18 -0
- package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte +88 -0
- package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte.d.ts +22 -0
- package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte +32 -0
- package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte.d.ts +21 -0
- package/dist/components/Modules/Editor/colors.d.ts +2 -0
- package/dist/components/Modules/Editor/colors.js +21 -0
- package/dist/components/Modules/Editor/controls.svelte +72 -0
- package/dist/components/Modules/Editor/controls.svelte.d.ts +24 -0
- package/dist/components/Modules/Editor/extensions.d.ts +1 -0
- package/dist/components/Modules/Editor/extensions.js +59 -0
- package/dist/components/Modules/Editor/main.svelte +42 -0
- package/dist/components/Modules/Editor/main.svelte.d.ts +25 -0
- package/dist/components/Modules/Editor/save.svelte +28 -0
- package/dist/components/Modules/Editor/save.svelte.d.ts +23 -0
- package/dist/components/Modules/Editor/styles/controls.css +70 -0
- package/dist/components/Modules/Editor/styles/main.css +43 -0
- package/dist/components/Modules/Editor/tools.d.ts +14 -0
- package/dist/components/Modules/Editor/tools.js +23 -0
- package/dist/components/Modules/FilePicker/cloudStore.svelte +96 -0
- package/dist/components/Modules/FilePicker/cloudStore.svelte.d.ts +20 -0
- package/dist/components/Modules/FilePicker/controls.svelte +122 -0
- package/dist/components/Modules/FilePicker/controls.svelte.d.ts +20 -0
- package/dist/components/Modules/FilePicker/filePicker.svelte +61 -0
- package/dist/components/Modules/FilePicker/filePicker.svelte.d.ts +18 -0
- package/dist/components/Modules/FilePicker/previews.svelte +19 -0
- package/dist/components/Modules/FilePicker/previews.svelte.d.ts +20 -0
- package/dist/components/Modules/Layout/Header/header.css +38 -0
- package/dist/components/Modules/Layout/Header/header.svelte +29 -0
- package/dist/components/Modules/Layout/Header/header.svelte.d.ts +21 -0
- package/dist/components/Modules/Layout/Menu/menu.css +45 -0
- package/dist/components/Modules/Layout/Menu/menu.svelte +129 -0
- package/dist/components/Modules/Layout/Menu/menu.svelte.d.ts +24 -0
- package/dist/components/Modules/Layout/background.svelte +28 -0
- package/dist/components/Modules/Layout/background.svelte.d.ts +26 -0
- package/dist/components/Modules/Layout/main.css +21 -0
- package/dist/components/Modules/Layout/main.svelte +119 -0
- package/dist/components/Modules/Layout/main.svelte.d.ts +27 -0
- package/dist/global.css +226 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +53 -0
- package/dist/stores/core/general.d.ts +3 -0
- package/dist/stores/core/general.js +5 -0
- package/dist/stores/core/ismobile.d.ts +1 -0
- package/dist/stores/core/ismobile.js +14 -0
- package/dist/stores/core/modal.d.ts +14 -0
- package/dist/stores/core/modal.js +35 -0
- package/dist/stores/core/user.d.ts +9 -0
- package/dist/stores/core/user.js +14 -0
- package/dist/stores/modules/editor.d.ts +9 -0
- package/dist/stores/modules/editor.js +14 -0
- package/dist/stores/modules/fileInput.d.ts +22 -0
- package/dist/stores/modules/fileInput.js +25 -0
- package/dist/stores/modules/toast.d.ts +8 -0
- package/dist/stores/modules/toast.js +21 -0
- package/package.json +75 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {PreviewAudio,PreviewDocument,PreviewImage,PreviewVideo, fileInputStore} from '../../../index.js';
|
|
3
|
+
|
|
4
|
+
export let media;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div id="file-picker-previews" style="flex-grow: 1; overflow-y: auto; padding-top: 1rem; max-height: 400px;">
|
|
8
|
+
{#if media}
|
|
9
|
+
{#if $fileInputStore.activeMenu === 'Music'}
|
|
10
|
+
<PreviewAudio {media} />
|
|
11
|
+
{:else if $fileInputStore.activeMenu === 'Documents'}
|
|
12
|
+
<PreviewDocument {media} />
|
|
13
|
+
{:else if $fileInputStore.activeMenu === 'Pictures'}
|
|
14
|
+
<PreviewImage {media} />
|
|
15
|
+
{:else if $fileInputStore.activeMenu === 'Videos'}
|
|
16
|
+
<PreviewVideo {media} />
|
|
17
|
+
{/if}
|
|
18
|
+
{/if}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Previews: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
media: any;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type Previews = InstanceType<typeof Previews>;
|
|
20
|
+
export default Previews;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#sierra-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
height: 50px;
|
|
6
|
+
border-bottom: 1px solid var(--border);
|
|
7
|
+
background-color: var(--header);
|
|
8
|
+
}
|
|
9
|
+
#sierra-header .bar {
|
|
10
|
+
width: 50px;
|
|
11
|
+
height: 3px;
|
|
12
|
+
margin: 8px auto;
|
|
13
|
+
background-color: var(--hamburger);
|
|
14
|
+
border-radius: 5px;
|
|
15
|
+
transition: 0.3s;
|
|
16
|
+
}
|
|
17
|
+
#sierra-header button:hover .bar:nth-of-type(1) {
|
|
18
|
+
-webkit-transform: translateY(1.5px) rotate(-4.5deg);
|
|
19
|
+
-ms-transform: translateY(1.5px) rotate(-4.5deg);
|
|
20
|
+
transform: translateY(1.5px) rotate(-4.5deg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#sierra-header button:hover .bar:nth-of-type(3) {
|
|
24
|
+
-webkit-transform: translateY(-1.5px) rotate(4.5deg);
|
|
25
|
+
-ms-transform: translateY(-1.5px) rotate(4.5deg);
|
|
26
|
+
transform: translateY(-1.5px) rotate(4.5deg);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#sierra-header img{
|
|
30
|
+
width: var(--header-image-size);
|
|
31
|
+
}
|
|
32
|
+
#sierra-header a:hover{
|
|
33
|
+
text-decoration: underline;
|
|
34
|
+
}
|
|
35
|
+
#sierra-header h2{
|
|
36
|
+
font-size: 1rem;
|
|
37
|
+
font-weight: normal;
|
|
38
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import './header.css';
|
|
3
|
+
const {
|
|
4
|
+
headerTitle,
|
|
5
|
+
headerLink,
|
|
6
|
+
headerImage,
|
|
7
|
+
headerImageSize,
|
|
8
|
+
toggleMenu = (() => {}),
|
|
9
|
+
headerContent,
|
|
10
|
+
} = $props();
|
|
11
|
+
</script>
|
|
12
|
+
<header id='sierra-header'>
|
|
13
|
+
<div style="display: flex; align-items: center; margin-left: 0.5rem; gap: 2rem;">
|
|
14
|
+
<button aria-label="Toggle menu" style="cursor: pointer;" onclick={toggleMenu}>
|
|
15
|
+
<div class="bar"></div>
|
|
16
|
+
<div class="bar"></div>
|
|
17
|
+
<div class="bar"></div>
|
|
18
|
+
</button>
|
|
19
|
+
<a href={headerLink} style="display: flex; align-items: center; gap: 0.5rem; color: inherit">
|
|
20
|
+
{#if headerImage}
|
|
21
|
+
<img style="--header-image-size : {headerImageSize}" src={headerImage} alt="Logo"/>
|
|
22
|
+
{/if}
|
|
23
|
+
{#if headerTitle}
|
|
24
|
+
<h2>{headerTitle}</h2>
|
|
25
|
+
{/if}
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
28
|
+
{@render headerContent?.()}
|
|
29
|
+
</header>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Header;
|
|
2
|
+
type Header = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Header: import("svelte").Component<{
|
|
7
|
+
headerTitle: any;
|
|
8
|
+
headerLink: any;
|
|
9
|
+
headerImage: any;
|
|
10
|
+
headerImageSize: any;
|
|
11
|
+
toggleMenu?: any;
|
|
12
|
+
headerContent: any;
|
|
13
|
+
}, {}, "">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
headerTitle: any;
|
|
16
|
+
headerLink: any;
|
|
17
|
+
headerImage: any;
|
|
18
|
+
headerImageSize: any;
|
|
19
|
+
toggleMenu?: any;
|
|
20
|
+
headerContent: any;
|
|
21
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#sierra-menu{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
align-items: flex-end;
|
|
6
|
+
padding: 20px 0px;
|
|
7
|
+
}
|
|
8
|
+
#sierra-menu hr{
|
|
9
|
+
color: var(--border);
|
|
10
|
+
}
|
|
11
|
+
#sierra-menu .icon-base {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 95%;
|
|
17
|
+
padding: 1px 0px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
border-top-left-radius: 40px;
|
|
20
|
+
border-bottom-left-radius: 40px;
|
|
21
|
+
}
|
|
22
|
+
#sierra-menu .icon-active {
|
|
23
|
+
background-color: var(--menu-icon-active-bg);
|
|
24
|
+
border: 1px solid var(--menu-icon-active-border);
|
|
25
|
+
border-right: unset;
|
|
26
|
+
}
|
|
27
|
+
#sierra-menu h3{
|
|
28
|
+
width: 50%;
|
|
29
|
+
font-size: 0.9rem;
|
|
30
|
+
margin-left: 10px;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
}
|
|
35
|
+
#sierra-menu i.fa-chevron-right {
|
|
36
|
+
transition: transform 0.2s;
|
|
37
|
+
}
|
|
38
|
+
#sierra-menu i.fa-chevron-right.active {
|
|
39
|
+
transform: rotate(90deg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#sierra-menu a:not(.icon-active):hover {
|
|
43
|
+
background-color: var(--menu-item-hover);
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import './menu.css';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { page } from '$app/state';
|
|
5
|
+
import { afterNavigate, beforeNavigate } from '$app/navigation';
|
|
6
|
+
import { isLoading, validateLayoutMenuSections } from '../../../../index.js';
|
|
7
|
+
|
|
8
|
+
export let toggleMenu: () => void;
|
|
9
|
+
export let closeMobileMenu: () => void;
|
|
10
|
+
export let isMenuOpen: boolean;
|
|
11
|
+
export let sections: any[];
|
|
12
|
+
|
|
13
|
+
function isParentActive(item: any, pathname: string) {
|
|
14
|
+
if (item.path === '/') {
|
|
15
|
+
return pathname === '/';
|
|
16
|
+
}
|
|
17
|
+
return pathname === item.path || pathname.startsWith(item.path + '/');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let openSubsections = new Set();
|
|
21
|
+
|
|
22
|
+
function toggleSubsection(id: string) {
|
|
23
|
+
if (!isMenuOpen){
|
|
24
|
+
toggleMenu();
|
|
25
|
+
if(openSubsections.has(id)) return;
|
|
26
|
+
}
|
|
27
|
+
if (openSubsections.has(id)) {
|
|
28
|
+
openSubsections.delete(id);
|
|
29
|
+
} else {
|
|
30
|
+
openSubsections.add(id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
openSubsections = new Set(openSubsections);
|
|
34
|
+
}
|
|
35
|
+
function syncOpenSubsectionsWithRoute(pathname: string) {
|
|
36
|
+
openSubsections.clear();
|
|
37
|
+
|
|
38
|
+
for (const section of sections) {
|
|
39
|
+
for (const item of section.items) {
|
|
40
|
+
if (!item.children) continue;
|
|
41
|
+
|
|
42
|
+
const match = item.children.some((child: any) =>
|
|
43
|
+
pathname.startsWith(child.path)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
if (match) {
|
|
47
|
+
openSubsections.add(item.id);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
openSubsections = new Set(openSubsections);
|
|
53
|
+
}
|
|
54
|
+
onMount(() => {
|
|
55
|
+
validateLayoutMenuSections(sections);
|
|
56
|
+
syncOpenSubsectionsWithRoute(page.url.pathname);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
beforeNavigate(() => isLoading.set(true));
|
|
60
|
+
afterNavigate(({ to }) => {
|
|
61
|
+
isLoading.set(false);
|
|
62
|
+
if (to) {
|
|
63
|
+
syncOpenSubsectionsWithRoute(to.url.pathname);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
</script>
|
|
68
|
+
<nav id="sierra-menu">
|
|
69
|
+
{#each sections as section, i}
|
|
70
|
+
{#if section.label}
|
|
71
|
+
<div style="width: 80%;">
|
|
72
|
+
<h3 style="font-size:small; {isMenuOpen? '':'display:none;'}">{section.label}</h3>
|
|
73
|
+
<hr/>
|
|
74
|
+
</div>
|
|
75
|
+
{/if}
|
|
76
|
+
|
|
77
|
+
{#each section.items as item}
|
|
78
|
+
<a title={item.label}
|
|
79
|
+
href={item.children ? 'javascript:void(0)' : item.path}
|
|
80
|
+
on:click={() => {
|
|
81
|
+
if (item.children) {
|
|
82
|
+
toggleSubsection(item.id);
|
|
83
|
+
}else{
|
|
84
|
+
closeMobileMenu();
|
|
85
|
+
}
|
|
86
|
+
}}
|
|
87
|
+
style="{isMenuOpen? '':'border-radius: unset;border-left: none;'}"
|
|
88
|
+
class={`
|
|
89
|
+
icon-base
|
|
90
|
+
${
|
|
91
|
+
item.children
|
|
92
|
+
? (!isMenuOpen && isParentActive(item, page.url.pathname) ? 'icon-active' : '')
|
|
93
|
+
: (isParentActive(item, page.url.pathname) ? 'icon-active' : '')
|
|
94
|
+
}
|
|
95
|
+
`}
|
|
96
|
+
|
|
97
|
+
>
|
|
98
|
+
<i class={item.icon} style="font-size: 15px; color: var(--icon-theme)"></i>
|
|
99
|
+
<h3 style="{isMenuOpen ? '':'display:none'}">{item.label}</h3>
|
|
100
|
+
{#if item.children}
|
|
101
|
+
<i
|
|
102
|
+
class={`fa fa-chevron-right ${openSubsections.has(item.id) ? 'active' : ''}`}
|
|
103
|
+
style="position: absolute; right: 10px; font-size: 12px; {isMenuOpen ? '':'display:none'}"
|
|
104
|
+
></i>
|
|
105
|
+
{/if}
|
|
106
|
+
</a>
|
|
107
|
+
{#if item.children && openSubsections.has(item.id) && isMenuOpen}
|
|
108
|
+
<div style="width: 75%; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px">
|
|
109
|
+
{#each item.children as child}
|
|
110
|
+
<a
|
|
111
|
+
title={child.label}
|
|
112
|
+
href={child.path}
|
|
113
|
+
on:click={closeMobileMenu}
|
|
114
|
+
class={`
|
|
115
|
+
icon-base
|
|
116
|
+
${page.url.pathname.startsWith(child.path) ? 'icon-active' : ''}
|
|
117
|
+
`}
|
|
118
|
+
style="margin-left: 10px"
|
|
119
|
+
>
|
|
120
|
+
<h3 style="{isMenuOpen ? '':'display:none'}">
|
|
121
|
+
{child.label}
|
|
122
|
+
</h3>
|
|
123
|
+
</a>
|
|
124
|
+
{/each}
|
|
125
|
+
</div>
|
|
126
|
+
{/if}
|
|
127
|
+
{/each}
|
|
128
|
+
{/each}
|
|
129
|
+
</nav>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './menu.css';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Menu: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
toggleMenu: () => void;
|
|
17
|
+
closeMobileMenu: () => void;
|
|
18
|
+
isMenuOpen: boolean;
|
|
19
|
+
sections: any[];
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type Menu = InstanceType<typeof Menu>;
|
|
24
|
+
export default Menu;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.background-svg {
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
z-index: -1;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
|
|
12
|
+
<svg class="background-svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid slice">
|
|
13
|
+
<defs>
|
|
14
|
+
<linearGradient id="lineGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
15
|
+
<stop offset="0%" stop-color="var(--background-v1-gradient-line-start)" />
|
|
16
|
+
<stop offset="100%" stop-color="var(--background-v1-gradient-line-end)" />
|
|
17
|
+
</linearGradient>
|
|
18
|
+
</defs>
|
|
19
|
+
<line x1="100" y1="0" x2="100" y2="1000" stroke="url(#lineGradient)" stroke-width="2" opacity="0.3" />
|
|
20
|
+
<line x1="300" y1="0" x2="250" y2="1000" stroke="url(#lineGradient)" stroke-width="1.5" opacity="0.2" />
|
|
21
|
+
<line x1="700" y1="0" x2="750" y2="1000" stroke="url(#lineGradient)" stroke-width="1.5" opacity="0.2" />
|
|
22
|
+
<line x1="900" y1="0" x2="900" y2="1000" stroke="url(#lineGradient)" stroke-width="2" opacity="0.3" />
|
|
23
|
+
|
|
24
|
+
<line x1="0" y1="200" x2="1000" y2="200" stroke="url(#lineGradient)" stroke-width="1" opacity="0.15" />
|
|
25
|
+
<line x1="0" y1="400" x2="1000" y2="450" stroke="url(#lineGradient)" stroke-width="1.5" opacity="0.2" />
|
|
26
|
+
<line x1="0" y1="650" x2="1000" y2="600" stroke="url(#lineGradient)" stroke-width="1" opacity="0.15" />
|
|
27
|
+
<line x1="0" y1="850" x2="1000" y2="850" stroke="url(#lineGradient)" stroke-width="2" opacity="0.25" />
|
|
28
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Background;
|
|
2
|
+
type Background = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Background: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#sierra-layout{
|
|
2
|
+
display: flex;
|
|
3
|
+
height: calc(100vh - 50px);
|
|
4
|
+
}
|
|
5
|
+
#sierra-layout .menu{
|
|
6
|
+
height: 100%;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
background-color: var(--sierra-menu);
|
|
9
|
+
border-right: 1px solid var(--border);
|
|
10
|
+
z-index: 10;
|
|
11
|
+
}
|
|
12
|
+
#sierra-layout .content{
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
}
|
|
18
|
+
#sierra-wrapper{
|
|
19
|
+
margin: 0 auto;
|
|
20
|
+
max-width: 56rem;
|
|
21
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import './main.css';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import {LinearProgress, isLoading, isMobile, Modal, Toast, theme,FilePicker, User, isLoggedIn} from '../../../index.js'
|
|
5
|
+
import Header from './Header/header.svelte';
|
|
6
|
+
import Menu from './Menu/menu.svelte';
|
|
7
|
+
import Background from './background.svelte';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
children,
|
|
11
|
+
headerTitle = '',
|
|
12
|
+
headerLink = '',
|
|
13
|
+
headerImage = '',
|
|
14
|
+
headerImageSize = '30px',
|
|
15
|
+
sections = [],
|
|
16
|
+
contentCenter = false,
|
|
17
|
+
headerContent = null,
|
|
18
|
+
paddingOff = false,
|
|
19
|
+
} = $props();
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
let isMenuOpen = $state(false);
|
|
23
|
+
$effect(() => {
|
|
24
|
+
if ($isMobile) isMenuOpen = false;
|
|
25
|
+
if ($theme){
|
|
26
|
+
document.body.setAttribute('data-theme', $theme);
|
|
27
|
+
localStorage.setItem('theme', $theme);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
onMount(() => {
|
|
32
|
+
if (typeof localStorage !== 'undefined') {
|
|
33
|
+
if(!$isMobile){
|
|
34
|
+
const stored = localStorage.getItem('isMenuOpen');
|
|
35
|
+
if (stored === null) {
|
|
36
|
+
localStorage.setItem('isMenuOpen', 'true');
|
|
37
|
+
isMenuOpen = true;
|
|
38
|
+
} else {
|
|
39
|
+
isMenuOpen = stored === 'true';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const storedTheme = localStorage.getItem('theme');
|
|
43
|
+
if (storedTheme) {
|
|
44
|
+
theme.set(storedTheme);
|
|
45
|
+
document.body.setAttribute('data-theme', storedTheme);
|
|
46
|
+
} else {
|
|
47
|
+
theme.set('dark');
|
|
48
|
+
localStorage.setItem('theme', 'dark');
|
|
49
|
+
document.body.setAttribute('data-theme', 'dark');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const anonId = localStorage.getItem('anonymous_id');
|
|
53
|
+
if(!$isLoggedIn){
|
|
54
|
+
if (!anonId) {
|
|
55
|
+
const newId = crypto.randomUUID();
|
|
56
|
+
localStorage.setItem('anonymous_id', newId);
|
|
57
|
+
User.update(user => ({ ...user, userId: newId }));
|
|
58
|
+
}else if(anonId) {
|
|
59
|
+
User.update(user => ({ ...user, userId: anonId }) );
|
|
60
|
+
//console.log("Updated User store with user id:", $User);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const toggleMenu = () => {
|
|
67
|
+
isMenuOpen = !isMenuOpen;
|
|
68
|
+
if($isMobile) return;
|
|
69
|
+
if (typeof localStorage !== 'undefined') {
|
|
70
|
+
localStorage.setItem('isMenuOpen', isMenuOpen.toString());
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const closeMobileMenu = () => {
|
|
74
|
+
if ($isMobile && isMenuOpen) isMenuOpen = false;
|
|
75
|
+
};
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<main style="height: 100vh;">
|
|
79
|
+
<Modal />
|
|
80
|
+
<Toast />
|
|
81
|
+
<FilePicker />
|
|
82
|
+
<Header
|
|
83
|
+
{headerTitle}
|
|
84
|
+
{headerLink}
|
|
85
|
+
{headerImage}
|
|
86
|
+
{headerImageSize}
|
|
87
|
+
{toggleMenu}
|
|
88
|
+
{headerContent}
|
|
89
|
+
/>
|
|
90
|
+
{#if $isLoading}<LinearProgress />{/if}
|
|
91
|
+
<div id="sierra-layout">
|
|
92
|
+
<div
|
|
93
|
+
class="menu"
|
|
94
|
+
data-label="Menu Container"
|
|
95
|
+
style={
|
|
96
|
+
$isMobile
|
|
97
|
+
? `width:300px; transform: translateX(${isMenuOpen ? '0%' : '-100%'}); transition: transform 0.3s ease; position: fixed; left: 0; padding-bottom: 50px`
|
|
98
|
+
: `width: ${isMenuOpen ? '300px' : '70px'}; transition: width 0.3s ease;`
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
<Menu
|
|
102
|
+
{sections}
|
|
103
|
+
{isMenuOpen}
|
|
104
|
+
{toggleMenu}
|
|
105
|
+
{closeMobileMenu}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<div data-label="Content Container" class="content" role="none" onclick={closeMobileMenu} style={paddingOff ? 'padding: 0px;' : 'padding: 20px'}>
|
|
109
|
+
<Background />
|
|
110
|
+
{#if contentCenter}
|
|
111
|
+
<div id='sierra-wrapper'>
|
|
112
|
+
{@render children()}
|
|
113
|
+
</div>
|
|
114
|
+
{:else}
|
|
115
|
+
{@render children()}
|
|
116
|
+
{/if}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</main>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default Main;
|
|
2
|
+
type Main = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Main: import("svelte").Component<{
|
|
7
|
+
children: any;
|
|
8
|
+
headerTitle?: string;
|
|
9
|
+
headerLink?: string;
|
|
10
|
+
headerImage?: string;
|
|
11
|
+
headerImageSize?: string;
|
|
12
|
+
sections?: any[];
|
|
13
|
+
contentCenter?: boolean;
|
|
14
|
+
headerContent?: any;
|
|
15
|
+
paddingOff?: boolean;
|
|
16
|
+
}, {}, "">;
|
|
17
|
+
type $$ComponentProps = {
|
|
18
|
+
children: any;
|
|
19
|
+
headerTitle?: string;
|
|
20
|
+
headerLink?: string;
|
|
21
|
+
headerImage?: string;
|
|
22
|
+
headerImageSize?: string;
|
|
23
|
+
sections?: any[];
|
|
24
|
+
contentCenter?: boolean;
|
|
25
|
+
headerContent?: any;
|
|
26
|
+
paddingOff?: boolean;
|
|
27
|
+
};
|