@dialpad/dialtone-vue 3.207.0 → 3.208.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.
Files changed (47) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/lib/editor/EditorToolbarButton.cjs +2 -0
  3. package/dist/lib/editor/EditorToolbarButton.cjs.map +1 -0
  4. package/dist/lib/editor/EditorToolbarButton.js +103 -0
  5. package/dist/lib/editor/EditorToolbarButton.js.map +1 -0
  6. package/dist/lib/editor/EditorToolbarDropdownButton.cjs +2 -0
  7. package/dist/lib/editor/EditorToolbarDropdownButton.cjs.map +1 -0
  8. package/dist/lib/editor/EditorToolbarDropdownButton.js +106 -0
  9. package/dist/lib/editor/EditorToolbarDropdownButton.js.map +1 -0
  10. package/dist/lib/editor/EditorToolbarPopoverButton.cjs +2 -0
  11. package/dist/lib/editor/EditorToolbarPopoverButton.cjs.map +1 -0
  12. package/dist/lib/editor/EditorToolbarPopoverButton.js +107 -0
  13. package/dist/lib/editor/EditorToolbarPopoverButton.js.map +1 -0
  14. package/dist/lib/editor/editor-constants.cjs +1 -1
  15. package/dist/lib/editor/editor-constants.cjs.map +1 -1
  16. package/dist/lib/editor/editor-constants.js +5 -3
  17. package/dist/lib/editor/editor-constants.js.map +1 -1
  18. package/dist/lib/editor/editor.cjs +1 -1
  19. package/dist/lib/editor/editor.cjs.map +1 -1
  20. package/dist/lib/editor/editor.js +550 -312
  21. package/dist/lib/editor/editor.js.map +1 -1
  22. package/dist/lib/input/input-constants.cjs +1 -1
  23. package/dist/lib/input/input-constants.cjs.map +1 -1
  24. package/dist/lib/input/input-constants.js +2 -1
  25. package/dist/lib/input/input-constants.js.map +1 -1
  26. package/dist/lib/input/input.cjs.map +1 -1
  27. package/dist/lib/input/input.js +1 -1
  28. package/dist/lib/input/input.js.map +1 -1
  29. package/dist/lib/rich-text-editor/rich-text-editor.cjs +2 -2
  30. package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  31. package/dist/lib/rich-text-editor/rich-text-editor.js +9 -2
  32. package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  33. package/dist/localization/en-US.cjs +5 -0
  34. package/dist/localization/en-US.cjs.map +1 -1
  35. package/dist/localization/en-US.js +5 -0
  36. package/dist/localization/en-US.js.map +1 -1
  37. package/dist/style.css +1 -0
  38. package/dist/types/components/input/input_constants.d.ts +1 -0
  39. package/dist/types/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts +314 -0
  40. package/dist/types/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts.map +1 -0
  41. package/dist/types/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +1614 -0
  42. package/dist/types/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +1 -0
  43. package/dist/types/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +1340 -0
  44. package/dist/types/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +1 -0
  45. package/dist/types/recipes/conversation_view/editor/editor_constants.d.ts +2 -0
  46. package/dist/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -1
  47. package/package.json +3 -3
