@jinntec/fore 0.25.0 → 1.0.0-2

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 (41) hide show
  1. package/README.md +75 -22
  2. package/dist/fore-all.js +11 -11
  3. package/dist/fore.js +1 -1
  4. package/index.js +5 -1
  5. package/package.json +17 -6
  6. package/resources/fore.css +121 -4
  7. package/resources/toastify.css +3 -1
  8. package/src/DependencyNotifyingDomFacade.js +9 -1
  9. package/src/ForeElementMixin.js +83 -12
  10. package/src/actions/abstract-action.js +101 -27
  11. package/src/actions/fx-action.js +4 -2
  12. package/src/actions/fx-append.js +21 -18
  13. package/src/actions/fx-confirm.js +22 -0
  14. package/src/actions/fx-dispatch.js +10 -2
  15. package/src/actions/fx-insert.js +35 -30
  16. package/src/actions/fx-message.js +7 -1
  17. package/src/actions/fx-send.js +1 -1
  18. package/src/actions/fx-setvalue.js +2 -9
  19. package/src/dep_graph.js +9 -0
  20. package/src/drawdown.js +172 -0
  21. package/src/fore.js +126 -18
  22. package/src/functions/fx-function.js +2 -2
  23. package/src/fx-bind.js +11 -7
  24. package/src/fx-fore.js +283 -67
  25. package/src/fx-header.js +20 -0
  26. package/src/fx-instance.js +54 -10
  27. package/src/fx-model.js +175 -38
  28. package/src/fx-submission.js +235 -53
  29. package/src/getInScopeContext.js +2 -3
  30. package/src/ui/abstract-control.js +23 -44
  31. package/src/ui/fx-alert.js +20 -19
  32. package/src/ui/fx-container.js +9 -4
  33. package/src/ui/fx-control.js +92 -37
  34. package/src/ui/fx-inspector.js +44 -0
  35. package/src/ui/fx-items.js +104 -20
  36. package/src/ui/fx-output.js +92 -3
  37. package/src/ui/fx-repeat.js +87 -80
  38. package/src/ui/fx-repeatitem.js +38 -48
  39. package/src/ui/fx-trigger.js +49 -27
  40. package/src/xpath-evaluation.js +533 -235
  41. package/src/xpath-util.js +50 -12
