- {steps.map((step, i) => {
- switch (step.type) {
- case 'key': {
- const tierOptions = Object.keys(stepsList.reduce((r, optionSteps) => {
- if (!optionSteps[i] || !optionSteps[i].key) {
- return r;
- }
- for (let j = 0; j < i; ++j) {
- if (steps[j].key !== optionSteps[j].key) {
- return r;
- }
- }
- return {...r, [optionSteps[i].key]: true};
- }, {}));
- if (0 === i) {
- tierOptions.push('
');
- }
- return (
-
-
-
- );
- }
- case 'invoke':
- return (
-
-
(
- {step.args.map((arg) => (
-
-
-
- ))}
-
)
-
- );
- default:
- return null;
- }
- })}
- {
- value && (
-
- =
-
-
- )
- }
-
- );
-};
-
-export default decorate(Steps);
diff --git a/src/client/components/types/steps.raw.scss b/src/client/components/types/traversal.raw.scss
similarity index 97%
rename from src/client/components/types/steps.raw.scss
rename to src/client/components/types/traversal.raw.scss
index 16415d2..148dd0d 100644
--- a/src/client/components/types/steps.raw.scss
+++ b/src/client/components/types/traversal.raw.scss
@@ -37,7 +37,7 @@
padding: 0.5em;
}
-.arg .steps {
+.arg .traversal {
display: flex;
}
diff --git a/src/client/components/types/traversal.type-renderer.jsx b/src/client/components/types/traversal.type-renderer.jsx
new file mode 100644
index 0000000..ea7572f
--- /dev/null
+++ b/src/client/components/types/traversal.type-renderer.jsx
@@ -0,0 +1,96 @@
+import {compose} from '@avocado/core';
+import contempo from 'contempo';
+import React from 'react';
+
+import propertyPropTypes from './property-prop-types';
+import {contextStepsList} from './steps-lists';
+import {typeFromSteps} from './typing';
+import Value from './value.type-renderer';
+
+const decorate = compose(
+ contempo(require('./traversal.raw.scss')),
+);
+
+const Traversal = (props) => {
+ const {
+ context,
+ value: {steps, value},
+ } = props;
+ const stepsList = contextStepsList(context, typeFromSteps(context, steps));
+ return (
+