microboard-temp 0.13.78 → 0.13.80

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.
@@ -1,5 +1,5 @@
1
1
  import { Board } from '../../Board';
2
2
  import { AudioItem } from '../Audio/Audio';
3
3
  import { Matrix } from '../Transformation/Matrix';
4
- export declare const prepareAudio: (file: File, accessToken: string | null, boardId: string, baseUrl?: string) => Promise<string>;
4
+ export declare const prepareAudio: (file: File, boardId: string, baseUrl?: string) => Promise<string>;
5
5
  export declare const calculateAudioPosition: (board: Board, audioItem: AudioItem) => Matrix;
@@ -16,4 +16,4 @@ export declare const resizeAndConvertToPng: (inp: string | ArrayBuffer | null |
16
16
  * @param boardId
17
17
  * @returns An object containing prepared image information on success, err otherwise
18
18
  */
19
- export declare const prepareImage: (inp: string | ArrayBuffer | null | undefined, accessToken: string | null, boardId: string, baseUrl?: string) => Promise<ImageConstructorData>;
19
+ export declare const prepareImage: (inp: string | ArrayBuffer | null | undefined, boardId: string, baseUrl?: string) => Promise<ImageConstructorData>;
@@ -5,7 +5,7 @@ export declare const getVideoMetadata: (file: File) => Promise<{
5
5
  height: number;
6
6
  }>;
7
7
  export declare const createVideoItem: (board: Board, extension: "mp4" | "webm", videoData: VideoConstructorData, onLoadCb: (video: VideoItem) => void) => void;
8
- export declare const prepareVideo: (file: File, accessToken: string | null, boardId: string, baseUrl?: string) => Promise<{
8
+ export declare const prepareVideo: (file: File, boardId: string, baseUrl?: string) => Promise<{
9
9
  url: string;
10
10
  previewUrl: string;
11
11
  }>;
@@ -52,25 +52,6 @@ export interface NotifyFunction {
52
52
  * Allowed drawing tools.
53
53
  */
54
54
  export type DrawingTool = "Pen" | "Eraser" | "Highlighter";
55
- /**
56
- * Template categories as a literal union.
57
- */
58
- export type TemplateCategory = "All templates" | "Research & Analysis" | "Diagramming" | "Meeting & Workshop" | "Strategy & Planning" | "Brainstorming" | "Agile Workflow" | "Icebreaker & Game" | "Education";
59
- /**
60
- * Template language definition.
61
- */
62
- export interface TemplateLanguage {
63
- value: "ru" | "en" | "de" | "es" | "fr" | "zh";
64
- label: string;
65
- }
66
- export interface Template {
67
- id: string;
68
- preview: string;
69
- languages: string[];
70
- tags: string[];
71
- name: string;
72
- created: string;
73
- }
74
55
  export declare enum ExportQuality {
75
56
  HIGH = 0,
76
57
  MEDIUM = 1,
@@ -116,6 +97,8 @@ type GetDocumentWidthFunction = () => number;
116
97
  type GetDocumentHeightFunction = () => number;
117
98
  type GetDPIFunction = () => number;
118
99
  type GetYouTubeIdFunction = (url?: string) => string | null;
100
+ type OnAuthInvalidFunction = (boardId?: string) => Promise<boolean>;
101
+ type OnAuthTerminalFailureFunction = (boardId?: string, reason?: string) => void;
119
102
  type GetDOMParser = () => {
120
103
  parseFromString: (str: string, type: DOMParserSupportedType) => Document;
121
104
  };
@@ -148,6 +131,12 @@ export declare const conf: {
148
131
  getDPI: GetDPIFunction;
149
132
  reactEditorFocus: ReactEditorFocus;
150
133
  reactEditorToSlatePoint: ReactEditorToSlatePoint;
134
+ /**
135
+ * Coordination hooks for authentication and connection state.
136
+ * UI repository should implement these to handle token refresh and terminal failure.
137
+ */
138
+ onAuthInvalid: OnAuthInvalidFunction;
139
+ onAuthTerminalFailure: OnAuthTerminalFailureFunction;
151
140
  planNames: {
152
141
  basic: string;
153
142
  plus: string;
@@ -216,11 +205,6 @@ export declare const conf: {
216
205
  HIGHLIGHTER_DEFAULT_COLOR: string;
217
206
  ERASER_DEFAULT_COLOR: string;
218
207
  ERASER_MAX_LINE_LENGTH: number;
219
- TEMPLATE_CATEGORIES: string[];
220
- TEMPLATE_LANGUAGES: {
221
- value: string;
222
- label: string;
223
- }[];
224
208
  CANVAS_BG_COLOR: string;
225
209
  URL_REGEX: RegExp;
226
210
  AI_NODE_DEFAULT_NODE_WIDTH: number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Universal authenticated fetch wrapper.
3
+ * Detects 401 AUTH_INVALID_ACCESS_TOKEN and coordinates refresh with the UI layer via Settings hooks.
4
+ * Compatible with Browser, Node.js (v18+), and Cloudflare Workers.
5
+ */
6
+ export declare function authenticatedFetch(url: string, init?: RequestInit, boardId?: string): Promise<Response>;
@@ -1,2 +1,2 @@
1
- export declare const uploadMediaToStorage: (blob: Blob, accessToken: string | null, boardId: string, type: "video" | "audio" | "image", baseUrl?: string) => Promise<string>;
2
- export declare const getMediaSignedUrl: (url: string, accessToken: string | null) => Promise<string | null>;
1
+ export declare const uploadMediaToStorage: (blob: Blob, boardId: string, type: "video" | "audio" | "image", baseUrl?: string) => Promise<string>;
2
+ export declare const getMediaSignedUrl: (url: string) => Promise<string | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.78",
3
+ "version": "0.13.80",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",