@@ -1,49 +1,60 @@
1
- import { EDITOR_SUPPORTED_LINK_PROTOCOLS as Z, EDITOR_DEFAULT_LINK_PREFIX as tt } from "./editor-constants.js";
2
- import { addClassStyleAttrs as et, removeClassStyleAttrs as it } from "../../common/utils/index.js";
3
- import { DtIconSearch as ot, DtIconBraces as y, DtIconImage as x, DtIconLink2 as N, DtIconCodeBlock as v, DtIconQuote as S, DtIconAlignJustify as F, DtIconAlignRight as U, DtIconAlignCenter as V, DtIconAlignLeft as M, DtIconListOrdered as Q, DtIconListBullet as q, DtIconStrikethrough as K, DtIconUnderline as P, DtIconItalic as z, DtIconBold as G, DtIconQuickReply as H } from "@dialpad/dialtone-icons/vue3";
4
- import { DialtoneLocalization as nt } from "../../localization/index.js";
5
- import { resolveComponent as h, openBlock as u, createElementBlock as _, mergeProps as f, createVNode as c, withCtx as r, Fragment as w, renderList as O, createBlock as d, withKeys as L, withModifiers as g, createTextVNode as A, toDisplayString as m, resolveDynamicComponent as b, createElementVNode as E, createCommentVNode as D, normalizeStyle as rt } from "vue";
6
- import { _ as st } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
7
- import lt from "../tooltip/tooltip.js";
8
- import at from "../input/input.js";
9
- import ut from "../stack/stack.js";
10
- import ct from "../popover/popover.js";
11
- import dt from "../button/button.js";
12
- import ht from "../rich-text-editor/rich-text-editor.js";
13
- import pt from "../list-item/list-item.js";
14
- import Bt from "../dropdown/dropdown-separator.js";
15
- import ft from "../list-item-group/list-item-group.js";
16
- import { RICH_TEXT_EDITOR_OUTPUT_FORMATS as gt, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as mt } from "../rich-text-editor/rich-text-editor-constants.js";
17
- const kt = {
1
+ import { EDITOR_DEFAULT_FONT_COLOR as Tt, EDITOR_SUPPORTED_LINK_PROTOCOLS as mt, EDITOR_DEFAULT_LINK_PREFIX as gt } from "./editor-constants.js";
2
+ import { addClassStyleAttrs as _t, removeClassStyleAttrs as kt } from "../../common/utils/index.js";
3
+ import It from "./EditorToolbarButton.js";
4
+ import Lt from "./EditorToolbarDropdownButton.js";
5
+ import At from "./EditorToolbarPopoverButton.js";
6
+ import { DtIconFontSize as K, DtIconChevronDown as Et, DtIconBraces as H, DtIconType as J, DtIconSearch as yt, DtIconImage as Y, DtIconLink2 as j, DtIconCodeBlock as G, DtIconQuote as X, DtIconAlignJustify as Z, DtIconAlignRight as W, DtIconAlignCenter as $, DtIconAlignLeft as tt, DtIconListOrdered as et, DtIconListBullet as ot, DtIconStrikethrough as it, DtIconUnderline as nt, DtIconItalic as rt, DtIconBold as st, DtIconQuickReply as lt } from "@dialpad/dialtone-icons/vue3";
7
+ import { DialtoneLocalization as wt } from "../../localization/index.js";
8
+ import { resolveComponent as f, resolveDirective as bt, openBlock as u, createElementBlock as g, mergeProps as B, createVNode as d, withCtx as a, Fragment as _, renderList as E, createBlock as p, createElementVNode as k, normalizeStyle as D, createTextVNode as w, toDisplayString as I, withDirectives as Ot, withKeys as b, withModifiers as L, createCommentVNode as F, resolveDynamicComponent as Ct } from "vue";
9
+ import { _ as Rt } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import xt from "../combobox/combobox.js";
11
+ import Dt from "../tooltip/tooltip.js";
12
+ import Ft from "../input/input.js";
13
+ import St from "../stack/stack.js";
14
+ import vt from "../popover/popover.js";
15
+ import Nt from "../button/button.js";
16
+ import Ut from "../rich-text-editor/rich-text-editor.js";
17
+ import Vt from "../list-item/list-item.js";
18
+ import Qt from "../dropdown/dropdown-separator.js";
19
+ import Mt from "../list-item-group/list-item-group.js";
20
+ import { RICH_TEXT_EDITOR_OUTPUT_FORMATS as qt, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as zt } from "../rich-text-editor/rich-text-editor-constants.js";
21
+ const Pt = {
18
22
  compatConfig: { MODE: 3 },
19
23
  name: "DtRecipeEditor",
20
24
  components: {
21
- DtListItemGroup: ft,
22
- DtDropdownSeparator: Bt,
23
- DtListItem: pt,
24
- DtRichTextEditor: ht,
25
- DtButton: dt,
26
- DtPopover: ct,
27
- DtStack: ut,
28
- DtInput: at,
29
- DtTooltip: lt,
30
- DtIconQuickReply: H,
31
- DtIconBold: G,
32
- DtIconItalic: z,
33
- DtIconUnderline: P,
34
- DtIconStrikethrough: K,
35
- DtIconListBullet: q,
36
- DtIconListOrdered: Q,
37
- DtIconAlignLeft: M,
38
- DtIconAlignCenter: V,
39
- DtIconAlignRight: U,
40
- DtIconAlignJustify: F,
41
- DtIconQuote: S,
42
- DtIconCodeBlock: v,
43
- DtIconLink2: N,
44
- DtIconImage: x,
45
- DtIconBraces: y,
46
- DtIconSearch: ot
25
+ DtListItemGroup: Mt,
26
+ DtDropdownSeparator: Qt,
27
+ DtListItem: Vt,
28
+ DtRichTextEditor: Ut,
29
+ DtButton: Nt,
30
+ DtPopover: vt,
31
+ DtStack: St,
32
+ DtInput: Ft,
33
+ DtTooltip: Dt,
34
+ DtCombobox: xt,
35
+ EditorToolbarButton: It,
36
+ EditorToolbarDropdownButton: Lt,
37
+ EditorToolbarPopoverButton: At,
38
+ DtIconQuickReply: lt,
39
+ DtIconBold: st,
40
+ DtIconItalic: rt,
41
+ DtIconUnderline: nt,
42
+ DtIconStrikethrough: it,
43
+ DtIconListBullet: ot,
44
+ DtIconListOrdered: et,
45
+ DtIconAlignLeft: tt,
46
+ DtIconAlignCenter: $,
47
+ DtIconAlignRight: W,
48
+ DtIconAlignJustify: Z,
49
+ DtIconQuote: X,
50
+ DtIconCodeBlock: G,
51
+ DtIconLink2: j,
52
+ DtIconImage: Y,
53
+ DtIconSearch: yt,
54
+ DtIconType: J,
55
+ DtIconBraces: H,
56
+ DtIconChevronDown: Et,
57
+ DtIconFontSize: K
47
58
  },
48
59
  mixins: [],
49
60
  inheritAttrs: !1,
@@ -95,7 +106,7 @@ const kt = {
95
106
  type: [Boolean, String, Number],
96
107
  default: !1,
97
108
  validator(t) {
98
- return typeof t == "string" ? mt.includes(t) : !0;
109
+ return typeof t == "string" ? zt.includes(t) : !0;
99
110
  }
100
111
  },
101
112
  /**
@@ -241,6 +252,50 @@ const kt = {
241
252
  showAddLinkButton: !0
242
253
  })
243
254
  },
255
+ /**
256
+ * Show font style button.
257
+ */
258
+ showFontStyleButton: {
259
+ type: Boolean,
260
+ default: !1
261
+ },
262
+ /**
263
+ * Show font size button.
264
+ */
265
+ showFontSizeButton: {
266
+ type: Boolean,
267
+ default: !1
268
+ },
269
+ /**
270
+ * Show font color button.
271
+ */
272
+ showFontColorButton: {
273
+ type: Boolean,
274
+ default: !1
275
+ },
276
+ /**
277
+ * Available font styles for the font style dropdown.
278
+ */
279
+ fontStyles: {
280
+ type: Array,
281
+ default: () => [
282
+ { name: "Arial", value: null },
283
+ // arial is the default font
284
+ { name: "Georgia", value: "Georgia" },
285
+ { name: "Helvetica", value: "Helvetica" },
286
+ { name: "Verdana", value: "Verdana" },
287
+ { name: "Times New Roman", value: "Times New Roman" }
288
+ ]
289
+ },
290
+ fontSizes: {
291
+ type: Array,
292
+ default: () => [
293
+ { name: "Small", value: "12px" },
294
+ { name: "Normal", value: "15px" },
295
+ { name: "Large", value: "24px" },
296
+ { name: "Huge", value: "36px" }
297
+ ]
298
+ },
244
299
  /**
245
300
  * Use div tags instead of paragraph tags to show text
246
301
  */
@@ -307,11 +362,13 @@ const kt = {
307
362
  linkOptions: {
308
363
  class: "d-recipe-editor__link"
309
364
  },
365
+ currentFontColor: void 0,
310
366
  showLinkInput: !1,
367
+ fontStyleSearch: "",
311
368
  linkInput: "",
312
369
  currentButtonRefIndex: 0,
313
370
  variableSearchValue: "",
314
- i18n: new nt()
371
+ i18n: new wt()
315
372
  };
316
373
  },
317
374
  computed: {
@@ -319,10 +376,10 @@ const kt = {
319
376
  return this.internalInputValue.length;
320
377
  },
321
378
  htmlOutputFormat() {
322
- return gt[2];
379
+ return qt[2];
323
380
  },
324
381
  flattenedVariableItems() {
325
- return this.variableCategories ? this.variableCategories.reduce((t, e) => t.concat(e.items || []), []) : [];
382
+ return this.variableCategories ? this.variableCategories.reduce((t, o) => t.concat(o.items || []), []) : [];
326
383
  },
327
384
  showingTextFormatButtons() {
328
385
  return this.showBoldButton || this.showItalicsButton || this.showStrikeButton || this.showUnderlineButton;
@@ -334,17 +391,17 @@ const kt = {
334
391
  return this.showListItemsButton || this.showOrderedListButton;
335
392
  },
336
393
  orderedRefs() {
337
- const t = this.buttonGroups.reduce((function(e, o) {
338
- return o.buttonGroup.forEach((l) => {
339
- e.push(this.getButtonRef(o.key, l.selector));
340
- }, this), e;
394
+ const t = this.buttonGroups.reduce((function(o, i) {
395
+ return i.buttonGroup.forEach((s) => {
396
+ o.push(this.getButtonRef(i.key, s.selector));
397
+ }, this), o;
341
398
  }).bind(this), []);
342
399
  return t.push(this.getButtonRef("custom", "link")), t;
343
400
  },
344
401
  buttonGroups() {
345
- const t = this.individualButtons.map((e) => ({
346
- key: e.selector,
347
- buttonGroup: [e]
402
+ const t = this.individualButtons.map((o) => ({
403
+ key: o.selector,
404
+ buttonGroup: [o]
348
405
  }));
349
406
  return [
350
407
  { key: "new", buttonGroup: this.newButtons },
@@ -352,15 +409,16 @@ const kt = {
352
409
  { key: "alignment", buttonGroup: this.alignmentButtons },
353
410
  { key: "list", buttonGroup: this.listButtons },
354
411
  ...t
355
- ].filter((e) => e.buttonGroup.length > 0);
412
+ ].filter((o) => o.buttonGroup.length > 0);
356
413
  },
357
414
  newButtons() {
358
415
  return [
359
416
  {
360
417
  showBtn: this.showQuickRepliesButton,
418
+ buttonType: "button",
361
419
  label: this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),
362
420
  selector: "quickReplies",
363
- icon: H,
421
+ icon: lt,
364
422
  dataQA: "dt-recipe-editor-quick-replies-btn",
365
423
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),
366
424
  onClick: this.onQuickRepliesClick
@@ -369,34 +427,62 @@ const kt = {
369
427
  },
370
428
  textFormatButtons() {
371
429
  return [
430
+ {
431
+ showBtn: this.showFontStyleButton,
432
+ buttonType: "popover",
433
+ selector: "fontStyle",
434
+ icon: J,
435
+ dataQA: "dt-recipe-editor-font-style-btn",
436
+ tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_FONT_STYLE_BUTTON_LABEL")
437
+ },
438
+ {
439
+ showBtn: this.showFontSizeButton,
440
+ buttonType: "popover",
441
+ selector: "fontSize",
442
+ icon: K,
443
+ dataQA: "dt-recipe-editor-font-size-btn",
444
+ tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_FONT_SIZE_BUTTON_LABEL")
445
+ },
446
+ {
447
+ showBtn: this.showFontColorButton,
448
+ buttonType: "custom",
449
+ selector: "fontColor",
450
+ dataQA: "dt-recipe-editor-font-color-btn",
451
+ tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_FONT_COLOR_BUTTON_LABEL"),
452
+ onClick: this.onColorPickerButtonClick
453
+ },
372
454
  {
373
455
  showBtn: this.showBoldButton,
456
+ buttonType: "button",
374
457
  selector: "bold",
375
- icon: G,
458
+ icon: st,
376
459
  dataQA: "dt-recipe-editor-bold-btn",
377
460
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_BOLD_BUTTON_LABEL"),
378
461
  onClick: this.onBoldTextToggle
379
462
  },
380
463
  {
381
464
  showBtn: this.showItalicsButton,
465
+ buttonType: "button",
382
466
  selector: "italic",
383
- icon: z,
467
+ icon: rt,
384
468
  dataQA: "dt-recipe-editor-italics-btn",
385
469
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ITALICS_BUTTON_LABEL"),
386
470
  onClick: this.onItalicTextToggle
387
471
  },
388
472
  {
389
473
  showBtn: this.showUnderlineButton,
474
+ buttonType: "button",
390
475
  selector: "underline",
391
- icon: P,
476
+ icon: nt,
392
477
  dataQA: "dt-recipe-editor-underline-btn",
393
478
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL"),
394
479
  onClick: this.onUnderlineTextToggle
395
480
  },
396
481
  {
397
482
  showBtn: this.showStrikeButton,
483
+ buttonType: "button",
398
484
  selector: "strike",
399
- icon: K,
485
+ icon: it,
400
486
  dataQA: "dt-recipe-editor-strike-btn",
401
487
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_STRIKE_BUTTON_LABEL"),
402
488
  onClick: this.onStrikethroughTextToggle
@@ -407,32 +493,36 @@ const kt = {
407
493
  return [
408
494
  {
409
495
  showBtn: this.showAlignLeftButton,
496
+ buttonType: "button",
410
497
  selector: { textAlign: "left" },
411
- icon: M,
498
+ icon: tt,
412
499
  dataQA: "dt-recipe-editor-align-left-btn",
413
500
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL"),
414
501
  onClick: () => this.onTextAlign("left")
415
502
  },
416
503
  {
417
504
  showBtn: this.showAlignCenterButton,
505
+ buttonType: "button",
418
506
  selector: { textAlign: "center" },
419
- icon: V,
507
+ icon: $,
420
508
  dataQA: "dt-recipe-editor-align-center-btn",
421
509
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL"),
422
510
  onClick: () => this.onTextAlign("center")
423
511
  },
424
512
  {
425
513
  showBtn: this.showAlignRightButton,
514
+ buttonType: "button",
426
515
  selector: { textAlign: "right" },
427
- icon: U,
516
+ icon: W,
428
517
  dataQA: "dt-recipe-editor-align-right-btn",
429
518
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL"),
430
519
  onClick: () => this.onTextAlign("right")
431
520
  },
432
521
  {
433
522
  showBtn: this.showAlignJustifyButton,
523
+ buttonType: "button",
434
524
  selector: { textAlign: "justify" },
435
- icon: F,
525
+ icon: Z,
436
526
  dataQA: "dt-recipe-editor-align-justify-btn",
437
527
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL"),
438
528
  onClick: () => this.onTextAlign("justify")
@@ -443,16 +533,18 @@ const kt = {
443
533
  return [
444
534
  {
445
535
  showBtn: this.showListItemsButton,
536
+ buttonType: "button",
446
537
  selector: "bulletList",
447
- icon: q,
538
+ icon: ot,
448
539
  dataQA: "dt-recipe-editor-list-items-btn",
449
540
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL"),
450
541
  onClick: this.onBulletListToggle
451
542
  },
452
543
  {
453
544
  showBtn: this.showOrderedListButton,
545
+ buttonType: "button",
454
546
  selector: "orderedList",
455
- icon: Q,
547
+ icon: et,
456
548
  dataQA: "dt-recipe-editor-ordered-list-items-btn",
457
549
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL"),
458
550
  onClick: this.onOrderedListToggle
@@ -463,50 +555,53 @@ const kt = {
463
555
  return [
464
556
  {
465
557
  showBtn: this.showQuoteButton,
558
+ buttonType: "button",
466
559
  selector: "blockquote",
467
- icon: S,
560
+ icon: X,
468
561
  dataQA: "dt-recipe-editor-blockquote-btn",
469
562
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_QUOTE_BUTTON_LABEL"),
470
563
  onClick: this.onBlockquoteToggle
471
564
  },
472
565
  {
473
566
  showBtn: this.showCodeBlockButton,
567
+ buttonType: "button",
474
568
  selector: "codeBlock",
475
- icon: v,
569
+ icon: G,
476
570
  dataQA: "dt-recipe-editor-code-block-btn",
477
571
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_CODE_BUTTON_LABEL"),
478
572
  onClick: this.onCodeBlockToggle
479
573
  },
480
574
  {
481
575
  showBtn: this.showInlineImageButton,
576
+ buttonType: "button",
482
577
  selector: "image",
483
- icon: x,
578
+ icon: Y,
484
579
  dataQA: "dt-recipe-editor-inline-image-btn",
485
580
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_IMAGE_BUTTON_LABEL"),
486
581
  // Handle getting image
487
582
  onClick: this.onInsertInlineImageClick
583
+ },
584
+ {
585
+ showBtn: this.showVariableButton,
586
+ buttonType: "popover",
587
+ selector: "variable",
588
+ icon: H,
589
+ dataQA: "dt-recipe-editor-variable-btn",
590
+ tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL")
488
591
  }
489
592
  ].filter((t) => t.showBtn);
490
593
  },
491
594
  linkButton() {
492
595
  return {
493
596
  showBtn: this.showAddLink.showAddLinkButton,
597
+ buttonType: "custom",
494
598
  selector: "link",
495
- icon: N,
599
+ icon: j,
496
600
  dataQA: "dt-recipe-editor-add-link-btn",
497
601
  tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_LINK_BUTTON_LABEL"),
498
602
  onClick: this.openLinkInput
499
603
  };
500
604
  },
501
- variableButton() {
502
- return {
503
- showBtn: this.showVariableButton,
504
- selector: "variable",
505
- icon: y,
506
- dataQA: "dt-recipe-editor-variable-btn",
507
- tooltipMessage: this.i18n.$t("DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL")
508
- };
509
- },
510
605
  confirmSetLinkButtonLabels() {
511
606
  return this.i18n.$ta("DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON");
512
607
  },
@@ -519,10 +614,24 @@ const kt = {
519
614
  showAddLinkButtonLabels() {
520
615
  return this.i18n.$ta("DIALTONE_EDITOR_ADD_LINK_BUTTON");
521
616
  },
617
+ filteredFontStyles() {
618
+ const t = this.fontStyleSearch.toLowerCase();
619
+ return this.fontStyles.filter(
620
+ (o) => o.name.toLowerCase().includes(t)
621
+ );
622
+ },
522
623
  filteredCategories() {
523
624
  return this.variableCategories.filter(
524
625
  (t) => this.getFilteredItemsForCategory(t).length
525
626
  );
627
+ },
628
+ colorPickerInput() {
629
+ return document.querySelector(".colorPickerInput");
630
+ },
631
+ actionBarBtn() {
632
+ var o, i;
633
+ const t = ((i = (o = this.$refs[this.orderedRefs[this.currentButtonRefIndex]][0]) == null ? void 0 : o.$refs) == null ? void 0 : i.buttonRef) || this.$refs[this.orderedRefs[this.currentButtonRefIndex]];
634
+ return Array.isArray(t) ? t[0] : t;
526
635
  }
527
636
  },
528
637
  watch: {
@@ -531,45 +640,45 @@ const kt = {
531
640
  }
532
641
  },
533
642
  methods: {
534
- removeClassStyleAttrs: it,
535
- addClassStyleAttrs: et,
643
+ removeClassStyleAttrs: kt,
644
+ addClassStyleAttrs: _t,
536
645
  onInputFocus(t) {
537
646
  t == null || t.stopPropagation();
538
647
  },
539
648
  removeLink() {
540
- var t, e, o, l, s;
541
- (s = (l = (o = (e = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null ? void 0 : e.chain()) == null ? void 0 : o.focus()) == null ? void 0 : l.unsetLink()) == null || s.run(), this.closeLinkInput();
649
+ var t, o, i, s, r;
650
+ (r = (s = (i = (o = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null ? void 0 : o.chain()) == null ? void 0 : i.focus()) == null ? void 0 : s.unsetLink()) == null || r.run(), this.closeLinkInput();
542
651
  },
543
652
  setLink(t) {
544
- var s, i, p;
545
- const e = (s = this.$refs.richTextEditor) == null ? void 0 : s.editor;
653
+ var r, e, T;
654
+ const o = (r = this.$refs.richTextEditor) == null ? void 0 : r.editor;
546
655
  if (t == null || t.preventDefault(), t == null || t.stopPropagation(), !this.linkInput) {
547
656
  this.removeLink();
548
657
  return;
549
658
  }
550
- Z.find((k) => k.test(this.linkInput)) || (this.linkInput = `${tt}${this.linkInput}`);
551
- const l = (p = (i = e == null ? void 0 : e.view) == null ? void 0 : i.state) == null ? void 0 : p.selection;
552
- l.anchor === l.head ? e.chain().focus().insertContentAt(
553
- l.anchor,
659
+ mt.find((A) => A.test(this.linkInput)) || (this.linkInput = `${gt}${this.linkInput}`);
660
+ const s = (T = (e = o == null ? void 0 : o.view) == null ? void 0 : e.state) == null ? void 0 : T.selection;
661
+ s.anchor === s.head ? o.chain().focus().insertContentAt(
662
+ s.anchor,
554
663
  `<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`
555
- ).run() : e.chain().focus().extendMarkRange("link").setLink({ href: this.linkInput, class: this.linkOptions.class }).run(), this.closeLinkInput();
664
+ ).run() : o.chain().focus().extendMarkRange("link").setLink({ href: this.linkInput, class: this.linkOptions.class }).run(), this.closeLinkInput();
556
665
  },
557
666
  openLinkInput() {
558
667
  this.showLinkInput = !0;
559
668
  },
560
669
  updateInput(t) {
561
- var e, o, l;
670
+ var o, i, s;
562
671
  if (!t)
563
672
  return this.closeLinkInput();
564
- this.linkInput = (l = (o = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) == null ? void 0 : o.getAttributes("link")) == null ? void 0 : l.href;
673
+ this.linkInput = (s = (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null ? void 0 : i.getAttributes("link")) == null ? void 0 : s.href;
565
674
  },
566
675
  closeLinkInput() {
567
676
  var t;
568
677
  this.showLinkInput = !1, this.linkInput = "", (t = this.$refs.richTextEditor.editor) == null || t.chain().focus();
569
678
  },
570
679
  onBoldTextToggle() {
571
- var t, e;
572
- (e = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null || e.chain().focus().toggleBold().run();
680
+ var t, o;
681
+ (o = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null || o.chain().focus().toggleBold().run();
573
682
  },
574
683
  onItalicTextToggle() {
575
684
  var t;
@@ -584,10 +693,10 @@ const kt = {
584
693
  (t = this.$refs.richTextEditor) == null || t.editor.chain().focus().toggleStrike().run();
585
694
  },
586
695
  onTextAlign(t) {
587
- var e, o, l, s;
588
- if ((o = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) != null && o.isActive({ textAlign: t }))
589
- return (l = this.$refs.richTextEditor) == null ? void 0 : l.editor.chain().focus().unsetTextAlign().run();
590
- (s = this.$refs.richTextEditor) == null || s.editor.chain().focus().setTextAlign(t).run();
696
+ var o, i, s, r;
697
+ if ((i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) != null && i.isActive({ textAlign: t }))
698
+ return (s = this.$refs.richTextEditor) == null ? void 0 : s.editor.chain().focus().unsetTextAlign().run();
699
+ (r = this.$refs.richTextEditor) == null || r.editor.chain().focus().setTextAlign(t).run();
591
700
  },
592
701
  onBulletListToggle() {
593
702
  var t;
@@ -607,25 +716,25 @@ const kt = {
607
716
  onInsertInlineImageClick() {
608
717
  this.$emit("inline-image-click");
609
718
  },
610
- insertVariable(t, e) {
611
- var o;
612
- (o = this.$refs.richTextEditor) == null || o.editor.chain().focus().insertVariable({
613
- id: e.id,
614
- placeholder: e.placeholder || "",
719
+ insertVariable(t, o) {
720
+ var i;
721
+ (i = this.$refs.richTextEditor) == null || i.editor.chain().focus().insertVariable({
722
+ id: o.id,
723
+ placeholder: o.placeholder || "",
615
724
  altText: ""
616
725
  }).run();
617
726
  },
618
727
  insertInlineImage(t) {
619
- var e;
620
- (e = this.$refs.richTextEditor) == null || e.editor.chain().focus().setImage({ src: t }).run();
728
+ var o;
729
+ (o = this.$refs.richTextEditor) == null || o.editor.chain().focus().setImage({ src: t }).run();
621
730
  },
622
731
  insertInMessageBody(t) {
623
- var e;
624
- (e = this.$refs.richTextEditor) == null || e.editor.chain().focus().insertContent(t).run();
732
+ var o;
733
+ (o = this.$refs.richTextEditor) == null || o.editor.chain().focus().insertContent(t).run();
625
734
  },
626
735
  setCursorPosition(t = null) {
627
- var e;
628
- (e = this.$refs.richTextEditor) == null || e.editor.chain().focus(t).run();
736
+ var o;
737
+ (o = this.$refs.richTextEditor) == null || o.editor.chain().focus(t).run();
629
738
  },
630
739
  onBlockquoteToggle() {
631
740
  var t;
@@ -643,12 +752,15 @@ const kt = {
643
752
  onInput(t) {
644
753
  this.$emit("input", t), this.$emit("update:modelValue", t);
645
754
  },
646
- getButtonKey(t, e) {
647
- return `${t}-${JSON.stringify(e)}`;
755
+ onSelected() {
756
+ this.updateFontColorInput();
757
+ },
758
+ getButtonKey(t, o) {
759
+ return `${t}-${JSON.stringify(o)}`;
648
760
  },
649
761
  // Unique Button Ref Key to identify ref
650
- getButtonRef(t, e) {
651
- return `${this.getButtonKey(t, e)}-ref`;
762
+ getButtonRef(t, o) {
763
+ return `${this.getButtonKey(t, o)}-ref`;
652
764
  },
653
765
  /**
654
766
  * Determines if an element in the action bar button list is focusable with tab key
@@ -664,202 +776,326 @@ const kt = {
664
776
  this.shiftButtonRefIndex(-1);
665
777
  },
666
778
  shiftButtonRefIndex(t) {
667
- const e = this.$refs[this.orderedRefs[this.currentButtonRefIndex]], o = Array.isArray(e) ? e[0] : e, l = (this.currentButtonRefIndex + t) % this.orderedRefs.length;
668
- this.currentButtonRefIndex = l >= 0 ? l : this.orderedRefs.length + l;
669
- const s = this.$refs[this.orderedRefs[this.currentButtonRefIndex]], i = Array.isArray(s) ? s[0] : s;
670
- o.$el.blur(), i.$el.focus();
779
+ const o = this.actionBarBtn, i = (this.currentButtonRefIndex + t) % this.orderedRefs.length;
780
+ this.currentButtonRefIndex = i >= 0 ? i : this.orderedRefs.length + i;
781
+ const s = this.actionBarBtn;
782
+ o.$el.blur(), s.$el.focus();
783
+ },
784
+ onFontStyleSelect(t) {
785
+ var o, i, s, r, e, T;
786
+ t ? (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null || i.chain().focus().setFontFamily(t).run() : (r = (s = this.$refs.richTextEditor) == null ? void 0 : s.editor) == null || r.chain().focus().unsetFontFamily().run(), (T = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) == null || T.commands.focus();
787
+ },
788
+ isCurrentFontFamily(t) {
789
+ var o, i, s, r, e;
790
+ return t ? (e = (r = this.$refs.richTextEditor) == null ? void 0 : r.editor) == null ? void 0 : e.isActive("textStyle", { fontFamily: t }) : !((s = (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null ? void 0 : i.getAttributes("textStyle")) != null && s.fontFamily);
791
+ },
792
+ onFontSizeSelect(t) {
793
+ var o, i, s, r;
794
+ (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null || i.chain().focus().setFontSize(t).run(), (r = (s = this.$refs.richTextEditor) == null ? void 0 : s.editor) == null || r.commands.focus();
795
+ },
796
+ isCurrentFontSize(t) {
797
+ var o, i, s, r, e;
798
+ return t ? (e = (r = this.$refs.richTextEditor) == null ? void 0 : r.editor) == null ? void 0 : e.isActive("textStyle", { fontSize: t }) : !((s = (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null ? void 0 : i.getAttributes("textStyle")) != null && s.fontSize);
671
799
  },
672
800
  getFilteredItemsForCategory(t) {
673
- const e = this.variableSearchValue.toLowerCase();
674
- return t.name.toLowerCase().includes(e) ? t.items : t.items.filter(
675
- (o) => o.name.toLowerCase().includes(e)
801
+ const o = this.variableSearchValue.toLowerCase();
802
+ return t.name.toLowerCase().includes(o) ? t.items : t.items.filter(
803
+ (i) => i.name.toLowerCase().includes(o)
676
804
  );
805
+ },
806
+ updateFontColorInput() {
807
+ var t, o, i;
808
+ this.currentFontColor = ((i = (o = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null ? void 0 : o.getAttributes("textStyle")) == null ? void 0 : i.color) || Tt;
809
+ },
810
+ onColorPickerButtonClick() {
811
+ var t;
812
+ (t = this.colorPickerInput) == null || t.click();
813
+ },
814
+ onColorPickerInput(t) {
815
+ var o, i, s, r;
816
+ (i = (o = this.$refs.richTextEditor) == null ? void 0 : o.editor) == null || i.chain().focus().setColor(t).run(), (r = (s = this.$refs.richTextEditor) == null ? void 0 : s.editor) == null || r.commands.focus();
677
817
  }
678
818
  }
679
- }, Tt = { class: "d-recipe-editor__popover-content" };
680
- function It(t, e, o, l, s, i) {
681
- const p = h("dt-button"), k = h("dt-tooltip"), T = h("dt-stack"), j = h("dt-icon-search"), C = h("dt-input"), J = h("dt-list-item"), Y = h("dt-dropdown-separator"), X = h("dt-list-item-group"), R = h("dt-popover"), $ = h("dt-rich-text-editor");
682
- return u(), _("div", f({ class: "d-recipe-editor" }, i.addClassStyleAttrs(t.$attrs), {
819
+ }, Kt = { class: "d-recipe-editor__popover-content" };
820
+ function Ht(t, o, i, s, r, e) {
821
+ const T = f("dt-icon-search"), A = f("dt-input"), C = f("dt-list-item"), S = f("dt-combobox"), v = f("editor-toolbar-popover-button"), at = f("editor-toolbar-dropdown-button"), y = f("dt-button"), ut = f("dt-dropdown-separator"), ct = f("dt-list-item-group"), dt = f("editor-toolbar-button"), O = f("dt-stack"), ht = f("dt-tooltip"), ft = f("dt-popover"), pt = f("dt-rich-text-editor"), Bt = bt("dt-tooltip");
822
+ return u(), g("div", B({ class: "d-recipe-editor" }, e.addClassStyleAttrs(t.$attrs), {
683
823
  "data-qa": "dt-recipe-editor",
684
824
  role: "presentation",
685
- onClick: e[5] || (e[5] = (a) => t.$refs.richTextEditor.focusEditor())
825
+ onClick: o[7] || (o[7] = (l) => t.$refs.richTextEditor.focusEditor())
686
826
  }), [
687
- c(T, {
827
+ d(O, {
688
828
  class: "d-recipe-editor__top-bar",
689
829
  direction: "row",
690
830
  gap: "450"
691
831
  }, {
692
- default: r(() => [
693
- (u(!0), _(w, null, O(i.buttonGroups, (a) => (u(), d(T, {
694
- key: a.key,
832
+ default: a(() => [
833
+ (u(!0), g(_, null, E(e.buttonGroups, (l) => (u(), p(O, {
834
+ key: l.key,
695
835
  direction: "row",
696
836
  gap: "300"
697
837
  }, {
698
- default: r(() => [
699
- (u(!0), _(w, null, O(a.buttonGroup, (n) => (u(), d(k, {
700
- key: i.getButtonKey(a.key, n.selector),
701
- message: n.tooltipMessage,
702
- placement: "top"
703
- }, {
704
- anchor: r(() => {
705
- var I, B;
706
- return [
707
- c(p, {
708
- ref_for: !0,
709
- ref: i.getButtonRef(a.key, n.selector),
710
- active: (B = (I = t.$refs.richTextEditor) == null ? void 0 : I.editor) == null ? void 0 : B.isActive(n.selector),
711
- "aria-label": n.tooltipMessage,
712
- "data-qa": n.dataQA,
713
- tabindex: i.canFocus(i.getButtonRef(a.key, n.selector)) ? 0 : -1,
714
- importance: "clear",
715
- kind: "muted",
716
- size: "xs",
717
- onClick: (W) => n.onClick(),
718
- onKeydown: [
719
- L(g(i.shiftActionBarFocusRight, ["stop"]), ["right"]),
720
- L(g(i.shiftActionBarFocusLeft, ["stop"]), ["left"])
721
- ]
722
- }, {
723
- icon: r(() => [
724
- (u(), d(b(n.icon), { size: "200" }))
725
- ]),
726
- default: r(() => [
727
- A(" " + m(n == null ? void 0 : n.label), 1)
728
- ]),
729
- _: 2
730
- }, 1032, ["active", "aria-label", "data-qa", "tabindex", "onClick", "onKeydown"])
731
- ];
732
- }),
733
- _: 2
734
- }, 1032, ["message"]))), 128)),
735
- e[6] || (e[6] = E("div", { class: "d-recipe-editor__button-group-divider" }, null, -1))
736
- ]),
737
- _: 2
738
- }, 1024))), 128)),
739
- i.variableButton.showBtn ? (u(), d(T, {
740
- key: 0,
741
- direction: "row",
742
- gap: "300"
743
- }, {
744
- default: r(() => [
745
- c(R, {
746
- padding: "small",
747
- "navigation-type": "arrow-keys",
748
- modal: !1,
749
- placement: "bottom-start"
750
- }, {
751
- anchor: r(({ attrs: a }) => [
752
- c(k, {
753
- message: i.variableButton.tooltipMessage,
754
- placement: "top"
838
+ default: a(() => [
839
+ (u(!0), g(_, null, E(l.buttonGroup, (n) => {
840
+ var R, N, U, V, Q, M, q, z;
841
+ return u(), g(_, null, [
842
+ n.buttonType === "popover" && n.selector === "fontStyle" ? (u(), p(v, {
843
+ key: e.getButtonKey(l.key, n.selector),
844
+ ref_for: !0,
845
+ ref: e.getButtonRef(l.key, n.selector),
846
+ "is-active": (N = (R = t.$refs.richTextEditor) == null ? void 0 : R.editor) == null ? void 0 : N.isActive(n.selector),
847
+ "tooltip-message": n.tooltipMessage,
848
+ "data-qa": n.dataQA,
849
+ "popover-data-qa": "dt-recipe-editor-font-style-input-popover",
850
+ tabindex: e.canFocus(e.getButtonRef(l.key, n.selector)) ? 0 : -1,
851
+ icon: n.icon,
852
+ onShiftFocusRight: e.shiftActionBarFocusRight,
853
+ onShiftFocusLeft: e.shiftActionBarFocusLeft
755
854
  }, {
756
- anchor: r(() => [
757
- c(p, f(a, {
758
- kind: "muted",
759
- size: "xs",
760
- importance: "clear",
761
- "aria-label": i.variableButton.tooltipMessage,
762
- "data-qa": i.variableButton.dataQA,
763
- "label-class": "d-jc-flex-start"
764
- }), {
765
- icon: r(() => [
766
- (u(), d(b(i.variableButton.icon), { size: "200" }))
855
+ content: a(({ close: m }) => [
856
+ d(S, {
857
+ label: "",
858
+ "label-visible": !1,
859
+ "show-list": !0,
860
+ "click-on-select": !0,
861
+ onEscape: (h) => m()
862
+ }, {
863
+ input: a(({ inputProps: h }) => [
864
+ d(A, B({ ref_for: !0 }, h, {
865
+ modelValue: r.fontStyleSearch,
866
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => r.fontStyleSearch = c),
867
+ "root-class": "d-p8 d-pb4 d-w216",
868
+ type: "search",
869
+ placeholder: r.i18n.$t("DIALTONE_EDITOR_FONT_STYLE_SEARCH_PLACEHOLDER"),
870
+ size: "sm",
871
+ role: "menuitem"
872
+ }), {
873
+ leftIcon: a(({ iconSize: c }) => [
874
+ d(T, { size: c }, null, 8, ["size"])
875
+ ]),
876
+ _: 1
877
+ }, 16, ["modelValue", "placeholder"])
767
878
  ]),
768
- _: 1
769
- }, 16, ["aria-label", "data-qa"])
770
- ]),
771
- _: 2
772
- }, 1032, ["message"])
773
- ]),
774
- content: r(({ close: a }) => [
775
- c(C, {
776
- modelValue: s.variableSearchValue,
777
- "onUpdate:modelValue": e[0] || (e[0] = (n) => s.variableSearchValue = n),
778
- "root-class": "d-p8 d-pb4 d-w264",
779
- type: "search",
780
- placeholder: s.i18n.$t("DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER"),
781
- size: "md",
782
- role: "menuitem"
783
- }, {
784
- leftIcon: r(({ iconSize: n }) => [
785
- c(j, { size: n }, null, 8, ["size"])
879
+ list: a(({ listProps: h }) => [
880
+ k("ul", B({ ref_for: !0 }, h), [
881
+ (u(!0), g(_, null, E(e.filteredFontStyles, (c) => (u(), p(C, {
882
+ key: c.name,
883
+ selected: e.isCurrentFontFamily(c.value),
884
+ style: D({ fontFamily: c.value || "inherit" }),
885
+ role: "option",
886
+ "navigation-type": "arrow-keys",
887
+ onClick: (P) => {
888
+ m(), e.onFontStyleSelect(c.value);
889
+ }
890
+ }, {
891
+ default: a(() => [
892
+ w(I(c.name), 1)
893
+ ]),
894
+ _: 2
895
+ }, 1032, ["selected", "style", "onClick"]))), 128))
896
+ ], 16)
897
+ ]),
898
+ _: 2
899
+ }, 1032, ["onEscape"])
786
900
  ]),
787
901
  _: 1
788
- }, 8, ["modelValue", "placeholder"]),
789
- (u(!0), _(w, null, O(i.filteredCategories, (n, I) => (u(), d(X, {
790
- key: n.name,
791
- heading: n.name,
792
- "heading-class": "d-headline--sm-compact d-p8"
902
+ }, 8, ["is-active", "tooltip-message", "data-qa", "tabindex", "icon", "onShiftFocusRight", "onShiftFocusLeft"])) : n.buttonType === "popover" && n.selector === "fontSize" ? (u(), p(at, {
903
+ key: e.getButtonKey(l.key, n.selector),
904
+ ref_for: !0,
905
+ ref: e.getButtonRef(l.key, n.selector),
906
+ "is-active": (V = (U = t.$refs.richTextEditor) == null ? void 0 : U.editor) == null ? void 0 : V.isActive(n.selector),
907
+ "tooltip-message": n.tooltipMessage,
908
+ "data-qa": n.dataQA,
909
+ "dropdown-data-qa": "dt-recipe-editor-font-size-input-popover",
910
+ tabindex: e.canFocus(e.getButtonRef(l.key, n.selector)) ? 0 : -1,
911
+ icon: n.icon,
912
+ onShiftFocusRight: e.shiftActionBarFocusRight,
913
+ onShiftFocusLeft: e.shiftActionBarFocusLeft
793
914
  }, {
794
- default: r(() => [
795
- (u(!0), _(w, null, O(i.getFilteredItemsForCategory(n), (B) => (u(), d(J, {
796
- key: n.name + B.name,
915
+ list: a(({ close: m }) => [
916
+ (u(!0), g(_, null, E(i.fontSizes, (h) => (u(), p(C, {
917
+ key: h.name,
918
+ selected: e.isCurrentFontSize(h.value),
797
919
  role: "menuitem",
798
920
  "navigation-type": "arrow-keys",
799
- onClick: (W) => {
800
- i.insertVariable(n.name, B), a();
921
+ onClick: (c) => {
922
+ m(), e.onFontSizeSelect(h.value, c);
801
923
  }
802
924
  }, {
803
- default: r(() => [
804
- A(m(B.name), 1)
925
+ default: a(() => [
926
+ k("span", {
927
+ style: D({ fontSize: h.value })
928
+ }, I(h.name), 5)
805
929
  ]),
806
930
  _: 2
807
- }, 1032, ["onClick"]))), 128)),
808
- I < i.filteredCategories.length - 1 ? (u(), d(Y, { key: 0 })) : D("", !0)
931
+ }, 1032, ["selected", "onClick"]))), 128))
809
932
  ]),
810
- _: 2
811
- }, 1032, ["heading"]))), 128))
812
- ]),
813
- _: 1
814
- }),
815
- e[7] || (e[7] = E("div", { class: "d-recipe-editor__button-group-divider" }, null, -1))
933
+ _: 1
934
+ }, 8, ["is-active", "tooltip-message", "data-qa", "tabindex", "icon", "onShiftFocusRight", "onShiftFocusLeft"])) : n.buttonType === "custom" && n.selector === "fontColor" ? Ot((u(), p(y, {
935
+ key: e.getButtonKey(l.key, n.selector),
936
+ ref_for: !0,
937
+ ref: e.getButtonRef(l.key, n.selector),
938
+ kind: "muted",
939
+ importance: "clear",
940
+ size: "xs",
941
+ active: (M = (Q = t.$refs.richTextEditor) == null ? void 0 : Q.editor) == null ? void 0 : M.isActive(n.selector),
942
+ tabindex: e.canFocus(e.getButtonRef(l.key, n.selector)) ? 0 : -1,
943
+ "aria-label": n.tooltipMessage,
944
+ "data-qa": n.dataQA,
945
+ onKeydown: [
946
+ b(L(e.shiftActionBarFocusRight, ["stop"]), ["right"]),
947
+ b(L(e.shiftActionBarFocusLeft, ["stop"]), ["left"])
948
+ ],
949
+ onClick: (m) => n.onClick()
950
+ }, {
951
+ default: a(() => [
952
+ d(A, {
953
+ value: r.currentFontColor,
954
+ "root-class": "d-w12 d-h12 d-my1",
955
+ "input-class": "colorPickerInput d-w100p d-h100p d-p0 d-bar0 d-c-pointer",
956
+ "input-wrapper-class": "d-w12 d-h12 d-bar2 d-ba-none",
957
+ size: "sm",
958
+ type: "color",
959
+ onInput: e.onColorPickerInput,
960
+ onClick: o[1] || (o[1] = L(() => {
961
+ }, ["stop"]))
962
+ }, null, 8, ["value", "onInput"])
963
+ ]),
964
+ _: 1
965
+ }, 8, ["active", "tabindex", "aria-label", "data-qa", "onKeydown", "onClick"])), [
966
+ [Bt, { message: n.tooltipMessage, placement: "top" }]
967
+ ]) : n.buttonType === "popover" && n.selector === "variable" ? (u(), p(v, {
968
+ key: e.getButtonKey(l.key, n.selector),
969
+ ref_for: !0,
970
+ ref: e.getButtonRef(l.key, n.selector),
971
+ "is-active": !1,
972
+ "tooltip-message": n.tooltipMessage,
973
+ "data-qa": n.dataQA,
974
+ "popover-data-qa": "dt-recipe-editor-variable-popover",
975
+ tabindex: e.canFocus(e.getButtonRef(l.key, n.selector)) ? 0 : -1,
976
+ icon: n.icon,
977
+ onShiftFocusRight: e.shiftActionBarFocusRight,
978
+ onShiftFocusLeft: e.shiftActionBarFocusLeft
979
+ }, {
980
+ content: a(({ close: m }) => [
981
+ d(S, {
982
+ label: "",
983
+ "label-visible": !1,
984
+ "show-list": !0,
985
+ "click-on-select": !0,
986
+ onEscape: (h) => m()
987
+ }, {
988
+ input: a(({ inputProps: h }) => [
989
+ d(A, B({ ref_for: !0 }, h, {
990
+ modelValue: r.variableSearchValue,
991
+ "onUpdate:modelValue": o[2] || (o[2] = (c) => r.variableSearchValue = c),
992
+ "root-class": "d-p8 d-pb4 d-w264",
993
+ type: "search",
994
+ placeholder: r.i18n.$t("DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER"),
995
+ size: "md",
996
+ role: "menuitem"
997
+ }), {
998
+ leftIcon: a(({ iconSize: c }) => [
999
+ d(T, { size: c }, null, 8, ["size"])
1000
+ ]),
1001
+ _: 1
1002
+ }, 16, ["modelValue", "placeholder"])
1003
+ ]),
1004
+ list: a(({ listProps: h }) => [
1005
+ k("div", B({ ref_for: !0 }, h), [
1006
+ (u(!0), g(_, null, E(e.filteredCategories, (c, P) => (u(), p(ct, {
1007
+ key: c.name,
1008
+ heading: c.name,
1009
+ "heading-class": "d-headline--sm-compact d-p8"
1010
+ }, {
1011
+ default: a(() => [
1012
+ (u(!0), g(_, null, E(e.getFilteredItemsForCategory(c), (x) => (u(), p(C, {
1013
+ key: c.name + x.name,
1014
+ role: "option",
1015
+ "navigation-type": "arrow-keys",
1016
+ onClick: (Jt) => {
1017
+ e.insertVariable(c.name, x), m();
1018
+ }
1019
+ }, {
1020
+ default: a(() => [
1021
+ w(I(x.name), 1)
1022
+ ]),
1023
+ _: 2
1024
+ }, 1032, ["onClick"]))), 128)),
1025
+ P < e.filteredCategories.length - 1 ? (u(), p(ut, { key: 0 })) : F("", !0)
1026
+ ]),
1027
+ _: 2
1028
+ }, 1032, ["heading"]))), 128))
1029
+ ], 16)
1030
+ ]),
1031
+ _: 2
1032
+ }, 1032, ["onEscape"])
1033
+ ]),
1034
+ _: 1
1035
+ }, 8, ["tooltip-message", "data-qa", "tabindex", "icon", "onShiftFocusRight", "onShiftFocusLeft"])) : n.buttonType === "button" ? (u(), p(dt, {
1036
+ key: e.getButtonKey(l.key, n.selector),
1037
+ ref_for: !0,
1038
+ ref: e.getButtonRef(l.key, n.selector),
1039
+ "is-active": (z = (q = t.$refs.richTextEditor) == null ? void 0 : q.editor) == null ? void 0 : z.isActive(n.selector),
1040
+ "tooltip-message": n.tooltipMessage,
1041
+ "data-qa": n.dataQA,
1042
+ tabindex: e.canFocus(e.getButtonRef(l.key, n.selector)) ? 0 : -1,
1043
+ icon: n.icon,
1044
+ label: n.label,
1045
+ "on-click": n.onClick,
1046
+ onShiftFocusRight: e.shiftActionBarFocusRight,
1047
+ onShiftFocusLeft: e.shiftActionBarFocusLeft
1048
+ }, null, 8, ["is-active", "tooltip-message", "data-qa", "tabindex", "icon", "label", "on-click", "onShiftFocusRight", "onShiftFocusLeft"])) : F("", !0)
1049
+ ], 64);
1050
+ }), 256)),
1051
+ o[8] || (o[8] = k("div", { class: "d-recipe-editor__button-group-divider" }, null, -1))
816
1052
  ]),
817
- _: 1
818
- })) : D("", !0),
819
- i.linkButton.showBtn ? (u(), d(T, {
820
- key: 1,
1053
+ _: 2
1054
+ }, 1024))), 128)),
1055
+ e.linkButton.showBtn ? (u(), p(O, {
1056
+ key: 0,
821
1057
  direction: "row",
822
1058
  gap: "300"
823
1059
  }, {
824
- default: r(() => [
825
- c(R, {
826
- open: s.showLinkInput,
1060
+ default: a(() => [
1061
+ d(ft, {
1062
+ open: r.showLinkInput,
827
1063
  "show-close-button": !1,
828
1064
  "data-qa": "dt-recipe-editor-link-input-popover",
829
1065
  padding: "none",
830
1066
  placement: "bottom-start",
831
1067
  onClick: [
832
- i.onInputFocus,
833
- g(i.onInputFocus, ["stop"])
1068
+ e.onInputFocus,
1069
+ L(e.onInputFocus, ["stop"])
834
1070
  ],
835
- onOpened: i.updateInput
1071
+ onOpened: e.updateInput
836
1072
  }, {
837
- anchor: r(() => [
838
- (u(), d(k, {
839
- key: i.linkButton.key,
840
- message: i.linkButton.tooltipMessage,
1073
+ anchor: a(() => [
1074
+ (u(), p(ht, {
1075
+ key: e.linkButton.key,
1076
+ message: e.linkButton.tooltipMessage,
841
1077
  placement: "top"
842
1078
  }, {
843
- anchor: r(() => {
844
- var a, n;
1079
+ anchor: a(() => {
1080
+ var l, n;
845
1081
  return [
846
- c(p, {
847
- ref: i.getButtonRef("custom", "link"),
848
- active: (n = (a = t.$refs.richTextEditor) == null ? void 0 : a.editor) == null ? void 0 : n.isActive(i.linkButton.selector),
849
- "aria-label": i.linkButton.tooltipMessage,
850
- "data-qa": i.linkButton.dataQA,
851
- tabindex: i.canFocus(i.getButtonRef("custom", "link")) ? 0 : -1,
1082
+ d(y, {
1083
+ ref: e.getButtonRef("custom", "link"),
1084
+ active: (n = (l = t.$refs.richTextEditor) == null ? void 0 : l.editor) == null ? void 0 : n.isActive(e.linkButton.selector),
1085
+ "aria-label": e.linkButton.tooltipMessage,
1086
+ "data-qa": e.linkButton.dataQA,
1087
+ tabindex: e.canFocus(e.getButtonRef("custom", "link")) ? 0 : -1,
852
1088
  importance: "clear",
853
1089
  kind: "muted",
854
1090
  size: "xs",
855
- onClick: e[1] || (e[1] = (I) => i.linkButton.onClick()),
1091
+ onClick: o[3] || (o[3] = (R) => e.linkButton.onClick()),
856
1092
  onKeydown: [
857
- L(g(i.shiftActionBarFocusRight, ["stop"]), ["right"]),
858
- L(g(i.shiftActionBarFocusLeft, ["stop"]), ["left"])
1093
+ b(L(e.shiftActionBarFocusRight, ["stop"]), ["right"]),
1094
+ b(L(e.shiftActionBarFocusLeft, ["stop"]), ["left"])
859
1095
  ]
860
1096
  }, {
861
- icon: r(() => [
862
- (u(), d(b(i.linkButton.icon), { size: "200" }))
1097
+ icon: a(() => [
1098
+ (u(), p(Ct(e.linkButton.icon), { size: "200" }))
863
1099
  ]),
864
1100
  _: 1
865
1101
  }, 8, ["active", "aria-label", "data-qa", "tabindex", "onKeydown"])
@@ -868,60 +1104,60 @@ function It(t, e, o, l, s, i) {
868
1104
  _: 1
869
1105
  }, 8, ["message"]))
870
1106
  ]),
871
- content: r(() => [
872
- E("div", Tt, [
873
- E("span", null, m(i.showAddLinkButtonLabels.title), 1),
874
- c(C, {
875
- modelValue: s.linkInput,
876
- "onUpdate:modelValue": e[2] || (e[2] = (a) => s.linkInput = a),
877
- "input-aria-label": i.showAddLinkButtonLabels["aria-label"],
878
- placeholder: o.setLinkPlaceholder,
1107
+ content: a(() => [
1108
+ k("div", Kt, [
1109
+ k("span", null, I(e.showAddLinkButtonLabels.title), 1),
1110
+ d(A, {
1111
+ modelValue: r.linkInput,
1112
+ "onUpdate:modelValue": o[4] || (o[4] = (l) => r.linkInput = l),
1113
+ "input-aria-label": e.showAddLinkButtonLabels["aria-label"],
1114
+ placeholder: i.setLinkPlaceholder,
879
1115
  "data-qa": "dt-recipe-editor-link-input",
880
1116
  "input-wrapper-class": "d-recipe-editor-link__input-wrapper",
881
1117
  onClick: [
882
- i.onInputFocus,
883
- g(i.onInputFocus, ["stop"])
1118
+ e.onInputFocus,
1119
+ L(e.onInputFocus, ["stop"])
884
1120
  ],
885
- onFocus: i.onInputFocus,
886
- onKeydown: L(i.setLink, ["enter"])
1121
+ onFocus: e.onInputFocus,
1122
+ onKeydown: b(e.setLink, ["enter"])
887
1123
  }, null, 8, ["modelValue", "input-aria-label", "placeholder", "onClick", "onFocus", "onKeydown"])
888
1124
  ])
889
1125
  ]),
890
- footerContent: r(() => [
891
- c(T, {
1126
+ footerContent: a(() => [
1127
+ d(O, {
892
1128
  direction: "row",
893
1129
  gap: "300",
894
1130
  class: "d-recipe-editor__popover-footer"
895
1131
  }, {
896
- default: r(() => [
897
- c(p, f({
1132
+ default: a(() => [
1133
+ d(y, B({
898
1134
  "data-qa": "dt-recipe-editor-remove-link-btn",
899
1135
  importance: "clear",
900
1136
  kind: "muted",
901
1137
  size: "sm"
902
- }, i.removeLinkButtonLabels, { onClick: i.removeLink }), {
903
- default: r(() => [
904
- A(m(i.removeLinkButtonLabels.title), 1)
1138
+ }, e.removeLinkButtonLabels, { onClick: e.removeLink }), {
1139
+ default: a(() => [
1140
+ w(I(e.removeLinkButtonLabels.title), 1)
905
1141
  ]),
906
1142
  _: 1
907
1143
  }, 16, ["onClick"]),
908
- c(p, f({
1144
+ d(y, B({
909
1145
  "data-qa": "dt-recipe-editor-set-link-cancel-btn",
910
1146
  importance: "clear",
911
1147
  kind: "muted",
912
1148
  size: "sm"
913
- }, i.cancelSetLinkButtonLabels, { onClick: i.closeLinkInput }), {
914
- default: r(() => [
915
- A(m(i.cancelSetLinkButtonLabels.title), 1)
1149
+ }, e.cancelSetLinkButtonLabels, { onClick: e.closeLinkInput }), {
1150
+ default: a(() => [
1151
+ w(I(e.cancelSetLinkButtonLabels.title), 1)
916
1152
  ]),
917
1153
  _: 1
918
1154
  }, 16, ["onClick"]),
919
- c(p, f({
1155
+ d(y, B({
920
1156
  "data-qa": "dt-recipe-editor-set-link-confirm-btn",
921
1157
  size: "sm"
922
- }, i.confirmSetLinkButtonLabels, { onClick: i.setLink }), {
923
- default: r(() => [
924
- A(m(i.confirmSetLinkButtonLabels.title), 1)
1158
+ }, e.confirmSetLinkButtonLabels, { onClick: e.setLink }), {
1159
+ default: a(() => [
1160
+ w(I(e.confirmSetLinkButtonLabels.title), 1)
925
1161
  ]),
926
1162
  _: 1
927
1163
  }, 16, ["onClick"])
@@ -933,46 +1169,48 @@ function It(t, e, o, l, s, i) {
933
1169
  }, 8, ["open", "onClick", "onOpened"])
934
1170
  ]),
935
1171
  _: 1
936
- })) : D("", !0)
1172
+ })) : F("", !0)
937
1173
  ]),
938
1174
  _: 1
939
1175
  }),
940
- E("div", {
941
- style: rt({ "max-height": o.maxHeight }),
1176
+ k("div", {
1177
+ style: D({ "max-height": i.maxHeight }),
942
1178
  class: "d-recipe-editor__content"
943
1179
  }, [
944
- c($, f({
1180
+ d(pt, B({
945
1181
  ref: "richTextEditor",
946
- modelValue: s.internalInputValue,
947
- "onUpdate:modelValue": e[3] || (e[3] = (a) => s.internalInputValue = a),
1182
+ modelValue: r.internalInputValue,
1183
+ "onUpdate:modelValue": o[5] || (o[5] = (l) => r.internalInputValue = l),
948
1184
  "allow-font-color": !0,
949
1185
  "allow-font-family": !0,
950
1186
  "allow-inline-images": !0,
951
1187
  "allow-line-breaks": !0,
952
1188
  "allow-variable": !0,
953
- "variable-items": i.flattenedVariableItems,
1189
+ "allow-font-size": i.showFontSizeButton,
1190
+ "variable-items": e.flattenedVariableItems,
954
1191
  "hide-link-bubble-menu": !0,
955
- "auto-focus": o.autoFocus,
956
- editable: o.editable,
957
- "input-aria-label": o.inputAriaLabel,
958
- "input-class": `d-recipe-editor__content-input ${o.inputClass}`,
1192
+ "auto-focus": i.autoFocus,
1193
+ editable: i.editable,
1194
+ "input-aria-label": i.inputAriaLabel,
1195
+ "input-class": `d-recipe-editor__content-input ${i.inputClass}`,
959
1196
  link: !0,
960
- "output-format": i.htmlOutputFormat,
961
- placeholder: o.placeholder,
962
- "use-div-tags": o.useDivTags,
963
- "allow-tables": o.allowTables,
1197
+ "output-format": e.htmlOutputFormat,
1198
+ placeholder: i.placeholder,
1199
+ "use-div-tags": i.useDivTags,
1200
+ "allow-tables": i.allowTables,
964
1201
  "data-qa": "dt-rich-text-editor"
965
- }, i.removeClassStyleAttrs(t.$attrs), {
966
- onTextInput: i.onTextInput,
967
- onBlur: i.onBlur,
968
- onFocus: i.onFocus,
969
- onInput: e[4] || (e[4] = (a) => i.onInput(a))
970
- }), null, 16, ["modelValue", "variable-items", "auto-focus", "editable", "input-aria-label", "input-class", "output-format", "placeholder", "use-div-tags", "allow-tables", "onTextInput", "onBlur", "onFocus"])
1202
+ }, e.removeClassStyleAttrs(t.$attrs), {
1203
+ onTextInput: e.onTextInput,
1204
+ onBlur: e.onBlur,
1205
+ onFocus: e.onFocus,
1206
+ onInput: o[6] || (o[6] = (l) => e.onInput(l)),
1207
+ onSelected: e.onSelected
1208
+ }), null, 16, ["modelValue", "allow-font-size", "variable-items", "auto-focus", "editable", "input-aria-label", "input-class", "output-format", "placeholder", "use-div-tags", "allow-tables", "onTextInput", "onBlur", "onFocus", "onSelected"])
971
1209
  ], 4)
972
1210
  ], 16);
973
1211
  }
974
- const Ut = /* @__PURE__ */ st(kt, [["render", It]]);
1212
+ const fe = /* @__PURE__ */ Rt(Pt, [["render", Ht]]);
975
1213
  export {
976
- Ut as default
1214
+ fe as default
977
1215
  };
978
1216
  //# sourceMappingURL=editor.js.map