@headless-tree/core 0.0.0-20250605151920 → 0.0.0-20250611144718
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/CHANGELOG.md +12 -1
- package/lib/cjs/core/create-tree.js +0 -1
- package/lib/cjs/features/tree/feature.js +1 -0
- package/lib/cjs/features/tree/types.d.ts +1 -0
- package/lib/cjs/test-utils/test-tree.js +1 -0
- package/lib/esm/core/create-tree.js +0 -1
- package/lib/esm/features/tree/feature.js +1 -0
- package/lib/esm/features/tree/types.d.ts +1 -0
- package/lib/esm/test-utils/test-tree.js +1 -0
- package/package.json +7 -2
- package/src/core/create-tree.ts +0 -1
- package/src/features/tree/feature.ts +1 -0
- package/src/features/tree/types.ts +1 -0
- package/src/test-utils/test-tree.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# @headless-tree/core
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20250611144718
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 647a072: Fixed incorrect package.json exports configurations to proper ESM and CJS exports (#104)
|
|
8
|
+
- 349d36e: change package.json["module"] to commonjs to fix inconsistent package definitiuons (#104)
|
|
9
|
+
- e2faf37: Fixed an issue async data loaders that resolve data before the tree is mounted can cause the tree to not render at all
|
|
10
|
+
|
|
11
|
+
Note: When using the `createTree()` API directly instead of going through the React `useTree` API, an additional call
|
|
12
|
+
to `tree.rebuildItems()` afterwards will be necessary. This change is marked as minor release regardless, since `createTree` is
|
|
13
|
+
currently not a publically documented feature.
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
6
16
|
|
|
7
17
|
- 727c982: export makeStateUpdater from core package
|
|
18
|
+
- 2887b0c: Added a `item.getKey()` utility method to use for generating React keys. For now, this just returns the item id, so no migration is needed from using `item.getId()` as React keys.
|
|
8
19
|
|
|
9
20
|
## 1.1.0
|
|
10
21
|
|
|
@@ -100,6 +100,7 @@ exports.treeFeature = {
|
|
|
100
100
|
(_d = item.getElement()) === null || _d === void 0 ? void 0 : _d.scrollIntoView(scrollIntoViewArg);
|
|
101
101
|
}),
|
|
102
102
|
getId: ({ itemId }) => itemId,
|
|
103
|
+
getKey: ({ itemId }) => itemId, // TODO apply to all stories to use
|
|
103
104
|
getProps: ({ item, prev }) => {
|
|
104
105
|
const itemMeta = item.getItemMeta();
|
|
105
106
|
return Object.assign(Object.assign({}, prev === null || prev === void 0 ? void 0 : prev()), { ref: item.registerElement, role: "treeitem", "aria-setsize": itemMeta.setSize, "aria-posinset": itemMeta.posInSet, "aria-selected": "false", "aria-label": item.getItemName(), "aria-level": itemMeta.level, tabIndex: item.isFocused() ? 0 : -1, onClick: (e) => {
|
|
@@ -97,6 +97,7 @@ export const treeFeature = {
|
|
|
97
97
|
(_d = item.getElement()) === null || _d === void 0 ? void 0 : _d.scrollIntoView(scrollIntoViewArg);
|
|
98
98
|
}),
|
|
99
99
|
getId: ({ itemId }) => itemId,
|
|
100
|
+
getKey: ({ itemId }) => itemId, // TODO apply to all stories to use
|
|
100
101
|
getProps: ({ item, prev }) => {
|
|
101
102
|
const itemMeta = item.getItemMeta();
|
|
102
103
|
return Object.assign(Object.assign({}, prev === null || prev === void 0 ? void 0 : prev()), { ref: item.registerElement, role: "treeitem", "aria-setsize": itemMeta.setSize, "aria-posinset": itemMeta.posInSet, "aria-selected": "false", "aria-label": item.getItemName(), "aria-level": itemMeta.level, tabIndex: item.isFocused() ? 0 : -1, onClick: (e) => {
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-tree/core",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "0.0.0-20250611144718",
|
|
5
4
|
"main": "lib/cjs/index.js",
|
|
6
5
|
"module": "lib/esm/index.js",
|
|
7
6
|
"types": "lib/esm/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"types": "./lib/esm/index.d.ts",
|
|
9
|
+
"import": "./lib/esm/index.js",
|
|
10
|
+
"default": "./lib/cjs/index.js"
|
|
11
|
+
},
|
|
8
12
|
"sideEffects": false,
|
|
9
13
|
"scripts": {
|
|
10
14
|
"build:cjs": "tsc -m commonjs --outDir lib/cjs",
|
|
@@ -18,6 +22,7 @@
|
|
|
18
22
|
"directory": "packages/core"
|
|
19
23
|
},
|
|
20
24
|
"author": "Lukas Bach <npm@lukasbach.com>",
|
|
25
|
+
"funding": "https://github.com/sponsors/lukasbach",
|
|
21
26
|
"license": "MIT",
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"jsdom": "^26.0.0",
|
package/src/core/create-tree.ts
CHANGED
|
@@ -126,6 +126,7 @@ export const treeFeature: FeatureImplementation<any> = {
|
|
|
126
126
|
item.getElement()?.scrollIntoView(scrollIntoViewArg);
|
|
127
127
|
},
|
|
128
128
|
getId: ({ itemId }) => itemId,
|
|
129
|
+
getKey: ({ itemId }) => itemId, // TODO apply to all stories to use
|
|
129
130
|
getProps: ({ item, prev }) => {
|
|
130
131
|
const itemMeta = item.getItemMeta();
|
|
131
132
|
return {
|