@jsenv/plugin-toolbar 0.1.15 → 1.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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @jsenv/plugin-toolbar [![npm package](https://img.shields.io/npm/v/@jsenv/plugin-toolbar.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/plugin-toolbar)
2
+
3
+ [Documentation](<https://github.com/jsenv/core/wiki/A)-Getting-started>) · [Changelog](./CHANGELOG.md)
@@ -1,8 +1,8 @@
1
1
  var l$2;
2
2
  l$2 = {
3
3
  __e: function (n, l, u, i) {
4
- for (var t, r, o; l = l.__;) if ((t = l.__c) && !t.__) try {
5
- if ((r = t.constructor) && null != r.getDerivedStateFromError && (t.setState(r.getDerivedStateFromError(n)), o = t.__d), null != t.componentDidCatch && (t.componentDidCatch(n, i || {}), o = t.__d), o) return t.__E = t;
4
+ for (var t, o, r; l = l.__;) if ((t = l.__c) && !t.__) try {
5
+ if ((o = t.constructor) && null != o.getDerivedStateFromError && (t.setState(o.getDerivedStateFromError(n)), r = t.__d), null != t.componentDidCatch && (t.componentDidCatch(n, i || {}), r = t.__d), r) return t.__E = t;
6
6
  } catch (l) {
7
7
  n = l;
8
8
  }
@@ -748,24 +748,24 @@ const notifyExecutionResult = (execution, previousExecution) => {
748
748
  if (previousExecution.status === "completed") {
749
749
  notify("Broken", {
750
750
  ...notificationOptions,
751
- body: `${executedFileRelativeUrl} execution now failing.`
751
+ body: "".concat(executedFileRelativeUrl, " execution now failing.")
752
752
  });
753
753
  } else {
754
754
  notify("Still failing", {
755
755
  ...notificationOptions,
756
- body: `${executedFileRelativeUrl} execution still failing.`
756
+ body: "".concat(executedFileRelativeUrl, " execution still failing.")
757
757
  });
758
758
  }
759
759
  } else {
760
760
  notify("Failing", {
761
761
  ...notificationOptions,
762
- body: `${executedFileRelativeUrl} execution failed.`
762
+ body: "".concat(executedFileRelativeUrl, " execution failed.")
763
763
  });
764
764
  }
765
765
  } else if (previousExecution && previousExecution.status === "failed") {
766
766
  notify("Fixed", {
767
767
  ...notificationOptions,
768
- body: `${executedFileRelativeUrl} execution fixed.`
768
+ body: "".concat(executedFileRelativeUrl, " execution fixed.")
769
769
  });
770
770
  }
771
771
  };
@@ -1279,7 +1279,7 @@ const renderDocumentIndexLink = () => {
1279
1279
  };
1280
1280
 
1281
1281
  const enableVariant = (rootNode, variables) => {
1282
- const nodesNotMatching = Array.from(rootNode.querySelectorAll(`[${attributeIndicatingACondition}]`));
1282
+ const nodesNotMatching = Array.from(rootNode.querySelectorAll("[".concat(attributeIndicatingACondition, "]")));
1283
1283
  nodesNotMatching.forEach(nodeNotMatching => {
1284
1284
  const conditionAttributeValue = nodeNotMatching.getAttribute(attributeIndicatingACondition);
1285
1285
  const matches = testCondition(conditionAttributeValue, variables);
@@ -1287,7 +1287,7 @@ const enableVariant = (rootNode, variables) => {
1287
1287
  renameAttribute(nodeNotMatching, attributeIndicatingACondition, attributeIndicatingAMatch);
1288
1288
  }
1289
1289
  });
1290
- const nodesMatching = Array.from(rootNode.querySelectorAll(`[${attributeIndicatingAMatch}]`));
1290
+ const nodesMatching = Array.from(rootNode.querySelectorAll("[".concat(attributeIndicatingAMatch, "]")));
1291
1291
  nodesMatching.forEach(nodeMatching => {
1292
1292
  const conditionAttributeValue = nodeMatching.getAttribute(attributeIndicatingAMatch);
1293
1293
  const matches = testCondition(conditionAttributeValue, variables);
@@ -1325,8 +1325,8 @@ const parseCondition = conditionAttributeValue => {
1325
1325
  value: conditionAttributeValue.slice(colonIndex + 1)
1326
1326
  };
1327
1327
  };
1328
- const attributeIndicatingACondition = `data-when`;
1329
- const attributeIndicatingAMatch = `data-when-active`;
1328
+ const attributeIndicatingACondition = "data-when";
1329
+ const attributeIndicatingAMatch = "data-when-active";
1330
1330
  const renameAttribute = (node, name, newName) => {
1331
1331
  node.setAttribute(newName, node.getAttribute(name));
1332
1332
  node.removeAttribute(name);
@@ -1379,10 +1379,10 @@ const computeText = ({
1379
1379
  endTime
1380
1380
  }) => {
1381
1381
  if (status === "completed") {
1382
- return `Execution completed in ${endTime - startTime}ms`;
1382
+ return "Execution completed in ".concat(endTime - startTime, "ms");
1383
1383
  }
1384
1384
  if (status === "failed") {
1385
- return `Execution failed in ${endTime - startTime}ms`;
1385
+ return "Execution failed in ".concat(endTime - startTime, "ms");
1386
1386
  }
1387
1387
  if (status === "running") {
1388
1388
  return "Executing...";
@@ -1468,9 +1468,9 @@ const computeTooltipText = ({
1468
1468
  }) => {
1469
1469
  const changesCount = changes.length;
1470
1470
  if (changesCount === 1) {
1471
- return `There is <a href="javascript:void(0)">1</a> change to apply`;
1471
+ return "There is <a href=\"javascript:void(0)\">1</a> change to apply";
1472
1472
  }
1473
- return `There is <a href="javascript:void(0)">${changesCount}<a> changes to apply`;
1473
+ return "There is <a href=\"javascript:void(0)\">".concat(changesCount, "<a> changes to apply");
1474
1474
  };
1475
1475
 
1476
1476
  const parentServerEvents = window.parent.__server_events__;
@@ -1546,7 +1546,7 @@ const renderToolbarAutoreloadSetting = () => {
1546
1546
  };
1547
1547
  const disableAutoreloadSetting = () => {
1548
1548
  document.querySelector(".settings_autoreload").setAttribute("data-disabled", "true");
1549
- document.querySelector(".settings_autoreload").setAttribute("title", `Autoreload not enabled on server`);
1549
+ document.querySelector(".settings_autoreload").setAttribute("title", "Autoreload not enabled on server");
1550
1550
  document.querySelector("#toggle_autoreload").disabled = true;
1551
1551
  };
1552
1552
 
@@ -1641,7 +1641,7 @@ const renderToolbarNotificationSetting = () => {
1641
1641
  const applyNotificationNotAvailableEffects = () => {
1642
1642
  const notifSetting = document.querySelector(".settings_notification");
1643
1643
  notifSetting.setAttribute("data-disabled", "true");
1644
- notifSetting.setAttribute("title", `Notification not available in the browser`);
1644
+ notifSetting.setAttribute("title", "Notification not available in the browser");
1645
1645
  notifCheckbox.disabled = true;
1646
1646
  };
1647
1647
  const applyNotificationDefaultEffects = () => {
@@ -1654,7 +1654,7 @@ const applyNotificationDeniedEffects = () => {
1654
1654
  applyNotificationNOTGrantedEffects();
1655
1655
  const notifSetting = document.querySelector(".settings_notification");
1656
1656
  notifSetting.setAttribute("data-disabled", "true");
1657
- notifSetting.setAttribute("title", `Notification denied`);
1657
+ notifSetting.setAttribute("title", "Notification denied");
1658
1658
  };
1659
1659
  const applyNotificationGrantedEffects = () => {
1660
1660
  enableVariant(document.querySelector(".notification_text"), {
@@ -80,52 +80,7 @@ const injectToolbar = async ({
80
80
  });
81
81
  });
82
82
  const div = document.createElement("div");
83
- div.innerHTML = `
84
- <div id="jsenv_toolbar_trigger" style="display:none">
85
- <svg id="jsenv_toolbar_trigger_icon">
86
- <use xlink:href="${jsenvLogoSvgUrl}#jsenv_logo"></use>
87
- </svg>
88
- <style>
89
- #jsenv_toolbar_trigger {
90
- display: block;
91
- overflow: hidden;
92
- position: fixed;
93
- z-index: 1000;
94
- bottom: -32px;
95
- right: 20px;
96
- height: 40px;
97
- width: 40px;
98
- padding: 0;
99
- margin: 0;
100
- border-radius: 5px 5px 0 0;
101
- border: 1px solid rgba(0, 0, 0, 0.33);
102
- border-bottom: none;
103
- box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.46);
104
- background: transparent;
105
- text-align: center;
106
- transition: 600ms;
107
- }
108
-
109
- #jsenv_toolbar_trigger:hover {
110
- cursor: pointer;
111
- }
112
-
113
- #jsenv_toolbar_trigger[data-expanded] {
114
- bottom: 0;
115
- }
116
-
117
- #jsenv_toolbar_trigger_icon {
118
- width: 35px;
119
- height: 35px;
120
- opacity: 0;
121
- transition: 600ms;
122
- }
123
-
124
- #jsenv_toolbar_trigger[data-expanded] #jsenv_toolbar_trigger_icon {
125
- opacity: 1;
126
- }
127
- </style>
128
- </div>`;
83
+ div.innerHTML = "\n<div id=\"jsenv_toolbar_trigger\" style=\"display:none\">\n <svg id=\"jsenv_toolbar_trigger_icon\">\n <use xlink:href=\"".concat(jsenvLogoSvgUrl, "#jsenv_logo\"></use>\n </svg>\n <style>\n #jsenv_toolbar_trigger {\n display: block;\n overflow: hidden;\n position: fixed;\n z-index: 1000;\n bottom: -32px;\n right: 20px;\n height: 40px;\n width: 40px;\n padding: 0;\n margin: 0;\n border-radius: 5px 5px 0 0;\n border: 1px solid rgba(0, 0, 0, 0.33);\n border-bottom: none;\n box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.46);\n background: transparent;\n text-align: center;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger:hover {\n cursor: pointer;\n }\n\n #jsenv_toolbar_trigger[data-expanded] {\n bottom: 0;\n }\n\n #jsenv_toolbar_trigger_icon {\n width: 35px;\n height: 35px;\n opacity: 0;\n transition: 600ms;\n }\n\n #jsenv_toolbar_trigger[data-expanded] #jsenv_toolbar_trigger_icon {\n opacity: 1;\n }\n </style>\n</div>");
129
84
  const toolbarTrigger = div.firstElementChild;
130
85
  iframe.parentNode.appendChild(toolbarTrigger);
131
86
  let timer;
@@ -72,9 +72,7 @@ const generateCodeToInjectToolbar = ({
72
72
  animationsEnabled,
73
73
  notificationsEnabled
74
74
  }, null, " ");
75
- return `import { injectToolbar } from ${from}
76
-
77
- injectToolbar(${paramsSource});`;
75
+ return "import { injectToolbar } from ".concat(from, "\n\ninjectToolbar(").concat(paramsSource, ");");
78
76
  };
79
77
 
80
78
  export { jsenvPluginToolbar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-toolbar",
3
- "version": "0.1.15",
3
+ "version": "1.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "/src/"
27
27
  ],
28
28
  "dependencies": {
29
- "@jsenv/ast": "3.0.8",
29
+ "@jsenv/ast": "4.0.0",
30
30
  "@preact/signals": "1.1.3"
31
31
  },
32
32
  "scripts": {