bb-relay 0.0.37 → 0.0.39

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.
@@ -164,6 +164,17 @@ declare const enGB: {
164
164
  rename: string;
165
165
  "issues.report": string;
166
166
  "feature.request": string;
167
+ zen: string;
168
+ "direction.toggle": string;
169
+ tips: string;
170
+ changelog: string;
171
+ "app.quit": string;
172
+ project: string;
173
+ "project.sync": string;
174
+ "project.close": string;
175
+ "help.starting": string;
176
+ "developer.tools.toggle": string;
177
+ socials: string;
167
178
  };
168
179
 
169
180
  type Language = keyof typeof enGB;
@@ -164,6 +164,17 @@ declare const enGB: {
164
164
  rename: string;
165
165
  "issues.report": string;
166
166
  "feature.request": string;
167
+ zen: string;
168
+ "direction.toggle": string;
169
+ tips: string;
170
+ changelog: string;
171
+ "app.quit": string;
172
+ project: string;
173
+ "project.sync": string;
174
+ "project.close": string;
175
+ "help.starting": string;
176
+ "developer.tools.toggle": string;
177
+ socials: string;
167
178
  };
168
179
 
169
180
  type Language = keyof typeof enGB;
package/dist/editor.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { C as Commit } from './Commit-PdsjrKSG.mjs';
2
2
  export { a as FileStat, F as FolderContent, b as FolderStat } from './FolderStat-Bhmwwc0t.mjs';
3
3
  export { F as FileContent } from './FileContent-CXlulSZq.mjs';
4
- import { L as Language, a as Locale } from './Locale-Ehh56foM.mjs';
4
+ import { L as Language, a as Locale } from './Locale-DQ4a71QR.mjs';
5
5
  export { R as Result } from './Result-BLbZLEgX.mjs';
6
6
 
