= {
bindToLabel: "calendar:weekNumbers"
}
]
+ },
+ list: {
+ properties: [
+ {
+ label: t("book_properties.collapse"),
+ title: t("book_properties.collapse_all_notes"),
+ type: "button",
+ icon: "bx bx-layer-minus",
+ async onClick({ note, triggerCommand }) {
+ const { noteId } = note;
+
+ // owned is important - we shouldn't remove inherited expanded labels
+ for (const expandedAttr of note.getOwnedLabels("expanded")) {
+ await attributes.removeAttributeById(noteId, expandedAttr.attributeId);
+ }
+
+ triggerCommand("refreshNoteList", { noteId: noteId });
+ },
+ },
+ {
+ label: t("book_properties.expand"),
+ title: t("book_properties.expand_all_children"),
+ type: "button",
+ icon: "bx bx-move-vertical",
+ async onClick({ note, triggerCommand }) {
+ const { noteId } = note;
+ if (!note.isLabelTruthy("expanded")) {
+ await attributes.addLabel(noteId, "expanded");
+ }
+
+ triggerCommand("refreshNoteList", { noteId });
+ },
+ }
+ ]
}
};
-export function renderBookProperty(property: BookProperty, note: FNote) {
+export function renderBookProperty(property: BookProperty, context: BookContext) {
const $container = $("");
- const $label = $("