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.
Files changed (100) hide show
  1. package/.husky/pre-commit +1 -0
  2. package/README.md +47 -0
  3. package/dist/chunk-S47CVTVK.mjs +33 -0
  4. package/dist/chunk-UJCSKKID.mjs +30 -0
  5. package/dist/dev.d.mts +11 -0
  6. package/dist/dev.d.ts +11 -0
  7. package/dist/dev.js +5028 -0
  8. package/dist/dev.mjs +4991 -0
  9. package/dist/index.d.mts +666 -0
  10. package/dist/index.d.ts +666 -0
  11. package/dist/index.js +405 -0
  12. package/dist/index.mjs +376 -0
  13. package/eslint.config.mts +19 -0
  14. package/jest.config.js +11 -0
  15. package/package.json +60 -0
  16. package/src/dev.ts +4 -0
  17. package/src/index.ts +72 -0
  18. package/src/load-virtual-editor/app/StatusState.ts +6 -0
  19. package/src/load-virtual-editor/app/css.ts +154 -0
  20. package/src/load-virtual-editor/app/store.ts +25 -0
  21. package/src/load-virtual-editor/events/handle-dir-update.ts +23 -0
  22. package/src/load-virtual-editor/events/handle-file-update.ts +23 -0
  23. package/src/load-virtual-editor/events/handle-load.ts +39 -0
  24. package/src/load-virtual-editor/events/handle-selected.ts +30 -0
  25. package/src/load-virtual-editor/index.ts +52 -0
  26. package/src/load-virtual-editor/lib/indexedStorage.ts +28 -0
  27. package/src/load-virtual-editor/mocks/generate-files.ts +25 -0
  28. package/src/load-virtual-editor/node/NodeState.ts +23 -0
  29. package/src/load-virtual-editor/node/copyDir.ts +14 -0
  30. package/src/load-virtual-editor/node/copyFile.ts +14 -0
  31. package/src/load-virtual-editor/node/createDir.ts +10 -0
  32. package/src/load-virtual-editor/node/createFile.ts +13 -0
  33. package/src/load-virtual-editor/node/deleteDir.ts +10 -0
  34. package/src/load-virtual-editor/node/deleteFile.ts +13 -0
  35. package/src/load-virtual-editor/node/formatPath.ts +13 -0
  36. package/src/load-virtual-editor/node/formatText.ts +19 -0
  37. package/src/load-virtual-editor/node/generateDirs.ts +13 -0
  38. package/src/load-virtual-editor/node/getDescendantLevel.ts +9 -0
  39. package/src/load-virtual-editor/node/getDirInfo.ts +33 -0
  40. package/src/load-virtual-editor/node/getFileInfo.ts +31 -0
  41. package/src/load-virtual-editor/node/getFiles.ts +17 -0
  42. package/src/load-virtual-editor/node/getParent.ts +11 -0
  43. package/src/load-virtual-editor/node/readDir.ts +41 -0
  44. package/src/load-virtual-editor/node/readFile.ts +46 -0
  45. package/src/load-virtual-editor/node/store.ts +206 -0
  46. package/src/load-virtual-editor/node/watch.ts +9 -0
  47. package/src/load-virtual-editor/node/writeFile.ts +21 -0
  48. package/src/load-virtual-editor/postResponse.ts +21 -0
  49. package/src/load-virtual-editor/request/requestFS.ts +199 -0
  50. package/src/load-virtual-editor/request/requestSelected.ts +45 -0
  51. package/src/load-virtual-editor/selected/SelectedState.ts +7 -0
  52. package/src/load-virtual-editor/selected/selectDir.ts +13 -0
  53. package/src/load-virtual-editor/selected/selectFile.ts +13 -0
  54. package/src/load-virtual-editor/selected/store.ts +27 -0
  55. package/src/load-virtual-editor/selected/watch.ts +9 -0
  56. package/src/locales/en-GB.ts +117 -0
  57. package/src/locales/fr-FR.ts +125 -0
  58. package/src/relay/index.ts +89 -0
  59. package/src/relay/registerEvent.ts +16 -0
  60. package/src/relay/registerRequest.ts +16 -0
  61. package/src/relay/storage-bridge.ts +71 -0
  62. package/src/types/BBEvent.ts +51 -0
  63. package/src/types/BBRequest.ts +8 -0
  64. package/src/types/Checkpoint.ts +11 -0
  65. package/src/types/CopyArg.ts +6 -0
  66. package/src/types/DirectoryContents.ts +4 -0
  67. package/src/types/DirectoryStats.ts +4 -0
  68. package/src/types/EventParam.ts +8 -0
  69. package/src/types/EventReturn.ts +9 -0
  70. package/src/types/FileContent.ts +9 -0
  71. package/src/types/GitFileStatus.ts +5 -0
  72. package/src/types/IconArg.ts +6 -0
  73. package/src/types/Language.ts +5 -0
  74. package/src/types/Locale.ts +3 -0
  75. package/src/types/MenuContent.ts +10 -0
  76. package/src/types/Nav.ts +3 -0
  77. package/src/types/PluginItem.ts +14 -0
  78. package/src/types/RenameType.ts +4 -0
  79. package/src/types/RequestParam.ts +9 -0
  80. package/src/types/RequestReturn.ts +11 -0
  81. package/src/types/Result.ts +6 -0
  82. package/src/types/Route.ts +1 -0
  83. package/src/types/Settings.ts +7 -0
  84. package/src/types/TutorialHeader.ts +10 -0
  85. package/src/types/User.ts +9 -0
  86. package/src/types/WatchFSEvent.ts +1 -0
  87. package/src/types/database.types.ts +266 -0
  88. package/src/types/dir/DirInfo.ts +10 -0
  89. package/src/types/dir/index.ts +32 -0
  90. package/src/types/files/FileInfo.ts +12 -0
  91. package/src/types/files/FileTypes.ts +13 -0
  92. package/src/types/files/ReadFile.ts +17 -0
  93. package/src/types/files/index.ts +31 -0
  94. package/src/types/project/Project.ts +35 -0
  95. package/src/types/project/index.ts +11 -0
  96. package/src/types/status/Load.ts +16 -0
  97. package/src/types/storage/index.ts +11 -0
  98. package/src/utils/inject-styles.ts +13 -0
  99. package/tsconfig.json +20 -0
  100. package/tsup.config.ts +16 -0