7
7
  type CopyArg = {
@@ -29,7 +29,7 @@ interface MenuContent {
29
29
  onClick?: () => void;
30
30
  }
31
31
 
32
- type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote" | "help" | "settings" | "notifications" | "dev";
32
+ type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote" | "help" | "settings" | "dev";
33
33
 
34
34
  type Route = "welcome" | "project" | "new-project" | "settings" | "updates";
35
35
 
@@ -38,7 +38,6 @@ declare const SHORTCUTS: Language[];
38
38
  type ShortcutID = Extract<Language, (typeof SHORTCUTS)[number]>;
39
39
  type Shortcut = {
40
40
  id: ShortcutID;
41
- name: string;
42
41
  description: string;
43
42
  keys: string[];
44
43
  };
@@ -49,7 +48,6 @@ type Settings = {
49
48
  autoUpdate: boolean;
50
49
  direction: "ltr" | "rtl";
51
50
  showAllFile: boolean;
52
- trashBehaviour: "permanent" | "trash";
53
51
  shortcuts: Shortcut[];
54
52
  theme: string;
55
53
  isDev: boolean;
@@ -58,6 +56,7 @@ type Settings = {
58
56
  */
59
57
  registry: Record<string, string>;
60
58
  mute: boolean;
59
+ icon: string;
61
60
  };
62
61
 
63
62
  interface TutorialHeader {
package/dist/editor.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { C as Commit } from './Commit-PdsjrKSG.js';
2
2
  export { a as FileStat, F as FolderContent, b as FolderStat } from './FolderStat-Bhmwwc0t.js';
3
3
  export { F as FileContent } from './FileContent-CXlulSZq.js';
4
- import { L as Language, a as Locale } from './Locale-Ehh56foM.js';
4
+ import { L as Language, a as Locale } from './Locale-DQ4a71QR.js';
5
5
  export { R as Result } from './Result-BLbZLEgX.js';
6
6
 
7
7
  type CopyArg = {
@@ -29,7 +29,7 @@ interface MenuContent {
29
29
  onClick?: () => void;
30
30
  }
31
31
 
32
- type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote" | "help" | "settings" | "notifications" | "dev";
32
+ type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote" | "help" | "settings" | "dev";
33
33
 
34
34
  type Route = "welcome" | "project" | "new-project" | "settings" | "updates";
35
35
 
@@ -38,7 +38,6 @@ declare const SHORTCUTS: Language[];
38
38
  type ShortcutID = Extract<Language, (typeof SHORTCUTS)[number]>;
39
39
  type Shortcut = {
40
40
  id: ShortcutID;
41
- name: string;
42
41
  description: string;
43
42
  keys: string[];
44
43
  };
@@ -49,7 +48,6 @@ type Settings = {
49
48
  autoUpdate: boolean;
50
49
  direction: "ltr" | "rtl";
51
50
  showAllFile: boolean;
52
- trashBehaviour: "permanent" | "trash";
53
51
  shortcuts: Shortcut[];
54
52
  theme: string;
55
53
  isDev: boolean;
@@ -58,6 +56,7 @@ type Settings = {
58
56
  */
59
57
  registry: Record<string, string>;
60
58
  mute: boolean;
59
+ icon: string;
61
60
  };
62
61
 
63
62
  interface TutorialHeader {
package/dist/index.d.mts CHANGED
@@ -17,10 +17,15 @@ type Manifest = {
17
17
  name: string;
18
18
  description?: string;
19
19
  keyword?: string[];
20
+ permissions: Permission[];
21
+ manifest_version: 1;
22
+ version: string;
23
+ author?: string;
24
+ homepage?: string;
25
+ repository?: string;
20
26
  sidebar?: {
21
27
  icon: string;
22
28
  title: string;
23
- path: string;
24
29
  };
25
30
  main?: {
26
31
  path: string;
@@ -28,16 +33,10 @@ type Manifest = {
28
33
  extensions: string[];
29
34
  icon?: string;
30
35
  };
31
- permissions: Permission[];
32
- iconsPath?: string;
33
- manifest_version: 1;
34
- version: string;
35
- author?: string;
36
- homepage?: string;
37
- repository?: string;
36
+ icons?: string;
38
37
  theme?: string;
38
+ entry?: string;
39
39
  [key: string]: unknown;
40
- status?: string;
41
40
  };
42
41
 
43
42
  declare const validateManifest: (manifestContent: string) => {
package/dist/index.d.ts CHANGED
@@ -17,10 +17,15 @@ type Manifest = {
17
17
  name: string;
18
18
  description?: string;
19
19
  keyword?: string[];
20
+ permissions: Permission[];
21
+ manifest_version: 1;
22
+ version: string;
23
+ author?: string;
24
+ homepage?: string;
25
+ repository?: string;
20
26
  sidebar?: {
21
27
  icon: string;
22
28
  title: string;
23
- path: string;
24
29
  };
25
30
  main?: {
26
31
  path: string;
@@ -28,16 +33,10 @@ type Manifest = {
28
33
  extensions: string[];
29
34
  icon?: string;
30
35
  };
31
- permissions: Permission[];
32
- iconsPath?: string;
33
- manifest_version: 1;
34
- version: string;
35
- author?: string;
36
- homepage?: string;
37
- repository?: string;
36
+ icons?: string;
38
37
  theme?: string;
38
+ entry?: string;
39
39
  [key: string]: unknown;
40
- status?: string;
41
40
  };
42
41
 
43
42
  declare const validateManifest: (manifestContent: string) => {
package/dist/index.js CHANGED
@@ -36,39 +36,46 @@ var validateManifest = (manifestContent) => {
36
36
  if (content.main) {
37
37
  if (!content.main.path) {
38
38
  errors.push("Manifest main path is missing");
39
- } else if (!content.main.type) {
39
+ } else {
40
+ fileChecks.push(content.main.path);
41
+ }
42
+ if (!content.main.type) {
40
43
  errors.push("Manifest main type is missing");
41
- } else if (!content.main.extensions) {
44
+ }
45
+ if (!content.main.extensions) {
42
46
  errors.push("Manifest main extensions is missing");
43
47
  } else if (!Array.isArray(content.main.extensions)) {
44
48
  errors.push("Manifest main extensions is not an array");
45
49
  } else if (content.main.extensions.length === 0) {
46
50
  errors.push("Manifest main extensions is empty");
47
- } else {
48
- fileChecks.push(content.main.path);
49
51
  }
50
52
  }
51
53
  if (content.sidebar) {
52
54
  if (!content.sidebar.icon) {
53
55
  errors.push("Manifest sidebar icon is missing");
54
- } else if (!content.sidebar.title) {
55
- errors.push("Manifest sidebar title is missing");
56
- } else if (content.sidebar.path) {
57
- if (!content.sidebar.path.endsWith(".js")) {
58
- errors.push("Manifest sidebar path must be a js file");
59
- } else fileChecks.push(content.sidebar.path);
60
56
  } else {
61
57
  fileChecks.push(content.sidebar.icon);
62
58
  }
59
+ if (!content.sidebar.title) {
60
+ errors.push("Manifest sidebar title is missing");
61
+ }
63
62
  }
64
- if (content.status) {
65
- fileChecks.push(content.status);
63
+ if (content.entry) {
64
+ if (!content.entry.endsWith(".js"))
65
+ errors.push("Entry file is not a javascript file");
66
+ else fileChecks.push(content.entry);
66
67
  }
67
- if (content.iconsPath) {
68
- fileChecks.push(content.iconsPath + "/bb.png");
68
+ if (content.icons) {
69
+ fileChecks.push(content.icons + "/bb.png");
70
+ fileChecks.push(content.icons + "/bbe.png");
71
+ fileChecks.push(content.icons + "/default.png");
72
+ fileChecks.push(content.icons + "/folder.png");
73
+ fileChecks.push(content.icons + "/folder-open.png");
69
74
  }
70
75
  if (content.theme) {
71
- fileChecks.push(content.theme);
76
+ if (!content.theme.endsWith(".css"))
77
+ errors.push("Theme file is not a css file");
78
+ else fileChecks.push(content.theme);
72
79
  }
73
80
  return {
74
81
  errors,
package/dist/index.mjs CHANGED
@@ -36,39 +36,46 @@ var validateManifest = (manifestContent) => {
36
36
  if (content.main) {
37
37
  if (!content.main.path) {
38
38
  errors.push("Manifest main path is missing");
39
- } else if (!content.main.type) {
39
+ } else {
40
+ fileChecks.push(content.main.path);
41
+ }
42
+ if (!content.main.type) {
40
43
  errors.push("Manifest main type is missing");
41
- } else if (!content.main.extensions) {
44
+ }
45
+ if (!content.main.extensions) {
42
46
  errors.push("Manifest main extensions is missing");
43
47
  } else if (!Array.isArray(content.main.extensions)) {
44
48
  errors.push("Manifest main extensions is not an array");
45
49
  } else if (content.main.extensions.length === 0) {
46
50
  errors.push("Manifest main extensions is empty");
47
- } else {
48
- fileChecks.push(content.main.path);
49
51
  }
50
52
  }
51
53
  if (content.sidebar) {
52
54
  if (!content.sidebar.icon) {
53
55
  errors.push("Manifest sidebar icon is missing");
54
- } else if (!content.sidebar.title) {
55
- errors.push("Manifest sidebar title is missing");
56
- } else if (content.sidebar.path) {
57
- if (!content.sidebar.path.endsWith(".js")) {
58
- errors.push("Manifest sidebar path must be a js file");
59
- } else fileChecks.push(content.sidebar.path);
60
56
  } else {
61
57
  fileChecks.push(content.sidebar.icon);
62
58
  }
59
+ if (!content.sidebar.title) {
60
+ errors.push("Manifest sidebar title is missing");
61
+ }
63
62
  }
64
- if (content.status) {
65
- fileChecks.push(content.status);
63
+ if (content.entry) {
64
+ if (!content.entry.endsWith(".js"))
65
+ errors.push("Entry file is not a javascript file");
66
+ else fileChecks.push(content.entry);
66
67
  }
67
- if (content.iconsPath) {
68
- fileChecks.push(content.iconsPath + "/bb.png");
68
+ if (content.icons) {
69
+ fileChecks.push(content.icons + "/bb.png");
70
+ fileChecks.push(content.icons + "/bbe.png");
71
+ fileChecks.push(content.icons + "/default.png");
72
+ fileChecks.push(content.icons + "/folder.png");
73
+ fileChecks.push(content.icons + "/folder-open.png");
69
74
  }
70
75
  if (content.theme) {
71
- fileChecks.push(content.theme);
76
+ if (!content.theme.endsWith(".css"))
77
+ errors.push("Theme file is not a css file");
78
+ else fileChecks.push(content.theme);
72
79
  }
73
80
  return {
74
81
  errors,
package/dist/locale.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as Language } from './Locale-Ehh56foM.mjs';
2
- export { a as Locale, e as enGB } from './Locale-Ehh56foM.mjs';
1
+ import { L as Language } from './Locale-DQ4a71QR.mjs';
2
+ export { a as Locale, e as enGB } from './Locale-DQ4a71QR.mjs';
3
3
 
4
4
  declare const frFR: {
5
5
  [key in Language]: string;
package/dist/locale.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as Language } from './Locale-Ehh56foM.js';
2
- export { a as Locale, e as enGB } from './Locale-Ehh56foM.js';
1
+ import { L as Language } from './Locale-DQ4a71QR.js';
2
+ export { a as Locale, e as enGB } from './Locale-DQ4a71QR.js';
3
3
 
4
4
  declare const frFR: {
5
5
  [key in Language]: string;
package/dist/locale.js CHANGED
@@ -164,7 +164,18 @@ var enGB = {
164
164
  "invert.selection": "Invert Selection",
165
165
  rename: "Rename",
166
166
  "issues.report": "Report Issues",
167
- "feature.request": "Feature Request"
167
+ "feature.request": "Feature Request",
168
+ zen: "Zen mode",
169
+ "direction.toggle": "Toggle LTR/RTL",
170
+ tips: "Tips",
171
+ changelog: "Release notes",
172
+ "app.quit": "Quit app",
173
+ project: "Project",
174
+ "project.sync": "Sync project",
175
+ "project.close": "Close project",
176
+ "help.starting": "Getting started",
177
+ "developer.tools.toggle": "Toggle Developer tools",
178
+ socials: "Socials"
168
179
  };
169
180
  var en_GB_default = enGB;
170
181
 
@@ -334,7 +345,18 @@ var frFR = {
334
345
  "invert.selection": "Inverser la s\xE9lection",
335
346
  rename: "Renommer",
336
347
  "issues.report": "Signaler un probl\xE8me",
337
- "feature.request": "Demande de fonctionnalit\xE9"
348
+ "feature.request": "Demande de fonctionnalit\xE9",
349
+ zen: "Activer le mode Zen",
350
+ "direction.toggle": "Basculer LTR/RTL",
351
+ tips: "Astuces",
352
+ changelog: "Notes de version",
353
+ "app.quit": "Quitter l'application",
354
+ project: "Projet",
355
+ "project.sync": "Synchroniser le projet",
356
+ "project.close": "Fermer le projet",
357
+ "help.starting": "Getting started",
358
+ "developer.tools.toggle": "(D\xE9s)activer les outils de d\xE9v",
359
+ socials: "Sociaux"
338
360
  };
339
361
  var fr_FR_default = frFR;
340
362
 
package/dist/locale.mjs CHANGED
@@ -164,7 +164,18 @@ var enGB = {
164
164
  "invert.selection": "Invert Selection",
165
165
  rename: "Rename",
166
166
  "issues.report": "Report Issues",
167
- "feature.request": "Feature Request"
167
+ "feature.request": "Feature Request",
168
+ zen: "Zen mode",
169
+ "direction.toggle": "Toggle LTR/RTL",
170
+ tips: "Tips",
171
+ changelog: "Release notes",
172
+ "app.quit": "Quit app",
173
+ project: "Project",
174
+ "project.sync": "Sync project",
175
+ "project.close": "Close project",
176
+ "help.starting": "Getting started",
177
+ "developer.tools.toggle": "Toggle Developer tools",
178
+ socials: "Socials"
168
179
  };
169
180
  var en_GB_default = enGB;
170
181
 
@@ -334,7 +345,18 @@ var frFR = {
334
345
  "invert.selection": "Inverser la s\xE9lection",
335
346
  rename: "Renommer",
336
347
  "issues.report": "Signaler un probl\xE8me",
337
- "feature.request": "Demande de fonctionnalit\xE9"
348
+ "feature.request": "Demande de fonctionnalit\xE9",
349
+ zen: "Activer le mode Zen",
350
+ "direction.toggle": "Basculer LTR/RTL",
351
+ tips: "Astuces",
352
+ changelog: "Notes de version",
353
+ "app.quit": "Quitter l'application",
354
+ project: "Projet",
355
+ "project.sync": "Synchroniser le projet",
356
+ "project.close": "Fermer le projet",
357
+ "help.starting": "Getting started",
358
+ "developer.tools.toggle": "(D\xE9s)activer les outils de d\xE9v",
359
+ socials: "Sociaux"
338
360
  };
339
361
  var fr_FR_default = frFR;
340
362
  export {
package/dist/plugin.d.mts CHANGED
@@ -156,7 +156,7 @@ type StatusElement = {
156
156
  iconLeft?: IconName;
157
157
  iconRight?: IconName;
158
158
  message?: string;
159
- text?: string;
159
+ text?: string | number;
160
160
  };
161
161
  type RenderStatusType = {
162
162
  element: StatusElement[];
@@ -229,7 +229,7 @@ declare abstract class Plugin<T extends Record<string, unknown>> {
229
229
  * You will also need to set initial state here
230
230
  */
231
231
  abstract init(): T;
232
- protected render(message: "sidebar" | "modal", arg: ElementInstruction): void;
232
+ protected updateRender(): void;
233
233
  /**
234
234
  * Used to determine what will be shown at the sidebar whenever a user navigates
235
235
  * to it.
@@ -283,7 +283,6 @@ declare abstract class Plugin<T extends Record<string, unknown>> {
283
283
  protected on(event: "ping", callback: (arg: unknown) => void): void;
284
284
  renderStatusBar?(): RenderStatusType | null;
285
285
  private registerStatus;
286
- private onStatusLoad;
287
286
  protected setState(param: SetState<T>): void;
288
287
  protected getState(): T;
289
288
  protected log(message: string): void;
package/dist/plugin.d.ts CHANGED
@@ -156,7 +156,7 @@ type StatusElement = {
156
156
  iconLeft?: IconName;
157
157
  iconRight?: IconName;
158
158
  message?: string;
159
- text?: string;
159
+ text?: string | number;
160
160
  };
161
161
  type RenderStatusType = {
162
162
  element: StatusElement[];
@@ -229,7 +229,7 @@ declare abstract class Plugin<T extends Record<string, unknown>> {
229
229
  * You will also need to set initial state here
230
230
  */
231
231
  abstract init(): T;
232
- protected render(message: "sidebar" | "modal", arg: ElementInstruction): void;
232
+ protected updateRender(): void;
233
233
  /**
234
234
  * Used to determine what will be shown at the sidebar whenever a user navigates
235
235
  * to it.
@@ -283,7 +283,6 @@ declare abstract class Plugin<T extends Record<string, unknown>> {
283
283
  protected on(event: "ping", callback: (arg: unknown) => void): void;
284
284
  renderStatusBar?(): RenderStatusType | null;
285
285
  private registerStatus;
286
- private onStatusLoad;
287
286
  protected setState(param: SetState<T>): void;
288
287
  protected getState(): T;
289
288
  protected log(message: string): void;
package/dist/plugin.js CHANGED
@@ -56,13 +56,11 @@ var Plugin = class {
56
56
  this.index = -1;
57
57
  this.eventIds.forEach((event) => this.off(event));
58
58
  this.eventIds = [];
59
- const sidebar = _optionalChain([this, 'access', _ => _.renderSidebar, 'optionalCall', _2 => _2()]) || null;
60
- if (sidebar) this.render("sidebar", sidebar);
61
- const status = _optionalChain([this, 'access', _3 => _3.renderStatusBar, 'optionalCall', _4 => _4()]) || null;
62
- if (status) this.registerStatus();
59
+ this.updateRender();
63
60
  });
64
61
  this.onSidebarLoad();
65
- this.onStatusLoad();
62
+ this.registerStatus();
63
+ this.registerSubscription("destroy", this.destroy);
66
64
  }
67
65
  // -----------------------------
68
66
  // Element Factory
@@ -89,13 +87,18 @@ var Plugin = class {
89
87
  }
90
88
  };
91
89
  }
92
- render(message, arg) {
93
- this.sendMessage({ type: message, arg });
90
+ updateRender() {
91
+ this.index = -1;
92
+ this.sendMessage({
93
+ type: "sidebar-update",
94
+ arg: _optionalChain([this, 'access', _ => _.renderSidebar, 'optionalCall', _2 => _2()]) || null
95
+ });
96
+ this.registerStatus();
94
97
  }
95
98
  onSidebarLoad() {
96
99
  this.index = -1;
97
100
  this.registerHandler("sidebar-load", () => {
98
- return _optionalChain([this, 'access', _5 => _5.renderSidebar, 'optionalCall', _6 => _6()]) || null;
101
+ return _optionalChain([this, 'access', _3 => _3.renderSidebar, 'optionalCall', _4 => _4()]) || null;
99
102
  });
100
103
  }
101
104
  // -----------------------------
@@ -169,7 +172,7 @@ var Plugin = class {
169
172
  this.registerSubscription(event, callback);
170
173
  }
171
174
  registerStatus() {
172
- const arg = _optionalChain([this, 'access', _7 => _7.renderStatusBar, 'optionalCall', _8 => _8()]);
175
+ const arg = _optionalChain([this, 'access', _5 => _5.renderStatusBar, 'optionalCall', _6 => _6()]);
173
176
  if (!arg) return;
174
177
  const { onClick, ...rest } = arg;
175
178
  if (arg) {
@@ -181,19 +184,6 @@ var Plugin = class {
181
184
  if (onClick) this.registerSubscription("status-click", onClick);
182
185
  }
183
186
  }
184
- onStatusLoad() {
185
- this.registerHandler("status-load", () => {
186
- const statusBar = _optionalChain([this, 'access', _9 => _9.renderStatusBar, 'optionalCall', _10 => _10()]);
187
- if (statusBar) {
188
- const { onClick, ...rest } = statusBar;
189
- if (onClick) {
190
- this.registerSubscription("status-click", onClick);
191
- }
192
- return rest;
193
- }
194
- return null;
195
- });
196
- }
197
187
  // -----------------------------
198
188
  // State
199
189
  // -----------------------------
package/dist/plugin.mjs CHANGED
@@ -56,13 +56,11 @@ var Plugin = class {
56
56
  this.index = -1;
57
57
  this.eventIds.forEach((event) => this.off(event));
58
58
  this.eventIds = [];
59
- const sidebar = this.renderSidebar?.() || null;
60
- if (sidebar) this.render("sidebar", sidebar);
61
- const status = this.renderStatusBar?.() || null;
62
- if (status) this.registerStatus();
59
+ this.updateRender();
63
60
  });
64
61
  this.onSidebarLoad();
65
- this.onStatusLoad();
62
+ this.registerStatus();
63
+ this.registerSubscription("destroy", this.destroy);
66
64
  }
67
65
  // -----------------------------
68
66
  // Element Factory
@@ -89,8 +87,13 @@ var Plugin = class {
89
87
  }
90
88
  };
91
89
  }
92
- render(message, arg) {
93
- this.sendMessage({ type: message, arg });
90
+ updateRender() {
91
+ this.index = -1;
92
+ this.sendMessage({
93
+ type: "sidebar-update",
94
+ arg: this.renderSidebar?.() || null
95
+ });
96
+ this.registerStatus();
94
97
  }
95
98
  onSidebarLoad() {
96
99
  this.index = -1;
@@ -181,19 +184,6 @@ var Plugin = class {
181
184
  if (onClick) this.registerSubscription("status-click", onClick);
182
185
  }
183
186
  }
184
- onStatusLoad() {
185
- this.registerHandler("status-load", () => {
186
- const statusBar = this.renderStatusBar?.();
187
- if (statusBar) {
188
- const { onClick, ...rest } = statusBar;
189
- if (onClick) {
190
- this.registerSubscription("status-click", onClick);
191
- }
192
- return rest;
193
- }
194
- return null;
195
- });
196
- }
197
187
  // -----------------------------
198
188
  // State
199
189
  // -----------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-relay",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "For managing bb-editor extension",
5
5
  "license": "ISC",
6
6
  "author": "Ade Adeola",
@@ -4,7 +4,7 @@ export type StatusElement = {
4
4
  iconLeft?: IconName;
5
5
  iconRight?: IconName;
6
6
  message?: string;
7
- text?: string;
7
+ text?: string | number;
8
8
  };
9
9
 
10
10
  export type RenderStatusType = {
@@ -111,6 +111,7 @@ export abstract class Plugin<T extends Record<string, unknown>> {
111
111
  store: Store<T>;
112
112
  notify: (message: string) => void;
113
113
  }) {
114
+ // supply functions from the main app
114
115
  this.notify = notify;
115
116
  this.sendMessage = (arg) => sendMessage({ ...arg, pluginId });
116
117
  this.subscribe = subscribe;
@@ -119,24 +120,24 @@ export abstract class Plugin<T extends Record<string, unknown>> {
119
120
  this.pluginId = pluginId;
120
121
  this.editor = editor;
121
122
 
123
+ // Sync local state
122
124
  this.store = store;
123
125
  const value = store.get();
124
126
  this.setState({ ...this.init(), ...value });
125
127
 
128
+ // Store changes will trigger updates in sidebar and status if implemented
126
129
  this.store.subscribe((curr, prev) => {
127
130
  const isEqual = equal(curr, prev);
128
131
  if (isEqual) return;
129
132
  this.index = -1;
130
133
  this.eventIds.forEach((event) => this.off(event));
131
134
  this.eventIds = [];
132
- const sidebar = this.renderSidebar?.() || null;
133
- if (sidebar) this.render("sidebar", sidebar);
134
- const status = this.renderStatusBar?.() || null;
135
- if (status) this.registerStatus();
135
+ this.updateRender();
136
136
  });
137
137
 
138
138
  this.onSidebarLoad();
139
- this.onStatusLoad();
139
+ this.registerStatus();
140
+ this.registerSubscription("destroy", this.destroy);
140
141
  }
141
142
 
142
143
  // -----------------------------
@@ -196,12 +197,16 @@ export abstract class Plugin<T extends Record<string, unknown>> {
196
197
 
197
198
  abstract init(): T;
198
199
 
199
- protected render(
200
- message: "sidebar" | "modal",
201
- arg: ElementInstruction,
202
- ): void {
203
- this.sendMessage({ type: message, arg });
200
+ protected updateRender(): void {
201
+ this.index = -1;
202
+ this.sendMessage({
203
+ type: "sidebar-update",
204
+ arg: this.renderSidebar?.() || null,
205
+ });
206
+
207
+ this.registerStatus();
204
208
  }
209
+
205
210
  // -----------------------------
206
211
  // Sidebar
207
212
  // -----------------------------
@@ -368,20 +373,6 @@ export abstract class Plugin<T extends Record<string, unknown>> {
368
373
  }
369
374
  }
370
375
 
371
- private onStatusLoad(): void {
372
- this.registerHandler("status-load", () => {
373
- const statusBar = this.renderStatusBar?.();
374
- if (statusBar) {
375
- const { onClick, ...rest } = statusBar;
376
- if (onClick) {
377
- this.registerSubscription("status-click", onClick);
378
- }
379
- return rest;
380
- }
381
- return null;
382
- });
383
- }
384
-
385
376
  // -----------------------------
386
377
  // State
387
378
  // -----------------------------
@@ -30,44 +30,52 @@ const validateManifest = (manifestContent: string) => {
30
30
  if (content.main) {
31
31
  if (!content.main.path) {
32
32
  errors.push("Manifest main path is missing");
33
- } else if (!content.main.type) {
33
+ } else {
34
+ fileChecks.push(content.main.path);
35
+ }
36
+ if (!content.main.type) {
34
37
  errors.push("Manifest main type is missing");
35
- } else if (!content.main.extensions) {
38
+ }
39
+ if (!content.main.extensions) {
36
40
  errors.push("Manifest main extensions is missing");
37
41
  } else if (!Array.isArray(content.main.extensions)) {
38
42
  errors.push("Manifest main extensions is not an array");
39
43
  } else if (content.main.extensions.length === 0) {
40
44
  errors.push("Manifest main extensions is empty");
41
- } else {
42
- fileChecks.push(content.main.path);
43
45
  }
44
46
  }
45
47
 
46
48
  if (content.sidebar) {
47
49
  if (!content.sidebar.icon) {
48
50
  errors.push("Manifest sidebar icon is missing");
49
- } else if (!content.sidebar.title) {
50
- errors.push("Manifest sidebar title is missing");
51
- } else if (content.sidebar.path) {
52
- if (!content.sidebar.path.endsWith(".js")) {
53
- errors.push("Manifest sidebar path must be a js file");
54
- } else fileChecks.push(content.sidebar.path);
55
51
  } else {
56
52
  fileChecks.push(content.sidebar.icon);
57
53
  }
54
+ if (!content.sidebar.title) {
55
+ errors.push("Manifest sidebar title is missing");
56
+ }
58
57
  }
59
58
 
60
- if (content.status) {
61
- fileChecks.push(content.status);
59
+ if (content.entry) {
60
+ if (!content.entry.endsWith(".js"))
61
+ errors.push("Entry file is not a javascript file");
62
+ else fileChecks.push(content.entry);
62
63
  }
63
64
 
64
- if (content.iconsPath) {
65
- fileChecks.push(content.iconsPath + "/bb.png");
65
+ if (content.icons) {
66
+ fileChecks.push(content.icons + "/bb.png");
67
+ fileChecks.push(content.icons + "/bbe.png");
68
+ fileChecks.push(content.icons + "/default.png");
69
+ fileChecks.push(content.icons + "/folder.png");
70
+ fileChecks.push(content.icons + "/folder-open.png");
66
71
  }
67
72
 
68
73
  if (content.theme) {
69
- fileChecks.push(content.theme);
74
+ if (!content.theme.endsWith(".css"))
75
+ errors.push("Theme file is not a css file");
76
+ else fileChecks.push(content.theme);
70
77
  }
78
+
71
79
  return {
72
80
  errors,
73
81
  fileChecks,
@@ -173,6 +173,17 @@ export const enGB = {
173
173
  rename: "Rename",
174
174
  "issues.report": "Report Issues",
175
175
  "feature.request": "Feature Request",
176
+ zen: "Zen mode",
177
+ "direction.toggle": "Toggle LTR/RTL",
178
+ tips: "Tips",
179
+ changelog: "Release notes",
180
+ "app.quit": "Quit app",
181
+ project: "Project",
182
+ "project.sync": "Sync project",
183
+ "project.close": "Close project",
184
+ "help.starting": "Getting started",
185
+ "developer.tools.toggle": "Toggle Developer tools",
186
+ socials: "Socials",
176
187
  };
177
188
 
178
189
  export default enGB;
@@ -176,6 +176,17 @@ export const frFR: { [key in Language]: string } = {
176
176
  rename: "Renommer",
177
177
  "issues.report": "Signaler un problème",
178
178
  "feature.request": "Demande de fonctionnalité",
179
+ zen: "Activer le mode Zen",
180
+ "direction.toggle": "Basculer LTR/RTL",
181
+ tips: "Astuces",
182
+ changelog: "Notes de version",
183
+ "app.quit": "Quitter l'application",
184
+ project: "Projet",
185
+ "project.sync": "Synchroniser le projet",
186
+ "project.close": "Fermer le projet",
187
+ "help.starting": "Getting started",
188
+ "developer.tools.toggle": "(Dés)activer les outils de dév",
189
+ socials: "Sociaux",
179
190
  };
180
191
 
181
192
  export default frFR;
@@ -14,10 +14,15 @@ export type Manifest = {
14
14
  name: string;
15
15
  description?: string;
16
16
  keyword?: string[];
17
+ permissions: Permission[];
18
+ manifest_version: 1;
19
+ version: string;
20
+ author?: string;
21
+ homepage?: string;
22
+ repository?: string;
17
23
  sidebar?: {
18
24
  icon: string;
19
25
  title: string;
20
- path: string;
21
26
  };
22
27
  main?: {
23
28
  path: string;
@@ -25,14 +30,8 @@ export type Manifest = {
25
30
  extensions: string[];
26
31
  icon?: string;
27
32
  };
28
- permissions: Permission[];
29
- iconsPath?: string;
30
- manifest_version: 1;
31
- version: string;
32
- author?: string;
33
- homepage?: string;
34
- repository?: string;
33
+ icons?: string;
35
34
  theme?: string;
35
+ entry?: string;
36
36
  [key: string]: unknown;
37
- status?: string;
38
37
  };
@@ -1,12 +1,11 @@
1
- type Nav =
2
- | "file-explorer"
3
- | "checkpoints"
4
- | "plugins"
5
- | "settings"
6
- | "remote"
7
- | "help"
8
- | "settings"
9
- | "notifications"
10
- | "dev";
11
-
12
- export default Nav;
1
+ type Nav =
2
+ | "file-explorer"
3
+ | "checkpoints"
4
+ | "plugins"
5
+ | "settings"
6
+ | "remote"
7
+ | "help"
8
+ | "settings"
9
+ | "dev";
10
+
11
+ export default Nav;
@@ -29,7 +29,6 @@ export type ShortcutID = Extract<Language, (typeof SHORTCUTS)[number]>;
29
29
 
30
30
  export type Shortcut = {
31
31
  id: ShortcutID;
32
- name: string;
33
32
  description: string;
34
33
  keys: string[];
35
34
  };
@@ -41,7 +40,6 @@ export type Settings = {
41
40
  autoUpdate: boolean;
42
41
  direction: "ltr" | "rtl";
43
42
  showAllFile: boolean;
44
- trashBehaviour: "permanent" | "trash";
45
43
  shortcuts: Shortcut[];
46
44
  theme: string;
47
45
  isDev: boolean;
@@ -50,4 +48,5 @@ export type Settings = {
50
48
  */
51
49
  registry: Record<string, string>;
52
50
  mute: boolean;
51
+ icon: string;
53
52
  };