├── src ├── pages │ ├── Theme.svelte │ ├── Explore.svelte │ ├── Profile.svelte │ ├── Projects.svelte │ ├── Settings.svelte │ └── Playground.svelte ├── stores.js ├── utils │ ├── compat.js │ ├── db.js │ ├── events.js │ ├── examples.js │ └── slug.js ├── main.js ├── views │ ├── Footer.svelte │ ├── Sidebar.svelte │ └── Navbar.svelte ├── index.js ├── components │ ├── JsonEditor.svelte │ ├── Login.svelte │ ├── Tabs.svelte │ ├── MonacoEditor.svelte │ └── ComponentPreview.svelte └── monaco-themes.js ├── public ├── examples │ ├── 99-embeds │ │ ├── meta.json │ │ ├── 20181225-blog-svelte-css-in-js │ │ │ ├── meta.json │ │ │ ├── Hero.svelte │ │ │ ├── App.svelte │ │ │ └── styles.js │ │ └── 20190420-blog-write-less-code │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 02-props │ │ ├── meta.json │ │ ├── 02-spread-props │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── Info.svelte │ │ ├── 00-declaring-props │ │ │ ├── meta.json │ │ │ ├── Nested.svelte │ │ │ └── App.svelte │ │ └── 01-default-values │ │ │ ├── meta.json │ │ │ ├── Nested.svelte │ │ │ └── App.svelte │ ├── 03-logic │ │ ├── meta.json │ │ ├── 00-if-blocks │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-else-blocks │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 03-each-blocks │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 05-await-blocks │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-else-if-blocks │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 04-keyed-each-blocks │ │ │ ├── meta.json │ │ │ ├── Thing.svelte │ │ │ └── App.svelte │ ├── 11-svg │ │ ├── meta.json │ │ ├── 01-clock │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-bar-chart │ │ │ └── meta.json │ │ ├── 03-area-chart │ │ │ ├── meta.json │ │ │ └── data.js │ │ ├── 04-scatterplot │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ ├── data.js │ │ │ └── Scatterplot.svelte │ │ └── 05-svg-transitions │ │ │ ├── meta.json │ │ │ ├── custom-transitions.js │ │ │ ├── shape.js │ │ │ └── App.svelte │ ├── 19-7guis │ │ ├── meta.json │ │ ├── 04-7guis-timer │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 05-7guis-crud │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-7guis-counter │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 06-7guis-circles │ │ │ └── meta.json │ │ ├── 03-7guis-flight-booker │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 02-7guis-temperature │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 04-events │ │ ├── meta.json │ │ ├── 00-dom-events │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-inline-handlers │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-event-modifiers │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 03-component-events │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── Inner.svelte │ │ ├── 04-event-forwarding │ │ │ ├── meta.json │ │ │ ├── Outer.svelte │ │ │ ├── App.svelte │ │ │ └── Inner.svelte │ │ └── 05-dom-event-forwarding │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── FancyButton.svelte │ ├── 07-stores │ │ ├── meta.json │ │ ├── 00-writable-stores │ │ │ ├── meta.json │ │ │ ├── stores.js │ │ │ ├── Resetter.svelte │ │ │ ├── Decrementer.svelte │ │ │ ├── Incrementer.svelte │ │ │ └── App.svelte │ │ ├── 02-readable-stores │ │ │ ├── meta.json │ │ │ ├── stores.js │ │ │ └── App.svelte │ │ ├── 03-derived-stores │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── stores.js │ │ ├── 04-custom-stores │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── stores.js │ │ └── 01-auto-subscriptions │ │ │ ├── meta.json │ │ │ ├── stores.js │ │ │ ├── Resetter.svelte │ │ │ ├── Decrementer.svelte │ │ │ ├── Incrementer.svelte │ │ │ └── App.svelte │ ├── 08-motion │ │ ├── meta.json │ │ ├── 00-tweened │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 01-spring │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 12-actions │ │ ├── meta.json │ │ ├── 00-actions │ │ │ ├── meta.json │ │ │ ├── pannable.js │ │ │ └── App.svelte │ │ └── 01-adding-parameters-to-actions │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 13-classes │ │ ├── meta.json │ │ ├── 00-classes │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 01-class-shorthand │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 01-reactivity │ │ ├── meta.json │ │ ├── 00-reactive-assignments │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-reactive-statements │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 01-reactive-declarations │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 05-bindings │ │ ├── meta.json │ │ ├── 00-text-inputs │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 09-dimensions │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-numeric-inputs │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 03-group-inputs │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 08-media-elements │ │ │ └── meta.json │ │ ├── 10-bind-this │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-checkbox-inputs │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 04-textarea-inputs │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 05-select-bindings │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 07-each-block-bindings │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 11-component-bindings │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── Keypad.svelte │ │ └── 06-multiple-select-bindings │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 06-lifecycle │ │ ├── meta.json │ │ ├── 03-tick │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 00-onmount │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-ondestroy │ │ │ ├── meta.json │ │ │ ├── utils.js │ │ │ └── App.svelte │ │ └── 02-update │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 10-animations │ │ ├── meta.json │ │ └── 00-animate │ │ │ └── meta.json │ ├── 15-context │ │ ├── meta.json │ │ └── 00-context-api │ │ │ ├── meta.json │ │ │ ├── mapbox.js │ │ │ ├── MapMarker.svelte │ │ │ ├── App.svelte │ │ │ └── Map.svelte │ ├── 18-debugging │ │ ├── meta.json │ │ └── 00-debug │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 00-introduction │ │ ├── meta.json │ │ ├── 02-styling │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 04-html-tags │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 00-hello-world │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 03-nested-components │ │ │ ├── Nested.svelte │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 01-dynamic-attributes │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 09-transitions │ │ ├── meta.json │ │ ├── 02-in-and-out │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 00-transition │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 05-transition-events │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 06-deferred-transitions │ │ │ ├── meta.json │ │ │ └── crossfade.js │ │ ├── 03-custom-css-transitions │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 04-custom-js-transitions │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ └── 01-adding-parameters-to-transitions │ │ │ ├── meta.json │ │ │ └── App.svelte │ ├── 14-composition │ │ ├── 00-slots │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── Box.svelte │ │ ├── 04-modal │ │ │ ├── meta.json │ │ │ ├── Modal.svelte │ │ │ └── App.svelte │ │ ├── 03-slot-props │ │ │ ├── meta.json │ │ │ ├── Hoverable.svelte │ │ │ └── App.svelte │ │ ├── meta.json │ │ ├── 02-named-slots │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── ContactCard.svelte │ │ └── 01-slot-fallbacks │ │ │ ├── meta.json │ │ │ ├── App.svelte │ │ │ └── Box.svelte │ ├── 17-module-context │ │ ├── meta.json │ │ └── 01-module-exports │ │ │ ├── meta.json │ │ │ ├── AudioPlayer.svelte │ │ │ └── App.svelte │ ├── 20-miscellaneous │ │ ├── meta.json │ │ ├── 01-hacker-news │ │ │ ├── meta.json │ │ │ ├── Comment.svelte │ │ │ ├── Item.svelte │ │ │ ├── Summary.svelte │ │ │ ├── List.svelte │ │ │ └── App.svelte │ │ └── 02-immutable-data │ │ │ ├── meta.json │ │ │ ├── flash.js │ │ │ ├── MutableTodo.svelte │ │ │ ├── ImmutableTodo.svelte │ │ │ └── App.svelte │ ├── 16-special-elements │ │ ├── meta.json │ │ ├── 00-svelte-self │ │ │ ├── meta.json │ │ │ ├── File.svelte │ │ │ ├── App.svelte │ │ │ └── Folder.svelte │ │ ├── 04-svelte-body │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 05-svelte-head │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 02-svelte-window │ │ │ ├── meta.json │ │ │ └── App.svelte │ │ ├── 01-svelte-component │ │ │ ├── meta.json │ │ │ ├── BlueThing.svelte │ │ │ ├── RedThing.svelte │ │ │ ├── GreenThing.svelte │ │ │ └── App.svelte │ │ └── 03-svelte-window-bindings │ │ │ ├── meta.json │ │ │ └── App.svelte │ └── await-blocks.json ├── logo.png ├── favicon.ico ├── logo-192.png ├── logo-512.png ├── apple-icon.png ├── logo-black.png ├── logo-white.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon-96x96.png ├── logo-left-font.png ├── logo-with-text.png ├── config.js ├── apple-icon-precomposed.png ├── fonts │ ├── roboto │ │ ├── roboto-latin-400.woff2 │ │ ├── roboto-latin-500.woff2 │ │ ├── roboto-latin-400italic.woff2 │ │ └── roboto-latin-500italic.woff2 │ ├── fira-mono │ │ └── fira-mono-latin-400.woff2 │ └── overpass │ │ ├── overpass-latin-100.woff2 │ │ ├── overpass-latin-300.woff2 │ │ ├── overpass-latin-400.woff2 │ │ ├── overpass-latin-600.woff2 │ │ └── overpass-latin-700.woff2 ├── icons │ ├── download.svg │ ├── dropdown.svg │ ├── chevron.svg │ ├── check.svg │ ├── arrow-right.svg │ ├── link.svg │ ├── save.svg │ ├── edit.svg │ ├── fork.svg │ ├── collapse.svg │ ├── expand.svg │ ├── flip.svg │ └── loading.svg ├── monaco-editor-worker-loader-proxy.js ├── browserconfig.xml ├── workers │ └── compiler.js ├── Component.svelte ├── 6.6.js ├── manifest.json ├── 19.19.js ├── index.html ├── 11.11.js ├── 54.54.js ├── themes │ ├── SpaceCadet.json │ ├── IDLE.json │ ├── themelist.json │ ├── Slush and Poppies.json │ ├── All Hallows Eve.json │ ├── Xcode_default.json │ ├── Zenburnesque.json │ └── Chrome DevTools.json ├── 44.44.js ├── 43.43.js ├── 13.13.js ├── 7.7.js ├── 23.23.js ├── 16.16.js ├── rollup.config.js ├── 27.27.js ├── global.css ├── 15.15.js ├── 37.37.js └── 46.46.js ├── .firebaserc ├── .gitignore ├── functions ├── .gitignore ├── types │ └── svelte.d.ts ├── tsconfig.json ├── Component.svelte ├── package.json └── src │ └── index.ts ├── firestore.rules ├── storage.rules ├── firestore.indexes.json ├── README.md ├── firebase.json ├── package.json └── webpack.config.js /src/pages/Theme.svelte: -------------------------------------------------------------------------------- 1 |
...don't affect this element
-------------------------------------------------------------------------------- /public/examples/00-introduction/03-nested-components/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Nested components" 3 | } -------------------------------------------------------------------------------- /public/examples/04-events/05-dom-event-forwarding/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "DOM event forwarding" 3 | } -------------------------------------------------------------------------------- /public/examples/05-bindings/07-each-block-bindings/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Each block bindings" 3 | } -------------------------------------------------------------------------------- /public/examples/05-bindings/11-component-bindings/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Component bindings" 3 | } -------------------------------------------------------------------------------- /public/examples/06-lifecycle/02-update/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "beforeUpdate and afterUpdate" 3 | } -------------------------------------------------------------------------------- /public/examples/07-stores/01-auto-subscriptions/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Auto-subscriptions" 3 | } -------------------------------------------------------------------------------- /public/examples/09-transitions/00-transition/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "The transition directive" 3 | } -------------------------------------------------------------------------------- /public/examples/09-transitions/05-transition-events/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Transition events" 3 | } -------------------------------------------------------------------------------- /public/examples/15-context/00-context-api/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "setContext and getContext" 3 | } -------------------------------------------------------------------------------- /public/examples/16-special-elements/02-svelte-window/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "The answer is {answer}
-------------------------------------------------------------------------------- /public/examples/07-stores/01-auto-subscriptions/stores.js: -------------------------------------------------------------------------------- 1 | import { writable } from 'svelte/store'; 2 | 3 | export const count = writable(0); -------------------------------------------------------------------------------- /public/examples/02-props/00-declaring-props/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |The answer is {answer}
-------------------------------------------------------------------------------- /public/examples/16-special-elements/01-svelte-component/BlueThing.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | blue thing -------------------------------------------------------------------------------- /public/examples/16-special-elements/01-svelte-component/RedThing.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | red thing -------------------------------------------------------------------------------- /public/fonts/roboto/roboto-latin-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/roboto/roboto-latin-400.woff2 -------------------------------------------------------------------------------- /public/fonts/roboto/roboto-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/roboto/roboto-latin-500.woff2 -------------------------------------------------------------------------------- /public/examples/02-props/01-default-values/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |{@html string}
-------------------------------------------------------------------------------- /public/fonts/fira-mono/fira-mono-latin-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/fira-mono/fira-mono-latin-400.woff2 -------------------------------------------------------------------------------- /public/fonts/overpass/overpass-latin-100.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/overpass/overpass-latin-100.woff2 -------------------------------------------------------------------------------- /public/fonts/overpass/overpass-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/overpass/overpass-latin-300.woff2 -------------------------------------------------------------------------------- /public/fonts/overpass/overpass-latin-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/overpass/overpass-latin-400.woff2 -------------------------------------------------------------------------------- /public/fonts/overpass/overpass-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/overpass/overpass-latin-600.woff2 -------------------------------------------------------------------------------- /public/fonts/overpass/overpass-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/overpass/overpass-latin-700.woff2 -------------------------------------------------------------------------------- /public/fonts/roboto/roboto-latin-400italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/roboto/roboto-latin-400italic.woff2 -------------------------------------------------------------------------------- /public/fonts/roboto/roboto-latin-500italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjgartendev/svelte-monaco-playground/HEAD/public/fonts/roboto/roboto-latin-500italic.woff2 -------------------------------------------------------------------------------- /firestore.rules: -------------------------------------------------------------------------------- 1 | service cloud.firestore { 2 | match /databases/{database}/documents { 3 | match /{document=**} { 4 | allow read, write; 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /storage.rules: -------------------------------------------------------------------------------- 1 | service firebase.storage { 2 | match /b/{bucket}/o { 3 | match /{allPaths=**} { 4 | allow read, write: if request.auth!=null; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /public/examples/16-special-elements/05-svelte-head/App.svelte: -------------------------------------------------------------------------------- 1 |Styled!
-------------------------------------------------------------------------------- /public/examples/05-bindings/00-text-inputs/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |Hello {name || 'stranger'}!
-------------------------------------------------------------------------------- /public/examples/14-composition/00-slots/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |This is a box. It can contain anything.
8 |This is a box. It can contain anything.
8 |{a} + {b} = {a + b}
-------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | const app = new App({ 3 | target: document.body, 4 | hydrateable: true, 5 | props: { 6 | previewType: "live" 7 | } 8 | }); 9 | 10 | window.app = app; 11 | 12 | export default app; -------------------------------------------------------------------------------- /public/examples/04-events/03-component-events/App.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 |{x} is greater than 10
7 | {:else if 5 > x} 8 |{x} is less than 5
9 | {:else} 10 |{x} is between 5 and 10
11 | {/if} -------------------------------------------------------------------------------- /public/examples/07-stores/00-writable-stores/Decrementer.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /public/examples/07-stores/00-writable-stores/Incrementer.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /public/examples/07-stores/01-auto-subscriptions/Decrementer.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /public/examples/07-stores/01-auto-subscriptions/Incrementer.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /public/examples/02-props/02-spread-props/App.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |{valueAtStart} / {value}
-------------------------------------------------------------------------------- /public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 |These styles...
14 |9 | The page has been open for 10 | {seconds} {seconds === 1 ? 'second' : 'seconds'} 11 |
-------------------------------------------------------------------------------- /public/examples/07-stores/04-custom-stores/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |13 | Fades in and out 14 |
15 | {/if} -------------------------------------------------------------------------------- /public/examples/13-classes/01-class-shorthand/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 15 | 16 |13 | Flies in, fades out 14 |
15 | {/if} -------------------------------------------------------------------------------- /public/icons/fork.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/examples/02-props/02-spread-props/Info.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | The {name} package is {speed} fast.
10 | Download version {version} from npm
11 | and learn more here
12 |
13 | Flies in and out 14 |
15 | {/if} -------------------------------------------------------------------------------- /functions/types/svelte.d.ts: -------------------------------------------------------------------------------- 1 | export function afterUpdate(fn: any): void; 2 | export function beforeUpdate(fn: any): void; 3 | export function createEventDispatcher(): any; 4 | export function getContext(key: any): any; 5 | export function onDestroy(fn: any): void; 6 | export function onMount(fn: any): void; 7 | export function setContext(key: any, context: any): void; 8 | export function tick(): any; 9 | -------------------------------------------------------------------------------- /public/examples/16-special-elements/00-svelte-self/File.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 14 | {name} -------------------------------------------------------------------------------- /src/views/Footer.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /public/examples/05-bindings/01-numeric-inputs/App.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 15 | 16 |{a} + {b} = {a + b}
-------------------------------------------------------------------------------- /public/examples/05-bindings/11-component-bindings/App.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |{count} * 2 = {doubled}
18 |{doubled} * 2 = {quadrupled}
-------------------------------------------------------------------------------- /public/examples/07-stores/03-derived-stores/App.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |15 | This page has been open for 16 | {$elapsed} {$elapsed === 1 ? 'second' : 'seconds'} 17 |
-------------------------------------------------------------------------------- /src/utils/events.js: -------------------------------------------------------------------------------- 1 | export function keyEvent(code) { 2 | return function (node, callback) { 3 | node.addEventListener('keydown', handleKeydown); 4 | 5 | function handleKeydown(event) { 6 | if (event.keyCode === code) { 7 | callback.call(this, event); 8 | } 9 | } 10 | 11 | return { 12 | destroy() { 13 | node.removeEventListener('keydown', handleKeydown); 14 | } 15 | }; 16 | }; 17 | } 18 | 19 | export const enter = keyEvent(13); 20 | -------------------------------------------------------------------------------- /public/examples/20-miscellaneous/02-immutable-data/flash.js: -------------------------------------------------------------------------------- 1 | export default function flash(element) { 2 | requestAnimationFrame(() => { 3 | element.style.transition = 'none'; 4 | element.style.color = 'rgba(255,62,0,1)'; 5 | element.style.backgroundColor = 'rgba(255,62,0,0.2)'; 6 | 7 | setTimeout(() => { 8 | element.style.transition = 'color 1s, background 1s'; 9 | element.style.color = ''; 10 | element.style.backgroundColor = ''; 11 | }); 12 | }); 13 | } -------------------------------------------------------------------------------- /public/examples/05-bindings/09-dimensions/App.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 14 | 15 | 16 |size: {w}px x {h}px
17 | 18 |Thank you. We will bombard your inbox and sell your personal details.
12 | {:else} 13 |You must opt in to continue. If you're not paying, you're the product.
14 | {/if} 15 | 16 | -------------------------------------------------------------------------------- /public/examples/03-logic/03-each-blocks/App.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 |status: {status}
9 | 10 | 14 | 15 | {#if visible} 16 |23 | Flies in and out 24 |
25 | {/if} -------------------------------------------------------------------------------- /public/examples/99-embeds/20181225-blog-svelte-css-in-js/App.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |Did you enjoy your lunch, mom? You drank it fast enough. I know, I just call her Annabelle cause she's shaped like a…she's the belle of the ball! YOU'RE the Chiclet! Not me. Caw ca caw, caw ca caw, caw ca caw! A Colombian cartel that WON'T kidnap and kill you. You go buy a tape recorder and record yourself for a whole day. I think you'll be surprised at some of your phrasing.
10 |...waiting
26 | {:then number} 27 |The number is {number}
28 | {:catch error} 29 |{error.message}
30 | {/await} -------------------------------------------------------------------------------- /functions/Component.svelte: -------------------------------------------------------------------------------- 1 |loading...
37 | {/each} 38 |34 | The quick brown fox jumps over the lazy dog 35 |
36 | {/if} -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /public/examples/16-special-elements/04-svelte-body/App.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 26 | 27 |
--------------------------------------------------------------------------------
/public/examples/19-7guis/04-7guis-timer/App.svelte:
--------------------------------------------------------------------------------
1 |
2 |
3 |
28 |
29 |
33 |
34 | I am being hovered upon.
22 | {:else} 23 |Hover over me!
24 | {/if} 25 |I am being hovered upon.
32 | {:else} 33 |Hover over me!
34 | {/if} 35 |I am being hovered upon.
42 | {:else} 43 |Hover over me!
44 | {/if} 45 |loading...
46 | {/if} -------------------------------------------------------------------------------- /public/examples/20-miscellaneous/02-immutable-data/App.svelte: -------------------------------------------------------------------------------- 1 |{keyCode}
39 | {:else} 40 |Focus this window and press any key
41 | {/if} 42 |{remaining} remaining
42 | 43 | 46 | 47 | 50 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-monaco-playground", 3 | "homepage": "https://mjgartendev.github.io/svelte-monaco-playground/", 4 | "dependencies": { 5 | "firebase": "^6.1.0", 6 | "jsoneditor": "^5.33.0", 7 | "monaco-themes": "^0.3.3", 8 | "rxfire": "^3.5.0", 9 | "rxjs": "^6.5.2", 10 | "yootils": "0.0.16" 11 | }, 12 | "devDependencies": { 13 | "@sveltejs/svelte-repl": "^0.1.8", 14 | "cross-env": "^5.2.0", 15 | "css-loader": "^2.1.1", 16 | "mini-css-extract-plugin": "^0.6.0", 17 | "serve": "^11.0.0", 18 | "style-loader": "^0.23.1", 19 | "svelte": "^3.4.4", 20 | "svelte-loader": "2.13.3", 21 | "webpack": "^4.30.0", 22 | "webpack-cli": "^3.3.0", 23 | "webpack-dev-server": "^3.3.1", 24 | "monaco-editor": "^0.17.0", 25 | "monaco-editor-webpack-plugin": "1.7.0" 26 | }, 27 | "scripts": { 28 | "build": "cross-env NODE_ENV=production webpack", 29 | "dev": "webpack-dev-server --content-base public", 30 | "predeploy": "npm run build" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/views/Sidebar.svelte: -------------------------------------------------------------------------------- 1 | 11 | 38 | 39 | 43 | -------------------------------------------------------------------------------- /public/examples/14-composition/04-modal/App.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | {#if showModal} 12 |selected question {selected ? selected.id : '[waiting...]'}
-------------------------------------------------------------------------------- /src/components/Login.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | {#if user} 16 |{composer} / performed by {performer}
44 | 45 | 52 |Please select at least one flavour
45 | {:else if flavours.length > scoops} 46 |Can't order more flavours than scoops!
47 | {:else} 48 |49 | You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'} 50 | of {join(flavours)} 51 |
52 | {/if} 53 | -------------------------------------------------------------------------------- /public/examples/11-svg/04-scatterplot/data.js: -------------------------------------------------------------------------------- 1 | export default { 2 | a: [ 3 | { x: 10, y: 8.04 }, 4 | { x: 8, y: 6.95 }, 5 | { x: 13, y: 7.58 }, 6 | { x: 9, y: 8.81 }, 7 | { x: 11, y: 8.33 }, 8 | { x: 14, y: 9.96 }, 9 | { x: 6, y: 7.24 }, 10 | { x: 4, y: 4.26 }, 11 | { x: 12, y: 10.84 }, 12 | { x: 7, y: 4.82 }, 13 | { x: 5, y: 5.68 } 14 | ], 15 | b: [ 16 | { x: 10, y: 9.14 }, 17 | { x: 8, y: 8.14 }, 18 | { x: 13, y: 8.74 }, 19 | { x: 9, y: 8.77 }, 20 | { x: 11, y: 9.26 }, 21 | { x: 14, y: 8.1 }, 22 | { x: 6, y: 6.13 }, 23 | { x: 4, y: 3.1 }, 24 | { x: 12, y: 9.13 }, 25 | { x: 7, y: 7.26 }, 26 | { x: 5, y: 4.74 } 27 | ], 28 | c: [ 29 | { x: 10, y: 7.46 }, 30 | { x: 8, y: 6.77 }, 31 | { x: 13, y: 12.74 }, 32 | { x: 9, y: 7.11 }, 33 | { x: 11, y: 7.81 }, 34 | { x: 14, y: 8.84 }, 35 | { x: 6, y: 6.08 }, 36 | { x: 4, y: 5.39 }, 37 | { x: 12, y: 8.15 }, 38 | { x: 7, y: 6.42 }, 39 | { x: 5, y: 5.73 } 40 | ], 41 | d: [ 42 | { x: 8, y: 6.58 }, 43 | { x: 8, y: 5.76 }, 44 | { x: 8, y: 7.71 }, 45 | { x: 8, y: 8.84 }, 46 | { x: 8, y: 8.47 }, 47 | { x: 8, y: 7.04 }, 48 | { x: 8, y: 5.25 }, 49 | { x: 19, y: 12.5 }, 50 | { x: 8, y: 5.56 }, 51 | { x: 8, y: 7.91 }, 52 | { x: 8, y: 6.89 } 53 | ] 54 | }; -------------------------------------------------------------------------------- /public/examples/12-actions/00-actions/App.svelte: -------------------------------------------------------------------------------- 1 | 27 | 28 | 42 | 43 | -------------------------------------------------------------------------------- /public/examples/05-bindings/06-multiple-select-bindings/App.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 |Please select at least one flavour
46 | {:else if flavours.length > scoops} 47 |Can't order more flavours than scoops!
48 | {:else} 49 |50 | You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'} 51 | of {join(flavours)} 52 |
53 | {/if} 54 | -------------------------------------------------------------------------------- /public/examples/20-miscellaneous/01-hacker-news/App.svelte: -------------------------------------------------------------------------------- 1 | 28 | 29 | 48 | 49 |No CSS output
46 | {/if} 47 | {/if} 48 | {#if type == "js"} 49 | {#if result.js.code} 50 |{result.js.code}
51 | {:else}
52 | No JS output
53 | {/if} 54 | {/if} 55 | {#if type == "original"} 56 |{source}
57 | {/if}
58 | {#if type == "stats"}
59 | {#if result.stats}
60 | No Stats output
63 | {/if} 64 | {/if} 65 | {#if type == "warnings"} 66 | {#if result.warnings} 67 |No Warnings output
70 | {/if} 71 | {/if} 72 | {#if type == "vars"} 73 | {#if result.vars} 74 |No Variables output
77 | {/if} 78 | {/if} 79 | 80 | 94 | -------------------------------------------------------------------------------- /public/examples/19-7guis/05-7guis-crud/App.svelte: -------------------------------------------------------------------------------- 1 | 2 | 3 | 59 | 60 | 81 | 82 | 83 | 84 | 89 | 90 | 91 | 92 | 93 | 98 | -------------------------------------------------------------------------------- /public/global.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | --blue: #007bff; 3 | --indigo: #6610f2; 4 | --purple: #6f42c1; 5 | --pink: #e83e8c; 6 | --red: #dc3545; 7 | --orange: #fd7e14; 8 | --yellow: #ffc107; 9 | --green: #28a745; 10 | --teal: #20c997; 11 | --cyan: #17a2b8; 12 | --white: #fff; 13 | --gray: #6c757d; 14 | --gray-dark: #343a40; 15 | --primary: #007bff; 16 | --secondary: #6c757d; 17 | --success: #28a745; 18 | --info: #17a2b8; 19 | --warning: #ffc107; 20 | --danger: #dc3545; 21 | --light: #f8f9fa; 22 | --dark: #343a40; 23 | --breakpoint-xs: 0; 24 | --breakpoint-sm: 576px; 25 | --breakpoint-md: 768px; 26 | --breakpoint-lg: 992px; 27 | --breakpoint-xl: 1200px; 28 | --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 29 | --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 30 | --primary: #29c785; 31 | --secondary: #444857; 32 | --surface: #1B2B34; 33 | --lighter: #f0f0f0; 34 | --darker: #333; 35 | --radius: 4px; 36 | --shadow-sm: 0px 1px 3px 0px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 2px 1px -1px rgba(0,0,0,0.12); 37 | --shadow-md: 0px 1px 5px 0px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 3px 1px -2px rgba(0,0,0,0.12); 38 | --shadow-lg: 0px 1px 8px 0px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 3px 3px -2px rgba(0,0,0,0.12); 39 | } 40 | html, 41 | body { 42 | width: 100%; 43 | height: 100%; 44 | } 45 | 46 | body { 47 | margin: 0; 48 | box-sizing: border-box; 49 | font-family: var(--font-family-sans-serif); 50 | overflow-y: hidden; 51 | } 52 | 53 | a { 54 | color:var(--primary); 55 | text-decoration: none; 56 | } 57 | 58 | label { 59 | display: block; 60 | } 61 | 62 | input:disabled { 63 | color: #ccc; 64 | } 65 | 66 | input[type="range"] { 67 | height: 0; 68 | } 69 | 70 | button, select { 71 | padding: 0.5em; 72 | border: 1px solid var(--secondary); 73 | font-weight: bold; 74 | border-radius: var(--radius); 75 | background: var(--secondary); 76 | color: var(--light); 77 | fill: var(--light); 78 | } 79 | button:hover { 80 | fill: var(--primary); 81 | color: var(--primary); 82 | cursor: pointer; 83 | } 84 | pre{ 85 | font-family: var(--font-family-monospace); 86 | background: var(--dark); 87 | color: var(--light); 88 | } -------------------------------------------------------------------------------- /public/examples/06-lifecycle/02-update/App.svelte: -------------------------------------------------------------------------------- 1 | 53 | 54 | 93 | 94 |