sve-ui 0.0.6 → 0.0.8

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.
@@ -2,15 +2,17 @@
2
2
  export let typeCodeLabel = 'Sve-UI';
3
3
 
4
4
  let copied = false;
5
- let text = globalThis?.document?.getElementById('textCode')?.innerHTML || '';
5
+ let text = globalThis?.document?.getElementById('textCode')?.textContent;
6
6
 
7
7
  const copyToClipboard = async () => {
8
8
  try {
9
- await navigator.clipboard.writeText(text);
10
- copied = true;
11
- setTimeout(() => {
12
- copied = false;
13
- }, 1500);
9
+ if (text) {
10
+ await navigator.clipboard.writeText(text);
11
+ copied = true;
12
+ setTimeout(() => {
13
+ copied = false;
14
+ }, 1500);
15
+ }
14
16
  } catch (err) {
15
17
  console.error('Failed to copy: ', err);
16
18
  }
@@ -7,6 +7,10 @@
7
7
  * @see Docs https://sveui.org/components/codeexample
8
8
  */
9
9
  export default class CodeExample extends SvelteComponentTyped<{
10
+ /**
11
+ * The type code label text, show in the top of the code example component.
12
+ * @default 'Sve-UI'
13
+ */
10
14
  typeCodeLabel?: string | undefined;
11
15
  }, {
12
16
  [evt: string]: CustomEvent<any>;
@@ -20,10 +24,6 @@ export type CodeExampleSlots = typeof __propDef.slots;
20
24
  import { SvelteComponentTyped } from "svelte";
21
25
  declare const __propDef: {
22
26
  props: {
23
- /**
24
- * The type code label
25
- * @default 'Sve-UI'
26
- */
27
27
  typeCodeLabel?: string | undefined;
28
28
  };
29
29
  events: {
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default as Button } from "./components/Button/Button.svelte";
2
+ export { default as CodeExample } from "./components/CodeExample/CodeExample.svelte";
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  // Reexport your entry components here
2
2
  export { default as Button } from './components/Button/Button.svelte';
3
+ export { default as CodeExample } from './components/CodeExample/CodeExample.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sve-ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",