@json-editor/json-editor 2.11.0 → 2.12.0

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 (74) hide show
  1. package/.env +1 -1
  2. package/CHANGELOG.md +11 -0
  3. package/README.md +77 -1
  4. package/README_ADDON.md +5 -1
  5. package/dist/jsoneditor.js +1 -1
  6. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  7. package/dist/nonmin/jsoneditor.js +330 -169
  8. package/dist/nonmin/jsoneditor.js.map +1 -1
  9. package/docs/cleave.html +1 -1
  10. package/docs/datetime.html +1 -1
  11. package/docs/describedby.html +1 -1
  12. package/docs/index.html +5 -3
  13. package/docs/meta_schema.json +5 -1
  14. package/docs/radio.html +1 -1
  15. package/docs/select2.html +1 -1
  16. package/docs/selectize.html +2 -5
  17. package/docs/signature.html +12 -11
  18. package/docs/wysiwyg.html +1 -1
  19. package/package.json +1 -1
  20. package/src/core.js +10 -1
  21. package/src/defaults.js +3 -1
  22. package/src/editor.js +1 -1
  23. package/src/editors/array/selectize.js +0 -2
  24. package/src/editors/array.js +24 -13
  25. package/src/editors/base64.js +9 -0
  26. package/src/editors/integer.js +3 -2
  27. package/src/editors/multiple.js +3 -0
  28. package/src/editors/number.js +4 -2
  29. package/src/editors/object.js +71 -3
  30. package/src/editors/signature.js +16 -16
  31. package/src/editors/string.js +4 -0
  32. package/src/editors/table.js +17 -14
  33. package/src/resolvers.js +6 -2
  34. package/src/schemaloader.js +13 -0
  35. package/src/theme.js +4 -0
  36. package/src/themes/bootstrap3.js +6 -0
  37. package/src/themes/bootstrap4.js +6 -0
  38. package/src/themes/bootstrap5.js +6 -0
  39. package/src/validator.js +28 -0
  40. package/tests/codeceptjs/constrains/dependentRequired_test.js +33 -0
  41. package/tests/codeceptjs/core_test.js +10 -0
  42. package/tests/codeceptjs/editors/array_test.js +52 -0
  43. package/tests/codeceptjs/editors/object_test.js +20 -0
  44. package/tests/codeceptjs/issues/issue-gh-1330_test.js +8 -0
  45. package/tests/codeceptjs/issues/issue-gh-1338_test.js +2 -0
  46. package/tests/codeceptjs/issues/issue-gh-1364_test.js +13 -0
  47. package/tests/codeceptjs/issues/issue-gh-1367_test.js +11 -0
  48. package/tests/codeceptjs/issues/issue-gh-1383_test.js +9 -0
  49. package/tests/codeceptjs/issues/issue-gh-1384_test.js +9 -0
  50. package/tests/codeceptjs/issues/issue-gh-1410_test.js +13 -0
  51. package/tests/codeceptjs/issues/issue-gh-1422_test.js +9 -0
  52. package/tests/docker-compose-local.yml +4 -0
  53. package/tests/pages/array-selectize-create.html +62 -0
  54. package/tests/pages/array-table-responsive.html +65 -0
  55. package/tests/pages/button_state_mode_1.html +34 -0
  56. package/tests/pages/button_state_mode_2.html +35 -0
  57. package/tests/pages/dependentRequired.html +71 -0
  58. package/tests/pages/issues/issue-gh-1330.html +52 -0
  59. package/tests/pages/issues/issue-gh-1364.html +64 -0
  60. package/tests/pages/issues/issue-gh-1367.html +49 -0
  61. package/tests/pages/issues/issue-gh-1383.html +31 -0
  62. package/tests/pages/issues/issue-gh-1383.json +14 -0
  63. package/tests/pages/issues/issue-gh-1384.html +31 -0
  64. package/tests/pages/issues/issue-gh-1384.json +36 -0
  65. package/tests/pages/issues/issue-gh-1410.html +57 -0
  66. package/tests/pages/issues/issue-gh-1422.html +68 -0
  67. package/tests/pages/keep_only_existing_values.html +1 -1
  68. package/tests/pages/load-events.html +60 -0
  69. package/tests/pages/meta-schema.html +5 -1
  70. package/tests/pages/meta_schema.json +5 -1
  71. package/tests/pages/object-case-sensitive-property-search-false.html +41 -0
  72. package/tests/pages/object-case-sensitive-property-search-true.html +41 -0
  73. package/dist/dev/jsoneditor.js +0 -3687
  74. package/dist/jsoneditor.js.map +0 -1
