|
1 | 1 | // createReplComponent.js
|
2 |
| -import { defineComponent, h } from 'vue' |
3 |
| -import ReplWrapper from '@/components/ReplWrapper.vue' // Adjust the path accordingly |
| 2 | +import { defineComponent, h } from "vue"; |
| 3 | +import ReplWrapper from "@/components/ReplWrapper.vue"; // Adjust the path accordingly |
4 | 4 |
|
5 | 5 | // Introduction
|
6 |
| -import HelloAppVue from '@/views/introduction/HelloWorldView.vue?raw' |
7 |
| -import DynamicAttributesAppVue from '@/views/introduction/dynamicattributes/DynamicAttributesView.vue?raw' |
8 |
| -import StylingAppVue from '@/views/introduction/StylingView.vue?raw' |
9 |
| -import MainComponentVue from '@/views/introduction/nestedcomponents/NestedAppView.vue?raw' |
10 |
| -import SubComponentVue from '@/views/introduction/nestedcomponents/NestedComponentsView.vue?raw' |
11 |
| -import HtmlDirectiveAppVue from '@/views/introduction/HtmlDirectiveView.vue?raw' |
| 6 | +import HelloAppVue from "@/views/introduction/HelloWorldView.vue?raw"; |
| 7 | +import DynamicAttributesAppVue from "@/views/introduction/dynamicattributes/DynamicAttributesView.vue?raw"; |
| 8 | +import StylingAppVue from "@/views/introduction/StylingView.vue?raw"; |
| 9 | +import MainComponentVue from "@/views/introduction/nestedcomponents/NestedAppView.vue?raw"; |
| 10 | +import SubComponentVue from "@/views/introduction/nestedcomponents/NestedComponentsView.vue?raw"; |
| 11 | +import HtmlDirectiveAppVue from "@/views/introduction/HtmlDirectiveView.vue?raw"; |
12 | 12 |
|
13 | 13 | // Reactivity
|
14 |
| -import ReactivityAssignmentView from '@/views/reactivity/ReactivityAssignmentView.vue?raw' |
15 |
| -import ReactivityDeclarationView from '@/views/reactivity/ReactiveDeclarationView.vue?raw' |
16 |
| -import ReactivityStatementsView from '@/views/reactivity/ReactiveStatementsView.vue?raw' |
| 14 | +import ReactivityAssignmentView from "@/views/reactivity/ReactivityAssignmentView.vue?raw"; |
| 15 | +import ReactivityDeclarationView from "@/views/reactivity/ReactiveDeclarationView.vue?raw"; |
| 16 | +import ReactivityStatementsView from "@/views/reactivity/ReactiveStatementsView.vue?raw"; |
17 | 17 |
|
18 | 18 | // Props
|
19 |
| -import DeclaringPropsAppVue from '@/views/props/declaringprops/DeclaringPropsView.vue?raw' |
20 |
| -import DeclaringPropsNestedVue from '@/views/props/declaringprops/NestedView.vue?raw' |
| 19 | +import DeclaringPropsAppVue from "@/views/props/declaringprops/DeclaringPropsView.vue?raw"; |
| 20 | +import DeclaringPropsNestedVue from "@/views/props/declaringprops/NestedView.vue?raw"; |
21 | 21 |
|
22 |
| -import DefaultValuesAppVue from '@/views/props/defaultvalues/DefaultValuesView.vue?raw' |
23 |
| -import DefaultValuesNestedVue from '@/views/props/defaultvalues/NestedView.vue?raw' |
| 22 | +import DefaultValuesAppVue from "@/views/props/defaultvalues/DefaultValuesView.vue?raw"; |
| 23 | +import DefaultValuesNestedVue from "@/views/props/defaultvalues/NestedView.vue?raw"; |
24 | 24 |
|
25 |
| -import SpreadPropsAppVue from '@/views/props/spreadprops/SpreadPropsView.vue?raw' |
26 |
| -import SpreadPropsNestedVue from '@/views/props/spreadprops/InfoView.vue?raw' |
| 25 | +import SpreadPropsAppVue from "@/views/props/spreadprops/SpreadPropsView.vue?raw"; |
| 26 | +import SpreadPropsNestedVue from "@/views/props/spreadprops/InfoView.vue?raw"; |
27 | 27 |
|
28 | 28 | // Events
|
29 |
| -import ComponentEventsAppVue from '@/views/events/componentevents/AppView.vue?raw' |
30 |
| -import ComponentEventsInnerVue from '@/views/events/componentevents/InnerView.vue?raw' |
31 |
| -import DomEventForwardingAppVue from '@/views/events/domeventforwarding/AppView.vue?raw' |
32 |
| -import DomEventForwardingInnerVue from '@/views/events/domeventforwarding/InnerView.vue?raw' |
33 |
| -import EventForwardingAppVue from '@/views/events/eventforwarding/GrandParentView.vue?raw' |
34 |
| -import EventForwardingChildVue from '@/views/events/eventforwarding/ChildView.vue?raw' |
35 |
| -import EventForwardingParentVue from '@/views/events/eventforwarding/ParentView.vue?raw' |
36 |
| -import DomEventViewAppVue from '@/views/events/DomEventView.vue?raw' |
37 |
| -import EventModifiersAppVue from '@/views/events/EventModifiersView.vue?raw' |
38 |
| -import InlineHandlerAppVue from '@/views/events/InlineHandlersView.vue?raw' |
| 29 | +import ComponentEventsAppVue from "@/views/events/componentevents/AppView.vue?raw"; |
| 30 | +import ComponentEventsInnerVue from "@/views/events/componentevents/InnerView.vue?raw"; |
| 31 | +import DomEventForwardingAppVue from "@/views/events/domeventforwarding/AppView.vue?raw"; |
| 32 | +import DomEventForwardingInnerVue from "@/views/events/domeventforwarding/InnerView.vue?raw"; |
| 33 | +import EventForwardingAppVue from "@/views/events/eventforwarding/GrandParentView.vue?raw"; |
| 34 | +import EventForwardingChildVue from "@/views/events/eventforwarding/ChildView.vue?raw"; |
| 35 | +import EventForwardingParentVue from "@/views/events/eventforwarding/ParentView.vue?raw"; |
| 36 | +import DomEventViewAppVue from "@/views/events/DomEventView.vue?raw"; |
| 37 | +import EventModifiersAppVue from "@/views/events/EventModifiersView.vue?raw"; |
| 38 | +import InlineHandlerAppVue from "@/views/events/InlineHandlersView.vue?raw"; |
39 | 39 |
|
40 | 40 | // Logic
|
41 |
| -import AwaitBlocksAppVue from '@/views/logic/awaitblocksview/AppView.vue?raw' |
42 |
| -import AwaitBlocksSupportVue from '@/views/logic/awaitblocksview/utils.js?raw' |
43 |
| -import KeyedEachBlocksAppVue from '@/views/logic/keyedeachblocks/AppView.vue?raw' |
44 |
| -import KeyedEachBlocksSupportVue from '@/views/logic/keyedeachblocks/ThingView.vue?raw' |
45 |
| -import EachBlocksAppVue from '@/views/logic/EachBlocksView.vue?raw' |
46 |
| -import ElseBlocksAppVue from '@/views/logic/ElseBlocksView.vue?raw' |
47 |
| -import ElseIfBlocksAppVue from '@/views/logic/ElseIfBlocksView.vue?raw' |
48 |
| -import IfBlocksAppVue from '@/views/logic/IfBlocksView.vue?raw' |
| 41 | +import AwaitBlocksAppVue from "@/views/logic/awaitblocksview/AppView.vue?raw"; |
| 42 | +import AwaitBlocksSupportVue from "@/views/logic/awaitblocksview/utils.js?raw"; |
| 43 | +import KeyedEachBlocksAppVue from "@/views/logic/keyedeachblocks/AppView.vue?raw"; |
| 44 | +import KeyedEachBlocksSupportVue from "@/views/logic/keyedeachblocks/ThingView.vue?raw"; |
| 45 | +import EachBlocksAppVue from "@/views/logic/EachBlocksView.vue?raw"; |
| 46 | +import ElseBlocksAppVue from "@/views/logic/ElseBlocksView.vue?raw"; |
| 47 | +import ElseIfBlocksAppVue from "@/views/logic/ElseIfBlocksView.vue?raw"; |
| 48 | +import IfBlocksAppVue from "@/views/logic/IfBlocksView.vue?raw"; |
49 | 49 |
|
50 | 50 | export function createReplComponent(codeString, files = {}) {
|
51 | 51 | return defineComponent({
|
52 | 52 | render() {
|
53 |
| - return h(ReplWrapper, { codeString, files }) |
54 |
| - } |
55 |
| - }) |
| 53 | + return h(ReplWrapper, { codeString, files }); |
| 54 | + }, |
| 55 | + }); |
56 | 56 | }
|
57 | 57 |
|
58 | 58 | // Introduction
|
59 |
| -export const HelloWorldVue = createReplComponent(HelloAppVue) |
60 |
| -export const DynamicAttributesVue = createReplComponent(DynamicAttributesAppVue) |
61 |
| -export const StylingVue = createReplComponent(StylingAppVue) |
| 59 | +export const HelloWorldVue = createReplComponent(HelloAppVue); |
| 60 | +export const DynamicAttributesVue = createReplComponent( |
| 61 | + DynamicAttributesAppVue, |
| 62 | +); |
| 63 | +export const StylingVue = createReplComponent(StylingAppVue); |
62 | 64 | export const NestedComponentsVue = createReplComponent(MainComponentVue, {
|
63 |
| - 'NestedComponent.vue': SubComponentVue |
64 |
| -}) |
65 |
| -export const HtmlDirectiveVue = createReplComponent(HtmlDirectiveAppVue) |
| 65 | + "NestedComponent.vue": SubComponentVue, |
| 66 | +}); |
| 67 | +export const HtmlDirectiveVue = createReplComponent(HtmlDirectiveAppVue); |
66 | 68 |
|
67 | 69 | // Reactivity
|
68 |
| -export const ReactivityAssignmentVue = createReplComponent(ReactivityAssignmentView) |
69 |
| -export const ReactivityDeclarationVue = createReplComponent(ReactivityDeclarationView) |
70 |
| -export const ReactivityStatementsVue = createReplComponent(ReactivityStatementsView) |
| 70 | +export const ReactivityAssignmentVue = createReplComponent( |
| 71 | + ReactivityAssignmentView, |
| 72 | +); |
| 73 | +export const ReactivityDeclarationVue = createReplComponent( |
| 74 | + ReactivityDeclarationView, |
| 75 | +); |
| 76 | +export const ReactivityStatementsVue = createReplComponent( |
| 77 | + ReactivityStatementsView, |
| 78 | +); |
71 | 79 |
|
72 | 80 | // Props
|
73 | 81 | export const DeclaringPropsVue = createReplComponent(DeclaringPropsAppVue, {
|
74 |
| - 'NestedView.vue': DeclaringPropsNestedVue |
75 |
| -}) |
| 82 | + "NestedView.vue": DeclaringPropsNestedVue, |
| 83 | +}); |
76 | 84 | export const DefaultValuesVue = createReplComponent(DefaultValuesAppVue, {
|
77 |
| - 'NestedView.vue': DefaultValuesNestedVue |
78 |
| -}) |
| 85 | + "NestedView.vue": DefaultValuesNestedVue, |
| 86 | +}); |
79 | 87 | export const SpreadPropsVue = createReplComponent(SpreadPropsAppVue, {
|
80 |
| - 'InfoView.vue': SpreadPropsNestedVue |
81 |
| -}) |
| 88 | + "InfoView.vue": SpreadPropsNestedVue, |
| 89 | +}); |
82 | 90 |
|
83 | 91 | // Logic
|
84 | 92 | export const AwaitBlocksVue = createReplComponent(AwaitBlocksAppVue, {
|
85 |
| - 'utils.js': AwaitBlocksSupportVue |
86 |
| -}) |
| 93 | + "utils.js": AwaitBlocksSupportVue, |
| 94 | +}); |
87 | 95 | export const KeyedEachBlocksVue = createReplComponent(KeyedEachBlocksAppVue, {
|
88 |
| - 'ThingView.vue': KeyedEachBlocksSupportVue |
89 |
| -}) |
90 |
| -export const EachBlocksVue = createReplComponent(EachBlocksAppVue) |
91 |
| -export const ElseBlocksVue = createReplComponent(ElseBlocksAppVue) |
92 |
| -export const ElseIfBlocksVue = createReplComponent(ElseIfBlocksAppVue) |
93 |
| -export const IfBlocksVue = createReplComponent(IfBlocksAppVue) |
| 96 | + "ThingView.vue": KeyedEachBlocksSupportVue, |
| 97 | +}); |
| 98 | +export const EachBlocksVue = createReplComponent(EachBlocksAppVue); |
| 99 | +export const ElseBlocksVue = createReplComponent(ElseBlocksAppVue); |
| 100 | +export const ElseIfBlocksVue = createReplComponent(ElseIfBlocksAppVue); |
| 101 | +export const IfBlocksVue = createReplComponent(IfBlocksAppVue); |
94 | 102 |
|
95 | 103 | // Events
|
96 | 104 | export const ComponentEventsVue = createReplComponent(ComponentEventsAppVue, {
|
97 |
| - 'InnerView.vue': ComponentEventsInnerVue |
98 |
| -}) |
99 |
| -export const DomEventForwardingVue = createReplComponent(DomEventForwardingAppVue, { |
100 |
| - 'InnerView.vue': DomEventForwardingInnerVue |
101 |
| -}) |
| 105 | + "InnerView.vue": ComponentEventsInnerVue, |
| 106 | +}); |
| 107 | +export const DomEventForwardingVue = createReplComponent( |
| 108 | + DomEventForwardingAppVue, |
| 109 | + { |
| 110 | + "InnerView.vue": DomEventForwardingInnerVue, |
| 111 | + }, |
| 112 | +); |
102 | 113 | export const EventForwardingVue = createReplComponent(EventForwardingAppVue, {
|
103 |
| - 'ChildView.vue': EventForwardingChildVue, |
104 |
| - 'ParentView.vue': EventForwardingParentVue |
105 |
| -}) |
106 |
| -export const DomEventViewVue = createReplComponent(DomEventViewAppVue) |
107 |
| -export const EventModifiersVue = createReplComponent(EventModifiersAppVue) |
108 |
| -export const InlineHandlersVue = createReplComponent(InlineHandlerAppVue) |
| 114 | + "ChildView.vue": EventForwardingChildVue, |
| 115 | + "ParentView.vue": EventForwardingParentVue, |
| 116 | +}); |
| 117 | +export const DomEventViewVue = createReplComponent(DomEventViewAppVue); |
| 118 | +export const EventModifiersVue = createReplComponent(EventModifiersAppVue); |
| 119 | +export const InlineHandlersVue = createReplComponent(InlineHandlerAppVue); |
0 commit comments