markmap-toolbar 0.18.10-alpha.2 → 0.18.12-alpha.3

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 CHANGED
@@ -210,6 +210,16 @@
210
210
  });
211
211
  }
212
212
  });
213
+ this.register({
214
+ id: "dark",
215
+ title: "Toggle dark theme",
216
+ content: _Toolbar.icon(
217
+ "M10 4a6 6 0 0 0 0 12a6 6 0 0 0 0 -12v2a4 4 0 0 1 0 8z"
218
+ ),
219
+ onClick: () => {
220
+ document.documentElement.classList.toggle("markmap-dark");
221
+ }
222
+ });
213
223
  this.render();
214
224
  }
215
225
  static create(mm) {
@@ -226,6 +236,7 @@
226
236
  };
227
237
  return /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { ...attrs, d: path }) });
228
238
  }
239
+ /** @deprecated Set `showBrand` instead. */
229
240
  setBrand(show) {
230
241
  this.showBrand = show;
231
242
  return this.render();
@@ -273,7 +284,8 @@
273
284
  "zoomIn",
274
285
  "zoomOut",
275
286
  "fit",
276
- "recurse"
287
+ "recurse",
288
+ "dark"
277
289
  ];
278
290
  let Toolbar = _Toolbar;
279
291
  exports.Toolbar = Toolbar;
package/dist/index.mjs CHANGED
@@ -208,6 +208,16 @@ const _Toolbar = class _Toolbar {
208
208
  });
209
209
  }
210
210
  });
211
+ this.register({
212
+ id: "dark",
213
+ title: "Toggle dark theme",
214
+ content: _Toolbar.icon(
215
+ "M10 4a6 6 0 0 0 0 12a6 6 0 0 0 0 -12v2a4 4 0 0 1 0 8z"
216
+ ),
217
+ onClick: () => {
218
+ document.documentElement.classList.toggle("markmap-dark");
219
+ }
220
+ });
211
221
  this.render();
212
222
  }
213
223
  static create(mm) {
@@ -224,6 +234,7 @@ const _Toolbar = class _Toolbar {
224
234
  };
225
235
  return /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { ...attrs, d: path }) });
226
236
  }
237
+ /** @deprecated Set `showBrand` instead. */
227
238
  setBrand(show) {
228
239
  this.showBrand = show;
229
240
  return this.render();
@@ -271,7 +282,8 @@ _Toolbar.defaultItems = [
271
282
  "zoomIn",
272
283
  "zoomOut",
273
284
  "fit",
274
- "recurse"
285
+ "recurse",
286
+ "dark"
275
287
  ];
276
288
  let Toolbar = _Toolbar;
277
289
  export {
package/dist/toolbar.d.ts CHANGED
@@ -8,8 +8,10 @@ export interface IToolbarItem {
8
8
  onClick?: (e: Event) => void;
9
9
  }
10
10
  export declare class Toolbar {
11
- private showBrand;
12
- private registry;
11
+ showBrand: boolean;
12
+ registry: {
13
+ [id: string]: IToolbarItem;
14
+ };
13
15
  private markmap;
14
16
  static defaultItems: (string | IToolbarItem)[];
15
17
  el: HTMLDivElement;
@@ -17,6 +19,7 @@ export declare class Toolbar {
17
19
  static create(mm: Markmap): Toolbar;
18
20
  static icon(path: string, attrs?: {}): import("@gera2ld/jsx-dom").VNode;
19
21
  constructor();
22
+ /** @deprecated Set `showBrand` instead. */
20
23
  setBrand(show: boolean): HTMLDivElement;
21
24
  register(data: IToolbarItem & {
22
25
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-toolbar",
3
- "version": "0.18.10-alpha.2+9487f11",
3
+ "version": "0.18.12-alpha.3+5e694ce",
4
4
  "description": "Extensible toolbar for markmap",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "markmap-common": "0.18.9",
39
- "markmap-view": "0.18.10-alpha.2+9487f11"
39
+ "markmap-view": "0.18.10"
40
40
  },
41
41
  "dependencies": {
42
42
  "@babel/runtime": "^7.22.6",
43
43
  "@gera2ld/jsx-dom": "^2.2.2"
44
44
  },
45
- "gitHead": "9487f115b82c8eaee934c7f848faf67f05c700b1"
45
+ "gitHead": "5e694cef13598557fe8cdf1d2b43396fd3edc07b"
46
46
  }