saby-customizer 0.0.0-pre.18 → 0.0.0-pre.22

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.
@@ -1,5 +1,5 @@
1
1
  import { oom } from '@notml/core'
2
- import { keysMapping, rightSidebar, PopupDialog, getListOfOpenCards, snackbar, context } from 'saby-customizer/lib.js'
2
+ import { keysMapping, rightSidebar, PopupDialog, getListOfOpenCards, snackbar, context, db } from 'saby-customizer/lib.js'
3
3
  import { octicons } from 'saby-customizer/octicons.js'
4
4
 
5
5
 
@@ -78,7 +78,8 @@ class GitBranchCard extends oom.extends(HTMLElement) {
78
78
  fontSize: '14px',
79
79
  whiteSpace: 'nowrap',
80
80
  overflow: 'hidden',
81
- textOverflow: 'ellipsis'
81
+ textOverflow: 'ellipsis',
82
+ flexGrow: '1'
82
83
  },
83
84
  '.description-textarea': {
84
85
  width: '100%'
@@ -104,130 +105,198 @@ class GitBranchCard extends oom.extends(HTMLElement) {
104
105
  return String(Math.min(Math.max(1, rows), 5))
105
106
  }
106
107
 
107
- url = this.options.data.url
108
- version = this.options.data.version
109
- milestones = this.options.data.milestones
110
- branchType = this.options.data.name === 'Ошибка' ? 'bugfix' : 'feature'
111
-
112
- cardTitle = oom.span(this.getTitle(), { title: this.getTitle() }).dom
113
-
114
- copyLinkButton = oom.mwcIconButton({
115
- title: 'Скопировать ссылку',
116
- class: 'icon_18',
117
- innerHTML: octicons.link.toSVG({ width: 18 }),
118
- onclick: () => this.copyLink()
119
- }).dom
120
-
121
- descriptionEdit = oom.mwcIconButton({
122
- title: 'Редактировать описание для git commit',
123
- class: 'icon_18',
124
- innerHTML: octicons.pencil.toSVG({ width: 18 }),
125
- onclick: () => this.editDescription()
126
- }).dom
127
-
128
- description = oom.span({
129
- class: 'description',
130
- title: this.options.data.description,
131
- onclick: () => this.editDescription()
132
- }, this.options.data.description).dom
133
-
134
- /** @type {HTMLTextAreaElement} */// @ts-ignore
135
- descriptionTextarea = oom.mwcTextarea({
136
- class: 'description-textarea hide',
137
- rows: GitBranchCard.maxRows(this.options.data.description),
138
- label: 'Описание для git commit',
139
- value: this.options.data.description,
140
- oninput: () => {
141
- this.descriptionTextarea.setAttribute('rows', GitBranchCard.maxRows(this.descriptionTextarea.value))
142
- }
143
- }).dom
108
+ /**
109
+ * @typedef GitCardData
110
+ * @property {string} [branchSubName] Имя ветки указанное пользователем
111
+ */
112
+ /** @type {import('saby-customizer/lib.js').CardData & GitCardData} Данные о задаче */
113
+ data = {
114
+ id: this.options.data.id,
115
+ number: this.options.data.number,
116
+ branchSubName: this.options.data.branchSubName || this.options.data.number,
117
+ date: this.options.data.date,
118
+ name: this.options.data.name,
119
+ uuid: this.options.data.uuid,
120
+ url: this.options.data.url,
121
+ author: this.options.data.author,
122
+ milestones: this.options.data.milestones,
123
+ version: this.options.data.version,
124
+ description: this.options.data.description
125
+ }
144
126
 
145
- versions = this.milestones.reduce((mwcMenu, item) => {
146
- mwcMenu(oom.mwcListItem(item))
127
+ elements = {
128
+ /** @type {HTMLSpanElement} */
129
+ cardTitle: oom.span(this.branchTitle, { title: this.branchTitle }).dom,
130
+ /** @type {import('@material/mwc-icon-button').IconButton} */// @ts-ignore
131
+ copyLinkButton: oom.mwcIconButton({
132
+ title: 'Скопировать ссылку',
133
+ class: 'icon_18',
134
+ innerHTML: octicons.link.toSVG({ width: 18 }),
135
+ onclick: () => this.copyLink()
136
+ }).dom,
137
+ /** @type {import('@material/mwc-icon-button').IconButton} */// @ts-ignore
138
+ descriptionEdit: oom.mwcIconButton({
139
+ title: 'Редактировать описание для git commit',
140
+ class: 'icon_18',
141
+ innerHTML: octicons.pencil.toSVG({ width: 18 }),
142
+ onclick: () => this.editDescription()
143
+ }).dom,
144
+ /** @type {HTMLSpanElement} */
145
+ description: oom.span({
146
+ class: 'description',
147
+ title: this.data.description,
148
+ onclick: () => this.editDescription()
149
+ }, this.data.description).dom,
150
+ /** @type {import('@material/mwc-textarea').TextArea} */// @ts-ignore
151
+ descriptionTextarea: oom.mwcTextarea({
152
+ class: 'description-textarea hide',
153
+ rows: GitBranchCard.maxRows(this.data.description),
154
+ label: 'Описание для git commit',
155
+ value: this.data.description,
156
+ oninput: () => this.oninputDescription()
157
+ }).dom,
158
+ /** @type {import('@material/mwc-menu').Menu} */// @ts-ignore
159
+ versions: this.data.milestones.reduce((mwcMenu, item) => {
160
+ return mwcMenu(oom.mwcListItem(item))
161
+ }, oom.mwcMenu({ fixed: true, activatable: true })).dom,
162
+ /** @type {HTMLDivElement} */// @ts-ignore
163
+ branchButton: oom.div({
164
+ class: 'version-button',
165
+ onclick: () => { this.elements.versions.open = true }
166
+ }, this.data.version).dom,
167
+ /** @type {HTMLSpanElement} */
168
+ branchNamePart: oom.span({
169
+ class: 'branch-part'
170
+ }, `/${this.branchType}/***/`).dom,
171
+ /** @type {HTMLSpanElement} */
172
+ branchSubName: oom.span({
173
+ title: this.data.branchSubName,
174
+ class: 'sub-name-button',
175
+ onclick: () => this.editBranchSubName()
176
+ }, this.data.branchSubName).dom,
177
+ /** @type {import('@material/mwc-textfield').TextField} */// @ts-ignore
178
+ branchSubNameTextfield: oom.mwcTextfield({
179
+ class: 'branch-sub-name hide',
180
+ value: this.data.branchSubName,
181
+ placeholder: this.data.branchSubName,
182
+ pattern: '^\\w+[\\w()-]*$',
183
+ validationmessage: 'Латинские буквы, цифры и _()-',
184
+ oninput: () => this.oninputBranchSubName(),
185
+ onblur: () => this.onblurBranchSubName()
186
+ }).dom,
187
+ /** @type {import('@material/mwc-icon-button').IconButton} */// @ts-ignore
188
+ copyBranchButton: oom.mwcIconButton({
189
+ title: 'Скопировать имя ветки',
190
+ class: 'primary-action',
191
+ innerHTML: octicons['git-branch'].toSVG({ width: 24 }),
192
+ onclick: () => this.copyBranchName().catch(console.error)
193
+ }).dom,
194
+ /** @type {import('@material/mwc-icon-button').IconButton} */// @ts-ignore
195
+ copyDescriptionButton: oom.mwcIconButton({
196
+ title: 'Скопировать описание',
197
+ innerHTML: octicons.copy.toSVG({ width: 24 }),
198
+ onclick: () => this.copyDescription().catch(console.error)
199
+ }).dom
200
+ }
147
201
 
148
- return mwcMenu
149
- }, oom.mwcMenu({ fixed: true, activatable: true })).dom
202
+ /** @returns {string} Заголовок для описания задачи */
203
+ get branchTitle() {
204
+ const { name } = this.data
205
+ const docNumber = ' № ' + this.data.number
206
+ const version = ' веха ' + this.version
207
+ const date = ' от ' + this.data.date
208
+ const author = ' ' + this.data.author
150
209
 
151
- branchButton = oom.div({
152
- class: 'version-button',
153
- onclick: () => {
154
- this.versions.open = true
155
- }
156
- }, this.version).dom
157
-
158
- branchNamePart = oom.span({
159
- class: 'branch-part'
160
- }, `/${this.branchType}/***/`).dom
161
-
162
- branchSubName = oom.span({
163
- title: this.options.data.number,
164
- class: 'sub-name-button',
165
- onclick: () => {
166
- this.branchSubName.classList.toggle('hide')
167
- this.branchSubNameTextfield.classList.toggle('hide')
168
- this.branchSubNameTextfield.focus()
169
- this.branchSubNameTextfield.select()
210
+ return name + docNumber + version + date + author
211
+ }
212
+
213
+ /** @returns {string} Версия задачи (веха), выбранная пользователем */
214
+ get version() {
215
+ return this.data.version
216
+ }
217
+
218
+ /**
219
+ * Обновление выбранной версии и обновление карточки задачи
220
+ *
221
+ * @param {string} value Версия
222
+ */
223
+ set version(value) {
224
+ if (this.data.milestones && this.data.milestones.includes(value)) {
225
+ this.data.version = value
226
+ this.elements.branchButton.textContent = this.data.version
227
+ this.elements.cardTitle.textContent = this.branchTitle
170
228
  }
171
- }, this.options.data.number).dom
172
-
173
- /** @type {import('@material/mwc-textfield').TextField} */// @ts-ignore
174
- branchSubNameTextfield = oom.mwcTextfield({
175
- class: 'branch-sub-name hide',
176
- value: this.options.data.number,
177
- placeholder: this.options.data.number,
178
- pattern: '^\\w+$',
179
- validationmessage: 'Латинские буквы и цифры',
180
- onblur: (/** @type {{target:import('@material/mwc-textfield').TextField}} */{ target }) => {
181
- if (target.checkValidity()) {
182
- this.branchSubName.textContent = target.value || this.options.data.number
183
- this.branchSubName.title = this.branchSubName.textContent
184
- this.branchSubName.classList.toggle('hide')
185
- this.branchSubNameTextfield.classList.toggle('hide')
186
- }
229
+ }
230
+
231
+ /** @returns {string} Часть имени ветки, зависящая от регламента задачи */
232
+ get branchType() {
233
+ return this.data.name === 'Ошибка' ? 'bugfix' : 'feature'
234
+ }
235
+
236
+ /** @returns {string} Часть имени ветки, определяемая пользователем */
237
+ get branchSubName() {
238
+ return this.data.branchSubName
239
+ }
240
+
241
+ /**
242
+ * Обновление доп. имени ветки и обновление карточки задачи
243
+ *
244
+ * @param {string} value Доп. имя ветки
245
+ */
246
+ set branchSubName(value) {
247
+ this.data.branchSubName = value || this.data.number
248
+ oom(this.elements.branchSubName, { innerHTML: '', title: this.data.branchSubName }, this.data.branchSubName)
249
+ if (this.elements.branchSubNameTextfield.value !== this.data.branchSubName) {
250
+ this.elements.branchSubNameTextfield.value = this.data.branchSubName
187
251
  }
188
- }).dom
252
+ }
189
253
 
190
- copyBranchButton = oom.mwcIconButton({
191
- title: 'Скопировать имя ветки',
192
- class: 'primary-action',
193
- innerHTML: octicons['git-branch'].toSVG({ width: 24 }),
194
- onclick: () => this.copyBranchName().catch(console.error)
195
- }).dom
254
+ /** @returns {string} Краткое описание задачи */
255
+ get description() {
256
+ return this.data.description
257
+ }
196
258
 
197
- copyDescriptionButton = oom.mwcIconButton({
198
- title: 'Скопировать описание',
199
- innerHTML: octicons.copy.toSVG({ width: 24 }),
200
- onclick: () => this.copyDescription()
201
- }).dom
259
+ /**
260
+ * Обновление краткого описания и карточки задачи
261
+ *
262
+ * @param {string} value Доп. имя ветки
263
+ */
264
+ set description(value) {
265
+ this.data.description = value || ''
266
+ this.elements.description.title = this.data.description
267
+ this.elements.description.textContent = this.data.description
268
+ if (this.elements.descriptionTextarea.value !== this.data.description) {
269
+ this.elements.descriptionTextarea.value = this.data.description
270
+ }
271
+ oom(this.elements.descriptionTextarea, { rows: GitBranchCard.maxRows(this.data.description) })
272
+ }
202
273
 
203
274
  template = () => {
204
- this.versions.anchor = this.branchButton
205
- this.versions.addEventListener('selected', (event) => {
206
- this.version = this.milestones[event.detail.index]
207
- this.cardTitle.textContent = this.getTitle()
208
- this.branchButton.textContent = this.version
275
+ this.elements.versions.anchor = this.elements.branchButton
276
+ this.elements.versions.addEventListener('selected', (/** @type {CustomEvent<import('@material/mwc-list/mwc-list-foundation').ActionDetail>} */event) => {
277
+ this.version = this.data.milestones[event.detail.index]
209
278
  })
210
279
 
211
280
  this.updateBranchNamePart().catch(console.error)
212
281
 
213
282
  return oom.div({ class: 'mdc-card' }, oom
214
- .div({ class: 'title' }, this.cardTitle)
283
+ .div({ class: 'title' }, this.elements.cardTitle)
215
284
  .div(oom
216
- .a({ class: 'link' }, this.url, {
285
+ .a({ class: 'link' }, this.data.url, {
217
286
  target: '_blank',
218
- href: this.url
219
- }), this.copyLinkButton)
287
+ href: this.data.url
288
+ }), this.elements.copyLinkButton)
220
289
  .div({
221
290
  class: 'description-line'
222
- }, this.descriptionEdit, this.description, this.descriptionTextarea)
291
+ }, this.elements.descriptionEdit, this.elements.description, this.elements.descriptionTextarea)
223
292
  .div({ class: 'branch-line' }, oom
224
293
  .div({ class: 'branch' },
225
- this.branchButton,
226
- this.versions,
227
- this.branchNamePart,
228
- this.branchSubName,
229
- this.branchSubNameTextfield)
230
- .div({ class: 'actions' }, this.copyBranchButton, this.copyDescriptionButton)
294
+ this.elements.branchButton,
295
+ this.elements.versions,
296
+ this.elements.branchNamePart,
297
+ this.elements.branchSubName,
298
+ this.elements.branchSubNameTextfield)
299
+ .div({ class: 'actions' }, this.elements.copyBranchButton, this.elements.copyDescriptionButton)
231
300
  )
232
301
  )
233
302
  }
@@ -236,64 +305,124 @@ class GitBranchCard extends oom.extends(HTMLElement) {
236
305
  async updateBranchNamePart() {
237
306
  const userLogin = await context.userLogin
238
307
 
239
- this.branchNamePart.textContent = `/${this.branchType}/${userLogin}/`
308
+ this.elements.branchNamePart.textContent = `/${this.branchType}/${userLogin}/`
240
309
  }
241
310
 
242
- /** Запускает редактирование описания для коммита */
311
+ /** Открывает форму редактирования редактирование описания для коммита */
243
312
  editDescription() {
244
- this.descriptionEdit.classList.toggle('hide')
245
- this.description.classList.toggle('hide')
246
- this.descriptionTextarea.classList.toggle('hide')
247
- this.descriptionTextarea.focus()
313
+ this.elements.descriptionEdit.classList.toggle('hide')
314
+ this.elements.description.classList.toggle('hide')
315
+ this.elements.descriptionTextarea.classList.toggle('hide')
316
+ this.elements.descriptionTextarea.focus()
248
317
  }
249
318
 
250
- /**
251
- * @returns {string} Заголовок
252
- */
253
- getTitle() {
254
- const { name } = this.options.data
255
- const docNumber = ' № ' + this.options.data.number
256
- const version = ' веха ' + this.version
257
- const date = ' от ' + this.options.data.date
258
- const author = ' ' + this.options.data.author
319
+ /** Обработка события при вводе текста в описание для расчета отображаемого кол-ва строк */
320
+ oninputDescription() {
321
+ this.description = this.elements.descriptionTextarea.value
322
+ }
259
323
 
260
- return name + docNumber + version + date + author
324
+ /** Открывает форму редактирования доп. имени ветки */
325
+ editBranchSubName() {
326
+ this.elements.branchSubName.classList.toggle('hide')
327
+ this.elements.branchSubNameTextfield.classList.toggle('hide')
328
+ this.elements.branchSubNameTextfield.focus()
329
+ this.elements.branchSubNameTextfield.select()
330
+ }
331
+
332
+ /** Сохранение данных о доп. имени ветки при вводе */
333
+ oninputBranchSubName() {
334
+ if (this.elements.branchSubNameTextfield.checkValidity()) {
335
+ this.branchSubName = this.elements.branchSubNameTextfield.value
336
+ }
337
+ }
338
+
339
+ /** Скрывает поле ввода доп. имени ветки при потере фокуса */
340
+ onblurBranchSubName() {
341
+ if (this.elements.branchSubNameTextfield.checkValidity()) {
342
+ this.elements.branchSubName.classList.toggle('hide')
343
+ this.elements.branchSubNameTextfield.classList.toggle('hide')
344
+ }
261
345
  }
262
346
 
263
347
  /**
348
+ * Получение имени ветки с учетом выбора вехи и доп. имени ветки
349
+ *
264
350
  * @returns {Promise<string>} Имя ветки
265
351
  */
266
352
  async getBranchName() {
267
- const branchSubName = this.branchSubNameTextfield.value || this.options.data.number
268
353
  const userLogin = await context.userLogin
269
354
 
270
- return `${this.version}/${this.branchType}/${userLogin}/${branchSubName}`
355
+ return `${this.version}/${this.branchType}/${userLogin}/${this.branchSubName}`
271
356
  }
272
357
 
273
358
  /** Копирование ссылки на задачу */
274
359
  copyLink() {
275
- navigator.clipboard.writeText(this.url)
276
- snackbar.show(`Скопирована ссылка: ${this.url}`)
360
+ navigator.clipboard.writeText(this.data.url)
361
+ snackbar.show(`Скопирована ссылка: ${this.data.url}`)
277
362
  }
278
363
 
279
364
  /** Копирование имени ветки */
280
365
  async copyBranchName() {
281
- if (this.branchSubNameTextfield.checkValidity()) {
366
+ if (this.elements.branchSubNameTextfield.checkValidity()) {
282
367
  const branchName = await this.getBranchName()
283
368
 
284
369
  navigator.clipboard.writeText(branchName)
285
370
  snackbar.show(`Скопировано имя ветки: ${branchName}`)
371
+
372
+ await this.saveToHistory()
286
373
  }
287
374
  }
288
375
 
289
376
  /** Копирование описания для git commit */
290
- copyDescription() {
291
- const description = this.getTitle() + '\n' +
292
- this.url + '\n' +
293
- this.descriptionTextarea.value
377
+ async copyDescription() {
378
+ const description = this.branchTitle + '\n' +
379
+ this.data.url + '\n' +
380
+ this.description
294
381
 
295
382
  navigator.clipboard.writeText(description)
296
383
  snackbar.show(`Скопировано описание для git commit:\n${description}`)
384
+
385
+ await this.saveToHistory()
386
+ }
387
+
388
+ /** Сохраняет данные в историю по карточкам для которых копировали имя ветки или описание */
389
+ async saveToHistory() {
390
+ const branchName = await this.getBranchName()
391
+ const gitBranchHistory = db.table('gitBranchHistory')
392
+ const historyOldData = await gitBranchHistory.get({
393
+ id: this.data.id,
394
+ branch: branchName
395
+ })
396
+ const historyData = {
397
+ id: this.data.id,
398
+ branch: branchName,
399
+ version: this.version,
400
+ useDate: new Date(),
401
+ data: this.data
402
+ }
403
+
404
+ if (historyOldData) {
405
+ await gitBranchHistory.update(historyOldData.pk, historyData)
406
+ } else {
407
+ await gitBranchHistory.add(historyData)
408
+ }
409
+ }
410
+
411
+ /** Восстановление из истории последнего сохраненного состояния карточки */
412
+ async restoreFromHistory() {
413
+ const gitBranchHistory = db.table('gitBranchHistory')
414
+ const historyData = await gitBranchHistory
415
+ .where({ id: this.options.data.id })
416
+ .reverse()
417
+ .sortBy('useDate')
418
+
419
+ if (historyData && historyData.length > 0) {
420
+ const [{ data: { version, branchSubName, description } }] = historyData
421
+
422
+ this.version = version
423
+ this.branchSubName = branchSubName
424
+ this.description = description
425
+ }
297
426
  }
298
427
 
299
428
  }
@@ -321,22 +450,35 @@ class GitBranchCardList extends oom.extends(HTMLElement) {
321
450
  // .mwcTab({ label: 'Список задач' })
322
451
  .mwcTab({ label: 'История задач' }))
323
452
 
324
- openTaskList = getListOfOpenCards({
325
- names: ['Ошибка', 'Задача'],
326
- hasVersion: true
327
- })
328
- .map(card => new GitBranchCard(card))
453
+ list = oom.div({ class: 'content' })
329
454
 
330
- openTaskListElement = (this.openTaskList.length > 0 && oom()(...this.openTaskList)) || oom
331
- .div({ class: 'empty' }, 'Открытых задач с вехой не найдено')
455
+ template = async () => {
456
+ // if (this.openTaskList.length === 0) {
457
+ // this.tabs({ activeindex: '1' })
458
+ // }
459
+ oom(this, this.tabs, this.list)
460
+ oom(this.list, oom.div({ class: 'empty' }, 'Загрузка ...'))
332
461
 
333
- template = () => {
334
- if (this.openTaskList.length === 0) {
335
- this.tabs({ activeindex: '1' })
462
+ this.list({ innerHTML: '' }, await this.buildTaskList())
463
+ }
464
+
465
+ /** @returns {Promise<HTMLElement|DocumentFragment>} Вернет готовый список задач с учетом аинхронной загрузки данных */
466
+ async buildTaskList() {
467
+ let taskTist = null
468
+ const openTaskList = (await getListOfOpenCards({
469
+ names: ['Ошибка', 'Задача'],
470
+ hasVersion: true
471
+ })).map(card => new GitBranchCard(card))
472
+
473
+ await Promise.all(openTaskList.map(card => card.restoreFromHistory()))
474
+
475
+ if (openTaskList.length > 0) {
476
+ taskTist = oom()(...openTaskList)
477
+ } else {
478
+ taskTist = oom.div({ class: 'empty' }, 'Открытых задач с вехой не найдено')
336
479
  }
337
- oom(this, this.tabs, oom.div({
338
- class: 'content'
339
- }, this.openTaskListElement))
480
+
481
+ return taskTist.dom
340
482
  }
341
483
 
342
484
  }
package/lib/database.js CHANGED
@@ -3,7 +3,10 @@ import { Dexie } from 'dexie'
3
3
  const db = new Dexie('saby-customizer-database')
4
4
 
5
5
 
6
- db.version(1).stores({ settings: '&key' })
6
+ db.version(2).stores({
7
+ settings: '&key',
8
+ gitBranchHistory: '++pk, &[id+branch], version, useDate'
9
+ })
7
10
 
8
11
 
9
12
  export { db }
@@ -1,2 +1,3 @@
1
1
  // Собрать стату по использованию фич кастомайзера
2
2
  // https://online.sbis.ru/news/4a005fd5-c99b-4e8d-a78b-eeb67b78d892
3
+ // https://git.sbis.ru/contragents/online/-/blob/rc-22.1200/client/ContractorCommon/_statisticCollection/Helper.ts
@@ -68,7 +68,16 @@ function parseRichEditorJSON(json) {
68
68
 
69
69
  /**
70
70
  * @typedef CardData Данные карточки документа
71
+ * @property {string} id Идентификатор документа
71
72
  * @property {string} number Номер документа
73
+ * @property {string} date Дата создания документа
74
+ * @property {string} name Название регламента Задача/Ошибка и т.д.
75
+ * @property {string} uuid UUID документа (для открытия ссылки)
76
+ * @property {string} url Ссылка на документ в отдельной вкладке
77
+ * @property {string} author Автор документа
78
+ * @property {string[]} milestones Список доступных вех (версий)
79
+ * @property {string} version Ближайшая версия
80
+ * @property {string} description Краткий текст описания задачи
72
81
  */
73
82
  /**
74
83
  * @typedef OpenCardsFilter Фильтры для выборки документов
@@ -95,13 +104,16 @@ export function getListOfOpenCards(filter = {}) {
95
104
  const { element } = control
96
105
  const record = control?.options?.record
97
106
  const data = record && {
107
+ id: record.get('@Документ'),
98
108
  number: record.get('Номер'),
99
109
  date: getStrDate(record.get('Дата')),
100
110
  name: record.get('РП.Документ').get('Регламент').get('Название'),
101
111
  uuid: record.get('РП.Документ').get('ИдентификаторПереписки'),
112
+ url: '',
102
113
  author: record.get('ЛицоСоздал.Название') || record.get('Сотрудник.Название'),
103
114
  milestones: [],
104
- version: 'dev'
115
+ version: 'dev',
116
+ description: ''
105
117
  }
106
118
 
107
119
  if (data) {
@@ -76,6 +76,14 @@ class RightSidebarButtonsContainer extends oom.extends(HTMLElement, { global: fa
76
76
  if (sabyPageRightPanel) {
77
77
  RightSidebarButtonsContainer.globalContainer = new RightSidebarButtonsContainer({ global: true })
78
78
  sabyPageRightPanel.prepend(RightSidebarButtonsContainer.globalContainer)
79
+ } else {
80
+ // Глобальные кнопки в карточке открытой в отдельной вкладке
81
+ const cardRightPanel = document.querySelector('.controls-StackTemplate__rightPanel .sabyPage-widgets__wrapper')
82
+
83
+ if (cardRightPanel) {
84
+ RightSidebarButtonsContainer.globalContainer = new RightSidebarButtonsContainer({ global: true })
85
+ cardRightPanel.prepend(RightSidebarButtonsContainer.globalContainer)
86
+ }
79
87
  }
80
88
  }
81
89
 
@@ -85,7 +93,12 @@ class RightSidebarButtonsContainer extends oom.extends(HTMLElement, { global: fa
85
93
 
86
94
  if (popupContainer) {
87
95
  this.observer = new MutationObserver(() => {
88
- const rightPanels = popupContainer.querySelectorAll('.controls-StackTemplate__rightPanel .sabyPage-MainLayout__wrapper')
96
+ let rightPanels = popupContainer.querySelectorAll('.controls-StackTemplate__rightPanel .sabyPage-MainLayout__wrapper')
97
+
98
+ if (rightPanels.length === 0) {
99
+ // Кнопки для всплывающий панелей в карточке открытой в отдельной вкладке
100
+ rightPanels = popupContainer.querySelectorAll('.controls-StackTemplate__rightPanel .sabyPage-widgets__wrapper')
101
+ }
89
102
 
90
103
  rightPanels.forEach(panel => {
91
104
  const rightSidebar = panel.querySelector('saby-customizer-right-sidebar')
@@ -95,9 +108,8 @@ class RightSidebarButtonsContainer extends oom.extends(HTMLElement, { global: fa
95
108
  }
96
109
  })
97
110
  })
111
+ this.observer.observe(popupContainer, { childList: true })
98
112
  }
99
-
100
- this.observer.observe(popupContainer, { childList: true })
101
113
  }
102
114
 
103
115
  template = () => {
package/material.js CHANGED
@@ -2046,13 +2046,13 @@ const t$2=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeSh
2046
2046
  * Copyright 2017 Google LLC
2047
2047
  * SPDX-License-Identifier: BSD-3-Clause
2048
2048
  */
2049
- var t$1;const i$2=globalThis.trustedTypes,s$2=i$2?i$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2=`lit$${(Math.random()+"").slice(9)}$`,o$3="?"+e$2,n$2=`<${o$3}>`,l$4=document,h$1=(t="")=>l$4.createComment(t),r$2=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d$1=Array.isArray,u=t=>{var i;return d$1(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f$1=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_=/'/g,m=/"/g,g=/^(?:script|style|textarea)$/i,$=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),p=$(1),b=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),x=new WeakMap,w=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(h$1(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l},A=l$4.createTreeWalker(l$4,129,null,!1),C=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?"<svg>":"",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,$=-1,p=0;for(;p<s.length&&(d.lastIndex=p,u=d.exec(s),null!==u);)p=d.lastIndex,d===c?"!--"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(g.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=f$1):void 0!==u[3]&&(d=f$1):d===f$1?">"===u[0]?(d=null!=h?h:c,$=-1):void 0===u[1]?$=-2:($=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f$1:'"'===u[3]?m:_):d===m||d===_?d=f$1:d===v||d===a?d=c:(d=f$1,h=void 0);const y=d===f$1&&t[i+1].startsWith("/>")?" ":"";r+=d===c?s+n$2:$>=0?(l.push(o),s.slice(0,$)+"$lit$"+s.slice($)+e$2+y):s+e$2+(-2===$?(l.push(void 0),i):y);}const u=r+(t[o]||"<?>")+(2===i?"</svg>":"");return [void 0!==s$2?s$2.createHTML(u):u,l]};class P{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=C(t,s);if(this.el=P.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(e$2)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(e$2),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?k:"@"===i[1]?H:S});}else c.push({type:6,index:r});}for(const i of t)l.removeAttribute(i);}if(g.test(l.tagName)){const t=l.textContent.split(e$2),s=t.length-1;if(s>0){l.textContent=i$2?i$2.emptyScript:"";for(let i=0;i<s;i++)l.append(t[i],h$1()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h$1());}}}else if(8===l.nodeType)if(l.data===o$3)c.push({type:2,index:r});else {let t=-1;for(;-1!==(t=l.data.indexOf(e$2,t+1));)c.push({type:7,index:r}),t+=e$2.length-1;}r++;}}static createElement(t,i){const s=l$4.createElement("template");return s.innerHTML=t,s}}function V(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r$2(i)?void 0:i._$litDirective$;return (null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=V(t,d._$AS(t,i.values),d,e)),i}class E{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l$4).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new I(n,this,t)),this.v.push(i),d=e[++r];}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++);}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=V(this,t,i),r$2(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==b&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):u(t)?this.M(t):this.$(t);}A(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t));}$(t){this._$AH!==T&&r$2(this._$AH)?this._$AA.nextSibling.data=t:this.S(l$4.createTextNode(t)),this._$AH=t;}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=P.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else {const t=new E(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t;}}_$AC(t){let i=x.get(t.strings);return void 0===i&&x.set(t.strings,i=new P(t)),i}M(t){d$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.A(h$1()),this.A(h$1()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=V(this,t,i,0),n=!r$2(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=V(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r$2(h)||h!==this._$AH[l]),h===T?t=T:t!==T&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.k(t);}k(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S{constructor(){super(...arguments),this.type=3;}k(t){this.element[this.name]=t===T?void 0:t;}}class k extends S{constructor(){super(...arguments),this.type=4;}k(t){t&&t!==T?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name);}}class H extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=V(this,t,i,0))&&void 0!==s?s:T)===b)return;const e=this._$AH,o=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==T&&(e===T||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class I{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t);}}const R=window.litHtmlPolyfillSupport;null==R||R(P,N),(null!==(t$1=globalThis.litHtmlVersions)&&void 0!==t$1?t$1:globalThis.litHtmlVersions=[]).push("2.0.1");
2049
+ var t$1;const i$2=globalThis.trustedTypes,s$2=i$2?i$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2=`lit$${(Math.random()+"").slice(9)}$`,o$3="?"+e$2,n$2=`<${o$3}>`,l$4=document,h$1=(t="")=>l$4.createComment(t),r$2=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d$1=Array.isArray,u=t=>{var i;return d$1(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f$1=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_=/'/g,m=/"/g,g=/^(?:script|style|textarea)$/i,$=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),p=$(1),b=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),x=new WeakMap,w=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(h$1(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l},A=l$4.createTreeWalker(l$4,129,null,!1),C=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?"<svg>":"",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,$=-1,p=0;for(;p<s.length&&(d.lastIndex=p,u=d.exec(s),null!==u);)p=d.lastIndex,d===c?"!--"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(g.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=f$1):void 0!==u[3]&&(d=f$1):d===f$1?">"===u[0]?(d=null!=h?h:c,$=-1):void 0===u[1]?$=-2:($=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f$1:'"'===u[3]?m:_):d===m||d===_?d=f$1:d===v||d===a?d=c:(d=f$1,h=void 0);const y=d===f$1&&t[i+1].startsWith("/>")?" ":"";r+=d===c?s+n$2:$>=0?(l.push(o),s.slice(0,$)+"$lit$"+s.slice($)+e$2+y):s+e$2+(-2===$?(l.push(void 0),i):y);}const u=r+(t[o]||"<?>")+(2===i?"</svg>":"");return [void 0!==s$2?s$2.createHTML(u):u,l]};class P{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=C(t,s);if(this.el=P.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(e$2)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(e$2),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?H:"@"===i[1]?I:S});}else c.push({type:6,index:r});}for(const i of t)l.removeAttribute(i);}if(g.test(l.tagName)){const t=l.textContent.split(e$2),s=t.length-1;if(s>0){l.textContent=i$2?i$2.emptyScript:"";for(let i=0;i<s;i++)l.append(t[i],h$1()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h$1());}}}else if(8===l.nodeType)if(l.data===o$3)c.push({type:2,index:r});else {let t=-1;for(;-1!==(t=l.data.indexOf(e$2,t+1));)c.push({type:7,index:r}),t+=e$2.length-1;}r++;}}static createElement(t,i){const s=l$4.createElement("template");return s.innerHTML=t,s}}function V(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r$2(i)?void 0:i._$litDirective$;return (null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=V(t,d._$AS(t,i.values),d,e)),i}class E{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l$4).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new L(n,this,t)),this.v.push(i),d=e[++r];}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++);}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=V(this,t,i),r$2(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==b&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):u(t)?this.M(t):this.$(t);}A(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t));}$(t){this._$AH!==T&&r$2(this._$AH)?this._$AA.nextSibling.data=t:this.S(l$4.createTextNode(t)),this._$AH=t;}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=P.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else {const t=new E(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t;}}_$AC(t){let i=x.get(t.strings);return void 0===i&&x.set(t.strings,i=new P(t)),i}M(t){d$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.A(h$1()),this.A(h$1()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=V(this,t,i,0),n=!r$2(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=V(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r$2(h)||h!==this._$AH[l]),h===T?t=T:t!==T&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.k(t);}k(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S{constructor(){super(...arguments),this.type=3;}k(t){this.element[this.name]=t===T?void 0:t;}}const k=i$2?i$2.emptyScript:"";class H extends S{constructor(){super(...arguments),this.type=4;}k(t){t&&t!==T?this.element.setAttribute(this.name,k):this.element.removeAttribute(this.name);}}class I extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=V(this,t,i,0))&&void 0!==s?s:T)===b)return;const e=this._$AH,o=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==T&&(e===T||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class L{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t);}}const z=window.litHtmlPolyfillSupport;null==z||z(P,N),(null!==(t$1=globalThis.litHtmlVersions)&&void 0!==t$1?t$1:globalThis.litHtmlVersions=[]).push("2.0.2");
2050
2050
 
2051
2051
  /**
2052
2052
  * @license
2053
2053
  * Copyright 2017 Google LLC
2054
2054
  * SPDX-License-Identifier: BSD-3-Clause
2055
- */var l$3,o$2;class s$1 extends n$3{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=w(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1);}render(){return b}}s$1.finalized=!0,s$1._$litElement$=!0,null===(l$3=globalThis.litElementHydrateSupport)||void 0===l$3||l$3.call(globalThis,{LitElement:s$1});const n$1=globalThis.litElementPolyfillSupport;null==n$1||n$1({LitElement:s$1});(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.0.1");
2055
+ */var l$3,o$2;class s$1 extends n$3{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=w(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1);}render(){return b}}s$1.finalized=!0,s$1._$litElement$=!0,null===(l$3=globalThis.litElementHydrateSupport)||void 0===l$3||l$3.call(globalThis,{LitElement:s$1});const n$1=globalThis.litElementPolyfillSupport;null==n$1||n$1({LitElement:s$1});(null!==(o$2=globalThis.litElementVersions)&&void 0!==o$2?o$2:globalThis.litElementVersions=[]).push("3.0.2");
2056
2056
 
2057
2057
  /**
2058
2058
  * @license
@@ -2587,12 +2587,6 @@ __decorate([
2587
2587
  e$7()
2588
2588
  ], DialogBase.prototype, "initialFocusAttribute", void 0);
2589
2589
 
2590
- /**
2591
- * @license
2592
- * Copyright 2017 Google LLC
2593
- * SPDX-License-Identifier: BSD-3-Clause
2594
- */console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.");
2595
-
2596
2590
  /**
2597
2591
  * @license
2598
2592
  * Copyright 2021 Google LLC
@@ -3477,7 +3471,7 @@ function tsDecorator(prototype, name, descriptor) {
3477
3471
  const constructor = prototype.constructor;
3478
3472
  if (!descriptor) {
3479
3473
  /**
3480
- * lit-element uses internal properties with two leading underscores to
3474
+ * lit uses internal properties with two leading underscores to
3481
3475
  * provide storage for accessors
3482
3476
  */
3483
3477
  const litInternalPropertyKey = `__${name}`;
@@ -3493,14 +3487,21 @@ function tsDecorator(prototype, name, descriptor) {
3493
3487
  if (!propDescriptor.set) {
3494
3488
  throw new Error(`@ariaProperty requires a setter for ${name}`);
3495
3489
  }
3490
+ // TODO(b/202853219): Remove this check when internal tooling is
3491
+ // compatible
3492
+ // tslint:disable-next-line:no-any bail if applied to internal generated class
3493
+ if (prototype.dispatchWizEvent) {
3494
+ return descriptor;
3495
+ }
3496
3496
  const wrappedDescriptor = {
3497
3497
  configurable: true,
3498
3498
  enumerable: true,
3499
3499
  set(value) {
3500
3500
  if (attribute === '') {
3501
3501
  const options = constructor.getPropertyOptions(name);
3502
- // the attribute will be a string at runtime
3503
- attribute = options.attribute;
3502
+ // if attribute is not a string, use `name` instead
3503
+ attribute =
3504
+ typeof options.attribute === 'string' ? options.attribute : name;
3504
3505
  }
3505
3506
  if (this.hasAttribute(attribute)) {
3506
3507
  this.removeAttribute(attribute);
@@ -3539,7 +3540,9 @@ function tsDecorator(prototype, name, descriptor) {
3539
3540
  * @category Decorator
3540
3541
  * @ExportDecoratedItems
3541
3542
  */
3542
- function ariaProperty(protoOrDescriptor, name, descriptor) {
3543
+ function ariaProperty(protoOrDescriptor, name,
3544
+ // tslint:disable-next-line:no-any any is required as a return type from decorators
3545
+ descriptor) {
3543
3546
  if (name !== undefined) {
3544
3547
  return tsDecorator(protoOrDescriptor, name, descriptor);
3545
3548
  }
@@ -7567,6 +7570,7 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
7567
7570
  _this.isFixedPosition = false;
7568
7571
  _this.isHorizontallyCenteredOnViewport = false;
7569
7572
  _this.maxHeight = 0;
7573
+ _this.openBottomBias = 0;
7570
7574
  _this.openAnimationEndTimerId = 0;
7571
7575
  _this.closeAnimationEndTimerId = 0;
7572
7576
  _this.animationRequestId = 0;
@@ -7724,6 +7728,15 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
7724
7728
  MDCMenuSurfaceFoundation.prototype.setMaxHeight = function (maxHeight) {
7725
7729
  this.maxHeight = maxHeight;
7726
7730
  };
7731
+ /**
7732
+ * Set to a positive integer to influence the menu to preferentially open
7733
+ * below the anchor instead of above.
7734
+ * @param bias A value of `x` simulates an extra `x` pixels of available space
7735
+ * below the menu during positioning calculations.
7736
+ */
7737
+ MDCMenuSurfaceFoundation.prototype.setOpenBottomBias = function (bias) {
7738
+ this.openBottomBias = bias;
7739
+ };
7727
7740
  MDCMenuSurfaceFoundation.prototype.isOpen = function () {
7728
7741
  return this.isSurfaceOpen;
7729
7742
  };
@@ -7906,7 +7919,8 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
7906
7919
  anchorSize.height - this.anchorMargin.top;
7907
7920
  }
7908
7921
  var isAvailableBottom = availableBottom - surfaceSize.height > 0;
7909
- if (!isAvailableBottom && availableTop > availableBottom) {
7922
+ if (!isAvailableBottom &&
7923
+ availableTop > availableBottom + this.openBottomBias) {
7910
7924
  // Attach bottom side of surface to the anchor.
7911
7925
  corner = this.setBit(corner, CornerBit.BOTTOM);
7912
7926
  }
@@ -11930,7 +11944,7 @@ class AccessibleSnackbarLabel extends d {
11930
11944
  // all browsers and screen readers:
11931
11945
  //
11932
11946
  // 1. `textContent = ''` is required for IE11 + JAWS
11933
- // 2. the lit-html render of `'&nbsp;'` is required for Chrome + JAWS and
11947
+ // 2. the lit render of `'&nbsp;'` is required for Chrome + JAWS and
11934
11948
  // NVDA
11935
11949
  //
11936
11950
  // All other browser/screen reader combinations support both methods.
package/octicons.js CHANGED
@@ -2239,6 +2239,17 @@ var zap = {
2239
2239
  };
2240
2240
  var require$$0 = {
2241
2241
  alert: alert,
2242
+ "alert-fill": {
2243
+ name: "alert-fill",
2244
+ keywords: [
2245
+ ],
2246
+ heights: {
2247
+ "12": {
2248
+ width: 12,
2249
+ path: "<path fill-rule=\"evenodd\" d=\"M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 01-1.146 1.954H1.33A1.312 1.312 0 01.183 9.058L4.855.708zM7 7V3H5v4h2zm-1 3a1 1 0 100-2 1 1 0 000 2z\"></path>"
2250
+ }
2251
+ }
2252
+ },
2242
2253
  archive: archive,
2243
2254
  "arrow-both": {
2244
2255
  name: "arrow-both",
@@ -2485,6 +2496,10 @@ var require$$0 = {
2485
2496
  keywords: [
2486
2497
  ],
2487
2498
  heights: {
2499
+ "12": {
2500
+ width: 12,
2501
+ path: "<path fill-rule=\"evenodd\" d=\"M6 0a6 6 0 100 12A6 6 0 006 0zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938z\"></path>"
2502
+ },
2488
2503
  "16": {
2489
2504
  width: 16,
2490
2505
  path: "<path fill-rule=\"evenodd\" d=\"M8 16A8 8 0 108 0a8 8 0 000 16zm3.78-9.72a.75.75 0 00-1.06-1.06L6.75 9.19 5.28 7.72a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l4.5-4.5z\"></path>"
@@ -3532,13 +3547,24 @@ var require$$0 = {
3532
3547
  heights: {
3533
3548
  "16": {
3534
3549
  width: 16,
3535
- path: "<path fill-rule=\"evenodd\" d=\"M2.5 8a5.5 5.5 0 1111 0 5.5 5.5 0 01-11 0zM8 1a7 7 0 100 14A7 7 0 008 1zm3.25 7.75a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5z\"></path>"
3550
+ path: "<path d=\"M4.25 7.25a.75.75 0 000 1.5h7.5a.75.75 0 000-1.5h-7.5z\"></path><path fill-rule=\"evenodd\" d=\"M16 8A8 8 0 110 8a8 8 0 0116 0zm-1.5 0a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z\"></path>"
3536
3551
  },
3537
3552
  "24": {
3538
3553
  width: 24,
3539
3554
  path: "<path fill-rule=\"evenodd\" d=\"M2.5 12a9.5 9.5 0 1119 0 9.5 9.5 0 01-19 0zM12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zm6.25 11.75a.75.75 0 000-1.5H5.75a.75.75 0 000 1.5h12.5z\"></path>"
3540
3555
  }
3541
3556
  }
3557
+ },
3558
+ "no-entry-fill": {
3559
+ name: "no-entry-fill",
3560
+ keywords: [
3561
+ ],
3562
+ heights: {
3563
+ "12": {
3564
+ width: 12,
3565
+ path: "<path fill-rule=\"evenodd\" d=\"M6 0a6 6 0 100 12A6 6 0 006 0zm3 5H3v2h6V5z\"></path>"
3566
+ }
3567
+ }
3542
3568
  },
3543
3569
  "north-star": {
3544
3570
  name: "north-star",
@@ -4181,6 +4207,10 @@ var require$$0 = {
4181
4207
  keywords: [
4182
4208
  ],
4183
4209
  heights: {
4210
+ "12": {
4211
+ width: 12,
4212
+ path: "<path fill-rule=\"evenodd\" d=\"M1.757 10.243a6 6 0 118.486-8.486 6 6 0 01-8.486 8.486zM6 4.763l-2-2L2.763 4l2 2-2 2L4 9.237l2-2 2 2L9.237 8l-2-2 2-2L8 2.763l-2 2z\"></path>"
4213
+ },
4184
4214
  "16": {
4185
4215
  width: 16,
4186
4216
  path: "<path fill-rule=\"evenodd\" d=\"M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z\"></path>"
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": "github:saby-customizer/saby-customizer.github.io",
11
11
  "license": "Unlicense",
12
- "version": "0.0.0-pre.18",
12
+ "version": "0.0.0-pre.22",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {
@@ -38,7 +38,7 @@
38
38
  "@material/mwc-textarea": "^0.25.3",
39
39
  "@material/mwc-top-app-bar": "^0.25.3",
40
40
  "@material/mwc-snackbar": "^0.25.3",
41
- "dexie": "^3.0.3"
41
+ "dexie": "^3.2.0"
42
42
  },
43
43
  "scripts": {
44
44
  "prepack": "cd .. && npm run build"