├── .babelrc
├── .gitignore
├── .npmignore
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── LICENSE
├── README.md
├── article.md
├── dist
├── monadic_react.d.ts
├── monadic_react.js
└── react_monad
│ ├── combinators.d.ts
│ ├── combinators.js
│ ├── core.d.ts
│ ├── core.js
│ ├── editable_list.d.ts
│ ├── editable_list.js
│ ├── forms.d.ts
│ ├── forms.js
│ ├── html.d.ts
│ ├── html.js
│ ├── list.d.ts
│ ├── list.js
│ ├── option.d.ts
│ ├── option.js
│ ├── paginator.d.ts
│ ├── paginator.js
│ ├── primitives.d.ts
│ ├── primitives.js
│ ├── rich_text.d.ts
│ ├── rich_text.js
│ ├── router.d.ts
│ ├── router.js
│ ├── workflow.d.ts
│ └── workflow.js
├── gulpfile.js
├── package.json
├── samples
├── Client
│ ├── app.js
│ ├── app.ts
│ ├── fonts
│ │ └── icomoon
│ │ │ ├── Read Me.txt
│ │ │ ├── demo-files
│ │ │ └── demo.css
│ │ │ ├── demo.html
│ │ │ ├── fonts
│ │ │ ├── icomoon.svg
│ │ │ ├── icomoon.ttf
│ │ │ └── icomoon.woff
│ │ │ ├── selection.json
│ │ │ ├── style.css
│ │ │ ├── style.scss
│ │ │ └── variables.scss
│ ├── generated_api.js
│ ├── generated_api.ts
│ ├── generated_models.js
│ ├── generated_models.ts
│ ├── homepage.js
│ ├── homepage.tsx
│ ├── samples
│ │ ├── button.js
│ │ ├── button.tsx
│ │ ├── context.js
│ │ ├── context.ts
│ │ ├── delay_wait.js
│ │ ├── delay_wait.tsx
│ │ ├── editable_list.js
│ │ ├── editable_list.ts
│ │ ├── form.js
│ │ ├── form.ts
│ │ ├── label.js
│ │ ├── label.tsx
│ │ ├── link.js
│ │ ├── link.ts
│ │ ├── list.js
│ │ ├── list.ts
│ │ ├── menu.js
│ │ ├── menu.tsx
│ │ ├── moments.js
│ │ ├── moments.tsx
│ │ ├── multiselector.js
│ │ ├── multiselector.tsx
│ │ ├── overlay.js
│ │ ├── overlay.ts
│ │ ├── pagination.js
│ │ ├── pagination.ts
│ │ ├── promise_sample.js
│ │ ├── promise_sample.tsx
│ │ ├── rich text.js
│ │ ├── rich text.tsx
│ │ ├── selector_and_custom_class.js
│ │ ├── selector_and_custom_class.tsx
│ │ ├── tabbed menu.js
│ │ ├── tabbed menu.tsx
│ │ ├── toggles.js
│ │ └── toggles.tsx
│ └── stylesheets
│ │ ├── global
│ │ ├── .gitkeep
│ │ ├── _buttons.scss
│ │ ├── _core.scss
│ │ ├── _figures.scss
│ │ ├── _forms.scss
│ │ ├── _links.scss
│ │ ├── _lists.scss
│ │ ├── _spinners.scss
│ │ ├── _tables.scss
│ │ └── _typography.scss
│ │ ├── objects
│ │ ├── .gitkeep
│ │ ├── _breadcrumbs.scss
│ │ ├── _buttons.scss
│ │ ├── _cards.scss
│ │ ├── _column-view.scss
│ │ ├── _controls.scss
│ │ ├── _core.scss
│ │ ├── _dropdowns.scss
│ │ ├── _footer-sticky.scss
│ │ ├── _footer.scss
│ │ ├── _forms.scss
│ │ ├── _header.scss
│ │ ├── _helpers.scss
│ │ ├── _list-styles.scss
│ │ ├── _local-menu.scss
│ │ ├── _menu.scss
│ │ ├── _models.scss
│ │ ├── _new-entity.scss
│ │ ├── _searchform.scss
│ │ ├── _switch.scss
│ │ ├── _texteditor.scss
│ │ └── _topbar.scss
│ │ ├── overwrites
│ │ ├── .gitkeep
│ │ ├── _project-specific.scss
│ │ └── _project-variables.scss
│ │ ├── pages
│ │ └── .gitkeep
│ │ ├── settings
│ │ ├── .gitkeep
│ │ ├── _fonts.scss
│ │ └── _variables.scss
│ │ ├── site.scss
│ │ ├── tools
│ │ ├── .gitkeep
│ │ └── _mixins.scss
│ │ └── vendor
│ │ ├── .gitkeep
│ │ └── _normalize.scss
├── README.md
├── app.js
├── index.html
└── wwwroot
│ ├── css
│ ├── Draft.css
│ ├── site.css
│ └── site.min.css
│ ├── fonts
│ ├── KaTeX_AMS-Regular.eot
│ ├── KaTeX_AMS-Regular.ttf
│ ├── KaTeX_AMS-Regular.woff
│ ├── KaTeX_AMS-Regular.woff2
│ ├── KaTeX_Caligraphic-Bold.eot
│ ├── KaTeX_Caligraphic-Bold.ttf
│ ├── KaTeX_Caligraphic-Bold.woff
│ ├── KaTeX_Caligraphic-Bold.woff2
│ ├── KaTeX_Caligraphic-Regular.eot
│ ├── KaTeX_Caligraphic-Regular.ttf
│ ├── KaTeX_Caligraphic-Regular.woff
│ ├── KaTeX_Caligraphic-Regular.woff2
│ ├── KaTeX_Fraktur-Bold.eot
│ ├── KaTeX_Fraktur-Bold.ttf
│ ├── KaTeX_Fraktur-Bold.woff
│ ├── KaTeX_Fraktur-Bold.woff2
│ ├── KaTeX_Fraktur-Regular.eot
│ ├── KaTeX_Fraktur-Regular.ttf
│ ├── KaTeX_Fraktur-Regular.woff
│ ├── KaTeX_Fraktur-Regular.woff2
│ ├── KaTeX_Main-Bold.eot
│ ├── KaTeX_Main-Bold.ttf
│ ├── KaTeX_Main-Bold.woff
│ ├── KaTeX_Main-Bold.woff2
│ ├── KaTeX_Main-Italic.eot
│ ├── KaTeX_Main-Italic.ttf
│ ├── KaTeX_Main-Italic.woff
│ ├── KaTeX_Main-Italic.woff2
│ ├── KaTeX_Main-Regular.eot
│ ├── KaTeX_Main-Regular.ttf
│ ├── KaTeX_Main-Regular.woff
│ ├── KaTeX_Main-Regular.woff2
│ ├── KaTeX_Math-BoldItalic.eot
│ ├── KaTeX_Math-BoldItalic.ttf
│ ├── KaTeX_Math-BoldItalic.woff
│ ├── KaTeX_Math-BoldItalic.woff2
│ ├── KaTeX_Math-Italic.eot
│ ├── KaTeX_Math-Italic.ttf
│ ├── KaTeX_Math-Italic.woff
│ ├── KaTeX_Math-Italic.woff2
│ ├── KaTeX_Math-Regular.eot
│ ├── KaTeX_Math-Regular.ttf
│ ├── KaTeX_Math-Regular.woff
│ ├── KaTeX_Math-Regular.woff2
│ ├── KaTeX_SansSerif-Bold.eot
│ ├── KaTeX_SansSerif-Bold.ttf
│ ├── KaTeX_SansSerif-Bold.woff
│ ├── KaTeX_SansSerif-Bold.woff2
│ ├── KaTeX_SansSerif-Italic.eot
│ ├── KaTeX_SansSerif-Italic.ttf
│ ├── KaTeX_SansSerif-Italic.woff
│ ├── KaTeX_SansSerif-Italic.woff2
│ ├── KaTeX_SansSerif-Regular.eot
│ ├── KaTeX_SansSerif-Regular.ttf
│ ├── KaTeX_SansSerif-Regular.woff
│ ├── KaTeX_SansSerif-Regular.woff2
│ ├── KaTeX_Script-Regular.eot
│ ├── KaTeX_Script-Regular.ttf
│ ├── KaTeX_Script-Regular.woff
│ ├── KaTeX_Script-Regular.woff2
│ ├── KaTeX_Size1-Regular.eot
│ ├── KaTeX_Size1-Regular.ttf
│ ├── KaTeX_Size1-Regular.woff
│ ├── KaTeX_Size1-Regular.woff2
│ ├── KaTeX_Size2-Regular.eot
│ ├── KaTeX_Size2-Regular.ttf
│ ├── KaTeX_Size2-Regular.woff
│ ├── KaTeX_Size2-Regular.woff2
│ ├── KaTeX_Size3-Regular.eot
│ ├── KaTeX_Size3-Regular.ttf
│ ├── KaTeX_Size3-Regular.woff
│ ├── KaTeX_Size3-Regular.woff2
│ ├── KaTeX_Size4-Regular.eot
│ ├── KaTeX_Size4-Regular.ttf
│ ├── KaTeX_Size4-Regular.woff
│ ├── KaTeX_Size4-Regular.woff2
│ ├── KaTeX_Typewriter-Regular.eot
│ ├── KaTeX_Typewriter-Regular.ttf
│ ├── KaTeX_Typewriter-Regular.woff
│ ├── KaTeX_Typewriter-Regular.woff2
│ └── icomoon
│ │ ├── Read Me.txt
│ │ ├── demo-files
│ │ └── demo.css
│ │ ├── demo.html
│ │ ├── fonts
│ │ ├── icomoon.svg
│ │ ├── icomoon.ttf
│ │ └── icomoon.woff
│ │ ├── selection.json
│ │ ├── style.css
│ │ ├── style.scss
│ │ └── variables.scss
│ ├── images
│ ├── draftjs
│ │ ├── bold-text-option.svg
│ │ ├── bullets.svg
│ │ ├── code.svg
│ │ ├── header.svg
│ │ ├── italicize-text.svg
│ │ ├── numbers.svg
│ │ ├── picture.svg
│ │ ├── quotes.svg
│ │ └── underline-text-option.svg
│ ├── icon-cancel.svg
│ ├── icon-danger.svg
│ ├── icon-edit.svg
│ ├── icon-enlarge.svg
│ ├── icon-left.svg
│ ├── icon-menu-down.svg
│ ├── icon-menu-up.svg
│ ├── icon-minus.svg
│ ├── icon-plus.svg
│ ├── icon-remove.svg
│ ├── icon-right.svg
│ ├── icon-scale-down.svg
│ ├── icon-scale-up.svg
│ ├── icon-shrink.svg
│ ├── icon-translation-and-localization.svg
│ ├── icon-unlink.svg
│ ├── icon-user-list.svg
│ ├── icon-user.svg
│ ├── icon-view.svg
│ └── logo.png
│ ├── js
│ └── site.js
│ └── translations.json
├── src
├── monadic_react.ts
├── react_monad
│ ├── combinators.tsx
│ ├── core.tsx
│ ├── editable_list.tsx
│ ├── forms.ts
│ ├── html.tsx
│ ├── list.tsx
│ ├── option.ts
│ ├── paginator.tsx
│ ├── primitives.tsx
│ ├── rich_text.tsx
│ ├── router.tsx
│ └── workflow.ts
├── tsconfig.json
└── yarn.lock
├── stylesheets
├── monadic
│ ├── _content-menu.scss
│ ├── _input-choices.scss
│ ├── _playground.scss
│ ├── _tabs.scss
│ └── _title-preview.scss
└── site.scss
├── todo.md
├── tsconfig.json
├── webpack.config.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015", "stage-0", "react"]
3 | }
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | ./samples/*
2 | ./samples/lib
3 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name":".NET Core Docker Launch (web)",
6 | "type": "coreclr",
7 | "request": "launch",
8 | "preLaunchTask": "composeForDebug",
9 | "cwd": "/app",
10 | "program": "/app/MonadicComponents.dll",
11 | "sourceFileMap": {
12 | "/app": "${workspaceRoot}"
13 | },
14 |
15 | "launchBrowser": {
16 | "enabled": true,
17 | "args": "${auto-detect-url}",
18 | "windows": {
19 | "command": "cmd.exe",
20 | "args": "/C start ${auto-detect-url}"
21 | },
22 | "osx": {
23 | "command": "open"
24 | },
25 | "linux": {
26 | "command": "xdg-open"
27 | }
28 | },
29 |
30 | "pipeTransport": {
31 | "pipeProgram": "/bin/bash",
32 | "pipeCwd": "${workspaceRoot}",
33 | "pipeArgs": [ "-c", "./dockerTask.sh startDebugging" ],
34 | "windows": {
35 | "pipeProgram": "${env.windir}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
36 | "pipeCwd": "${workspaceRoot}",
37 | "pipeArgs": [ ".\\dockerTask.ps1", "-StartDebugging" ]
38 | }
39 | }
40 | },
41 | {
42 | "name": ".NET Core Launch (web)",
43 | "type": "coreclr",
44 | "request": "launch",
45 | "preLaunchTask": "build",
46 | "program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/MonadicComponents.dll",
47 | "args": [],
48 | "cwd": "${workspaceRoot}",
49 | "stopAtEntry": false,
50 | "internalConsoleOptions": "openOnSessionStart",
51 | "launchBrowser": {
52 | "enabled": true,
53 | "args": "${auto-detect-url}",
54 | "windows": {
55 | "command": "cmd.exe",
56 | "args": "/C start ${auto-detect-url}"
57 | },
58 | "osx": {
59 | "command": "open"
60 | },
61 | "linux": {
62 | "command": "xdg-open"
63 | }
64 | },
65 | "env": {
66 | "ASPNETCORE_ENVIRONMENT": "Development"
67 | },
68 | "sourceFileMap": {
69 | "/Views": "${workspaceRoot}/Views"
70 | }
71 | },
72 | {
73 | "name": ".NET Core Attach",
74 | "type": "coreclr",
75 | "request": "attach",
76 | "processId": "${command.pickProcess}"
77 | }
78 | ]
79 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.associations": {
3 | "dockerfile.*": "dockerfile"
4 | },
5 | "git.ignoreLimitWarning": true,
6 | "typescript.tsdk": "node_modules\\typescript\\lib"
7 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Giuseppe Maggiore
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/dist/monadic_react.d.ts:
--------------------------------------------------------------------------------
1 | export * from './react_monad/combinators';
2 | export * from './react_monad/core';
3 | export * from './react_monad/editable_list';
4 | export * from './react_monad/forms';
5 | export * from './react_monad/html';
6 | export * from './react_monad/list';
7 | export * from './react_monad/option';
8 | export * from './react_monad/paginator';
9 | export * from './react_monad/primitives';
10 | export * from './react_monad/rich_text';
11 | export * from './react_monad/router';
12 | export * from './react_monad/workflow';
13 |
--------------------------------------------------------------------------------
/dist/monadic_react.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | function __export(m) {
3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4 | }
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | __export(require("./react_monad/combinators"));
7 | __export(require("./react_monad/core"));
8 | __export(require("./react_monad/editable_list"));
9 | __export(require("./react_monad/forms"));
10 | __export(require("./react_monad/html"));
11 | __export(require("./react_monad/list"));
12 | __export(require("./react_monad/option"));
13 | __export(require("./react_monad/paginator"));
14 | __export(require("./react_monad/primitives"));
15 | __export(require("./react_monad/rich_text"));
16 | __export(require("./react_monad/router"));
17 | __export(require("./react_monad/workflow"));
18 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9uYWRpY19yZWFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tb25hZGljX3JlYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsK0NBQXlDO0FBQ3pDLHdDQUFrQztBQUNsQyxpREFBMkM7QUFDM0MseUNBQW1DO0FBQ25DLHdDQUFrQztBQUNsQyx3Q0FBa0M7QUFDbEMsMENBQW9DO0FBQ3BDLDZDQUF1QztBQUN2Qyw4Q0FBd0M7QUFDeEMsNkNBQXVDO0FBQ3ZDLDBDQUFvQztBQUNwQyw0Q0FBc0MifQ==
--------------------------------------------------------------------------------
/dist/react_monad/combinators.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { C, Cont, CmdCommon, Context } from './core';
3 | export declare type RepeatProps = {
4 | kind: "repeat";
5 | value: A;
6 | p: (_: A) => C;
7 | } & CmdCommon;
8 | export declare type AllProps = {
9 | kind: "all";
10 | ps: Array>;
11 | } & CmdCommon>;
12 | export declare type AnyProps = {
13 | kind: "any";
14 | value: A;
15 | ps: Array<(_: A) => C>;
16 | className: string;
17 | } & CmdCommon;
18 | export declare type NeverProps = {
19 | kind: "never";
20 | p: C;
21 | } & CmdCommon;
22 | export declare type RetractProps = {
23 | kind: "retract";
24 | inb: (_: A) => B;
25 | out: (_: A) => (_: B) => A;
26 | p: (_: B) => C;
27 | value: A;
28 | } & CmdCommon;
29 | export declare type DelayProps = {
30 | kind: "delay";
31 | dt: number;
32 | value: A;
33 | p: (_: A) => C;
34 | } & CmdCommon;
35 | export declare type WaitProps = {
36 | kind: "wait";
37 | dt: number;
38 | value: A;
39 | p: (_: A) => C;
40 | } & CmdCommon;
41 | export declare type RetryStrategy = "never" | "semi exponential" | {
42 | kind: "retry then show failure";
43 | times: number;
44 | on_failure: C;
45 | } | {
46 | kind: "never";
47 | on_failure: C;
48 | };
49 | export declare type LiftPromiseProps = {
50 | kind: "lift promise";
51 | p: (_: B) => Promise;
52 | retry_strategy: RetryStrategy;
53 | value: B;
54 | } & CmdCommon;
55 | export declare type SimpleMenuType = "side menu" | {
56 | kind: "tabs";
57 | max_tabs: number;
58 | };
59 | export declare let repeat: (key?: string, dbg?: () => string) => (p: (_: A) => C) => (_: A) => C;
60 | export declare let any: (key?: string, className?: string, dbg?: () => string) => (ps: ((_: A) => C)[]) => (_: A) => C;
61 | export declare let never: (p: C, key?: string) => C;
62 | export declare let all: (ps: C[], key?: string, dbg?: () => string) => C;
63 | export declare let retract: (key?: string, dbg?: () => string) => (inb: (_: A) => B, out: (_: A) => (_: B) => A, p: (_: B) => C) => (_: A) => C;
64 | export declare let lift_promise: (p: (_: A) => Promise, retry_strategy: RetryStrategy, key?: string, dbg?: () => string) => (_: A) => C;
65 | export declare let delay: (dt: number, key?: string, dbg?: () => string) => (p: (_: A) => C) => (_: A) => C;
66 | export declare let waiting: (dt: number, key?: string, dbg?: () => string) => (p: (_: A) => C) => (_: A) => C;
67 | export declare let mk_submenu_entry: (label: string, children: MenuEntryValue[]) => MenuEntrySubMenu;
68 | export declare let mk_menu_entry: (v: A) => MenuEntryValue;
69 | export declare type MenuEntryValue = {
70 | kind: "item";
71 | value: A;
72 | };
73 | export declare type MenuEntrySubMenu = {
74 | kind: "sub menu";
75 | label: string;
76 | children: Array>;
77 | };
78 | export declare type MenuEntry = MenuEntryValue | MenuEntrySubMenu;
79 | export declare let simple_menu: (type: SimpleMenuType, to_string: (_: A) => string, key?: string, dbg?: () => string) => (items: MenuEntry[], p: (_: A) => C, selected_item?: A, selected_sub_menu?: string) => C;
80 | export declare let custom: (key?: string, dbg?: () => string) => (render: (ctxt: () => Context) => (_: Cont) => JSX.Element) => C;
81 | export declare let hide: (f_name: string, f: C) => C;
82 |
--------------------------------------------------------------------------------
/dist/react_monad/core.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Route, Url } from './router';
3 | export declare type CmdCommon = {
4 | cont: Cont;
5 | context: () => Context;
6 | key: string;
7 | debug_info: () => string;
8 | };
9 | export declare type UnitProps = {
10 | kind: "unit";
11 | value: A;
12 | } & CmdCommon;
13 | export declare type BindProps = {
14 | kind: "bind";
15 | once: boolean;
16 | p: C;
17 | k: (_: B) => C;
18 | className: string;
19 | } & CmdCommon;
20 | export declare type MapProps = {
21 | kind: "map";
22 | p: C;
23 | f: (_: A) => B;
24 | } & CmdCommon;
25 | export declare type FilterProps = {
26 | kind: "filter";
27 | p: C;
28 | f: (_: A) => boolean;
29 | } & CmdCommon;
30 | export declare type ShouldComponentUpdateProps = {
31 | kind: "should component update";
32 | p: (_: A) => C;
33 | f: (_: A) => boolean;
34 | v: A;
35 | } & CmdCommon;
36 | export declare type Mode = "edit" | "view";
37 | export declare type Context = {
38 | logic_frame: number;
39 | force_reload: (callback?: () => void) => C;
40 | current_page: C;
41 | set_page: (x: T, new_page: Route, callback?: () => void) => C;
42 | set_url: (x: T, new_url: Url, callback?: () => void) => C;
43 | push_route: (new_route: Route<{}>, callback?: () => void) => C;
44 | set_routes: (routes: Array>, callback?: () => void) => C;
45 | };
46 | export declare type Cont = (callback: () => void) => (_: A) => void;
47 | export declare type C = {
48 | comp: (ctxt: () => Context) => (cont: Cont) => JSX.Element;
49 | then: (key: string, k: (_: A) => C, className?: string, dbg?: () => string) => C;
50 | never: (key?: string) => C;
51 | ignore: (key?: string) => C;
52 | ignore_with: (x: B) => C;
53 | map: (f: (_: A) => B, key?: string, dbg?: () => string) => C;
54 | filter: (f: (_: A) => boolean, key?: string, dbg?: () => string) => C;
55 | };
56 | export declare function make_C(comp: (ctxt: () => Context) => (cont: Cont) => JSX.Element): C;
57 | export declare let unit: (x: A, key?: string, dbg?: () => string) => C;
58 | export declare type JoinProps = {
59 | p: C>;
60 | } & CmdCommon;
61 | export declare type JoinState = {
62 | p_inner: "waiting" | JSX.Element;
63 | p_outer: JSX.Element;
64 | };
65 | export declare let bind: (key: string, p: C, k: (_: A) => C, className?: string, dbg?: () => string) => C;
66 | export declare let map: (key?: string, dbg?: () => string) => (_: (_: A) => B) => (_: C) => C;
67 | export declare let filter: (key?: string, dbg?: () => string) => (_: (_: A) => boolean) => (_: C) => C;
68 | export declare let should_component_update: (key?: string, dbg?: () => string) => (_: (_: A) => boolean) => (_: (_: A) => C) => (_: A) => C;
69 | export declare type SimpleApplicationProps = {
70 | p: C;
71 | cont: (_: A) => void;
72 | };
73 | export declare type SimpleApplicationState = {
74 | context: Context;
75 | };
76 | export declare class SimpleApplication extends React.Component, SimpleApplicationState> {
77 | constructor(props: SimpleApplicationProps, context: any);
78 | context_from_props(props: SimpleApplicationProps, p: C): Context;
79 | render(): JSX.Element;
80 | }
81 | export declare let simple_application: (p: C, cont: (_: A) => void) => JSX.Element;
82 |
--------------------------------------------------------------------------------
/dist/react_monad/editable_list.d.ts:
--------------------------------------------------------------------------------
1 | import { List } from "immutable";
2 | import { C } from '../react_monad/core';
3 | export declare type EditableListState = {
4 | items: List;
5 | selected_index: undefined | number;
6 | };
7 | export declare type ListOperation = {
8 | kind: "add";
9 | value: A;
10 | } | {
11 | kind: "remove";
12 | value: A;
13 | index: number;
14 | } | {
15 | kind: "toggle";
16 | value: A;
17 | index: number;
18 | selected: boolean;
19 | };
20 | export declare let editable_list: (list_name: string, initial_items: C>, create_new_form: (_: EditableListState) => C) => C>;
21 |
--------------------------------------------------------------------------------
/dist/react_monad/forms.d.ts:
--------------------------------------------------------------------------------
1 | import * as Immutable from "immutable";
2 | import { C, Mode } from './core';
3 | import * as Moment from 'moment';
4 | export declare type FormErrors = {
5 | errors: Immutable.Map>;
6 | };
7 | export declare type FormData = {
8 | model: M;
9 | } & FormErrors;
10 | export declare type FormEntry = {
11 | kind: "string";
12 | field_name: string;
13 | in: (_: M) => string;
14 | out: (_: M) => (_: string) => M;
15 | get_errors: (_: M) => Array;
16 | } | {
17 | kind: "number";
18 | field_name: string;
19 | in: (_: M) => number;
20 | out: (_: M) => (_: number) => M;
21 | get_errors: (_: M) => Array;
22 | } | {
23 | kind: "date";
24 | field_name: string;
25 | in: (_: M) => Moment.Moment;
26 | out: (_: M) => (_: Moment.Moment) => M;
27 | get_errors: (_: M) => Array;
28 | } | {
29 | kind: "time";
30 | field_name: string;
31 | in: (_: M) => Moment.Moment;
32 | out: (_: M) => (_: Moment.Moment) => M;
33 | get_errors: (_: M) => Array;
34 | } | {
35 | kind: "datetime";
36 | field_name: string;
37 | in: (_: M) => Moment.Moment;
38 | out: (_: M) => (_: Moment.Moment) => M;
39 | get_errors: (_: M) => Array;
40 | } | {
41 | kind: "image";
42 | field_name: string;
43 | in: (_: M) => string;
44 | out: (_: M) => (_: string) => M;
45 | get_errors: (_: M) => Array;
46 | } | {
47 | kind: "file";
48 | field_name: string;
49 | filename: (_: M) => string;
50 | url: (_: M) => string;
51 | in: (_: M) => File;
52 | out: (_: M) => (_: File) => M;
53 | get_errors: (_: M) => Array;
54 | } | {
55 | kind: "lazy image";
56 | field_name: string;
57 | download: (c: M) => C;
58 | upload: (c: M) => (src: string) => C;
59 | } | {
60 | kind: "lazy file";
61 | field_name: string;
62 | filename: (_: M) => string;
63 | out: (_: M) => (_: File) => M;
64 | url: (_: M) => string;
65 | upload: (_: M) => (_: File) => C;
66 | };
67 | export declare let simple_inner_form: (mode: Mode, model_name: (_: M) => string, entries: FormEntry[]) => (_: FormData) => C>;
68 | export declare let form_errors: (model_name: (_: M) => string, entries: FormEntry[]) => (fd: FormData) => C>;
69 | export declare let simple_form_with_autosave: (mode: Mode, model_name: (_: M) => string, entries: FormEntry[], download_M: C, upload_M: (_: M) => C) => C;
70 | export declare let simple_form_with_save_button: (mode: Mode, model_name: (_: M) => string, entries: FormEntry[], download_M: C, upload_M: (_: M) => C) => C;
71 | export declare let simple_form_with_prev_and_next_buttons: (mode: Mode, model_name: (_: M) => string, entries: FormEntry[], prev_enabled: (_: FormData) => boolean, next_enabled: (_: FormData) => boolean, prev_visible: (_: FormData) => boolean, next_visible: (_: FormData) => boolean, on_prev: (_: M) => M, on_next: (_: M) => M) => (_: FormData) => C>;
72 |
--------------------------------------------------------------------------------
/dist/react_monad/html.d.ts:
--------------------------------------------------------------------------------
1 | import * as Immutable from "immutable";
2 | import { C, CmdCommon, Mode } from './core';
3 | export declare type H1Props = {
4 | kind: "h1";
5 | className: string | undefined;
6 | text: string;
7 | value: A;
8 | p: (_: A) => C;
9 | } & CmdCommon;
10 | export declare type H2Props = {
11 | kind: "h2";
12 | className: string | undefined;
13 | text: string;
14 | value: A;
15 | p: (_: A) => C;
16 | } & CmdCommon;
17 | export declare type LabelProps = {
18 | kind: "label";
19 | className: string | undefined;
20 | text: string;
21 | span_before_content: boolean;
22 | value: A;
23 | p: (_: A) => C;
24 | } & CmdCommon;
25 | export declare type DivProps = {
26 | kind: "div";
27 | className: string | undefined;
28 | value: A;
29 | p: (_: A) => C;
30 | } & CmdCommon;
31 | export declare type FormProps = {
32 | kind: "form";
33 | className: string | undefined;
34 | value: A;
35 | p: (_: A) => C;
36 | } & CmdCommon;
37 | export declare type MultiSelectorType = "list" | "checkbox";
38 | export declare type MultiSelectorProps = {
39 | kind: "multi selector";
40 | type: MultiSelectorType;
41 | to_string: (_: A) => string;
42 | items: Immutable.List;
43 | selected_items: undefined | Immutable.List;
44 | } & CmdCommon>;
45 | export declare type ImageProps = {
46 | kind: "image";
47 | src: string;
48 | mode: Mode;
49 | } & CmdCommon;
50 | export declare type SelectorType = "dropdown" | "radio";
51 | export declare type SelectorProps = {
52 | kind: "selector";
53 | type: SelectorType;
54 | to_string: (_: A) => string;
55 | items: Immutable.List;
56 | selected_item: undefined | A;
57 | } & CmdCommon;
58 | export declare type ButtonProps = {
59 | label: string;
60 | x: A;
61 | disabled: boolean;
62 | className: string;
63 | } & CmdCommon & ({
64 | kind: "button";
65 | } | {
66 | kind: "a";
67 | href: string;
68 | rel?: "nofollow";
69 | });
70 | export declare type LinkProps = {
71 | kind: "link";
72 | label: string;
73 | url: string;
74 | disabled: boolean;
75 | className: string;
76 | } & CmdCommon;
77 | export declare type FileProps = {
78 | kind: "file";
79 | label: string;
80 | url: string;
81 | mode: Mode;
82 | disabled: boolean;
83 | } & CmdCommon;
84 | export declare function label(text: string, span_before_content?: boolean, className?: string, key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
85 | export declare function h1(text: string, className?: string, key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
86 | export declare function h2(text: string, className?: string, key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
87 | export declare function div(className?: string, key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
88 | export declare function overlay(key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
89 | export declare function form(className?: string, key?: string, dbg?: () => string): (p: (_: A) => C) => ((_: A) => C);
90 | export declare let selector: (type: SelectorType, to_string: (_: A) => string, key?: string, dbg?: () => string) => (items: A[], selected_item?: A) => C;
91 | export declare let multi_selector: (type: MultiSelectorType, to_string: (_: A) => string, key?: string, dbg?: () => string) => (items: A[], selected_items?: A[]) => C;
92 | export declare let image: (mode: Mode, key?: string, dbg?: () => string) => (src: string) => C;
93 | export declare let a: (label: string, href?: string, rel?: "nofollow", disabled?: boolean, key?: string, className?: string, dbg?: () => string) => (x: A) => C;
94 | export declare let button: (label: string, disabled?: boolean, key?: string, className?: string, dbg?: () => string) => (x: A) => C;
95 | export declare let link: (label: string, url: string, disabled?: boolean, key?: string, className?: string, dbg?: () => string) => C;
96 | export declare let file: (mode: Mode, label: string, url: string, disabled?: boolean, key?: string, dbg?: () => string) => C;
97 |
--------------------------------------------------------------------------------
/dist/react_monad/list.d.ts:
--------------------------------------------------------------------------------
1 | import * as Immutable from "immutable";
2 | import { C } from '../react_monad/core';
3 | export declare let list: (items: Immutable.List, key?: string, className?: string, dbg?: () => string) => (renderer: (index: number) => (_: A) => C) => C;
4 |
--------------------------------------------------------------------------------
/dist/react_monad/option.d.ts:
--------------------------------------------------------------------------------
1 | export declare type Methods = {
2 | map: (f: (_: A) => B) => Option;
3 | };
4 | export declare type Option = ({
5 | kind: "none";
6 | } | {
7 | kind: "some";
8 | value: A;
9 | }) & Methods;
10 | export declare let none: () => Option;
11 | export declare let some: (x: A) => Option;
12 |
--------------------------------------------------------------------------------
/dist/react_monad/option.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.none = function () {
4 | return {
5 | kind: "none",
6 | map: function (f) { return map(f)(this); }
7 | };
8 | };
9 | exports.some = function (x) {
10 | return {
11 | kind: "some", value: x,
12 | map: function (f) { return map(f)(this); }
13 | };
14 | };
15 | var map = function (f) { return function (x) { return x.kind == "none" ? exports.none() : exports.some(f(x.value)); }; };
16 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JlYWN0X21vbmFkL29wdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdXLFFBQUEsSUFBSSxHQUFHO0lBQTRCLE9BQU87UUFDbkQsSUFBSSxFQUFDLE1BQU07UUFDWCxHQUFHLEVBQUMsVUFBNEIsQ0FBVSxJQUFHLE9BQU8sR0FBRyxDQUFNLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFBLENBQUMsQ0FBQztLQUFFLENBQUE7QUFDM0UsQ0FBQyxDQUFBO0FBQ1UsUUFBQSxJQUFJLEdBQUcsVUFBWSxDQUFHO0lBQWdCLE9BQU87UUFDdEQsSUFBSSxFQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUMsQ0FBQztRQUNwQixHQUFHLEVBQUMsVUFBNEIsQ0FBVSxJQUFHLE9BQU8sR0FBRyxDQUFNLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFBLENBQUMsQ0FBQztLQUFFLENBQUE7QUFBQyxDQUFDLENBQUE7QUFFN0UsSUFBSSxHQUFHLEdBQUcsVUFBYyxDQUFVLElBQWlDLE9BQU8sVUFBQSxDQUFDLElBQUksT0FBQSxDQUFDLENBQUMsSUFBSSxJQUFJLE1BQU0sQ0FBQyxDQUFDLENBQUMsWUFBSSxFQUFLLENBQUMsQ0FBQyxDQUFDLFlBQUksQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQWxELENBQWtELENBQUEsQ0FBQyxDQUFDLENBQUEifQ==
--------------------------------------------------------------------------------
/dist/react_monad/paginator.d.ts:
--------------------------------------------------------------------------------
1 | import { C } from '../react_monad/core';
2 | export declare type Page = {
3 | num_pages: number;
4 | page_index: number;
5 | items: A;
6 | };
7 | export declare let paginate: (items_per_page: number, get_page: (current_page: number, items_per_page: number) => C>, key?: string, dbg?: () => string) => (renderer: (items: A) => C) => C;
8 |
--------------------------------------------------------------------------------
/dist/react_monad/primitives.d.ts:
--------------------------------------------------------------------------------
1 | import * as Moment from 'moment';
2 | import { C, Mode, CmdCommon } from './core';
3 | export declare type OptionalParameters = {
4 | disabled?: boolean;
5 | size?: number;
6 | };
7 | export declare type NumberProps = {
8 | kind: "number";
9 | value: number;
10 | mode: Mode;
11 | } & CmdCommon;
12 | export declare type StringType = "email" | "tel" | "text" | "url" | "password";
13 | export declare type StringProps = {
14 | kind: "string";
15 | value: string;
16 | type: StringType;
17 | mode: Mode;
18 | optional_parameters: OptionalParameters;
19 | } & CmdCommon;
20 | export declare type BooleanStyle = "checkbox" | "fancy toggle" | "plus/minus" | "radio";
21 | export declare type BoolProps = {
22 | kind: "bool";
23 | value: boolean;
24 | mode: Mode;
25 | style: BooleanStyle;
26 | } & CmdCommon;
27 | export declare type DateProps = {
28 | kind: "date";
29 | value: Moment.Moment;
30 | mode: Mode;
31 | } & CmdCommon;
32 | export declare type DateTimeProps = {
33 | kind: "date time";
34 | value: Moment.Moment;
35 | mode: Mode;
36 | } & CmdCommon;
37 | export declare type TimeProps = {
38 | kind: "time";
39 | value: Moment.Moment;
40 | mode: Mode;
41 | } & CmdCommon;
42 | export declare let number: (mode: Mode, key?: string, dbg?: () => string) => (value: number) => C;
43 | export declare let string: (mode: Mode, type?: StringType, key?: string, dbg?: () => string, optional_parameters?: OptionalParameters) => (value: string) => C;
44 | export declare let bool: (mode: Mode, style: BooleanStyle, key?: string, dbg?: () => string) => (value: boolean) => C;
45 | export declare let date_time: (mode: Mode, key?: string, dbg?: () => string) => (value: Moment.Moment) => C;
46 | export declare let date: (mode: Mode, key?: string, dbg?: () => string) => (value: Moment.Moment) => C;
47 | export declare let time: (mode: Mode, key?: string, dbg?: () => string) => (value: Moment.Moment) => C;
48 |
--------------------------------------------------------------------------------
/dist/react_monad/rich_text.d.ts:
--------------------------------------------------------------------------------
1 | import { C, Mode } from './core';
2 | export declare type MediaType = 'image' | 'video' | 'youtube' | 'mathblock';
3 | export declare function rich_text(mode: Mode, key?: string, dbg?: () => string): (_: string) => C;
4 |
--------------------------------------------------------------------------------
/dist/react_monad/router.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import * as Immutable from "immutable";
3 | import * as Option from "./option";
4 | import { C, Mode, Context } from './core';
5 | export declare type UrlElement = string | {
6 | kind: "int";
7 | name: K;
8 | };
9 | export declare type UrlTemplate = Array>;
10 | export declare let parse_url: (template: UrlElement[]) => (url: string) => Option.Option;
11 | export declare let instantiate_url: (template: UrlElement[]) => (t: T) => string;
12 | export declare type Url = PartialRetraction;
13 | export declare let make_url: (template: UrlElement[]) => PartialRetraction;
14 | export declare let fallback_url: () => PartialRetraction;
15 | export declare type PartialRetraction = {
16 | in: (_: A) => Option.Option;
17 | out: (_: B) => A;
18 | };
19 | export declare type Route = {
20 | url: Url;
21 | page: (_: A) => C;
22 | };
23 | export declare type ApplicationProps = {
24 | mode: Mode;
25 | base_url: string;
26 | slug: string;
27 | routes: () => Promise>>;
28 | };
29 | export declare type ApplicationState = {
30 | kind: "loading routes";
31 | } | {
32 | kind: "running";
33 | context: Context;
34 | routes: Immutable.List>;
35 | };
36 | export declare class Application extends React.Component {
37 | constructor(props: ApplicationProps, context: any);
38 | load(): void;
39 | componentDidMount(): void;
40 | history: Immutable.Stack;
41 | context_from_props(props: ApplicationProps, p: C): Context;
42 | render(): JSX.Element;
43 | }
44 | export declare let application: (mode: Mode, base_url: string, slug: string, routes: () => Promise[]>) => JSX.Element;
45 | export declare let get_context: (key?: string, dbg?: () => string) => C;
46 | export declare let link_to_route: (label: string, x: T, r: Route, key?: string, className?: string) => C;
47 |
--------------------------------------------------------------------------------
/dist/react_monad/workflow.d.ts:
--------------------------------------------------------------------------------
1 | import { Map } from "immutable";
2 | import { C } from '../react_monad/core';
3 | export declare type WorkflowData = {
4 | model: M;
5 | step: S;
6 | };
7 | export declare let simple_workflow: (workflow_name: string, steps: Map) => C>>, initial_model: C, initial_step: S) => C;
8 |
--------------------------------------------------------------------------------
/dist/react_monad/workflow.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var core_1 = require("../react_monad/core");
4 | var combinators_1 = require("../react_monad/combinators");
5 | exports.simple_workflow = function (workflow_name, steps, initial_model, initial_step) {
6 | return initial_model.then(workflow_name + "_initial_binder", function (m) {
7 | return combinators_1.repeat(workflow_name + "_repeater")(function (cd) {
8 | return steps.has(cd.step) ?
9 | steps.get(cd.step)(cd)
10 | :
11 | core_1.unit(cd).filter(function (_) { return false; });
12 | })({ model: m, step: initial_step }).map(function (c) { return c.model; });
13 | });
14 | };
15 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2Zsb3cuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmVhY3RfbW9uYWQvd29ya2Zsb3cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFLQSw0Q0FBaUQ7QUFHakQsMERBQXlHO0FBSTlGLFFBQUEsZUFBZSxHQUFHLFVBQWMsYUFBb0IsRUFBRSxLQUFxRSxFQUFFLGFBQWtCLEVBQUUsWUFBYztJQUN4SyxPQUFPLGFBQWEsQ0FBQyxJQUFJLENBQUksYUFBYSxvQkFBaUIsRUFBRSxVQUFBLENBQUM7UUFDOUQsT0FBQSxvQkFBTSxDQUF1QixhQUFhLGNBQVcsQ0FBQyxDQUFDLFVBQUEsRUFBRTtZQUN2RCxPQUFBLEtBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7Z0JBQ2xCLEtBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQztnQkFDeEIsQ0FBQztvQkFDQyxXQUFJLENBQW9CLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxVQUFBLENBQUMsSUFBSSxPQUFBLEtBQUssRUFBTCxDQUFLLENBQUM7UUFIaEQsQ0FHZ0QsQ0FDakQsQ0FBQyxFQUFFLEtBQUssRUFBRSxDQUFDLEVBQUUsSUFBSSxFQUFDLFlBQVksRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFJLFVBQUEsQ0FBQyxJQUFJLE9BQUEsQ0FBQyxDQUFDLEtBQUssRUFBUCxDQUFPLENBQUM7SUFMdkQsQ0FLdUQsQ0FBQyxDQUFBO0FBQzFELENBQUMsQ0FBQSJ9
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | ///
2 | var gulp = require("gulp");
3 |
4 | // Plugins for CSS compoling
5 | var sass = require('gulp-sass'),
6 | autoprefixer = require('gulp-autoprefixer'),
7 | cleanCSS = require('gulp-clean-css'),
8 | rename = require('gulp-rename'),
9 | mmq = require('gulp-merge-media-queries');
10 |
11 | gulp.task("default", ['stylesheets', 'fonts', 'mathfonts']);
12 |
13 | // Compile Stylesheets
14 | gulp.task('stylesheets', function() {
15 | return gulp.src('./samples/Client/stylesheets/**/*.scss')
16 | .pipe(sass().on('error', sass.logError))
17 | .pipe(mmq({log: false}))
18 | .pipe(autoprefixer({browsers: ['> 2%', 'last 2 versions'], cascade: false}))
19 | .pipe(gulp.dest("./samples/wwwroot/css"))
20 | .pipe(rename({ suffix: '.min' }))
21 | .pipe(cleanCSS())
22 | .pipe(gulp.dest("./samples/wwwroot/css"))
23 | });
24 |
25 | // Compile fonts
26 | gulp.task('fonts', function() {
27 | return gulp.src('./Client/fonts/**/*')
28 | .pipe(gulp.dest("./samples/wwwroot/fonts"))
29 | });
30 |
31 | gulp.task('mathfonts', function() {
32 | return gulp.src('./node_modules/katex/dist/fonts/**/*')
33 | .pipe(gulp.dest("./samples/wwwroot/fonts"))
34 | });
35 |
36 | // Watch Stylesheets
37 | gulp.task('watch', function(callback) {
38 | gulp.watch('./Client/stylesheets/**/*.scss', ['stylesheets', 'fonts']);
39 | });
40 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "monadic_react",
3 | "version": "1.1.12",
4 | "description": "A monadic library for easily composing React-based libraries.",
5 | "main": "dist/monadic_react.js",
6 | "typings": "dist/monadic_react.d.ts",
7 | "typescript": {
8 | "definition": "dist/monadic_react.d.ts"
9 | },
10 | "scripts": {
11 | "pub": "cd src && ../node_modules/.bin/tsc && cd .. && npm publish",
12 | "be": "cd samples && ../node_modules/.bin/nodemon app.js",
13 | "fe": "./node_modules/.bin/webpack -w",
14 | "css": "./node_modules/.bin/gulp"
15 | },
16 | "dependencies": {
17 | "draft-js": "~0.10.0",
18 | "i18next": "7.1.3",
19 | "immutable": "3.8.1",
20 | "jquery-ujs": "1.2.1",
21 | "katex": "^0.8.1",
22 | "moment": "2.18.1",
23 | "slugify": "1.1.0",
24 | "whatwg-fetch": "2.0.2"
25 | },
26 | "peerDependencies": {
27 | "react": "^16.0.0",
28 | "react-dom": "^16.0.0"
29 | },
30 | "devDependencies": {
31 | "@types/draft-js": "^0.10.10",
32 | "@types/i18next": "2.3.35",
33 | "@types/katex": "^0.5.0",
34 | "@types/react": "^16.0.18",
35 | "@types/react-dom": "^16.0.2",
36 | "awesome-typescript-loader": "3.1.2",
37 | "babel-core": "6.22.1",
38 | "babel-loader": "6.2.10",
39 | "babel-plugin-transform-runtime": "6.22.0",
40 | "babel-polyfill": "6.22.0",
41 | "babel-preset-es2015": "6.22.0",
42 | "babel-preset-react": "6.22.0",
43 | "babel-preset-stage-0": "6.22.0",
44 | "babelify": "7.3.0",
45 | "browserify": "14.0.0",
46 | "del": "2.2.0",
47 | "express": "4.15.3",
48 | "gulp": "3.9.1",
49 | "gulp-autoprefixer": "4.0.0",
50 | "gulp-clean-css": "3.2.0",
51 | "gulp-merge-media-queries": "0.2.1",
52 | "gulp-rename": "1.2.2",
53 | "gulp-sass": "3.1.0",
54 | "nodemon": "1.11.0",
55 | "source-map-loader": "0.1.6",
56 | "typescript": "^2.4.2",
57 | "webpack": "2.3.2"
58 | },
59 | "author": "Giuseppe Maggiore",
60 | "license": "MIT"
61 | }
--------------------------------------------------------------------------------
/samples/Client/app.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | function __export(m) {
3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4 | }
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | require("babel-polyfill");
7 | __export(require("./homepage"));
8 | //# sourceMappingURL=app.js.map
--------------------------------------------------------------------------------
/samples/Client/app.ts:
--------------------------------------------------------------------------------
1 | import 'babel-polyfill'
2 | export * from './homepage'
3 |
--------------------------------------------------------------------------------
/samples/Client/fonts/icomoon/Read Me.txt:
--------------------------------------------------------------------------------
1 | Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures.
2 |
3 | To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts
4 |
5 | You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects.
6 |
7 | You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection.
8 |
--------------------------------------------------------------------------------
/samples/Client/fonts/icomoon/demo-files/demo.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0;
3 | margin: 0;
4 | font-family: sans-serif;
5 | font-size: 1em;
6 | line-height: 1.5;
7 | color: #555;
8 | background: #fff;
9 | }
10 | h1 {
11 | font-size: 1.5em;
12 | font-weight: normal;
13 | }
14 | small {
15 | font-size: .66666667em;
16 | }
17 | a {
18 | color: #e74c3c;
19 | text-decoration: none;
20 | }
21 | a:hover, a:focus {
22 | box-shadow: 0 1px #e74c3c;
23 | }
24 | .bshadow0, input {
25 | box-shadow: inset 0 -2px #e7e7e7;
26 | }
27 | input:hover {
28 | box-shadow: inset 0 -2px #ccc;
29 | }
30 | input, fieldset {
31 | font-family: sans-serif;
32 | font-size: 1em;
33 | margin: 0;
34 | padding: 0;
35 | border: 0;
36 | }
37 | input {
38 | color: inherit;
39 | line-height: 1.5;
40 | height: 1.5em;
41 | padding: .25em 0;
42 | }
43 | input:focus {
44 | outline: none;
45 | box-shadow: inset 0 -2px #449fdb;
46 | }
47 | .glyph {
48 | font-size: 16px;
49 | width: 15em;
50 | padding-bottom: 1em;
51 | margin-right: 4em;
52 | margin-bottom: 1em;
53 | float: left;
54 | overflow: hidden;
55 | }
56 | .liga {
57 | width: 80%;
58 | width: calc(100% - 2.5em);
59 | }
60 | .talign-right {
61 | text-align: right;
62 | }
63 | .talign-center {
64 | text-align: center;
65 | }
66 | .bgc1 {
67 | background: #f1f1f1;
68 | }
69 | .fgc1 {
70 | color: #999;
71 | }
72 | .fgc0 {
73 | color: #000;
74 | }
75 | p {
76 | margin-top: 1em;
77 | margin-bottom: 1em;
78 | }
79 | .mvm {
80 | margin-top: .75em;
81 | margin-bottom: .75em;
82 | }
83 | .mtn {
84 | margin-top: 0;
85 | }
86 | .mtl, .mal {
87 | margin-top: 1.5em;
88 | }
89 | .mbl, .mal {
90 | margin-bottom: 1.5em;
91 | }
92 | .mal, .mhl {
93 | margin-left: 1.5em;
94 | margin-right: 1.5em;
95 | }
96 | .mhmm {
97 | margin-left: 1em;
98 | margin-right: 1em;
99 | }
100 | .mls {
101 | margin-left: .25em;
102 | }
103 | .ptl {
104 | padding-top: 1.5em;
105 | }
106 | .pbs, .pvs {
107 | padding-bottom: .25em;
108 | }
109 | .pvs, .pts {
110 | padding-top: .25em;
111 | }
112 | .unit {
113 | float: left;
114 | }
115 | .unitRight {
116 | float: right;
117 | }
118 | .size1of2 {
119 | width: 50%;
120 | }
121 | .size1of1 {
122 | width: 100%;
123 | }
124 | .clearfix:before, .clearfix:after {
125 | content: " ";
126 | display: table;
127 | }
128 | .clearfix:after {
129 | clear: both;
130 | }
131 | .hidden-true {
132 | display: none;
133 | }
134 | .textbox0 {
135 | width: 3em;
136 | background: #f1f1f1;
137 | padding: .25em .5em;
138 | line-height: 1.5;
139 | height: 1.5em;
140 | }
141 | #testDrive {
142 | display: block;
143 | padding-top: 24px;
144 | line-height: 1.5;
145 | }
146 | .fs0 {
147 | font-size: 16px;
148 | }
149 | .fs1 {
150 | font-size: 32px;
151 | }
152 | .fs2 {
153 | font-size: 20px;
154 | }
155 |
156 |
--------------------------------------------------------------------------------
/samples/Client/fonts/icomoon/fonts/icomoon.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoppinger/MonadicReact/1f846494caff33ccd64b89f59a254f231370c351/samples/Client/fonts/icomoon/fonts/icomoon.ttf
--------------------------------------------------------------------------------
/samples/Client/fonts/icomoon/fonts/icomoon.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoppinger/MonadicReact/1f846494caff33ccd64b89f59a254f231370c351/samples/Client/fonts/icomoon/fonts/icomoon.woff
--------------------------------------------------------------------------------
/samples/Client/fonts/icomoon/variables.scss:
--------------------------------------------------------------------------------
1 | $icomoon-font-path: "fonts" !default;
2 |
3 | $icon-code: "\e937";
4 | $icon-eye: "\e936";
5 | $icon-minus: "\e935";
6 | $icon-warning: "\e904";
7 | $icon-users: "\e906";
8 | $icon-user: "\e907";
9 | $icon-upload: "\e908";
10 | $icon-underline: "\e90a";
11 | $icon-text-size: "\e90b";
12 | $icon-sync: "\e90c";
13 | $icon-text-align-center: "\e90d";
14 | $icon-text-align-justify: "\e90e";
15 | $icon-text-align-left: "\e90f";
16 | $icon-text-align-right: "\e910";
17 | $icon-text-format-remove: "\e911";
18 | $icon-sort-alpha-asc: "\e912";
19 | $icon-printer: "\e913";
20 | $icon-bold: "\e92d";
21 | $icon-italic: "\e91c";
22 | $icon-undo: "\e909";
23 | $icon-redo: "\e914";
24 | $icon-pencil: "\e916";
25 | $icon-map-marker: "\e917";
26 | $icon-magnifier: "\e918";
27 | $icon-line-spacing: "\e919";
28 | $icon-ol: "\e938";
29 | $icon-list: "\e91a";
30 | $icon-lock: "\e91b";
31 | $icon-indent-decrease: "\e91d";
32 | $icon-indent-increase: "\e91e";
33 | $icon-heart: "\e91f";
34 | $icon-home: "\e920";
35 | $icon-calendar-full: "\e929";
36 | $icon-alarm: "\e932";
37 | $icon-camera-video: "\e92a";
38 | $icon-picture: "\e915";
39 | $icon-camera: "\e92b";
40 | $icon-cart: "\e92c";
41 | $icon-funnel: "\e921";
42 | $icon-download: "\e922";
43 | $icon-cross: "\e923";
44 | $icon-plus: "\e934";
45 | $icon-crop: "\e924";
46 | $icon-chevron-down: "\e925";
47 | $icon-chevron-left: "\e926";
48 | $icon-chevron-right: "\e927";
49 | $icon-chevron-up: "\e928";
50 | $icon-arrow-down: "\e92e";
51 | $icon-arrow-left: "\e92f";
52 | $icon-arrow-right: "\e930";
53 | $icon-arrow-up: "\e931";
54 | $icon-move: "\e933";
55 | $icon-fullscreen: "\e905";
56 | $icon-link: "\e902";
57 | $icon-unlink: "\e903";
58 | $icon-trash: "\e901";
59 | $icon-settings: "\e900";
60 | $icon-sigma: "\e93c";
61 | $icon-latex: "\e93c";
62 | $icon-h1: "\e93a";
63 | $icon-h2: "\e93b";
64 | $icon-h3: "\e93d";
65 | $icon-quote: "\e939";
66 |
67 |
--------------------------------------------------------------------------------
/samples/Client/generated_api.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | let Items = [
4 | { Id: 1, Name: "TestCourse", Points: 1 },
5 | { Id: 2, Name: "Course 2", Points: 10 },
6 | { Id: 3, Name: "Third test", Points: 15 },
7 | ];
8 | function get_Course(id) {
9 | let course = Items.filter(x => x.Id == id);
10 | return Promise.resolve({
11 | Item: course.length > 0 ? course[0] : null
12 | });
13 | }
14 | exports.get_Course = get_Course;
15 | function update_Course(c) {
16 | let courseIndex = Items.findIndex(x => x.Id == c.Id);
17 | if (courseIndex != -1) {
18 | Items[courseIndex] = c;
19 | }
20 | return Promise.resolve(null);
21 | }
22 | exports.update_Course = update_Course;
23 | //# sourceMappingURL=generated_api.js.map
--------------------------------------------------------------------------------
/samples/Client/generated_api.ts:
--------------------------------------------------------------------------------
1 | import * as Models from "./generated_models"
2 |
3 | let Items = [
4 | { Id: 1, Name: "TestCourse", Points: 1 },
5 | { Id: 2, Name: "Course 2", Points: 10 },
6 | { Id: 3, Name: "Third test", Points: 15 },
7 | ]
8 |
9 | type CourseItem = {
10 | Item: Models.Course
11 | }
12 |
13 | export function get_Course(id:number):Promise {
14 | let course = Items.filter(x => x.Id == id);
15 | return Promise.resolve({
16 | Item: course.length > 0 ? course[0] : null
17 | })
18 | }
19 |
20 | export function update_Course(c:Models.Course):Promise {
21 | let courseIndex = Items.findIndex(x => x.Id == c.Id);
22 |
23 | if(courseIndex != -1) {
24 | Items[courseIndex] = c;
25 | }
26 | return Promise.resolve(null)
27 | }
--------------------------------------------------------------------------------
/samples/Client/generated_models.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | //# sourceMappingURL=generated_models.js.map
--------------------------------------------------------------------------------
/samples/Client/generated_models.ts:
--------------------------------------------------------------------------------
1 | export type Course = {
2 | Id: number,
3 | Name: string,
4 | Points: number
5 | }
--------------------------------------------------------------------------------
/samples/Client/samples/button.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const monadic_react_1 = require("../../../src/monadic_react");
4 | exports.button_sample = monadic_react_1.repeat(`input number`)(n => monadic_react_1.label("Insert an even number: ", true)(n => monadic_react_1.number("edit", "number")(n))(n))(0).then(`input number bind`, n => monadic_react_1.button(`Send ${n.toString()} further`, n % 2 != 0)(n).filter(n => n % 2 == 0).map(n => `Your selection is ${n.toString()}`).then(`button to string`, s => monadic_react_1.string("view")(s).ignore()));
5 | //# sourceMappingURL=button.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/button.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set} from "immutable"
4 | import * as Immutable from "immutable"
5 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
6 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
7 | custom, repeat, all, any, lift_promise, retract, delay,
8 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
9 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
10 |
11 | type FictionalPage = { title:string, content:string }
12 |
13 | export let button_sample : C =
14 | repeat(`input number`)(n =>
15 | label("Insert an even number: ", true)(n =>
16 | number("edit", "number")(n))(n))(0).then(`input number bind`, n =>
17 | button(`Send ${n.toString()} further`, n % 2 != 0)(n).filter(n => n % 2 == 0).map(n =>
18 | `Your selection is ${n.toString()}`).then(`button to string`, s =>
19 | string("view")(s).ignore()))
20 |
--------------------------------------------------------------------------------
/samples/Client/samples/context.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const monadic_react_1 = require("../../../src/monadic_react");
4 | exports.context_sample = monadic_react_1.any()([
5 | _ => monadic_react_1.button(`Force reload`)(null).then(undefined, _ => monadic_react_1.get_context().then(undefined, ctxt => ctxt.force_reload())),
6 | ])(null).then(`context sample`, _ => monadic_react_1.get_context().then(undefined, ctxt => monadic_react_1.string("view")(`Context: ${JSON.stringify(ctxt)}`).ignore()));
7 | //# sourceMappingURL=context.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/context.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set} from "immutable"
4 | import * as Immutable from "immutable"
5 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
6 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
7 | custom, repeat, all, any, lift_promise, retract, delay,
8 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
9 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
10 |
11 | export let context_sample : C =
12 | any()([
13 | _ => button(`Force reload`)(null).then(undefined, _ =>
14 | get_context().then(undefined, ctxt =>
15 | ctxt.force_reload())),
16 | ])(null).then(`context sample`, _ =>
17 | get_context().then(undefined, ctxt =>
18 | string("view")(`Context: ${JSON.stringify(ctxt)}`).ignore()))
19 |
--------------------------------------------------------------------------------
/samples/Client/samples/delay_wait.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const monadic_react_1 = require("../../../src/monadic_react");
4 | exports.delay_wait = monadic_react_1.delay(2000)(monadic_react_1.repeat()(monadic_react_1.string('edit', 'text')))("").then('forget', _ => monadic_react_1.unit(null));
5 | //# sourceMappingURL=delay_wait.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/delay_wait.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set} from "immutable"
4 | import * as Immutable from "immutable"
5 | import * as Moment from 'moment'
6 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
7 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
8 | custom, repeat, all, any, lift_promise, retract, delay, waiting,
9 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
10 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
11 |
12 |
13 | let delay_example: C =
14 | repeat('repeat_delay')(
15 | string('edit','text')
16 | )("")
17 | .then('pass-delayed',delay(5000)(
18 | label("This is the last thing you have chosen: ",true,'final delay choice')(string('view','text','delayed-string'))
19 | //s => button(s,false)(s)
20 | )
21 | ).never('lose_delay')
22 |
23 | let wait_example: C =
24 | any('any_waiting')(
25 | ["A","B","C","D"].map( (s) =>
26 | _ => button(s,false,s)(s)
27 | )
28 | )("")
29 | .then('pass-waited',waiting(5000)(
30 | label("This is the last thing you have chosen: ",true,'final delay choice')(string('view','text','waited-string'))
31 | //s => button(s,false)(s)
32 | )
33 | ).never('lose_wait')
34 |
35 | export let delay_wait = any()([
36 | label('Delay:',true,'delay')(_ => delay_example),
37 | label('Wait:',true,'wait')(_ => wait_example)
38 | ])(null)
--------------------------------------------------------------------------------
/samples/Client/samples/editable_list.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const immutable_1 = require("immutable");
4 | const monadic_react_1 = require("../../../src/monadic_react");
5 | exports.editable_list_sample = monadic_react_1.editable_list(`editable-number-list`, monadic_react_1.unit(immutable_1.Range(1, 5).toList()), s => monadic_react_1.button(`+`)(s.items.max() + 1)).then(`editable number list container`, s => monadic_react_1.string("view")(`The selected item is ${s.items.get(s.selected_index)}`).ignore());
6 | //# sourceMappingURL=editable_list.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/editable_list.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set, Range} from "immutable"
4 | import * as Immutable from "immutable"
5 | import * as Moment from 'moment'
6 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
7 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
8 | custom, repeat, all, any, lift_promise, retract, delay,
9 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
10 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
11 |
12 | export let editable_list_sample : C =
13 | editable_list(`editable-number-list`, unit(Range(1,5).toList()),
14 | s => button(`+`)(s.items.max() + 1)).then(`editable number list container`, s =>
15 | string("view")(`The selected item is ${s.items.get(s.selected_index)}`).ignore())
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/Client/samples/label.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const monadic_react_1 = require("../../../src/monadic_react");
4 | exports.label_sample = monadic_react_1.repeat(`input number`)(n => monadic_react_1.label("Insert a number: ", true)(n => monadic_react_1.number("edit", "number")(n))(n))(0).then(`input number bind`, c => monadic_react_1.string("view", "text", "view")(`Your selection is ${c.toString()}`).ignore());
5 | //# sourceMappingURL=label.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/label.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set} from "immutable"
4 | import * as Immutable from "immutable"
5 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
6 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
7 | custom, repeat, all, any, lift_promise, retract, delay,
8 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
9 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
10 |
11 | export let label_sample : C =
12 | repeat(`input number`)(n =>
13 | label("Insert a number: ", true)(n =>
14 | number("edit", "number")(n))(n))(0).then(`input number bind`, c =>
15 | string("view", "text", "view")(`Your selection is ${c.toString()}`).ignore())
16 |
--------------------------------------------------------------------------------
/samples/Client/samples/link.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const monadic_react_1 = require("../../../src/monadic_react");
4 | exports.link_sample = monadic_react_1.any(`link sample`)([
5 | _ => monadic_react_1.link(`Google`, "https://www.google.com", false, "google"),
6 | _ => monadic_react_1.link(`Facebook`, "https://www.facebook.com", false, "facebook"),
7 | _ => monadic_react_1.link(`Hoppinger`, "https://www.hoppinger.com", false, "hoppinger")
8 | ])(null);
9 | //# sourceMappingURL=link.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/link.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set} from "immutable"
4 | import * as Immutable from "immutable"
5 | import * as Moment from 'moment'
6 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
7 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
8 | custom, repeat, all, any, lift_promise, retract, delay,
9 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
10 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
11 |
12 | export let link_sample : C =
13 | any(`link sample`)([
14 | _ => link(`Google`, "https://www.google.com", false, "google"),
15 | _ => link(`Facebook`, "https://www.facebook.com", false, "facebook"),
16 | _ => link(`Hoppinger`, "https://www.hoppinger.com", false, "hoppinger")
17 | ])(null)
18 |
--------------------------------------------------------------------------------
/samples/Client/samples/list.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | const immutable_1 = require("immutable");
4 | const monadic_react_1 = require("../../../src/monadic_react");
5 | exports.list_sample = monadic_react_1.list(immutable_1.Range(1, 10).toList(), `list sample`)(i => n => monadic_react_1.string("view", "text", `item-${i}-${n}`)(`This is item ${i}/${n}`).ignore(`ignore-${i}-${n}`));
6 | //# sourceMappingURL=list.js.map
--------------------------------------------------------------------------------
/samples/Client/samples/list.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ReactDOM from "react-dom"
3 | import {List, Map, Set, Range} from "immutable"
4 | import * as Immutable from "immutable"
5 | import * as Moment from 'moment'
6 | import {UrlTemplate, application, get_context, Route, Url, make_url, fallback_url, link_to_route,
7 | Option, C, Mode, unit, bind, string, number, bool, button, selector, multi_selector, label, h1, h2, div, form, image, link, file, overlay,
8 | custom, repeat, all, any, lift_promise, retract, delay,
9 | simple_menu, mk_menu_entry, mk_submenu_entry, MenuEntry, MenuEntryValue, MenuEntrySubMenu,
10 | rich_text, paginate, Page, list, editable_list} from '../../../src/monadic_react'
11 |
12 | export let list_sample : C