package/.env CHANGED
@@ -1,2 +1,2 @@
1
1
  COMPOSE_PROJECT_NAME=json-editor
2
- COMPOSE_FILE=./tests/docker-compose.yml
2
+ COMPOSE_FILE=./tests/docker-compose.yml:./tests/docker-compose-local.yml
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 2.12.0
4
+
5
+ - Fixed issue #1422: use_default_values: false deletes valid values while true sets invalid default values
6
+ - Added feature: load-events
7
+ - Fixed issue #1410: Schema for "additionalProperties" does not override "no_additional_properties: true"
8
+ - Added feature: table-responsive
9
+ - Fixed readme-broken-link
10
+ - Updated integrity checks in example pages
11
+
3
12
  ### 2.11.0
4
13
 
5
14
  - Fixed issue #746 and #645: Selectize with create = true should add items
@@ -11,6 +20,8 @@
11
20
  - Updated playground ace editor config
12
21
  - Added button_state_mode options
13
22
  - Added support for case-insensitive properties search
23
+ - Fixed issue #746 and #645 Selectize with create = true should add Items
24
+ - Added support for case insensitive properties search
14
25
  - Added support for dependentRequired constrains
15
26
  - Fixed issue #1367: Signature editor not returning base64 data
16
27
  - Fixed issue #1237: more coherent ui for Base64 editor
package/README.md CHANGED
@@ -315,6 +315,16 @@ Here are all the available options:
315
315
  <td>If <code>true</code>, control inputs <code>name</code> attributes will be set.</td>
316
316
  <td><code>true</code></td>
317
317
  </tr>
318
+ <tr>
319
+ <td>button_state_mode</td>
320
+ <td>If <code>1</code>, inactive buttons are hidden. If <code>2</code>, inactive buttons are disabled.</td>
321
+ <td><code>1</code></td>
322
+ </tr>
323
+ <tr>
324
+ <td>case_sensitive_property_search</td>
325
+ <td>This property controls whether property searches in an object editor are case-sensitive</td>
326
+ <td><code>true</code></td>
327
+ </tr>
318
328
  </tbody>
319
329
  </table>
320
330
 
@@ -540,7 +550,7 @@ Some of The [hyper-schema][hyper] specification is supported as well.
540
550
 
541
551
  [core]: http://json-schema.org/latest/json-schema-core.html
542
552
  [validation]: http://json-schema.org/latest/json-schema-validation.html
543
- [hyper]: http://json-schema.org/latest/json-schema-hypermedia.html
553
+ [hyper]: https://json-schema.org/draft-07/json-hyper-schema-release-notes
544
554
 
545
555
  ### $ref and definitions
546
556
 
@@ -636,6 +646,52 @@ Show a video preview (using HTML5 video)
636
646
  The `href` property is a template that gets re-evaluated every time the value changes.
637
647
  The variable `self` is always available. Look at the __Dependencies__ section below for how to include other fields or use a custom template engine.
638
648
 
