@tap-payments/os-micro-frontend-shared 0.1.259-test.1 → 0.1.259-test.1-test.2
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.
package/build/constants/apps.js
CHANGED
|
@@ -320,10 +320,6 @@ export const APP_CODES = {
|
|
|
320
320
|
code: 'BRAND',
|
|
321
321
|
functions: { view: { code: 'VIEW' }, update: { code: 'UPDATE' } },
|
|
322
322
|
},
|
|
323
|
-
appSettings: {
|
|
324
|
-
code: 'APP_SETTINGS',
|
|
325
|
-
functions: { view: { code: 'VIEW' }, update: { code: 'UPDATE' } },
|
|
326
|
-
},
|
|
327
323
|
},
|
|
328
324
|
},
|
|
329
325
|
order: {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { AppDetails, Segment, TableMode, Timezone } from '../types/index.js';
|
|
2
2
|
import { SheetViewColumnsData } from './columnResizeStorage';
|
|
3
|
+
export interface PreviewData {
|
|
4
|
+
id: string;
|
|
5
|
+
img: string;
|
|
6
|
+
isGenerating: boolean;
|
|
7
|
+
serviceCode?: string;
|
|
8
|
+
appCode: string;
|
|
9
|
+
isMinimized: boolean;
|
|
10
|
+
}
|
|
3
11
|
export declare function setSecretKey(): void;
|
|
4
12
|
export declare function getSecretKey(): string | null;
|
|
5
13
|
export declare function removeSecretKey(): void;
|
|
@@ -32,4 +40,7 @@ export declare const getGlobalTableModeStorage: () => TableMode;
|
|
|
32
40
|
export declare const removeGlobalTableModeStorage: () => void;
|
|
33
41
|
export declare const setSheetViewColumnsStorage: (data: SheetViewColumnsData) => void;
|
|
34
42
|
export declare const getSheetViewColumnsStorage: () => SheetViewColumnsData;
|
|
43
|
+
export declare const setPreviewStorage: (previews: PreviewData[]) => void;
|
|
44
|
+
export declare const getPreviewStorage: () => Map<string, string>;
|
|
45
|
+
export declare const removePreviewStorage: () => void;
|
|
35
46
|
export declare const clearTapOsLocalStorage: () => void;
|
|
@@ -12,6 +12,7 @@ const CALENDER_TIMEZONE = 'tap-dashboard-calender-timezone';
|
|
|
12
12
|
const CALENDER_TIMEZONE_HISTORY = 'tap-dashboard-calender-timezone-history';
|
|
13
13
|
const GLOBAL_TABLE_MODE_KEY = 'tap-dashboard-global-table-mode';
|
|
14
14
|
const SHEETVIEW_COLUMNS_KEY = 'sheetview_columns';
|
|
15
|
+
const PREVIEW_STORAGE_KEY = 'dock-preview-windows';
|
|
15
16
|
export function setSecretKey() {
|
|
16
17
|
localStorage.setItem(SECRET_KEY_LOCAL_STORAGE, TEST_SECRET_KEY);
|
|
17
18
|
}
|
|
@@ -169,6 +170,43 @@ export const removeGlobalTableModeStorage = () => {
|
|
|
169
170
|
};
|
|
170
171
|
export const setSheetViewColumnsStorage = (data) => localStorage.setItem(SHEETVIEW_COLUMNS_KEY, JSON.stringify(data));
|
|
171
172
|
export const getSheetViewColumnsStorage = () => JSON.parse(localStorage.getItem(SHEETVIEW_COLUMNS_KEY) || '{}');
|
|
173
|
+
export const setPreviewStorage = (previews) => {
|
|
174
|
+
try {
|
|
175
|
+
const data = previews
|
|
176
|
+
.filter((p) => p.img)
|
|
177
|
+
.map((p) => ({
|
|
178
|
+
id: p.id,
|
|
179
|
+
img: p.img,
|
|
180
|
+
timestamp: Date.now(),
|
|
181
|
+
}));
|
|
182
|
+
localStorage.setItem(PREVIEW_STORAGE_KEY, JSON.stringify(data));
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.warn('Failed to save preview cache:', error);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
export const getPreviewStorage = () => {
|
|
189
|
+
try {
|
|
190
|
+
const cached = localStorage.getItem(PREVIEW_STORAGE_KEY);
|
|
191
|
+
if (!cached)
|
|
192
|
+
return new Map();
|
|
193
|
+
const data = JSON.parse(cached);
|
|
194
|
+
const previewMap = new Map();
|
|
195
|
+
data.forEach((item) => {
|
|
196
|
+
previewMap.set(item.id, item.img);
|
|
197
|
+
});
|
|
198
|
+
return previewMap;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return new Map();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
export const removePreviewStorage = () => {
|
|
205
|
+
try {
|
|
206
|
+
localStorage.removeItem(PREVIEW_STORAGE_KEY);
|
|
207
|
+
}
|
|
208
|
+
catch (error) { }
|
|
209
|
+
};
|
|
172
210
|
export const clearTapOsLocalStorage = () => {
|
|
173
211
|
removeSecretKey();
|
|
174
212
|
removeConnectMetaData();
|
|
@@ -180,4 +218,5 @@ export const clearTapOsLocalStorage = () => {
|
|
|
180
218
|
removeCalenderTimezone();
|
|
181
219
|
removeCalenderTimezoneHistory();
|
|
182
220
|
removeGlobalTableModeStorage();
|
|
221
|
+
removePreviewStorage();
|
|
183
222
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.259-test.1",
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.259-test.1-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|