astro 3.4.1 → 3.4.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.
@@ -5,9 +5,23 @@ export interface Props {
5
5
  fallback?: Fallback;
6
6
  }
7
7
 
8
- const { fallback = 'animate' } = Astro.props as Props;
8
+ const { fallback = 'animate' } = Astro.props;
9
9
  ---
10
10
 
11
+ <style is:global>
12
+ /* Route announcer */
13
+ .astro-route-announcer {
14
+ position: absolute;
15
+ left: 0;
16
+ top: 0;
17
+ clip: rect(0 0 0 0);
18
+ clip-path: inset(50%);
19
+ overflow: hidden;
20
+ white-space: nowrap;
21
+ width: 1px;
22
+ height: 1px;
23
+ }
24
+ </style>
11
25
  <meta name="astro-view-transitions-enabled" content="true" />
12
26
  <meta name="astro-view-transitions-fallback" content={fallback} />
13
27
  <script>
@@ -54,16 +54,3 @@
54
54
  animation: none !important;
55
55
  }
56
56
  }
57
-
58
- /* Route announcer */
59
- .astro-route-announcer {
60
- position: absolute;
61
- left: 0;
62
- top: 0;
63
- clip: rect(0 0 0 0);
64
- clip-path: inset(50%);
65
- overflow: hidden;
66
- white-space: nowrap;
67
- width: 1px;
68
- height: 1px;
69
- }
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "3.4.1";
1
+ const ASTRO_VERSION = "3.4.2";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
20
20
  base: restart.container.settings.config.base
21
21
  })
22
22
  );
23
- const currentVersion = "3.4.1";
23
+ const currentVersion = "3.4.2";
24
24
  if (currentVersion.includes("-")) {
25
25
  logger.warn(null, msg.prerelease({ currentVersion }));
26
26
  }
