bb-relay 0.0.1
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/.husky/pre-commit +1 -0
- package/README.md +47 -0
- package/dist/chunk-S47CVTVK.mjs +33 -0
- package/dist/chunk-UJCSKKID.mjs +30 -0
- package/dist/dev.d.mts +11 -0
- package/dist/dev.d.ts +11 -0
- package/dist/dev.js +5028 -0
- package/dist/dev.mjs +4991 -0
- package/dist/index.d.mts +666 -0
- package/dist/index.d.ts +666 -0
- package/dist/index.js +405 -0
- package/dist/index.mjs +376 -0
- package/eslint.config.mts +19 -0
- package/jest.config.js +11 -0
- package/package.json +60 -0
- package/src/dev.ts +4 -0
- package/src/index.ts +72 -0
- package/src/load-virtual-editor/app/StatusState.ts +6 -0
- package/src/load-virtual-editor/app/css.ts +154 -0
- package/src/load-virtual-editor/app/store.ts +25 -0
- package/src/load-virtual-editor/events/handle-dir-update.ts +23 -0
- package/src/load-virtual-editor/events/handle-file-update.ts +23 -0
- package/src/load-virtual-editor/events/handle-load.ts +39 -0
- package/src/load-virtual-editor/events/handle-selected.ts +30 -0
- package/src/load-virtual-editor/index.ts +52 -0
- package/src/load-virtual-editor/lib/indexedStorage.ts +28 -0
- package/src/load-virtual-editor/mocks/generate-files.ts +25 -0
- package/src/load-virtual-editor/node/NodeState.ts +23 -0
- package/src/load-virtual-editor/node/copyDir.ts +14 -0
- package/src/load-virtual-editor/node/copyFile.ts +14 -0
- package/src/load-virtual-editor/node/createDir.ts +10 -0
- package/src/load-virtual-editor/node/createFile.ts +13 -0
- package/src/load-virtual-editor/node/deleteDir.ts +10 -0
- package/src/load-virtual-editor/node/deleteFile.ts +13 -0
- package/src/load-virtual-editor/node/formatPath.ts +13 -0
- package/src/load-virtual-editor/node/formatText.ts +19 -0
- package/src/load-virtual-editor/node/generateDirs.ts +13 -0
- package/src/load-virtual-editor/node/getDescendantLevel.ts +9 -0
- package/src/load-virtual-editor/node/getDirInfo.ts +33 -0
- package/src/load-virtual-editor/node/getFileInfo.ts +31 -0
- package/src/load-virtual-editor/node/getFiles.ts +17 -0
- package/src/load-virtual-editor/node/getParent.ts +11 -0
- package/src/load-virtual-editor/node/readDir.ts +41 -0
- package/src/load-virtual-editor/node/readFile.ts +46 -0
- package/src/load-virtual-editor/node/store.ts +206 -0
- package/src/load-virtual-editor/node/watch.ts +9 -0
- package/src/load-virtual-editor/node/writeFile.ts +21 -0
- package/src/load-virtual-editor/postResponse.ts +21 -0
- package/src/load-virtual-editor/request/requestFS.ts +199 -0
- package/src/load-virtual-editor/request/requestSelected.ts +45 -0
- package/src/load-virtual-editor/selected/SelectedState.ts +7 -0
- package/src/load-virtual-editor/selected/selectDir.ts +13 -0
- package/src/load-virtual-editor/selected/selectFile.ts +13 -0
- package/src/load-virtual-editor/selected/store.ts +27 -0
- package/src/load-virtual-editor/selected/watch.ts +9 -0
- package/src/locales/en-GB.ts +117 -0
- package/src/locales/fr-FR.ts +125 -0
- package/src/relay/index.ts +89 -0
- package/src/relay/registerEvent.ts +16 -0
- package/src/relay/registerRequest.ts +16 -0
- package/src/relay/storage-bridge.ts +71 -0
- package/src/types/BBEvent.ts +51 -0
- package/src/types/BBRequest.ts +8 -0
- package/src/types/Checkpoint.ts +11 -0
- package/src/types/CopyArg.ts +6 -0
- package/src/types/DirectoryContents.ts +4 -0
- package/src/types/DirectoryStats.ts +4 -0
- package/src/types/EventParam.ts +8 -0
- package/src/types/EventReturn.ts +9 -0
- package/src/types/FileContent.ts +9 -0
- package/src/types/GitFileStatus.ts +5 -0
- package/src/types/IconArg.ts +6 -0
- package/src/types/Language.ts +5 -0
- package/src/types/Locale.ts +3 -0
- package/src/types/MenuContent.ts +10 -0
- package/src/types/Nav.ts +3 -0
- package/src/types/PluginItem.ts +14 -0
- package/src/types/RenameType.ts +4 -0
- package/src/types/RequestParam.ts +9 -0
- package/src/types/RequestReturn.ts +11 -0
- package/src/types/Result.ts +6 -0
- package/src/types/Route.ts +1 -0
- package/src/types/Settings.ts +7 -0
- package/src/types/TutorialHeader.ts +10 -0
- package/src/types/User.ts +9 -0
- package/src/types/WatchFSEvent.ts +1 -0
- package/src/types/database.types.ts +266 -0
- package/src/types/dir/DirInfo.ts +10 -0
- package/src/types/dir/index.ts +32 -0
- package/src/types/files/FileInfo.ts +12 -0
- package/src/types/files/FileTypes.ts +13 -0
- package/src/types/files/ReadFile.ts +17 -0
- package/src/types/files/index.ts +31 -0
- package/src/types/project/Project.ts +35 -0
- package/src/types/project/index.ts +11 -0
- package/src/types/status/Load.ts +16 -0
- package/src/types/storage/index.ts +11 -0
- package/src/utils/inject-styles.ts +13 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +16 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type WatchFSEvent = "updated" | "deleted"
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]
|
|
2
|
+
|
|
3
|
+
export type Database = {
|
|
4
|
+
// Allows to automatically instantiate createClient with right options
|
|
5
|
+
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
|
6
|
+
__InternalSupabase: {
|
|
7
|
+
PostgrestVersion: "13.0.4"
|
|
8
|
+
}
|
|
9
|
+
public: {
|
|
10
|
+
Tables: {
|
|
11
|
+
plugin_versions: {
|
|
12
|
+
Row: {
|
|
13
|
+
archived: boolean
|
|
14
|
+
created_at: string
|
|
15
|
+
id: number
|
|
16
|
+
plugin_id: number
|
|
17
|
+
release_note: string
|
|
18
|
+
size: number
|
|
19
|
+
stage: Database["public"]["Enums"]["version_stage"]
|
|
20
|
+
updated_at: string
|
|
21
|
+
version: string
|
|
22
|
+
}
|
|
23
|
+
Insert: {
|
|
24
|
+
archived?: boolean
|
|
25
|
+
created_at?: string
|
|
26
|
+
id?: number
|
|
27
|
+
plugin_id: number
|
|
28
|
+
release_note: string
|
|
29
|
+
size?: number
|
|
30
|
+
stage?: Database["public"]["Enums"]["version_stage"]
|
|
31
|
+
updated_at?: string
|
|
32
|
+
version: string
|
|
33
|
+
}
|
|
34
|
+
Update: {
|
|
35
|
+
archived?: boolean
|
|
36
|
+
created_at?: string
|
|
37
|
+
id?: number
|
|
38
|
+
plugin_id?: number
|
|
39
|
+
release_note?: string
|
|
40
|
+
size?: number
|
|
41
|
+
stage?: Database["public"]["Enums"]["version_stage"]
|
|
42
|
+
updated_at?: string
|
|
43
|
+
version?: string
|
|
44
|
+
}
|
|
45
|
+
Relationships: [
|
|
46
|
+
{
|
|
47
|
+
foreignKeyName: "plugin_versions_plugin_id_fkey"
|
|
48
|
+
columns: ["plugin_id"]
|
|
49
|
+
isOneToOne: false
|
|
50
|
+
referencedRelation: "plugins"
|
|
51
|
+
referencedColumns: ["id"]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
plugins: {
|
|
56
|
+
Row: {
|
|
57
|
+
author_id: string
|
|
58
|
+
categories: string[] | null
|
|
59
|
+
created_at: string
|
|
60
|
+
description: string | null
|
|
61
|
+
homepage: string | null
|
|
62
|
+
id: number
|
|
63
|
+
key: string
|
|
64
|
+
name: string | null
|
|
65
|
+
npm_package: string | null
|
|
66
|
+
updated_at: string
|
|
67
|
+
}
|
|
68
|
+
Insert: {
|
|
69
|
+
author_id?: string
|
|
70
|
+
categories?: string[] | null
|
|
71
|
+
created_at?: string
|
|
72
|
+
description?: string | null
|
|
73
|
+
homepage?: string | null
|
|
74
|
+
id?: number
|
|
75
|
+
key?: string
|
|
76
|
+
name?: string | null
|
|
77
|
+
npm_package?: string | null
|
|
78
|
+
updated_at?: string
|
|
79
|
+
}
|
|
80
|
+
Update: {
|
|
81
|
+
author_id?: string
|
|
82
|
+
categories?: string[] | null
|
|
83
|
+
created_at?: string
|
|
84
|
+
description?: string | null
|
|
85
|
+
homepage?: string | null
|
|
86
|
+
id?: number
|
|
87
|
+
key?: string
|
|
88
|
+
name?: string | null
|
|
89
|
+
npm_package?: string | null
|
|
90
|
+
updated_at?: string
|
|
91
|
+
}
|
|
92
|
+
Relationships: [
|
|
93
|
+
{
|
|
94
|
+
foreignKeyName: "plugins_author_id_fkey"
|
|
95
|
+
columns: ["author_id"]
|
|
96
|
+
isOneToOne: false
|
|
97
|
+
referencedRelation: "profiles"
|
|
98
|
+
referencedColumns: ["id"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
profiles: {
|
|
103
|
+
Row: {
|
|
104
|
+
avatar_url: string | null
|
|
105
|
+
full_name: string | null
|
|
106
|
+
id: string
|
|
107
|
+
updated_at: string | null
|
|
108
|
+
username: string | null
|
|
109
|
+
website: string | null
|
|
110
|
+
}
|
|
111
|
+
Insert: {
|
|
112
|
+
avatar_url?: string | null
|
|
113
|
+
full_name?: string | null
|
|
114
|
+
id: string
|
|
115
|
+
updated_at?: string | null
|
|
116
|
+
username?: string | null
|
|
117
|
+
website?: string | null
|
|
118
|
+
}
|
|
119
|
+
Update: {
|
|
120
|
+
avatar_url?: string | null
|
|
121
|
+
full_name?: string | null
|
|
122
|
+
id?: string
|
|
123
|
+
updated_at?: string | null
|
|
124
|
+
username?: string | null
|
|
125
|
+
website?: string | null
|
|
126
|
+
}
|
|
127
|
+
Relationships: []
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
Views: {
|
|
131
|
+
[_ in never]: never
|
|
132
|
+
}
|
|
133
|
+
Functions: {
|
|
134
|
+
[_ in never]: never
|
|
135
|
+
}
|
|
136
|
+
Enums: {
|
|
137
|
+
version_stage: "DRAFT" | "ALPHA" | "BETA" | "PROD"
|
|
138
|
+
}
|
|
139
|
+
CompositeTypes: {
|
|
140
|
+
[_ in never]: never
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
|
|
146
|
+
|
|
147
|
+
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
|
|
148
|
+
|
|
149
|
+
export type Tables<
|
|
150
|
+
DefaultSchemaTableNameOrOptions extends
|
|
151
|
+
| keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
|
|
152
|
+
| { schema: keyof DatabaseWithoutInternals },
|
|
153
|
+
TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
154
|
+
schema: keyof DatabaseWithoutInternals
|
|
155
|
+
}
|
|
156
|
+
? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
|
|
157
|
+
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
|
|
158
|
+
: never = never
|
|
159
|
+
> = DefaultSchemaTableNameOrOptions extends {
|
|
160
|
+
schema: keyof DatabaseWithoutInternals
|
|
161
|
+
}
|
|
162
|
+
? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
|
|
163
|
+
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
164
|
+
Row: infer R
|
|
165
|
+
}
|
|
166
|
+
? R
|
|
167
|
+
: never
|
|
168
|
+
: DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
|
|
169
|
+
? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
|
|
170
|
+
Row: infer R
|
|
171
|
+
}
|
|
172
|
+
? R
|
|
173
|
+
: never
|
|
174
|
+
: never
|
|
175
|
+
|
|
176
|
+
export type TablesInsert<
|
|
177
|
+
DefaultSchemaTableNameOrOptions extends
|
|
178
|
+
| keyof DefaultSchema["Tables"]
|
|
179
|
+
| { schema: keyof DatabaseWithoutInternals },
|
|
180
|
+
TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
181
|
+
schema: keyof DatabaseWithoutInternals
|
|
182
|
+
}
|
|
183
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
|
|
184
|
+
: never = never
|
|
185
|
+
> = DefaultSchemaTableNameOrOptions extends {
|
|
186
|
+
schema: keyof DatabaseWithoutInternals
|
|
187
|
+
}
|
|
188
|
+
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
189
|
+
Insert: infer I
|
|
190
|
+
}
|
|
191
|
+
? I
|
|
192
|
+
: never
|
|
193
|
+
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
|
|
194
|
+
? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
195
|
+
Insert: infer I
|
|
196
|
+
}
|
|
197
|
+
? I
|
|
198
|
+
: never
|
|
199
|
+
: never
|
|
200
|
+
|
|
201
|
+
export type TablesUpdate<
|
|
202
|
+
DefaultSchemaTableNameOrOptions extends
|
|
203
|
+
| keyof DefaultSchema["Tables"]
|
|
204
|
+
| { schema: keyof DatabaseWithoutInternals },
|
|
205
|
+
TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
206
|
+
schema: keyof DatabaseWithoutInternals
|
|
207
|
+
}
|
|
208
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
|
|
209
|
+
: never = never
|
|
210
|
+
> = DefaultSchemaTableNameOrOptions extends {
|
|
211
|
+
schema: keyof DatabaseWithoutInternals
|
|
212
|
+
}
|
|
213
|
+
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
214
|
+
Update: infer U
|
|
215
|
+
}
|
|
216
|
+
? U
|
|
217
|
+
: never
|
|
218
|
+
: DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
|
|
219
|
+
? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
|
|
220
|
+
Update: infer U
|
|
221
|
+
}
|
|
222
|
+
? U
|
|
223
|
+
: never
|
|
224
|
+
: never
|
|
225
|
+
|
|
226
|
+
export type Enums<
|
|
227
|
+
DefaultSchemaEnumNameOrOptions extends
|
|
228
|
+
| keyof DefaultSchema["Enums"]
|
|
229
|
+
| { schema: keyof DatabaseWithoutInternals },
|
|
230
|
+
EnumName extends DefaultSchemaEnumNameOrOptions extends {
|
|
231
|
+
schema: keyof DatabaseWithoutInternals
|
|
232
|
+
}
|
|
233
|
+
? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
|
|
234
|
+
: never = never
|
|
235
|
+
> = DefaultSchemaEnumNameOrOptions extends {
|
|
236
|
+
schema: keyof DatabaseWithoutInternals
|
|
237
|
+
}
|
|
238
|
+
? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
|
239
|
+
: DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
|
|
240
|
+
? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
|
|
241
|
+
: never
|
|
242
|
+
|
|
243
|
+
export type CompositeTypes<
|
|
244
|
+
PublicCompositeTypeNameOrOptions extends
|
|
245
|
+
| keyof DefaultSchema["CompositeTypes"]
|
|
246
|
+
| { schema: keyof DatabaseWithoutInternals },
|
|
247
|
+
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
|
248
|
+
schema: keyof DatabaseWithoutInternals
|
|
249
|
+
}
|
|
250
|
+
? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
|
|
251
|
+
: never = never
|
|
252
|
+
> = PublicCompositeTypeNameOrOptions extends {
|
|
253
|
+
schema: keyof DatabaseWithoutInternals
|
|
254
|
+
}
|
|
255
|
+
? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
|
|
256
|
+
: PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
|
|
257
|
+
? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
|
|
258
|
+
: never
|
|
259
|
+
|
|
260
|
+
export const Constants = {
|
|
261
|
+
public: {
|
|
262
|
+
Enums: {
|
|
263
|
+
version_stage: ["DRAFT", "ALPHA", "BETA", "PROD"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} as const
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import DirInfo from "./DirInfo";
|
|
2
|
+
|
|
3
|
+
export type DirRequests = {
|
|
4
|
+
"create-dir": {
|
|
5
|
+
args: { path: string };
|
|
6
|
+
response: null;
|
|
7
|
+
};
|
|
8
|
+
"read-dir": {
|
|
9
|
+
args: { path: string };
|
|
10
|
+
response: { path: string; type: "file" | "dir" }[];
|
|
11
|
+
};
|
|
12
|
+
"get-files": {
|
|
13
|
+
args: { path: string };
|
|
14
|
+
response: string[];
|
|
15
|
+
};
|
|
16
|
+
"get-dir-info": {
|
|
17
|
+
args: { path: string };
|
|
18
|
+
response: DirInfo;
|
|
19
|
+
};
|
|
20
|
+
"copy-dir": {
|
|
21
|
+
args: { source: string; destination: string };
|
|
22
|
+
response: null;
|
|
23
|
+
};
|
|
24
|
+
"delete-dir": {
|
|
25
|
+
args: { path: string };
|
|
26
|
+
response: null;
|
|
27
|
+
};
|
|
28
|
+
"select-dir": {
|
|
29
|
+
args: { path: string };
|
|
30
|
+
response: null;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BinaryFile, TextFile } from "./FileTypes";
|
|
2
|
+
|
|
3
|
+
export type ReadFile =
|
|
4
|
+
| {
|
|
5
|
+
args: {
|
|
6
|
+
path: string;
|
|
7
|
+
type: "text";
|
|
8
|
+
};
|
|
9
|
+
response: TextFile;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
args: {
|
|
13
|
+
path: string;
|
|
14
|
+
type: "binary";
|
|
15
|
+
};
|
|
16
|
+
response: BinaryFile;
|
|
17
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FileInfo } from "@/index";
|
|
2
|
+
import { ReadFile } from "./ReadFile";
|
|
3
|
+
import { BinaryFile, TextFile } from "./FileTypes";
|
|
4
|
+
|
|
5
|
+
export type FileRequests = {
|
|
6
|
+
"create-file": {
|
|
7
|
+
args: { path: string };
|
|
8
|
+
response: null;
|
|
9
|
+
};
|
|
10
|
+
"copy-file": {
|
|
11
|
+
args: { source: string; destination: string };
|
|
12
|
+
response: null;
|
|
13
|
+
};
|
|
14
|
+
"read-file": ReadFile;
|
|
15
|
+
stat: {
|
|
16
|
+
args: { path: string };
|
|
17
|
+
response: FileInfo;
|
|
18
|
+
};
|
|
19
|
+
"write-file": {
|
|
20
|
+
args: TextFile | BinaryFile;
|
|
21
|
+
response: null;
|
|
22
|
+
};
|
|
23
|
+
"delete-file": {
|
|
24
|
+
args: { path: string };
|
|
25
|
+
response: null;
|
|
26
|
+
};
|
|
27
|
+
"select-file": {
|
|
28
|
+
args: { path: string };
|
|
29
|
+
response: null;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type Category =
|
|
2
|
+
| "Action"
|
|
3
|
+
| "Adventure"
|
|
4
|
+
| "ChickLit"
|
|
5
|
+
| "Comedy"
|
|
6
|
+
| "Drama"
|
|
7
|
+
| "FanFiction"
|
|
8
|
+
| "Fantasy"
|
|
9
|
+
| "Horror"
|
|
10
|
+
| "Mystery / Thriller"
|
|
11
|
+
| "Parody"
|
|
12
|
+
| "Poetry"
|
|
13
|
+
| "Romance"
|
|
14
|
+
| "SciFi"
|
|
15
|
+
| "Thriller"
|
|
16
|
+
| "Western"
|
|
17
|
+
| "Historical Fiction"
|
|
18
|
+
| "No Fiction"
|
|
19
|
+
| "Paranormal"
|
|
20
|
+
| "Adult"
|
|
21
|
+
| "Short story"
|
|
22
|
+
| "Spiritual"
|
|
23
|
+
| "Other";
|
|
24
|
+
|
|
25
|
+
export default interface Project {
|
|
26
|
+
title: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
lastAccessedAt: string;
|
|
30
|
+
remoteId?: string;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
category?: Category;
|
|
33
|
+
description?: string;
|
|
34
|
+
genre?: string | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Load = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether the app is in dark mode or not
|
|
4
|
+
*/
|
|
5
|
+
mode: "dark" | "light";
|
|
6
|
+
/**
|
|
7
|
+
* The CSS to be applied to the app
|
|
8
|
+
*/
|
|
9
|
+
css: string;
|
|
10
|
+
/**
|
|
11
|
+
* The language of the app e.g. en, en-gb
|
|
12
|
+
*/
|
|
13
|
+
language: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Load;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the function to inject styles to the iframe from the parent window
|
|
3
|
+
* @param css the css styles from parent window
|
|
4
|
+
* @returns function to remove the injected styles
|
|
5
|
+
*/
|
|
6
|
+
export default function injectStyles(css: string) {
|
|
7
|
+
const style = document.createElement("style");
|
|
8
|
+
style.textContent = css;
|
|
9
|
+
document.head.appendChild(style);
|
|
10
|
+
return () => {
|
|
11
|
+
document.head.removeChild(style);
|
|
12
|
+
};
|
|
13
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@electron-toolkit/tsconfig/tsconfig.web.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"baseUrl": ".",
|
|
15
|
+
"paths": {
|
|
16
|
+
"@/*": ["./src/*"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"]
|
|
20
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
import cssModulesPlugin from "esbuild-css-modules-plugin";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
entry: {
|
|
6
|
+
index: "src/index.ts",
|
|
7
|
+
dev: "src/dev.ts",
|
|
8
|
+
},
|
|
9
|
+
format: ["esm", "cjs"],
|
|
10
|
+
dts: true,
|
|
11
|
+
outDir: "dist",
|
|
12
|
+
plugins: [cssModulesPlugin()],
|
|
13
|
+
loader: {
|
|
14
|
+
".css": "css",
|
|
15
|
+
},
|
|
16
|
+
});
|