Skip to content

Commit f4c5b39

Browse files
committed
Use Typescript for builds, cleaned up bins, use Bootstrap 5
1 parent e827fdc commit f4c5b39

File tree

3,165 files changed

+98540
-247848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,165 files changed

+98540
-247848
lines changed

.circleci/config.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/node:14-browsers
6-
environment:
7-
CHROME_BIN: "/usr/bin/google-chrome"
5+
- image: cimg/node:lts
86
steps:
97
- checkout
108
- restore_cache:
119
key: dependency-cache-{{ checksum "package.json" }}
1210
- run:
13-
name: Install npm
14-
command: npm install
11+
name: Install modules
12+
command: yarn install
1513
- save_cache:
1614
key: dependency-cache-{{ checksum "package.json" }}
1715
paths:

.dccache

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"parser": "@babel/eslint-parser",
2+
"parser": "@typescript-eslint/parser",
33
"extends": "formio",
44
"parserOptions": {
55
"ecmaVersion": 2015,
66
"sourceType": "module"
77
},
8+
"plugins": ["@typescript-eslint"],
89
"env": {
910
"browser": true,
1011
"es6": true,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
_site
22
lib
33
dump.rdb
4+
.dccache
45
.DS_Store
56
.bower.json
67
node_modules

.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
timeout: 20000,
66
exit: true,
77
require: [
8-
'@babel/register',
8+
'ts-node/register',
99
'mock-local-storage',
1010
'jsdom-global/register'
1111
]

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
"-t",
1515
"20000",
1616
"--colors",
17-
"${workspaceFolder}/lib/**/*.unit.js",
18-
17+
"${workspaceFolder}/src/**/*.unit.js",
18+
"-t",
19+
"30000"
1920
],
2021
"internalConsoleOptions": "openOnSessionStart",
2122
"skipFiles": [

Changelog.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ All notable changes to this project will be documented in this file
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
6-
7-
## [Unreleased: 5.0.0-rc.5]
6+
## 5.0.0-rc.5
87
### Added
98
- FIO-5986: added check for identical uploaded file
109
- FIO-6453: added sanitization inside error message container

_config.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
baseurl: ""
1+
baseurl: /

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ description: The core JavaScript Library for Form.io
33
author: The Form.io Developers
44
markdown: kramdown
55
highlighter: rouge
6-
baseurl: https://formio.github.io/formio.js
7-
exclude: [package.json, package-lock.json, bower.json, circle.yml, karma.conf.js, gulpfile.js, node_modules, bower_components, src, test, gulp, lib, config]
6+
baseurl: /formio.js/
7+
exclude: [package.json, package-lock.json, circle.yml, gulpfile.js, node_modules, bower_components, src, test, gulp, lib, config, tsconfig.json]
88

_layouts/default.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,59 @@
77
window.dataLayer = window.dataLayer || [];
88
function gtag(){dataLayer.push(arguments);}
99
gtag('js', new Date());
10-
1110
gtag('config', 'UA-58453303-6');
1211
</script>
13-
14-
<base href="{{ site.baseurl }}/"></base>
12+
<base href="{{ site.baseurl }}"></base>
1513
<meta charset="utf-8">
1614
<meta http-equiv="X-UA-Compatible" content="IE=edge">
1715
<meta name="viewport" content="width=device-width, initial-scale=1">
1816
<title>JavaScript Powered Forms and Form.io SDK</title>
19-
<link href="{{ site.baseurl }}/app/syntax.css" rel="stylesheet">
20-
<link href="{{ site.baseurl }}/app/main.css" rel="stylesheet">
21-
<link href="{{ site.baseurl }}/app/fontawesome/css/font-awesome.min.css" rel="stylesheet">
17+
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.baseurl }}app/favicon/apple-touch-icon.png">
18+
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.baseurl }}app/favicon/favicon-32x32.png">
19+
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.baseurl }}app/favicon/favicon-16x16.png">
20+
<link rel="manifest" href="{{ site.baseurl }}app/favicon/site.webmanifest">
21+
<link href="{{ site.baseurl }}app/syntax.css" rel="stylesheet">
22+
<link href="{{ site.baseurl }}app/main.css" rel="stylesheet">
23+
<link href="{{ site.baseurl }}app/bootstrap/css/bootstrap.min.css" rel="stylesheet">
24+
<link href="{{ site.baseurl }}app/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
2225
{% if page.template %}
23-
<link href="https://bootswatch.com/4/{{ page.template }}/bootstrap.min.css" rel="stylesheet">
26+
<link href="{{ site.baseurl }}app/bootswatch/dist/{{ page.template }}/bootstrap.min.css" rel="stylesheet">
2427
{% endif %}
2528
{% if page.template == nil %}
26-
<link href="https://bootswatch.com/4/cosmo/bootstrap.min.css" rel="stylesheet">
29+
<link href="{{ site.baseurl }}app/bootswatch/dist/spacelab/bootstrap.min.css" rel="stylesheet">
2730
{% endif %}
2831
{% if page.noFormio == nil %}
29-
<link href="{{ site.baseurl }}/dist/formio.full.min.css" rel="stylesheet">
32+
<link href="{{ site.baseurl }}dist/formio.full.min.css" rel="stylesheet">
3033
{% endif %}
3134
<script src="https://cdn.form.io/ace/ace.js"></script>
32-
<script src="{{ site.baseurl }}/app/jquery/jquery.slim.min.js"></script>
33-
<script src="{{ site.baseurl }}/app/bootstrap/js/bootstrap.min.js"></script>
35+
<script src="{{ site.baseurl }}app/bootstrap/js/bootstrap.min.js"></script>
3436
{% if page.noFormio == nil %}
35-
<script src="{{ site.baseurl }}/dist/formio.full.js"></script>
37+
<script src="{{ site.baseurl }}dist/formio.full.js"></script>
3638
{% endif %}
3739
{% if page.contrib %}
38-
<script src="{{ site.baseurl }}/dist/formio.contrib.min.js"></script>
40+
<script src="{{ site.baseurl }}dist/formio.contrib.min.js"></script>
3941
{% endif %}
40-
<script type="text/javascript">
41-
window.onload = function() {
42-
if (Formio) {
43-
Formio.icons = 'fontawesome';
44-
document.getElementById('renderer-version').innerHTML = Formio.version;
45-
}
46-
};
47-
</script>
4842
</head>
4943
<body>
5044
<a href="https://github.com/formio/formio.js"><img style="position: absolute; top: 0; right: 0; border: 0;z-index:3000;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
51-
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
45+
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4 p-0">
5246
<div class="container">
53-
<a class="navbar-brand" href="#">
54-
<img height="25px;" style="display: inline;" alt="Form.io" src="https://help.form.io/assets/formio-logo.png"> | JavaScript SDK Library
47+
<a class="navbar-brand p-0" href="#">
48+
<svg width="150px" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 324 115.2"><defs><style>.cls-1{fill:#373a36;}.cls-2{fill:#69b342;}</style></defs><polygon class="cls-1" points="95.53 37.72 127.07 37.72 127.07 45.67 105.07 45.67 105.07 56.68 125.68 56.68 125.68 64.64 105.07 64.64 105.07 82.62 95.53 82.62 95.53 37.72"/><path class="cls-1" d="M139.14,65.76c0,6.49,2.81,10.34,7.34,10.34s7.15-3.85,7.15-10.28c0-7-2.6-10.39-7.29-10.39-4.35,0-7.2,3.21-7.2,10.33m24-.06c0,10.2-6.14,17.7-16.89,17.7-10.52,0-16.67-7.46-16.67-17.52,0-10.4,6.34-17.75,17.11-17.75,10,0,16.45,7,16.45,17.57"/><path class="cls-1" d="M167,58.06c0-3.35,0-6.33-.07-9.15h9.22c.12.75.24,4.1.24,5.92,1.5-3.85,5.12-6.67,10.89-6.7V57c-6.82-.18-10.89,1.64-10.89,10.88v14.7H167Z"/><path class="cls-1" d="M192.81,57.6c0-2.92,0-5.8-.06-8.69h9c.12.82.31,2.7.36,4a10.6,10.6,0,0,1,9.43-4.8c4.88,0,7.56,2.51,8.76,5.13,2-2.76,4.91-5.13,10.45-5.13,5.92,0,10.76,3.61,10.76,12.38V82.62h-9.17v-21c0-3-1.11-6-4.95-6-4,0-5.56,2.56-5.56,7.73V82.62H212.6V62c0-3.49-.87-6.31-4.88-6.31-3.81,0-5.63,2.33-5.63,8.11V82.62h-9.28Z"/><rect class="cls-1" x="247.55" y="71.18" width="10.09" height="11.44"/><path class="cls-1" d="M263.73,48.91h9.39V82.62h-9.39Zm0-13.83h9.39V43.4h-9.39Z"/><path class="cls-1" d="M289.11,65.76c0,6.49,2.8,10.34,7.33,10.34s7.16-3.85,7.16-10.28c0-7-2.61-10.39-7.29-10.39-4.36,0-7.2,3.21-7.2,10.33m24-.06c0,10.2-6.15,17.7-16.89,17.7-10.53,0-16.67-7.46-16.67-17.52,0-10.4,6.33-17.75,17.11-17.75,10,0,16.45,7,16.45,17.57"/><polygon class="cls-1" points="45.38 65.99 54.91 56.55 46.72 48.42 37.2 57.85 45.38 65.99"/><polygon class="cls-1" points="10.87 57.41 46.43 92.97 54.38 85.01 26.7 57.32 53.92 30.1 46.05 22.23 10.87 57.41"/><polygon class="cls-2" points="59.37 35.48 51.42 43.43 65.73 57.75 51.45 72.03 59.37 80.03 81.63 57.76 81.6 57.73 81.61 57.71 59.37 35.48"/></svg>
5549
</a>
56-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
50+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
5751
<span class="navbar-toggler-icon"></span>
5852
</button>
5953
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
60-
<ul class="navbar-nav nav-fill mr-auto">
61-
<li class="nav-item {% if page.section == 'home' %}active bg-white border{% endif %}"><a class="nav-link" href="{{ site.baseurl }}"><i class="fa fa-home"></i></a></li>
62-
<li class="nav-item {% if page.section == 'builder' %}active bg-white border{% endif %}"><a class="nav-link" href="app/builder.html"><i class="fa fa-th-list"></i> Form Builder</a></li>
63-
<li class="nav-item {% if page.section == 'sandbox' %}active bg-white border{% endif %}"><a class="nav-link" href="app/sandbox.html"><i class="fa fa-cube"></i> Sandbox</a></li>
64-
<li class="nav-item {% if page.section == 'examples' %}active bg-white border{% endif %}"><a class="nav-link" href="app/examples"><i class="fa fa-check-square-o"></i> Examples</a></li>
65-
<li class="nav-item"><a class="nav-link" target="_blank" href="https://github.com/formio/formio.js/wiki"><i class="fa fa-book"></i> Documentation</a></li>
66-
<li class="nav-item {% if page.section == 'sdk'%}active bg-white border{% endif %}"><a class="nav-link" href="app/sdk"><i class="fa fa-list-alt"></i> SDK</a></li>
54+
<ul class="navbar-nav nav-fill me-auto">
55+
<li class="nav-item {% if page.section == 'home' %}active bg-white border{% endif %}"><a class="text-dark nav-link p-3" href="{{ site.baseurl }}"><i class="bi bi-house-fill"></i></a></li>
56+
<li class="nav-item {% if page.section == 'builder' %}active bg-white border{% endif %}"><a class="text-dark nav-link p-3" href="app/builder.html"><i class="bi bi-menu-button-wide"></i> Form Builder</a></li>
57+
<li class="nav-item {% if page.section == 'sandbox' %}active bg-white border{% endif %}"><a class="text-dark nav-link p-3" href="app/sandbox.html"><i class="bi bi-box"></i> Sandbox</a></li>
58+
<li class="nav-item {% if page.section == 'examples' %}active bg-white border{% endif %}"><a class="text-dark nav-link p-3" href="app/examples"><i class="bi bi-check-square"></i> Examples</a></li>
59+
<li class="nav-item"><a class="text-dark nav-link p-3" target="_blank" href="https://help.form.io/developers/form-renderer"><i class="bi bi-book"></i> Documentation</a></li>
60+
<li class="nav-item {% if page.section == 'sdk'%}active bg-white border{% endif %}"><a class="text-dark nav-link p-3" href="app/sdk"><i class="bi bi-window"></i> SDK</a></li>
6761
</ul>
68-
<ul class="navbar-nav">
62+
<ul class="navbar-nav float-end">
6963
<li class="nav-item"><a class="github-button nav-link" href="https://github.com/formio/formio.js" data-size="large" data-show-count="true" aria-label="Star formio/formio.js on GitHub">Star</a></li>
7064
<li class="nav-item"><a class="github-button nav-link" href="https://github.com/formio/formio.js/fork" data-size="large" data-show-count="true" aria-label="Fork formio/formio.js on GitHub">Fork</a></li>
7165
</ul>
@@ -75,12 +69,17 @@
7569
<div class="{% if page.fluid %}container-fluid{% endif %}{% if page.fluid == nil %}container{% endif %}">
7670
{{ content }}
7771
</div>
78-
<hr />
79-
<div>
80-
<h4 class="text-center text-muted">powered by <img src="{{ site.baseurl }}/app/logo.png" class="mr-2" style="height: 1.2em;" /></h4>
81-
<p class="text-center text-muted mb-0" style="font-size: 0.8em">Copyright © Form.io LLC 2021. All rights reserved</p>
72+
<div class="container">
73+
<footer class="py-3 my-4">
74+
<h4 class="align-center text-center text-muted">powered by <svg width="150px" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 324 115.2"><defs><style>.cls-1{fill:#373a36;}.cls-2{fill:#69b342;}</style></defs><polygon class="cls-1" points="95.53 37.72 127.07 37.72 127.07 45.67 105.07 45.67 105.07 56.68 125.68 56.68 125.68 64.64 105.07 64.64 105.07 82.62 95.53 82.62 95.53 37.72"/><path class="cls-1" d="M139.14,65.76c0,6.49,2.81,10.34,7.34,10.34s7.15-3.85,7.15-10.28c0-7-2.6-10.39-7.29-10.39-4.35,0-7.2,3.21-7.2,10.33m24-.06c0,10.2-6.14,17.7-16.89,17.7-10.52,0-16.67-7.46-16.67-17.52,0-10.4,6.34-17.75,17.11-17.75,10,0,16.45,7,16.45,17.57"/><path class="cls-1" d="M167,58.06c0-3.35,0-6.33-.07-9.15h9.22c.12.75.24,4.1.24,5.92,1.5-3.85,5.12-6.67,10.89-6.7V57c-6.82-.18-10.89,1.64-10.89,10.88v14.7H167Z"/><path class="cls-1" d="M192.81,57.6c0-2.92,0-5.8-.06-8.69h9c.12.82.31,2.7.36,4a10.6,10.6,0,0,1,9.43-4.8c4.88,0,7.56,2.51,8.76,5.13,2-2.76,4.91-5.13,10.45-5.13,5.92,0,10.76,3.61,10.76,12.38V82.62h-9.17v-21c0-3-1.11-6-4.95-6-4,0-5.56,2.56-5.56,7.73V82.62H212.6V62c0-3.49-.87-6.31-4.88-6.31-3.81,0-5.63,2.33-5.63,8.11V82.62h-9.28Z"/><rect class="cls-1" x="247.55" y="71.18" width="10.09" height="11.44"/><path class="cls-1" d="M263.73,48.91h9.39V82.62h-9.39Zm0-13.83h9.39V43.4h-9.39Z"/><path class="cls-1" d="M289.11,65.76c0,6.49,2.8,10.34,7.33,10.34s7.16-3.85,7.16-10.28c0-7-2.61-10.39-7.29-10.39-4.36,0-7.2,3.21-7.2,10.33m24-.06c0,10.2-6.15,17.7-16.89,17.7-10.53,0-16.67-7.46-16.67-17.52,0-10.4,6.33-17.75,17.11-17.75,10,0,16.45,7,16.45,17.57"/><polygon class="cls-1" points="45.38 65.99 54.91 56.55 46.72 48.42 37.2 57.85 45.38 65.99"/><polygon class="cls-1" points="10.87 57.41 46.43 92.97 54.38 85.01 26.7 57.32 53.92 30.1 46.05 22.23 10.87 57.41"/><polygon class="cls-2" points="59.37 35.48 51.42 43.43 65.73 57.75 51.45 72.03 59.37 80.03 81.63 57.76 81.6 57.73 81.61 57.71 59.37 35.48"/></svg></h4>
75+
<p class="text-center text-muted mb-0" style="font-size: 0.8em">Copyright © Form.io LLC <span id="year"></span>. All rights reserved</p>
76+
<p class="text-center text-muted mb-0" style="font-size: 0.8em">Renderer v<span id="renderer-version"></span></p>
77+
<script async defer src="https://buttons.github.io/buttons.js"></script>
78+
<script type="text/javascript">
79+
document.getElementById('year').innerText = (new Date()).getFullYear();
80+
document.getElementById('renderer-version').innerHTML = Formio.version;
81+
</script>
82+
</footer>
8283
</div>
83-
<p class="text-center text-muted mb-0" style="font-size: 0.8em">Renderer v<span id="renderer-version"></span></p>
84-
<script async defer src="https://buttons.github.io/buttons.js"></script>
8584
</body>
8685
</html>

_layouts/vtabs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ layout: default
88
{% for section in sections %}
99
{% if section.disabled == nil %}
1010
<li class="nav-item ml-0">
11-
<a class="nav-link border-top rounded-0 {% if section.url == page.url %}active{% endif %}" href="{{ site.baseurl }}{{ section.url }}">{{ section.title }}</a>
11+
<a class="nav-link border-top rounded-0 {% if section.url == page.url %}active{% endif %}" href="{{ site.baseurl }}{{ section.url | replace_first: "/", "" }}">{{ section.title }}</a>
1212
</li>
1313
{% endif %}
1414
{% endfor %}

app/bootstrap-icons/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019-2021 The Bootstrap Authors
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
13+
all 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
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)