package/README.md CHANGED
@@ -1,28 +1,54 @@
1
+ ![NPM](https://img.shields.io/npm/l/@jinntec/fore)
2
+ ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jinntec/fore/CI)
3
+ ![GitHub Discussions](https://img.shields.io/github/discussions/jinntec/fore)
4
+ ![GitHub last commit](https://img.shields.io/github/last-commit/jinntec/fore)
5
+ ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/jinntec/fore)
6
+ ![GitHub top language](https://img.shields.io/github/languages/top/jinntec/fore)
7
+
8
+
9
+
1
10
 
2
11
  ![logo](resources/images/light-200.png)
3
12
 
4
13
  >'situated in front of something else' - Merriam Webster
5
14
 
15
+ [![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2FJinnForeTec)](https://twitter.com/JinnForeTec)
16
+
6
17
  ## [Demos](https://jinntec.github.io/Fore)
7
18
 
8
- DEMOS CURRENTLY OUTDATED AS OF 0.23.0 - WILL BE UPDATED SOONISH
19
+ # What it does
9
20
 
10
- > Please note that not all demos are online as there are some technical obstacles still. If you don't want to miss
11
- > new demos you should have your own clone running.
21
+ Fore lets you write data-driven front-end applications in a declarative way
22
+ just using HTML5 and JavaScript (ES6).
12
23
 
13
- ## An xformish forms framework in Web Components
24
+ ![todo](resources/images/todo-screen.png)
25
+ The use cases range from simple to complex forms to full single page
26
+ applications. It can be used standalone or in conjunction with other web
27
+ components or frameworks.
14
28
 
15
- Fore is a model-driven forms framework that follows the ideas of the XForms 2.0
16
- Standard but translates those into the world of HTML5 Web Components.
29
+ By using the bare metal of the browser
30
+ platform, Fore integrates well with any other library you might want to use in
31
+ conjunction with it.
17
32
 
18
- Fore uses XML as it's main data model but is intended to allow JSON alternatively or at the same time.
33
+
34
+ ## An xformish framework in Web Components
35
+
36
+ Fore is a model-driven language that follows the ideas of the XForms 2.0
37
+ Standard but applies those to the world of HTML5 Web Components.
38
+
39
+ Going beyond just forms it nicely integrates with Web Components, allowing to configure,
40
+ ochestrate and interact with them by binding their properties to data instances.
41
+
42
+ Fore uses XML as it's main data model but allows to use JSON alternatively or at the same time. Accessing and mutating JSON data with declarative
43
+ actions makes JSON processing even easier than in native JavaScript.
19
44
 
20
45
  Through the wonderful [fontoXPath library](https://github.com/FontoXML/fontoxpath) Fore is able to process XML in the client with XPath 3.1 and
21
46
  XQuery 3.1 support.
22
47
 
23
- Being as close as possible to the web platform standards available in browsers natively Fore combines well with any other
48
+ Being as close as possible to the web platform standards available in browsers natively, Fore combines well with any other
24
49
  JS framework or component library.
25
50
 
51
+
26
52
  ## Features
27
53
 
28
54
  * MVC architecture
@@ -34,11 +60,12 @@ JS framework or component library.
34
60
  * generic UI control to bind any kind of component
35
61
  * bound template expressions
36
62
  * powerful XPath/XQuery 3.1 support in the browser
63
+ * Submission module declaratively wrapping the fetch API
37
64
 
38
65
  ## Framework-agnostic
39
66
 
40
67
  Fore focuses on providing a stable processing engine for model-driven
41
- forms. Major premise for a longer-term solution is to stick closely to the features
68
+ apps. Major premise for a longer-term solution is to stick closely to the features
42
69
  of the browser platform and avoid specific frameworks for the implementation.
43
70
 
44
71
  That said it's obvious that Fore does not provide a set of controls
@@ -46,7 +73,7 @@ by itself but allows you to use whatever uber-fancy components you have
46
73
  found elsewhere. May it be some material-design date-picker or
47
74
  that nice jquery(sic!) timeline nobody has done better yet.
48
75
 
49
- That comes to the price of slightly more markup up-front (working on it already)
76
+ That comes to the price of slightly more markup up-front
50
77
  but allows big flexibility and makes it compatible with any framework
51
78
  that plays by the rules of the platform.
52
79
 
@@ -72,27 +99,42 @@ More examples are found in the demos (see running)
72
99
 
73
100
  ## Documentation
74
101
 
75
- Currently the demos are the documentation (see 'demo' folder). All files listed on the demo.html page are expected to work.
102
+ Currently the demos are the documentation (see 'demo' folder). All files listed on the demo.html page are expected to work
103
+ and serve the purpose of documentation. The intend is to have at least one demo
104
+ for each feature and show how to use it with an example.
76
105
 
77
106
  Some of them also offer some explanations and should give you an idea of building your own.
78
107
 
79
- ## Warning
108
+ ## Development and Contributions
80
109
 
81
- The project is still in it's prerelease phase. However there are already about 100 tests and what can be seen in demos is expected to work. The overall architecture matures quite nicely but certainly can still undergo some fundamental changes. There won't be any major releases before 1.0.0 so be aware of breaking changes (will annouce them).
110
+ Default branch of development is 'dev'.
111
+ Feature additions or bugfixes will always there.
82
112
 
83
- It's expected that a first release will be available during this summer.
113
+ The master branch is only used for releases.
84
114
 
85
- ## Development and Contributions
115
+ Contributions are always welcome.
86
116
 
87
- Contributions are always welcome. Default branch of development is 'dev'. PRs
88
- feature additions or bugfixes will always go into 'dev'.
117
+ ### what to contribute
89
118
 
90
- The master branch is only used for releases.
119
+ It's not all about code.
91
120
 
92
- ### Contributing demo forms
121
+ Any feedback is welcome and appreciated. Please use the ['discussions'](https://github.com/Jinntec/Fore/discussions) or
122
+ ['issues'](https://github.com/Jinntec/Fore/issues) as appropriate to suggest features or ask your questions.
93
123
 
94
- There is a file called `demo/sample.html` which can be used to quickly write new demos. See below under 'Developing' for the required setup.
124
+ New demo files are highly welcome as always something new can be learned.
125
+ There is a directory called 'template' that contains some blueprints that can be copied to quickly get going.
95
126
 
127
+ When working on demos it is recommended to copy your file to the 'demo' folder
128
+ and make it work there. If you have additional files you can create
129
+ a subdirectory for the new demo.
130
+
131
+ ## Running from CDN
132
+
133
+ Include the following snippet at end of body:
134
+
135
+ ```
136
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@jinntec/fore@latest/dist/fore-all.js"></script>
137
+ ```
96
138
  ## Installation
97
139
 
98
140
  Run
@@ -118,7 +160,6 @@ If you intend to hack it yourself ...
118
160
  * clone this repo to your machine
119
161
  * run `npm i` to install dependencies
120
162
 
121
-
122
163
  ## Running demos and docs
123
164
 
124
165
  1. checkout this repo or download the sources
@@ -152,6 +193,18 @@ The package is still huge but is expected to shrink massively.
152
193
  Include the repective bundle in your webpage with a module import:
153
194
  ```
154
195
  <script type="module">
155
- import 'fore-all.js';
196
+ import 'dist/fore-all.js';
156
197
  </script>
157
198
  ```
199
+
200
+ ## Giant shoulders
201
+
202
+ The giants that made Fore possible:
203
+
204
+ * past and current [XForms editors](https://www.w3.org/community/xformsusers/wiki/XForms_2.0) - not all brilliant ideas get traction and fame. Nevertheless a brilliantly worked out state engine.
205
+ * [fontoXPath](https://github.com/FontoXML/fontoxpath) - without this wonderful XPath 3.1 implementation in the browser Fore has never been possible - period.
206
+ * [depGraph](https://github.com/jriecken/dependency-graph) - finding this gem saved a big bunch of work.
207
+
208
+ Thanks to all giants!
209
+
210
+