Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 #474

Merged
merged 86 commits into from
Sep 24, 2024
Merged

v1 #474

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
19e2a58
chore: refactor the data structures holding state into recursive stru…
josdejong Jun 14, 2024
ed66b0b
chore: update devDependencies
josdejong Jun 14, 2024
3a9d51b
feat: refactor the API to use `undefined` instead of `null` (#453)
josdejong Jun 17, 2024
18c4743
fix: short cut key `Ctrl+F` and `Ctrl+H` not working in table mode wh…
josdejong Jun 17, 2024
47683d4
chore: cleanup deprecation messages
josdejong Jun 17, 2024
a3aeedd
chore: update devDependencies
josdejong Jun 17, 2024
3bda70e
chore: run `npm audit fix`
josdejong Jun 19, 2024
8c436ed
fix: the do you want to format message popped up after clicking the "…
josdejong Jun 19, 2024
f257b24
Merge branch 'refs/heads/main' into v1
josdejong Jun 26, 2024
1e1e85c
feat: implemented a powerful API for expand and collapse (#458)
josdejong Jul 5, 2024
4b2daf5
feat: upgrade to the latest version of `codemirror` and update devDep…
josdejong Jul 5, 2024
416cba2
fix: in table mode, exit editing a key or value when clicking outside…
josdejong Jul 8, 2024
9234a59
chore: reorder some CSS to fix some styling issues in Svelte 5 (WIP)
josdejong Jul 8, 2024
1936750
fix: define `svelte@4` as a peer dependency
josdejong Jul 8, 2024
5d5124a
fix: update test snapshots
josdejong Jul 8, 2024
f2c3afb
feat: use `dialog` for `SortModal` and `CopyPasteModal` (WIP)
josdejong Jul 8, 2024
f3e6b09
chore: refactor the Modal to have an `onClose` callback instead of `o…
josdejong Jul 8, 2024
22588bb
chore: refactor the TransformModal to use dialog (WIP)
josdejong Jul 8, 2024
3586283
chore: change `husky install` into `husky`
josdejong Jul 9, 2024
55aca06
chore: update package-lock.json
josdejong Jul 9, 2024
58072b4
chore: refactor `JSONRepairModal` to use dialog
josdejong Jul 9, 2024
df6b02c
chore: refactor `JSONEditorModal` to use dialog, remove dependency `s…
josdejong Jul 9, 2024
cb7bcf6
chore: refactor the sizing of the modals
josdejong Jul 9, 2024
f7ad04b
fix: get `use:onEscape` working with the `dialog` setup
josdejong Jul 9, 2024
983c9a2
fix: onClose callback of modals not propagated
josdejong Jul 9, 2024
8aaa1a4
fix: #451 add aria-label to the editable div
josdejong Jul 10, 2024
e41bb75
fix: context menu and color picker not visible in JSONEditorModal (WIP)
josdejong Jul 11, 2024
dfcd39f
fix: linting issues
josdejong Jul 11, 2024
1d5f983
fix: update test snapshots
josdejong Jul 11, 2024
2df86b5
feat: export more utility functions (fixes #454)
josdejong Jul 11, 2024
2f3c250
chore: refactor paste as JSON logic (#460)
josdejong Jul 11, 2024
5c26337
fix: let `getInRecursiveState` return undefined instead of throwing a…
josdejong Jul 11, 2024
8d93a44
Merge branch 'refs/heads/v1' into feat/dialog
josdejong Jul 11, 2024
425c7a7
fix: context menu and color picker not overflowing the edge of the di…
josdejong Jul 11, 2024
dfe4af8
fix: escape in nested JSONEditorModals closing all modals instead of …
josdejong Jul 11, 2024
551c8af
fix: some reorganization of the styles
josdejong Jul 11, 2024
0c5ebc0
fix: selection not applied after editing a key or value
josdejong Jul 11, 2024
38357fa
fix: extracting a part of the document broken
josdejong Jul 11, 2024
80807f6
docs: describe browser requirements (March 2022 or newer)
josdejong Jul 12, 2024
86ce27f
chore: refactor `documentStatePatch` so it can correctly handle multi…
josdejong Jul 12, 2024
aa00620
chore: replace `svelte-simple-modal` with native HTML `<dialog />` (#…
josdejong Jul 12, 2024
e1785bd
Merge branch 'refs/heads/v1' into chore/refactor-documentStatePatch
josdejong Jul 12, 2024
a342c08
chore: solve merge conflict
josdejong Jul 12, 2024
b08b1f6
chore: cleanup a resolved FIXME
josdejong Jul 12, 2024
8604049
feat: upgrade to the latest version of `ajv` and `sass`
josdejong Jul 15, 2024
e90390d
chore: fix JSONEditorModal closing when clicking ESC when editing a v…
josdejong Jul 15, 2024
c807600
chore: refactor `KeySelection` and `ValueSelection` (#463)
josdejong Jul 15, 2024
c2d79c9
chore: replace `updateSelection(...)` with `selection = ...`
josdejong Jul 15, 2024
b6945ea
chore: upgrade eslint configuration
josdejong Jul 15, 2024
c4b823a
chore: fix using a deprecated import of `svelte-preprocess`
josdejong Jul 15, 2024
483a9c3
chore: configure `.browserslistrc`
josdejong Jul 15, 2024
b1fd963
chore: fix babel build warnings
josdejong Jul 15, 2024
222af37
chore: fix Apply button in JSONEditorModal not working
josdejong Jul 15, 2024
0b934e3
chore: refactor selection styling (#468)
josdejong Jul 23, 2024
6526761
chore: move the ValidationErrorIcon outside the table value cell
josdejong Jul 23, 2024
1a010db
chore: fix a build-warning and update test snapshots
josdejong Jul 23, 2024
51466f0
docs: update example `EnumValue`
josdejong Jul 23, 2024
b3fceb5
chore: fix a linting issue
josdejong Jul 23, 2024
4edf7dd
feat: change the default query language to `jsonquery` (#469)
josdejong Jul 25, 2024
ee6defb
feat: implement support for the query language `JSONPath` (#470)
josdejong Jul 25, 2024
0de0caa
Merge branch 'main' into v1
josdejong Jul 26, 2024
abce71c
fix: #464 `readOnly` doesn't work on chrome in `text` mode
josdejong Jul 26, 2024
4faad82
chore: dependencies and devDependencies
josdejong Jul 26, 2024
cbdd745
chore: add a rule to the `arraySchema`
josdejong Jul 26, 2024
a496b73
chore: fix linting issue
josdejong Jul 26, 2024
7d6427e
chore: fix SortModal not restoring the previous state
josdejong Jul 26, 2024
814a09d
chore: fix closing ContextMenu using Escape also closing JSONEditorModal
josdejong Jul 26, 2024
4e5fce5
chore: some fixes related to losing focus in the modals
josdejong Jul 26, 2024
a83b54a
chore: give the background area behind the SearchBox a light gray col…
josdejong Jul 26, 2024
bc52545
chore: rename `updatedJson` to `json`
josdejong Jul 26, 2024
2ee127b
chore: fix not always remembering the initial `enforceString` state
josdejong Jul 26, 2024
75824f5
chore: fix some styling issues on hovering over nested contents in tr…
josdejong Jul 30, 2024
951003a
chore: fix a styling issue in table mode when the editing a value is …
josdejong Jul 30, 2024
f192344
chore: fix left padding of the color picker button
josdejong Jul 30, 2024
39fb408
chore: fix a styling issue in table mode when the editing a value is …
josdejong Jul 30, 2024
5a4c425
chore: fix focus issues in TableMode
josdejong Jul 30, 2024
e2d46de
chore: fix shortly losing focus when clicking on a validation error i…
josdejong Jul 30, 2024
32c3e45
chore: give the area behind the search box a light gray color in tree…
josdejong Jul 30, 2024
fb60a9c
chore: fix linting issues
josdejong Jul 30, 2024
ff859f1
chore: update test snapshots
josdejong Jul 30, 2024
5edb7c5
chore: remove passing `parser` to function `getEnforceString`
josdejong Aug 1, 2024
7b28f36
chore: upgrade dependencies (most notably `@josdejong/jsonquery@1.2.0`
josdejong Aug 30, 2024
1a2286c
chore: upgrade dependencies (most notably `@jsonquerylang/jsonquery@3`)
josdejong Sep 23, 2024
0fce9a1
chore: convert the `ReadonlyPassword` example component into TypeScript
josdejong Sep 23, 2024
455ad55
feat: the vanilla constructor is changed from `new JSONEditor(...)` t…
josdejong Sep 24, 2024
8359816
docs: update the description of the JSON Query language
josdejong Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Test out at: https://browsersl.ist/

fully supports es6
not dead
31 changes: 0 additions & 31 deletions .eslintrc.json

This file was deleted.

26 changes: 13 additions & 13 deletions README-VANILLA.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A web-based tool to view, edit, format, transform, and validate JSON.

Try it out: https://jsoneditoronline.org
Try it out: <https://jsoneditoronline.org>

This is the vanilla variant of `svelte-jsoneditor`, which can be used in vanilla JavaScript or frameworks like SolidJS, React, Vue, Angular.

Expand Down Expand Up @@ -38,19 +38,19 @@ If you have a setup for your project with a bundler (like Vite, Rollup, or Webpa

```ts
// for use in a React, Vue, or Angular project
import { JSONEditor } from 'vanilla-jsoneditor'
import { createJSONEditor } from 'vanilla-jsoneditor'
```

If you want to use the library straight in the browser, use the provided standalone ES bundle:

```ts
// for use directly in the browser
import { JSONEditor } from 'vanilla-jsoneditor/standalone.js'
import { createJSONEditor } from 'vanilla-jsoneditor/standalone.js'
```

The standalone bundle contains all dependencies of `vanilla-jsoneditor`, for example `lodash-es` and `Ajv`. If you use some of these dependencies in your project too, it means that they will be bundled twice in your web application, leading to a needlessly large application size. In general, it is preferable to use the default `import { JSONEditor } from 'vanilla-jsoneditor'` so dependencies can be reused.
The standalone bundle contains all dependencies of `vanilla-jsoneditor`, for example `lodash-es` and `Ajv`. If you use some of these dependencies in your project too, it means that they will be bundled twice in your web application, leading to a needlessly large application size. In general, it is preferable to use the default `import { createJSONEditor } from 'vanilla-jsoneditor'` so dependencies can be reused.

## Use (Browser example loading the ES module):
## Use (Browser example loading the ES module)

```html
<!doctype html>
Expand All @@ -62,11 +62,11 @@ The standalone bundle contains all dependencies of `vanilla-jsoneditor`, for exa
<div id="jsoneditor"></div>

<script type="module">
import { JSONEditor } from 'vanilla-jsoneditor/standalone.js'
import { createJSONEditor } from 'vanilla-jsoneditor/standalone.js'

// Or use it through a CDN (not recommended for use in production):
// import { JSONEditor } from 'https://unpkg.com/vanilla-jsoneditor/index.js'
// import { JSONEditor } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor/index.js'
// import { createJSONEditor } from 'https://unpkg.com/vanilla-jsoneditor/index.js'
// import { createJSONEditor } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor/index.js'

let content = {
text: undefined,
Expand All @@ -75,7 +75,7 @@ The standalone bundle contains all dependencies of `vanilla-jsoneditor`, for exa
}
}

const editor = new JSONEditor({
const editor = createJSONEditor({
target: document.getElementById('jsoneditor'),
props: {
content,
Expand All @@ -100,22 +100,22 @@ The standalone bundle contains all dependencies of `vanilla-jsoneditor`, for exa

Depending on whether you are using JavaScript of TypeScript, create either a JSX or TSX file:

### TypeScript:
### TypeScript

```tsx
//
// JSONEditorReact.tsx
//
import { useEffect, useRef } from 'react'
import { JSONEditor, JSONEditorPropsOptional } from 'vanilla-jsoneditor'
import { createJSONEditor, JSONEditorPropsOptional } from 'vanilla-jsoneditor'

const JSONEditorReact: React.FC<JSONEditorPropsOptional> = (props) => {
const refContainer = useRef<HTMLDivElement>(null)
const refEditor = useRef<JSONEditor | null>(null)

useEffect(() => {
// create editor
refEditor.current = new JSONEditor({
refEditor.current = createJSONEditor({
target: refContainer.current!,
props: {}
})
Expand Down Expand Up @@ -157,7 +157,7 @@ const JSONEditorReact = (props) => {

useEffect(() => {
// create editor
refEditor.current = new JSONEditor({
refEditor.current = createJSONEditor({
target: refContainer.current,
props: {}
})
Expand Down
Loading