@jsenv/core 29.8.6 → 29.9.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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/html/explorer.html +4 -3
  3. package/dist/js/autoreload.js +59 -39
  4. package/dist/js/server_events_client.js +9 -4
  5. package/dist/js/supervisor.js +4 -2
  6. package/dist/main.js +50 -2085
  7. package/package.json +2 -2
  8. package/src/build/build.js +33 -33
  9. package/src/plugins/autoreload/client/autoreload.js +57 -31
  10. package/src/plugins/autoreload/client/url_helpers.js +7 -4
  11. package/src/plugins/explorer/client/explorer.html +4 -3
  12. package/src/plugins/plugins.js +1 -1
  13. package/src/plugins/ribbon/jsenv_plugin_ribbon.js +6 -1
  14. package/src/plugins/server_events/client/connection_manager.js +8 -3
  15. package/src/plugins/supervisor/client/supervisor.js +4 -2
  16. package/src/plugins/url_resolution/jsenv_plugin_url_resolution.js +6 -2
  17. package/src/plugins/url_resolution/node_esm_resolver.js +6 -1
  18. package/dist/js/html_src_set.js +0 -20
  19. package/src/plugins/autoreload/client/autoreload_preference.js +0 -11
  20. package/src/plugins/toolbar/client/animation/toolbar_animation.js +0 -39
  21. package/src/plugins/toolbar/client/eventsource/eventsource.css +0 -83
  22. package/src/plugins/toolbar/client/eventsource/toolbar_eventsource.js +0 -57
  23. package/src/plugins/toolbar/client/execution/execution.css +0 -79
  24. package/src/plugins/toolbar/client/execution/toolbar_execution.js +0 -88
  25. package/src/plugins/toolbar/client/focus/focus.css +0 -61
  26. package/src/plugins/toolbar/client/focus/toolbar_focus.js +0 -19
  27. package/src/plugins/toolbar/client/jsenv_logo.svg +0 -140
  28. package/src/plugins/toolbar/client/notification/toolbar_notification.js +0 -181
  29. package/src/plugins/toolbar/client/responsive/overflow_menu.css +0 -61
  30. package/src/plugins/toolbar/client/responsive/toolbar_responsive.js +0 -103
  31. package/src/plugins/toolbar/client/settings/settings.css +0 -201
  32. package/src/plugins/toolbar/client/settings/toolbar_settings.js +0 -47
  33. package/src/plugins/toolbar/client/theme/jsenv_theme.css +0 -77
  34. package/src/plugins/toolbar/client/theme/light_theme.css +0 -106
  35. package/src/plugins/toolbar/client/theme/toolbar_theme.js +0 -34
  36. package/src/plugins/toolbar/client/toolbar.html +0 -457
  37. package/src/plugins/toolbar/client/toolbar_injector.js +0 -218
  38. package/src/plugins/toolbar/client/toolbar_main.css +0 -172
  39. package/src/plugins/toolbar/client/toolbar_main.js +0 -197
  40. package/src/plugins/toolbar/client/tooltip/tooltip.css +0 -61
  41. package/src/plugins/toolbar/client/tooltip/tooltip.js +0 -39
  42. package/src/plugins/toolbar/client/util/animation.js +0 -305
  43. package/src/plugins/toolbar/client/util/dom.js +0 -108
  44. package/src/plugins/toolbar/client/util/fetch_using_xhr.js +0 -400
  45. package/src/plugins/toolbar/client/util/fetching.js +0 -14
  46. package/src/plugins/toolbar/client/util/iframe_to_parent_href.js +0 -10
  47. package/src/plugins/toolbar/client/util/jsenv_logger.js +0 -28
  48. package/src/plugins/toolbar/client/util/preferences.js +0 -10
  49. package/src/plugins/toolbar/client/util/responsive.js +0 -112
  50. package/src/plugins/toolbar/client/util/util.js +0 -19
  51. package/src/plugins/toolbar/client/variant/variant.js +0 -74
  52. package/src/plugins/toolbar/jsenv_plugin_toolbar.js +0 -62
