@hina-ui/vue 1.6.0 → 1.7.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/dist/index.js +178 -94
- package/dist/index.js.map +1 -1
- package/dist/types/components/anchor/Anchor.vue.d.ts +26 -10
- package/dist/types/components/anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/types/components/anchor/composables/useAnchor.d.ts +15 -0
- package/dist/types/components/anchor/composables/useAnchor.d.ts.map +1 -0
- package/dist/types/components/anchor/composables/useScrollSpy.d.ts.map +1 -1
- package/dist/types/components/anchor/types.d.ts +9 -0
- package/dist/types/components/anchor/types.d.ts.map +1 -0
- package/dist/types/components/app-shell/AppShell.vue.d.ts.map +1 -1
- package/dist/types/components/app-shell/composables/useSidebarScrollUpdates.d.ts +4 -0
- package/dist/types/components/app-shell/composables/useSidebarScrollUpdates.d.ts.map +1 -0
- package/dist/types/components/sidebar/DrawerScope.d.ts +13 -2
- package/dist/types/components/sidebar/DrawerScope.d.ts.map +1 -1
- package/dist/types/components/sidebar/Sidebar.vue.d.ts +4 -1
- package/dist/types/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/types/components/sidebar/context.d.ts +1 -0
- package/dist/types/components/sidebar/context.d.ts.map +1 -1
- package/dist/types/components/sidebar/sidebar.variants.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/anchor/Anchor.vue +15 -19
- package/src/components/anchor/composables/useAnchor.ts +19 -0
- package/src/components/anchor/composables/useScrollSpy.ts +6 -1
- package/src/components/anchor/types.ts +8 -0
- package/src/components/app-shell/AppShell.vue +5 -2
- package/src/components/app-shell/composables/useSidebarScrollUpdates.ts +52 -0
- package/src/components/sidebar/DrawerScope.ts +12 -4
- package/src/components/sidebar/Sidebar.vue +27 -7
- package/src/components/sidebar/context.ts +1 -0
- package/src/components/sidebar/sidebar.variants.ts +1 -1
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -2267,7 +2267,7 @@ function useScrollFocus(host, viewport, options) {
|
|
|
2267
2267
|
var _hoisted_1$92 = ["data-visible"];
|
|
2268
2268
|
var _hoisted_2$47 = ["data-visible"];
|
|
2269
2269
|
var _hoisted_3$24 = ["data-visible"];
|
|
2270
|
-
var _hoisted_4$
|
|
2270
|
+
var _hoisted_4$20 = ["data-visible"];
|
|
2271
2271
|
//#endregion
|
|
2272
2272
|
//#region src/components/scroll-area/ScrollArea.vue
|
|
2273
2273
|
var ScrollArea_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2391,7 +2391,7 @@ var ScrollArea_default = /* @__PURE__ */ defineComponent({
|
|
|
2391
2391
|
"data-side": "y-end",
|
|
2392
2392
|
"data-visible": unref(showYEnd) ? "" : void 0,
|
|
2393
2393
|
"aria-hidden": "true"
|
|
2394
|
-
}, null, 8, _hoisted_4$
|
|
2394
|
+
}, null, 8, _hoisted_4$20)) : createCommentVNode("", true)
|
|
2395
2395
|
], 64)) : createCommentVNode("", true)], 2);
|
|
2396
2396
|
};
|
|
2397
2397
|
}
|
|
@@ -5141,8 +5141,8 @@ var _hoisted_1$85 = {
|
|
|
5141
5141
|
};
|
|
5142
5142
|
var _hoisted_2$42 = { class: "hn-collapse-body" };
|
|
5143
5143
|
var _hoisted_3$22 = ["role"];
|
|
5144
|
-
var _hoisted_4$
|
|
5145
|
-
var _hoisted_5$
|
|
5144
|
+
var _hoisted_4$19 = { class: "flex min-w-0 flex-1 flex-col gap-1" };
|
|
5145
|
+
var _hoisted_5$14 = {
|
|
5146
5146
|
key: 0,
|
|
5147
5147
|
class: "text-fg font-medium"
|
|
5148
5148
|
};
|
|
@@ -5199,7 +5199,7 @@ var Alert_default = /* @__PURE__ */ defineComponent({
|
|
|
5199
5199
|
class: normalizeClass(unref(calloutIcon)({ tone: props.tone })),
|
|
5200
5200
|
"aria-hidden": "true"
|
|
5201
5201
|
}, null, 8, ["class"])) : createCommentVNode("", true)]),
|
|
5202
|
-
createElementVNode("div", _hoisted_4$
|
|
5202
|
+
createElementVNode("div", _hoisted_4$19, [props.title ? (openBlock(), createElementBlock("p", _hoisted_5$14, toDisplayString(props.title), 1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
|
|
5203
5203
|
unref(slots).actions ? (openBlock(), createElementBlock("div", _hoisted_6$9, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true),
|
|
5204
5204
|
props.closable ? (openBlock(), createBlock(CloseButton_default, {
|
|
5205
5205
|
key: 1,
|
|
@@ -6744,8 +6744,8 @@ var _hoisted_3$21 = {
|
|
|
6744
6744
|
key: 0,
|
|
6745
6745
|
class: "text-muted block truncate text-xs"
|
|
6746
6746
|
};
|
|
6747
|
-
var _hoisted_4$
|
|
6748
|
-
var _hoisted_5$
|
|
6747
|
+
var _hoisted_4$18 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
6748
|
+
var _hoisted_5$13 = { class: "min-w-0 flex-1" };
|
|
6749
6749
|
var _hoisted_6$8 = { class: "block truncate" };
|
|
6750
6750
|
var _hoisted_7$6 = {
|
|
6751
6751
|
key: 0,
|
|
@@ -6799,7 +6799,7 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
|
6799
6799
|
default: withCtx(() => [createVNode(unref(SelectItemText), { "as-child": "" }, {
|
|
6800
6800
|
default: withCtx(() => [createElementVNode("span", _hoisted_1$82, [renderSlot(_ctx.$slots, "option", { option }, () => [createElementVNode("span", _hoisted_2$40, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_3$21, toDisplayString(option.description), 1)) : createCommentVNode("", true)])])]),
|
|
6801
6801
|
_: 2
|
|
6802
|
-
}, 1024), createElementVNode("span", _hoisted_4$
|
|
6802
|
+
}, 1024), createElementVNode("span", _hoisted_4$18, [createVNode(unref(SelectItemIndicator), null, {
|
|
6803
6803
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
6804
6804
|
_: 1
|
|
6805
6805
|
})])]),
|
|
@@ -6820,7 +6820,7 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
|
6820
6820
|
class: normalizeClass(unref(selectItem)())
|
|
6821
6821
|
}, {
|
|
6822
6822
|
default: withCtx(() => [createVNode(unref(SelectItemText), { "as-child": "" }, {
|
|
6823
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_5$
|
|
6823
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_5$13, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$8, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$6, toDisplayString(item.description), 1)) : createCommentVNode("", true)])])]),
|
|
6824
6824
|
_: 2
|
|
6825
6825
|
}, 1024), createElementVNode("span", _hoisted_8$3, [createVNode(unref(SelectItemIndicator), null, {
|
|
6826
6826
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
@@ -7421,12 +7421,12 @@ var _hoisted_2$38 = {
|
|
|
7421
7421
|
class: "relative min-h-0 flex-auto"
|
|
7422
7422
|
};
|
|
7423
7423
|
var _hoisted_3$20 = ["inert"];
|
|
7424
|
-
var _hoisted_4$
|
|
7424
|
+
var _hoisted_4$17 = [
|
|
7425
7425
|
"aria-label",
|
|
7426
7426
|
"inert",
|
|
7427
7427
|
"data-disabled"
|
|
7428
7428
|
];
|
|
7429
|
-
var _hoisted_5$
|
|
7429
|
+
var _hoisted_5$12 = {
|
|
7430
7430
|
key: 1,
|
|
7431
7431
|
class: "flex max-w-full flex-wrap items-center gap-3"
|
|
7432
7432
|
};
|
|
@@ -7521,8 +7521,8 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
7521
7521
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "ellipsis", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
7522
7522
|
key: "1"
|
|
7523
7523
|
} : void 0]), 1024),
|
|
7524
|
-
props.pageSizeOptions?.length || props.showJump ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
7525
|
-
])], 10, _hoisted_4$
|
|
7524
|
+
props.pageSizeOptions?.length || props.showJump ? (openBlock(), createElementBlock("div", _hoisted_5$12, [props.pageSizeOptions?.length ? (openBlock(), createBlock(PaginationSize_default, { key: 0 })) : createCommentVNode("", true), props.showJump ? (openBlock(), createBlock(PaginationJump_default, { key: 1 })) : createCommentVNode("", true)])) : createCommentVNode("", true)
|
|
7525
|
+
])], 10, _hoisted_4$17)]),
|
|
7526
7526
|
_: 3
|
|
7527
7527
|
}, 8, [
|
|
7528
7528
|
"page",
|
|
@@ -8703,7 +8703,7 @@ var _hoisted_3$19 = [
|
|
|
8703
8703
|
"autocomplete",
|
|
8704
8704
|
"disabled"
|
|
8705
8705
|
];
|
|
8706
|
-
var _hoisted_4$
|
|
8706
|
+
var _hoisted_4$16 = ["value", "disabled"];
|
|
8707
8707
|
//#endregion
|
|
8708
8708
|
//#region src/components/multi-select/MultiSelect.vue
|
|
8709
8709
|
var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
@@ -8874,7 +8874,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
8874
8874
|
key: option.value,
|
|
8875
8875
|
value: option.value,
|
|
8876
8876
|
disabled: option.disabled
|
|
8877
|
-
}, toDisplayString(option.label), 9, _hoisted_4$
|
|
8877
|
+
}, toDisplayString(option.label), 9, _hoisted_4$16);
|
|
8878
8878
|
}), 128))], 8, _hoisted_3$19), [[vModelSelect, model.value]])]),
|
|
8879
8879
|
_: 1
|
|
8880
8880
|
})) : createCommentVNode("", true),
|
|
@@ -8970,8 +8970,8 @@ var _hoisted_3$18 = {
|
|
|
8970
8970
|
key: 0,
|
|
8971
8971
|
class: "text-muted block truncate text-xs"
|
|
8972
8972
|
};
|
|
8973
|
-
var _hoisted_4$
|
|
8974
|
-
var _hoisted_5$
|
|
8973
|
+
var _hoisted_4$15 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
8974
|
+
var _hoisted_5$11 = { class: "min-w-0 flex-1" };
|
|
8975
8975
|
var _hoisted_6$7 = { class: "block truncate" };
|
|
8976
8976
|
var _hoisted_7$5 = {
|
|
8977
8977
|
key: 0,
|
|
@@ -9022,7 +9022,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
|
9022
9022
|
disabled: option.disabled,
|
|
9023
9023
|
class: normalizeClass(unref(selectItem)())
|
|
9024
9024
|
}, {
|
|
9025
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_1$70, [renderSlot(_ctx.$slots, "option", { option }, () => [createElementVNode("span", _hoisted_2$34, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_3$18, toDisplayString(option.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_4$
|
|
9025
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_1$70, [renderSlot(_ctx.$slots, "option", { option }, () => [createElementVNode("span", _hoisted_2$34, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_3$18, toDisplayString(option.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_4$15, [createVNode(unref(ComboboxItemIndicator), null, {
|
|
9026
9026
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
9027
9027
|
_: 1
|
|
9028
9028
|
})])]),
|
|
@@ -9042,7 +9042,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
|
9042
9042
|
disabled: item.disabled,
|
|
9043
9043
|
class: normalizeClass(unref(selectItem)())
|
|
9044
9044
|
}, {
|
|
9045
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_5$
|
|
9045
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_5$11, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$7, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8$2, [createVNode(unref(ComboboxItemIndicator), null, {
|
|
9046
9046
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
9047
9047
|
_: 1
|
|
9048
9048
|
})])]),
|
|
@@ -9258,8 +9258,8 @@ var commandEmpty = tv({ base: "text-muted px-4 py-8 text-center text-sm" });
|
|
|
9258
9258
|
var _hoisted_1$68 = { class: "truncate" };
|
|
9259
9259
|
var _hoisted_2$33 = ["textContent"];
|
|
9260
9260
|
var _hoisted_3$17 = ["textContent"];
|
|
9261
|
-
var _hoisted_4$
|
|
9262
|
-
var _hoisted_5$
|
|
9261
|
+
var _hoisted_4$14 = ["textContent"];
|
|
9262
|
+
var _hoisted_5$10 = {
|
|
9263
9263
|
key: 0,
|
|
9264
9264
|
class: "text-muted truncate text-xs"
|
|
9265
9265
|
};
|
|
@@ -9310,8 +9310,8 @@ var CommandPaletteItem_default = /* @__PURE__ */ defineComponent({
|
|
|
9310
9310
|
parts.value[2] ? (openBlock(), createElementBlock("span", {
|
|
9311
9311
|
key: 1,
|
|
9312
9312
|
textContent: toDisplayString(parts.value[2])
|
|
9313
|
-
}, null, 8, _hoisted_4$
|
|
9314
|
-
]), props.match.item.description ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
9313
|
+
}, null, 8, _hoisted_4$14)) : createCommentVNode("", true)
|
|
9314
|
+
]), props.match.item.description ? (openBlock(), createElementBlock("span", _hoisted_5$10, toDisplayString(props.match.item.description), 1)) : createCommentVNode("", true)], 2),
|
|
9315
9315
|
props.match.item.kbd?.length ? (openBlock(), createElementBlock("span", {
|
|
9316
9316
|
key: 1,
|
|
9317
9317
|
class: normalizeClass(unref(commandItemHint)())
|
|
@@ -9658,7 +9658,7 @@ var _hoisted_3$16 = {
|
|
|
9658
9658
|
key: 0,
|
|
9659
9659
|
class: "text-muted block truncate text-xs"
|
|
9660
9660
|
};
|
|
9661
|
-
var _hoisted_4$
|
|
9661
|
+
var _hoisted_4$13 = {
|
|
9662
9662
|
key: 1,
|
|
9663
9663
|
class: "flex size-4 shrink-0 items-center justify-center"
|
|
9664
9664
|
};
|
|
@@ -9680,7 +9680,7 @@ var ListboxOptionContent_default = /* @__PURE__ */ defineComponent({
|
|
|
9680
9680
|
}, () => [createElementVNode("span", _hoisted_2$32, toDisplayString(props.option.label), 1), props.option.description ? (openBlock(), createElementBlock("span", _hoisted_3$16, toDisplayString(props.option.description), 1)) : createCommentVNode("", true)])]), slots.trailing ? renderSlot(_ctx.$slots, "trailing", {
|
|
9681
9681
|
option: props.option,
|
|
9682
9682
|
selected: unref(selected)
|
|
9683
|
-
}, void 0, void 0, 0) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
9683
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock("span", _hoisted_4$13, [createVNode(unref(ListboxItemIndicator), null, {
|
|
9684
9684
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
9685
9685
|
_: 1
|
|
9686
9686
|
})]))], 64);
|
|
@@ -10090,12 +10090,12 @@ var _hoisted_1$65 = [
|
|
|
10090
10090
|
];
|
|
10091
10091
|
var _hoisted_2$31 = ["aria-selected", "aria-checked"];
|
|
10092
10092
|
var _hoisted_3$15 = ["onClick"];
|
|
10093
|
-
var _hoisted_4$
|
|
10093
|
+
var _hoisted_4$12 = {
|
|
10094
10094
|
key: 1,
|
|
10095
10095
|
class: "size-5 shrink-0",
|
|
10096
10096
|
"aria-hidden": "true"
|
|
10097
10097
|
};
|
|
10098
|
-
var _hoisted_5$
|
|
10098
|
+
var _hoisted_5$9 = { class: "min-w-0 flex-1" };
|
|
10099
10099
|
var _hoisted_6$6 = { class: "block truncate" };
|
|
10100
10100
|
var _hoisted_7$4 = {
|
|
10101
10101
|
key: 0,
|
|
@@ -10180,13 +10180,13 @@ var Tree_default = /* @__PURE__ */ defineComponent({
|
|
|
10180
10180
|
}, [createVNode(DisclosureIcon_default, {
|
|
10181
10181
|
direction: "end",
|
|
10182
10182
|
open: isExpanded
|
|
10183
|
-
}, null, 8, ["open"])], 10, _hoisted_3$15)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
10183
|
+
}, null, 8, ["open"])], 10, _hoisted_3$15)) : (openBlock(), createElementBlock("span", _hoisted_4$12)),
|
|
10184
10184
|
props.multiple ? (openBlock(), createBlock(TreeCheck_default, {
|
|
10185
10185
|
key: 2,
|
|
10186
10186
|
selected: unref(state)(item.value).selected,
|
|
10187
10187
|
indeterminate: unref(state)(item.value).indeterminate
|
|
10188
10188
|
}, null, 8, ["selected", "indeterminate"])) : createCommentVNode("", true),
|
|
10189
|
-
createElementVNode("span", _hoisted_5$
|
|
10189
|
+
createElementVNode("span", _hoisted_5$9, [renderSlot(_ctx.$slots, "node", mergeProps({
|
|
10190
10190
|
node: item.value,
|
|
10191
10191
|
expanded: isExpanded
|
|
10192
10192
|
}, { ref_for: true }, unref(state)(item.value)), () => [createElementVNode("span", _hoisted_6$6, toDisplayString(item.value.label), 1), item.value.description ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)])]),
|
|
@@ -10450,11 +10450,11 @@ var _hoisted_1$63 = [
|
|
|
10450
10450
|
];
|
|
10451
10451
|
var _hoisted_2$29 = { class: "min-w-0 flex-1 truncate" };
|
|
10452
10452
|
var _hoisted_3$14 = ["onClick"];
|
|
10453
|
-
var _hoisted_4$
|
|
10453
|
+
var _hoisted_4$11 = {
|
|
10454
10454
|
key: 1,
|
|
10455
10455
|
class: "size-5 shrink-0"
|
|
10456
10456
|
};
|
|
10457
|
-
var _hoisted_5$
|
|
10457
|
+
var _hoisted_5$8 = { class: "min-w-0 flex-1" };
|
|
10458
10458
|
var _hoisted_6$5 = { class: "block truncate" };
|
|
10459
10459
|
var _hoisted_7$3 = {
|
|
10460
10460
|
key: 0,
|
|
@@ -10598,8 +10598,8 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
10598
10598
|
}, [createVNode(DisclosureIcon_default, {
|
|
10599
10599
|
direction: "end",
|
|
10600
10600
|
open: isExpanded
|
|
10601
|
-
}, null, 8, ["open"])], 10, _hoisted_3$14)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
10602
|
-
createElementVNode("span", _hoisted_5$
|
|
10601
|
+
}, null, 8, ["open"])], 10, _hoisted_3$14)) : (openBlock(), createElementBlock("span", _hoisted_4$11)),
|
|
10602
|
+
createElementVNode("span", _hoisted_5$8, [renderSlot(_ctx.$slots, "node", { node: item.value }, () => [createElementVNode("span", _hoisted_6$5, toDisplayString(item.value.label), 1), item.value.description ? (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)])]),
|
|
10603
10603
|
createElementVNode("span", _hoisted_8$1, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
|
|
10604
10604
|
]),
|
|
10605
10605
|
_: 2
|
|
@@ -15794,8 +15794,8 @@ var _hoisted_3$11 = {
|
|
|
15794
15794
|
key: 1,
|
|
15795
15795
|
class: "flex items-start justify-between gap-4 px-(--hn-panel-p)"
|
|
15796
15796
|
};
|
|
15797
|
-
var _hoisted_4$
|
|
15798
|
-
var _hoisted_5$
|
|
15797
|
+
var _hoisted_4$10 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
15798
|
+
var _hoisted_5$7 = { class: "flex min-w-0 items-center gap-2" };
|
|
15799
15799
|
var _hoisted_6$4 = {
|
|
15800
15800
|
key: 0,
|
|
15801
15801
|
class: "text-muted flex shrink-0 [&_svg]:size-5",
|
|
@@ -15916,7 +15916,7 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15916
15916
|
"aria-hidden": "true",
|
|
15917
15917
|
"data-disabled": props.locked ? "" : void 0,
|
|
15918
15918
|
class: normalizeClass(unref(sheetHandle)({ header: props.header && !slots.body }))
|
|
15919
|
-
}, null, 10, _hoisted_2$22)) : createCommentVNode("", true), props.header && !slots.body ? (openBlock(), createElementBlock("div", _hoisted_3$11, [createElementVNode("div", _hoisted_4$
|
|
15919
|
+
}, null, 10, _hoisted_2$22)) : createCommentVNode("", true), props.header && !slots.body ? (openBlock(), createElementBlock("div", _hoisted_3$11, [createElementVNode("div", _hoisted_4$10, [createElementVNode("div", _hoisted_5$7, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_6$4, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
15920
15920
|
default: withCtx(() => [createVNode(Heading_default, {
|
|
15921
15921
|
level: 2,
|
|
15922
15922
|
size: "lg",
|
|
@@ -16820,7 +16820,7 @@ var _hoisted_1$32 = {
|
|
|
16820
16820
|
};
|
|
16821
16821
|
var _hoisted_2$19 = { class: "hn-collapse-body" };
|
|
16822
16822
|
var _hoisted_3$10 = ["data-tone"];
|
|
16823
|
-
var _hoisted_4$
|
|
16823
|
+
var _hoisted_4$9 = ["aria-live"];
|
|
16824
16824
|
//#endregion
|
|
16825
16825
|
//#region src/components/banner/Banner.vue
|
|
16826
16826
|
var Banner_default = /* @__PURE__ */ defineComponent({
|
|
@@ -16914,7 +16914,7 @@ var Banner_default = /* @__PURE__ */ defineComponent({
|
|
|
16914
16914
|
index: at.value
|
|
16915
16915
|
})], 2))]),
|
|
16916
16916
|
_: 3
|
|
16917
|
-
}, 8, ["enter-from-class", "leave-to-class"])], 8, _hoisted_4$
|
|
16917
|
+
}, 8, ["enter-from-class", "leave-to-class"])], 8, _hoisted_4$9)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [renderSlot(_ctx.$slots, "icon", {}, () => [props.icon ? (openBlock(), createBlock(resolveDynamicComponent(icon.value), {
|
|
16918
16918
|
key: 0,
|
|
16919
16919
|
class: normalizeClass(unref(bannerIcon)()),
|
|
16920
16920
|
"aria-hidden": "true"
|
|
@@ -17597,8 +17597,8 @@ var _hoisted_1$26 = [
|
|
|
17597
17597
|
];
|
|
17598
17598
|
var _hoisted_2$16 = ["id", "for"];
|
|
17599
17599
|
var _hoisted_3$9 = ["id"];
|
|
17600
|
-
var _hoisted_4$
|
|
17601
|
-
var _hoisted_5$
|
|
17600
|
+
var _hoisted_4$8 = ["id"];
|
|
17601
|
+
var _hoisted_5$6 = {
|
|
17602
17602
|
key: 0,
|
|
17603
17603
|
"data-hn-form-field-message": "",
|
|
17604
17604
|
class: "hn-collapse [--hn-collapse-out:var(--hn-duration-fast)]"
|
|
@@ -17714,14 +17714,14 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
17714
17714
|
key: 0,
|
|
17715
17715
|
id: unref(descriptionId),
|
|
17716
17716
|
class: normalizeClass(unref(formFieldDescription)())
|
|
17717
|
-
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_4$
|
|
17717
|
+
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_4$8)) : createCommentVNode("", true),
|
|
17718
17718
|
createVNode(Transition, mergeProps({
|
|
17719
17719
|
"enter-from-class": "hn-collapse-closed",
|
|
17720
17720
|
"enter-to-class": "hn-collapse-open",
|
|
17721
17721
|
"leave-from-class": "hn-collapse-open",
|
|
17722
17722
|
"leave-to-class": "hn-collapse-closed"
|
|
17723
17723
|
}, toHandlers(unref(hooks))), {
|
|
17724
|
-
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
17724
|
+
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$6, [createElementVNode("div", _hoisted_6$3, [createElementVNode("p", {
|
|
17725
17725
|
id: unref(messageId),
|
|
17726
17726
|
class: normalizeClass(unref(formFieldMessage)()),
|
|
17727
17727
|
"aria-live": "polite"
|
|
@@ -18280,7 +18280,7 @@ var codeBlockLabel = tv({ base: "text-faint font-mono text-xs select-none" });
|
|
|
18280
18280
|
var _hoisted_1$23 = ["data-lang"];
|
|
18281
18281
|
var _hoisted_2$14 = ["innerHTML"];
|
|
18282
18282
|
var _hoisted_3$8 = { key: 1 };
|
|
18283
|
-
var _hoisted_4$
|
|
18283
|
+
var _hoisted_4$7 = { key: 2 };
|
|
18284
18284
|
//#endregion
|
|
18285
18285
|
//#region src/components/code-block/CodeBlock.vue
|
|
18286
18286
|
var CodeBlock_default = /* @__PURE__ */ defineComponent({
|
|
@@ -18322,7 +18322,7 @@ var CodeBlock_default = /* @__PURE__ */ defineComponent({
|
|
|
18322
18322
|
style: normalizeStyle(tk.htmlStyle)
|
|
18323
18323
|
}, toDisplayString(tk.content), 5);
|
|
18324
18324
|
}), 128))], 64);
|
|
18325
|
-
}), 128))])) : (openBlock(), createElementBlock("code", _hoisted_4$
|
|
18325
|
+
}), 128))])) : (openBlock(), createElementBlock("code", _hoisted_4$7, toDisplayString(__props.code), 1))], 2)]),
|
|
18326
18326
|
_: 1
|
|
18327
18327
|
}, 8, ["label", "class"]), createElementVNode("div", { class: normalizeClass(unref(codeBlockActions)()) }, [tag.value ? (openBlock(), createElementBlock("span", {
|
|
18328
18328
|
key: 0,
|
|
@@ -19388,7 +19388,7 @@ var sidebarRegion = tv({
|
|
|
19388
19388
|
true: "w-full",
|
|
19389
19389
|
false: "w-[calc(16rem-1px)] px-3"
|
|
19390
19390
|
},
|
|
19391
|
-
footer: { true: "border-line border-t" }
|
|
19391
|
+
footer: { true: "border-line w-full border-t" }
|
|
19392
19392
|
}
|
|
19393
19393
|
});
|
|
19394
19394
|
var sidebarLabel = tv({ base: "hn-sidebar-label min-w-0" });
|
|
@@ -19429,9 +19429,10 @@ var SidebarLabel_default = /* @__PURE__ */ defineComponent({
|
|
|
19429
19429
|
//#endregion
|
|
19430
19430
|
//#region src/components/sidebar/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
19431
19431
|
var _hoisted_1$17 = ["data-state", "inert"];
|
|
19432
|
-
var _hoisted_2$13 =
|
|
19433
|
-
var _hoisted_3$7 =
|
|
19434
|
-
var _hoisted_4$
|
|
19432
|
+
var _hoisted_2$13 = { class: "min-w-0 flex-1" };
|
|
19433
|
+
var _hoisted_3$7 = ["data-state", "inert"];
|
|
19434
|
+
var _hoisted_4$6 = { class: "hn-collapse-body" };
|
|
19435
|
+
var _hoisted_5$5 = ["aria-label"];
|
|
19435
19436
|
//#endregion
|
|
19436
19437
|
//#region src/components/sidebar/Sidebar.vue
|
|
19437
19438
|
var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
@@ -19439,6 +19440,10 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
19439
19440
|
__name: "Sidebar",
|
|
19440
19441
|
props: {
|
|
19441
19442
|
label: {},
|
|
19443
|
+
closable: {
|
|
19444
|
+
type: Boolean,
|
|
19445
|
+
default: true
|
|
19446
|
+
},
|
|
19442
19447
|
class: {}
|
|
19443
19448
|
},
|
|
19444
19449
|
setup(__props) {
|
|
@@ -19451,42 +19456,61 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
19451
19456
|
return openBlock(), createElementBlock("aside", {
|
|
19452
19457
|
"data-state": state.value,
|
|
19453
19458
|
inert: state.value === "hidden",
|
|
19454
|
-
class: normalizeClass(unref(cn)(unref(sidebarRoot)({ inDrawer: inDrawer.value }), props.class))
|
|
19459
|
+
class: normalizeClass(unref(cn)(unref(sidebarRoot)({ inDrawer: inDrawer.value }), props.class)),
|
|
19460
|
+
onTransitionrun: _cache[3] || (_cache[3] = (...args) => unref(sidebar)?.onTransitionRun && unref(sidebar)?.onTransitionRun(...args))
|
|
19455
19461
|
}, [
|
|
19456
19462
|
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
19457
19463
|
key: 0,
|
|
19458
|
-
class: normalizeClass(unref(sidebarRegion)({ inDrawer: inDrawer.value }))
|
|
19459
|
-
}, [renderSlot(_ctx.$slots, "header", { state: state.value })],
|
|
19464
|
+
class: normalizeClass(unref(cn)(unref(sidebarRegion)({ inDrawer: inDrawer.value }), "flex items-center gap-2"))
|
|
19465
|
+
}, [createElementVNode("div", _hoisted_2$13, [renderSlot(_ctx.$slots, "header", { state: state.value })]), inDrawer.value && props.closable ? (openBlock(), createBlock(CloseButton_default, {
|
|
19466
|
+
key: 0,
|
|
19467
|
+
class: "shrink-0",
|
|
19468
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(sidebar)?.toggle())
|
|
19469
|
+
})) : createCommentVNode("", true)], 2)) : _ctx.$slots.icon || _ctx.$slots.wordmark ? (openBlock(), createElementBlock("div", {
|
|
19460
19470
|
key: 1,
|
|
19461
19471
|
class: "hn-collapse shrink-0",
|
|
19462
19472
|
"data-state": state.value === "rail" && !_ctx.$slots.icon ? "closed" : "open",
|
|
19463
19473
|
inert: state.value === "rail" && !_ctx.$slots.icon
|
|
19464
|
-
}, [createElementVNode("div",
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19474
|
+
}, [createElementVNode("div", _hoisted_4$6, [createElementVNode("div", { class: normalizeClass(unref(sidebarRegion)({ inDrawer: inDrawer.value })) }, [createElementVNode("div", { class: normalizeClass(unref(sidebarBrand)()) }, [
|
|
19475
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
|
|
19476
|
+
key: 0,
|
|
19477
|
+
class: normalizeClass(unref(sidebarIcon)())
|
|
19478
|
+
}, [renderSlot(_ctx.$slots, "icon", { state: state.value })], 2)) : createCommentVNode("", true),
|
|
19479
|
+
_ctx.$slots.wordmark ? (openBlock(), createBlock(SidebarLabel_default, {
|
|
19480
|
+
key: 1,
|
|
19481
|
+
as: "div",
|
|
19482
|
+
class: normalizeClass(unref(sidebarWordmark)())
|
|
19483
|
+
}, {
|
|
19484
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "wordmark", { state: state.value })]),
|
|
19485
|
+
_: 3
|
|
19486
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
19487
|
+
inDrawer.value && props.closable ? (openBlock(), createBlock(CloseButton_default, {
|
|
19488
|
+
key: 2,
|
|
19489
|
+
class: "ms-auto shrink-0",
|
|
19490
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(sidebar)?.toggle())
|
|
19491
|
+
})) : createCommentVNode("", true)
|
|
19492
|
+
], 2)], 2)])], 8, _hoisted_3$7)) : inDrawer.value && props.closable ? (openBlock(), createElementBlock("div", {
|
|
19493
|
+
key: 2,
|
|
19494
|
+
class: normalizeClass(unref(cn)(unref(sidebarRegion)({ inDrawer: inDrawer.value }), "flex justify-end"))
|
|
19495
|
+
}, [createVNode(CloseButton_default, { onClick: _cache[2] || (_cache[2] = ($event) => unref(sidebar)?.toggle()) })], 2)) : createCommentVNode("", true),
|
|
19496
|
+
createVNode(ScrollArea_default, {
|
|
19497
|
+
shadow: false,
|
|
19498
|
+
class: "min-h-0 flex-1"
|
|
19471
19499
|
}, {
|
|
19472
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "wordmark", { state: state.value })]),
|
|
19473
|
-
_: 3
|
|
19474
|
-
}, 8, ["class"])) : createCommentVNode("", true)], 2)], 2)])], 8, _hoisted_2$13)) : createCommentVNode("", true),
|
|
19475
|
-
createVNode(ScrollArea_default, { class: "min-h-0 flex-1" }, {
|
|
19476
19500
|
default: withCtx(() => [createElementVNode("nav", {
|
|
19477
19501
|
"aria-label": props.label ?? unref(t).sidebar.navLabel,
|
|
19478
19502
|
class: normalizeClass(unref(cn)("flex flex-col gap-1 py-2", !inDrawer.value && "px-2.5"))
|
|
19479
|
-
}, [renderSlot(_ctx.$slots, "default")], 10,
|
|
19503
|
+
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_5$5)]),
|
|
19480
19504
|
_: 3
|
|
19481
19505
|
}),
|
|
19482
19506
|
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
19483
|
-
key:
|
|
19507
|
+
key: 3,
|
|
19484
19508
|
class: normalizeClass(unref(sidebarRegion)({
|
|
19485
19509
|
inDrawer: inDrawer.value,
|
|
19486
19510
|
footer: true
|
|
19487
19511
|
}))
|
|
19488
19512
|
}, [renderSlot(_ctx.$slots, "footer", { state: state.value })], 2)) : createCommentVNode("", true)
|
|
19489
|
-
],
|
|
19513
|
+
], 42, _hoisted_1$17);
|
|
19490
19514
|
};
|
|
19491
19515
|
}
|
|
19492
19516
|
});
|
|
@@ -19499,7 +19523,7 @@ var _hoisted_2$12 = [
|
|
|
19499
19523
|
"inert"
|
|
19500
19524
|
];
|
|
19501
19525
|
var _hoisted_3$6 = ["data-collapsed"];
|
|
19502
|
-
var _hoisted_4$
|
|
19526
|
+
var _hoisted_4$5 = { class: "flex flex-col gap-0.5 pt-1" };
|
|
19503
19527
|
//#endregion
|
|
19504
19528
|
//#region src/components/sidebar/SidebarGroup.vue
|
|
19505
19529
|
var SidebarGroup_default = /* @__PURE__ */ defineComponent({
|
|
@@ -19548,7 +19572,7 @@ var SidebarGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
19548
19572
|
class: "hn-sidebar-label border-line pointer-events-none absolute inset-x-2 top-1/2 border-t",
|
|
19549
19573
|
"data-collapsed": rail.value ? void 0 : ""
|
|
19550
19574
|
}, null, 8, _hoisted_3$6)]), createVNode(CollapsibleContent_default, null, {
|
|
19551
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_4$
|
|
19575
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_4$5, [renderSlot(_ctx.$slots, "default")])]),
|
|
19552
19576
|
_: 3
|
|
19553
19577
|
})]),
|
|
19554
19578
|
_: 3
|
|
@@ -19608,12 +19632,12 @@ var _hoisted_1$15 = {
|
|
|
19608
19632
|
};
|
|
19609
19633
|
var _hoisted_2$11 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
19610
19634
|
var _hoisted_3$5 = { class: "flex min-w-0 items-center gap-2" };
|
|
19611
|
-
var _hoisted_4$
|
|
19635
|
+
var _hoisted_4$4 = {
|
|
19612
19636
|
key: 0,
|
|
19613
19637
|
class: "text-muted flex shrink-0 [&_svg]:size-5",
|
|
19614
19638
|
"aria-hidden": "true"
|
|
19615
19639
|
};
|
|
19616
|
-
var _hoisted_5$
|
|
19640
|
+
var _hoisted_5$4 = { class: "px-(--hn-panel-p) py-1" };
|
|
19617
19641
|
var _hoisted_6$2 = {
|
|
19618
19642
|
key: 2,
|
|
19619
19643
|
class: "flex shrink-0 justify-end gap-(--hn-inline-gap) px-(--hn-panel-p)"
|
|
@@ -19704,7 +19728,7 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19704
19728
|
default: withCtx(() => [createTextVNode(toDisplayString(props.description), 1)]),
|
|
19705
19729
|
_: 1
|
|
19706
19730
|
})) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), slots.body ? renderSlot(_ctx.$slots, "body", { close }, void 0, void 0, 1) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
19707
|
-
props.header ? (openBlock(), createElementBlock("div", _hoisted_1$15, [createElementVNode("div", _hoisted_2$11, [createElementVNode("div", _hoisted_3$5, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
19731
|
+
props.header ? (openBlock(), createElementBlock("div", _hoisted_1$15, [createElementVNode("div", _hoisted_2$11, [createElementVNode("div", _hoisted_3$5, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$4, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
19708
19732
|
default: withCtx(() => [createVNode(Heading_default, {
|
|
19709
19733
|
level: 2,
|
|
19710
19734
|
size: "lg",
|
|
@@ -19739,7 +19763,7 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19739
19763
|
ref: scrollArea,
|
|
19740
19764
|
class: "min-h-0 grow"
|
|
19741
19765
|
}, {
|
|
19742
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_5$
|
|
19766
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5$4, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
19743
19767
|
_: 3
|
|
19744
19768
|
}, 512)) : createCommentVNode("", true),
|
|
19745
19769
|
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
@@ -19759,14 +19783,18 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19759
19783
|
//#region src/components/sidebar/DrawerScope.ts
|
|
19760
19784
|
var DrawerScope_default = defineComponent({
|
|
19761
19785
|
name: "HnSidebarDrawerScope",
|
|
19762
|
-
|
|
19786
|
+
props: { close: {
|
|
19787
|
+
type: Function,
|
|
19788
|
+
required: true
|
|
19789
|
+
} },
|
|
19790
|
+
setup(props, { slots }) {
|
|
19763
19791
|
provideSidebar({
|
|
19764
19792
|
state: ref("expanded"),
|
|
19765
|
-
toggle: () =>
|
|
19793
|
+
toggle: () => props.close(),
|
|
19766
19794
|
openMobile: () => {},
|
|
19767
19795
|
inDrawer: true
|
|
19768
19796
|
});
|
|
19769
|
-
return () => h("div", { class: "
|
|
19797
|
+
return () => h("div", { class: "flex min-h-0 flex-1 flex-col overflow-hidden px-(--hn-panel-p)" }, slots.default?.());
|
|
19770
19798
|
}
|
|
19771
19799
|
});
|
|
19772
19800
|
//#endregion
|
|
@@ -19786,6 +19814,41 @@ function useDesktopQuery(query = "(min-width: 64rem)") {
|
|
|
19786
19814
|
return isDesktop;
|
|
19787
19815
|
}
|
|
19788
19816
|
//#endregion
|
|
19817
|
+
//#region src/components/app-shell/composables/useSidebarScrollUpdates.ts
|
|
19818
|
+
function useSidebarScrollUpdates(area) {
|
|
19819
|
+
const transitioning = shallowRef(false);
|
|
19820
|
+
let paused;
|
|
19821
|
+
let revision = 0;
|
|
19822
|
+
function resume() {
|
|
19823
|
+
const instance = paused;
|
|
19824
|
+
paused = void 0;
|
|
19825
|
+
if (instance && !instance.state().destroyed) instance.sleep(false);
|
|
19826
|
+
}
|
|
19827
|
+
const stop = watch([() => area.value?.instance, transitioning], ([instance, active]) => {
|
|
19828
|
+
if (active && instance === paused) return;
|
|
19829
|
+
resume();
|
|
19830
|
+
if (active && instance && !instance.state().sleeping && !instance.state().destroyed) {
|
|
19831
|
+
paused = instance;
|
|
19832
|
+
instance.sleep(true);
|
|
19833
|
+
}
|
|
19834
|
+
}, { flush: "sync" });
|
|
19835
|
+
onBeforeUnmount(() => {
|
|
19836
|
+
revision++;
|
|
19837
|
+
stop();
|
|
19838
|
+
resume();
|
|
19839
|
+
});
|
|
19840
|
+
return (event) => {
|
|
19841
|
+
if (event.target !== event.currentTarget || event.propertyName !== "width") return;
|
|
19842
|
+
const animations = event.currentTarget.getAnimations().filter((animation) => animation instanceof CSSTransition && animation.transitionProperty === "width");
|
|
19843
|
+
if (!animations.length) return;
|
|
19844
|
+
const current = ++revision;
|
|
19845
|
+
transitioning.value = true;
|
|
19846
|
+
Promise.allSettled(animations.map((animation) => animation.finished)).then(() => {
|
|
19847
|
+
if (current === revision) transitioning.value = false;
|
|
19848
|
+
});
|
|
19849
|
+
};
|
|
19850
|
+
}
|
|
19851
|
+
//#endregion
|
|
19789
19852
|
//#region src/components/app-shell/AppShell.vue?vue&type=script&setup=true&lang.ts
|
|
19790
19853
|
var _hoisted_1$14 = {
|
|
19791
19854
|
key: 0,
|
|
@@ -19796,8 +19859,8 @@ var _hoisted_3$4 = {
|
|
|
19796
19859
|
key: 0,
|
|
19797
19860
|
class: "hidden h-full shrink-0 lg:block"
|
|
19798
19861
|
};
|
|
19799
|
-
var _hoisted_4$
|
|
19800
|
-
var _hoisted_5$
|
|
19862
|
+
var _hoisted_4$3 = { class: "flex min-h-0 min-w-0 flex-1 flex-col" };
|
|
19863
|
+
var _hoisted_5$3 = {
|
|
19801
19864
|
key: 0,
|
|
19802
19865
|
class: "border-line bg-canvas shrink-0 border-b"
|
|
19803
19866
|
};
|
|
@@ -19838,6 +19901,7 @@ var AppShell_default = /* @__PURE__ */ defineComponent({
|
|
|
19838
19901
|
mainArea: main
|
|
19839
19902
|
});
|
|
19840
19903
|
const isDesktop = useDesktopQuery();
|
|
19904
|
+
const onTransitionRun = useSidebarScrollUpdates(main);
|
|
19841
19905
|
function toggle() {
|
|
19842
19906
|
if (!isDesktop.value) {
|
|
19843
19907
|
mobileOpen.value = !mobileOpen.value;
|
|
@@ -19848,7 +19912,8 @@ var AppShell_default = /* @__PURE__ */ defineComponent({
|
|
|
19848
19912
|
provideSidebar({
|
|
19849
19913
|
state: computed(() => sidebar.value),
|
|
19850
19914
|
toggle,
|
|
19851
|
-
openMobile: () => mobileOpen.value = true
|
|
19915
|
+
openMobile: () => mobileOpen.value = true,
|
|
19916
|
+
onTransitionRun
|
|
19852
19917
|
});
|
|
19853
19918
|
const router = getCurrentInstance()?.appContext.config.globalProperties.$router;
|
|
19854
19919
|
watch(() => router?.currentRoute?.value?.fullPath, () => {
|
|
@@ -19858,7 +19923,7 @@ var AppShell_default = /* @__PURE__ */ defineComponent({
|
|
|
19858
19923
|
return openBlock(), createBlock(TooltipProvider_default, null, {
|
|
19859
19924
|
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cn)("bg-canvas text-fg flex h-screen flex-col overflow-hidden", props.class)) }, [
|
|
19860
19925
|
_ctx.$slots.banner ? (openBlock(), createElementBlock("div", _hoisted_1$14, [renderSlot(_ctx.$slots, "banner")])) : createCommentVNode("", true),
|
|
19861
|
-
createElementVNode("div", _hoisted_2$10, [_ctx.$slots.sidebar ? (openBlock(), createElementBlock("div", _hoisted_3$4, [renderSlot(_ctx.$slots, "sidebar")])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4$
|
|
19926
|
+
createElementVNode("div", _hoisted_2$10, [_ctx.$slots.sidebar ? (openBlock(), createElementBlock("div", _hoisted_3$4, [renderSlot(_ctx.$slots, "sidebar")])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4$3, [_ctx.$slots.header ? (openBlock(), createElementBlock("header", _hoisted_5$3, [createElementVNode("div", _hoisted_6$1, [renderSlot(_ctx.$slots, "header")])])) : createCommentVNode("", true), createElementVNode("main", _hoisted_7, [createVNode(ScrollArea_default, {
|
|
19862
19927
|
ref_key: "main",
|
|
19863
19928
|
ref: main,
|
|
19864
19929
|
"data-scroll-restore": props.restoreKey,
|
|
@@ -19876,10 +19941,10 @@ var AppShell_default = /* @__PURE__ */ defineComponent({
|
|
|
19876
19941
|
size: "sm",
|
|
19877
19942
|
class: "lg:hidden"
|
|
19878
19943
|
}, {
|
|
19879
|
-
|
|
19944
|
+
body: withCtx(({ close }) => [createVNode(unref(DrawerScope_default), { close }, {
|
|
19880
19945
|
default: withCtx(() => [renderSlot(_ctx.$slots, "sidebar")]),
|
|
19881
19946
|
_: 3
|
|
19882
|
-
})]),
|
|
19947
|
+
}, 8, ["close"])]),
|
|
19883
19948
|
_: 3
|
|
19884
19949
|
}, 8, ["open", "title"])) : createCommentVNode("", true)
|
|
19885
19950
|
], 2)]),
|
|
@@ -20072,7 +20137,8 @@ function useScrollSpy(entries) {
|
|
|
20072
20137
|
const hash = decodeURIComponent(location.hash.slice(1));
|
|
20073
20138
|
if (hash && entries().some((entry) => entry.id === hash)) visible.value = /* @__PURE__ */ new Set([hash]);
|
|
20074
20139
|
locate();
|
|
20075
|
-
watch(entries, () => {
|
|
20140
|
+
watch(entries, (next, previous) => {
|
|
20141
|
+
if (next.length === previous.length && next.every((entry, index) => entry.id === previous[index]?.id)) return;
|
|
20076
20142
|
visible.value = /* @__PURE__ */ new Set();
|
|
20077
20143
|
locate();
|
|
20078
20144
|
});
|
|
@@ -20097,6 +20163,25 @@ function useScrollSpy(entries) {
|
|
|
20097
20163
|
};
|
|
20098
20164
|
}
|
|
20099
20165
|
//#endregion
|
|
20166
|
+
//#region src/components/anchor/composables/useAnchor.ts
|
|
20167
|
+
function useAnchor(items) {
|
|
20168
|
+
const entries = computed(() => items().flatMap((item) => [{
|
|
20169
|
+
id: item.id,
|
|
20170
|
+
label: item.label,
|
|
20171
|
+
depth: 0,
|
|
20172
|
+
item
|
|
20173
|
+
}, ...(item.children ?? []).map((child) => ({
|
|
20174
|
+
id: child.id,
|
|
20175
|
+
label: child.label,
|
|
20176
|
+
depth: 1,
|
|
20177
|
+
item: child
|
|
20178
|
+
}))]));
|
|
20179
|
+
return {
|
|
20180
|
+
entries,
|
|
20181
|
+
...useScrollSpy(() => entries.value)
|
|
20182
|
+
};
|
|
20183
|
+
}
|
|
20184
|
+
//#endregion
|
|
20100
20185
|
//#region src/components/anchor/Anchor.vue?vue&type=script&setup=true&lang.ts
|
|
20101
20186
|
var _hoisted_1$9 = ["aria-label"];
|
|
20102
20187
|
var _hoisted_2$6 = { class: "border-line relative grid grid-cols-1 border-s" };
|
|
@@ -20105,6 +20190,11 @@ var _hoisted_3$2 = [
|
|
|
20105
20190
|
"aria-current",
|
|
20106
20191
|
"onClick"
|
|
20107
20192
|
];
|
|
20193
|
+
var _hoisted_4$2 = { class: "min-w-0 flex-1 wrap-break-word" };
|
|
20194
|
+
var _hoisted_5$2 = {
|
|
20195
|
+
key: 0,
|
|
20196
|
+
class: "flex shrink-0 items-center empty:hidden"
|
|
20197
|
+
};
|
|
20108
20198
|
//#endregion
|
|
20109
20199
|
//#region src/components/anchor/Anchor.vue
|
|
20110
20200
|
var Anchor_default = /* @__PURE__ */ defineComponent({
|
|
@@ -20118,16 +20208,7 @@ var Anchor_default = /* @__PURE__ */ defineComponent({
|
|
|
20118
20208
|
setup(__props) {
|
|
20119
20209
|
const props = __props;
|
|
20120
20210
|
const t = useUiLocale();
|
|
20121
|
-
const entries =
|
|
20122
|
-
id: item.id,
|
|
20123
|
-
label: item.label,
|
|
20124
|
-
depth: 0
|
|
20125
|
-
}, ...(item.children ?? []).map((child) => ({
|
|
20126
|
-
id: child.id,
|
|
20127
|
-
label: child.label,
|
|
20128
|
-
depth: 1
|
|
20129
|
-
}))]));
|
|
20130
|
-
const { visible, current, span, jump } = useScrollSpy(() => entries.value);
|
|
20211
|
+
const { entries, visible, current, span, jump } = useAnchor(() => props.items);
|
|
20131
20212
|
return (_ctx, _cache) => {
|
|
20132
20213
|
return openBlock(), createElementBlock("nav", {
|
|
20133
20214
|
"aria-label": props.label ?? unref(t).anchor.navLabel,
|
|
@@ -20147,7 +20228,7 @@ var Anchor_default = /* @__PURE__ */ defineComponent({
|
|
|
20147
20228
|
class: "bg-accent col-start-1 -ms-px w-0.5 self-stretch justify-self-start rounded-full"
|
|
20148
20229
|
}, null, 8, ["style"])) : createCommentVNode("", true)]),
|
|
20149
20230
|
_: 1
|
|
20150
|
-
}), (openBlock(true), createElementBlock(Fragment, null, renderList(entries
|
|
20231
|
+
}), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(entries), (entry, index) => {
|
|
20151
20232
|
return openBlock(), createElementBlock("li", {
|
|
20152
20233
|
key: entry.id,
|
|
20153
20234
|
class: "col-start-1",
|
|
@@ -20155,9 +20236,12 @@ var Anchor_default = /* @__PURE__ */ defineComponent({
|
|
|
20155
20236
|
}, [createElementVNode("a", {
|
|
20156
20237
|
href: `#${entry.id}`,
|
|
20157
20238
|
"aria-current": unref(current) === entry.id ? "location" : void 0,
|
|
20158
|
-
class: normalizeClass(unref(cn)("hn-link
|
|
20239
|
+
class: normalizeClass(unref(cn)("hn-link flex items-center gap-(--hn-control-gap) py-1 text-sm", entry.depth === 0 ? "ps-3" : "ps-6", unref(visible).has(entry.id) ? "font-medium [--hn-link-color:var(--hn-fg-default)]" : "[--hn-link-color:var(--hn-fg-muted)]")),
|
|
20159
20240
|
onClick: ($event) => unref(jump)($event, entry.id)
|
|
20160
|
-
}, toDisplayString(entry.label),
|
|
20241
|
+
}, [createElementVNode("span", _hoisted_4$2, toDisplayString(entry.label), 1), _ctx.$slots.trailing ? (openBlock(), createElementBlock("span", _hoisted_5$2, [renderSlot(_ctx.$slots, "trailing", {
|
|
20242
|
+
item: entry.item,
|
|
20243
|
+
active: unref(current) === entry.id
|
|
20244
|
+
})])) : createCommentVNode("", true)], 10, _hoisted_3$2)], 4);
|
|
20161
20245
|
}), 128))])], 10, _hoisted_1$9);
|
|
20162
20246
|
};
|
|
20163
20247
|
}
|