Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
ac55fb4c
Commit
ac55fb4c
authored
Jun 14, 2019
by
Tim Steenvoorden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw opacity boxes around subexpressions
parent
89c507ba
Pipeline
#25342
passed with stage
in 6 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
43 deletions
+80
-43
Examples/DynamicEditor/DynEditorExample.css
Examples/DynamicEditor/DynEditorExample.css
+37
-6
Examples/DynamicEditor/DynEditorExample.icl
Examples/DynamicEditor/DynEditorExample.icl
+43
-37
No files found.
Examples/DynamicEditor/DynEditorExample.css
View file @
ac55fb4c
.typedTaskEditor
{
padding
:
0.2em
;
margin
:
0.4em
;
align-self
:
flex-start
;
/*
* CSS additions and fixes for typed task editor.
*/
/* Make labels occupy less space */
.itasks-label
{
padding
:
0em
1em
0em
0em
;
width
:
auto
;
}
/* Make containers have their natural sizes */
.itasks-container
{
align-self
:
auto
;
}
/* Make generated labels flow on top */
.itasks-container.itasks-form-item
{
flex-direction
:
column
;
}
/* Set base padding */
.typedtasks-base
{
padding
:
0.2em
0.4em
;
}
/* Center horizontal structures vertically */
.typedtasks-horizontal
{
align-items
:
center
;
margin
:
0.2em
;
}
/* Indent vertical structures horizontally */
.typedtasks-vertical
{
margin
:
0.8em
1.6em
;
}
.typedTaskEditorWithBorder
{
border
:
1px
solid
#ccc
;
/* Add background boxes which get darker with nesting */
.typedtasks-boxed
{
background-color
:
hsla
(
0
,
0%
,
0%
,
5%
);
}
Examples/DynamicEditor/DynEditorExample.icl
View file @
ac55fb4c
...
...
@@ -125,14 +125,14 @@ taskEditor = DynamicEditor
(
Typed
TaskExpr
(
Task
a
))
(
Typed
TaskFunc
(
a
->
Task
b
))
->
Typed
TaskExpr
(
Task
b
)
)
<<@@@
applyVertical
Classes
<<@@@
applyVertical
BoxedLayout
,
functionConsDyn
"ThenF"
"sequence"
(
dynamic
\(
Typed
taskFunc1
)
(
Typed
taskFunc2
)
->
Typed
(
ThenF
taskFunc1
taskFunc2
)
::
A
.
a
b
c
:
(
Typed
TaskFunc
(
a
->
Task
b
))
(
Typed
TaskFunc
(
b
->
Task
c
))
->
Typed
TaskFunc
(
a
->
Task
c
)
)
<<@@@
applyVertical
Classes
<<@@@
applyVertical
BoxedLayout
,
functionConsDyn
"Both"
"both"
(
dynamic
\(
Typed
task1
)
(
Typed
task2
)
->
Typed
(
Both
task1
task2
)
::
A
.
a
b
:
...
...
@@ -140,7 +140,7 @@ taskEditor = DynamicEditor
(
Typed
TaskExpr
(
Task
b
))
->
Typed
TaskExpr
(
Task
(
a
,
b
))
)
<<@@@
applyVertical
Classes
<<@@@
applyVertical
BoxedLayout
,
functionConsDyn
"Any"
"any of"
(
dynamic
\(
Typed
task1
)
(
Typed
task2
)
->
Typed
(
Any
task1
task2
)
::
A
.
a
b
:
...
...
@@ -148,7 +148,7 @@ taskEditor = DynamicEditor
(
Typed
TaskExpr
(
Task
a
))
->
Typed
TaskExpr
(
Task
a
)
)
<<@@@
applyVertical
Classes
<<@@@
applyVertical
BoxedLayout
,
functionConsDyn
"One"
"one of"
(
dynamic
\
button1
(
Typed
task1
)
button2
(
Typed
task2
)
->
Typed
(
One
button1
task1
button2
task2
)
::
A
.
a
b
:
...
...
@@ -158,7 +158,7 @@ taskEditor = DynamicEditor
(
Typed
TaskExpr
(
Task
a
))
->
Typed
TaskExpr
(
Task
a
)
)
<<@@@
applyVertical
Classes
<<@@@
applyVertical
BoxedLayout
// , functionConsDyn "When" "guarded sequence"
// ( dynamic \(Typed task1) (Typed steps) -> Typed (When task1 steps) ::
// // Typed (When task1 [(expr, pred, tfExpr) \\ (Typed expr, pred, Typed tfExpr) <- steps]) ::
...
...
@@ -168,7 +168,7 @@ taskEditor = DynamicEditor
// // (Typed (List (Typed Func (a -> Bool), String, Typed TaskFunc (a -> Task a))) (a -> Task b))
// -> Typed TaskExpr (Task b)
// )
// <<@@@ applyHorizontal
Classes
// <<@@@ applyHorizontal
BoxedLayout
// , listConsDyn "List TaskContExpr" "continuations"
// ( dynamic \typedSteps -> Typed ((\(Typed expr) -> expr) <$> typedSteps) ::
// A.a b:
...
...
@@ -195,7 +195,7 @@ taskEditor = DynamicEditor
String
->
Typed
TaskExpr
(
Task
a
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
<<@@@
AddLabels
[
Nothing
,
Just
"message"
]
,
functionConsDyn
"ViewF"
"view"
(
dynamic
\
s
(
Typed
func
)
->
Typed
(
ViewF
s
func
)
::
...
...
@@ -204,14 +204,14 @@ taskEditor = DynamicEditor
(
Typed
Func
(
a
->
b
))
->
Typed
TaskFunc
(
a
->
Task
b
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"UpdateF"
"update"
(
dynamic
\
s
->
Typed
(
UpdateF
s
)
::
A
.
a
:
String
->
Typed
TaskFunc
(
a
->
Task
a
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
,
DynamicConsGroup
"Special"
[
functionConsDyn
"Done"
"done"
...
...
@@ -220,13 +220,13 @@ taskEditor = DynamicEditor
(
Typed
Expr
a
)
->
Typed
TaskExpr
(
Task
a
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
// Non-task functions:
,
DynamicConsGroup
"Basics"
[
functionConsDyn
"Identity"
"this value"
(
dynamic
Typed
Identity
::
A
.
a
:
Typed
Func
(
a
->
a
))
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Apply"
"apply"
(
dynamic
\(
Typed
func
)
(
Typed
expr
)
->
Typed
(
Apply
func
expr
)
::
...
...
@@ -235,92 +235,92 @@ taskEditor = DynamicEditor
(
Typed
Expr
a
)
->
Typed
Expr
b
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Fst"
"fst"
(
dynamic
Typed
Fst
::
A
.
a
b
:
Typed
Func
((
a
,
b
)
->
a
))
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Snd"
"snd"
(
dynamic
Typed
Snd
::
A
.
a
b
:
Typed
Func
((
a
,
b
)
->
b
))
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
]
,
DynamicConsGroup
"Arithmetic"
[
functionConsDyn
"Add"
"add"
(
dynamic
\(
Typed
i
)
->
Typed
(
Add
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Sub"
"sub"
(
dynamic
\(
Typed
i
)
->
Typed
(
Sub
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Mul"
"mul"
(
dynamic
\(
Typed
i
)
->
Typed
(
Mul
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Div"
"div"
(
dynamic
\(
Typed
i
)
->
Typed
(
Div
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
,
DynamicConsGroup
"Logic"
[
functionConsDyn
"Conj"
"and"
(
dynamic
\(
Typed
b
)
->
Typed
(
Conj
b
)
::
(
Typed
Expr
Bool
)
->
Typed
Func
(
Bool
->
Bool
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Disj"
"or"
(
dynamic
\(
Typed
b
)
->
Typed
(
Disj
b
)
::
(
Typed
Expr
Bool
)
->
Typed
Func
(
Bool
->
Bool
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Not"
"not"
(
dynamic
Typed
Not
::
Typed
Func
(
Bool
->
Bool
))
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
]
,
DynamicConsGroup
"Comparison"
[
functionConsDyn
"Gt"
"greater than"
(
dynamic
\(
Typed
i
)
->
Typed
(
Gt
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Ge"
"greater or equal"
(
dynamic
\(
Typed
i
)
->
Typed
(
Ge
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Eq"
"equal to"
(
dynamic
\(
Typed
i
)
->
Typed
(
Eq
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Le"
"lesser than"
(
dynamic
\(
Typed
i
)
->
Typed
(
Le
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
,
functionConsDyn
"Lt"
"lesser than"
(
dynamic
\(
Typed
i
)
->
Typed
(
Lt
i
)
::
(
Typed
Expr
Int
)
->
Typed
Func
(
Int
->
Int
))
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
// Non-task expressions:
,
DynamicConsGroup
"Values"
[
functionConsDyn
"Int"
"the integer"
(
dynamic
\
i
->
Typed
(
Int
i
)
::
Int
->
Typed
Expr
Int
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Bool"
"the boolean"
(
dynamic
\
b
->
Typed
(
Bool
b
)
::
Bool
->
Typed
Expr
Bool
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"String"
"the string"
(
dynamic
\
s
->
Typed
(
String
s
)
::
String
->
Typed
Expr
String
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Tuple"
"the tuple"
(
dynamic
\(
Typed
a
)
(
Typed
b
)
->
Typed
(
Tuple
a
b
)
::
A
.
a
b
:
(
Typed
Expr
a
)
(
Typed
Expr
b
)
->
Typed
Expr
(
a
,
b
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
// Types
,
DynamicConsGroup
"Types"
[
functionConsDyn
"Ty.Int"
"Int"
(
dynamic
Typed
(
Ty
VInt
)
::
Typed
Ty
Int
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Ty.Bool"
"Bool"
(
dynamic
Typed
(
Ty
VBool
)
::
Typed
Ty
Bool
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Ty.String"
"String"
(
dynamic
Typed
(
Ty
VString
)
::
Typed
Ty
String
)
<<@@@
applyHorizontal
ClassesNoBorder
<<@@@
applyHorizontal
Layout
,
functionConsDyn
"Ty.Tuple"
"Tuple"
(
dynamic
\(
Typed
(
Ty
toValue1
))
(
Typed
(
Ty
toValue2
))
->
Typed
(
Ty
\(
x
,
y
)
->
VTuple
(
toValue1
x
)
(
toValue2
y
))
::
A
.
a
b
:
(
Typed
Ty
a
)
(
Typed
Ty
b
)
->
Typed
Ty
(
a
,
b
)
)
<<@@@
applyHorizontal
Classes
<<@@@
applyHorizontal
BoxedLayout
]
// Internal helper editors
,
DynamicConsGroup
"Helpers"
...
...
@@ -339,9 +339,15 @@ where
stringEditor
::
Editor
String
stringEditor
=
gEditor
{|*|}
applyHorizontalClasses
=
ApplyCssClasses
[
"typedTaskEditor"
,
"itasks-horizontal"
,
"itasks-wrap-width"
,
"itasks-wrap-height"
,
"typedTaskEditorWithBorder"
]
applyHorizontalClassesNoBorder
=
ApplyCssClasses
[
"typedTaskEditor"
,
"itasks-horizontal"
,
"itasks-wrap-width"
,
"itasks-wrap-height"
]
applyVerticalClasses
=
ApplyCssClasses
[
"typedTaskEditor"
,
"itasks-vertical"
,
"itasks-wrap-width"
,
"itasks-wrap-height"
,
"typedTaskEditorWithBorder"
]
basicClasses
=
[
"typedtasks-base"
,
"itasks-wrap-width"
,
"itasks-wrap-height"
]
horizontalClasses
=
[
"typedtasks-horizontal"
,
"itasks-horizontal"
]
verticalClasses
=
[
"typedtasks-vertical"
,
"itasks-vertical"
]
boxedClasses
=
[
"typedtasks-boxed"
]
applyHorizontalBoxedLayout
=
ApplyCssClasses
$
basicClasses
++
horizontalClasses
++
boxedClasses
applyVerticalBoxedLayout
=
ApplyCssClasses
$
basicClasses
++
verticalClasses
++
boxedClasses
applyHorizontalLayout
=
ApplyCssClasses
$
basicClasses
++
horizontalClasses
applyVerticalLayout
=
ApplyCssClasses
$
basicClasses
++
verticalClasses
// Evaluation //////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment