Skip to content

Commit 8bfa2a7

Browse files
committed
Update demo and demo data
1 parent b55035d commit 8bfa2a7

File tree

7 files changed

+15
-50
lines changed

7 files changed

+15
-50
lines changed

custom-component-library/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"json-edit-react": "1.25.6-beta3",
13+
"json-edit-react": "1.25.6",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0"
1616
},

custom-component-library/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1151,10 +1151,10 @@ [email protected]:
11511151
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
11521152
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
11531153

1154-
1155-
version "1.25.6-beta3"
1156-
resolved "https://registry.yarnpkg.com/json-edit-react/-/json-edit-react-1.25.6-beta3.tgz#812d6714d329458adfa85a9548ce9d8590452d8f"
1157-
integrity sha512-6b8C5OSpTzfXKIWSftVYRwyaE9+07L3O4oug6qzEfbgFfjDqNT2t3IzKdsfO5ST5qDEE4SDEYL2BU2awFoMH2A==
1154+
1155+
version "1.25.6"
1156+
resolved "https://registry.yarnpkg.com/json-edit-react/-/json-edit-react-1.25.6.tgz#92a5199b2663695d4d2c950268b8d93f259bbf5d"
1157+
integrity sha512-MrkvpsYm/Vjkgl9bntd3d/BEW+hIOV7STrNMRRyIuZd641L9MA5ZoJvwWBIbK3pY6UwBm45/ImParmQSgm+KSg==
11581158
dependencies:
11591159
object-property-assigner "^1.3.5"
11601160
object-property-extractor "^1.0.13"

demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"ajv": "^8.16.0",
3535
"firebase": "^10.13.0",
3636
"framer-motion": "^11.0.3",
37-
"json-edit-react": "1.25.6-beta3",
37+
"json-edit-react": "1.25.6",
3838
"json5": "^2.2.3",
3939
"react": "^19.0.0",
4040
"react-datepicker": "^7.5.0",

demo/src/demoData/data.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ export const data: Record<string, object> = {
44
number: 99,
55
boolean: true,
66
nothing: null,
7-
enum: 'Option B',
8-
// Date: new Date(),
7+
enum: 'Option B 🍌',
98
Usage: [
109
'Edit a value by clicking the "edit" icon, or double-clicking the value.',
1110
'You can change the type of any value',

demo/src/demoData/dataDefinitions.tsx

+2-36
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ import {
1818
ThemeStyles,
1919
TypeFilterFunction,
2020
UpdateFunction,
21-
// StringDisplay,
22-
// StringEdit,
23-
// toPathString,
2421
ErrorString,
2522
TypeOptions,
2623
UpdateFunctionProps,
@@ -96,38 +93,7 @@ export const demoDataDefinitions: Record<string, DemoData> = {
9693
rootName: 'data',
9794
collapse: 2,
9895
data: data.intro,
99-
customNodeDefinitions: [
100-
dateNodeDefinition,
101-
// {
102-
// condition: (nodeData) => nodeData.value instanceof Date,
103-
// element: (props) => {
104-
// const { nodeData, isEditing, setValue, getStyles, canEdit, value, handleEdit } = props
105-
// return isEditing ? (
106-
// <StringEdit
107-
// styles={getStyles('input', nodeData)}
108-
// pathString={toPathString(nodeData.path)}
109-
// {...props}
110-
// value={value instanceof Date ? value.toISOString() : (value as string)}
111-
// setValue={setValue as React.Dispatch<React.SetStateAction<string>>}
112-
// handleEdit={() => {
113-
// const newDate = new Date(value as string)
114-
// handleEdit(newDate as any)
115-
// }}
116-
// />
117-
// ) : (
118-
// <StringDisplay
119-
// {...props}
120-
// styles={getStyles('string', nodeData)}
121-
// canEdit={canEdit}
122-
// pathString={toPathString(nodeData.path)}
123-
// value={nodeData.value.toLocaleString()}
124-
// />
125-
// )
126-
// },
127-
// showEditTools: true,
128-
// showOnEdit: true,
129-
// },
130-
],
96+
customNodeDefinitions: [dateNodeDefinition],
13197
// restrictEdit: ({ key }) => key === 'number',
13298
customTextEditorAvailable: true,
13399
restrictTypeSelection: ({ key }) => {
@@ -137,7 +103,7 @@ export const demoDataDefinitions: Record<string, DemoData> = {
137103
'Date',
138104
{
139105
enum: 'Custom Type',
140-
values: ['Option A', 'Option B', 'Option C'],
106+
values: ['Option A 🍏', 'Option B 🍌', 'Option C 🍒'],
141107
matchPriority: 1,
142108
},
143109
]

demo/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2528,10 +2528,10 @@ [email protected]:
25282528
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
25292529
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
25302530

2531-
2532-
version "1.25.6-beta3"
2533-
resolved "https://registry.yarnpkg.com/json-edit-react/-/json-edit-react-1.25.6-beta3.tgz#812d6714d329458adfa85a9548ce9d8590452d8f"
2534-
integrity sha512-6b8C5OSpTzfXKIWSftVYRwyaE9+07L3O4oug6qzEfbgFfjDqNT2t3IzKdsfO5ST5qDEE4SDEYL2BU2awFoMH2A==
2531+
2532+
version "1.25.6"
2533+
resolved "https://registry.yarnpkg.com/json-edit-react/-/json-edit-react-1.25.6.tgz#92a5199b2663695d4d2c950268b8d93f259bbf5d"
2534+
integrity sha512-MrkvpsYm/Vjkgl9bntd3d/BEW+hIOV7STrNMRRyIuZd641L9MA5ZoJvwWBIbK3pY6UwBm45/ImParmQSgm+KSg==
25352535
dependencies:
25362536
object-property-assigner "^1.3.5"
25372537
object-property-extractor "^1.0.13"

scripts/installLatestPackage.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function installLatestPackage() {
2424
// Check if beta tag exists
2525
if (!packageData['dist-tags'].beta) {
2626
console.log('No beta version available. Installing stable version')
27-
installPackage(packageName, betaVersion, foldersToInstall)
27+
installPackage(packageName, stableVersion, foldersToInstall)
2828
return
2929
}
3030

@@ -38,7 +38,7 @@ async function installLatestPackage() {
3838
if (betaDate > stableDate) {
3939
installPackage(packageName, betaVersion, foldersToInstall)
4040
} else {
41-
installPackage(packageName, betaVersion, foldersToInstall)
41+
installPackage(packageName, stableVersion, foldersToInstall)
4242
}
4343
} catch (error) {
4444
console.error('Error checking or installing package:', error.message)

0 commit comments

Comments
 (0)