@sierra-95/svelte-scaffold 1.0.7 → 1.0.9

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 (88) hide show
  1. package/README.md +8 -8
  2. package/dist/Hooks/preview.d.ts +1 -0
  3. package/dist/Hooks/preview.js +7 -0
  4. package/dist/components/Core/Alerts/Backdrop/backdrop.svelte +26 -26
  5. package/dist/components/Core/Alerts/Modal/modal.svelte +40 -40
  6. package/dist/components/Core/Alerts/Toast/toast.css +38 -38
  7. package/dist/components/Core/Alerts/Toast/toast.svelte +32 -32
  8. package/dist/components/Core/Alerts/Wrapper/wrapper.svelte +18 -18
  9. package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte +33 -33
  10. package/dist/components/Core/Form/Hr/hr.svelte +10 -10
  11. package/dist/components/Core/Form/Input/FileInput/fileInput.svelte +158 -130
  12. package/dist/components/Core/Form/Input/FileInput/preview.svelte +50 -37
  13. package/dist/components/Core/Form/Input/SearchBar/search.svelte +68 -68
  14. package/dist/components/Core/Form/Input/input/input.svelte +16 -16
  15. package/dist/components/Core/Form/Input/password/password.svelte +26 -26
  16. package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte +94 -94
  17. package/dist/components/Core/Menus/MenuItem/menuItem.svelte +43 -43
  18. package/dist/components/Core/Menus/UserMenu/profile.svelte +34 -34
  19. package/dist/components/Core/others/Button/Flip/button.css +50 -50
  20. package/dist/components/Core/others/Button/Flip/button.svelte +79 -69
  21. package/dist/components/Core/others/Button/Flip/button.svelte.d.ts +6 -15
  22. package/dist/components/Core/others/Button/Marquee/button.css +36 -36
  23. package/dist/components/Core/others/Button/Marquee/button.svelte +58 -45
  24. package/dist/components/Core/others/Button/Marquee/button.svelte.d.ts +4 -2
  25. package/dist/components/Core/others/Button/Swipe/button.css +32 -35
  26. package/dist/components/Core/others/Button/Swipe/button.svelte +58 -49
  27. package/dist/components/Core/others/Button/Swipe/button.svelte.d.ts +6 -13
  28. package/dist/components/Core/others/Button/default/button.css +60 -77
  29. package/dist/components/Core/others/Button/default/button.svelte +124 -139
  30. package/dist/components/Core/others/Button/select/select.svelte +28 -28
  31. package/dist/components/Core/others/Button/theme/theme.css +121 -121
  32. package/dist/components/Core/others/Button/theme/theme.svelte +67 -67
  33. package/dist/components/Core/others/Button/times/times.svelte +24 -24
  34. package/dist/components/Core/others/Clock/Date/date.svelte +25 -25
  35. package/dist/components/Core/others/Clock/Time/time.svelte +35 -35
  36. package/dist/components/Core/others/Previews/Audio/audio.svelte +61 -61
  37. package/dist/components/Core/others/Previews/Document/documents.svelte +36 -24
  38. package/dist/components/Core/others/Previews/GenericFile/genericFile.svelte +26 -0
  39. package/dist/components/Core/others/Previews/GenericFile/genericFile.svelte.d.ts +22 -0
  40. package/dist/components/Core/others/Previews/Image/image.svelte +26 -26
  41. package/dist/components/Core/others/Previews/Video/video.svelte +28 -28
  42. package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte +55 -55
  43. package/dist/components/Core/others/Progress/CustomProgress/customProgress.svelte +64 -64
  44. package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.css +60 -60
  45. package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte +86 -86
  46. package/dist/components/Modules/Editor/Hooks/extractContent.js +14 -14
  47. package/dist/components/Modules/Editor/Hooks/extractImage.js +30 -30
  48. package/dist/components/Modules/Editor/Hooks/insertImage.js +26 -26
  49. package/dist/components/Modules/Editor/Hooks/insertYoutube.js +34 -34
  50. package/dist/components/Modules/Editor/Marks/Links/links.svelte +78 -78
  51. package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte +32 -32
  52. package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte +58 -58
  53. package/dist/components/Modules/Editor/Nodes/History/history.svelte +21 -21
  54. package/dist/components/Modules/Editor/Nodes/Images/images.svelte +85 -85
  55. package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte +30 -30
  56. package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte +55 -55
  57. package/dist/components/Modules/Editor/Nodes/TextColor/styles.css +18 -18
  58. package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte +88 -88
  59. package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte +32 -32
  60. package/dist/components/Modules/Editor/colors.js +21 -21
  61. package/dist/components/Modules/Editor/controls.svelte +71 -71
  62. package/dist/components/Modules/Editor/extensions.js +59 -59
  63. package/dist/components/Modules/Editor/main.svelte +41 -41
  64. package/dist/components/Modules/Editor/save.svelte +28 -28
  65. package/dist/components/Modules/Editor/styles/controls.css +68 -72
  66. package/dist/components/Modules/Editor/styles/main.css +42 -42
  67. package/dist/components/Modules/Editor/tools.js +22 -22
  68. package/dist/components/Modules/FilePicker/cloudStore.svelte +98 -96
  69. package/dist/components/Modules/FilePicker/controls.svelte +140 -121
  70. package/dist/components/Modules/FilePicker/filePicker.svelte +59 -60
  71. package/dist/components/Modules/FilePicker/previews.svelte +22 -18
  72. package/dist/components/Modules/Layout/Header/header.css +37 -37
  73. package/dist/components/Modules/Layout/Header/header.svelte +31 -31
  74. package/dist/components/Modules/Layout/Menu/menu.css +53 -53
  75. package/dist/components/Modules/Layout/Menu/menu.svelte +129 -129
  76. package/dist/components/Modules/Layout/background.svelte +28 -28
  77. package/dist/components/Modules/Layout/collapse.svelte +24 -24
  78. package/dist/components/Modules/Layout/main.css +31 -31
  79. package/dist/components/Modules/Layout/main.svelte +110 -122
  80. package/dist/global.css +246 -219
  81. package/dist/index.d.ts +2 -1
  82. package/dist/index.js +2 -1
  83. package/dist/stores/core/general.js +4 -4
  84. package/dist/stores/core/ismobile.js +14 -14
  85. package/dist/stores/core/modal.js +35 -35
  86. package/dist/stores/modules/fileInput.d.ts +3 -3
  87. package/dist/stores/modules/fileInput.js +1 -1
  88. package/package.json +75 -75
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # @sierra-95/svelte-scaffold
2
- [![Alt text](https://files.michaelmachohi.com/logos/michaelmachohi.favicon.png)](https://michaelmachohi.com)
3
- [![npm version](https://img.shields.io/npm/v/@sierra-95/svelte-scaffold.svg)](https://www.npmjs.com/package/@sierra-95/svelte-scaffold)
4
- [![npm downloads](https://img.shields.io/npm/dm/@sierra-95/svelte-scaffold.svg)](https://www.npmjs.com/package/@sierra-95/svelte-ui)
5
-
6
- ## Documentation
7
- Full documentation: [https://svelte.michaelmachohi.com](https://svelte.michaelmachohi.com)
8
-
1
+ # @sierra-95/svelte-scaffold
2
+ [![Alt text](https://files.michaelmachohi.com/logos/michaelmachohi.favicon.png)](https://michaelmachohi.com)
3
+ [![npm version](https://img.shields.io/npm/v/@sierra-95/svelte-scaffold.svg)](https://www.npmjs.com/package/@sierra-95/svelte-scaffold)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@sierra-95/svelte-scaffold.svg)](https://www.npmjs.com/package/@sierra-95/svelte-ui)
5
+
6
+ ## Documentation
7
+ Full documentation: [https://svelte.michaelmachohi.com](https://svelte.michaelmachohi.com)
8
+
@@ -1,3 +1,4 @@
1
1
  export declare function getPreviewUrlForMedia(file: File): string;
2
2
  export declare function toggleSelectForMedia(id: string, url: string, urlsOnly: boolean): void;
3
3
  export declare function removeFileForMedia(index: number, e: Event): void;
4
+ export declare const DOCUMENT_MIME_TYPES: Set<string>;
@@ -22,3 +22,10 @@ export function removeFileForMedia(index, e) {
22
22
  selectedFiles: state.selectedFiles.filter((_, i) => i !== index)
23
23
  }));
24
24
  }
25
+ export const DOCUMENT_MIME_TYPES = new Set([
26
+ 'application/pdf',
27
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
28
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
29
+ 'application/vnd.ms-excel',
30
+ 'text/plain'
31
+ ]);
@@ -1,27 +1,27 @@
1
- <script>
2
- let {
3
- open = $bindable(false),
4
- zIndex = 15,
5
- children
6
- } = $props();
7
- </script>
8
- <style>
9
- #sierra-blur {
10
- position: fixed;
11
- top: 0;
12
- right: 0;
13
- bottom: 0;
14
- left: 0;
15
- background-color: rgba(0, 0, 0, 0.3);
16
- display: flex;
17
- align-items: center;
18
- justify-content: center;
19
- padding: 1rem;
20
- backdrop-filter: blur(2px);
21
- }
22
- </style>
23
- {#if open}
24
- <div id="sierra-blur" style="z-index: {zIndex};">
25
- {@render children?.()}
26
- </div>
1
+ <script>
2
+ let {
3
+ open = $bindable(false),
4
+ zIndex = 15,
5
+ children
6
+ } = $props();
7
+ </script>
8
+ <style>
9
+ #sierra-blur {
10
+ position: fixed;
11
+ top: 0;
12
+ right: 0;
13
+ bottom: 0;
14
+ left: 0;
15
+ background-color: rgba(0, 0, 0, 0.3);
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ padding: 1rem;
20
+ backdrop-filter: blur(2px);
21
+ }
22
+ </style>
23
+ {#if open}
24
+ <div id="sierra-blur" style="z-index: {zIndex};">
25
+ {@render children?.()}
26
+ </div>
27
27
  {/if}
@@ -1,40 +1,40 @@
1
- <script>
2
- import { modalStore, Button, Backdrop, Wrapper, resetModalStore} from '../../../../index.js';
3
- import { onMount } from 'svelte';
4
-
5
- function close() {
6
- resetModalStore();
7
- }
8
- /**
9
- * @param {{ key: string; }} e
10
- */
11
- function handleKeydown(e) {
12
- if (e.key === 'Escape') close();
13
- }
14
-
15
- onMount(() => {
16
- window.addEventListener('keydown', handleKeydown);
17
- return () => window.removeEventListener('keydown', handleKeydown);
18
- });
19
- </script>
20
-
21
-
22
- <Backdrop bind:open={$modalStore.open} zIndex={20}>
23
- <Wrapper>
24
- <h2 style="font-size: 1.3rem;">{$modalStore.title}</h2>
25
- {#if $modalStore?.content}
26
- <h3 style="font-size: 1rem;">{$modalStore.content}</h3>
27
- {/if}
28
- {@render $modalStore.render?.()}
29
- <div style="display: flex; gap: 30px; margin-top: 20px;">
30
- <Button onclick={() => { $modalStore.onConfirm?.(); close();}}>
31
- {$modalStore.confirmText}
32
- </Button>
33
- {#if $modalStore.cancelText}
34
- <button onclick={() => {$modalStore.onCancel?.();close();}}
35
- >{$modalStore.cancelText}
36
- </button>
37
- {/if}
38
- </div>
39
- </Wrapper>
40
- </Backdrop>
1
+ <script>
2
+ import { modalStore, Button, Backdrop, Wrapper, resetModalStore} from '../../../../index.js';
3
+ import { onMount } from 'svelte';
4
+
5
+ function close() {
6
+ resetModalStore();
7
+ }
8
+ /**
9
+ * @param {{ key: string; }} e
10
+ */
11
+ function handleKeydown(e) {
12
+ if (e.key === 'Escape') close();
13
+ }
14
+
15
+ onMount(() => {
16
+ window.addEventListener('keydown', handleKeydown);
17
+ return () => window.removeEventListener('keydown', handleKeydown);
18
+ });
19
+ </script>
20
+
21
+
22
+ <Backdrop bind:open={$modalStore.open} zIndex={20}>
23
+ <Wrapper>
24
+ <h2 style="font-size: 1.3rem;">{$modalStore.title}</h2>
25
+ {#if $modalStore?.content}
26
+ <h3 style="font-size: 1rem;">{$modalStore.content}</h3>
27
+ {/if}
28
+ {@render $modalStore.render?.()}
29
+ <div style="display: flex; gap: 30px; margin-top: 20px;">
30
+ <Button onclick={() => { $modalStore.onConfirm?.(); close();}}>
31
+ {$modalStore.confirmText}
32
+ </Button>
33
+ {#if $modalStore.cancelText}
34
+ <button onclick={() => {$modalStore.onCancel?.();close();}}
35
+ >{$modalStore.cancelText}
36
+ </button>
37
+ {/if}
38
+ </div>
39
+ </Wrapper>
40
+ </Backdrop>
@@ -1,39 +1,39 @@
1
- #toast{
2
- position: fixed;
3
- top: 80px;
4
- right: 20px;
5
- width: 300px;
6
- border-top-right-radius: 5px;
7
- border-bottom-right-radius: 5px;
8
- border-left: 6px solid var(--retval);
9
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
10
- background-color: var(--background-secondary);
11
- z-index: 25;
12
- }
13
- #toast div:nth-child(1){
14
- display: flex;
15
- align-items: center;
16
- justify-content: space-between;
17
- font-weight: bold;
18
- color: var(--retval);
19
- padding: 5px 5px 5px 10px;
20
- }
21
- #toast div:nth-child(1) div{
22
- display: flex;
23
- align-items: center;
24
- gap: 10px;
25
- }
26
- #toast div:nth-child(2){
27
- padding: 0px 5px 5px 20px;
28
- }
29
- #toast p {
30
- max-width: 250px;
31
- white-space: normal;
32
- overflow-wrap: break-word;
33
- word-break: normal;
34
- }
35
- #toast i.fa-times{
36
- color: var(--text);
37
- cursor: pointer;
38
- padding-right: 20px;
1
+ #toast{
2
+ position: fixed;
3
+ top: 80px;
4
+ right: 20px;
5
+ width: 300px;
6
+ border-top-right-radius: 5px;
7
+ border-bottom-right-radius: 5px;
8
+ border-left: 6px solid var(--retval);
9
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
10
+ background-color: var(--background-secondary);
11
+ z-index: 25;
12
+ }
13
+ #toast div:nth-child(1){
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: space-between;
17
+ font-weight: bold;
18
+ color: var(--retval);
19
+ padding: 5px 5px 5px 10px;
20
+ }
21
+ #toast div:nth-child(1) div{
22
+ display: flex;
23
+ align-items: center;
24
+ gap: 10px;
25
+ }
26
+ #toast div:nth-child(2){
27
+ padding: 0px 5px 5px 20px;
28
+ }
29
+ #toast p {
30
+ max-width: 250px;
31
+ white-space: normal;
32
+ overflow-wrap: break-word;
33
+ word-break: normal;
34
+ }
35
+ #toast i.fa-times{
36
+ color: var(--text);
37
+ cursor: pointer;
38
+ padding-right: 20px;
39
39
  }
@@ -1,32 +1,32 @@
1
- <script>
2
- import './toast.css';
3
- import {toastCarrier, clearToastMessage} from '../../../../index.js';
4
-
5
- const statusClass = {
6
- info: 'var(--primary-bg)',
7
- success: 'var(--primary-bg)',
8
- error: 'var(--error-bg)',
9
- warning: 'var(--warning-bg)'
10
- };
11
- $: retval = statusClass[$toastCarrier.status]
12
- </script>
13
- {#if $toastCarrier.message}
14
- <div id="toast" style="--retval: {retval};">
15
- <div>
16
- <div>
17
- {#if $toastCarrier.status === 'info'}
18
- <i class="fa-solid fa-circle-info"></i>
19
- {:else if $toastCarrier.status === 'success'}
20
- <i class="fa-solid fa-circle-check"></i>
21
- {:else if $toastCarrier.status === 'error'}
22
- <i class="fa-solid fa-circle-xmark"></i>
23
- {:else if $toastCarrier.status === 'warning'}
24
- <i class="fa-solid fa-triangle-exclamation"></i>
25
- {/if}
26
- <p>{$toastCarrier.status}</p>
27
- </div>
28
- <i on:click={clearToastMessage} role="none" class="fa-solid fa-times"></i>
29
- </div>
30
- <div>{ $toastCarrier.message }</div>
31
- </div>
32
- {/if}
1
+ <script>
2
+ import './toast.css';
3
+ import {toastCarrier, clearToastMessage} from '../../../../index.js';
4
+
5
+ const statusClass = {
6
+ info: 'var(--primary-bg)',
7
+ success: 'var(--primary-bg)',
8
+ error: 'var(--error-bg)',
9
+ warning: 'var(--warning-bg)'
10
+ };
11
+ $: retval = statusClass[$toastCarrier.status]
12
+ </script>
13
+ {#if $toastCarrier.message}
14
+ <div id="toast" style="--retval: {retval};">
15
+ <div>
16
+ <div>
17
+ {#if $toastCarrier.status === 'info'}
18
+ <i class="fa-solid fa-circle-info"></i>
19
+ {:else if $toastCarrier.status === 'success'}
20
+ <i class="fa-solid fa-circle-check"></i>
21
+ {:else if $toastCarrier.status === 'error'}
22
+ <i class="fa-solid fa-circle-xmark"></i>
23
+ {:else if $toastCarrier.status === 'warning'}
24
+ <i class="fa-solid fa-triangle-exclamation"></i>
25
+ {/if}
26
+ <p>{$toastCarrier.status}</p>
27
+ </div>
28
+ <i on:click={clearToastMessage} role="none" class="fa-solid fa-times"></i>
29
+ </div>
30
+ <div>{ $toastCarrier.message }</div>
31
+ </div>
32
+ {/if}
@@ -1,19 +1,19 @@
1
- <script>
2
- let {
3
- padding = '20px',
4
- minHeight = '100px',
5
- maxWidth = '500px',
6
- children
7
- } = $props();
8
- </script>
9
- <style>
10
- #sierra-wrapper {
11
- background-color: var(--background-secondary);
12
- border-radius: 5px;
13
- box-shadow: var(--box-shadow);
14
- width: 100%;
15
- }
16
- </style>
17
- <div id="sierra-wrapper" role='none' style="max-width: {maxWidth}; min-height: {minHeight}; padding: {padding};" onclick={e => e.stopPropagation()}>
18
- {@render children?.()}
1
+ <script>
2
+ let {
3
+ padding = '20px',
4
+ minHeight = '100px',
5
+ maxWidth = '500px',
6
+ children
7
+ } = $props();
8
+ </script>
9
+ <style>
10
+ #sierra-wrapper {
11
+ background-color: var(--background-secondary);
12
+ border-radius: 5px;
13
+ box-shadow: var(--box-shadow);
14
+ width: 100%;
15
+ }
16
+ </style>
17
+ <div id="sierra-wrapper" role='none' style="max-width: {maxWidth}; min-height: {minHeight}; padding: {padding};" onclick={e => e.stopPropagation()}>
18
+ {@render children?.()}
19
19
  </div>
@@ -1,34 +1,34 @@
1
- <script>
2
- const {email} = $props();
3
- </script>
4
- <style>
5
- #maintenance {
6
- position: fixed;
7
- top: 0;
8
- right: 0;
9
- bottom: 0;
10
- left: 0;
11
- background-color: rgba(0, 0, 0, 0.7);
12
- display: flex;
13
- flex-direction: column;
14
- align-items: center;
15
- justify-content: center;
16
- gap: 10px;
17
- padding: 1rem;
18
- z-index: 5;
19
- backdrop-filter: blur(2px);
20
- color: white;
21
- }
22
- #maintenance a{
23
- text-decoration: underline;
24
- }
25
- </style>
26
-
27
- <div id="maintenance">
28
- <h1>Under Construction</h1>
29
- <p>This site is still being built and will be available soon. Thanks for your patience.</p>
30
- <p>
31
- Need immediate assistance?<br>
32
- Contact <a href="mailto:{email}">{email}</a>
33
- </p>
1
+ <script>
2
+ const {email} = $props();
3
+ </script>
4
+ <style>
5
+ #maintenance {
6
+ position: fixed;
7
+ top: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ background-color: rgba(0, 0, 0, 0.7);
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ gap: 10px;
17
+ padding: 1rem;
18
+ z-index: 5;
19
+ backdrop-filter: blur(2px);
20
+ color: white;
21
+ }
22
+ #maintenance a{
23
+ text-decoration: underline;
24
+ }
25
+ </style>
26
+
27
+ <div id="maintenance">
28
+ <h1>Under Construction</h1>
29
+ <p>This site is still being built and will be available soon. Thanks for your patience.</p>
30
+ <p>
31
+ Need immediate assistance?<br>
32
+ Contact <a href="mailto:{email}">{email}</a>
33
+ </p>
34
34
  </div>
@@ -1,11 +1,11 @@
1
- <script lang="ts">
2
- export let width: string = "100%";
3
- export let color: string = "var(--text-tertiary)";
4
- </script>
5
-
6
- <style>
7
- #sierra-hr {
8
- margin: auto;
9
- }
10
- </style>
1
+ <script lang="ts">
2
+ export let width: string = "100%";
3
+ export let color: string = "var(--text-tertiary)";
4
+ </script>
5
+
6
+ <style>
7
+ #sierra-hr {
8
+ margin: auto;
9
+ }
10
+ </style>
11
11
  <hr id="sierra-hr" style="width: {width}; color: {color};"/>