obi-sdk 0.4.3 → 0.5.0

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.
@@ -9,8 +9,11 @@ export declare class CourseModal extends LitElement {
9
9
  apiKey: string;
10
10
  onClose?: () => void;
11
11
  private apiBaseUrl;
12
+ private selectedCourse;
12
13
  private handleClose;
14
+ private handleGetStarted;
13
15
  private fetchCourses;
16
+ private handleCourseCardClick;
14
17
  connectedCallback(): void;
15
18
  render(): import("lit").TemplateResult<1>;
16
19
  }
@@ -3,20 +3,22 @@ export type CourseData = {
3
3
  id: string;
4
4
  name: string;
5
5
  description: string;
6
- imageSrc?: string;
6
+ duration?: number;
7
7
  };
8
8
  export declare class Course extends LitElement {
9
9
  static styles: import("lit").CSSResult;
10
10
  id: string;
11
11
  name: string;
12
12
  description: string;
13
- imageSrc: string;
13
+ duration: number;
14
+ selected: boolean;
14
15
  private handleClick;
15
16
  render(): import("lit").TemplateResult<1>;
16
17
  }
17
18
  export declare class CourseList extends LitElement {
18
19
  static styles: import("lit").CSSResult;
19
20
  courses: CourseData[];
21
+ selectedCourseId: string | null;
20
22
  loading: boolean;
21
23
  error: string;
22
24
  render(): import("lit").TemplateResult<1>;
@@ -0,0 +1 @@
1
+ export * from "./obi-widget";
@@ -1,10 +1,10 @@
1
1
  import { LitElement, nothing } from "lit";
2
- import "./navigation-bar";
3
- import "./courses";
4
- import "./audio-equalizer";
5
- import "./dot-loader";
6
- import "./searching-loader";
7
- import "./session-start-modal";
2
+ import "../navigation-bar";
3
+ import "../courses";
4
+ import "../audio-equalizer";
5
+ import "../dot-loader";
6
+ import "../searching-loader";
7
+ import "../session-start-modal";
8
8
  export declare class ObiWidget extends LitElement {
9
9
  private apiKey;
10
10
  private isActive;
@@ -29,6 +29,10 @@ export declare class ObiWidget extends LitElement {
29
29
  private researchingTimeoutRef;
30
30
  constructor();
31
31
  private updateFromConfig;
32
+ /**
33
+ * Generate additional color variables based on the primary color
34
+ */
35
+ private generateColorVariables;
32
36
  static styles: import("lit").CSSResult;
33
37
  private removeSessionUrlParams;
34
38
  /**
@@ -60,6 +64,7 @@ export declare class ObiWidget extends LitElement {
60
64
  private sessionConnectionCheck;
61
65
  connectedCallback(): void;
62
66
  disconnectedCallback(): void;
67
+ private handleConfigUpdate;
63
68
  private handleMouseEnter;
64
69
  private handleMouseLeave;
65
70
  /**
@@ -0,0 +1,12 @@
1
+ export declare const ORIGINAL_PRIMARY_COLOR = "#a10fff";
2
+ /**
3
+ * Generate a selected state color from a primary color based on a design relationship
4
+ *
5
+ * This function calculates the transformation between an original primary color and its
6
+ * designed selected state, then applies that same transformation to any given primary color.
7
+ *
8
+ * @param currentPrimaryColor - The current primary color in hex format (e.g., '#a10fff')
9
+ * @param designedSelectedColor - The color used in the designs in hex format (e.g., '#c76cff')
10
+ * @returns The generated selected color in hex format
11
+ */
12
+ export declare function generateSelectedColor(currentPrimaryColor: string, designedSelectedColor: string): string;
@@ -1 +1,2 @@
1
1
  export * from "./storage";
2
+ export * from "./color";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obi-sdk",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "JavaScript SDK for Obi",
5
5
  "type": "module",
6
6
  "main": "dist/obi-sdk.umd.js",
@@ -31,8 +31,8 @@
31
31
  "ts-pattern": "^5.7.0",
32
32
  "zod": "^3.22.0",
33
33
  "@obi/obi-client": "0.2.0",
34
- "@obi/url-params": "0.2.0",
35
- "@obi/obi-session": "0.3.0"
34
+ "@obi/obi-session": "0.3.0",
35
+ "@obi/url-params": "0.2.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -49,10 +49,13 @@
49
49
  "@typescript-eslint/eslint-plugin": "^6.0.0",
50
50
  "@typescript-eslint/parser": "^6.0.0",
51
51
  "@vitejs/plugin-react": "^4.0.3",
52
+ "@vitest/coverage-v8": "^2.1.8",
53
+ "@vitest/ui": "^2.1.8",
52
54
  "eslint": "^8.45.0",
53
55
  "eslint-config-prettier": "^9.0.0",
54
56
  "eslint-plugin-import": "^2.28.0",
55
57
  "eslint-plugin-storybook": "^9.0.0",
58
+ "jsdom": "^25.0.1",
56
59
  "prettier": "^3.0.0",
57
60
  "react": "^18.2.0",
58
61
  "react-dom": "^18.2.0",
@@ -60,7 +63,8 @@
60
63
  "storybook": "^9.0.0",
61
64
  "terser": "^5.39.0",
62
65
  "typescript": "^5.8.3",
63
- "vite": "^4.5.0"
66
+ "vite": "^4.5.0",
67
+ "vitest": "^2.1.8"
64
68
  },
65
69
  "scripts": {
66
70
  "dev": "vite",
@@ -74,6 +78,10 @@
74
78
  "types": "tsc --emitDeclarationOnly",
75
79
  "clean": "rimraf dist",
76
80
  "storybook": "storybook dev -p 6006",
77
- "build-storybook": "storybook build"
81
+ "build-storybook": "storybook build",
82
+ "test": "vitest",
83
+ "test:ui": "vitest --ui",
84
+ "test:run": "vitest run",
85
+ "test:coverage": "vitest run --coverage"
78
86
  }
79
87
  }