@@ -50,7 +50,7 @@ function serverStart({
50
50
  base,
51
51
  isRestart = false
52
52
  }) {
53
- const version = "3.4.1";
53
+ const version = "3.4.2";
54
54
  const localPrefix = `${dim("\u2503")} Local `;
55
55
  const networkPrefix = `${dim("\u2503")} Network `;
56
56
  const emptyPrefix = " ".repeat(11);
@@ -235,7 +235,7 @@ function printHelp({
235
235
  message.push(
236
236
  linebreak(),
237
237
  ` ${bgGreen(black(` ${commandName} `))} ${green(
238
- `v${"3.4.1"}`
238
+ `v${"3.4.2"}`
239
239
  )} ${headline}`
240
240
  );
241
241
  }
@@ -39,7 +39,7 @@ document.addEventListener("DOMContentLoaded", async () => {
39
39
  status: "loading",
40
40
  eventTarget
41
41
  };
42
- eventTarget.addEventListener("plugin-notification", (evt) => {
42
+ eventTarget.addEventListener("toggle-notification", (evt) => {
43
43
  const target = overlay.shadowRoot?.querySelector(`[data-plugin-id="${plugin.id}"]`);
44
44
  if (!target)
45
45
  return;
@@ -49,6 +49,13 @@ document.addEventListener("DOMContentLoaded", async () => {
49
49
  }
50
50
  target.querySelector(".notification")?.toggleAttribute("data-active", newState);
51
51
  });
52
+ eventTarget.addEventListener("toggle-plugin", (evt) => {
53
+ let newState = void 0;
54
+ if (evt instanceof CustomEvent) {
55
+ newState = evt.detail.state ?? true;
56
+ }
57
+ overlay.togglePluginStatus(plugin, newState);
58
+ });
52
59
  return plugin;
53
60
  };
54
61
  const customPluginsDefinitions = await loadDevOverlayPlugins();
@@ -84,7 +84,7 @@ class AstroDevOverlay extends HTMLElement {
84
84
  overflow: hidden;
85
85
  }
86
86
 
87
- #dev-bar #bar-container .item:hover, #dev-bar #bar-container .item:focus {
87
+ #dev-bar #bar-container .item:hover, #dev-bar #bar-container .item:focus-visible {
88
88
  background: rgba(27, 30, 36, 1);
89
89
  cursor: pointer;
90
90
  outline-offset: -3px;
@@ -103,6 +103,33 @@ class AstroDevOverlay extends HTMLElement {
103
103
  background: rgba(71, 78, 94, 1);
104
104
  }
105
105
 
106
+ #dev-bar .item-tooltip {
107
+ background: linear-gradient(0deg, #13151A, #13151A), linear-gradient(0deg, #343841, #343841);
108
+ border: 1px solid rgba(52, 56, 65, 1);
109
+ border-radius: 4px;
110
+ padding: 4px 8px;
111
+ position: absolute;
112
+ top: -40px;
113
+ opacity: 0;
114
+ transition: opacity 0.2s ease-in-out 0s;
115
+ pointer-events: none;
116
+ }
117
+
118
+ #dev-bar .item-tooltip::after{
119
+ content: '';
120
+ position: absolute;
121
+ left: calc(50% - 5px);
122
+ bottom: -6px;
123
+ border-left: 5px solid transparent;
124
+ border-right: 5px solid transparent;
125
+ border-top: 5px solid #343841;
126
+ }
127
+
128
+ #dev-bar .item:hover .item-tooltip, #dev-bar .item:not(.active):focus-visible .item-tooltip {
129
+ transition: opacity 0.2s ease-in-out 200ms;
130
+ opacity: 1;
131
+ }
132
+
106
133
  #dev-bar #bar-container .item.active .notification {
107
134
  border-color: rgba(71, 78, 94, 1);
108
135
  }
@@ -317,7 +344,7 @@ class AstroDevOverlay extends HTMLElement {
317
344
  await plugin.init?.(shadowRoot, plugin.eventTarget);
318
345
  plugin.status = "ready";
319
346
  if (import.meta.hot) {
320
- import.meta.hot.send(`${WS_EVENT_NAME}:${plugin.id}:init`);
347
+ import.meta.hot.send(`${WS_EVENT_NAME}:${plugin.id}:initialized`);
321
348
  }
322
349
  } catch (e) {
323
350
  console.error(`Failed to init plugin ${plugin.id}, error: ${e}`);
@@ -327,7 +354,7 @@ class AstroDevOverlay extends HTMLElement {
327
354
  getPluginTemplate(plugin) {
328
355
  return `<button class="item" data-plugin-id="${plugin.id}">
329
356
  <div class="icon">${this.getPluginIcon(plugin.icon)}<div class="notification"></div></div>
330
- <span class="sr-only">${plugin.name}</span>
357
+ <span class="item-tooltip">${plugin.name}</span>
331
358
  </button>`;
332
359
  }
333
360
  getPluginIcon(icon) {
@@ -350,7 +377,7 @@ class AstroDevOverlay extends HTMLElement {
350
377
  target.classList.toggle("active", plugin.active);
351
378
  this.getPluginCanvasById(plugin.id)?.toggleAttribute("data-active", plugin.active);
352
379
  plugin.eventTarget.dispatchEvent(
353
- new CustomEvent("plugin-toggle", {
380
+ new CustomEvent("plugin-toggled", {
354
381
  detail: {
355
382
  state: plugin.active,
356
383
  plugin
@@ -358,7 +385,7 @@ class AstroDevOverlay extends HTMLElement {
358
385
  })
359
386
  );
360
387
  if (import.meta.hot) {
361
- import.meta.hot.send(`${WS_EVENT_NAME}:${plugin.id}:toggle`, { state: plugin.active });
388
+ import.meta.hot.send(`${WS_EVENT_NAME}:${plugin.id}:toggled`, { state: plugin.active });
362
389
  }
363
390
  }
364
391
  toggleMinimizeButton(newStatus) {
@@ -16,8 +16,15 @@ class AstroComponentInstance {
16
16
  this.factory = factory;
17
17
  this.slotValues = {};
18
18
  for (const name in slots) {
19
- const value = slots[name](result);
20
- this.slotValues[name] = () => value;
19
+ let didRender = false;
20
+ let value = slots[name](result);
21
+ this.slotValues[name] = () => {
22
+ if (!didRender) {
23
+ didRender = true;
24
+ return value;
25
+ }
26
+ return slots[name](result);
27
+ };
21
28
  }
22
29
  }
23
30
  async init(result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",