@quenk/frontend 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +19 -0
  2. package/lib/app/display.d.ts +140 -0
  3. package/lib/app/display.js +167 -0
  4. package/lib/app/display.js.map +1 -0
  5. package/lib/app/index.d.ts +26 -0
  6. package/lib/app/index.js +29 -0
  7. package/lib/app/index.js.map +1 -0
  8. package/lib/app/model/http.d.ts +147 -0
  9. package/lib/app/model/http.js +184 -0
  10. package/lib/app/model/http.js.map +1 -0
  11. package/lib/app/model/index.d.ts +36 -0
  12. package/lib/app/model/index.js +3 -0
  13. package/lib/app/model/index.js.map +1 -0
  14. package/lib/app/router/hash.d.ts +143 -0
  15. package/lib/app/router/hash.js +178 -0
  16. package/lib/app/router/hash.js.map +1 -0
  17. package/lib/app/router/index.d.ts +49 -0
  18. package/lib/app/router/index.js +3 -0
  19. package/lib/app/router/index.js.map +1 -0
  20. package/lib/app/scene/dialog/alert.d.ts +13 -0
  21. package/lib/app/scene/dialog/alert.js +18 -0
  22. package/lib/app/scene/dialog/alert.js.map +1 -0
  23. package/lib/app/scene/dialog/confirm.d.ts +39 -0
  24. package/lib/app/scene/dialog/confirm.js +36 -0
  25. package/lib/app/scene/dialog/confirm.js.map +1 -0
  26. package/lib/app/scene/dialog/index.d.ts +65 -0
  27. package/lib/app/scene/dialog/index.js +71 -0
  28. package/lib/app/scene/dialog/index.js.map +1 -0
  29. package/lib/app/scene/director.d.ts +90 -0
  30. package/lib/app/scene/director.js +111 -0
  31. package/lib/app/scene/director.js.map +1 -0
  32. package/lib/app/scene/index.d.ts +66 -0
  33. package/lib/app/scene/index.js +50 -0
  34. package/lib/app/scene/index.js.map +1 -0
  35. package/lib/app/search/filters.d.ts +258 -0
  36. package/lib/app/search/filters.js +372 -0
  37. package/lib/app/search/filters.js.map +1 -0
  38. package/package.json +35 -0
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleHttpModel = exports.HttpModel = exports.RequestFactory = exports.NO_PATH = void 0;
4
+ const status = require("@quenk/jhr/lib/status");
5
+ const future_1 = require("@quenk/noni/lib/control/monad/future");
6
+ const maybe_1 = require("@quenk/noni/lib/data/maybe");
7
+ const string_1 = require("@quenk/noni/lib/data/string");
8
+ const record_1 = require("@quenk/noni/lib/data/record");
9
+ const type_1 = require("@quenk/noni/lib/data/type");
10
+ const request_1 = require("@quenk/jhr/lib/request");
11
+ exports.NO_PATH = '?invalid?';
12
+ /**
13
+ * RequestFactory generates request objects with paths from the provided
14
+ * Paths object.
15
+ *
16
+ * A set of internal rules are used for each operation to determine the path.
17
+ * This helps reduce the amount of paths that need to be supplied by re-using
18
+ * the "search" path for "create" etc.
19
+ */
20
+ class RequestFactory {
21
+ constructor(paths = {}) {
22
+ this.paths = paths;
23
+ }
24
+ /**
25
+ * create generates a request for the model "create" method.
26
+ */
27
+ create(data) {
28
+ return new request_1.Post(this.paths.create || this.paths.search || exports.NO_PATH, data, {
29
+ tags: {
30
+ path: this.paths.create || this.paths.get || exports.NO_PATH,
31
+ verb: 'post',
32
+ method: 'create'
33
+ }
34
+ });
35
+ }
36
+ /**
37
+ * search generates a request for the model "search" method.
38
+ */
39
+ search(qry) {
40
+ return new request_1.Get(this.paths.search || exports.NO_PATH, qry, {
41
+ tags: (0, record_1.merge)((0, type_1.isObject)(qry.$tags) ? qry.$tags : {}, {
42
+ path: this.paths.search,
43
+ verb: 'get',
44
+ method: 'search'
45
+ })
46
+ });
47
+ }
48
+ /**
49
+ * update generates a request for the model "update" method.
50
+ */
51
+ update(id, changes) {
52
+ return new request_1.Patch((0, string_1.interpolate)(this.paths.update ||
53
+ this.paths.get ||
54
+ exports.NO_PATH, { id }), changes, {
55
+ tags: {
56
+ path: this.paths.update,
57
+ verb: 'patch',
58
+ method: 'update'
59
+ }
60
+ });
61
+ }
62
+ /**
63
+ * get generates a request for the model "get" method.
64
+ */
65
+ get(id) {
66
+ return new request_1.Get((0, string_1.interpolate)(this.paths.get || exports.NO_PATH, { id }), {}, {
67
+ tags: {
68
+ path: this.paths.get,
69
+ verb: 'get',
70
+ method: 'get'
71
+ }
72
+ });
73
+ }
74
+ /**
75
+ * remove generates a request for the model "remove" method.
76
+ */
77
+ remove(id) {
78
+ return new request_1.Delete((0, string_1.interpolate)(this.paths.remove ||
79
+ this.paths.get ||
80
+ exports.NO_PATH, { id }), {}, {
81
+ tags: {
82
+ path: this.paths.remove,
83
+ verb: 'delete',
84
+ method: 'remove'
85
+ }
86
+ });
87
+ }
88
+ }
89
+ exports.RequestFactory = RequestFactory;
90
+ const errors = {
91
+ [status.BAD_REQUEST]: 'BADREQUEST',
92
+ [status.UNAUTHORIZED]: 'UNAUTHORIZED',
93
+ [status.FORBIDDEN]: 'FORBIDDEN',
94
+ [status.CONFLICT]: 'CONFLICT',
95
+ 'other': 'UNEXPECTED_STATUS'
96
+ };
97
+ const response2Error = (r) => new Error(errors[r.code] || errors.other);
98
+ /**
99
+ * HttpModel is an abstract implementation of a Model class that uses http
100
+ * for CSUGR operations.
101
+ *
102
+ * To use send requests via jhr directly, use the child class in this module,
103
+ * to utilize a Remote actor, see the RemoteModel implementation elsewhere.
104
+ */
105
+ class HttpModel {
106
+ create(data) {
107
+ let that = this;
108
+ return (0, future_1.doFuture)(function* () {
109
+ let res = yield that.send(that.requests.create(data));
110
+ if (res.code !== status.CREATED)
111
+ return (0, future_1.raise)(response2Error(res));
112
+ return (0, future_1.pure)(res.body.data.id);
113
+ });
114
+ }
115
+ search(qry) {
116
+ let that = this;
117
+ return (0, future_1.doFuture)(function* () {
118
+ let res = yield that.send(that.requests.search(qry));
119
+ if ((res.code !== status.OK) && (res.code !== status.NO_CONTENT))
120
+ return (0, future_1.raise)(response2Error(res));
121
+ return (0, future_1.pure)((res.code === status.NO_CONTENT) ?
122
+ []
123
+ : res.body.data);
124
+ });
125
+ }
126
+ update(id, changes) {
127
+ let that = this;
128
+ return (0, future_1.doFuture)(function* () {
129
+ let res = yield that.send(that.requests.update(id, changes));
130
+ if (res.code === status.NOT_FOUND)
131
+ return (0, future_1.pure)(false);
132
+ if (res.code !== status.OK)
133
+ return (0, future_1.raise)(response2Error(res));
134
+ return (0, future_1.pure)(true);
135
+ });
136
+ }
137
+ get(id) {
138
+ let that = this;
139
+ return (0, future_1.doFuture)(function* () {
140
+ let res = yield that.send(that.requests.get(id));
141
+ if (res.code === status.NOT_FOUND)
142
+ return (0, future_1.pure)((0, maybe_1.nothing)());
143
+ if (res.code !== status.OK)
144
+ return (0, future_1.raise)(response2Error(res));
145
+ return (0, future_1.pure)((0, maybe_1.fromNullable)(res.body));
146
+ });
147
+ }
148
+ remove(id) {
149
+ let that = this;
150
+ return (0, future_1.doFuture)(function* () {
151
+ let res = yield that.send(that.requests.remove(id));
152
+ if (res.code !== status.OK)
153
+ return (0, future_1.raise)(response2Error(res));
154
+ return (0, future_1.pure)(true);
155
+ });
156
+ }
157
+ }
158
+ exports.HttpModel = HttpModel;
159
+ /**
160
+ * SimpleHttpModel is an HttpModel that uses the JHR lib directly.
161
+ *
162
+ * There is no intermediate transformations or interception other than what
163
+ * the jhr agent is configured for. Use this in smaller, less complicated apps
164
+ * where these abstraction are not needed. See the RemoteModel class if you
165
+ * need something more complicated.
166
+ */
167
+ class SimpleHttpModel extends HttpModel {
168
+ constructor(agent, requests) {
169
+ super();
170
+ this.agent = agent;
171
+ this.requests = requests;
172
+ }
173
+ /**
174
+ * fromPaths generates a new HttpModel using Paths object.
175
+ */
176
+ static fromPaths(agent, paths) {
177
+ return new SimpleHttpModel(agent, new RequestFactory(paths));
178
+ }
179
+ send(req) {
180
+ return this.agent.send(req);
181
+ }
182
+ }
183
+ exports.SimpleHttpModel = SimpleHttpModel;
184
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/app/model/http.ts"],"names":[],"mappings":";;;AAAA,gDAA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AAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;YAEnD,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE;gBAAE,OAAO,IAAA,cAAK,EAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YAE9D,OAAO,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;QAEtB,CAAC,CAAC,CAAC;IAEP,CAAC;CAEJ;AArGD,8BAqGC;AAED;;;;;;;GAOG;AACH,MAAa,eAAkC,SAAQ,SAAY;IAE/D,YACW,KAA4B,EAC5B,QAAwB;QAAI,KAAK,EAAE,CAAC;QADpC,UAAK,GAAL,KAAK,CAAuB;QAC5B,aAAQ,GAAR,QAAQ,CAAgB;IAAa,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,KAA4B,EAAE,KAAY;QAEvD,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAEjE,CAAC;IAED,IAAI,CAAC,GAAoB;QAErB,OAA4C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAErE,CAAC;CAEJ;AArBD,0CAqBC"}
@@ -0,0 +1,36 @@
1
+ import { Object } from '@quenk/noni/lib/data/jsonx';
2
+ import { Maybe } from '@quenk/noni/lib/data/maybe';
3
+ import { Future } from '@quenk/noni/lib/control/monad/future';
4
+ /**
5
+ * Id is a valid unique identifier for a single record.
6
+ */
7
+ export type Id = string | number;
8
+ /**
9
+ * Model is an interface for preforming CSUGR operations on a data
10
+ * type found in the application we are interested in persisting.
11
+ *
12
+ * Actual implementations may manipulate data stored on the client side or
13
+ * a remote endpoint.
14
+ */
15
+ export interface Model<T extends Object> {
16
+ /**
17
+ * create a new entry for the data type.
18
+ */
19
+ create(data: T): Future<Id>;
20
+ /**
21
+ * search for entries that match the specified query criteria.
22
+ */
23
+ search(qry: Object): Future<T[]>;
24
+ /**
25
+ * update a single entry with the data provided.
26
+ */
27
+ update(id: Id, changes: Partial<T>): Future<boolean>;
28
+ /**
29
+ * get a single entry using its id.
30
+ */
31
+ get(id: Id): Future<Maybe<T>>;
32
+ /**
33
+ * remove a single entry using its id
34
+ */
35
+ remove(id: Id): Future<boolean>;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/model/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,143 @@
1
+ import * as router from './';
2
+ import { Key } from 'path-to-regexp';
3
+ import { Object as JObject } from '@quenk/noni/lib/data/json';
4
+ import { Future } from '@quenk/noni/lib/control/monad/future';
5
+ /**
6
+ * Path type alias.
7
+ */
8
+ export type Path = string;
9
+ /**
10
+ * Query type alias.
11
+ */
12
+ export type Query = JObject;
13
+ /**
14
+ * Params
15
+ */
16
+ export type Params = JObject;
17
+ /**
18
+ * Filter type.
19
+ */
20
+ export type Filter<R extends Request> = router.Filter<R>;
21
+ /**
22
+ * Handler type.
23
+ */
24
+ export type Handler<R extends Request> = router.Handler<R>;
25
+ /**
26
+ * OnError type.
27
+ */
28
+ export type OnError = (e: Error) => Future<void>;
29
+ /**
30
+ * OnNotFound type.
31
+ */
32
+ export type OnNotFound = (path: Path) => Future<void>;
33
+ /**
34
+ * Routes table.
35
+ */
36
+ export interface Routes<R extends Request> {
37
+ [key: string]: [Filter<R>[], Handler<R>];
38
+ }
39
+ /**
40
+ * Request interface.
41
+ */
42
+ export interface Request {
43
+ /**
44
+ * path requested
45
+ */
46
+ path: Path;
47
+ /**
48
+ * query data.
49
+ */
50
+ query: Query;
51
+ /**
52
+ * params data.
53
+ */
54
+ params: Params;
55
+ }
56
+ /**
57
+ * Cache used internally by the Router.
58
+ * @private
59
+ */
60
+ export declare class Cache<R extends Request> {
61
+ regex: RegExp;
62
+ keys: Key[];
63
+ filters: Filter<R>[];
64
+ handler: Handler<R>;
65
+ constructor(regex: RegExp, keys: Key[], filters: Filter<R>[], handler: Handler<R>);
66
+ }
67
+ /**
68
+ * AbstractHashRouter implementation based on the value of window.location.hash.
69
+ */
70
+ export declare abstract class AbstractHashRouter<R extends Request> implements router.Router<R> {
71
+ window: Window;
72
+ routes: Routes<R>;
73
+ constructor(window: Window, routes?: Routes<R>);
74
+ cache: Cache<R>[];
75
+ keys: Object[];
76
+ /**
77
+ * createRequest is a constructor for new Request instances.
78
+ */
79
+ abstract createRequest(path: Path, query: Query, params: Params): Future<R>;
80
+ /**
81
+ * onError is invoked when an non-thrown error is invoked.
82
+ */
83
+ abstract onError(e: Error): Future<void>;
84
+ /**
85
+ * onNotFound is invoked each time the user navigates to an unknown route.
86
+ */
87
+ abstract onNotFound(path: Path): Future<void>;
88
+ handleEvent(_: Event): void;
89
+ /**
90
+ * add a Handler to the route table for a specific path.
91
+ */
92
+ add(path: string, handler: Handler<R>): AbstractHashRouter<R>;
93
+ use(path: string, mware: Filter<R>): AbstractHashRouter<R>;
94
+ clear(): void;
95
+ /**
96
+ * start activates routing by installing a hook into the supplied
97
+ * window.
98
+ */
99
+ start(): AbstractHashRouter<R>;
100
+ stop(): AbstractHashRouter<R>;
101
+ }
102
+ /**
103
+ * DefaultRequest represents a change in the browser's hash triggered
104
+ * by the user.
105
+ */
106
+ export declare class DefaultRequest {
107
+ path: string;
108
+ query: Query;
109
+ params: Params;
110
+ constructor(path: string, query: Query, params: Params);
111
+ }
112
+ /**
113
+ * HashRouter implementation.
114
+ */
115
+ export declare class HashRouter extends AbstractHashRouter<DefaultRequest> {
116
+ window: Window;
117
+ routes: Routes<DefaultRequest>;
118
+ error: OnError;
119
+ notFound: OnNotFound;
120
+ constructor(window: Window, routes?: Routes<DefaultRequest>, error?: OnError, notFound?: OnNotFound);
121
+ createRequest(path: Path, query: Query, params: Params): Future<DefaultRequest>;
122
+ /**
123
+ * navigate to a new path without user interaction.
124
+ *
125
+ * Use this method to change application routes on behalf of the user or
126
+ * automatically.
127
+ *
128
+ * @param path - The path to navigate to; should not include '#'.
129
+ */
130
+ navigate(path: Path): void;
131
+ onError(e: Error): Future<void>;
132
+ onNotFound(path: Path): Future<void>;
133
+ }
134
+ /**
135
+ * takeHash from a Window object.
136
+ *
137
+ * If the hash is empty "/" is returned.
138
+ */
139
+ export declare const takeHash: (w: Window) => string[];
140
+ /**
141
+ * compile a Routes map into a Cache for faster route matching.
142
+ */
143
+ export declare const compile: <R extends Request>(r: Routes<R>) => Cache<R>[];
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compile = exports.takeHash = exports.HashRouter = exports.DefaultRequest = exports.AbstractHashRouter = exports.Cache = void 0;
4
+ const qs = require("qs");
5
+ const toRegex = require("path-to-regexp");
6
+ const function_1 = require("@quenk/noni/lib/data/function");
7
+ const future_1 = require("@quenk/noni/lib/control/monad/future");
8
+ const record_1 = require("@quenk/noni/lib/data/record");
9
+ const EVENT_HASH_CHANGED = 'hashchange';
10
+ /**
11
+ * Cache used internally by the Router.
12
+ * @private
13
+ */
14
+ class Cache {
15
+ constructor(regex, keys, filters, handler) {
16
+ this.regex = regex;
17
+ this.keys = keys;
18
+ this.filters = filters;
19
+ this.handler = handler;
20
+ }
21
+ }
22
+ exports.Cache = Cache;
23
+ /**
24
+ * AbstractHashRouter implementation based on the value of window.location.hash.
25
+ */
26
+ class AbstractHashRouter {
27
+ constructor(window, routes = {}) {
28
+ this.window = window;
29
+ this.routes = routes;
30
+ this.cache = [];
31
+ this.keys = [];
32
+ }
33
+ handleEvent(_) {
34
+ let [path, query] = (0, exports.takeHash)(this.window);
35
+ let cache = this.cache;
36
+ let mware = [];
37
+ let handler = () => (0, future_1.pure)(undefined);
38
+ let keys = [];
39
+ let r = null;
40
+ let count = 0;
41
+ while ((r == null) && (count < cache.length)) {
42
+ r = cache[count].regex.exec(path);
43
+ keys = cache[count].keys;
44
+ mware = cache[count].filters;
45
+ handler = cache[count].handler;
46
+ count = count + 1;
47
+ }
48
+ if (r != null) {
49
+ let ft = this.createRequest(path, qs.parse(query), parseParams(keys, r));
50
+ mware
51
+ .reduce((p, c) => p.chain(c), ft)
52
+ .chain(handler)
53
+ .trap(e => this.onError(e))
54
+ .fork(console.error, function_1.noop);
55
+ }
56
+ else {
57
+ this.onNotFound(path).fork(console.error, function_1.noop);
58
+ }
59
+ }
60
+ /**
61
+ * add a Handler to the route table for a specific path.
62
+ */
63
+ add(path, handler) {
64
+ if (this.routes.hasOwnProperty(path)) {
65
+ this.routes[path][1] = handler;
66
+ }
67
+ else {
68
+ this.routes[path] = [[], handler];
69
+ }
70
+ this.cache = (0, exports.compile)(this.routes);
71
+ return this;
72
+ }
73
+ use(path, mware) {
74
+ if (this.routes.hasOwnProperty(path)) {
75
+ this.routes[path][0].push(mware);
76
+ }
77
+ else {
78
+ this.routes[path] = [[mware], () => (0, future_1.pure)(undefined)];
79
+ }
80
+ this.cache = (0, exports.compile)(this.routes);
81
+ return this;
82
+ }
83
+ clear() {
84
+ this.cache = [];
85
+ this.routes = {};
86
+ }
87
+ /**
88
+ * start activates routing by installing a hook into the supplied
89
+ * window.
90
+ */
91
+ start() {
92
+ this.window.addEventListener(EVENT_HASH_CHANGED, this);
93
+ return this;
94
+ }
95
+ stop() {
96
+ this.window.removeEventListener(EVENT_HASH_CHANGED, this);
97
+ return this;
98
+ }
99
+ }
100
+ exports.AbstractHashRouter = AbstractHashRouter;
101
+ /**
102
+ * DefaultRequest represents a change in the browser's hash triggered
103
+ * by the user.
104
+ */
105
+ class DefaultRequest {
106
+ constructor(path, query, params) {
107
+ this.path = path;
108
+ this.query = query;
109
+ this.params = params;
110
+ }
111
+ }
112
+ exports.DefaultRequest = DefaultRequest;
113
+ /**
114
+ * HashRouter implementation.
115
+ */
116
+ class HashRouter extends AbstractHashRouter {
117
+ constructor(window, routes = {}, error = (e) => {
118
+ console.error(e);
119
+ return future_1.voidPure;
120
+ }, notFound = () => (0, future_1.pure)((0, function_1.noop)())) {
121
+ super(window, routes);
122
+ this.window = window;
123
+ this.routes = routes;
124
+ this.error = error;
125
+ this.notFound = notFound;
126
+ }
127
+ createRequest(path, query, params) {
128
+ return (0, future_1.pure)(new DefaultRequest(path, query, params));
129
+ }
130
+ /**
131
+ * navigate to a new path without user interaction.
132
+ *
133
+ * Use this method to change application routes on behalf of the user or
134
+ * automatically.
135
+ *
136
+ * @param path - The path to navigate to; should not include '#'.
137
+ */
138
+ navigate(path) {
139
+ path = path.split('#').join('');
140
+ path = `#${path}`;
141
+ if (window.location.hash === path)
142
+ this.handleEvent(new Event('hashchanged'));
143
+ window.location.hash = path;
144
+ }
145
+ onError(e) {
146
+ return this.error(e);
147
+ }
148
+ onNotFound(path) {
149
+ return this.notFound(path);
150
+ }
151
+ }
152
+ exports.HashRouter = HashRouter;
153
+ const parseParams = (keys, results) => {
154
+ let params = Object.create(null);
155
+ keys.forEach((key, index) => params[key.name] = results[index + 1]);
156
+ return params;
157
+ };
158
+ /**
159
+ * takeHash from a Window object.
160
+ *
161
+ * If the hash is empty "/" is returned.
162
+ */
163
+ const takeHash = (w) => ((w.location.hash != null) && (w.location.hash != '')) ?
164
+ w.location.hash
165
+ .replace(/^#/, '/')
166
+ .replace(/\/\//g, '/')
167
+ .split('?') :
168
+ ['/'];
169
+ exports.takeHash = takeHash;
170
+ /**
171
+ * compile a Routes map into a Cache for faster route matching.
172
+ */
173
+ const compile = (r) => (0, record_1.reduce)(r, [], (p, c, path) => {
174
+ let keys = [];
175
+ return p.concat(new Cache(toRegex.pathToRegexp(path, keys), keys, c[0], c[1]));
176
+ });
177
+ exports.compile = compile;
178
+ //# sourceMappingURL=hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../src/app/router/hash.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,0CAA0C;AAM1C,4DAAqD;AACrD,iEAA8E;AAC9E,wD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AC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IAEnD,OAAO,MAAM,CAAC;AAElB,CAAC,CAAA;AAED;;;;GAIG;AACI,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAClC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,QAAQ,CAAC,IAAI;SACV,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;SACrB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACjB,CAAC,GAAG,CAAC,CAAC;AAND,QAAA,QAAQ,YAMP;AAEd;;GAEG;AACI,MAAM,OAAO,GAAG,CAAoB,CAAY,EAAc,EAAE,CACnE,IAAA,eAAM,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAa,EAAE,CAA4B,EAAE,IAAY,EAAE,EAAE;IAExE,IAAI,IAAI,GAAU,EAAE,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,CACrB,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7D,CAAC,CAAC,CAAC;AAPM,QAAA,OAAO,WAOb"}
@@ -0,0 +1,49 @@
1
+ import { Future } from '@quenk/noni/lib/control/monad/future';
2
+ /**
3
+ * Route is a string used as an identifier for application state.
4
+ */
5
+ export type Route = string;
6
+ /**
7
+ * Filter types transform <R> values before they are passed to handlers.
8
+ */
9
+ export type Filter<R> = (req: R) => Future<R>;
10
+ /**
11
+ * Handler is the action taken to terminate a request.
12
+ */
13
+ export type Handler<R> = (r: R) => Future<void>;
14
+ /**
15
+ * Router is an interface for changing application state based on user requests.
16
+ *
17
+ * Each request is enscapulated by the type <R> that is constrained by
18
+ * the Router implementation.
19
+ */
20
+ export interface Router<R> {
21
+ /**
22
+ * onError hook.
23
+ */
24
+ onError(e: Error): Future<void>;
25
+ /**
26
+ * onNotFound hook.
27
+ */
28
+ onNotFound(url: string): Future<void>;
29
+ /**
30
+ * add a Handler to the internal route table.
31
+ */
32
+ add(path: Route, handler: Handler<R>): Router<R>;
33
+ /**
34
+ * use a Filter for a specific path.
35
+ */
36
+ use(path: Route, mware: Filter<R>): Router<R>;
37
+ /**
38
+ * clear all routes from the Router.
39
+ */
40
+ clear(): void;
41
+ /**
42
+ * start the Router.
43
+ */
44
+ start(): Router<R>;
45
+ /**
46
+ * stop the Router.
47
+ */
48
+ stop(): Router<R>;
49
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/router/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { Address } from '@quenk/potoo/lib/actor/address';
2
+ import { Runtime } from '@quenk/potoo/lib/actor/system/vm/runtime';
3
+ import { Dialog, DialogEventTarget } from '.';
4
+ /**
5
+ * AlertDialog provides a dialog for displaying an alert message.
6
+ */
7
+ export declare abstract class AlertDialog extends Dialog {
8
+ runtime: Runtime;
9
+ display: Address;
10
+ message: string;
11
+ target: DialogEventTarget;
12
+ constructor(runtime: Runtime, display: Address, message: string, target?: DialogEventTarget);
13
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlertDialog = void 0;
4
+ const _1 = require(".");
5
+ /**
6
+ * AlertDialog provides a dialog for displaying an alert message.
7
+ */
8
+ class AlertDialog extends _1.Dialog {
9
+ constructor(runtime, display, message, target = '?') {
10
+ super(runtime, display, target);
11
+ this.runtime = runtime;
12
+ this.display = display;
13
+ this.message = message;
14
+ this.target = target;
15
+ }
16
+ }
17
+ exports.AlertDialog = AlertDialog;
18
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../../src/app/scene/dialog/alert.ts"],"names":[],"mappings":";;;AAGA,wBAA8C;AAE9C;;GAEG;AACH,MAAsB,WAAY,SAAQ,SAAM;IAE5C,YACW,OAAgB,EAChB,OAAgB,EAChB,OAAe,EACf,SAA4B,GAAG;QAEtC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QALzB,YAAO,GAAP,OAAO,CAAS;QAChB,YAAO,GAAP,OAAO,CAAS;QAChB,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAyB;IAI1C,CAAC;CAEJ;AAZD,kCAYC"}