@aiquants/directory-tree 3.4.0 → 3.5.1
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/dist/DirectoryTree.d.ts.map +1 -1
- package/dist/DirectoryTreeGrid.d.ts +4 -0
- package/dist/DirectoryTreeGrid.d.ts.map +1 -1
- package/dist/entryRendering.d.ts +17 -0
- package/dist/entryRendering.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +800 -765
- package/dist/styles/directory-tree.standalone.css +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DirectoryTree.spec.md +23 -4
- package/src/DirectoryTree.tsx +45 -3
- package/src/DirectoryTreeGrid.tsx +12 -1
- package/src/entryRendering.tsx +46 -0
- package/src/types.ts +28 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
2
|
/*! @aiquants/directory-tree standalone CSS — 非 Tailwind ホスト専用。ホストの Tailwind ビルドと混在させないこと */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer components{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-pupil{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-rod{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}.dt-grid{flex-direction:column;display:flex;position:relative}.dt-grid-body{flex:1;min-height:0;position:relative}.dt-grid-header,.dt-grid-footer,.dt-grid-row,.dt-grid-hscrollbar-row{align-items:stretch;display:flex}.dt-grid-name-cell,.dt-grid-name-header,.dt-grid-name-footer{z-index:1;flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.dt-grid-numeric-viewport{flex:1;position:relative;overflow:hidden}.dt-grid-numeric-track{transform:translateX(calc(-1 * var(--dt-hscroll,0px)));will-change:transform;display:grid}.dt-grid-cell{white-space:nowrap;text-overflow:ellipsis;align-items:center;padding:0 8px;display:flex;overflow:hidden}.dt-grid-cell--right{text-align:right;justify-content:flex-end}.dt-grid-cell--center{text-align:center;justify-content:center}.dt-grid-name-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dt-grid-scrollbar-spacer{flex-shrink:0}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.flex{display:flex}.grid{display:grid}.inline{display:inline}.table{display:table}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/10{background-color:color-mix(in oklab, var(--color-blue-400) 10%, transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/20{background-color:color-mix(in oklab, var(--color-blue-400) 20%, transparent)}}.px-1{padding-inline:calc(var(--spacing) * 1)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.pr-\[2px\]{padding-right:2px}.pb-\[3px\]{padding-bottom:3px}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-sky-500{color:var(--color-sky-500)}.text-teal-500{color:var(--color-teal-500)}.text-violet-500{color:var(--color-violet-500)}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab, var(--color-gray-400) 15%, transparent)}}}.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:#54a2ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 15%, transparent)}}.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:#54a2ff40}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 25%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-300:where(.dark,.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-orange-400:where(.dark,.dark *){color:var(--color-orange-400)}.dark\:text-pink-400:where(.dark,.dark *){color:var(--color-pink-400)}.dark\:text-purple-400:where(.dark,.dark *){color:var(--color-purple-400)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\:text-teal-400:where(.dark,.dark *){color:var(--color-teal-400)}.dark\:text-violet-400:where(.dark,.dark *){color:var(--color-violet-400)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]:where(.dark,.dark *){--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-gray-200) 10%, transparent)}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer components{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-pupil{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-rod{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}.dt-grid{flex-direction:column;display:flex;position:relative}.dt-grid-body{flex:1;min-height:0;position:relative}.dt-grid-header,.dt-grid-footer,.dt-grid-row,.dt-grid-hscrollbar-row{align-items:stretch;display:flex}.dt-grid-name-cell,.dt-grid-name-header,.dt-grid-name-footer{z-index:1;flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.dt-grid-numeric-viewport{flex:1;position:relative;overflow:hidden}.dt-grid-numeric-track{transform:translateX(calc(-1 * var(--dt-hscroll,0px)));will-change:transform;display:grid}.dt-grid-cell{white-space:nowrap;text-overflow:ellipsis;align-items:center;padding:0 8px;display:flex;overflow:hidden}.dt-grid-cell--right{text-align:right;justify-content:flex-end}.dt-grid-cell--center{text-align:center;justify-content:center}.dt-grid-name-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dt-grid-scrollbar-spacer{flex-shrink:0}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.flex{display:flex}.grid{display:grid}.inline{display:inline}.table{display:table}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/10{background-color:color-mix(in oklab, var(--color-blue-400) 10%, transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-400\/20{background-color:color-mix(in oklab, var(--color-blue-400) 20%, transparent)}}.px-1{padding-inline:calc(var(--spacing) * 1)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.pr-\[2px\]{padding-right:2px}.pb-\[3px\]{padding-bottom:3px}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-amber-500{color:var(--color-amber-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-500{color:var(--color-purple-500)}.text-red-500{color:var(--color-red-500)}.text-sky-500{color:var(--color-sky-500)}.text-teal-500{color:var(--color-teal-500)}.text-violet-500{color:var(--color-violet-500)}.lowercase{text-transform:lowercase}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab, var(--color-gray-400) 15%, transparent)}}}.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:#54a2ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/15:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 15%, transparent)}}.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:#54a2ff40}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/25:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 25%, transparent)}}.dark\:text-amber-400:where(.dark,.dark *){color:var(--color-amber-400)}.dark\:text-blue-300:where(.dark,.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:where(.dark,.dark *){color:var(--color-blue-400)}.dark\:text-emerald-400:where(.dark,.dark *){color:var(--color-emerald-400)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-gray-300:where(.dark,.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400)}.dark\:text-orange-400:where(.dark,.dark *){color:var(--color-orange-400)}.dark\:text-pink-400:where(.dark,.dark *){color:var(--color-pink-400)}.dark\:text-purple-400:where(.dark,.dark *){color:var(--color-purple-400)}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400)}.dark\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\:text-teal-400:where(.dark,.dark *){color:var(--color-teal-400)}.dark\:text-violet-400:where(.dark,.dark *){color:var(--color-violet-400)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]:where(.dark,.dark *){--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-gray-200\/10:where(.dark,.dark *):hover{background-color:color-mix(in oklab, var(--color-gray-200) 10%, transparent)}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
|
package/dist/types.d.ts
CHANGED
|
@@ -31,6 +31,22 @@ export type DirectoryEntry = {
|
|
|
31
31
|
* エントリ用のオプションのインラインスタイル。
|
|
32
32
|
*/
|
|
33
33
|
style?: CSSProperties;
|
|
34
|
+
/**
|
|
35
|
+
* Extra `data-*` attributes rendered on this entry's row. Keys are given **without** the
|
|
36
|
+
* `data-` prefix (`{ open: true }` renders `data-open="true"`); values are stringified.
|
|
37
|
+
* camelCase keys are converted to kebab-case exactly as the DOM `dataset` API does
|
|
38
|
+
* (`{ panelCount: 2 }` renders `data-panel-count="2"`).
|
|
39
|
+
*
|
|
40
|
+
* この行へ付与する追加の `data-*` 属性。キーは `data-` を**含めずに**渡し
|
|
41
|
+
* (`{ open: true }` は `data-open="true"` になる)、値は文字列化される。
|
|
42
|
+
* camelCase のキーは DOM の `dataset` と同じ規約で kebab-case へ変換される
|
|
43
|
+
* (`{ panelCount: 2 }` は `data-panel-count="2"`)。
|
|
44
|
+
*
|
|
45
|
+
* @remarks 用途は、状態を CSS クラスではなく属性として公開し、テストやスタイルが
|
|
46
|
+
* クラス名に依存しないようにすること。クラス名は整形や prefix 変更で無言に壊れる。
|
|
47
|
+
* このコンポーネント自身が出力する `data-entry-*` は上書きできない (常に後勝ち)。
|
|
48
|
+
*/
|
|
49
|
+
data?: Record<string, string | number | boolean>;
|
|
34
50
|
};
|
|
35
51
|
/**
|
|
36
52
|
* Comparator applied to a sibling group before the tree is flattened into rows.
|
|
@@ -531,6 +547,18 @@ export type UseDirectoryTreeStateProps = {
|
|
|
531
547
|
export type DirectoryEntryItemProps = {
|
|
532
548
|
entry: DirectoryEntry;
|
|
533
549
|
indentLevel: number;
|
|
550
|
+
/**
|
|
551
|
+
* Logical depth from the roots, 0-based, independent of the visual indent.
|
|
552
|
+
* ルートからの論理的な深さ (0 始まり)。視覚的インデントとは独立。
|
|
553
|
+
*
|
|
554
|
+
* `visual.removeRootIndent` は `indentLevel` を負方向へずらすため、`aria-level` の算出には
|
|
555
|
+
* こちらを用いる (支援技術へ伝えるのは見た目のずれではなく実際の階層)。
|
|
556
|
+
*/
|
|
557
|
+
depth: number;
|
|
558
|
+
/** 1-based position among its siblings (`aria-posinset`). / 兄弟内の位置 (1 始まり)。 */
|
|
559
|
+
positionInSet: number;
|
|
560
|
+
/** Number of siblings in the same group (`aria-setsize`). / 同一グループの兄弟数。 */
|
|
561
|
+
setSize: number;
|
|
534
562
|
/** Resolved height of this row in px. / この行の解決済み高さ (px)。 */
|
|
535
563
|
rowHeight: number;
|
|
536
564
|
isDirOpen: (path: string) => boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,yBAAyB,CAAA;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB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+4,8 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Date | Author | Reviewer | Approver | Summary of Changes |
|
|
6
6
|
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
7
|
+
| 3.5.1 | 2026-08-08 | Claude Opus 5 | | | Hardening of the 3.5.0 `data` API after adversarial review. `null` / `undefined` values now omit the attribute entirely instead of rendering `data-x="undefined"` — the type forbids them, but a dynamic or JS-side value can still produce one, and a consumer testing attribute *presence* would read that as a real state. The key-conversion contract is also corrected: it lowercases and inserts a dash before a capital that follows a lowercase letter or digit, which is **not** identical to the DOM `dataset` reverse mapping (`aBC` becomes `a-bc`, not `a-b-c`) and is **not injective** (`panelCount` and `panel-count` collapse to the same attribute; within one object the later key wins). 3.5.0 documented these as equivalent, which was wrong. Tests added for the nullish case and for grid-mode `data-*` + position output. |
|
|
8
|
+
| 3.5.0 | 2026-08-08 | Claude Opus 5 | | | Rows now declare their position in the tree: `aria-level` (1-based **logical** depth, so `visual.removeRootIndent` no longer misreports the hierarchy it only shifts visually), `aria-posinset` and `aria-setsize`, taken from the **post-sort** sibling order so the announced position always matches the rendered one. Grid rows gain `aria-posinset` / `aria-setsize` alongside the `aria-level` they already had. New `DirectoryEntry.data` renders extra `data-*` attributes on the row so consumers can expose state as attributes instead of CSS classes (class names are a styling contract and break silently under utility refactors); keys are given without the `data-` prefix and camelCase is converted to kebab-case exactly as the DOM `dataset` API does, since React otherwise drops the attribute with only a warning. The component's own `data-entry-*` attributes cannot be overridden. Also completes the pass-through audit started in 3.4.0: `virtualScroll.testId` and `virtualScroll.contentProps` were accepted by the type but never forwarded, and are now forwarded (they target the scroll pane, a different element from the `role="tree"` container this component owns, so there is no ARIA conflict). |
|
|
7
9
|
| 3.4.0 | 2026-08-08 | Claude Opus 5 | | | Add the optional top-level `sort` prop (`DirectoryEntryComparator`), applied to every sibling group inside `collectTreeData` immediately before flattening. Only a shallow copy of each sibling array is sorted, so every `DirectoryEntry` object and every `children` array keeps its identity and consumer-side memoization (row memo, reference-preserving decorators, hydration caches) survives a re-sort; the caller's `entries` arrays are never mutated. `isLastChild` and the ancestor chain derive from the loop index, so connector geometry follows the sorted order automatically, in grid mode too. Ordering is deliberately a top-level prop rather than a `visual` member because it changes row semantics rather than presentation. Also fixes a latent defect exposed by any reordering: `virtualScroll.getItemKey` was accepted by the type but never destructured or forwarded, so `VirtualScroll` fell back to index keying and every row whose index-to-entry mapping changed was unmounted and remounted; it is now forwarded, defaulting to `entry.absolutePath`. |
|
|
8
10
|
| 3.1.0 | 2026-07-31 | Claude Opus 5 | | | Add opt-in `virtualScroll.preserveScrollAnchor`: when the row list mutates (e.g. streaming insertions above the viewport), the first visible row is kept visually stationary via a pre-paint (`useLayoutEffect`) scroll correction. Pure helpers `captureScrollAnchor` / `resolveAnchorScroll` live in `scrollAnchor.ts` (unit-tested). The anchor is captured from the **live pane position** (`getScrollPosition()`, inset-adjusted) rather than the RAF-throttled `onScroll` mirror, so corrections landing mid-scroll do not rubber-band by the notification lag; the handle's clamped return value is adopted, and the component's own `scrollPosition` state is updated **in the same pre-paint flush** so the tree-line canvas / expand glyphs never misalign from the rows. No correction at the top of the list (scroll 0) and pixel-position fallback when the anchored row vanished. Known trade-off: the programmatic correction goes through the ScrollPane handle, which stops an in-progress pointer-drag inertia fling (same as the pre-existing compensation path). Also removed a leftover dead `isEmpty` local. |
|
|
9
11
|
| 3.0.1 | 2026-07-07 | Antigravity | | | Fix: `columns[0].className` is now correctly applied to the name column cells in the header and footer (TreeGrid mode), ensuring consistency with body rows and data columns. |
|
|
@@ -121,6 +123,13 @@ The fundamental data structure for representing a file or directory.
|
|
|
121
123
|
| `absolutePath` | `string` | The absolute path of the entry. エントリの絶対パス。 |
|
|
122
124
|
| `relativePath` | `string` | The path of the entry relative to the root. ルートからの相対パス。 |
|
|
123
125
|
| `children` | `DirectoryEntry[] \| null` | An array of child entries if it's a directory, otherwise `null`. ディレクトリの場合は子エントリの配列、それ以外の場合は `null`。 |
|
|
126
|
+
| `data` | `Record<string, string \| number \| boolean>` | Extra `data-*` attributes rendered on this entry's row. Keys omit the `data-` prefix; a dash is inserted before each capital following a lowercase letter or digit and the whole key is lowercased (`{ panelCount: 2 }` → `data-panel-count="2"`). This is **not** the DOM `dataset` reverse mapping (`aBC` → `a-bc`) and is **not injective** (`panelCount` and `panel-count` collide; the later key wins). Values are stringified; `null` / `undefined` omit the attribute. The component's own `data-entry-*` attributes always win. この行へ付与する追加の `data-*` 属性。キーは `data-` を含めず、camelCase は `dataset` と同じ規約で kebab-case になる。自前の `data-entry-*` は上書き不可。 |
|
|
127
|
+
|
|
128
|
+
**Why `data` exists**: it lets a consumer expose row state as an *attribute* rather than as a CSS class, so
|
|
129
|
+
styling and test locators never depend on class names — those are a styling contract that changes freely under
|
|
130
|
+
utility refactors, prefix migrations and class sorting, and break silently when they do.
|
|
131
|
+
`data` は行の状態を CSS クラスではなく属性として公開するための口。クラス名はスタイリング契約であり、
|
|
132
|
+
整形や prefix 変更で無言に壊れるため、スタイルやテストの依存先にしない。
|
|
124
133
|
|
|
125
134
|
### 3.2. Props
|
|
126
135
|
|
|
@@ -251,8 +260,10 @@ export type DirectoryEntryComparator = (a: DirectoryEntry, b: DirectoryEntry) =>
|
|
|
251
260
|
5. **Stable reference required** (memoize with `useMemo` / `useCallback`) — a new identity each render re-runs the
|
|
252
261
|
whole traversal, the same constraint as `visual.itemHeight` and `grid.columns`.
|
|
253
262
|
6. Omitting `sort` skips the copy entirely: entries render in exactly the order given.
|
|
254
|
-
7. Sorting is applied to rows only
|
|
255
|
-
order
|
|
263
|
+
7. Sorting is applied to **rows only**. `grid.columns[].footer` still receives every node of the `entries` prop in the
|
|
264
|
+
**prop's** order, not the rendered order. Most footers aggregate (sum / count) and are unaffected, but a footer whose
|
|
265
|
+
output depends on order (e.g. "first item", a running sequence) must apply the same comparator itself.
|
|
266
|
+
フッタは描画順ではなく `entries` の順序で全ノードを受け取る。順序に依存するフッタは同じ比較関数を自前で適用すること。
|
|
256
267
|
|
|
257
268
|
**Row keying.** `virtualScroll.getItemKey` is forwarded to `VirtualScroll`, and when it is omitted rows are keyed by
|
|
258
269
|
`entry.absolutePath` instead of by index. This is what lets a re-sort *move* existing rows rather than unmount and
|
|
@@ -511,13 +522,21 @@ guards). Run `pnpm run test:coverage`.
|
|
|
511
522
|
* **Row stability**: re-rendering with a different comparator *moves* the DOM node of an unchanged entry rather than recreating it.
|
|
512
523
|
* **`getItemKey` forwarding**: a caller-supplied `virtualScroll.getItemKey` is actually invoked, and the default keys rows by `absolutePath` (proven by reordering `entries` and asserting DOM-node identity).
|
|
513
524
|
|
|
514
|
-
### 9.5.
|
|
525
|
+
### 9.5. Row position semantics, `data-*` and pass-through ([DirectoryTree.a11y-and-passthrough.test.tsx](../tests/DirectoryTree.a11y-and-passthrough.test.tsx))
|
|
526
|
+
|
|
527
|
+
* **`aria-level`**: 1-based logical depth for roots and nested rows, and **unchanged by `visual.removeRootIndent`** (which shifts only the visual indent).
|
|
528
|
+
* **`aria-posinset` / `aria-setsize`**: position and sibling count per group, independent between a parent's group and its children's.
|
|
529
|
+
* **Post-sort position**: with a comparator applied, the announced position matches the rendered order at every depth — the announcement can never contradict what is drawn.
|
|
530
|
+
* **`entry.data`**: rendered as `data-*`; camelCase converted to kebab-case; absent/empty `data` adds no attributes; the component's own `data-entry-*` cannot be overridden.
|
|
531
|
+
* **Pass-through**: `virtualScroll.testId` and `virtualScroll.contentProps` actually reach `VirtualScroll` (regression gate for the typed-but-dropped class of defect).
|
|
532
|
+
|
|
533
|
+
### 9.6. Pure helpers
|
|
515
534
|
|
|
516
535
|
* **[gridUtils.test.ts](../tests/gridUtils.test.ts)**: `buildNumericTemplate`, `computeGridMetrics`, `clampHScroll`, `flattenAllEntries` (incl. default/invalid widths, zero-width viewport, NaN clamp).
|
|
517
536
|
* **[treeLineGeometry.test.ts](../tests/treeLineGeometry.test.ts)**: `buildTreeLineGeometry` — every connector variant (directory/file, last-child, ancestor lines, glyphs), `hideLines` skip, empty input, glyph-size fallback, and defensive out-of-bounds fallbacks.
|
|
518
537
|
* **[useEntryInteraction.test.tsx](../tests/useEntryInteraction.test.tsx)**: file select, directory single-click (delayed toggle), double-click (recursive), `preventDefault`, unmount timer cleanup.
|
|
519
538
|
* **[entryRendering.test.tsx](../tests/entryRendering.test.tsx)**: `resolveExpandIcon`, `resolveEntryIcon` (all icon paths + sanitizer edge cases), `getFileExtension`.
|
|
520
539
|
|
|
521
|
-
### 9.
|
|
540
|
+
### 9.7. VirtualScroll horizontal wheel (`@aiquants/virtualscroll`)
|
|
522
541
|
|
|
523
542
|
* **[wheel-horizontal.spec.tsx](../../virtualscroll/tests/integration/wheel-horizontal.spec.tsx)**: `onWheelHorizontal` fires on horizontal-dominant / shift+wheel gestures, not on vertical-dominant; `deltaMode` LINE/PAGE scaling; a no-op (backward-compatible) when the handler is absent.
|
package/src/DirectoryTree.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import type { CSSProperties, MouseEvent } from "react"
|
|
|
8
8
|
import { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"
|
|
9
9
|
import { twMerge } from "tailwind-merge"
|
|
10
10
|
import { DirectoryTreeGridFooterRow, DirectoryTreeGridHeaderRow, DirectoryTreeGridRow } from "./DirectoryTreeGrid.tsx"
|
|
11
|
-
import { DEFAULT_ITEM_HEIGHT, directoryTreeClasses, EXPAND_GLYPH_SIZE, getFileExtension, INDENT_SIZE, resolveEntryIcon, resolveExpandIcon } from "./entryRendering.tsx"
|
|
11
|
+
import { DEFAULT_ITEM_HEIGHT, directoryTreeClasses, EXPAND_GLYPH_SIZE, getFileExtension, INDENT_SIZE, resolveEntryIcon, resolveExpandIcon, toDataAttributes } from "./entryRendering.tsx"
|
|
12
12
|
import { buildNumericTemplate, clampHScroll, computeGridMetrics, DEFAULT_GRID_SCROLLBAR_WIDTH, flattenAllEntries } from "./gridUtils.ts"
|
|
13
13
|
import { captureScrollAnchor, resolveAnchorScroll } from "./scrollAnchor.ts"
|
|
14
14
|
import { TreeLine } from "./TreeLine.tsx"
|
|
@@ -40,7 +40,18 @@ const applyWebkitScrollbarHide = () => {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
type FlattenedEntry = {
|
|
43
|
+
type FlattenedEntry = {
|
|
44
|
+
entry: DirectoryEntry
|
|
45
|
+
/** 視覚的インデント段数 (removeRootIndent で負になり得る)。 */
|
|
46
|
+
indentLevel: number
|
|
47
|
+
/** ルートからの論理的な深さ (0 始まり)。`aria-level` の算出に使う。 */
|
|
48
|
+
depth: number
|
|
49
|
+
/** 兄弟内の位置 (1 始まり)。 */
|
|
50
|
+
positionInSet: number
|
|
51
|
+
/** 同一グループの兄弟数。 */
|
|
52
|
+
setSize: number
|
|
53
|
+
parentIsLast: boolean[]
|
|
54
|
+
}
|
|
44
55
|
|
|
45
56
|
/** A flattened entry with its resolved row height. / 解決済みの行高を持つフラット化エントリ。 */
|
|
46
57
|
type VirtualItem = FlattenedEntry & { rowHeight: number }
|
|
@@ -83,7 +94,8 @@ const collectTreeData = (entries: DirectoryEntry[], resolver: (absolutePath: str
|
|
|
83
94
|
effectiveAncestorChain = ancestorChain.slice(1)
|
|
84
95
|
}
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
// 位置情報は並べ替え後の ordered から採るため、aria の申告は実際の描画順と常に一致する
|
|
98
|
+
flatItems.push({ entry, indentLevel: effectiveIndentLevel, depth: indentLevel, positionInSet: index + 1, setSize: ordered.length, parentIsLast: effectiveNextAncestorChain })
|
|
87
99
|
|
|
88
100
|
if (includeTreeLines) {
|
|
89
101
|
if (effectiveIndentLevel > maxIndent) {
|
|
@@ -323,6 +335,9 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
323
335
|
({
|
|
324
336
|
entry,
|
|
325
337
|
indentLevel,
|
|
338
|
+
depth,
|
|
339
|
+
positionInSet,
|
|
340
|
+
setSize,
|
|
326
341
|
rowHeight,
|
|
327
342
|
isDirOpen,
|
|
328
343
|
parentIsLast,
|
|
@@ -402,6 +417,9 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
402
417
|
...(!isDirectory && (isSelected || isItemSelected) ? highlightStyles?.itemSelectedStyle : {}),
|
|
403
418
|
}
|
|
404
419
|
|
|
420
|
+
// 利用側が渡した data-* 属性。自身が出力する data-entry-* より前に展開し、後勝ちで守る
|
|
421
|
+
const customDataAttributes = toDataAttributes(entry.data)
|
|
422
|
+
|
|
405
423
|
const typeIconStyle = typeIconSize ? { width: typeIconSize, height: typeIconSize } : undefined
|
|
406
424
|
const fontSizeStyle = fontSize ? { fontSize: typeof fontSize === "number" ? `${fontSize}px` : fontSize } : undefined
|
|
407
425
|
|
|
@@ -419,6 +437,7 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
419
437
|
...entryStyle,
|
|
420
438
|
...entry.style,
|
|
421
439
|
}}
|
|
440
|
+
{...customDataAttributes}
|
|
422
441
|
data-entry-type={isDirectory ? "directory" : "file"}
|
|
423
442
|
data-entry-expanded={isDirectory ? String(isExpanded) : undefined}
|
|
424
443
|
data-entry-selected={isSelected ? "true" : undefined}
|
|
@@ -430,6 +449,9 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
430
449
|
tabIndex={0}
|
|
431
450
|
role="treeitem"
|
|
432
451
|
aria-expanded={isDirectory ? isExpanded : undefined}
|
|
452
|
+
aria-level={depth + 1}
|
|
453
|
+
aria-posinset={positionInSet}
|
|
454
|
+
aria-setsize={setSize}
|
|
433
455
|
aria-label={`${entry.name} (${isDirectory ? "directory" : "file"})`}>
|
|
434
456
|
{(showExpandIcons || useCanvasExpandIcons) && <span className={expandIconClasses}>{expandIconContent}</span>}
|
|
435
457
|
{(isDirectory ? showDirectoryIcons : showFileIcons) && (
|
|
@@ -457,6 +479,9 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
457
479
|
key={child.absolutePath}
|
|
458
480
|
entry={child}
|
|
459
481
|
indentLevel={indentLevel + 1}
|
|
482
|
+
depth={depth + 1}
|
|
483
|
+
positionInSet={index + 1}
|
|
484
|
+
setSize={childrenToRender.length}
|
|
460
485
|
// 非仮想化の再帰描画では親行の高さを一様に流用する (DirectoryTree は renderChildren=false のため通常この経路は通らない)。
|
|
461
486
|
rowHeight={rowHeight}
|
|
462
487
|
isDirOpen={isDirOpen}
|
|
@@ -497,6 +522,10 @@ const DirectoryEntryItem = memo<DirectoryEntryItemProps>(
|
|
|
497
522
|
|
|
498
523
|
return (
|
|
499
524
|
prev.indentLevel === next.indentLevel &&
|
|
525
|
+
// 位置情報は aria として描画されるため、変化したら再描画が必要
|
|
526
|
+
prev.depth === next.depth &&
|
|
527
|
+
prev.positionInSet === next.positionInSet &&
|
|
528
|
+
prev.setSize === next.setSize &&
|
|
500
529
|
prev.rowHeight === next.rowHeight &&
|
|
501
530
|
prevExpanded === nextExpanded &&
|
|
502
531
|
prev.selection.selectedPath === next.selection.selectedPath &&
|
|
@@ -607,6 +636,10 @@ export const DirectoryTree = ({
|
|
|
607
636
|
behaviorOptions,
|
|
608
637
|
preserveScrollAnchor = false,
|
|
609
638
|
getItemKey: userGetItemKey,
|
|
639
|
+
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
640
|
+
// (`role="tree"` は本コンポーネント自身のコンテナに付くため contentProps とは別要素で衝突しない)
|
|
641
|
+
testId,
|
|
642
|
+
contentProps,
|
|
610
643
|
}: DirectoryTreeVirtualScrollOptions = virtualScrollOptions ?? {}
|
|
611
644
|
|
|
612
645
|
const [scrollPosition, setScrollPosition] = useState(typeof initialScrollOffset === "number" ? initialScrollOffset : 0)
|
|
@@ -879,6 +912,8 @@ export const DirectoryTree = ({
|
|
|
879
912
|
getItem={getItem}
|
|
880
913
|
getItemHeight={getItemHeight}
|
|
881
914
|
getItemKey={resolvedGetItemKey}
|
|
915
|
+
testId={testId}
|
|
916
|
+
contentProps={contentProps}
|
|
882
917
|
viewportSize={viewportHeight}
|
|
883
918
|
overscanCount={userOverscanCount}
|
|
884
919
|
onScroll={handleVirtualScroll}
|
|
@@ -913,6 +948,8 @@ export const DirectoryTree = ({
|
|
|
913
948
|
key={item.entry.absolutePath}
|
|
914
949
|
entry={item.entry}
|
|
915
950
|
indentLevel={item.indentLevel}
|
|
951
|
+
positionInSet={item.positionInSet}
|
|
952
|
+
setSize={item.setSize}
|
|
916
953
|
rowHeight={item.rowHeight}
|
|
917
954
|
isDirOpen={safeIsExpanded}
|
|
918
955
|
columns={grid.columns}
|
|
@@ -931,6 +968,9 @@ export const DirectoryTree = ({
|
|
|
931
968
|
key={item.entry.absolutePath}
|
|
932
969
|
entry={item.entry}
|
|
933
970
|
indentLevel={item.indentLevel}
|
|
971
|
+
depth={item.depth}
|
|
972
|
+
positionInSet={item.positionInSet}
|
|
973
|
+
setSize={item.setSize}
|
|
934
974
|
rowHeight={item.rowHeight}
|
|
935
975
|
isDirOpen={safeIsExpanded}
|
|
936
976
|
parentIsLast={item.parentIsLast}
|
|
@@ -964,6 +1004,8 @@ export const DirectoryTree = ({
|
|
|
964
1004
|
getItem,
|
|
965
1005
|
getItemHeight,
|
|
966
1006
|
resolvedGetItemKey,
|
|
1007
|
+
testId,
|
|
1008
|
+
contentProps,
|
|
967
1009
|
viewportHeight,
|
|
968
1010
|
userOverscanCount,
|
|
969
1011
|
handleVirtualScroll,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type { CSSProperties, MouseEvent, ReactNode } from "react"
|
|
12
12
|
import { memo, useState } from "react"
|
|
13
13
|
import { twMerge } from "tailwind-merge"
|
|
14
|
-
import { directoryTreeClasses, getFileExtension, INDENT_SIZE, resolveEntryIcon, resolveExpandIcon } from "./entryRendering.tsx"
|
|
14
|
+
import { directoryTreeClasses, getFileExtension, INDENT_SIZE, resolveEntryIcon, resolveExpandIcon, toDataAttributes } from "./entryRendering.tsx"
|
|
15
15
|
import type { DirectoryEntry, DirectoryTreeColumn, DirectoryTreeIconOverrides, HighlightStyles } from "./types.ts"
|
|
16
16
|
import { useEntryInteraction } from "./useEntryInteraction.ts"
|
|
17
17
|
|
|
@@ -44,6 +44,10 @@ const numericTrackStyle = (numericTotal: number, numericTemplate: string): CSSPr
|
|
|
44
44
|
export type DirectoryTreeGridRowProps = {
|
|
45
45
|
entry: DirectoryEntry
|
|
46
46
|
indentLevel: number
|
|
47
|
+
/** 兄弟内の位置 (1 始まり)。`aria-posinset` として出力する。 */
|
|
48
|
+
positionInSet: number
|
|
49
|
+
/** 同一グループの兄弟数。`aria-setsize` として出力する。 */
|
|
50
|
+
setSize: number
|
|
47
51
|
rowHeight: number
|
|
48
52
|
isDirOpen: (path: string) => boolean
|
|
49
53
|
columns: DirectoryTreeColumn[]
|
|
@@ -75,6 +79,8 @@ export const DirectoryTreeGridRow = memo<DirectoryTreeGridRowProps>(
|
|
|
75
79
|
({
|
|
76
80
|
entry,
|
|
77
81
|
indentLevel,
|
|
82
|
+
positionInSet,
|
|
83
|
+
setSize,
|
|
78
84
|
rowHeight,
|
|
79
85
|
isDirOpen,
|
|
80
86
|
columns,
|
|
@@ -134,6 +140,9 @@ export const DirectoryTreeGridRow = memo<DirectoryTreeGridRowProps>(
|
|
|
134
140
|
role="row"
|
|
135
141
|
aria-expanded={isDirectory ? isExpanded : undefined}
|
|
136
142
|
aria-level={indentLevel + 1}
|
|
143
|
+
aria-posinset={positionInSet}
|
|
144
|
+
aria-setsize={setSize}
|
|
145
|
+
{...toDataAttributes(entry.data)}
|
|
137
146
|
data-entry-type={isDirectory ? "directory" : "file"}
|
|
138
147
|
data-entry-expanded={isDirectory ? String(isExpanded) : undefined}
|
|
139
148
|
data-entry-selected={isSelected ? "true" : undefined}
|
|
@@ -170,6 +179,8 @@ export const DirectoryTreeGridRow = memo<DirectoryTreeGridRowProps>(
|
|
|
170
179
|
const nextExpanded = isEntryExpanded(next.entry, next.isDirOpen)
|
|
171
180
|
return (
|
|
172
181
|
prev.indentLevel === next.indentLevel &&
|
|
182
|
+
prev.positionInSet === next.positionInSet &&
|
|
183
|
+
prev.setSize === next.setSize &&
|
|
173
184
|
prev.rowHeight === next.rowHeight &&
|
|
174
185
|
prevExpanded === nextExpanded &&
|
|
175
186
|
prev.columns === next.columns &&
|
package/src/entryRendering.tsx
CHANGED
|
@@ -249,3 +249,49 @@ export const resolveEntryIcon = (ctx: DirectoryTreeIconRenderContext, overrides?
|
|
|
249
249
|
if (typeof target === "function") return sanitizeIcon(target(ctx), entry.absolutePath)
|
|
250
250
|
return sanitizeIcon(target, entry.absolutePath)
|
|
251
251
|
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @function toKebabCase
|
|
255
|
+
* @description Lowercases a key and inserts a dash before each capital that follows a lowercase
|
|
256
|
+
* letter or digit, producing the form HTML `data-*` attributes require.
|
|
257
|
+
* キーを小文字化し、小文字または数字に続く大文字の前へダッシュを挿入して、
|
|
258
|
+
* HTML の `data-*` 属性が要求する形へ変換する。
|
|
259
|
+
*
|
|
260
|
+
* @remarks これは DOM の `dataset` 逆変換と**同一ではない**。`dataset` は連続する大文字をそれぞれ
|
|
261
|
+
* 区切るが、ここでは `aBC` は `a-bc` になる。またこの変換は単射ではなく、`panelCount` と
|
|
262
|
+
* `panel-count` は同じ属性名へ落ちる (同一オブジェクト内に両方を書いた場合は後者が勝つ)。
|
|
263
|
+
* 実務上のキーは単語境界が明確なため問題にならないが、契約として明記しておく。
|
|
264
|
+
*
|
|
265
|
+
* @param key - 変換前のキー。
|
|
266
|
+
* @returns 属性名として使える小文字ダッシュ区切りのキー。
|
|
267
|
+
*/
|
|
268
|
+
const toKebabCase = (key: string): string => key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @function toDataAttributes
|
|
272
|
+
* @description Converts an entry's `data` map into React `data-*` props.
|
|
273
|
+
* エントリの `data` マップを React の `data-*` props へ変換する。
|
|
274
|
+
*
|
|
275
|
+
* キーは `data-` を含めずに受け取り、ここで接頭辞を付ける。値は属性として出力するため文字列化する。
|
|
276
|
+
* camelCase のキーは HTML の `dataset` と同じ規約で kebab-case へ変換する
|
|
277
|
+
* (`panelCount` → `data-panel-count`)。変換しないと React が属性を落として警告を出すだけで、
|
|
278
|
+
* 利用側からは「指定したのに出ない」という無言の失敗に見える。
|
|
279
|
+
*
|
|
280
|
+
* 呼び出し側はこの結果をコンポーネント自身の `data-entry-*` より**前**に展開すること
|
|
281
|
+
* (後勝ちで自前の属性を守るため)。
|
|
282
|
+
*
|
|
283
|
+
* @param data - エントリの `data` マップ (未指定可)。
|
|
284
|
+
* @returns `data-*` をキーとするオブジェクト。`data` が空なら undefined。
|
|
285
|
+
*/
|
|
286
|
+
export const toDataAttributes = (data?: Record<string, string | number | boolean>): Record<string, string> | undefined => {
|
|
287
|
+
if (!data) {
|
|
288
|
+
return undefined
|
|
289
|
+
}
|
|
290
|
+
// null / undefined は「属性を出さない」意図として扱う。String() に通すと data-x="undefined" という
|
|
291
|
+
// 実在しない状態を DOM へ書き込んでしまい、属性の有無で判定する利用側が誤検知する
|
|
292
|
+
const entries = Object.entries(data).filter(([, value]) => value !== null && value !== undefined)
|
|
293
|
+
if (entries.length === 0) {
|
|
294
|
+
return undefined
|
|
295
|
+
}
|
|
296
|
+
return Object.fromEntries(entries.map(([key, value]) => [`data-${toKebabCase(key)}`, String(value)]))
|
|
297
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -37,6 +37,22 @@ export type DirectoryEntry = {
|
|
|
37
37
|
* エントリ用のオプションのインラインスタイル。
|
|
38
38
|
*/
|
|
39
39
|
style?: CSSProperties
|
|
40
|
+
/**
|
|
41
|
+
* Extra `data-*` attributes rendered on this entry's row. Keys are given **without** the
|
|
42
|
+
* `data-` prefix (`{ open: true }` renders `data-open="true"`); values are stringified.
|
|
43
|
+
* camelCase keys are converted to kebab-case exactly as the DOM `dataset` API does
|
|
44
|
+
* (`{ panelCount: 2 }` renders `data-panel-count="2"`).
|
|
45
|
+
*
|
|
46
|
+
* この行へ付与する追加の `data-*` 属性。キーは `data-` を**含めずに**渡し
|
|
47
|
+
* (`{ open: true }` は `data-open="true"` になる)、値は文字列化される。
|
|
48
|
+
* camelCase のキーは DOM の `dataset` と同じ規約で kebab-case へ変換される
|
|
49
|
+
* (`{ panelCount: 2 }` は `data-panel-count="2"`)。
|
|
50
|
+
*
|
|
51
|
+
* @remarks 用途は、状態を CSS クラスではなく属性として公開し、テストやスタイルが
|
|
52
|
+
* クラス名に依存しないようにすること。クラス名は整形や prefix 変更で無言に壊れる。
|
|
53
|
+
* このコンポーネント自身が出力する `data-entry-*` は上書きできない (常に後勝ち)。
|
|
54
|
+
*/
|
|
55
|
+
data?: Record<string, string | number | boolean>
|
|
40
56
|
}
|
|
41
57
|
|
|
42
58
|
/**
|
|
@@ -553,6 +569,18 @@ export type UseDirectoryTreeStateProps = {
|
|
|
553
569
|
export type DirectoryEntryItemProps = {
|
|
554
570
|
entry: DirectoryEntry
|
|
555
571
|
indentLevel: number
|
|
572
|
+
/**
|
|
573
|
+
* Logical depth from the roots, 0-based, independent of the visual indent.
|
|
574
|
+
* ルートからの論理的な深さ (0 始まり)。視覚的インデントとは独立。
|
|
575
|
+
*
|
|
576
|
+
* `visual.removeRootIndent` は `indentLevel` を負方向へずらすため、`aria-level` の算出には
|
|
577
|
+
* こちらを用いる (支援技術へ伝えるのは見た目のずれではなく実際の階層)。
|
|
578
|
+
*/
|
|
579
|
+
depth: number
|
|
580
|
+
/** 1-based position among its siblings (`aria-posinset`). / 兄弟内の位置 (1 始まり)。 */
|
|
581
|
+
positionInSet: number
|
|
582
|
+
/** Number of siblings in the same group (`aria-setsize`). / 同一グループの兄弟数。 */
|
|
583
|
+
setSize: number
|
|
556
584
|
/** Resolved height of this row in px. / この行の解決済み高さ (px)。 */
|
|
557
585
|
rowHeight: number
|
|
558
586
|
isDirOpen: (path: string) => boolean
|