@jsenv/core 29.8.6 → 29.9.0

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/js/autoreload.js +1 -1
  3. package/dist/main.js +50 -2085
  4. package/package.json +2 -2
  5. package/src/build/build.js +33 -33
  6. package/src/plugins/plugins.js +1 -1
  7. package/src/plugins/ribbon/jsenv_plugin_ribbon.js +6 -1
  8. package/src/plugins/url_resolution/jsenv_plugin_url_resolution.js +6 -2
  9. package/src/plugins/url_resolution/node_esm_resolver.js +6 -1
  10. package/dist/js/html_src_set.js +0 -20
  11. package/src/plugins/toolbar/client/animation/toolbar_animation.js +0 -39
  12. package/src/plugins/toolbar/client/eventsource/eventsource.css +0 -83
  13. package/src/plugins/toolbar/client/eventsource/toolbar_eventsource.js +0 -57
  14. package/src/plugins/toolbar/client/execution/execution.css +0 -79
  15. package/src/plugins/toolbar/client/execution/toolbar_execution.js +0 -88
  16. package/src/plugins/toolbar/client/focus/focus.css +0 -61
  17. package/src/plugins/toolbar/client/focus/toolbar_focus.js +0 -19
  18. package/src/plugins/toolbar/client/jsenv_logo.svg +0 -140
  19. package/src/plugins/toolbar/client/notification/toolbar_notification.js +0 -181
  20. package/src/plugins/toolbar/client/responsive/overflow_menu.css +0 -61
  21. package/src/plugins/toolbar/client/responsive/toolbar_responsive.js +0 -103
  22. package/src/plugins/toolbar/client/settings/settings.css +0 -201
  23. package/src/plugins/toolbar/client/settings/toolbar_settings.js +0 -47
  24. package/src/plugins/toolbar/client/theme/jsenv_theme.css +0 -77
  25. package/src/plugins/toolbar/client/theme/light_theme.css +0 -106
  26. package/src/plugins/toolbar/client/theme/toolbar_theme.js +0 -34
  27. package/src/plugins/toolbar/client/toolbar.html +0 -457
  28. package/src/plugins/toolbar/client/toolbar_injector.js +0 -218
  29. package/src/plugins/toolbar/client/toolbar_main.css +0 -172
  30. package/src/plugins/toolbar/client/toolbar_main.js +0 -197
  31. package/src/plugins/toolbar/client/tooltip/tooltip.css +0 -61
  32. package/src/plugins/toolbar/client/tooltip/tooltip.js +0 -39
  33. package/src/plugins/toolbar/client/util/animation.js +0 -305
  34. package/src/plugins/toolbar/client/util/dom.js +0 -108
  35. package/src/plugins/toolbar/client/util/fetch_using_xhr.js +0 -400
  36. package/src/plugins/toolbar/client/util/fetching.js +0 -14
  37. package/src/plugins/toolbar/client/util/iframe_to_parent_href.js +0 -10
  38. package/src/plugins/toolbar/client/util/jsenv_logger.js +0 -28
  39. package/src/plugins/toolbar/client/util/preferences.js +0 -10
  40. package/src/plugins/toolbar/client/util/responsive.js +0 -112
  41. package/src/plugins/toolbar/client/util/util.js +0 -19
  42. package/src/plugins/toolbar/client/variant/variant.js +0 -74
  43. package/src/plugins/toolbar/jsenv_plugin_toolbar.js +0 -62