@@ -1,79 +0,0 @@
1
- /* Loader icon */
2
- #loader-icon {
3
- width: 20px;
4
- height: 20px;
5
- margin: 10px;
6
- transform: scaleX(-1);
7
- color: #cecece;
8
- }
9
- #loader-icon[data-animate] {
10
- opacity: 0;
11
- transform-origin: center;
12
- animation: rotateLoader 1s linear infinite !important;
13
- }
14
- @keyframes rotateLoader {
15
- 0% {
16
- transform: scaleX(-1) rotate(360deg);
17
- opacity: 1;
18
- }
19
- 50% {
20
- opacity: 0;
21
- }
22
- 100% {
23
- transform: scaleX(-1) rotate(0deg);
24
- opacity: 1;
25
- }
26
- }
27
-
28
- /* Check icon */
29
- #check-icon {
30
- width: 25px;
31
- height: 25px;
32
- margin: 7px;
33
- opacity: 0;
34
- stroke-width: 5;
35
- }
36
- #check-icon[data-animate] {
37
- opacity: 1;
38
- }
39
- #check-icon[data-animate] path {
40
- transform-origin: 50% 50%;
41
- stroke-dasharray: 48;
42
- stroke-dashoffset: 48;
43
- animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
44
- stroke: green;
45
- }
46
- @keyframes stroke {
47
- 100% {
48
- stroke-dashoffset: 0;
49
- }
50
- }
51
-
52
- /* Cross icon */
53
- #cross-icon {
54
- width: 20px;
55
- height: 20px;
56
- margin: 10px;
57
- opacity: 0;
58
- stroke-width: 5;
59
- }
60
- #cross-icon rect {
61
- width: 33px;
62
- height: 0;
63
- fill: #d74640;
64
- }
65
- #cross-icon[data-animate] {
66
- opacity: 1;
67
- }
68
- #cross-icon[data-animate] #cross_p1 {
69
- animation: draw 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
70
- }
71
- #cross-icon[data-animate] #cross_p2 {
72
- animation: draw 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.2s;
73
- }
74
- @keyframes draw {
75
- 100% {
76
- height: 376.964px;
77
- width: 45px;
78
- }
79
- }
@@ -1,88 +0,0 @@
1
- import { removeForceHideElement } from "../util/dom.js"
2
- import { enableVariant } from "../variant/variant.js"
3
- import { toggleTooltip } from "../tooltip/tooltip.js"
4
- import { notifyExecutionResult } from "../notification/toolbar_notification.js"
5
-
6
- export const renderExecutionInToolbar = async () => {
7
- // reset file execution indicator ui
8
- applyExecutionIndicator()
9
- removeForceHideElement(document.querySelector("#execution-indicator"))
10
-
11
- const { status, startTime, endTime } =
12
- await window.parent.__supervisor__.getDocumentExecutionResult()
13
- const execution = { status, startTime, endTime }
14
- applyExecutionIndicator(execution)
15
- const executionStorageKey = window.location.href
16
- const previousExecution = sessionStorage.hasOwnProperty(executionStorageKey)
17
- ? JSON.parse(sessionStorage.getItem(executionStorageKey))
18
- : undefined
19
- notifyExecutionResult(executionStorageKey, execution, previousExecution)
20
- sessionStorage.setItem(executionStorageKey, JSON.stringify(execution))
21
- }
22
-
23
- // const changeLink = variantNode.querySelector(".eventsource-changes-link")
24
- // changeLink.innerHTML = reloadMessageCount
25
- // changeLink.onclick = () => {
26
- // console.log(reloadMessages)
27
- // // eslint-disable-next-line no-alert
28
- // window.parent.alert(JSON.stringify(reloadMessages, null, " "))
29
- // }
30
-
31
- // const someFailed = reloadMessages.some((m) => m.status === "failed")
32
- // const somePending = reloadMessages.some((m) => m.status === "pending")
33
- // const applyLink = variantNode.querySelector(".eventsource-reload-link")
34
- // applyLink.innerHTML = someFailed
35
- // ? "failed"
36
- // : somePending
37
- // ? "applying..."
38
- // : "apply changes"
39
- // applyLink.onclick = someFailed
40
- // ? () => {
41
- // parentEventSourceClient.applyReloadMessageEffects()
42
- // }
43
- // : somePending
44
- // ? () => {}
45
- // : () => {
46
- // parentEventSourceClient.applyReloadMessageEffects()
47
- // }
48
-
49
- // parentEventSourceClient.reloadMessagesSignal.onchange = () => {
50
- // updateEventSourceIndicator()
51
- // }
52
- // const autoreloadCheckbox = document.querySelector("#toggle-autoreload")
53
- // autoreloadCheckbox.checked = parentEventSourceClient.isAutoreloadEnabled()
54
- // autoreloadCheckbox.onchange = () => {
55
- // parentEventSourceClient.setAutoreloadPreference(autoreloadCheckbox.checked)
56
- // updateEventSourceIndicator()
57
- // }
58
-
59
- const applyExecutionIndicator = ({
60
- status = "running",
61
- startTime,
62
- endTime,
63
- } = {}) => {
64
- const executionIndicator = document.querySelector("#execution-indicator")
65
- enableVariant(executionIndicator, { execution: status })
66
- const variantNode = executionIndicator.querySelector("[data-when-active]")
67
- variantNode.querySelector("button").onclick = () =>
68
- toggleTooltip(executionIndicator)
69
- variantNode.querySelector(".tooltip").textContent = computeText({
70
- status,
71
- startTime,
72
- endTime,
73
- })
74
- }
75
-
76
- // relative time: https://github.com/tc39/proposal-intl-relative-time/issues/118
77
- const computeText = ({ status, startTime, endTime }) => {
78
- if (status === "completed") {
79
- return `Execution completed in ${endTime - startTime}ms`
80
- }
81
- if (status === "errored") {
82
- return `Execution failed in ${endTime - startTime}ms`
83
- }
84
- if (status === "running") {
85
- return "Executing..."
86
- }
87
- return ""
88
- }
@@ -1,61 +0,0 @@
1
- button:focus,
2
- a:focus,
3
- input:focus,
4
- *[data-contains-hidden-input] input:focus + * {
5
- outline-style: none;
6
- outline-offset: -2px;
7
- }
8
-
9
- *[data-contains-hidden-input] input:focus + * {
10
- outline-width: 4px;
11
- outline-offset: -2px;
12
- }
13
-
14
- html[data-last-interaction="keyboard"] button:focus,
15
- html[data-last-interaction="keyboard"] a:focus,
16
- html[data-last-interaction="keyboard"] input:focus,
17
- html[data-last-interaction="keyboard"]
18
- *[data-contains-hidden-input]
19
- input:focus
20
- + * {
21
- outline-style: auto;
22
- }
23
-
24
- html[data-last-interaction="keyboard"]
25
- *[data-contains-hidden-input]
26
- input:focus
27
- + * {
28
- outline-color: rgb(0, 150, 255);
29
- }
30
-
31
- /*
32
- Don't try to replace @-moz-document url-prefix() this by
33
-
34
- -moz-outline or -moz-outline-color
35
- Because firefox would take into account outline instead of -moz-outline
36
-
37
- :moz-focus-ring
38
- Because for some element we set the focus outline on a div which would not match :focusring
39
- */
40
- @-moz-document url-prefix() {
41
- html[data-last-interaction="keyboard"] button:focus,
42
- html[data-last-interaction="keyboard"] a:focus,
43
- html[data-last-interaction="keyboard"] input:focus,
44
- html[data-last-interaction="keyboard"]
45
- *[data-input-customized]
46
- input:focus
47
- + * {
48
- outline-width: 2px;
49
- outline-offset: 0;
50
- outline-style: solid;
51
- /*
52
- force a blue color for firefox otherwise
53
- it uses outline-color: inherit
54
- making it unpredictible and sometimes hard to see
55
- */
56
- outline-color: rgb(0, 150, 255);
57
- }
58
- }
59
- ::-moz-focus-inner {
60
- border: 0;
61
- }
@@ -1,19 +0,0 @@
1
- // handle data-last-interaction attr on html (focusring)
2
- window.addEventListener("mousedown", (mousedownEvent) => {
3
- if (mousedownEvent.defaultPrevented) {
4
- return
5
- }
6
- document.documentElement.setAttribute("data-last-interaction", "mouse")
7
- })
8
- window.addEventListener("touchstart", (touchstartEvent) => {
9
- if (touchstartEvent.defaultPrevented) {
10
- return
11
- }
12
- document.documentElement.setAttribute("data-last-interaction", "mouse")
13
- })
14
- window.addEventListener("keydown", (keydownEvent) => {
15
- if (keydownEvent.defaultPrevented) {
16
- return
17
- }
18
- document.documentElement.setAttribute("data-last-interaction", "keyboard")
19
- })
@@ -1,140 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- id="jsenv_logo"
4
- viewBox="0 0 430 430"
5
- enable-background="new 0 0 430 430"
6
- >
7
- <g id="letters">
8
- <path
9
- id="j"
10
- fill="#F7931E"
11
- d="M78.879,272.229c3.381-0.441,7.056-1.176,9.408-3.822c2.793-2.939,3.234-8.086,3.234-19.111v-63.064
12
- h19.404v66.74c0,16.023-3.381,23.52-9.555,28.371c-5.292,4.264-14.112,6.174-21.021,6.174L78.879,272.229z M111.072,167.121
13
- c0,6.174-4.41,10.438-10.143,10.438c-5.292,0-9.702-4.263-9.555-10.438c-0.147-6.468,4.41-10.437,9.849-10.437
14
- S111.072,160.653,111.072,167.121z"
15
- />
16
- <path
17
- id="s"
18
- fill="#F7931E"
19
- d="M123.714,240.77c2.793,1.764,8.085,3.822,12.936,3.822c4.998,0,7.791-2.205,7.791-6.469
20
- c0-3.675-2.058-6.027-8.379-9.702c-11.76-6.615-14.553-14.112-14.553-20.727c0-12.937,9.261-22.639,23.667-22.639
21
- c6.027,0,10.731,1.47,14.553,3.234l-3.381,14.112c-2.793-1.617-6.174-2.94-9.996-2.94c-4.851,0-7.203,2.94-7.203,6.174
22
- c0,3.234,1.617,4.998,8.379,8.967c10.584,6.027,14.553,13.524,14.553,21.756c0,14.699-10.584,22.639-25.432,22.639
23
- c-6.027,0-13.083-1.617-16.464-4.117L123.714,240.77z"
24
- />
25
- <path
26
- id="e"
27
- fill="#F7931E"
28
- d="M204.414,223.57c0.148,21.756,8.674,26.461,16.906,26.461c4.852,0,8.967-1.176,11.76-2.793l1.764,8.379
29
- c-3.969,2.205-9.996,3.381-15.582,3.381c-17.052,0-25.872-13.965-25.872-35.722c0-23.08,9.702-37.486,23.961-37.486
30
- c14.553,0,20.285,15.289,20.285,31.459c0,2.646,0,4.557-0.146,6.321H204.414z M226.76,215.191
31
- c0.293-14.259-5.145-20.581-10.584-20.581c-7.352,0-11.174,10.878-11.613,20.581H226.76z"
32
- />
33
- <path
34
- id="n"
35
- fill="#F7931E"
36
- d="M249.836,205.342c0-8.379-0.441-12.643-0.588-18.375h9.85l0.588,8.526h0.293
37
- c3.088-5.733,8.82-9.702,16.318-9.702c9.85,0,17.199,7.35,17.199,24.55v47.775h-11.318V212.25c0-8.379-1.617-16.905-9.85-16.905
38
- c-4.705,0-9.262,3.969-10.732,11.613c-0.293,1.764-0.439,3.969-0.439,6.321v44.835h-11.32V205.342z"
39
- />
40
- <path
41
- id="v"
42
- fill="#F7931E"
43
- d="M313.783,186.966l8.967,39.985c1.029,4.851,2.205,11.172,3.088,17.346h0.441
44
- c0.734-5.879,1.91-11.907,2.939-17.346l8.82-39.985h11.172l-18.523,71.149h-10.143l-18.521-71.149H313.783z"
45
- />
46
- </g>
47
- <g id="arcs">
48
- <path
49
- id="arc1"
50
- fill="#F7931E"
51
- 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
52
- 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
53
- 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
54
- 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
55
- 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
56
- 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
57
- 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
58
- 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
59
- 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
60
- 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
61
- 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
62
- 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
63
- 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
64
- 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
65
- 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
66
- 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
67
- 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
68
- 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
69
- 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
70
- 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
71
- 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
72
- 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
73
- 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
74
- 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"
75
- />
76
- <path
77
- id="arc2"
78
- fill="#F7931E"
79
- 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
80
- 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
81
- 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
82
- 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
83
- 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
84
- 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
85
- 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
86
- 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
87
- 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
88
- 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
89
- 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
90
- 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
91
- 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
92
- 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
93
- 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
94
- 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
95
- 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
96
- 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
97
- 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
98
- 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
99
- 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
100
- 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
101
- 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
102
- 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
103
- 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
104
- 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
105
- 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
106
- 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
107
- 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
108
- 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
109
- 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
110
- 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
111
- 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
112
- 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
113
- 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
114
- 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
115
- 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
116
- 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
117
- C394.018,225.817,393.652,225.463,393.625,225.021z"
118
- />
119
- </g>
120
- <g id="circles">
121
- <circle
122
- id="circle2"
123
- fill="#F7931E"
124
- stroke-width="9"
125
- stroke-miterlimit="10"
126
- cx="70.536"
127
- cy="110.694"
128
- r="36.011"
129
- />
130
- <circle
131
- id="circle1"
132
- fill="#F7931E"
133
- stroke-width="9"
134
- stroke-miterlimit="10"
135
- cx="362.721"
136
- cy="309.694"
137
- r="36.012"
138
- />
139
- </g>
140
- </svg>
@@ -1,181 +0,0 @@
1
- import { createPreference } from "../util/preferences.js"
2
- import { enableVariant } from "../variant/variant.js"
3
-
4
- const notificationAvailable = typeof window.Notification === "function"
5
- const notificationPreference = createPreference("notification")
6
-
7
- const arrayOfOpenedNotifications = []
8
- export const renderToolbarNotification = () => {
9
- if (!notificationAvailable) {
10
- applyNotificationNotAvailableEffects()
11
- return
12
- }
13
- updatePermission()
14
- }
15
-
16
- const updatePermission = () => {
17
- const notifPermission = Notification.permission
18
- if (notifPermission === "default") {
19
- applyNotificationDefaultEffects()
20
- return
21
- }
22
- if (notifPermission === "denied") {
23
- applyNotificationDeniedEffects()
24
- return
25
- }
26
- if (notifPermission === "granted") {
27
- applyNotificationGrantedEffects()
28
- return
29
- }
30
- }
31
-
32
- const notifCheckbox = document.querySelector("#toggle-notifs")
33
-
34
- const applyNotificationNotAvailableEffects = () => {
35
- const notifSetting = document.querySelector(".settings-notification")
36
- notifSetting.setAttribute("data-disabled", "true")
37
- notifSetting.setAttribute(
38
- "title",
39
- `Notification not available in the browser`,
40
- )
41
- notifCheckbox.disabled = true
42
- }
43
- const applyNotificationDefaultEffects = () => {
44
- applyNotificationNOTGrantedEffects()
45
- const notifSetting = document.querySelector(".settings-notification")
46
- notifSetting.removeAttribute("data-disabled")
47
- notifSetting.removeAttribute("title")
48
- }
49
- const applyNotificationDeniedEffects = () => {
50
- applyNotificationNOTGrantedEffects()
51
- const notifSetting = document.querySelector(".settings-notification")
52
- notifSetting.setAttribute("data-disabled", "true")
53
- notifSetting.setAttribute("title", `Notification denied`)
54
- }
55
- const applyNotificationGrantedEffects = () => {
56
- enableVariant(document.querySelector(".notification-text"), {
57
- notif_granted: "yes",
58
- })
59
- notifCheckbox.disabled = false
60
- notifCheckbox.checked = getNotificationPreference()
61
- notifCheckbox.onchange = () => {
62
- setNotificationPreference(notifCheckbox.checked)
63
- if (!notifCheckbox.checked) {
64
- // slice because arrayOfOpenedNotifications can be mutated while looping
65
- arrayOfOpenedNotifications.slice().forEach((notification) => {
66
- notification.close()
67
- })
68
- }
69
- }
70
- }
71
- const applyNotificationNOTGrantedEffects = () => {
72
- enableVariant(document.querySelector(".notification-text"), {
73
- notif_granted: "no",
74
- })
75
- notifCheckbox.disabled = true
76
- notifCheckbox.checked = false
77
- document.querySelector("a.request_notification_permission").onclick = () => {
78
- requestPermission().then(() => {
79
- setNotificationPreference(true)
80
- updatePermission()
81
- })
82
- }
83
- }
84
-
85
- export const notifyExecutionResult = (
86
- executedFileRelativeUrl,
87
- execution,
88
- previousExecution,
89
- ) => {
90
- const notificationEnabled = getNotificationPreference()
91
- if (!notificationEnabled) return
92
-
93
- const notificationOptions = {
94
- lang: "en",
95
- icon: getFaviconHref(),
96
- clickToFocus: true,
97
- clickToClose: true,
98
- }
99
-
100
- if (execution.status === "errored") {
101
- if (previousExecution) {
102
- if (previousExecution.status === "completed") {
103
- notify("Broken", {
104
- ...notificationOptions,
105
- body: `${executedFileRelativeUrl} execution now failing.`,
106
- })
107
- } else {
108
- notify("Still failing", {
109
- ...notificationOptions,
110
- body: `${executedFileRelativeUrl} execution still failing.`,
111
- })
112
- }
113
- } else {
114
- notify("Failing", {
115
- ...notificationOptions,
116
- body: `${executedFileRelativeUrl} execution failed.`,
117
- })
118
- }
119
- } else if (previousExecution && previousExecution.status === "errored") {
120
- notify("Fixed", {
121
- ...notificationOptions,
122
- body: `${executedFileRelativeUrl} execution fixed.`,
123
- })
124
- }
125
- }
126
-
127
- const getNotificationPreference = () =>
128
- notificationPreference.has() ? notificationPreference.get() : true
129
-
130
- const setNotificationPreference = (value) => notificationPreference.set(value)
131
-
132
- const getFaviconHref = () => {
133
- const link = document.querySelector('link[rel="icon"]')
134
- return link ? link.href : undefined
135
- }
136
-
137
- let permission = "default"
138
-
139
- const notify = notificationAvailable
140
- ? async (
141
- title,
142
- { clickToFocus = false, clickToClose = false, ...options } = {},
143
- ) => {
144
- if (permission !== "granted") {
145
- return null
146
- }
147
-
148
- const notification = new Notification(title, options)
149
- arrayOfOpenedNotifications.push(notification)
150
- notification.onclick = () => {
151
- // but if the user navigated inbetween
152
- // focusing window will show something else
153
- // in that case it could be great to do something
154
- // maybe like showing a message saying this execution
155
- // is no longer visible
156
- // we could also navigauate to this file execution but
157
- // there is no guarantee re-executing the file would give same output
158
- // and it would also trigger an other notification
159
- if (clickToFocus) window.focus()
160
- if (clickToClose) notification.close()
161
- }
162
- notification.onclose = () => {
163
- const index = arrayOfOpenedNotifications.indexOf(notification)
164
- if (index > -1) {
165
- arrayOfOpenedNotifications.splice(index, 1)
166
- }
167
- }
168
- return notification
169
- }
170
- : () => {}
171
-
172
- let requestPromise
173
- const requestPermission = notificationAvailable
174
- ? async () => {
175
- if (requestPromise) return requestPromise
176
- requestPromise = Notification.requestPermission()
177
- permission = await requestPromise
178
- requestPromise = undefined
179
- return permission
180
- }
181
- : () => Promise.resolve("default")
@@ -1,61 +0,0 @@
1
- #overflow-menu-button {
2
- display: none;
3
- position: absolute;
4
- top: 0;
5
- right: 0;
6
- width: 40px;
7
- background: #404040;
8
- }
9
-
10
- #dotsIconSvg {
11
- width: 25px;
12
- }
13
-
14
- #overflow-menu {
15
- visibility: hidden; /* disable keyboard navigation */
16
- display: none;
17
- position: absolute;
18
- left: 100%;
19
- top: 0;
20
- bottom: 0;
21
- width: 100%;
22
- height: 100%;
23
- background: #404040;
24
- opacity: 0;
25
- }
26
-
27
- #overflow-menu[data-animate] {
28
- transition-property: left, opacity;
29
- transition-duration: 0.3s;
30
- }
31
-
32
- #overflow-menu > * {
33
- display: table-cell;
34
- vertical-align: middle;
35
- text-align: center;
36
- }
37
-
38
- #toolbar[data-overflow-menu-enabled] #overflow-menu-button {
39
- display: block;
40
- }
41
-
42
- #toolbar[data-overflow-menu-visible] #overflow-menu-button {
43
- background: #030713;
44
- }
45
-
46
- #toolbar[data-overflow-menu-enabled][data-overflow-menu-visible]
47
- #toolbar-wrapper {
48
- visibility: hidden; /* disable keyboard navigation */
49
- }
50
-
51
- #toolbar[data-overflow-menu-visible] #overflow-menu {
52
- visibility: visible; /* restore keyboard navigation */
53
- display: block;
54
- opacity: 1;
55
- left: 0;
56
- margin-left: -40px;
57
- }
58
-
59
- #toolbar[data-overflow-menu-enabled] #settings-box {
60
- right: -40px;
61
- }