@quaffui/quaff 0.1.0-prealpha4 → 0.1.0-prealpha5

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.
@@ -34,6 +34,7 @@ $:
34
34
  class={classes}
35
35
  aria-disabled={disable || undefined}
36
36
  tabindex={disable ? -1 : 0}
37
+ on:click
37
38
  {...$$restProps}
38
39
  >
39
40
  {#if icon && !loading}
@@ -16,6 +16,7 @@ declare const __propDef: {
16
16
  class?: string | undefined;
17
17
  };
18
18
  events: {
19
+ click: MouseEvent;
19
20
  activated: CustomEvent<any>;
20
21
  } & {
21
22
  [evt: string]: CustomEvent<any>;
@@ -1,13 +1,10 @@
1
- <script>import Prism from "prismjs";
2
- import "prismjs/themes/prism-twilight.css";
3
- import "prismjs/components/prism-typescript";
4
- import "prism-svelte";
1
+ <script>import Highlight from "svelte-highlight";
2
+ import typescript from "svelte-highlight/languages/typescript";
3
+ import "svelte-highlight/styles/material.css";
5
4
  import { QBtn } from "../..";
6
5
  export let language, code = "/* No code found */", title = void 0, copiable = void 0;
7
6
  let btnContent = "Copy";
8
7
  let btnColor = "primary";
9
- $:
10
- highlighted = Prism.highlight(code, Prism.languages[language], language);
11
8
  async function copyCode() {
12
9
  try {
13
10
  if (navigator.clipboard.write) {
@@ -36,8 +33,10 @@ async function copyCode() {
36
33
 
37
34
  <div class="q-code-block">
38
35
  {#if copiable}
39
- <div class="flex between-align middle-align q-pb-sm">
40
- <h4 class="q-ma-none q-pr-lg">{title}</h4>
36
+ <div class="flex between-align {title ? 'middle' : 'right'}-align q-pb-sm">
37
+ {#if title}
38
+ <h4 class="q-ma-none q-pr-lg">{title}</h4>
39
+ {/if}
41
40
  <QBtn
42
41
  class="{btnColor}-border {btnColor}-text"
43
42
  size="sm"
@@ -51,7 +50,7 @@ async function copyCode() {
51
50
  {:else if title}
52
51
  <h4>{title}</h4>
53
52
  {/if}
54
- <pre class="language-svelte"><code>{@html highlighted}</code></pre>
53
+ <Highlight language={typescript} {code} />
55
54
  </div>
56
55
 
57
56
  <style>
@@ -1,7 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import "prismjs/themes/prism-twilight.css";
3
- import "prismjs/components/prism-typescript";
4
- import "prism-svelte";
2
+ import "svelte-highlight/styles/material.css";
5
3
  import type { QCodeBlockProps } from "./props";
6
4
  declare const __propDef: {
7
5
  props: {
package/dist/global.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- declare var __QUAFF_VERSION__: string;
2
1
  declare var __PLATFORM__:
3
2
  | "aix"
4
3
  | "darwin"
@@ -2,17 +2,17 @@
2
2
  /// <reference types="@sveltejs/kit" />
3
3
  export declare const quaffStore: {
4
4
  subscribe: (this: void, run: import("svelte/store").Subscriber<{
5
- version: string;
5
+ version: any;
6
6
  dark: boolean;
7
7
  }>, invalidate?: import("svelte/store").Invalidator<{
8
- version: string;
8
+ version: any;
9
9
  dark: boolean;
10
10
  }> | undefined) => import("svelte/store").Unsubscriber;
11
11
  setDarkMode: (newVal: boolean) => void;
12
12
  toggleDarkMode: () => void;
13
13
  };
14
14
  export declare const Quaff: import("svelte/store").Readable<{
15
- version: string;
15
+ version: any;
16
16
  router: import("@sveltejs/kit").Page<Record<string, string>, string | null>;
17
17
  dark: {
18
18
  isActive: boolean;
@@ -21,10 +21,10 @@ export declare const Quaff: import("svelte/store").Readable<{
21
21
  };
22
22
  subscribe: {
23
23
  quaff: (this: void, run: import("svelte/store").Subscriber<{
24
- version: string;
24
+ version: any;
25
25
  dark: boolean;
26
26
  }>, invalidate?: import("svelte/store").Invalidator<{
27
- version: string;
27
+ version: any;
28
28
  dark: boolean;
29
29
  }> | undefined) => import("svelte/store").Unsubscriber;
30
30
  page: (this: void, run: import("svelte/store").Subscriber<import("@sveltejs/kit").Page<Record<string, string>, string | null>>, invalidate?: import("svelte/store").Invalidator<import("@sveltejs/kit").Page<Record<string, string>, string | null>> | undefined) => import("svelte/store").Unsubscriber;
@@ -1,8 +1,9 @@
1
1
  import { writable, derived } from "svelte/store";
2
2
  import { page } from "$app/stores";
3
+ import version from "../helpers/version";
3
4
  function quaff() {
4
5
  const { subscribe, set, update } = writable({
5
- version: __QUAFF_VERSION__,
6
+ version,
6
7
  dark: false,
7
8
  //TODO lang: {},
8
9
  //TODO? iconSet: {},
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@quaffui/quaff",
3
- "version": "0.1.0-prealpha4",
3
+ "version": "0.1.0-prealpha5",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "open": "vite dev --open",
7
- "build": "vite build && npm run package",
7
+ "build": "vite build && npm run package && npm run build:css",
8
+ "build:css": "vite build --config vite.config.scss.ts",
8
9
  "preview": "vite preview",
9
10
  "package": "svelte-kit sync && svelte-package && publint",
10
11
  "prepublishOnly": "npm run package",
@@ -20,7 +21,8 @@
20
21
  ".": {
21
22
  "types": "./dist/index.d.ts",
22
23
  "svelte": "./dist/index.js"
23
- }
24
+ },
25
+ "./css/": "./dist/css/"
24
26
  },
25
27
  "files": [
26
28
  "dist",
@@ -59,8 +61,8 @@
59
61
  "type": "module",
60
62
  "dependencies": {
61
63
  "beercss": "^3.2.13",
64
+ "highlight.js": "^11.8.0",
62
65
  "material-dynamic-colors": "^1.0.1",
63
- "prism-svelte": "0.5.0",
64
- "prismjs": "^1.29.0"
66
+ "svelte-highlight": "^7.3.0"
65
67
  }
66
68
  }