@@ -0,0 +1 @@
1
+ npm test
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Introduction
2
+
3
+ This would be used in retrieving data from worldframer app.
4
+
5
+
6
+ # APIs
7
+
8
+ ## ```get-mode```
9
+
10
+ This returns the light or dark mode. Use it on iframe load to ensure that the extension has the same theme as the app.
11
+
12
+ ```ts
13
+ type Response = {
14
+ type: "mode";
15
+ mode: "light" | "dark";
16
+ }
17
+ ```
18
+
19
+ ## ```get-node```
20
+
21
+ Returns the list of directory and/or files in the specified folder. Empty string will point to the current workspace
22
+
23
+
24
+ ```ts
25
+ type NodeResponse = {
26
+ type: "node";
27
+ root: string;
28
+ node: {
29
+ name: string;
30
+ fullPath: string;
31
+ isDirectory: boolean;
32
+ ext: string;
33
+ size: number;
34
+ createdAt: Date;
35
+ modifiedAt: Date;
36
+ isDiff?: boolean;
37
+ wordCount?: number;
38
+ childrenCount?: number;
39
+ summary?: string;
40
+ }[];
41
+ }
42
+ ```
43
+
44
+ # Info
45
+
46
+
47
+ Folders and files that starts with underscore are hidden automatically from the UI. If you want to create files that shouldn't appear in the explorer. For example: `_data`
@@ -0,0 +1,33 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
28
+
29
+ export {
30
+ __commonJS,
31
+ __toESM,
32
+ __publicField
33
+ };
@@ -0,0 +1,30 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ export {
28
+ __commonJS,
29
+ __toESM
30
+ };
package/dist/dev.d.mts ADDED
@@ -0,0 +1,11 @@
1
+ declare function loadVirtualEditor({ sidebar, main, }: {
2
+ sidebar: HTMLIFrameElement | null;
3
+ main: HTMLIFrameElement | null;
4
+ }): void;
5
+
6
+ declare const generateFiles: ({ length, content, }?: {
7
+ length?: number;
8
+ content?: boolean | string;
9
+ }) => void;
10
+
11
+ export { generateFiles, loadVirtualEditor };
package/dist/dev.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ declare function loadVirtualEditor({ sidebar, main, }: {
2
+ sidebar: HTMLIFrameElement | null;
3
+ main: HTMLIFrameElement | null;
4
+ }): void;
5
+
6
+ declare const generateFiles: ({ length, content, }?: {
7
+ length?: number;
8
+ content?: boolean | string;
9
+ }) => void;
10
+
11
+ export { generateFiles, loadVirtualEditor };