saby-customizer 0.0.0-pre.28 → 0.0.0-pre.29
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/features/git-branch.js +2 -0
- package/lib/saby-lib/toolbar.js +17 -1
- package/octicons.js +0 -15
- package/package.json +1 -1
package/features/git-branch.js
CHANGED
|
@@ -593,6 +593,7 @@ toolbar.addButton({
|
|
|
593
593
|
|
|
594
594
|
toolbar.addButton({
|
|
595
595
|
position: 'top',
|
|
596
|
+
filter: { names: ['Ошибка', 'Задача'] },
|
|
596
597
|
title: 'Скопировать имя ветки для Git',
|
|
597
598
|
iconSVG: octicons['git-branch'].toSVG({ width: 24 }),
|
|
598
599
|
onclick: card => {
|
|
@@ -605,6 +606,7 @@ toolbar.addButton({
|
|
|
605
606
|
})
|
|
606
607
|
toolbar.addButton({
|
|
607
608
|
position: 'top',
|
|
609
|
+
filter: { names: ['Ошибка', 'Задача'] },
|
|
608
610
|
title: 'Скопировать описание для Git коммита',
|
|
609
611
|
iconSVG: octicons['git-commit'].toSVG({ width: 24 }),
|
|
610
612
|
onclick: card => {
|
package/lib/saby-lib/toolbar.js
CHANGED
|
@@ -54,9 +54,15 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
|
|
|
54
54
|
}
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* @typedef ButtonOptionsFilter
|
|
59
|
+
* @property {Array<string>} [names] Фильтр по названию документа
|
|
60
|
+
*/
|
|
61
|
+
|
|
57
62
|
/**
|
|
58
63
|
* @typedef ButtonOptions
|
|
59
64
|
* @property {string} [position='right'] Позиция панели в которой отображается кнопка
|
|
65
|
+
* @property {ButtonOptionsFilter} [filter] Фильтры отображения кнопок
|
|
60
66
|
* @property {string} title Всплывающая подсказка на кнопке
|
|
61
67
|
* @property {string} iconSVG Верстка иконки в формате SVG
|
|
62
68
|
* @property {Function} onclick Обработчик клика на иконку
|
|
@@ -172,7 +178,17 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
|
|
|
172
178
|
* @param {ButtonOptions} options Опции кнопки
|
|
173
179
|
*/
|
|
174
180
|
addButton(options) {
|
|
175
|
-
|
|
181
|
+
let match = true
|
|
182
|
+
|
|
183
|
+
match = match && this.options.position === options.position
|
|
184
|
+
|
|
185
|
+
if (match && this.options.card && options.filter) {
|
|
186
|
+
if (options.filter.names) {
|
|
187
|
+
match = match && options.filter.names.includes(this.options.card.data.name)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (match) {
|
|
176
192
|
const button = oom.div({
|
|
177
193
|
class: 'button',
|
|
178
194
|
title: options.title,
|
package/octicons.js
CHANGED
|
@@ -2603,21 +2603,6 @@ var require$$0 = {
|
|
|
2603
2603
|
},
|
|
2604
2604
|
clock: clock,
|
|
2605
2605
|
code: code,
|
|
2606
|
-
"code-of-conduct": {
|
|
2607
|
-
name: "code-of-conduct",
|
|
2608
|
-
keywords: [
|
|
2609
|
-
],
|
|
2610
|
-
heights: {
|
|
2611
|
-
"16": {
|
|
2612
|
-
width: 16,
|
|
2613
|
-
path: "<path fill-rule=\"evenodd\" d=\"M8.048 2.241c.964-.709 2.079-1.238 3.325-1.241a4.613 4.613 0 013.282 1.355c.41.408.757.86.996 1.428.238.568.348 1.206.347 1.968 0 2.193-1.505 4.254-3.081 5.862-1.496 1.526-3.213 2.796-4.249 3.563l-.22.163a.75.75 0 01-.895 0l-.221-.163c-1.036-.767-2.753-2.037-4.249-3.563C1.51 10.008.007 7.952.002 5.762a4.614 4.614 0 011.353-3.407C3.123.585 6.223.537 8.048 2.24zm-1.153.983c-.81.78-1.546 1.669-2.166 2.417-.184.222-.358.432-.52.623a.75.75 0 00.04 1.016c.35.35.697.697 1.043 1.047.866.875 2.292.914 3.185.032.264-.26.534-.528.802-.797.694-.694 1.8-.701 2.474-.03L12.92 8.7l.283.284c-.244.334-.515.666-.81.995l-1.384-1.28A.75.75 0 109.99 9.802l1.357 1.252c-.325.31-.656.606-.984.887l-1.48-1.366a.75.75 0 10-1.018 1.102L9.191 12.9c-.433.34-.838.643-1.191.905-1.04-.773-2.537-1.907-3.846-3.242C2.611 8.99 1.502 7.306 1.502 5.75a3.114 3.114 0 01.913-2.335c1.159-1.158 3.23-1.224 4.48-.191zm7.112 4.442c.313-.65.491-1.293.491-1.916v-.001c0-.614-.088-1.045-.23-1.385-.143-.339-.357-.633-.673-.949a3.113 3.113 0 00-2.218-.915c-1.092.003-2.165.627-3.226 1.602-.823.755-1.554 1.637-2.228 2.45l-.127.154.562.566a.756.756 0 001.066.02l.794-.79c1.258-1.258 3.312-1.31 4.594-.032.396.394.792.791 1.173 1.173l.022.023z\"></path>"
|
|
2614
|
-
},
|
|
2615
|
-
"24": {
|
|
2616
|
-
width: 24,
|
|
2617
|
-
path: "<path fill-rule=\"evenodd\" d=\"M2.828 4.328C5.26 1.896 9.5 1.881 11.935 4.317c.024.024.046.05.067.076 1.391-1.078 2.993-1.886 4.777-1.89a6.216 6.216 0 014.424 1.825c.559.56 1.023 1.165 1.34 1.922.318.756.47 1.617.468 2.663 0 2.972-2.047 5.808-4.269 8.074-2.098 2.14-4.507 3.924-5.974 5.009l-.311.23a.752.752 0 01-.897 0l-.312-.23c-1.466-1.085-3.875-2.869-5.973-5.009-2.22-2.263-4.264-5.095-4.27-8.063v.012-.024.012a6.217 6.217 0 011.823-4.596zm8.033 1.042c-1.846-1.834-5.124-1.823-6.969.022a4.713 4.713 0 00-1.382 3.52c0 2.332 1.65 4.79 3.839 7.022 1.947 1.986 4.184 3.66 5.66 4.752a79.983 79.983 0 002.159-1.645l-2.14-1.974a.752.752 0 011.02-1.106l2.295 2.118c.616-.52 1.242-1.08 1.85-1.672l-2.16-1.992a.752.752 0 011.021-1.106l2.188 2.02a18.992 18.992 0 001.528-1.877l-.585-.586-1.651-1.652c-1.078-1.074-2.837-1.055-3.935.043-.379.38-.76.758-1.132 1.126-1.14 1.124-2.96 1.077-4.07-.043-.489-.495-.98-.988-1.475-1.482a.752.752 0 01-.04-1.019c.234-.276.483-.576.745-.893.928-1.12 2.023-2.442 3.234-3.576zm9.725 6.77c.579-1.08.92-2.167.92-3.228.002-.899-.128-1.552-.35-2.08-.22-.526-.551-.974-1.017-1.44a4.71 4.71 0 00-3.356-1.384c-1.66.004-3.25.951-4.77 2.346-1.18 1.084-2.233 2.353-3.188 3.506l-.351.423c.331.332.663.664.993.998a1.375 1.375 0 001.943.03c.37-.365.748-.74 1.125-1.118 1.662-1.663 4.373-1.726 6.06-.045.56.558 1.12 1.12 1.658 1.658l.333.334z\"></path>"
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
},
|
|
2621
2606
|
"code-review": {
|
|
2622
2607
|
name: "code-review",
|
|
2623
2608
|
keywords: [
|