@jsenv/core 23.1.3 → 23.2.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.
Files changed (82) hide show
  1. package/dist/jsenv_browser_system.js +36 -99
  2. package/dist/jsenv_browser_system.js.map +12 -21
  3. package/dist/jsenv_compile_proxy.js +18 -82
  4. package/dist/jsenv_compile_proxy.js.map +11 -21
  5. package/dist/jsenv_exploring_index.js +127 -274
  6. package/dist/jsenv_exploring_index.js.map +76 -90
  7. package/dist/jsenv_exploring_redirector.js +21 -89
  8. package/dist/jsenv_exploring_redirector.js.map +13 -25
  9. package/dist/jsenv_toolbar.js +81 -149
  10. package/dist/jsenv_toolbar.js.map +50 -61
  11. package/dist/jsenv_toolbar_injector.js +185 -231
  12. package/dist/jsenv_toolbar_injector.js.map +30 -42
  13. package/package.json +8 -9
  14. package/src/abort/abortable.js +172 -0
  15. package/src/abort/callback_list.js +64 -0
  16. package/src/abort/callback_race.js +34 -0
  17. package/src/abort/cleaner.js +22 -0
  18. package/src/abort/main.js +32 -0
  19. package/src/abort/process_teardown_events.js +59 -0
  20. package/src/buildProject.js +132 -123
  21. package/src/execute.js +108 -107
  22. package/src/executeTestPlan.js +107 -125
  23. package/src/importUsingChildProcess.js +2 -1
  24. package/src/internal/browser-launcher/executeHtmlFile.js +33 -12
  25. package/src/internal/browser-utils/fetch-browser.js +4 -29
  26. package/src/internal/browser-utils/fetchUsingXHR.js +5 -7
  27. package/src/internal/building/buildUsingRollup.js +60 -24
  28. package/src/internal/building/createJsenvRollupPlugin.js +13 -31
  29. package/src/internal/building/ressource_builder.js +3 -6
  30. package/src/internal/building/sourcemap_loader.js +4 -5
  31. package/src/internal/building/url_fetcher.js +2 -5
  32. package/src/internal/building/url_loader.js +3 -6
  33. package/src/internal/compiling/compileFile.js +1 -2
  34. package/src/internal/compiling/createCompiledFileService.js +8 -9
  35. package/src/internal/compiling/startCompileServer.js +74 -135
  36. package/src/internal/executing/coverage/generateCoverageJsonFile.js +20 -3
  37. package/src/internal/executing/coverage/relativeUrlToEmptyCoverage.js +19 -30
  38. package/src/internal/executing/coverage/reportToCoverage.js +44 -24
  39. package/src/internal/executing/coverage/v8CoverageFromNodeV8Directory.js +2 -15
  40. package/src/internal/executing/createSummaryLog.js +50 -37
  41. package/src/internal/executing/executeConcurrently.js +89 -47
  42. package/src/internal/executing/executePlan.js +33 -7
  43. package/src/internal/executing/executionLogs.js +25 -28
  44. package/src/internal/executing/execution_colors.js +15 -0
  45. package/src/internal/executing/generateExecutionSteps.js +3 -2
  46. package/src/internal/executing/launchAndExecute.js +217 -261
  47. package/src/internal/exploring/fetchExploringJson.js +3 -4
  48. package/src/internal/fetchUrl.js +6 -2
  49. package/src/internal/logs/log_style.js +16 -28
  50. package/src/internal/logs/msAsDuration.js +1 -1
  51. package/src/internal/node-launcher/createChildProcessOptions.js +4 -5
  52. package/src/internal/node-launcher/createControllableNodeProcess.js +117 -229
  53. package/src/internal/node-launcher/kill_process_tree.js +76 -0
  54. package/src/internal/node-launcher/nodeControllableFile.mjs +16 -10
  55. package/src/internal/{promise_track_race.js → promise_race.js} +2 -2
  56. package/src/internal/runtime/s.js +25 -24
  57. package/src/internal/toolbar/toolbar.html +157 -61
  58. package/src/internal/toolbar/toolbar.injector.js +8 -0
  59. package/src/internal/toolbar/util/animation.js +3 -7
  60. package/src/internal/toolbar/util/fetching.js +1 -30
  61. package/src/jsenvServiceWorkerFinalizer.js +1 -2
  62. package/src/launchBrowser.js +131 -127
  63. package/src/launchNode.js +29 -17
  64. package/src/playwright_browser_versions.js +3 -3
  65. package/src/requireUsingChildProcess.js +2 -1
  66. package/src/signal/signal.js +65 -0
  67. package/src/startExploring.js +70 -72
  68. package/src/internal/executeJsenvAsyncFunction.js +0 -34
  69. package/src/internal/toolbar/animation/toolbar-movie-icon.svg +0 -15
  70. package/src/internal/toolbar/compilation/flask.svg +0 -7
  71. package/src/internal/toolbar/compilation/info.svg +0 -9
  72. package/src/internal/toolbar/compilation/loupe.svg +0 -11
  73. package/src/internal/toolbar/compilation/toolbar_compilation.svg +0 -11
  74. package/src/internal/toolbar/eventsource/toolbar-power-icon.svg +0 -10
  75. package/src/internal/toolbar/eventsource/toolbar-power-off-icon.svg +0 -10
  76. package/src/internal/toolbar/responsive/toolbar-dots-icon.svg +0 -10
  77. package/src/internal/toolbar/settings/toolbar-settings-icon.svg +0 -9
  78. package/src/internal/toolbar/theme/toolbar-palette-icon.svg +0 -10
  79. package/src/internal/toolbar/toolbar-cross-icon.svg +0 -10
  80. package/src/internal/toolbar/toolbar-loading-icon.svg +0 -102
  81. package/src/internal/toolbar/toolbar-notif-icon.svg +0 -9
  82. package/src/internal/trackRessources.js +0 -23