@@ -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
- }
@@ -1,103 +0,0 @@
1
- import {
2
- forceHideElement,
3
- removeForceHideElement,
4
- deactivateToolbarSection,
5
- } from "../util/dom.js"
6
- import { createHorizontalBreakpoint } from "../util/responsive.js"
7
- import { hideTooltip } from "../tooltip/tooltip.js"
8
-
9
- const WINDOW_SMALL_WIDTH = 420
10
-
11
- export const makeToolbarResponsive = () => {
12
- // apply responsive design on toolbar icons if needed + add listener on resize screen
13
- // ideally we should listen breakpoint once, for now restore toolbar
14
- const overflowMenuBreakpoint = createHorizontalBreakpoint(WINDOW_SMALL_WIDTH)
15
- const handleOverflowMenuBreakpoint = () => {
16
- responsiveToolbar(overflowMenuBreakpoint)
17
- }
18
- handleOverflowMenuBreakpoint()
19
- overflowMenuBreakpoint.changed.listen(handleOverflowMenuBreakpoint)
20
-
21
- // overflow menu
22
- document.querySelector("#overflow-menu-button").onclick = () =>
23
- toggleOverflowMenu()
24
- }
25
-
26
- const responsiveToolbar = (overflowMenuBreakpoint) => {
27
- // close all tooltips in case opened
28
- hideTooltip(document.querySelector("#eventsource-indicator"))
29
- hideTooltip(document.querySelector("#execution-indicator"))
30
- // close settings box in case opened
31
- deactivateToolbarSection(document.querySelector("#settings"))
32
-
33
- if (overflowMenuBreakpoint.isBelow()) {
34
- enableOverflow()
35
- } else {
36
- disableOverflow()
37
- }
38
- }
39
-
40
- let moves = []
41
-
42
- const enableOverflow = () => {
43
- // move elements from toolbar to overflow menu
44
- const responsiveToolbarElements = document.querySelectorAll(
45
- "[data-responsive-toolbar-element]",
46
- )
47
- const overflowMenu = document.querySelector("#overflow-menu")
48
-
49
- // keep a placeholder element to know where to move them back
50
- moves = Array.from(responsiveToolbarElements).map((element) => {
51
- const placeholder = document.createElement("div")
52
- placeholder.style.display = "none"
53
- placeholder.setAttribute("data-placeholder", "")
54
- element.parentNode.replaceChild(placeholder, element)
55
- overflowMenu.appendChild(element)
56
- return { element, placeholder }
57
- })
58
-
59
- document
60
- .querySelector("#toolbar")
61
- .setAttribute("data-overflow-menu-enabled", "")
62
- removeForceHideElement(document.querySelector("#overflow-menu-button"))
63
- }
64
-
65
- const disableOverflow = () => {
66
- // close overflow menu in case it's open & unselect toggleOverflowMenu button in case it's selected
67
- hideOverflowMenu()
68
- deactivateToolbarSection(document.querySelector("#overflow-menu"))
69
- moves.forEach(({ element, placeholder }) => {
70
- placeholder.parentNode.replaceChild(element, placeholder)
71
- })
72
- moves = []
73
-
74
- document
75
- .querySelector("#toolbar")
76
- .removeAttribute("data-overflow-menu-enabled")
77
- forceHideElement(document.querySelector("#overflow-menu-button"))
78
- }
79
-
80
- const toggleOverflowMenu = () => {
81
- if (overflowMenuIsVisible()) {
82
- hideOverflowMenu()
83
- } else {
84
- showOverflowMenu()
85
- }
86
- }
87
-
88
- const overflowMenuIsVisible = () => {
89
- const toolbar = document.querySelector("#toolbar")
90
- return toolbar.hasAttribute("data-overflow-menu-visible")
91
- }
92
-
93
- const showOverflowMenu = () => {
94
- const toolbar = document.querySelector("#toolbar")
95
- document.querySelector("#overflow-menu").setAttribute("data-animate", "")
96
- toolbar.setAttribute("data-overflow-menu-visible", "")
97
- }
98
-
99
- const hideOverflowMenu = () => {
100
- const toolbar = document.querySelector("#toolbar")
101
- toolbar.removeAttribute("data-overflow-menu-visible")
102
- document.querySelector("#overflow-menu").removeAttribute("data-animate")
103
- }
@@ -1,201 +0,0 @@
1
- #settings-button {
2
- position: relative;
3
- }
4
-
5
- #settings-button[data-warning] svg {
6
- fill: #cb5909;
7
- }
8
-
9
- #settings-button[data-warning] svg:hover {
10
- fill: darkorange !important;
11
- }
12
-
13
- #settings-box {
14
- display: none;
15
- position: absolute;
16
- bottom: 40px;
17
- right: 0;
18
- text-align: center;
19
- padding: 17px;
20
- font-size: 14px;
21
- color: #fff;
22
- background-color: #030713;
23
- border-radius: 5px 5px 0 0;
24
- min-width: 250px;
25
- min-height: 150px;
26
- z-index: -1;
27
- }
28
-
29
- [data-active] #settings-box {
30
- display: block;
31
- animation: comeUp ease 0.3s;
32
- }
33
-
34
- @keyframes comeUp {
35
- 0% {
36
- opacity: 0;
37
- transform: translate(0, 90px);
38
- }
39
- 100% {
40
- opacity: 1;
41
- transform: translate(0, 0);
42
- }
43
- }
44
-
45
- #settings-box-body {
46
- text-align: left;
47
- padding: 18px 0;
48
- max-height: 80vh;
49
- overflow: auto;
50
- width: 100vw;
51
- display: flex;
52
- justify-content: center;
53
- }
54
-
55
- .settings-box-items-wrapper {
56
- max-width: 700px;
57
- display: flex;
58
- flex-wrap: wrap;
59
- justify-content: center;
60
- }
61
-
62
- .settings-box-item {
63
- padding: 15px;
64
- background: #0c111b;
65
- width: 250px;
66
- margin: 9px 18px;
67
- }
68
-
69
- #settings-box-header .settings-icon {
70
- fill: none;
71
- stroke: #24b1b0;
72
- stroke-width: 2;
73
- margin-right: 10px;
74
- width: 22px;
75
- height: 22px;
76
- position: relative;
77
- top: 4px;
78
- }
79
-
80
- #settings-box h3 {
81
- display: inline-block;
82
- font-size: 20px;
83
- margin: 10px 0;
84
- color: #24b1b0;
85
- }
86
-
87
- #button-close-settings {
88
- float: right;
89
- fill: #24b1b0;
90
- }
91
-
92
- #button-close-settings:hover {
93
- opacity: 0.6;
94
- }
95
-
96
- label {
97
- color: #a9a8a8;
98
- font-size: 14px;
99
- padding-bottom: 3px;
100
- display: block;
101
- }
102
-
103
- #settings-box .category-title {
104
- color: #24b1b0;
105
- font-size: 16px;
106
- display: inline-block;
107
- margin-bottom: 15px;
108
- margin-top: 4px;
109
- }
110
-
111
- #settings-box .category-title svg {
112
- fill: currentColor;
113
- vertical-align: top;
114
- margin-right: 5px;
115
- width: 18px;
116
- height: 18px;
117
- }
118
-
119
- #settings-box .category-subtitle {
120
- color: #a9a8a8;
121
- font-size: 14px;
122
- max-width: 220px;
123
- }
124
-
125
- /* checkbox switch */
126
- .switch {
127
- position: relative;
128
- float: right;
129
- width: 3.5em;
130
- height: 2em;
131
- padding: 0;
132
- cursor: pointer;
133
- }
134
- .switch input {
135
- position: absolute;
136
- opacity: 0;
137
- width: 0;
138
- height: 0;
139
- }
140
- .switch .slider {
141
- position: absolute;
142
- vertical-align: middle;
143
- height: 0.3em;
144
- left: 0.5em;
145
- right: 0.5em;
146
- top: 50%;
147
- margin-top: -0.15em;
148
- background-color: #4c4c4c;
149
- transition: 0.4s;
150
- border-radius: 0.15em;
151
- }
152
- .switch .square {
153
- position: absolute;
154
- content: "";
155
- height: 1em;
156
- width: 1em;
157
- left: 0.5em;
158
- top: 50%;
159
- margin-top: -0.5em;
160
- background-color: #4c4c4c;
161
- color: #030713;
162
- transition: 0.4s;
163
- border-radius: 0.15em;
164
- }
165
- .switch input + * {
166
- position: relative;
167
- width: 100%;
168
- height: 100%;
169
-
170
- /* It's important to have a border (event transparent)
171
- To be able to apply an outline to this element later*/
172
- border-width: 1px;
173
- border-color: transparent;
174
- border-style: solid;
175
- }
176
- .switch input:checked + * .slider {
177
- background-color: #24b1b0;
178
- }
179
- .switch input:checked + * .square {
180
- transform: translateX(1.6em);
181
- background-color: #24b1b0;
182
- }
183
-
184
- .settings-box-item[data-disabled] {
185
- background-color: rgba(12, 17, 27, 0.4);
186
- cursor: default;
187
- }
188
- .settings-box-item[data-disabled] .category-title,
189
- .settings-box-item[data-disabled] .switch,
190
- .settings-box-item[data-disabled] .category-subtitle {
191
- opacity: 0.4;
192
- }
193
- .settings-box-item[data-disabled] .category-title span {
194
- text-decoration: line-through;
195
- }
196
- .settings-box-item[data-disabled] .category-subtitle {
197
- text-decoration: line-through;
198
- }
199
- .settings-box-item[data-disabled] .switch {
200
- cursor: default;
201
- }