Releases: google/playground-elements
v0.4.2
Added
-
Import maps are now supported. This allows customizing the URL that a bare
module specifier resolves to, e.g. to a specific version, or to a different
CDN.Note that import maps currently only apply to the immediate imports of
project source files, not to external transitive dependencies.Also note
scopes
are not yet supported, onlyimports
.See https://github.com/WICG/import-maps and
https://wicg.github.io/import-maps/ for more information on import maps.Previously, all bare modules resolved to unpkg.com URLs at the latest version.
This continues to be the fallback behavior if no import map is provided, or no
entry in it matches.To specify an import map in a JSON project manifest, add an
importMap
property:{ "files": { "index.html": {}, "my-element.ts": {} }, "importMap": { "imports": { "lit-html": "https://unpkg.com/lit-html@next-major", "lit-html/": "https://unpkg.com/lit-html@next-major/" } } }
To specify an import map inline, add a
<script type="sample/importmap">
slotted child:<playground-ide> <script type="sample/importmap"> { "imports": { "lit-html": "https://unpkg.com/lit-html@next-major", "lit-html/": "https://unpkg.com/lit-html@next-major/" } } </script> ... </playground-ide>
Fixed
- Bare module imports in
.js
files are now resolved in the same way as.ts
files.
v0.4.1
v0.4.0
Added
-
Added
editableFileSystem
property (editable-file-system
attribute) to
<playground-ide>
. Whentrue
, the user will be able to create, delete, and
rename files in the virtual filesystem.- To create a new file: click the "+" icon button in the tab bar.
- To rename a file: click the three-dots menu button on its tab, and select
"Rename". - To delete a file: click the three-dots menu button on its tab, and select
"Delete".
-
Added
<playground-file-system-controls>
element which displays popup
menus/dialogs for creating, deleting, and renaming files.
Changed
-
[BREAKING] The tab bar has been factored into a new standalone element
called<playground-tab-bar>
. The<playground-file-editor>
element no
longer integrates the tab bar, and thenoFilePicker
property has been
removed. -
[BREAKING] The following CSS custom properties have been renamed:
--playground-file-picker-background
->--playground-tab-bar-background
--playground-file-picker-foreground
->--playground-tab-bar-foreground
-
[BREAKING] The following CSS shadow parts have been renamed:
file-picker
->tab-bar
v0.3.7
Added
-
Added
files
property to<playground-ide>
and<playground-project>
. Use
this property to directly get and set the array of project files (e.g. to
save/restore the project state).Note that directly setting
files
always takes precedence over setting
projectSrc
, and both take precedence over slotted children.
Changed
- It is no longer necessary to load the Material Icons font. The reload button
icon is now inlined SVG.
Fixed
- Fix caret placement issues with some dynamic layouts.
v0.3.6
v0.3.5
v0.3.4
Changed
- The playground service worker now serves its own 404s when a file is not
found, instead of forwarding the request to the server.
Fixed
- Fix race condition where preview could load too early and 404.
- Fix race condition where preview could sometimes never load.
- Fix preview 404 that could occur after leaving page idle for some time.