Commit graph

81 commits

Author SHA1 Message Date
Martin Trapp
0e0fa605d1
Fix 8083 (#8105)
* override wrong positions in browser history

* Lost events are taken into account during throttling
2023-08-16 16:38:18 -04:00
Martin Trapp
56e7c5177b
Handle noscript tags in head during ViewTransitions (#8091) 2023-08-15 16:26:37 -04:00
Greg Cobb
a12027b6af
fix: Removed extra double quotes from computed style in shiki code component (#8035) 2023-08-15 22:29:16 +08:00
matthewp
06fa76cec6 [ci] format 2023-08-11 17:57:40 +00:00
Matthew Phillips
4a145c4c7d
Fix same-page transition with different query params (#8042) 2023-08-11 13:54:31 -04:00
matthewp
2bdcba2aa7 [ci] format 2023-08-11 12:59:13 +00:00
Matthew Phillips
405913cdf2
Prevent script re-execution on page evaluation (#8033) 2023-08-11 08:56:12 -04:00
Martin Trapp
86bee28121
View Transitions: do not animate same page navigation, but animate hash links to different pages (#8013)
* Links with hash marks are now supported if they lead to a different page

* treat links to same page equally, independent of hash or not

* Links to the same page do not trigger view transitions

* special treatment for trailing hash

* view transitions: simpler rule to exclude in-page links
2023-08-10 10:07:13 -04:00
Matthew Phillips
a00cfb8942
Fix race condition when performing swap for fallback (#7945)
* Fix race condition when performing swap for fallback

* Adding a changeset

* Use let
2023-08-04 08:48:11 -04:00
Matthew Phillips
fa4367792b Revert "Fix race condition when performing swap for fallback"
This reverts commit e5f7d11ef5.
2023-08-03 19:57:36 -04:00
Matthew Phillips
e5f7d11ef5 Fix race condition when performing swap for fallback 2023-08-03 19:57:12 -04:00
matthewp
68066290df [ci] format 2023-08-02 18:44:36 +00:00
Matthew Phillips
41afb84057
Persistent DOM in ViewTransitions (#7861)
* First pass at transition:persist

* Persistent islands

* Changeset

* Updated compiler

* Use official release

* Upgrade again

* Refactor to allow head content to persist untouched

* >=

* Specify the types for "astro:persist"

* Automatically persist links

* Use reference for array

* Upgrade to latest compiler version

* Explain the feature

* Update .changeset/empty-experts-unite.md

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* Update .changeset/empty-experts-unite.md

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* Update .changeset/empty-experts-unite.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/empty-experts-unite.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-08-02 14:42:01 -04:00
matthewp
4e651af16f [ci] format 2023-08-02 17:10:18 +00:00
Martin Trapp
c264be3497
Fix scroll position in view transition (#7882) (#7911) 2023-08-02 13:07:30 -04:00
matthewp
2f95a3e0ca [ci] format 2023-07-28 13:09:24 +00:00
Matthew Phillips
49a4b28202
Scroll position restoration (#7800)
* Scroll position restoration

* Adding a changeset

* Throttle state persistence

* very important change
2023-07-28 09:07:00 -04:00
matthewp
73eb4dfe2f [ci] format 2023-07-27 12:59:49 +00:00
Matthew Phillips
5161cf919c
Add astro:beforeload event (#7823)
* Add astro:beforeload event

* Adding a changeset

* Update .changeset/chilled-elephants-develop.md

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-07-27 08:57:37 -04:00
matthewp
30336bab94 [ci] format 2023-07-27 12:44:15 +00:00
Matthew Phillips
267487e63e
Prevent navigation on hash change (#7824) 2023-07-27 08:42:04 -04:00
matthewp
0c1a26adc8 [ci] format 2023-07-25 12:38:25 +00:00
Matthew Phillips
188eeddd47
Execute scripts on page navigation (view transitions) (#7786)
* Execute scripts on page navigation (view transitions)

* Update .changeset/sharp-seas-smile.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-07-25 08:35:47 -04:00
matthewp
c65da5f1cd [ci] format 2023-07-21 20:29:15 +00:00
Matthew Phillips
274e675328
Prevent FOUC with production links in ViewTransitions (#7756)
* Prevent FOUC with production links in ViewTransitions

* Adding changeset

* Move up so it works with fallback too
2023-07-21 16:26:42 -04:00
matthewp
f79ab0bdb3 [ci] format 2023-07-21 20:13:33 +00:00
Matthew Phillips
c2d6cfd0c2
Prevent animations with prefers-reduced-motion (#7757)
* Prevent animations with prefers-reduced-motion

* Also disable animations in the fallback

* Change select to target elements
2023-07-21 16:10:48 -04:00
Matthew Phillips
201d32dcfc
Handle back navigation from page without VT (#7750)
* Handle back navigation from page without VT

* Adding a changeset
2023-07-21 10:40:36 -04:00
matthewp
7a6ca236e8 [ci] format 2023-07-19 19:21:13 +00:00
Matthew Phillips
6a12fcecb0
Initial View Transition Support (#7511)
* Basic support

* Add the fade transition

* Move CSS into a separate file

* Add transition name

* View Transitions changeset

* Replace the boolean transition with 'morph'

* Update to use `transition:animate`

* Use head propagation

* Move CSS into a separate file

* Add builtin animations and namespaced module

* Misquote

* Remove unused code

* Add automatic prefetching to the View Transitions router

* Use a data attribute for back nav animations

* Use [data-astro-transition]

* Add view transitions to examples

* Wait on the HTML response before calling startViewTransition

* Updated stuff

* Update the compiler

* Fix

* Fallback support

* Properly do fallback

* Simplify the selectors

* Put viewTransitions support behind a flag

* Upgrade the compiler

* Remove unused import

* Add tests

* Use an explicit import instead of types

* Fix case where the click comes from within nested content

* Fix linting

* Add a test for the back button

* Prevent glitch in fallback

* Do not combine selectors

* Fallback to MPA nav if there is an issue fetching

* Fallback swap if there are no animations

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/components/ViewTransitions.astro

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Update packages/astro/components/ViewTransitions.astro

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Update the changeset

* PR review changes

* Update more based on review comments.

* Update the updateDOM default

* Pass in transitions options to the compiler

* Update broken tests

* Update .changeset/silly-garlics-live.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/silly-garlics-live.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/silly-garlics-live.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/silly-garlics-live.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* h2 -> h4

* Upgrade to stable compiler

* Remove exp redirects from sitemap

* Remove usage from examples

* Remove example updates

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-07-19 15:18:41 -04:00
Erika
b3b640435b
nit: export props has been unnecessary.. forever (#7646) 2023-07-14 09:57:06 -04:00
Bjorn Lu
cac4a321e8
Support <Code inline /> to output inline code (#6959)
* Support `<Code inline />` to output inline code

* Fix typo

* Fix typo again

* Remove expected error

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-05-03 12:15:00 -04:00
Bjorn Lu
49514e4ce4
Upgrade shiki to v0.14.1 (#6932)
* Upgrade shiki

* Update themes

* Update languages

* Simplify

* Fix compat for other remark code

* Update theme again

* Fix language gen

* Add changeset

* Fix code

* Update test theme colors

* Update changeset

* Fix test again
2023-05-03 11:07:57 -04:00
Erika
694918a56b
Implement RFC "A core story for images" (#6344)
* feat(assets): Add Vite plugin

* feat(images): Set up Image component

* fix(types): Attempt to fix type generation

* Revert "fix(types): Attempt to fix type generation"

This reverts commit 063aa276e2.

* fix(image): Fix image types causing build to fail

* feat(image): Implement client side part

* feat(services): Allow arbitrary transforms parameters

* fix(image): Fix paths and types

* config(types): Update config types to provide completions for available services

* feat(image): Add serving in dev

* feat(image): Improve type error messages

* refactor(image): Move sharp's parseParams to baseService

* refactor(image): Skip work in dev for remote servies

* feat(image): Add support for remote images

* feat(image): Add squoosh service

* chore: update export map

* refactor(image): Abstract attributes handling by services

* config(vercel): Remove test image service

* feat(image): Support for relative images in Markdown (WIP)

* feat(images): Add support for relative images in Markdown

* feat(image): Update with RFC feedback

* fix(image): Fix alt error on getImage

* feat(image): Add support for assets validation through content collections

* feat(image): Remove validateTransform

* feat(image): Move to assets folder

* fix(image): Fix package exports

* feat(image): Add static imports references to virtual moduel

* fix(image): Fix images from content collections not working when embedded

* chore: lockfile

* fix(markdown): Fix type

* fix(images): Flag enhanced images behing an experimental flag

* config(example): Update images example conifg

* fix(image): Fix types

* fix(image): Fix asset type for strict, allow arbritary input and output formats

* chore: fix example check

* feat(image): Emit assets for ESM imported images

* Add initial core image tests (#6381)

* feat(images): Make frontmatter extraction more generic than images for future

* feat(image): Add support for building

* fix(image): Fix types

* fix(images): Fix compatibility with image integration

* feat(images): Cuter generation stats

* fix(images): Globals are unsafe, it turns out

* fix(images): Only generate images if flag is enabled

* fix(images): Only create `addStaticImage` in build

* feat(images): Add SSR endpoint

* fix(images): Only inject route in SSR

* Add tests for SSR

* Remove console.log

* Updated lockfile

* rename to satisfy the link gods

* skip build tests for now

* fix(images): Fix WASM files not being copied in dev

* feat(images): Add quality presets

* fix build tests running

* Remove console.log

* Add tests for getImage

* Test local services

* Test the content collections API

* Add tests for quality

* Skipping content collections test

* feat(image): Add support for `~/assets` alias

* test(image): Add tests for aliases in dev

* Fix windows + content collections

* test(image): Add tests for aliased images and images in Markdown

* Fix markdown images being built

* Should be posix join

* Use the optimized image

* fix test

* Fixes windows smoke

* fix(image): Nits

* feat(images): Add automatic update for `env.d.ts` when experimental images are enabled

* fix(images): Revert env.d.ts change if the user opted-out of the experimental image support

* chore: remove bad image example project

* feat(image): Rename `experimental.images` to `experimental.assets`

* fix(images): Remove unused code in MDX integration

* chore: Remove unrelated change

* fix(images): Remove export from astro/components

* Fix, esm import on Win

* test(images): Add test for format

* fix(images): Add `client-image.d.ts` to export map

* chore: changeset

* fix(images): Adjust with feedback, no more automatic refine, asset() -> image()

* fix(images): Fix types

* fix(images): Remove unnecessary spread

* fix(images): Better types for parseUrl and transform

* fix(images): Fix types

* fix(images): Adjust from feedback

* fix(images): Pass width and height through getHTMLAttributes even if they're not added by the uesr

* fix(images): Recusirsively extract frontmatter assets

* fix(images): Use a reduce instead

* feat(images): Add support for data: URIs

* chore: changeset

* docs(images): Misc docs fixes

* Update .changeset/gold-rocks-cry.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update .changeset/gold-rocks-cry.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/assets/services/service.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/assets/services/service.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/assets/services/service.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/assets/types.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/astro/src/assets/types.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-03-07 16:12:21 +01:00
Matthew Phillips
a9bdd9cc4e
Fixes usage of Code component in Vercel (#6198)
* Fixes usage of Code component in Vercel

* Adding a changeset
2023-02-09 14:22:57 -05:00
natemoo-re
98d35de877 [ci] format 2023-01-25 23:22:56 +00:00
wulinsheng123
aedf23f858
fix: component is not able to use a custom theme anymore (#5952)
* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-25 17:21:15 -06:00
Giuseppe La Torre
23dc9ea96a
Fix Code.astro shiki css class replace logic (#5829) 2023-01-11 21:54:09 +08:00
Anders Kaseorg
53e0c98dae
Fix spelling mistakes found by codespell and mwic (#5627) 2022-12-19 12:00:00 +01:00
matthewp
991d629832 [ci] format 2022-11-16 13:59:51 +00:00
Matthew Phillips
9f80a4046f
Allow Code component to run in Vercel (#5409)
* Allow Code component to run in Vercel

* Adding a changeset

* Pass theme through to `codeToHtml`

* Use script to generate languages

* another bundling approach

* fix lint warnings
2022-11-16 08:57:53 -05:00
Mohammad Hamzehei
8d2d0c3c03
fix a typo in Code component's wrap prop (#5050) 2022-10-11 15:47:16 +08:00
Juan Martín Seery
a2e8e76c30
chore: updated shiki (#4519)
* Upgraded shiki

* Use setColorReplacements

* no-shadow

* Changeset
2022-08-28 08:23:37 -03:00
FredKSchott
4de35f3b70 [ci] format 2022-08-06 04:39:26 +00:00
Matthew Phillips
bccd88f0eb
Move the Markdown component to its own package (#3986)
* Move the Markdown component to its own package

* Update the examples

* Updated lockfile

* Use is:raw

* Add a main field

* Update the formatting of the readme

* Rename to @astrojs/markdown-component
2022-07-20 16:45:05 -04:00
Matthew Phillips
5fde2fd8bc
Moves Debug component's styles to be inlined (#3963) 2022-07-18 16:42:57 -04:00
Erika
7c5c4106d7
Use a .ts file to export built-in components so they're typed (#3927)
* Use a .ts file to export built-in components so they automatically have types

* Add changeset
2022-07-14 14:33:10 -04:00
Fred K. Schott
224c181cbd
deprecate the markdown component in SSR (#3240) 2022-05-03 17:08:53 -07:00
tony-sull
dfa1042f2b [ci] format 2022-04-18 16:31:07 +00:00
Tony Sullivan
394ab90547
Perf: reuse Shiki highlighters per theme/lang (#3130)
* reuse Shiki highlighters per theme/lang

* chore: adding changeset
2022-04-18 16:30:19 +00:00