sveltekit-ui 1.0.38 → 1.0.40

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.
@@ -6,14 +6,13 @@ export function create_code_manager(config) {
6
6
  let content = $derived(set_closurable(config?.content, null))
7
7
  let copy_button_manager = $state(null)
8
8
 
9
- function init(config) {
9
+ function init() {
10
10
  copy_button_manager = create_button_manager({
11
11
  type: "soft",
12
12
  is_uniform: true,
13
13
  support_icon: "clipboard",
14
14
  is_success_animation: true,
15
- on_click: () =>
16
- copy_to_clipboard(typeof config?.content == "string" ? config?.content : JSON.stringify(config?.content)),
15
+ on_click: () => copy_to_clipboard(typeof content == "string" ? content : JSON.stringify(content)),
17
16
  })
18
17
  }
19
18
 
@@ -9,27 +9,22 @@
9
9
  let { manager } = $props()
10
10
  </script>
11
11
 
12
- {#snippet display_val(input)}
13
- {#if Array.isArray(input) && input.length > 0}
14
- {#each input as input_item}
15
- <div style="display: flex; gap: 1rem; align-items: center;">
16
- <p>{input_item?.file_name}</p>
17
- <p style="color: var(--g10-t); font-size: 1.2rem;">{input_item?.mime_type}</p>
18
- </div>
19
- <DisplayFile manager={input_item} />
20
- {/each}
21
- {:else}
22
- {@render display_file(input)}
23
- {/if}
24
- {/snippet}
25
-
26
12
  <div style="margin-top: {manager?.mt}rem; margin-bottom: {manager?.mb}rem;">
27
13
  {#if manager?.is_show_button}
28
14
  <Button manager={manager?.select_file_from_storage_button_manager} />
29
15
  {/if}
30
16
  {#if manager?.is_show_content}
31
17
  <div style="margin-top: 1rem;">
32
- <DisplayFile manager={manager?.display_file} />
18
+ {#if Array.isArray(manager?.display_file) && manager?.display_file.length > 0}
19
+ {#each manager?.display_file as input_item}
20
+ <div style="display: flex; gap: 1rem; align-items: center;">
21
+ <p>{input_item?.file_name}</p>
22
+ <p style="color: var(--g10-t); font-size: 1.2rem;">{input_item?.mime_type}</p>
23
+ </div>
24
+ <DisplayFile manager={input_item} />
25
+ {/each}
26
+ {:else}<DisplayFile manager={manager?.display_file} />
27
+ {/if}
33
28
  </div>
34
29
  {/if}
35
30
  <Popover manager={manager?.popover_manager}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-ui",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "A SvelteKit UI component library for building modern web applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -6,14 +6,13 @@ export function create_code_manager(config) {
6
6
  let content = $derived(set_closurable(config?.content, null))
7
7
  let copy_button_manager = $state(null)
8
8
 
9
- function init(config) {
9
+ function init() {
10
10
  copy_button_manager = create_button_manager({
11
11
  type: "soft",
12
12
  is_uniform: true,
13
13
  support_icon: "clipboard",
14
14
  is_success_animation: true,
15
- on_click: () =>
16
- copy_to_clipboard(typeof config?.content == "string" ? config?.content : JSON.stringify(config?.content)),
15
+ on_click: () => copy_to_clipboard(typeof content == "string" ? content : JSON.stringify(content)),
17
16
  })
18
17
  }
19
18
 
@@ -9,27 +9,22 @@
9
9
  let { manager } = $props()
10
10
  </script>
11
11
 
12
- {#snippet display_val(input)}
13
- {#if Array.isArray(input) && input.length > 0}
14
- {#each input as input_item}
15
- <div style="display: flex; gap: 1rem; align-items: center;">
16
- <p>{input_item?.file_name}</p>
17
- <p style="color: var(--g10-t); font-size: 1.2rem;">{input_item?.mime_type}</p>
18
- </div>
19
- <DisplayFile manager={input_item} />
20
- {/each}
21
- {:else}
22
- {@render display_file(input)}
23
- {/if}
24
- {/snippet}
25
-
26
12
  <div style="margin-top: {manager?.mt}rem; margin-bottom: {manager?.mb}rem;">
27
13
  {#if manager?.is_show_button}
28
14
  <Button manager={manager?.select_file_from_storage_button_manager} />
29
15
  {/if}
30
16
  {#if manager?.is_show_content}
31
17
  <div style="margin-top: 1rem;">
32
- <DisplayFile manager={manager?.display_file} />
18
+ {#if Array.isArray(manager?.display_file) && manager?.display_file.length > 0}
19
+ {#each manager?.display_file as input_item}
20
+ <div style="display: flex; gap: 1rem; align-items: center;">
21
+ <p>{input_item?.file_name}</p>
22
+ <p style="color: var(--g10-t); font-size: 1.2rem;">{input_item?.mime_type}</p>
23
+ </div>
24
+ <DisplayFile manager={input_item} />
25
+ {/each}
26
+ {:else}<DisplayFile manager={manager?.display_file} />
27
+ {/if}
33
28
  </div>
34
29
  {/if}
35
30
  <Popover manager={manager?.popover_manager}>