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
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import "./chunk-S47CVTVK.mjs";
|
|
2
|
+
|
|
3
|
+
// src/relay/registerRequest.ts
|
|
4
|
+
function registerRequest(request) {
|
|
5
|
+
if (!window) throw new Error("Window not found");
|
|
6
|
+
if (window === window.parent) throw new Error("No parent window available");
|
|
7
|
+
window.parent.postMessage({ ...request, source: "request" }, "*");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// src/relay/storage-bridge.ts
|
|
11
|
+
function storageBridge() {
|
|
12
|
+
let loaded = false;
|
|
13
|
+
const proto = Storage.prototype;
|
|
14
|
+
const _setItem = proto.setItem;
|
|
15
|
+
const _removeItem = proto.removeItem;
|
|
16
|
+
const _clear = proto.clear;
|
|
17
|
+
function snapshot(storage) {
|
|
18
|
+
const obj = {};
|
|
19
|
+
for (let i = 0; i < storage.length; i++) {
|
|
20
|
+
const key = storage.key(i);
|
|
21
|
+
if (key !== null) {
|
|
22
|
+
obj[key] = storage.getItem(key);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return obj;
|
|
26
|
+
}
|
|
27
|
+
function notify() {
|
|
28
|
+
registerRequest({
|
|
29
|
+
type: "sync-storage",
|
|
30
|
+
id: crypto.randomUUID(),
|
|
31
|
+
arg: {
|
|
32
|
+
data: snapshot(localStorage)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
proto.setItem = function(key, value) {
|
|
37
|
+
const result = _setItem.apply(this, [key, value]);
|
|
38
|
+
notify();
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
proto.removeItem = function(key) {
|
|
42
|
+
const result = _removeItem.apply(this, [key]);
|
|
43
|
+
notify();
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
proto.clear = function() {
|
|
47
|
+
const result = _clear.apply(this);
|
|
48
|
+
notify();
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
registerRequest({
|
|
52
|
+
type: "load-storage",
|
|
53
|
+
id: crypto.randomUUID(),
|
|
54
|
+
arg: null
|
|
55
|
+
});
|
|
56
|
+
window.addEventListener("message", (event) => {
|
|
57
|
+
const data = event.data;
|
|
58
|
+
if (data.type === "load-storage") {
|
|
59
|
+
if (!loaded && data.response) {
|
|
60
|
+
loaded = true;
|
|
61
|
+
for (const key in data.response) {
|
|
62
|
+
localStorage.setItem(key, data.response[key]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/relay/registerEvent.ts
|
|
70
|
+
function registerEvent(event) {
|
|
71
|
+
if (!window) throw new Error("Window not found");
|
|
72
|
+
if (window === window.parent) throw new Error("No parent window available");
|
|
73
|
+
window.parent.postMessage({ ...event, source: "event" }, "*");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/relay/index.ts
|
|
77
|
+
var BBRelay = class {
|
|
78
|
+
constructor() {
|
|
79
|
+
this.requestCallbacks = /* @__PURE__ */ new Map();
|
|
80
|
+
this.eventCallbacks = /* @__PURE__ */ new Map();
|
|
81
|
+
this.responseIds = [];
|
|
82
|
+
storageBridge();
|
|
83
|
+
window.addEventListener("message", (event) => {
|
|
84
|
+
const data = event.data;
|
|
85
|
+
if (!data?.type) return;
|
|
86
|
+
if (this.responseIds.includes(data.responseId)) return;
|
|
87
|
+
this.responseIds.push(data.responseId);
|
|
88
|
+
if (!data.id) {
|
|
89
|
+
for (const [, { type, callback: callback2 }] of this.eventCallbacks) {
|
|
90
|
+
const { response } = data;
|
|
91
|
+
if (type === data.type) {
|
|
92
|
+
callback2({ response });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const callback = this.requestCallbacks.get(data.id);
|
|
97
|
+
if (callback) {
|
|
98
|
+
const { response, error } = data;
|
|
99
|
+
callback.callback({ response, error });
|
|
100
|
+
this.requestCallbacks.delete(data.id);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
request(type, arg, callback) {
|
|
106
|
+
const id = crypto.randomUUID();
|
|
107
|
+
if (callback)
|
|
108
|
+
this.requestCallbacks.set(id, {
|
|
109
|
+
type,
|
|
110
|
+
callback
|
|
111
|
+
});
|
|
112
|
+
registerRequest({ type, arg, id });
|
|
113
|
+
}
|
|
114
|
+
subscribe(type, callback) {
|
|
115
|
+
const id = crypto.randomUUID();
|
|
116
|
+
this.eventCallbacks.set(id, {
|
|
117
|
+
type,
|
|
118
|
+
callback
|
|
119
|
+
});
|
|
120
|
+
registerEvent({ type });
|
|
121
|
+
return () => {
|
|
122
|
+
this.eventCallbacks.delete(id);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// src/utils/inject-styles.ts
|
|
128
|
+
function injectStyles(css) {
|
|
129
|
+
const style = document.createElement("style");
|
|
130
|
+
style.textContent = css;
|
|
131
|
+
document.head.appendChild(style);
|
|
132
|
+
return () => {
|
|
133
|
+
document.head.removeChild(style);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/locales/en-GB.ts
|
|
138
|
+
var enGB = {
|
|
139
|
+
"language.british_english": "British English",
|
|
140
|
+
"language.french": "French (France)",
|
|
141
|
+
"file.new": "New File",
|
|
142
|
+
"file.new.placeholder": "Press enter to add file",
|
|
143
|
+
"file.open": "Open File",
|
|
144
|
+
"file.duplicate": "Duplicate File",
|
|
145
|
+
"file.delete": "Delete File",
|
|
146
|
+
"file.rename": "Rename File",
|
|
147
|
+
"file.close": "Close File",
|
|
148
|
+
"file.cut": "Cut File",
|
|
149
|
+
"file.copy": "Copy File",
|
|
150
|
+
"file.export_html": "Export as HTML",
|
|
151
|
+
"file.export_pdf": "Export as PDF",
|
|
152
|
+
"file.print": "Print File",
|
|
153
|
+
"file.location.open": "Open File Location",
|
|
154
|
+
file: "File",
|
|
155
|
+
edit: "Edit",
|
|
156
|
+
view: "View",
|
|
157
|
+
help: "Help",
|
|
158
|
+
welcome: "Welcome to BB Desktop!",
|
|
159
|
+
"welcome.message": "Get started by creating a new file or opening an existing one.",
|
|
160
|
+
"version.current": "Current Version",
|
|
161
|
+
"version.latest": "Latest Version",
|
|
162
|
+
"version.out_of_date": "An update is available!",
|
|
163
|
+
"version.up_to_date": "You are using the latest version.",
|
|
164
|
+
"update.check": "Check for Updates",
|
|
165
|
+
"update.download": "Download Update",
|
|
166
|
+
"update.release_notes": "Release Notes",
|
|
167
|
+
install_and_restart: "Install and Restart",
|
|
168
|
+
later: "Later",
|
|
169
|
+
close: "Close",
|
|
170
|
+
about: "About",
|
|
171
|
+
change_log: "Change Log",
|
|
172
|
+
documentation: "Documentation",
|
|
173
|
+
"report.issue": "Report Issue",
|
|
174
|
+
"folder.new": "New Folder",
|
|
175
|
+
"folder.new.placeholder": "Press enter to add folder",
|
|
176
|
+
"folder.open": "Open folder",
|
|
177
|
+
"folder.open.message": "You can open a folder",
|
|
178
|
+
"folder.open.description": "Opening a folder allows you to create a project, and save all files in that folder",
|
|
179
|
+
"project.download": "Download Project",
|
|
180
|
+
"project.download.title": "You can download a project",
|
|
181
|
+
"project.download.description": " You browse the projects that you backed up in the clouds and download them to your computer",
|
|
182
|
+
"project.select": "Select project",
|
|
183
|
+
"project.select.title": "You can select a previous project",
|
|
184
|
+
"project.select.description": "Go into your file system to select a previously saved project",
|
|
185
|
+
"project.new": "New Project",
|
|
186
|
+
tags: "Tags",
|
|
187
|
+
"tag.input.placeholder": "Press enter to add tag",
|
|
188
|
+
category: "Category",
|
|
189
|
+
"category.select": "Select category",
|
|
190
|
+
"project.title": "Project Title",
|
|
191
|
+
"project.title.placeholder": "The tales of two cities",
|
|
192
|
+
"project.description": "What is your story about",
|
|
193
|
+
"project.description.placeholder": "This is a story about...",
|
|
194
|
+
email: "Email",
|
|
195
|
+
"email.placeholder": "example@email.com",
|
|
196
|
+
password: "Password",
|
|
197
|
+
"password.placeholder": "********",
|
|
198
|
+
username: "username",
|
|
199
|
+
"username.placeholder": "@bb-author",
|
|
200
|
+
"workspace.select": "Select workspace",
|
|
201
|
+
"workspace.select.description": "Select a folder where all your projects will be saved",
|
|
202
|
+
"file.explorer": "File explorer",
|
|
203
|
+
"no_workspace.message": "Select a workspace to start working on your next project",
|
|
204
|
+
"folder.select.placeholder": "./path/to/project",
|
|
205
|
+
"folder.select": "Select folder",
|
|
206
|
+
"folder.rename": "Rename Folder",
|
|
207
|
+
"folder.duplicate": "Duplicate Folder",
|
|
208
|
+
"folder.paste": "Paste into Folder",
|
|
209
|
+
"folder.cut": "Cut Folder",
|
|
210
|
+
"folder.copy": "Copy Folder",
|
|
211
|
+
"folder.delete": "Delete Folder",
|
|
212
|
+
folder: "Folder",
|
|
213
|
+
"folder.location.open": "Open Folder Location",
|
|
214
|
+
"checkpoint.list.header": "Checkpoints",
|
|
215
|
+
"checkpoint.placeholder": "Checkpoint message...",
|
|
216
|
+
"checkpoint.button": "Save checkpoint",
|
|
217
|
+
"git.stage.all": "Add all to stage",
|
|
218
|
+
"git.discard.all": "Discard all changes",
|
|
219
|
+
"git.stage": "Add to stage",
|
|
220
|
+
"git.discard": "Discard changes",
|
|
221
|
+
"git.discard.message": "Are you sure you want to discard all changes?",
|
|
222
|
+
"git.unstage.all": "Remove all from stage",
|
|
223
|
+
"git.unstage": "Remove from stage",
|
|
224
|
+
changes: "Changes",
|
|
225
|
+
history: "History",
|
|
226
|
+
home: "Home",
|
|
227
|
+
cancel: "Cancel",
|
|
228
|
+
confirm: "Confirm",
|
|
229
|
+
"plugin.install": "Install plugin",
|
|
230
|
+
"project.create": "Create project",
|
|
231
|
+
"checkpoint.save": "Save checkpoint",
|
|
232
|
+
"file.delete.warning": "Are you sure you want to delete this file? This action cannot be undone.",
|
|
233
|
+
"folder.delete.warning": "Are you sure you want to delete this folder? This action cannot be undone.",
|
|
234
|
+
delete: "Delete",
|
|
235
|
+
"placeholder.text": "This is a placeholder text",
|
|
236
|
+
"placeholder.click": "Click me",
|
|
237
|
+
"placeholder.label": "Label",
|
|
238
|
+
find: "Find",
|
|
239
|
+
replace: "Replace",
|
|
240
|
+
"replace.all": "Replace all",
|
|
241
|
+
previous: "Previous",
|
|
242
|
+
next: "Next",
|
|
243
|
+
"search.use.regex": "Use regex",
|
|
244
|
+
"search.case.sensitive": "Case sensitive",
|
|
245
|
+
"plugins.search": "Search Plugins in Marketplace",
|
|
246
|
+
install: "Install",
|
|
247
|
+
uninstall: "Uninstall",
|
|
248
|
+
repository: "Repository"
|
|
249
|
+
};
|
|
250
|
+
var en_GB_default = enGB;
|
|
251
|
+
|
|
252
|
+
// src/locales/fr-FR.ts
|
|
253
|
+
var frFR = {
|
|
254
|
+
"language.british_english": "Anglais britannique",
|
|
255
|
+
"language.french": "Fran\xE7ais (France)",
|
|
256
|
+
"file.new": "Nouveau fichier",
|
|
257
|
+
"file.new.placeholder": "Appuyez sur Entr\xE9e pour ajouter un fichier",
|
|
258
|
+
"file.open": "Ouvrir le fichier",
|
|
259
|
+
"file.duplicate": "Dupliquer le fichier",
|
|
260
|
+
"file.delete": "Supprimer le fichier",
|
|
261
|
+
"file.rename": "Renommer le fichier",
|
|
262
|
+
"file.close": "Fermer le fichier",
|
|
263
|
+
"file.cut": "Couper le fichier",
|
|
264
|
+
"file.copy": "Copier le fichier",
|
|
265
|
+
"file.export_html": "Exporter au format HTML",
|
|
266
|
+
"file.export_pdf": "Exporter au format PDF",
|
|
267
|
+
"file.print": "Imprimer le fichier",
|
|
268
|
+
"file.location.open": "Ouvrir l'emplacement du fichier",
|
|
269
|
+
file: "Fichier",
|
|
270
|
+
edit: "Modifier",
|
|
271
|
+
view: "Afficher",
|
|
272
|
+
help: "Aide",
|
|
273
|
+
welcome: "Bienvenue sur BB Desktop !",
|
|
274
|
+
"welcome.message": "Obtenir Commencer par cr\xE9er un nouveau fichier ou en ouvrir un existant.",
|
|
275
|
+
"version.current": "Version actuelle",
|
|
276
|
+
"version.latest": "Derni\xE8re version",
|
|
277
|
+
"version.out_of_date": "Une mise \xE0 jour est disponible !",
|
|
278
|
+
"version.up_to_date": "Vous utilisez la derni\xE8re version.",
|
|
279
|
+
"update.check": "Rechercher les mises \xE0 jour",
|
|
280
|
+
"update.download": "T\xE9l\xE9charger la mise \xE0 jour",
|
|
281
|
+
"update.release_notes": "Notes de version",
|
|
282
|
+
install_and_restart: "Installer et red\xE9marrer",
|
|
283
|
+
later: "Plus tard",
|
|
284
|
+
close: "Fermer",
|
|
285
|
+
about: "\xC0 propos",
|
|
286
|
+
change_log: "Journal des modifications",
|
|
287
|
+
documentation: "Documentation",
|
|
288
|
+
"report.issue": "Signaler un probl\xE8me",
|
|
289
|
+
"folder.new": "Nouveau dossier",
|
|
290
|
+
"folder.new.placeholder": "Appuyez sur Entr\xE9e pour ajouter un dossier",
|
|
291
|
+
"folder.open": "Ouvrir un dossier",
|
|
292
|
+
"folder.open.message": "Vous pouvez ouvrir un dossier",
|
|
293
|
+
"folder.open.description": "Ouvrir un dossier vous permet de cr\xE9er un projet et d'enregistrer tous les fichiers qu'il contient.",
|
|
294
|
+
"project.download": "T\xE9l\xE9charger le projet",
|
|
295
|
+
"project.download.title": "Vous pouvez t\xE9l\xE9charger un projet.",
|
|
296
|
+
"project.download.description": "Parcourez les projets sauvegard\xE9s dans le cloud et t\xE9l\xE9chargez-les sur votre ordinateur.",
|
|
297
|
+
"project.select": "S\xE9lectionner un projet.",
|
|
298
|
+
"project.select.title": "Vous pouvez s\xE9lectionner un projet pr\xE9c\xE9dent.",
|
|
299
|
+
"project.select.description": "Acc\xE9dez \xE0 votre syst\xE8me de fichiers pour s\xE9lectionner un projet pr\xE9c\xE9demment enregistr\xE9.",
|
|
300
|
+
"project.new": "Nouveau projet.",
|
|
301
|
+
tags: "\xC9tiquettes",
|
|
302
|
+
"tag.input.placeholder": "Appuyez sur Entr\xE9e pour ajouter une \xE9tiquette.",
|
|
303
|
+
category: "Cat\xE9gorie",
|
|
304
|
+
"category.select": "S\xE9lectionnez une cat\xE9gorie.",
|
|
305
|
+
"project.title": "Titre du projet.",
|
|
306
|
+
"project.title.placeholder": "Les contes de deux villes.",
|
|
307
|
+
"project.description": "De quoi parle votre histoire\xA0?",
|
|
308
|
+
"project.description.placeholder": "Ceci est une histoire sur...",
|
|
309
|
+
email: "Email",
|
|
310
|
+
"email.placeholder": "example@email.com",
|
|
311
|
+
password: "Password",
|
|
312
|
+
"password.placeholder": "********",
|
|
313
|
+
username: "username",
|
|
314
|
+
"username.placeholder": "@bb-author",
|
|
315
|
+
"workspace.select": "S\xE9lectionnez un espace de travail",
|
|
316
|
+
"workspace.select.description": "S\xE9lectionnez un dossier o\xF9 tous vos projets seront enregistr\xE9s",
|
|
317
|
+
"file.explorer": "Explorateur de fichiers",
|
|
318
|
+
"no_workspace.message": "S\xE9lectionnez un espace de travail pour commencer \xE0 travailler sur votre prochain projet",
|
|
319
|
+
"folder.select.placeholder": "./chemin/vers/projet",
|
|
320
|
+
"folder.select": "S\xE9lectionnez un dossier",
|
|
321
|
+
"folder.rename": "Renommer le dossier",
|
|
322
|
+
"folder.duplicate": "Dupliquer le dossier",
|
|
323
|
+
"folder.paste": "Coller dans le dossier",
|
|
324
|
+
"folder.cut": "Couper le dossier",
|
|
325
|
+
"folder.copy": "Copier le dossier",
|
|
326
|
+
"folder.delete": "Supprimer le dossier",
|
|
327
|
+
folder: "Dossier",
|
|
328
|
+
"folder.location.open": "Ouvrir l'emplacement du dossier",
|
|
329
|
+
"checkpoint.list.header": "Points de contr\xF4le",
|
|
330
|
+
"checkpoint.placeholder": "Message du point de contr\xF4le...",
|
|
331
|
+
"checkpoint.button": "Enregistrer le point de contr\xF4le",
|
|
332
|
+
"git.stage.all": "Ajouter tout \xE0 la zone de pr\xE9paration",
|
|
333
|
+
"git.discard.all": "Annuler toutes les modifications",
|
|
334
|
+
"git.stage": "Ajouter \xE0 la zone de pr\xE9paration",
|
|
335
|
+
"git.discard": "Annuler les modifications",
|
|
336
|
+
"git.discard.message": "\xCAtes-vous s\xFBr de vouloir annuler toutes les modifications ?",
|
|
337
|
+
"git.unstage.all": "Retirer tout de la zone de pr\xE9paration",
|
|
338
|
+
"git.unstage": "Retirer de la zone de pr\xE9paration",
|
|
339
|
+
changes: "Modifications",
|
|
340
|
+
history: "Historique",
|
|
341
|
+
home: "Accueil",
|
|
342
|
+
cancel: "Annuler",
|
|
343
|
+
confirm: "Confirmer",
|
|
344
|
+
"plugin.install": "Installer le plugin",
|
|
345
|
+
"project.create": "Cr\xE9er projet",
|
|
346
|
+
"checkpoint.save": "Enregistrer le point de contr\xF4le",
|
|
347
|
+
"file.delete.warning": "\xCAtes-vous s\xFBr de vouloir supprimer ce fichier\xA0? Cette action est irr\xE9versible.",
|
|
348
|
+
"folder.delete.warning": "\xCAtes-vous s\xFBr de vouloir supprimer ce dossier\xA0? Cette action est irr\xE9versible.",
|
|
349
|
+
delete: "Supprimer",
|
|
350
|
+
"placeholder.text": "Ceci est un texte d'espace r\xE9serv\xE9",
|
|
351
|
+
"placeholder.click": "Cliquez ici",
|
|
352
|
+
"placeholder.label": "\xC9tiquette",
|
|
353
|
+
find: "Rechercher",
|
|
354
|
+
replace: "Remplacer",
|
|
355
|
+
"replace.all": "Tout remplacer",
|
|
356
|
+
previous: "Pr\xE9c\xE9dent",
|
|
357
|
+
next: "Suivant",
|
|
358
|
+
"search.use.regex": "Utiliser une expression r\xE9guli\xE8re",
|
|
359
|
+
"search.case.sensitive": "Respecter la casse",
|
|
360
|
+
"plugins.search": "Rechercher des plugins dans le Marketplace",
|
|
361
|
+
install: "Installer",
|
|
362
|
+
uninstall: "D\xE9sinstaller",
|
|
363
|
+
repository: "D\xE9p\xF4t"
|
|
364
|
+
};
|
|
365
|
+
var fr_FR_default = frFR;
|
|
366
|
+
|
|
367
|
+
// src/index.ts
|
|
368
|
+
var src_default = BBRelay;
|
|
369
|
+
export {
|
|
370
|
+
src_default as default,
|
|
371
|
+
en_GB_default as enGB,
|
|
372
|
+
fr_FR_default as frFR,
|
|
373
|
+
injectStyles,
|
|
374
|
+
registerEvent,
|
|
375
|
+
registerRequest
|
|
376
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import { defineConfig } from "eslint/config";
|
|
5
|
+
|
|
6
|
+
export default defineConfig([
|
|
7
|
+
{
|
|
8
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
|
|
9
|
+
plugins: { js },
|
|
10
|
+
extends: ["js/recommended"],
|
|
11
|
+
languageOptions: { globals: globals.browser },
|
|
12
|
+
},
|
|
13
|
+
tseslint.configs.recommended,
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
]);
|
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bb-relay",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "For managing bb-editor extension",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Ade Adeola",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"privateExports": [
|
|
13
|
+
"./dev"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"style": "./dist/index.css",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./dev": {
|
|
23
|
+
"types": "./dist/dev.d.ts",
|
|
24
|
+
"import": "./dist/dev.mjs",
|
|
25
|
+
"require": "./dist/dev.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"prepare": "husky",
|
|
32
|
+
"preversion": "npm test",
|
|
33
|
+
"version": "npm run build && git add -A dist",
|
|
34
|
+
"postversion": "git push && git push --tags && npm publish"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@electron-toolkit/tsconfig": "^2.0.0",
|
|
38
|
+
"@eslint/js": "^9.36.0",
|
|
39
|
+
"@faker-js/faker": "^9.9.0",
|
|
40
|
+
"@types/jest": "^30.0.0",
|
|
41
|
+
"@types/path-browserify": "^1.0.3",
|
|
42
|
+
"esbuild-css-modules-plugin": "^3.1.5",
|
|
43
|
+
"eslint": "^9.36.0",
|
|
44
|
+
"globals": "^16.4.0",
|
|
45
|
+
"husky": "^9.1.7",
|
|
46
|
+
"idb": "^8.0.3",
|
|
47
|
+
"jest": "^30.0.3",
|
|
48
|
+
"jest-environment-jsdom": "^30.0.2",
|
|
49
|
+
"jiti": "^2.6.0",
|
|
50
|
+
"mime": "^4.0.7",
|
|
51
|
+
"path-browserify": "^1.0.1",
|
|
52
|
+
"react": "^19.1.0",
|
|
53
|
+
"ts-jest": "^29.4.0",
|
|
54
|
+
"tsup": "^8.5.0",
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"typescript-eslint": "^8.44.1",
|
|
57
|
+
"uuid": "^11.1.0",
|
|
58
|
+
"zustand": "^5.0.6"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/src/dev.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import BBRelay from "./relay";
|
|
2
|
+
import DirInfo from "./types/dir/DirInfo";
|
|
3
|
+
import BBEvent from "./types/BBEvent";
|
|
4
|
+
import EventReturn from "./types/EventReturn";
|
|
5
|
+
import FileInfo from "./types/files/FileInfo";
|
|
6
|
+
import Load from "./types/status/Load";
|
|
7
|
+
import registerEvent from "./relay/registerEvent";
|
|
8
|
+
import registerRequest from "./relay/registerRequest";
|
|
9
|
+
import BBRequest from "./types/BBRequest";
|
|
10
|
+
import RequestReturn from "./types/RequestReturn";
|
|
11
|
+
import injectStyles from "./utils/inject-styles";
|
|
12
|
+
import Checkpoint from "./types/Checkpoint";
|
|
13
|
+
import CopyArg from "./types/CopyArg";
|
|
14
|
+
import { WatchFSEvent } from "./types/WatchFSEvent";
|
|
15
|
+
import { User } from "./types/User";
|
|
16
|
+
import DirectoryContents from "./types/DirectoryContents";
|
|
17
|
+
import { DirectoryStats } from "./types/DirectoryStats";
|
|
18
|
+
import FileContent from "./types/FileContent";
|
|
19
|
+
import GitFileStatus from "./types/GitFileStatus";
|
|
20
|
+
import IconArg from "./types/IconArg";
|
|
21
|
+
import Language from "./types/Language";
|
|
22
|
+
import Locale from "./types/Locale";
|
|
23
|
+
import { MenuContent } from "./types/MenuContent";
|
|
24
|
+
import Nav from "./types/Nav";
|
|
25
|
+
import { PluginItem } from "./types/PluginItem";
|
|
26
|
+
import Project from "./types/project/Project";
|
|
27
|
+
import { RenameType } from "./types/RenameType";
|
|
28
|
+
import Result from "./types/Result";
|
|
29
|
+
import { Route } from "./types/Route";
|
|
30
|
+
import { Settings } from "./types/Settings";
|
|
31
|
+
import { TutorialHeader } from "./types/TutorialHeader";
|
|
32
|
+
import enGB from "./locales/en-GB";
|
|
33
|
+
import frFR from "./locales/fr-FR";
|
|
34
|
+
|
|
35
|
+
export default BBRelay;
|
|
36
|
+
|
|
37
|
+
export { registerRequest, injectStyles, registerEvent };
|
|
38
|
+
|
|
39
|
+
export type {
|
|
40
|
+
BBRequest,
|
|
41
|
+
DirInfo,
|
|
42
|
+
FileInfo,
|
|
43
|
+
Load,
|
|
44
|
+
BBEvent,
|
|
45
|
+
RequestReturn,
|
|
46
|
+
EventReturn,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type {
|
|
50
|
+
Checkpoint,
|
|
51
|
+
CopyArg,
|
|
52
|
+
DirectoryContents,
|
|
53
|
+
DirectoryStats,
|
|
54
|
+
FileContent,
|
|
55
|
+
GitFileStatus,
|
|
56
|
+
IconArg,
|
|
57
|
+
Language,
|
|
58
|
+
Locale,
|
|
59
|
+
MenuContent,
|
|
60
|
+
Nav,
|
|
61
|
+
PluginItem,
|
|
62
|
+
Project,
|
|
63
|
+
RenameType,
|
|
64
|
+
Result,
|
|
65
|
+
Route,
|
|
66
|
+
Settings,
|
|
67
|
+
TutorialHeader,
|
|
68
|
+
User,
|
|
69
|
+
WatchFSEvent,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { enGB, frFR };
|