markmap-toolbar 0.15.0-alpha.0 → 0.15.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/README.md +1 -1
- package/dist/index.js +95 -120
- package/dist/index.mjs +31 -9
- package/package.json +6 -6
- package/types/toolbar.d.ts +6 -6
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markmap-toolbar v0.15.0
|
|
1
|
+
/*! markmap-toolbar v0.15.0 | MIT License */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -20,61 +20,48 @@ function _extends() {
|
|
|
20
20
|
return _extends.apply(this, arguments);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/*! @gera2ld/jsx-dom v2.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
30
|
-
var NS_ATTRS = {
|
|
23
|
+
/*! @gera2ld/jsx-dom v2.2.2 | ISC License */
|
|
24
|
+
const VTYPE_ELEMENT = 1;
|
|
25
|
+
const VTYPE_FUNCTION = 2;
|
|
26
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
27
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
28
|
+
const NS_ATTRS = {
|
|
31
29
|
show: XLINK_NS,
|
|
32
30
|
actuate: XLINK_NS,
|
|
33
31
|
href: XLINK_NS
|
|
34
32
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var isElement = function isElement(c) {
|
|
39
|
-
return (c == null ? void 0 : c.vtype) === VTYPE_ELEMENT;
|
|
40
|
-
};
|
|
41
|
-
var isRenderFunction = function isRenderFunction(c) {
|
|
42
|
-
return (c == null ? void 0 : c.vtype) === VTYPE_FUNCTION;
|
|
43
|
-
};
|
|
33
|
+
const isLeaf = c => typeof c === 'string' || typeof c === 'number';
|
|
34
|
+
const isElement = c => (c == null ? void 0 : c.vtype) === VTYPE_ELEMENT;
|
|
35
|
+
const isRenderFunction = c => (c == null ? void 0 : c.vtype) === VTYPE_FUNCTION;
|
|
44
36
|
function jsx(type, props) {
|
|
45
|
-
|
|
37
|
+
let vtype;
|
|
46
38
|
if (typeof type === 'string') vtype = VTYPE_ELEMENT;else if (typeof type === 'function') vtype = VTYPE_FUNCTION;else throw new Error('Invalid VNode type');
|
|
47
39
|
return {
|
|
48
|
-
vtype
|
|
49
|
-
type
|
|
50
|
-
props
|
|
40
|
+
vtype,
|
|
41
|
+
type,
|
|
42
|
+
props
|
|
51
43
|
};
|
|
52
44
|
}
|
|
53
|
-
|
|
45
|
+
const jsxs = jsx;
|
|
54
46
|
function Fragment(props) {
|
|
55
47
|
return props.children;
|
|
56
48
|
}
|
|
57
|
-
|
|
49
|
+
const DEFAULT_ENV = {
|
|
58
50
|
isSvg: false
|
|
59
51
|
};
|
|
60
|
-
function insertDom(parent,
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
ref.children.forEach(function (ch) {
|
|
65
|
-
insertDom(parent, ch);
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
throw new Error("Unkown ref type " + JSON.stringify(ref));
|
|
69
|
-
}
|
|
52
|
+
function insertDom(parent, nodes) {
|
|
53
|
+
if (!Array.isArray(nodes)) nodes = [nodes];
|
|
54
|
+
nodes = nodes.filter(Boolean);
|
|
55
|
+
if (nodes.length) parent.append(...nodes);
|
|
70
56
|
}
|
|
71
57
|
function mountAttributes(domElement, props, env) {
|
|
72
|
-
for (
|
|
58
|
+
for (const key in props) {
|
|
73
59
|
if (key === 'key' || key === 'children' || key === 'ref') continue;
|
|
74
60
|
if (key === 'dangerouslySetInnerHTML') {
|
|
75
61
|
domElement.innerHTML = props[key].__html;
|
|
76
|
-
} else if (key === 'innerHTML' || key === 'textContent' || key === 'innerText') {
|
|
77
|
-
|
|
62
|
+
} else if (key === 'innerHTML' || key === 'textContent' || key === 'innerText' || key === 'value' && ['textarea', 'select'].includes(domElement.tagName)) {
|
|
63
|
+
const value = props[key];
|
|
64
|
+
if (value != null) domElement[key] = value;
|
|
78
65
|
} else if (key.startsWith('on')) {
|
|
79
66
|
domElement[key.toLowerCase()] = props[key];
|
|
80
67
|
} else {
|
|
@@ -82,7 +69,7 @@ function mountAttributes(domElement, props, env) {
|
|
|
82
69
|
}
|
|
83
70
|
}
|
|
84
71
|
}
|
|
85
|
-
|
|
72
|
+
const attrMap = {
|
|
86
73
|
className: 'class',
|
|
87
74
|
labelFor: 'for'
|
|
88
75
|
};
|
|
@@ -93,7 +80,7 @@ function setDOMAttribute(el, attr, value, isSVG) {
|
|
|
93
80
|
} else if (value === false) {
|
|
94
81
|
el.removeAttribute(attr);
|
|
95
82
|
} else {
|
|
96
|
-
|
|
83
|
+
const namespace = isSVG ? NS_ATTRS[attr] : undefined;
|
|
97
84
|
if (namespace !== undefined) {
|
|
98
85
|
el.setAttributeNS(namespace, attr, value);
|
|
99
86
|
} else {
|
|
@@ -101,116 +88,83 @@ function setDOMAttribute(el, attr, value, isSVG) {
|
|
|
101
88
|
}
|
|
102
89
|
}
|
|
103
90
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
function flatten(arr) {
|
|
92
|
+
return arr.reduce((prev, item) => prev.concat(item), []);
|
|
93
|
+
}
|
|
94
|
+
function mountChildren(children, env) {
|
|
95
|
+
return Array.isArray(children) ? flatten(children.map(child => mountChildren(child, env))) : mount(children, env);
|
|
96
|
+
}
|
|
97
|
+
function mount(vnode, env = DEFAULT_ENV) {
|
|
108
98
|
if (vnode == null || typeof vnode === 'boolean') {
|
|
109
|
-
return
|
|
110
|
-
type: MOUNT_SINGLE,
|
|
111
|
-
node: null
|
|
112
|
-
};
|
|
99
|
+
return null;
|
|
113
100
|
}
|
|
114
101
|
if (vnode instanceof Node) {
|
|
115
|
-
return
|
|
116
|
-
type: MOUNT_SINGLE,
|
|
117
|
-
node: vnode
|
|
118
|
-
};
|
|
102
|
+
return vnode;
|
|
119
103
|
}
|
|
120
104
|
if (isRenderFunction(vnode)) {
|
|
121
|
-
|
|
122
|
-
type
|
|
123
|
-
props
|
|
105
|
+
const {
|
|
106
|
+
type,
|
|
107
|
+
props
|
|
108
|
+
} = vnode;
|
|
124
109
|
if (type === Fragment) {
|
|
125
|
-
|
|
110
|
+
const node = document.createDocumentFragment();
|
|
126
111
|
if (props.children) {
|
|
127
|
-
|
|
128
|
-
insertDom(node,
|
|
112
|
+
const children = mountChildren(props.children, env);
|
|
113
|
+
insertDom(node, children);
|
|
129
114
|
}
|
|
130
|
-
return
|
|
131
|
-
type: MOUNT_SINGLE,
|
|
132
|
-
node: node
|
|
133
|
-
};
|
|
115
|
+
return node;
|
|
134
116
|
}
|
|
135
|
-
|
|
117
|
+
const childVNode = type(props);
|
|
136
118
|
return mount(childVNode, env);
|
|
137
119
|
}
|
|
138
120
|
if (isLeaf(vnode)) {
|
|
139
|
-
return {
|
|
140
|
-
type: MOUNT_SINGLE,
|
|
141
|
-
node: document.createTextNode("" + vnode)
|
|
142
|
-
};
|
|
121
|
+
return document.createTextNode(`${vnode}`);
|
|
143
122
|
}
|
|
144
123
|
if (isElement(vnode)) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
124
|
+
let node;
|
|
125
|
+
const {
|
|
126
|
+
type,
|
|
127
|
+
props
|
|
128
|
+
} = vnode;
|
|
129
|
+
if (!env.isSvg && type === 'svg') {
|
|
150
130
|
env = Object.assign({}, env, {
|
|
151
131
|
isSvg: true
|
|
152
132
|
});
|
|
153
133
|
}
|
|
154
134
|
if (!env.isSvg) {
|
|
155
|
-
|
|
135
|
+
node = document.createElement(type);
|
|
156
136
|
} else {
|
|
157
|
-
|
|
137
|
+
node = document.createElementNS(SVG_NS, type);
|
|
158
138
|
}
|
|
159
|
-
mountAttributes(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (env.isSvg && _type === 'foreignObject') {
|
|
139
|
+
mountAttributes(node, props, env);
|
|
140
|
+
if (props.children) {
|
|
141
|
+
let childEnv = env;
|
|
142
|
+
if (env.isSvg && type === 'foreignObject') {
|
|
164
143
|
childEnv = Object.assign({}, childEnv, {
|
|
165
144
|
isSvg: false
|
|
166
145
|
});
|
|
167
146
|
}
|
|
168
|
-
|
|
147
|
+
const children = mountChildren(props.children, childEnv);
|
|
148
|
+
if (children != null) insertDom(node, children);
|
|
169
149
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
node: _node
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
if (Array.isArray(vnode)) {
|
|
179
|
-
return {
|
|
180
|
-
type: MOUNT_ARRAY,
|
|
181
|
-
children: vnode.map(function (child) {
|
|
182
|
-
return mount(child, env);
|
|
183
|
-
})
|
|
184
|
-
};
|
|
150
|
+
const {
|
|
151
|
+
ref
|
|
152
|
+
} = props;
|
|
153
|
+
if (typeof ref === 'function') ref(node);
|
|
154
|
+
return node;
|
|
185
155
|
}
|
|
186
156
|
throw new Error('mount: Invalid Vnode!');
|
|
187
157
|
}
|
|
188
|
-
|
|
189
|
-
var result = [];
|
|
190
|
-
for (var i = 0; i < array.length; i += 1) {
|
|
191
|
-
var item = array[i];
|
|
192
|
-
if (Array.isArray(item)) result = result.concat(flattenWithoutNull(item));else if (item != null) result.push(item);
|
|
193
|
-
}
|
|
194
|
-
return result;
|
|
195
|
-
}
|
|
196
|
-
function asDom(result) {
|
|
197
|
-
if (result.type === MOUNT_SINGLE) {
|
|
198
|
-
return result.node;
|
|
199
|
-
}
|
|
200
|
-
return result.children.map(asDom);
|
|
201
|
-
}
|
|
158
|
+
|
|
202
159
|
/**
|
|
203
160
|
* Mount vdom as real DOM nodes.
|
|
204
161
|
*/
|
|
205
|
-
|
|
206
162
|
function mountDom(vnode) {
|
|
207
|
-
|
|
208
|
-
return flattenWithoutNull(vnode.map(mountDom));
|
|
209
|
-
}
|
|
210
|
-
return asDom(mount(vnode));
|
|
163
|
+
return mount(vnode);
|
|
211
164
|
}
|
|
212
165
|
|
|
213
166
|
const clsToolbarItem = 'mm-toolbar-item';
|
|
167
|
+
const clsActive = 'active';
|
|
214
168
|
function renderBrand() {
|
|
215
169
|
return jsxs("a", {
|
|
216
170
|
className: "mm-toolbar-brand",
|
|
@@ -243,7 +197,7 @@ function safeCaller(fn) {
|
|
|
243
197
|
try {
|
|
244
198
|
await promise;
|
|
245
199
|
} finally {
|
|
246
|
-
promise =
|
|
200
|
+
promise = undefined;
|
|
247
201
|
}
|
|
248
202
|
};
|
|
249
203
|
}
|
|
@@ -251,7 +205,7 @@ class Toolbar {
|
|
|
251
205
|
static create(mm) {
|
|
252
206
|
const toolbar = new Toolbar();
|
|
253
207
|
toolbar.attach(mm);
|
|
254
|
-
return toolbar
|
|
208
|
+
return toolbar;
|
|
255
209
|
}
|
|
256
210
|
static icon(path, attrs = {}) {
|
|
257
211
|
attrs = _extends({
|
|
@@ -271,7 +225,10 @@ class Toolbar {
|
|
|
271
225
|
constructor() {
|
|
272
226
|
this.showBrand = true;
|
|
273
227
|
this.registry = {};
|
|
274
|
-
this.
|
|
228
|
+
this.el = mountDom(jsx("div", {
|
|
229
|
+
className: "mm-toolbar"
|
|
230
|
+
}));
|
|
231
|
+
this.items = [...Toolbar.defaultItems];
|
|
275
232
|
this.register({
|
|
276
233
|
id: 'zoomIn',
|
|
277
234
|
title: 'Zoom in',
|
|
@@ -290,10 +247,24 @@ class Toolbar {
|
|
|
290
247
|
content: Toolbar.icon('M4 7h2v-2h2v4h-4zM4 13h2v2h2v-4h-4zM16 7h-2v-2h-2v4h4zM16 13h-2v2h-2v-4h4z'),
|
|
291
248
|
onClick: this.getHandler(mm => mm.fit())
|
|
292
249
|
});
|
|
293
|
-
this.
|
|
250
|
+
this.register({
|
|
251
|
+
id: 'recurse',
|
|
252
|
+
title: 'Toggle recursively',
|
|
253
|
+
content: Toolbar.icon('M16 4h-12v12h12v-8h-8v4h2v-2h4v4h-8v-8h10z'),
|
|
254
|
+
onClick: e => {
|
|
255
|
+
var _this$markmap;
|
|
256
|
+
const button = e.target.closest(`.${clsToolbarItem}`);
|
|
257
|
+
const active = button == null ? void 0 : button.classList.toggle(clsActive);
|
|
258
|
+
(_this$markmap = this.markmap) == null ? void 0 : _this$markmap.setOptions({
|
|
259
|
+
toggleRecursively: active
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
this.render();
|
|
294
264
|
}
|
|
295
265
|
setBrand(show) {
|
|
296
266
|
this.showBrand = show;
|
|
267
|
+
return this.render();
|
|
297
268
|
}
|
|
298
269
|
register(data) {
|
|
299
270
|
this.registry[data.id] = data;
|
|
@@ -306,6 +277,7 @@ class Toolbar {
|
|
|
306
277
|
}
|
|
307
278
|
setItems(items) {
|
|
308
279
|
this.items = [...items];
|
|
280
|
+
return this.render();
|
|
309
281
|
}
|
|
310
282
|
attach(mm) {
|
|
311
283
|
this.markmap = mm;
|
|
@@ -319,10 +291,13 @@ class Toolbar {
|
|
|
319
291
|
}
|
|
320
292
|
return item;
|
|
321
293
|
}).filter(Boolean);
|
|
322
|
-
|
|
323
|
-
|
|
294
|
+
while (this.el.firstChild) {
|
|
295
|
+
this.el.firstChild.remove();
|
|
296
|
+
}
|
|
297
|
+
this.el.append(mountDom(jsxs(Fragment, {
|
|
324
298
|
children: [this.showBrand && renderBrand(), items.map(renderItem)]
|
|
325
|
-
}));
|
|
299
|
+
})));
|
|
300
|
+
return this.el;
|
|
326
301
|
}
|
|
327
302
|
}
|
|
328
303
|
Toolbar.defaultItems = ['zoomIn', 'zoomOut', 'fit', 'recurse'];
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! markmap-toolbar v0.15.0
|
|
1
|
+
/*! markmap-toolbar v0.15.0 | MIT License */
|
|
2
2
|
import { mountDom } from '@gera2ld/jsx-dom';
|
|
3
|
-
import { jsx, jsxs } from '@gera2ld/jsx-dom/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } from '@gera2ld/jsx-dom/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
function _extends() {
|
|
6
6
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -18,6 +18,7 @@ function _extends() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const clsToolbarItem = 'mm-toolbar-item';
|
|
21
|
+
const clsActive = 'active';
|
|
21
22
|
function renderBrand() {
|
|
22
23
|
return jsxs("a", {
|
|
23
24
|
className: "mm-toolbar-brand",
|
|
@@ -50,7 +51,7 @@ function safeCaller(fn) {
|
|
|
50
51
|
try {
|
|
51
52
|
await promise;
|
|
52
53
|
} finally {
|
|
53
|
-
promise =
|
|
54
|
+
promise = undefined;
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
}
|
|
@@ -58,7 +59,7 @@ class Toolbar {
|
|
|
58
59
|
static create(mm) {
|
|
59
60
|
const toolbar = new Toolbar();
|
|
60
61
|
toolbar.attach(mm);
|
|
61
|
-
return toolbar
|
|
62
|
+
return toolbar;
|
|
62
63
|
}
|
|
63
64
|
static icon(path, attrs = {}) {
|
|
64
65
|
attrs = _extends({
|
|
@@ -78,7 +79,10 @@ class Toolbar {
|
|
|
78
79
|
constructor() {
|
|
79
80
|
this.showBrand = true;
|
|
80
81
|
this.registry = {};
|
|
81
|
-
this.
|
|
82
|
+
this.el = mountDom(jsx("div", {
|
|
83
|
+
className: "mm-toolbar"
|
|
84
|
+
}));
|
|
85
|
+
this.items = [...Toolbar.defaultItems];
|
|
82
86
|
this.register({
|
|
83
87
|
id: 'zoomIn',
|
|
84
88
|
title: 'Zoom in',
|
|
@@ -97,10 +101,24 @@ class Toolbar {
|
|
|
97
101
|
content: Toolbar.icon('M4 7h2v-2h2v4h-4zM4 13h2v2h2v-4h-4zM16 7h-2v-2h-2v4h4zM16 13h-2v2h-2v-4h4z'),
|
|
98
102
|
onClick: this.getHandler(mm => mm.fit())
|
|
99
103
|
});
|
|
100
|
-
this.
|
|
104
|
+
this.register({
|
|
105
|
+
id: 'recurse',
|
|
106
|
+
title: 'Toggle recursively',
|
|
107
|
+
content: Toolbar.icon('M16 4h-12v12h12v-8h-8v4h2v-2h4v4h-8v-8h10z'),
|
|
108
|
+
onClick: e => {
|
|
109
|
+
var _this$markmap;
|
|
110
|
+
const button = e.target.closest(`.${clsToolbarItem}`);
|
|
111
|
+
const active = button == null ? void 0 : button.classList.toggle(clsActive);
|
|
112
|
+
(_this$markmap = this.markmap) == null ? void 0 : _this$markmap.setOptions({
|
|
113
|
+
toggleRecursively: active
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.render();
|
|
101
118
|
}
|
|
102
119
|
setBrand(show) {
|
|
103
120
|
this.showBrand = show;
|
|
121
|
+
return this.render();
|
|
104
122
|
}
|
|
105
123
|
register(data) {
|
|
106
124
|
this.registry[data.id] = data;
|
|
@@ -113,6 +131,7 @@ class Toolbar {
|
|
|
113
131
|
}
|
|
114
132
|
setItems(items) {
|
|
115
133
|
this.items = [...items];
|
|
134
|
+
return this.render();
|
|
116
135
|
}
|
|
117
136
|
attach(mm) {
|
|
118
137
|
this.markmap = mm;
|
|
@@ -126,10 +145,13 @@ class Toolbar {
|
|
|
126
145
|
}
|
|
127
146
|
return item;
|
|
128
147
|
}).filter(Boolean);
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
while (this.el.firstChild) {
|
|
149
|
+
this.el.firstChild.remove();
|
|
150
|
+
}
|
|
151
|
+
this.el.append(mountDom(jsxs(Fragment, {
|
|
131
152
|
children: [this.showBrand && renderBrand(), items.map(renderItem)]
|
|
132
|
-
}));
|
|
153
|
+
})));
|
|
154
|
+
return this.el;
|
|
133
155
|
}
|
|
134
156
|
}
|
|
135
157
|
Toolbar.defaultItems = ['zoomIn', 'zoomOut', 'fit', 'recurse'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-toolbar",
|
|
3
|
-
"version": "0.15.0
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Extensible toolbar for markmap",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"markmap-common": "*"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"markmap-common": "0.15.0
|
|
39
|
-
"markmap-view": "0.15.0
|
|
38
|
+
"markmap-common": "0.15.0",
|
|
39
|
+
"markmap-view": "0.15.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@babel/runtime": "^7.
|
|
43
|
-
"@gera2ld/jsx-dom": "^2.
|
|
42
|
+
"@babel/runtime": "^7.22.6",
|
|
43
|
+
"@gera2ld/jsx-dom": "^2.2.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "9c13bae5e28346ec613362046a023839ef64538b"
|
|
46
46
|
}
|
package/types/toolbar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VChildren } from '@gera2ld/jsx-dom';
|
|
2
2
|
import type { Markmap } from 'markmap-view';
|
|
3
3
|
import './style.css';
|
|
4
|
-
interface IToolbarItem {
|
|
4
|
+
export interface IToolbarItem {
|
|
5
5
|
id?: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
content: VChildren;
|
|
@@ -12,17 +12,17 @@ export declare class Toolbar {
|
|
|
12
12
|
private registry;
|
|
13
13
|
private markmap;
|
|
14
14
|
static defaultItems: (string | IToolbarItem)[];
|
|
15
|
+
el: HTMLDivElement;
|
|
15
16
|
items: (string | IToolbarItem)[];
|
|
16
|
-
static create(mm: Markmap):
|
|
17
|
+
static create(mm: Markmap): Toolbar;
|
|
17
18
|
static icon(path: string, attrs?: {}): import("@gera2ld/jsx-dom").VNode;
|
|
18
19
|
constructor();
|
|
19
|
-
setBrand(show: boolean):
|
|
20
|
+
setBrand(show: boolean): HTMLDivElement;
|
|
20
21
|
register(data: IToolbarItem & {
|
|
21
22
|
id: string;
|
|
22
23
|
}): void;
|
|
23
24
|
getHandler(handle: (mm: Markmap) => Promise<void>): () => void;
|
|
24
|
-
setItems(items: (string | IToolbarItem)[]):
|
|
25
|
+
setItems(items: (string | IToolbarItem)[]): HTMLDivElement;
|
|
25
26
|
attach(mm: Markmap): void;
|
|
26
|
-
render():
|
|
27
|
+
render(): HTMLDivElement;
|
|
27
28
|
}
|
|
28
|
-
export {};
|