@sanity/hierarchical-document-list 1.0.0 → 1.1.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.
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.idea/hierarchical-document-list.iml +11 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/vcs.xml +6 -0
- package/CHANGELOG.md +15 -0
- package/README.md +329 -297
- package/commitlint.config.js +3 -0
- package/lib/TreeDeskStructure.d.ts +8 -8
- package/lib/TreeDeskStructure.js +96 -96
- package/lib/TreeInputComponent.d.ts +19 -19
- package/lib/TreeInputComponent.js +50 -52
- package/lib/components/DeskWarning.d.ts +6 -6
- package/lib/components/DeskWarning.js +46 -46
- package/lib/components/DocumentInNode.d.ts +11 -11
- package/lib/components/DocumentInNode.js +81 -82
- package/lib/components/DocumentPreviewStatus.d.ts +7 -7
- package/lib/components/DocumentPreviewStatus.js +39 -39
- package/lib/components/NodeActions.d.ts +10 -10
- package/lib/components/NodeActions.js +61 -61
- package/lib/components/NodeContentRenderer.d.ts +8 -8
- package/lib/components/NodeContentRenderer.js +105 -105
- package/lib/components/PlaceholderDropzone.d.ts +9 -9
- package/lib/components/PlaceholderDropzone.js +30 -30
- package/lib/components/SuppressedDnDManager.d.ts +2 -0
- package/lib/components/SuppressedDnDManager.js +59 -0
- package/lib/components/TreeEditor.d.ts +12 -12
- package/lib/components/TreeEditor.js +74 -59
- package/lib/components/TreeEditorErrorBoundary.d.ts +16 -3
- package/lib/components/TreeEditorErrorBoundary.js +74 -59
- package/lib/components/TreeNodeRenderer.d.ts +3 -3
- package/lib/components/TreeNodeRenderer.js +59 -59
- package/lib/components/TreeNodeRendererScaffold.d.ts +4 -4
- package/lib/components/TreeNodeRendererScaffold.js +44 -44
- package/lib/createDeskHierarchy.d.ts +14 -14
- package/lib/createDeskHierarchy.js +84 -85
- package/lib/createHierarchicalSchemas.d.ts +98 -78
- package/lib/createHierarchicalSchemas.js +138 -138
- package/lib/hooks/useAllItems.d.ts +7 -7
- package/lib/hooks/useAllItems.js +119 -119
- package/lib/hooks/useLocalTree.d.ts +17 -17
- package/lib/hooks/useLocalTree.js +59 -59
- package/lib/hooks/useTreeOperations.d.ts +9 -9
- package/lib/hooks/useTreeOperations.js +39 -39
- package/lib/hooks/useTreeOperationsProvider.d.ts +14 -14
- package/lib/hooks/useTreeOperationsProvider.js +85 -85
- package/lib/index.d.ts +3 -3
- package/lib/index.js +12 -12
- package/lib/schemas/hierarchy.tree.d.ts +13 -13
- package/lib/schemas/hierarchy.tree.js +19 -19
- package/lib/types.d.ts +128 -0
- package/lib/types.js +2 -0
- package/lib/utils/flatDataToTree.d.ts +6 -6
- package/lib/utils/flatDataToTree.js +26 -26
- package/lib/utils/getAdjescentNodes.d.ts +12 -12
- package/lib/utils/getAdjescentNodes.js +19 -19
- package/lib/utils/getCommonTreeProps.d.ts +7 -7
- package/lib/utils/getCommonTreeProps.js +33 -33
- package/lib/utils/getTreeHeight.d.ts +3 -3
- package/lib/utils/getTreeHeight.js +11 -11
- package/lib/utils/gradientPatchAdapter.d.ts +4 -4
- package/lib/utils/gradientPatchAdapter.js +40 -42
- package/lib/utils/idUtils.d.ts +2 -2
- package/lib/utils/idUtils.js +13 -13
- package/lib/utils/injectNodeTypeInPatches.d.ts +12 -12
- package/lib/utils/injectNodeTypeInPatches.js +59 -58
- package/lib/utils/moveItemInArray.d.ts +5 -5
- package/lib/utils/moveItemInArray.js +26 -26
- package/lib/utils/throwError.d.ts +7 -7
- package/lib/utils/throwError.js +12 -12
- package/lib/utils/treeData.d.ts +18 -18
- package/lib/utils/treeData.js +118 -118
- package/lib/utils/treePatches.d.ts +15 -15
- package/lib/utils/treePatches.js +171 -171
- package/lint-staged.config.js +4 -0
- package/package.json +65 -55
- package/sanity.json +12 -12
- package/tsconfig.json +20 -20
package/package.json
CHANGED
|
@@ -1,55 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sanity/hierarchical-document-list",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"author": "Sanity <hello@sanity.io>",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/sanity-io/hierarchical-document-list.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/sanity-io/hierarchical-document-list/issues"
|
|
13
|
-
},
|
|
14
|
-
"homepage": "https://github.com/sanity-io/hierarchical-document-list#readme",
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "tsc -w -d",
|
|
17
|
-
"build": "tsc -d",
|
|
18
|
-
"format": "prettier src -w",
|
|
19
|
-
"lint": "eslint src"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@sanity/hierarchical-document-list",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"author": "Sanity <hello@sanity.io>",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/sanity-io/hierarchical-document-list.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/sanity-io/hierarchical-document-list/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/sanity-io/hierarchical-document-list#readme",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "tsc -w -d",
|
|
17
|
+
"build": "tsc -d",
|
|
18
|
+
"format": "prettier src -w",
|
|
19
|
+
"lint": "eslint src",
|
|
20
|
+
"prepare": "npm run build && husky install",
|
|
21
|
+
"clean": "rimraf lib",
|
|
22
|
+
"release": "standard-version",
|
|
23
|
+
"prepublishOnly": "npm run clean && npm run lint && npm run build"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@commitlint/cli": "^16.2.3",
|
|
27
|
+
"@commitlint/config-conventional": "^16.2.1",
|
|
28
|
+
"@sanity/base": ">= 2.25.0",
|
|
29
|
+
"@sanity/color": "^2.1.6",
|
|
30
|
+
"@sanity/desk-tool": ">= 2.25.0",
|
|
31
|
+
"@sanity/form-builder": "^2.25.0",
|
|
32
|
+
"@sanity/icons": ">= 1.2.0",
|
|
33
|
+
"@sanity/ui": ">= 0.37.0",
|
|
34
|
+
"@types/assert": "^1.5.6",
|
|
35
|
+
"@types/react": "^17.0.38",
|
|
36
|
+
"@types/react-dom": "^17.0.11",
|
|
37
|
+
"@types/react-sortable-tree": "^0.3.14",
|
|
38
|
+
"@types/styled-components": "^5.1.21",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
40
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
41
|
+
"eslint": "^8.7.0",
|
|
42
|
+
"eslint-config-prettier": "^8.3.0",
|
|
43
|
+
"eslint-config-sanity": "^5.1.0",
|
|
44
|
+
"husky": "^7.0.4",
|
|
45
|
+
"lint-staged": "^12.3.7",
|
|
46
|
+
"prettier": "^2.5.1",
|
|
47
|
+
"react": "^17.0.2",
|
|
48
|
+
"react-dom": "^17.0.2",
|
|
49
|
+
"rimraf": "^3.0.2",
|
|
50
|
+
"standard-version": "^9.3.2",
|
|
51
|
+
"styled-components": "^5.3.3",
|
|
52
|
+
"typescript": "^4.5.5"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"assert": "^2.0.0",
|
|
56
|
+
"react-sortable-tree": "^2.8.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@sanity/base": ">= 2.25.0",
|
|
60
|
+
"@sanity/desk-tool": ">= 2.25.0",
|
|
61
|
+
"react": "^17.0.2",
|
|
62
|
+
"react-dom": "^17.0.2",
|
|
63
|
+
"styled-components": ">= 5.2.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/sanity.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"paths": {
|
|
3
|
-
"source": "./src",
|
|
4
|
-
"compiled": "./lib"
|
|
5
|
-
},
|
|
6
|
-
"parts": [
|
|
7
|
-
{
|
|
8
|
-
"implements": "part:@sanity/base/schema-type",
|
|
9
|
-
"path": "schemas/hierarchy.tree.js"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"paths": {
|
|
3
|
+
"source": "./src",
|
|
4
|
+
"compiled": "./lib"
|
|
5
|
+
},
|
|
6
|
+
"parts": [
|
|
7
|
+
{
|
|
8
|
+
"implements": "part:@sanity/base/schema-type",
|
|
9
|
+
"path": "schemas/hierarchy.tree.js"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
-
"allowJs": false,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"allowSyntheticDefaultImports": false,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"module": "CommonJS",
|
|
13
|
-
"moduleResolution": "Node",
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
"outDir": "lib"
|
|
18
|
-
},
|
|
19
|
-
"include": ["./src"]
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": false,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"module": "CommonJS",
|
|
13
|
+
"moduleResolution": "Node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
"outDir": "lib"
|
|
18
|
+
},
|
|
19
|
+
"include": ["./src"]
|
|
20
|
+
}
|