@@ -1,14 +1,13 @@
1
- import {
2
- createCancellationToken,
3
- composeCancellationToken,
4
- } from "@jsenv/cancellation"
5
1
  import {
6
2
  normalizeStructuredMetaMap,
7
3
  collectFiles,
8
4
  urlToRelativeUrl,
9
5
  } from "@jsenv/filesystem"
10
6
 
11
- import { executeJsenvAsyncFunction } from "./internal/executeJsenvAsyncFunction.js"
7
+ import {
8
+ Abortable,
9
+ raceProcessTeardownEvents,
10
+ } from "@jsenv/core/src/abort/main.js"
12
11
  import { jsenvCoreDirectoryUrl } from "./internal/jsenvCoreDirectoryUrl.js"
13
12
  import {
14
13
  assertProjectDirectoryUrl,
@@ -31,8 +30,8 @@ import {
31
30
  import { jsenvRuntimeSupportDuringDev } from "./jsenvRuntimeSupportDuringDev.js"
32
31
 
33
32
  export const startExploring = async ({
34
- cancellationToken = createCancellationToken(),
35
- cancelOnSIGINT = false,
33
+ signal = new AbortController().signal,
34
+ handleSIGINT = true,
36
35
 
37
36
  explorableConfig = jsenvExplorableConfig,
38
37
  projectDirectoryUrl,
@@ -50,6 +49,7 @@ export const startExploring = async ({
50
49
  compileServerCanWriteOnFilesystem,
51
50
  compileServerPort,
52
51
  compileServerProtocol,
52
+ compileServerHttp2,
53
53
  compileServerCertificate,
54
54
  compileServerPrivateKey,
55
55
  sourcemapMethod,
@@ -57,78 +57,76 @@ export const startExploring = async ({
57
57
  livereloadWatchConfig,
58
58
  jsenvDirectoryClean,
59
59
  }) => {
60
- const jsenvStartExploringFunction = async ({ jsenvCancellationToken }) => {
61
- cancellationToken = composeCancellationToken(
62
- cancellationToken,
63
- jsenvCancellationToken,
64
- )
60
+ projectDirectoryUrl = assertProjectDirectoryUrl({ projectDirectoryUrl })
61
+ await assertProjectDirectoryExists({ projectDirectoryUrl })
65
62
 
66
- projectDirectoryUrl = assertProjectDirectoryUrl({ projectDirectoryUrl })
67
- await assertProjectDirectoryExists({ projectDirectoryUrl })
68
-
69
- const outDirectoryRelativeUrl = computeOutDirectoryRelativeUrl({
70
- projectDirectoryUrl,
71
- jsenvDirectoryRelativeUrl,
72
- outDirectoryName,
73
- })
63
+ const exploringServerOperation = Abortable.fromSignal(signal)
64
+ if (handleSIGINT) {
65
+ Abortable.effect(exploringServerOperation, (cb) =>
66
+ raceProcessTeardownEvents(
67
+ {
68
+ SIGINT: true,
69
+ },
70
+ cb,
71
+ ),
72
+ )
73
+ }
74
74
 
75
- const redirectFiles = createRedirectFilesService({
76
- projectDirectoryUrl,
77
- outDirectoryRelativeUrl,
78
- })
79
- const serveExploringData = createExploringDataService({
80
- projectDirectoryUrl,
81
- outDirectoryRelativeUrl,
82
- explorableConfig,
83
- livereloading,
84
- })
85
- const serveExplorableListAsJson = createExplorableListAsJsonService({
86
- projectDirectoryUrl,
87
- outDirectoryRelativeUrl,
88
- explorableConfig,
89
- })
75
+ const outDirectoryRelativeUrl = computeOutDirectoryRelativeUrl({
76
+ projectDirectoryUrl,
77
+ jsenvDirectoryRelativeUrl,
78
+ outDirectoryName,
79
+ })
90
80
 
91
- const compileServer = await startCompileServer({
92
- cancellationToken,
93
- projectDirectoryUrl,
94
- keepProcessAlive,
95
- livereloadSSE: livereloading,
96
- accessControlAllowRequestOrigin: true,
97
- accessControlAllowRequestMethod: true,
98
- accessControlAllowRequestHeaders: true,
99
- accessControlAllowCredentials: true,
100
- stopOnPackageVersionChange: true,
101
- jsenvToolbarInjection: jsenvToolbar,
102
- customServices: {
103
- "service:exploring-redirect": (request) => redirectFiles(request),
104
- "service:exploring-data": (request) => serveExploringData(request),
105
- "service:explorables": (request) => serveExplorableListAsJson(request),
106
- },
107
- customCompilers,
108
- jsenvDirectoryRelativeUrl,
109
- outDirectoryName,
110
- inlineImportMapIntoHTML,
81
+ const redirectFiles = createRedirectFilesService({
82
+ projectDirectoryUrl,
83
+ outDirectoryRelativeUrl,
84
+ })
85
+ const serveExploringData = createExploringDataService({
86
+ projectDirectoryUrl,
87
+ outDirectoryRelativeUrl,
88
+ explorableConfig,
89
+ livereloading,
90
+ })
91
+ const serveExplorableListAsJson = createExplorableListAsJsonService({
92
+ projectDirectoryUrl,
93
+ outDirectoryRelativeUrl,
94
+ explorableConfig,
95
+ })
111
96
 
112
- compileServerLogLevel,
113
- compileServerCanReadFromFilesystem,
114
- compileServerCanWriteOnFilesystem,
115
- compileServerPort,
116
- compileServerProtocol,
117
- compileServerCertificate,
118
- compileServerPrivateKey,
119
- sourcemapMethod,
120
- babelPluginMap,
121
- runtimeSupport: runtimeSupportDuringDev,
122
- livereloadWatchConfig,
123
- jsenvDirectoryClean,
124
- })
97
+ const compileServer = await startCompileServer({
98
+ signal: exploringServerOperation.signal,
99
+ keepProcessAlive,
125
100
 
126
- return compileServer
127
- }
101
+ projectDirectoryUrl,
102
+ livereloadSSE: livereloading,
103
+ jsenvToolbarInjection: jsenvToolbar,
104
+ customServices: {
105
+ "service:exploring-redirect": (request) => redirectFiles(request),
106
+ "service:exploring-data": (request) => serveExploringData(request),
107
+ "service:explorables": (request) => serveExplorableListAsJson(request),
108
+ },
109
+ customCompilers,
110
+ jsenvDirectoryRelativeUrl,
111
+ outDirectoryName,
112
+ inlineImportMapIntoHTML,
128
113
 
129
- return executeJsenvAsyncFunction(jsenvStartExploringFunction, {
130
- cancelOnSIGINT,
114
+ compileServerLogLevel,
115
+ compileServerCanReadFromFilesystem,
116
+ compileServerCanWriteOnFilesystem,
117
+ compileServerPort,
118
+ compileServerProtocol,
119
+ compileServerHttp2,
120
+ compileServerCertificate,
121
+ compileServerPrivateKey,
122
+ sourcemapMethod,
123
+ babelPluginMap,
124
+ runtimeSupport: runtimeSupportDuringDev,
125
+ livereloadWatchConfig,
126
+ jsenvDirectoryClean,
131
127
  })
128
+
129
+ return compileServer
132
130
  }
133
131
 
134
132
  const createRedirectFilesService = ({ projectDirectoryUrl }) => {
@@ -1,34 +0,0 @@
1
- import {
2
- executeAsyncFunction,
3
- createCancellationSource,
4
- } from "@jsenv/cancellation"
5
- import { SIGINTSignal } from "@jsenv/node-signals"
6
-
7
- export const executeJsenvAsyncFunction = (
8
- fn,
9
- { cancelOnSIGINT = false } = {},
10
- ) => {
11
- return executeAsyncFunction(
12
- async () => {
13
- const jsenvCancellationSource = createCancellationSource()
14
- const jsenvCancellationToken = jsenvCancellationSource.token
15
-
16
- if (cancelOnSIGINT) {
17
- const unregister = SIGINTSignal.addCallback(() => {
18
- jsenvCancellationSource.cancel("process SIGINT")
19
- })
20
- try {
21
- return await fn({ jsenvCancellationToken })
22
- } finally {
23
- unregister()
24
- }
25
- }
26
-
27
- return fn({ jsenvCancellationToken })
28
- },
29
- {
30
- catchCancellation: true,
31
- considerUnhandledRejectionsAsExceptions: true,
32
- },
33
- )
34
- }
@@ -1,15 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-movie-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path
7
- d="M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3h-2zM8 17H6v-2h2v2zm0-4H6v-2h2v2zm0-4H6V7h2v2zm10 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V7h2v2z"
8
- />
9
- <path d="M0 0h24v24H0z" fill="none" />
10
- </svg>
11
-
12
-
13
-
14
-
15
-
@@ -1,7 +0,0 @@
1
- <svg
2
- viewBox="-74 0 512 512"
3
- xmlns="http://www.w3.org/2000/svg"
4
- id="icon"
5
- >
6
- <path d="m361.414062 443.589844-108.269531-263.902344c-6.003906-14.640625-9.050781-30.085938-9.050781-45.910156v-69.757813c0-7.511719 2.925781-14.574219 8.238281-19.886719 6.476563-6.476562 10.046875-15.089843 10.046875-24.25v-9.882812c0-5.523438-4.480468-10-10-10h-139.621094c-5.523437 0-10 4.476562-10 10v9.882812c0 9.160157 3.566407 17.773438 10.042969 24.25 5.3125 5.3125 8.238281 12.375 8.238281 19.890626v69.753906c0 15.824218-3.042968 31.269531-9.050781 45.910156l-29.75 72.515625c-.011719.027344-.023437.054687-.035156.082031l-78.484375 191.304688c-6.285156 15.324218-4.53125 32.6875 4.695312 46.441406 9.226563 13.757812 24.621094 21.96875 41.183594 21.96875h265.9375c16.5625 0 31.960938-8.210938 41.1875-21.96875 9.222656-13.757812 10.976563-31.117188 4.691406-46.441406zm-230.921874-256.3125c7-17.058594 10.546874-35.058594 10.546874-53.5v-69.757813c0-12.851562-5.003906-24.9375-14.09375-34.027343-2.671874-2.671876-4.15625-6.21875-4.1875-9.992188h119.621094c-.03125 3.773438-1.515625 7.316406-4.191406 9.992188-9.085938 9.089843-14.09375 21.171874-14.09375 34.027343v69.753907c0 18.441406 3.550781 36.441406 10.546875 53.5l24.144531 58.851562h-152.4375zm209.617187 291.613281c-5.585937 8.332031-14.542969 13.109375-24.574219 13.109375h-265.9375c-10.027344 0-18.984375-4.777344-24.574218-13.109375-4.214844-6.285156-5.824219-13.574219-4.730469-20.761719h16.476562c5.519531 0 10-4.480468 10-10 0-5.523437-4.480469-10-10-10h-9.1875l11.484375-28h16.867188c5.523437 0 10-4.480468 10-10 0-5.523437-4.476563-10-10-10h-8.660156l11.484374-28h17.34375c5.523438 0 10-4.480468 10-10 0-5.523437-4.476562-10-10-10h-9.136718l11.488281-28h17.8125c5.523437 0 10-4.480468 10-10 0-5.523437-4.476563-10-10-10h-9.609375l11.488281-28h168.84375l75.921875 185.054688c3.804688 9.277344 2.785156 19.378906-2.800781 27.707031zm0 0"/><path d="m312.03125 444.214844c-2.09375-5.113282-7.929688-7.558594-13.042969-5.46875-5.109375 2.09375-7.558593 7.929687-5.46875 13.042968l.054688.125c1.585937 3.871094 5.316406 6.214844 9.257812 6.214844 1.261719 0 2.542969-.238281 3.785157-.746094 5.109374-2.09375 7.558593-7.933593 5.464843-13.042968zm0 0"/><path d="m297.898438 409.761719-35.8125-87.289063c-2.09375-5.109375-7.933594-7.554687-13.046876-5.457031-5.109374 2.09375-7.550781 7.9375-5.457031 13.046875l35.8125 87.289062c1.585938 3.871094 5.316407 6.207032 9.257813 6.207032 1.261718 0 2.546875-.238282 3.789062-.75 5.109375-2.09375 7.554688-7.9375 5.457032-13.046875zm0 0"/>
7
- </svg>
@@ -1,9 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- viewBox="0 0 24 24"
4
- id="icon"
5
- >
6
- <path
7
- fill="currentColor"
8
- d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm1 18h-2v-8h2v8zm-1-12.25c.69 0 1.25.56 1.25 1.25s-.56 1.25-1.25 1.25-1.25-.56-1.25-1.25.56-1.25 1.25-1.25z"/>
9
- </svg>
@@ -1,11 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- viewBox="0 0 512 512"
4
- style="enable-background:new 0 0 512 512;"
5
- id="icon"
6
- >
7
- <path d="M497.938,430.063l-126.914-126.91C389.287,272.988,400,237.762,400,200C400,89.719,310.281,0,200,0
8
- C89.719,0,0,89.719,0,200c0,110.281,89.719,200,200,200c37.762,0,72.984-10.711,103.148-28.973l126.914,126.91
9
- C439.438,507.313,451.719,512,464,512c12.281,0,24.563-4.688,33.938-14.063C516.688,479.195,516.688,448.805,497.938,430.063z
10
- M64,200c0-74.992,61.016-136,136-136s136,61.008,136,136s-61.016,136-136,136S64,274.992,64,200z"/>
11
- </svg>
@@ -1,11 +0,0 @@
1
- <svg
2
- viewBox="0 0 16 16"
3
- xmlns="http://www.w3.org/2000/svg"
4
- id="toolbar_compilation_icon"
5
- >
6
- <path
7
- fill="currentColor"
8
- d="M 2.5 2 C 1.671875 2 1 2.671875 1 3.5 L 1 12.5 C 1 13.328125 1.671875 14 2.5 14 L 13.5 14 C 14.328125 14 15 13.328125 15 12.5 L 15 5.5 C 15 4.671875 14.328125 4 13.5 4 L 6.796875 4 L 6.144531 2.789063 C 5.882813 2.300781 5.378906 2 4.824219 2 Z"
9
- />
10
- </svg>
11
-
@@ -1,10 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-power-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path d="M0 0h24v24H0V0z" fill="none" />
7
- <path
8
- d="M16 9v4.66l-3.5 3.51V19h-1v-1.83L8 13.65V9h8m0-6h-2v4h-4V3H8v4h-.01C6.9 6.99 6 7.89 6 8.98v5.52L9.5 18v3h5v-3l3.5-3.51V9c0-1.1-.9-2-2-2V3z"
9
- />
10
- </svg>
@@ -1,10 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-power-off-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path d="M0 0h24v24H0V0z" fill="none" />
7
- <path
8
- d="M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25 6 8.54v5.96L9.5 18v3h5v-3l.48-.48 4.47 4.47 1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57-1.07 1.06z"
9
- />
10
- </svg>
@@ -1,10 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-dots-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path d="M0 0h24v24H0V0z" fill="none" />
7
- <path
8
- d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
9
- />
10
- </svg>
@@ -1,9 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-settings-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path
7
- d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"
8
- />
9
- </svg>
@@ -1,10 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-palette-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path
7
- d="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"
8
- />
9
- <path d="M0 0h24v24H0z" fill="none" />
10
- </svg>
@@ -1,10 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-cross-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path
7
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
8
- />
9
- <path d="M0 0h24v24H0z" fill="none" />
10
- </svg>
@@ -1,102 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-loading-icon"
4
- viewBox="0 0 430 430"
5
- enable-background="new 0 0 430 430"
6
- >
7
- <g>
8
- <g>
9
- <path
10
- id="arc1"
11
- fill="currentColor"
12
- d="M32.118,204.979c0,0,0.105,1.801,0.302,5.179c0.124,3.4,0.638,8.29,1.434,14.48
13
- c0.249,1.546,0.511,3.174,0.786,4.882c0.137,0.853,0.278,1.725,0.421,2.617c0.154,0.89,0.376,1.789,0.558,2.712
14
- c0.384,1.843,0.783,3.761,1.197,5.75c0.444,1.981,1.027,4.008,1.56,6.112c2.274,8.378,5.328,17.708,9.758,27.396
15
- c4.406,9.688,10.04,19.776,17.062,29.673c7.003,9.901,15.393,19.609,25.102,28.499c9.702,8.888,20.652,17.025,32.581,23.85
16
- c11.948,6.789,24.834,12.287,38.159,16.203c13.357,3.824,27.155,5.896,40.737,6.35l2.541,0.113l2.542-0.017
17
- c1.689-0.012,3.376-0.142,5.059-0.152l1.259-0.126h0.157c-0.466,0-0.034,0.113-0.096,0.111l0.329,0.039l0.657-0.012l2.625-0.138
18
- c1.748-0.094,3.492-0.181,5.229-0.274l2.599-0.14l2.399-0.292c1.596-0.203,3.188-0.354,4.772-0.526
19
- c3.147-0.236,6.372-0.888,9.541-1.397c12.69-2.107,24.746-5.299,35.916-9.232c2.755-1.075,5.479-2.131,8.182-3.142
20
- c2.655-1.114,5.222-2.329,7.782-3.459c2.6-1.056,4.984-2.43,7.407-3.636c1.206-0.616,2.401-1.228,3.584-1.832
21
- c1.189-0.598,2.295-1.31,3.432-1.949c2.248-1.316,4.477-2.577,6.623-3.866c2.099-1.369,4.148-2.706,6.146-4.011
22
- c2.042-1.258,3.901-2.66,5.735-3.997c1.822-1.352,3.646-2.613,5.355-3.907c1.669-1.351,3.284-2.656,4.843-3.918
23
- c1.569-1.258,3.121-2.439,4.471-3.723c1.402-1.238,2.746-2.427,4.031-3.563c1.288-1.139,2.548-2.204,3.621-3.327
24
- c2.193-2.203,4.225-4.131,5.979-5.831c1.697-1.744,3.063-3.304,4.243-4.516c2.34-2.456,3.588-3.767,3.588-3.767l0.026-0.028
25
- c0.326-0.342,0.867-0.355,1.209-0.029c0.285,0.271,0.341,0.695,0.161,1.026c0,0-0.868,1.598-2.574,4.574
26
- c-0.854,1.488-1.885,3.349-3.214,5.459c-1.387,2.064-2.967,4.465-4.816,7.108c-0.887,1.355-1.955,2.669-3.051,4.075
27
- c-1.103,1.406-2.257,2.878-3.46,4.412c-1.185,1.56-2.571,3.036-3.979,4.607c-1.424,1.563-2.899,3.181-4.424,4.853
28
- c-1.572,1.628-3.282,3.218-5.018,4.893c-1.745,1.662-3.502,3.432-5.49,5.023c-1.957,1.641-3.965,3.323-6.021,5.047
29
- c-2.111,1.653-4.363,3.226-6.623,4.899c-9.169,6.472-19.718,12.805-31.671,17.869c-11.917,5.107-25.137,9.123-39.146,11.367
30
- c-3.516,0.507-7.004,1.114-10.719,1.336c-1.834,0.148-3.674,0.319-5.521,0.438l-2.773,0.192l-2.611,0.027
31
- c-1.74,0.015-3.486,0.03-5.237,0.045l-2.63,0.012l-1.585-0.006l-1.378-0.074c-1.836-0.101-3.676-0.201-5.521-0.302l-2.766-0.157
32
- l-2.764-0.29c-14.755-1.437-29.532-4.559-43.748-9.26c-14.191-4.788-27.769-11.24-40.221-18.991
33
- c-12.467-7.743-23.632-16.999-33.41-26.861c-9.758-9.893-18.135-20.455-24.833-31.222c-6.743-10.739-11.988-21.536-15.97-31.794
34
- c-4.006-10.258-6.601-20.021-8.441-28.721c-1.917-8.698-2.688-16.429-3.245-22.764c-0.396-6.374-0.584-11.386-0.485-14.752
35
- c0.026-3.383,0.04-5.188,0.04-5.188c0.003-0.47,0.387-0.848,0.857-0.844C31.725,204.181,32.091,204.536,32.118,204.979z"
36
- />
37
- </g>
38
- <g>
39
- <path
40
- id="arc2"
41
- fill="currentColor"
42
- d="M393.625,225.021c0,0-0.104-1.731-0.297-4.979c-0.049-0.812-0.103-1.718-0.162-2.716
43
- c-0.029-0.499-0.061-1.021-0.093-1.565c-0.059-0.538-0.119-1.097-0.182-1.679c-0.269-2.323-0.534-4.99-0.906-7.966
44
- c-0.241-1.486-0.496-3.051-0.763-4.693c-0.133-0.82-0.269-1.658-0.408-2.516c-0.126-0.859-0.286-1.731-0.487-2.616
45
- c-0.778-3.54-1.458-7.393-2.614-11.413c-0.266-1.009-0.537-2.034-0.812-3.075c-0.264-1.043-0.553-2.096-0.908-3.147
46
- c-0.672-2.11-1.362-4.281-2.071-6.509c-1.604-4.392-3.258-9.013-5.353-13.684c-4.077-9.377-9.302-19.173-15.844-28.827
47
- c-6.541-9.647-14.329-19.197-23.385-28.038l-1.683-1.677l-1.766-1.605c-1.182-1.068-2.366-2.142-3.557-3.218
48
- c-1.163-1.104-2.449-2.08-3.686-3.116c-1.246-1.024-2.496-2.052-3.75-3.083c-1.3-0.972-2.604-1.946-3.91-2.924
49
- c-1.324-0.953-2.58-2.003-3.953-2.902c-1.354-0.92-2.714-1.843-4.075-2.768l-2.042-1.389l-2.112-1.291
50
- c-11.209-6.99-23.347-12.819-35.961-17.193c-12.643-4.307-25.78-6.991-38.788-8.151c-1.628-0.128-3.24-0.356-4.867-0.403
51
- c-1.623-0.068-3.243-0.136-4.858-0.205c-3.224-0.204-6.444-0.09-9.634-0.125l-2.151-0.002l-2.495,0.128
52
- c-1.66,0.095-3.316,0.141-4.966,0.211l-2.47,0.097c-0.809,0.042-1.532,0.143-2.3,0.21c-1.513,0.146-3.021,0.293-4.522,0.438
53
- c-2.979,0.166-6.046,0.719-9.053,1.084c-3.023,0.336-5.975,0.917-8.906,1.449c-1.462,0.28-2.93,0.501-4.374,0.794
54
- c-1.436,0.332-2.863,0.661-4.282,0.989c-1.424,0.318-2.838,0.634-4.245,0.947c-1.396,0.353-2.766,0.767-4.137,1.143
55
- c-2.735,0.781-5.465,1.47-8.073,2.398c-1.315,0.436-2.621,0.868-3.917,1.296c-1.3,0.42-2.588,0.844-3.827,1.363
56
- c-2.513,0.967-4.983,1.917-7.408,2.85c-2.367,1.068-4.709,2.091-7.01,3.092c-1.163,0.477-2.267,1.042-3.361,1.598
57
- c-1.1,0.548-2.188,1.091-3.263,1.627c-1.082,0.532-2.15,1.059-3.206,1.579c-1.025,0.576-2.039,1.145-3.039,1.706
58
- c-1.992,1.14-4.003,2.158-5.868,3.29c-1.848,1.157-3.655,2.272-5.419,3.344c-1.792,1.037-3.405,2.208-5.008,3.287
59
- c-1.605,1.084-3.153,2.13-4.64,3.135c-2.895,2.146-5.553,4.117-7.955,5.898c-2.294,1.916-4.409,3.579-6.239,5.05
60
- c-0.934,0.718-1.729,1.45-2.471,2.111c-0.751,0.655-1.434,1.25-2.044,1.782c-2.474,2.127-3.793,3.262-3.793,3.262l-0.025,0.022
61
- c-0.358,0.308-0.898,0.267-1.207-0.091c-0.256-0.297-0.271-0.721-0.063-1.032c0,0,0.969-1.457,2.861-4.161
62
- c0.957-1.342,2.071-3.069,3.577-4.928c1.497-1.867,3.207-4.042,5.195-6.425c2.072-2.294,4.393-4.829,6.954-7.583
63
- c1.353-1.299,2.761-2.652,4.222-4.055c1.466-1.404,2.982-2.873,4.665-4.248c1.653-1.413,3.373-2.863,5.158-4.347
64
- c1.799-1.46,3.737-2.85,5.699-4.323c0.988-0.729,1.989-1.466,3.003-2.214c1.05-0.693,2.113-1.395,3.188-2.104
65
- c1.082-0.705,2.176-1.418,3.282-2.14c1.107-0.723,2.227-1.456,3.411-2.104c9.235-5.625,19.942-10.626,31.724-14.697
66
- c1.475-0.504,2.951-1.046,4.456-1.527c1.52-0.435,3.049-0.873,4.587-1.314c1.543-0.431,3.096-0.864,4.658-1.299
67
- c1.57-0.402,3.17-0.716,4.772-1.065c1.604-0.341,3.218-0.685,4.839-1.029c0.808-0.191,1.629-0.319,2.454-0.433
68
- c0.824-0.123,1.649-0.245,2.478-0.368c3.322-0.481,6.616-1.035,10.133-1.254c1.738-0.127,3.483-0.254,5.236-0.383
69
- c0.866-0.054,1.775-0.143,2.61-0.166l2.472-0.042c1.65-0.022,3.307-0.069,4.97-0.067l2.497-0.011
70
- c-0.163,0.003,0.397-0.005,0.4-0.001l0.164,0.008l0.327,0.015l0.655,0.031l1.311,0.062c3.497,0.194,7.019,0.236,10.533,0.702
71
- c1.757,0.188,3.52,0.377,5.285,0.567c1.767,0.169,3.518,0.523,5.28,0.778c14.083,2.205,28.099,5.979,41.516,11.19
72
- c13.397,5.272,26.146,12.065,37.788,20.016l2.192,1.471l2.117,1.569c1.408,1.045,2.813,2.087,4.215,3.127
73
- c2.768,2.124,5.406,4.386,8.06,6.582c1.274,1.16,2.545,2.316,3.813,3.468c1.254,1.164,2.556,2.267,3.731,3.496
74
- c1.2,1.201,2.396,2.398,3.587,3.591l1.775,1.789l1.689,1.859c9.061,9.819,16.775,20.217,23.014,30.685
75
- c6.256,10.46,11.099,20.933,14.763,30.855c1.899,4.94,3.31,9.814,4.67,14.425c0.586,2.333,1.157,4.605,1.712,6.814
76
- c0.297,1.098,0.526,2.196,0.731,3.282c0.215,1.083,0.427,2.15,0.636,3.2c0.923,4.179,1.378,8.165,1.943,11.813
77
- c0.151,0.911,0.247,1.811,0.318,2.695c0.082,0.882,0.162,1.745,0.24,2.587c0.155,1.684,0.305,3.29,0.445,4.814
78
- c0.173,3.065,0.257,5.808,0.365,8.183c0.022,0.594,0.045,1.165,0.066,1.714c-0.006,0.545-0.01,1.068-0.015,1.567
79
- c-0.009,1-0.017,1.908-0.024,2.721c-0.029,3.252-0.045,4.987-0.045,4.987c-0.004,0.47-0.389,0.847-0.857,0.843
80
- C394.018,225.817,393.652,225.463,393.625,225.021z"
81
- />
82
- </g>
83
- <circle
84
- id="circle2"
85
- fill="currentColor"
86
- stroke-width="9"
87
- stroke-miterlimit="10"
88
- cx="70.536"
89
- cy="110.694"
90
- r="36.011"
91
- />
92
- <circle
93
- id="circle1"
94
- fill="currentColor"
95
- stroke-width="9"
96
- stroke-miterlimit="10"
97
- cx="362.721"
98
- cy="309.694"
99
- r="36.012"
100
- />
101
- </g>
102
- </svg>
@@ -1,9 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="toolbar-notif-icon"
4
- viewBox="0 0 24 24"
5
- >
6
- <path
7
- d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"
8
- />
9
- </svg>
@@ -1,23 +0,0 @@
1
- import { memoize } from "@jsenv/filesystem"
2
-
3
- export const trackRessources = () => {
4
- const callbackArray = []
5
-
6
- const registerCleanupCallback = (callback) => {
7
- if (typeof callback !== "function")
8
- throw new TypeError(`callback must be a function
9
- callback: ${callback}`)
10
- callbackArray.push(callback)
11
- return () => {
12
- const index = callbackArray.indexOf(callback)
13
- if (index > -1) callbackArray.splice(index, 1)
14
- }
15
- }
16
-
17
- const cleanup = memoize(async (reason) => {
18
- const localCallbackArray = callbackArray.slice()
19
- await Promise.all(localCallbackArray.map((callback) => callback(reason)))
20
- })
21
-
22
- return { registerCleanupCallback, cleanup }
23
- }