mirror of https://github.com/sveltejs/svelte
commit
1a87812b31
@ -1,2 +1,2 @@
|
|||||||
// This file is automatically generated
|
// This file is automatically generated
|
||||||
export default new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]);
|
export default new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","srcset_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]);
|
@ -0,0 +1,2 @@
|
|||||||
|
<p><p>invalid</p></p>
|
||||||
|
<p><p>invalid</p></p>
|
@ -0,0 +1,8 @@
|
|||||||
|
<p><!-- HTML_TAG_START --></p>
|
||||||
|
<p>invalid</p>
|
||||||
|
<!-- HTML_TAG_END -->
|
||||||
|
<p></p>
|
||||||
|
<p><!-- HTML_TAG_START --></p>
|
||||||
|
<p>invalid</p>
|
||||||
|
<!-- HTML_TAG_END -->
|
||||||
|
<p></p>
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let content;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{@html content}</p>
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
import Inner from './inner.svelte';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Inner content="<p>invalid</p>" />
|
||||||
|
|
||||||
|
<p>{@html '<p>invalid</p>'}</p>
|
After Width: | Height: | Size: 58 B |
After Width: | Height: | Size: 106 B |
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
snapshot(target) {
|
||||||
|
const svg = target.querySelector('svg');
|
||||||
|
|
||||||
|
return {
|
||||||
|
svg,
|
||||||
|
circle: svg.querySelector('circle')
|
||||||
|
};
|
||||||
|
},
|
||||||
|
test(assert, _, snapshot) {
|
||||||
|
assert.instanceOf(snapshot.svg, SVGElement);
|
||||||
|
assert.instanceOf(snapshot.circle, SVGElement);
|
||||||
|
}
|
||||||
|
};
|
After Width: | Height: | Size: 64 B |
@ -1,2 +1,4 @@
|
|||||||
|
<!-- HTML_TAG_START -->
|
||||||
<p>this is some html</p>
|
<p>this is some html</p>
|
||||||
<p>and so is this</p>
|
<p>and so is this</p>
|
||||||
|
<!-- HTML_TAG_END -->
|
||||||
|
@ -1 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let raw;
|
||||||
|
</script>
|
||||||
|
|
||||||
{@html raw}
|
{@html raw}
|
@ -0,0 +1,10 @@
|
|||||||
|
export default {
|
||||||
|
html: '',
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
component.show = true;
|
||||||
|
assert.equal(target.innerHTML, '<svg><circle cx="200" cy="500" r="200"></circle></svg>');
|
||||||
|
assert.instanceOf(target.querySelector('svg'), SVGElement);
|
||||||
|
assert.instanceOf(target.querySelector('circle'), SVGElement);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
export let show = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if show}
|
||||||
|
<svg>{@html '<circle cx="200" cy="500" r="200"></circle>'}</svg>
|
||||||
|
{/if}
|
@ -1,16 +1,16 @@
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { get_examples_data } from '../src/lib/server/examples/index.js';
|
import { get_examples_data } from '../src/lib/server/examples/index.js';
|
||||||
import fs from 'node:fs';
|
import { mkdir, writeFile } from 'node:fs/promises';
|
||||||
|
|
||||||
const examples_data = get_examples_data(
|
const examples_data = await get_examples_data(
|
||||||
fileURLToPath(new URL('../../../documentation/examples', import.meta.url))
|
fileURLToPath(new URL('../../../documentation/examples', import.meta.url))
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(new URL('../src/lib/generated/', import.meta.url), { recursive: true });
|
await mkdir(new URL('../src/lib/generated/', import.meta.url), { recursive: true });
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
fs.writeFileSync(
|
writeFile(
|
||||||
new URL('../src/lib/generated/examples-data.js', import.meta.url),
|
new URL('../src/lib/generated/examples-data.js', import.meta.url),
|
||||||
`export default ${JSON.stringify(examples_data)}`
|
`export default ${JSON.stringify(examples_data)}`
|
||||||
);
|
);
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import { readFileSync } from 'fs';
|
|
||||||
import { join } from 'path';
|
|
||||||
import { env } from '$env/dynamic/private';
|
import { env } from '$env/dynamic/private';
|
||||||
|
|
||||||
const local_svelte_path = env.LOCAL_SVELTE_PATH || '../../../svelte';
|
const local_svelte_path = env.LOCAL_SVELTE_PATH || '../../../svelte';
|
||||||
|
|
||||||
export function GET({ params: { path } }) {
|
export async function GET({ params: { path } }) {
|
||||||
if (import.meta.env.PROD || ('/' + path).includes('/.')) {
|
if (import.meta.env.PROD || ('/' + path).includes('/.')) {
|
||||||
return new Response(undefined, { status: 403 });
|
return new Response(undefined, { status: 403 });
|
||||||
}
|
}
|
||||||
return new Response(readFileSync(join(local_svelte_path, path)), {
|
|
||||||
|
const { readFile } = await import('node:fs/promises');
|
||||||
|
|
||||||
|
return new Response(await readFile(`${local_svelte_path}/${path}`), {
|
||||||
headers: { 'Content-Type': 'text/javascript' }
|
headers: { 'Content-Type': 'text/javascript' }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
After Width: | Height: | Size: 106 KiB |
@ -1,9 +1,15 @@
|
|||||||
import { get_docs_data, get_docs_list } from '$lib/server/docs/index.js';
|
|
||||||
|
|
||||||
export const prerender = true;
|
export const prerender = true;
|
||||||
|
|
||||||
export function load({ url }) {
|
export async function load({ url }) {
|
||||||
|
if (url.pathname === '/docs') {
|
||||||
|
return {
|
||||||
|
sections: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const { get_docs_data, get_docs_list } = await import('$lib/server/docs/index.js');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sections: url.pathname === '/docs' ? [] : get_docs_list(get_docs_data())
|
sections: get_docs_list(await get_docs_data())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
// This page now exists solely for redirect, prerendering triggers the `handleMissingID`
|
|
||||||
export const prerender = false;
|
|
@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
Loading…
Reference in new issue