649
+ ### if-then-else
650
+ The if-then-else keywords are used to express conditional validation logic based on the evaluation of a specified condition. The if keyword defines a condition, and depending on whether it evaluates to true or false, the schema specified under either the then or else keywords will be applied.
651
+
652
+ ```json
653
+ {
654
+ "type": "object",
655
+ "properties": {
656
+ "street_address": {
657
+ "type": "string"
658
+ },
659
+ "country": {
660
+ "type": "string",
661
+ "default": "United States of America",
662
+ "enum": [
663
+ "United States of America",
664
+ "Canada"
665
+ ]
666
+ },
667
+ "postal_code": {
668
+ "type": "string"
669
+ }
670
+ },
671
+ "if": {
672
+ "properties": {
673
+ "country": {
674
+ "const": "United States of America"
675
+ }
676
+ }
677
+ },
678
+ "then": {
679
+ "properties": {
680
+ "postal_code": {
681
+ "pattern": "[0-9]{5}(-[0-9]{4})?"
682
+ }
683
+ }
684
+ },
685
+ "else": {
686
+ "properties": {
687
+ "postal_code": {
688
+ "pattern": "[A-Z][0-9][A-Z] [0-9][A-Z][0-9]"
689
+ }
690
+ }
691
+ }
692
+ }
693
+ ```
694
+
639
695
  ### Property Ordering
640
696
 
641
697
  There is no way to specify property ordering in JSON Schema (although this may change in v5 of the spec).
@@ -848,8 +904,10 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
848
904
  * pgsql
849
905
  * php
850
906
  * python
907
+ * prql
851
908
  * r
852
909
  * ruby
910
+ * rust
853
911
  * sass
854
912
  * scala
855
913
  * scss
@@ -857,10 +915,12 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
857
915
  * sql
858
916
  * stylus
859
917
  * svg
918
+ * typescript
860
919
  * twig
861
920
  * vbscript
862
921
  * xml
863
922
  * yaml
923
+ * zig
864
924
 
865
925
  ```json
866
926
  {
@@ -1038,6 +1098,22 @@ editor.on('deleteAllRows', deletedValues => {
1038
1098
  });
1039
1099
  ```
1040
1100
 
1101
+ #### Schema loader events
1102
+
1103
+ When schemas are loaded via a request, the `schemaLoaded` event is triggered individually for each schema after its loading.
1104
+ Once the loading of all schemas is completed, the `allSchemasLoaded` event is triggered.
1105
+
1106
+ ```javascript
1107
+ editor.on('schemaLoaded', (payload) => {
1108
+ console.log('schemasLoaded', payload.schemaUrl)
1109
+ console.log('schemasLoaded', payload.schema)
1110
+ })
1111
+
1112
+ editor.on('allSchemasLoaded', () => {
1113
+ console.log('allSchemasLoaded')
1114
+ })
1115
+ ```
1116
+
1041
1117
 
1042
1118
  #### Objects
1043
1119
 
package/README_ADDON.md CHANGED
@@ -95,8 +95,10 @@ For configuration options, see the [ACE homepage](https://ace.c9.io/://).
95
95
  ``"format": "pgsql"``<br>
96
96
  ``"format": "php"``<br>
97
97
  ``"format": "python"``<br>
98
+ ``"format": "prql"``<br>
98
99
  ``"format": "r"``<br>
99
100
  ``"format": "ruby"``<br>
101
+ ``"format": "rust"``<br>
100
102
  ``"format": "sass"``<br>
101
103
  ``"format": "scala"``<br>
102
104
  ``"format": "scss"``<br>
@@ -105,10 +107,12 @@ For configuration options, see the [ACE homepage](https://ace.c9.io/://).
105
107
  ``"format": "sqlserver"``<br>
106
108
  ``"format": "stylus"``<br>
107
109
  ``"format": "svg"``<br>
110
+ ``"format": "typescript"``<br>
108
111
  ``"format": "twig"``<br>
109
112
  ``"format": "vbscript"``<br>
110
113
  ``"format": "xml"``<br>
111
- ``"format": "yaml"
114
+ ``"format": "yaml"``<br>
115
+ ``"format": "zig"
112
116
  </details>
113
117
 
114
118
  **Supported Types:** string<br>