Skip to content

Commit

Permalink
update compiled Example.stories.dev.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Aug 12, 2024
1 parent 57c3b68 commit da5bb5c
Showing 1 changed file with 57 additions and 74 deletions.
131 changes: 57 additions & 74 deletions tests/__compiled__/pre-transform/Example.stories.dev.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import 'svelte/internal/disclose-version';
import "svelte/internal/disclose-version";

$.mark_module_start();
Example_stories.filename = 'stories/Example.stories.svelte';

import * as $ from 'svelte/internal/client';

var Example_default = $.add_locations(
$.template(`<p> </p> <p> </p> <br>`, 1),
Example_stories.filename,
[
[45, 4],
[46, 4],
[47, 24],
]
);
var Example_default_1 = $.add_locations($.template(`Label`, 1), Example_stories.filename, []);
var root = $.add_locations($.template(`<!> <!> <!> <!>`, 1), Example_stories.filename, []);
Example_stories[$.FILENAME] = "tests/stories/Example.stories.svelte";

import * as $ from "svelte/internal/client";
import { action } from '@storybook/addon-actions';
import { defineMeta, setTemplate } from '@storybook/addon-svelte-csf';
import Example from './Example.svelte';

var root_2 = $.add_locations($.template(`<p> </p> <p> </p> <br>`, 1), Example_stories[$.FILENAME], [[45, 4], [46, 4], [47, 24]]);
var root_4 = $.add_locations($.template(`Label`, 1), Example_stories[$.FILENAME], []);
var root = $.add_locations($.template(`<!> <!> <!> <!>`, 1), Example_stories[$.FILENAME], []);

/**
* Description set explicitly in the comment above `defineMeta`.
*
Expand All @@ -37,45 +28,45 @@ const { Story } = defineMeta({
args: {
onclick: action('onclick'),
onmouseenter: action('onmouseenter'),
onmouseleave: action('onmouseleave'),
},
onmouseleave: action('onmouseleave')
}
});

function Example_stories($$anchor, $$props) {
if (new.target === Example_stories)
throw new Error(
'Instantiating a component with `new` is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information'
);
$.check_target(new.target);
$.push($$props, true, Example_stories);

var render = $.wrap_snippet(($$anchor, args = $.noop, context = $.noop) => {
const render = $.wrap_snippet(Example_stories, ($$anchor, args = $.noop, context = $.noop) => {
var fragment = $.comment();
var node = $.first_child(fragment);

$.validate_component(Example)(
node,
$.spread_props(args, {
onclick: handleClick,
children: $.wrap_snippet(($$anchor, $$slotProps) => {
var fragment_1 = Example_default();
var p = $.first_child(fragment_1);
var text = $.child(p);
var p_1 = $.sibling($.sibling(p, true));
var text_1 = $.child(p_1);
var text_2 = $.sibling(p_1, true);
var br = $.sibling(text_2);

$.template_effect(() => {
$.set_text(text, args()?.id);
$.set_text(text_1, context().name);
$.set_text(text_2, ` You clicked: ${$.stringify($.get(count))}`);
});

$.append($$anchor, fragment_1);
}),
$$slots: { default: true },
})
);
Example(node, $.spread_props(args, {
onclick: handleClick,
children: $.wrap_snippet(Example_stories, ($$anchor, $$slotProps) => {
var fragment_1 = root_2();
var p = $.first_child(fragment_1);
var text = $.child(p);

$.reset(p);

var p_1 = $.sibling($.sibling(p, true));
var text_1 = $.child(p_1);

$.reset(p_1);

var text_2 = $.sibling(p_1, true);
var br = $.sibling(text_2);

$.template_effect(() => {
$.set_text(text, args().id);
$.set_text(text_1, context().name);
$.set_text(text_2, ` You clicked: ${$.get(count) ?? ""}`);
});

$.append($$anchor, fragment_1);
}),
$$slots: { default: true }
}));

$.append($$anchor, fragment);
});
Expand All @@ -93,61 +84,53 @@ function Example_stories($$anchor, $$props) {
var fragment_2 = root();
var node_1 = $.first_child(fragment_2);

$.validate_component(Story)(node_1, { name: 'Default' });
Story(node_1, { name: "Default" });

var node_2 = $.sibling($.sibling(node_1, true));

$.validate_component(Story)(node_2, { name: 'Rounded', args: { rounded: true } });
Story(node_2, { name: "Rounded", args: { rounded: true } });

var node_3 = $.sibling($.sibling(node_2, true));

$.validate_component(Story)(node_3, { name: 'Square', args: { rounded: false } });
Story(node_3, { name: "Square", args: { rounded: false } });

var node_4 = $.sibling($.sibling(node_3, true));

$.validate_component(Story)(node_4, {
name: 'Without template',
children: $.wrap_snippet(($$anchor, $$slotProps) => {
Story(node_4, {
name: "Without template",
children: $.wrap_snippet(Example_stories, ($$anchor, $$slotProps) => {
var fragment_3 = $.comment();
var node_5 = $.first_child(fragment_3);

$.validate_component(Example)(node_5, {
children: $.wrap_snippet(($$anchor, $$slotProps) => {
var fragment_4 = Example_default_1();
Example(node_5, {
children: $.wrap_snippet(Example_stories, ($$anchor, $$slotProps) => {
$.next();

var fragment_4 = root_4();

$.append($$anchor, fragment_4);
}),
$$slots: { default: true },
$$slots: { default: true }
});

$.append($$anchor, fragment_3);
}),
$$slots: { default: true },
$$slots: { default: true }
});

$.append($$anchor, fragment_2);
return $.pop({ ...$.legacy_api() });
}

if (import.meta.hot) {
const s = $.source(Example_stories);
const filename = Example_stories.filename;

Example_stories = $.hmr(s);
Example_stories.filename = filename;

if (import.meta.hot.acceptExports) {
import.meta.hot.acceptExports(['default'], (module) => {
$.set(s, module.default);
});
} else {
import.meta.hot.acceptExports(['default'], (module) => {
$.set(s, module.default);
});
}
Example_stories = $.hmr(Example_stories, () => Example_stories[$.HMR].source);

import.meta.hot.acceptExports(["default"], (module) => {
module.default[$.HMR].source = Example_stories[$.HMR].source;
$.set(Example_stories[$.HMR].source, module.default[$.HMR].original);
});
}

export default Example_stories;

$.mark_module_end(Example_stories);
Example_stories.__docgen = { keywords: [], data: [], name: 'Example.stories.svelte' };

0 comments on commit da5bb5c

Please sign in to comment.