2023-10-29 22:02:07 +03:00
|
|
|
<script setup lang="ts">
|
2024-01-04 16:12:03 +03:00
|
|
|
import { reactive, ref } from 'vue'
|
2023-10-29 22:02:07 +03:00
|
|
|
|
|
|
|
import GraphEditor from '@/components/GraphEditor.vue'
|
|
|
|
import { useSuggestionDbStore } from '@/stores/suggestionDatabase'
|
2024-01-04 16:12:03 +03:00
|
|
|
import { ToastContainer } from 'react-toastify'
|
|
|
|
import 'react-toastify/dist/ReactToastify.css'
|
|
|
|
import { createReactWrapper } from 'vue-react-wrapper'
|
2024-03-14 20:05:26 +03:00
|
|
|
import MockProjectStoreWrapper from '../mock/MockProjectStoreWrapper.vue'
|
2023-10-29 22:02:07 +03:00
|
|
|
import HstCode from './histoire/HstCode.vue'
|
|
|
|
|
|
|
|
const text = ref(`\
|
|
|
|
from Standard.Base import all
|
|
|
|
from Standard.Base.Runtime.Ref import Ref
|
|
|
|
|
|
|
|
from Standard.Test import Bench
|
|
|
|
|
|
|
|
options = Bench.options . set_warmup (Bench.phase_conf 1 2) . set_measure (Bench.phase_conf 3 2)
|
|
|
|
|
|
|
|
collect_benches = Bench.build builder->
|
|
|
|
range_size = 100000000
|
|
|
|
data = 0.up_to range_size
|
|
|
|
|
|
|
|
builder.group "Range" options group_builder->
|
|
|
|
group_builder.specify "iterate" <|
|
|
|
|
cell = Ref.new 0
|
|
|
|
data . each _->
|
|
|
|
x = cell.get
|
|
|
|
cell.put x+1
|
|
|
|
|
|
|
|
cell.get . should_equal range_size
|
|
|
|
|
|
|
|
main =
|
|
|
|
benches = collect_benches
|
|
|
|
result = run_main benches
|
2023-11-07 18:51:30 +03:00
|
|
|
third_node = 2 + 2
|
2023-10-29 22:02:07 +03:00
|
|
|
`)
|
2024-01-04 16:12:03 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Note: These props should be synced with the props in
|
|
|
|
* `app/ide-desktop/lib/dashboard/src/authentication/src/components/app.tsx`.
|
|
|
|
* We need this here, as the react component is not part of the dashboard and not usually available in the demo scenes.
|
|
|
|
* Using this wrapper enables us to see toasts in the absence of the dashboard/React.
|
|
|
|
*/
|
|
|
|
const toastProps = reactive({
|
|
|
|
position: 'top-center',
|
|
|
|
theme: 'light',
|
|
|
|
closeOnClick: false,
|
|
|
|
draggable: false,
|
|
|
|
toastClassName: 'text-sm leading-170 bg-frame-selected rounded-2xl backdrop-blur-3xl',
|
|
|
|
limit: 3,
|
|
|
|
})
|
|
|
|
const WrappedToastContainer = createReactWrapper(ToastContainer, toastProps)
|
2023-10-29 22:02:07 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<Story
|
|
|
|
title="Editor"
|
|
|
|
group="graph"
|
|
|
|
:layout="{ type: 'single', iframe: false }"
|
|
|
|
:setupApp="
|
|
|
|
() => {
|
|
|
|
useSuggestionDbStore()
|
|
|
|
}
|
|
|
|
"
|
|
|
|
responsiveDisabled
|
|
|
|
autoPropsDisabled
|
|
|
|
>
|
2024-01-04 16:12:03 +03:00
|
|
|
<WrappedToastContainer />t
|
2023-10-29 22:02:07 +03:00
|
|
|
<MockProjectStoreWrapper v-model="text">
|
|
|
|
<Suspense><GraphEditor /></Suspense>
|
|
|
|
</MockProjectStoreWrapper>
|
|
|
|
|
|
|
|
<template #controls><HstCode v-model="text" title="code" /></template>
|
|
|
|
</Story>
|
|
|
|
</template>
|