Subversion Repositories oidplus

Rev

Rev 1422 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
597 daniel-mar 1
/**
2
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
 * Licensed under the LGPL or a commercial license.
4
 * For LGPL see License.txt in the project root for license information.
5
 * For commercial licenses see https://www.tiny.cloud/
6
 *
1434 daniel-mar 7
 * Version: 5.10.9 (2023-11-15)
597 daniel-mar 8
 */
9
(function () {
10
    'use strict';
11
 
12
    var Cell = function (initial) {
13
      var value = initial;
14
      var get = function () {
15
        return value;
16
      };
17
      var set = function (v) {
18
        value = v;
19
      };
20
      return {
21
        get: get,
22
        set: set
23
      };
24
    };
25
 
637 daniel-mar 26
    var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
597 daniel-mar 27
 
637 daniel-mar 28
    var get$1 = function (customTabs) {
597 daniel-mar 29
      var addTab = function (spec) {
30
        var currentCustomTabs = customTabs.get();
31
        currentCustomTabs[spec.name] = spec;
32
        customTabs.set(currentCustomTabs);
33
      };
34
      return { addTab: addTab };
35
    };
36
 
637 daniel-mar 37
    var register$1 = function (editor, dialogOpener) {
597 daniel-mar 38
      editor.addCommand('mceHelp', dialogOpener);
39
    };
40
 
637 daniel-mar 41
    var register = function (editor, dialogOpener) {
597 daniel-mar 42
      editor.ui.registry.addButton('help', {
43
        icon: 'help',
44
        tooltip: 'Help',
45
        onAction: dialogOpener
46
      });
47
      editor.ui.registry.addMenuItem('help', {
48
        text: 'Help',
49
        icon: 'help',
50
        shortcut: 'Alt+0',
51
        onAction: dialogOpener
52
      });
53
    };
54
 
55
    var __assign = function () {
56
      __assign = Object.assign || function __assign(t) {
57
        for (var s, i = 1, n = arguments.length; i < n; i++) {
58
          s = arguments[i];
59
          for (var p in s)
60
            if (Object.prototype.hasOwnProperty.call(s, p))
61
              t[p] = s[p];
62
        }
63
        return t;
64
      };
65
      return __assign.apply(this, arguments);
66
    };
67
 
68
    var noop = function () {
69
    };
70
    var constant = function (value) {
71
      return function () {
72
        return value;
73
      };
74
    };
637 daniel-mar 75
    var identity = function (x) {
76
      return x;
77
    };
597 daniel-mar 78
    var never = constant(false);
79
    var always = constant(true);
80
 
81
    var none = function () {
82
      return NONE;
83
    };
84
    var NONE = function () {
85
      var call = function (thunk) {
86
        return thunk();
87
      };
637 daniel-mar 88
      var id = identity;
597 daniel-mar 89
      var me = {
90
        fold: function (n, _s) {
91
          return n();
92
        },
93
        isSome: never,
94
        isNone: always,
95
        getOr: id,
96
        getOrThunk: call,
97
        getOrDie: function (msg) {
98
          throw new Error(msg || 'error: getOrDie called on none.');
99
        },
100
        getOrNull: constant(null),
101
        getOrUndefined: constant(undefined),
102
        or: id,
103
        orThunk: call,
104
        map: none,
105
        each: noop,
106
        bind: none,
107
        exists: never,
108
        forall: always,
637 daniel-mar 109
        filter: function () {
110
          return none();
111
        },
597 daniel-mar 112
        toArray: function () {
113
          return [];
114
        },
115
        toString: constant('none()')
116
      };
117
      return me;
118
    }();
119
    var some = function (a) {
120
      var constant_a = constant(a);
121
      var self = function () {
122
        return me;
123
      };
124
      var bind = function (f) {
125
        return f(a);
126
      };
127
      var me = {
128
        fold: function (n, s) {
129
          return s(a);
130
        },
131
        isSome: always,
132
        isNone: never,
133
        getOr: constant_a,
134
        getOrThunk: constant_a,
135
        getOrDie: constant_a,
136
        getOrNull: constant_a,
137
        getOrUndefined: constant_a,
138
        or: self,
139
        orThunk: self,
140
        map: function (f) {
141
          return some(f(a));
142
        },
143
        each: function (f) {
144
          f(a);
145
        },
146
        bind: bind,
147
        exists: bind,
148
        forall: bind,
149
        filter: function (f) {
150
          return f(a) ? me : NONE;
151
        },
152
        toArray: function () {
153
          return [a];
154
        },
155
        toString: function () {
156
          return 'some(' + a + ')';
157
        }
158
      };
159
      return me;
160
    };
161
    var from = function (value) {
162
      return value === null || value === undefined ? NONE : some(value);
163
    };
164
    var Optional = {
165
      some: some,
166
      none: none,
167
      from: from
168
    };
169
 
170
    var nativeIndexOf = Array.prototype.indexOf;
171
    var rawIndexOf = function (ts, t) {
172
      return nativeIndexOf.call(ts, t);
173
    };
174
    var contains = function (xs, x) {
175
      return rawIndexOf(xs, x) > -1;
176
    };
177
    var map = function (xs, f) {
178
      var len = xs.length;
179
      var r = new Array(len);
180
      for (var i = 0; i < len; i++) {
181
        var x = xs[i];
182
        r[i] = f(x, i);
183
      }
184
      return r;
185
    };
186
    var filter = function (xs, pred) {
187
      var r = [];
188
      for (var i = 0, len = xs.length; i < len; i++) {
189
        var x = xs[i];
190
        if (pred(x, i)) {
191
          r.push(x);
192
        }
193
      }
194
      return r;
195
    };
196
    var findUntil = function (xs, pred, until) {
197
      for (var i = 0, len = xs.length; i < len; i++) {
198
        var x = xs[i];
199
        if (pred(x, i)) {
200
          return Optional.some(x);
201
        } else if (until(x, i)) {
202
          break;
203
        }
204
      }
205
      return Optional.none();
206
    };
207
    var find = function (xs, pred) {
208
      return findUntil(xs, pred, never);
209
    };
210
 
211
    var keys = Object.keys;
212
    var hasOwnProperty = Object.hasOwnProperty;
637 daniel-mar 213
    var get = function (obj, key) {
597 daniel-mar 214
      return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
215
    };
216
    var has = function (obj, key) {
217
      return hasOwnProperty.call(obj, key);
218
    };
219
 
220
    var cat = function (arr) {
221
      var r = [];
222
      var push = function (x) {
223
        r.push(x);
224
      };
225
      for (var i = 0; i < arr.length; i++) {
226
        arr[i].each(push);
227
      }
228
      return r;
229
    };
230
 
231
    var getHelpTabs = function (editor) {
232
      return Optional.from(editor.getParam('help_tabs'));
233
    };
234
    var getForcedPlugins = function (editor) {
235
      return editor.getParam('forced_plugins');
236
    };
237
 
238
    var description = '<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n  <li>Focus the menubar: Alt + F9 (Windows) or &#x2325;F9 (MacOS)</li>\n  <li>Focus the toolbar: Alt + F10 (Windows) or &#x2325;F10 (MacOS)</li>\n  <li>Focus the footer: Alt + F11 (Windows) or &#x2325;F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n  <li>the menubar</li>\n  <li>each group of the toolbar </li>\n  <li>the sidebar</li>\n  <li>the element path in the footer </li>\n  <li>the wordcount toggle button in the footer </li>\n  <li>the branding link in the footer </li>\n  <li>the editor resize handle in the footer</li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n  <li>moving between menus in the menubar</li>\n  <li>moving between buttons in a toolbar group</li>\n  <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or &#x2303;F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>';
637 daniel-mar 239
    var tab$3 = function () {
597 daniel-mar 240
      var body = {
241
        type: 'htmlpanel',
242
        presets: 'document',
243
        html: description
244
      };
245
      return {
246
        name: 'keyboardnav',
247
        title: 'Keyboard Navigation',
248
        items: [body]
249
      };
250
    };
251
 
637 daniel-mar 252
    var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
597 daniel-mar 253
 
254
    var convertText = function (source) {
255
      var mac = {
256
        alt: '&#x2325;',
257
        ctrl: '&#x2303;',
258
        shift: '&#x21E7;',
259
        meta: '&#x2318;',
260
        access: '&#x2303;&#x2325;'
261
      };
262
      var other = {
263
        meta: 'Ctrl ',
264
        access: 'Shift + Alt '
265
      };
637 daniel-mar 266
      var replace = global$2.mac ? mac : other;
597 daniel-mar 267
      var shortcut = source.split('+');
268
      var updated = map(shortcut, function (segment) {
269
        var search = segment.toLowerCase().trim();
270
        return has(replace, search) ? replace[search] : segment;
271
      });
637 daniel-mar 272
      return global$2.mac ? updated.join('').replace(/\s/, '') : updated.join('+');
597 daniel-mar 273
    };
274
 
275
    var shortcuts = [
276
      {
277
        shortcuts: ['Meta + B'],
278
        action: 'Bold'
279
      },
280
      {
281
        shortcuts: ['Meta + I'],
282
        action: 'Italic'
283
      },
284
      {
285
        shortcuts: ['Meta + U'],
286
        action: 'Underline'
287
      },
288
      {
289
        shortcuts: ['Meta + A'],
290
        action: 'Select all'
291
      },
292
      {
293
        shortcuts: [
294
          'Meta + Y',
295
          'Meta + Shift + Z'
296
        ],
297
        action: 'Redo'
298
      },
299
      {
300
        shortcuts: ['Meta + Z'],
301
        action: 'Undo'
302
      },
303
      {
304
        shortcuts: ['Access + 1'],
305
        action: 'Heading 1'
306
      },
307
      {
308
        shortcuts: ['Access + 2'],
309
        action: 'Heading 2'
310
      },
311
      {
312
        shortcuts: ['Access + 3'],
313
        action: 'Heading 3'
314
      },
315
      {
316
        shortcuts: ['Access + 4'],
317
        action: 'Heading 4'
318
      },
319
      {
320
        shortcuts: ['Access + 5'],
321
        action: 'Heading 5'
322
      },
323
      {
324
        shortcuts: ['Access + 6'],
325
        action: 'Heading 6'
326
      },
327
      {
328
        shortcuts: ['Access + 7'],
329
        action: 'Paragraph'
330
      },
331
      {
332
        shortcuts: ['Access + 8'],
333
        action: 'Div'
334
      },
335
      {
336
        shortcuts: ['Access + 9'],
337
        action: 'Address'
338
      },
339
      {
340
        shortcuts: ['Alt + 0'],
341
        action: 'Open help dialog'
342
      },
343
      {
344
        shortcuts: ['Alt + F9'],
345
        action: 'Focus to menubar'
346
      },
347
      {
348
        shortcuts: ['Alt + F10'],
349
        action: 'Focus to toolbar'
350
      },
351
      {
352
        shortcuts: ['Alt + F11'],
353
        action: 'Focus to element path'
354
      },
355
      {
356
        shortcuts: ['Ctrl + F9'],
357
        action: 'Focus to contextual toolbar'
358
      },
359
      {
360
        shortcuts: ['Shift + Enter'],
361
        action: 'Open popup menu for split buttons'
362
      },
363
      {
364
        shortcuts: ['Meta + K'],
365
        action: 'Insert link (if link plugin activated)'
366
      },
367
      {
368
        shortcuts: ['Meta + S'],
369
        action: 'Save (if save plugin activated)'
370
      },
371
      {
372
        shortcuts: ['Meta + F'],
373
        action: 'Find (if searchreplace plugin activated)'
374
      },
375
      {
376
        shortcuts: ['Meta + Shift + F'],
377
        action: 'Switch to or from fullscreen mode'
378
      }
379
    ];
380
 
637 daniel-mar 381
    var tab$2 = function () {
597 daniel-mar 382
      var shortcutList = map(shortcuts, function (shortcut) {
383
        var shortcutText = map(shortcut.shortcuts, convertText).join(' or ');
384
        return [
385
          shortcut.action,
386
          shortcutText
387
        ];
388
      });
389
      var tablePanel = {
390
        type: 'table',
391
        header: [
392
          'Action',
393
          'Shortcut'
394
        ],
395
        cells: shortcutList
396
      };
397
      return {
398
        name: 'shortcuts',
399
        title: 'Handy Shortcuts',
400
        items: [tablePanel]
401
      };
402
    };
403
 
637 daniel-mar 404
    var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
597 daniel-mar 405
 
406
    var urls = map([
407
      {
408
        key: 'advlist',
409
        name: 'Advanced List'
410
      },
411
      {
412
        key: 'anchor',
413
        name: 'Anchor'
414
      },
415
      {
416
        key: 'autolink',
417
        name: 'Autolink'
418
      },
419
      {
420
        key: 'autoresize',
421
        name: 'Autoresize'
422
      },
423
      {
424
        key: 'autosave',
425
        name: 'Autosave'
426
      },
427
      {
428
        key: 'bbcode',
429
        name: 'BBCode'
430
      },
431
      {
432
        key: 'charmap',
433
        name: 'Character Map'
434
      },
435
      {
436
        key: 'code',
437
        name: 'Code'
438
      },
439
      {
440
        key: 'codesample',
441
        name: 'Code Sample'
442
      },
443
      {
444
        key: 'colorpicker',
445
        name: 'Color Picker'
446
      },
447
      {
448
        key: 'directionality',
449
        name: 'Directionality'
450
      },
451
      {
452
        key: 'emoticons',
453
        name: 'Emoticons'
454
      },
455
      {
456
        key: 'fullpage',
457
        name: 'Full Page'
458
      },
459
      {
460
        key: 'fullscreen',
461
        name: 'Full Screen'
462
      },
463
      {
464
        key: 'help',
465
        name: 'Help'
466
      },
467
      {
468
        key: 'hr',
469
        name: 'Horizontal Rule'
470
      },
471
      {
472
        key: 'image',
473
        name: 'Image'
474
      },
475
      {
476
        key: 'imagetools',
477
        name: 'Image Tools'
478
      },
479
      {
480
        key: 'importcss',
481
        name: 'Import CSS'
482
      },
483
      {
484
        key: 'insertdatetime',
485
        name: 'Insert Date/Time'
486
      },
487
      {
488
        key: 'legacyoutput',
489
        name: 'Legacy Output'
490
      },
491
      {
492
        key: 'link',
493
        name: 'Link'
494
      },
495
      {
496
        key: 'lists',
497
        name: 'Lists'
498
      },
499
      {
500
        key: 'media',
501
        name: 'Media'
502
      },
503
      {
504
        key: 'nonbreaking',
505
        name: 'Nonbreaking'
506
      },
507
      {
508
        key: 'noneditable',
509
        name: 'Noneditable'
510
      },
511
      {
512
        key: 'pagebreak',
513
        name: 'Page Break'
514
      },
515
      {
516
        key: 'paste',
517
        name: 'Paste'
518
      },
519
      {
520
        key: 'preview',
521
        name: 'Preview'
522
      },
523
      {
524
        key: 'print',
525
        name: 'Print'
526
      },
527
      {
679 daniel-mar 528
        key: 'quickbars',
529
        name: 'Quick Toolbars'
530
      },
531
      {
597 daniel-mar 532
        key: 'save',
533
        name: 'Save'
534
      },
535
      {
536
        key: 'searchreplace',
537
        name: 'Search and Replace'
538
      },
539
      {
540
        key: 'spellchecker',
541
        name: 'Spell Checker'
542
      },
543
      {
544
        key: 'tabfocus',
545
        name: 'Tab Focus'
546
      },
547
      {
548
        key: 'table',
549
        name: 'Table'
550
      },
551
      {
552
        key: 'template',
553
        name: 'Template'
554
      },
555
      {
556
        key: 'textcolor',
557
        name: 'Text Color'
558
      },
559
      {
560
        key: 'textpattern',
561
        name: 'Text Pattern'
562
      },
563
      {
564
        key: 'toc',
565
        name: 'Table of Contents'
566
      },
567
      {
568
        key: 'visualblocks',
569
        name: 'Visual Blocks'
570
      },
571
      {
572
        key: 'visualchars',
573
        name: 'Visual Characters'
574
      },
575
      {
576
        key: 'wordcount',
577
        name: 'Word Count'
578
      },
579
      {
679 daniel-mar 580
        key: 'a11ychecker',
581
        name: 'Accessibility Checker',
582
        type: 'premium'
583
      },
584
      {
597 daniel-mar 585
        key: 'advcode',
679 daniel-mar 586
        name: 'Advanced Code Editor',
587
        type: 'premium'
597 daniel-mar 588
      },
589
      {
679 daniel-mar 590
        key: 'advtable',
591
        name: 'Advanced Tables',
592
        type: 'premium'
597 daniel-mar 593
      },
594
      {
679 daniel-mar 595
        key: 'autocorrect',
596
        name: 'Autocorrect',
597
        type: 'premium'
597 daniel-mar 598
      },
599
      {
679 daniel-mar 600
        key: 'casechange',
601
        name: 'Case Change',
602
        type: 'premium'
597 daniel-mar 603
      },
604
      {
679 daniel-mar 605
        key: 'checklist',
606
        name: 'Checklist',
607
        type: 'premium'
597 daniel-mar 608
      },
609
      {
679 daniel-mar 610
        key: 'export',
611
        name: 'Export',
612
        type: 'premium'
597 daniel-mar 613
      },
614
      {
679 daniel-mar 615
        key: 'mediaembed',
616
        name: 'Enhanced Media Embed',
617
        type: 'premium'
597 daniel-mar 618
      },
619
      {
679 daniel-mar 620
        key: 'formatpainter',
621
        name: 'Format Painter',
622
        type: 'premium'
597 daniel-mar 623
      },
624
      {
679 daniel-mar 625
        key: 'linkchecker',
626
        name: 'Link Checker',
627
        type: 'premium'
597 daniel-mar 628
      },
629
      {
679 daniel-mar 630
        key: 'mentions',
631
        name: 'Mentions',
632
        type: 'premium'
597 daniel-mar 633
      },
634
      {
679 daniel-mar 635
        key: 'pageembed',
636
        name: 'Page Embed',
637
        type: 'premium'
597 daniel-mar 638
      },
639
      {
640
        key: 'permanentpen',
679 daniel-mar 641
        name: 'Permanent Pen',
642
        type: 'premium'
597 daniel-mar 643
      },
644
      {
679 daniel-mar 645
        key: 'powerpaste',
646
        name: 'PowerPaste',
647
        type: 'premium'
597 daniel-mar 648
      },
649
      {
679 daniel-mar 650
        key: 'rtc',
651
        name: 'Real-Time Collaboration',
652
        type: 'premium'
597 daniel-mar 653
      },
654
      {
679 daniel-mar 655
        key: 'tinymcespellchecker',
656
        name: 'Spell Checker Pro',
657
        type: 'premium'
597 daniel-mar 658
      },
659
      {
679 daniel-mar 660
        key: 'tinycomments',
661
        name: 'Tiny Comments',
662
        type: 'premium',
663
        slug: 'comments'
597 daniel-mar 664
      },
665
      {
679 daniel-mar 666
        key: 'tinydrive',
667
        name: 'Tiny Drive',
668
        type: 'premium'
597 daniel-mar 669
      }
670
    ], function (item) {
671
      return __assign(__assign({}, item), {
679 daniel-mar 672
        type: item.type || 'opensource',
597 daniel-mar 673
        slug: item.slug || item.key
674
      });
675
    });
676
 
637 daniel-mar 677
    var tab$1 = function (editor) {
597 daniel-mar 678
      var availablePlugins = function () {
679 daniel-mar 679
        var premiumPlugins = filter(urls, function (_a) {
680
          var key = _a.key, type = _a.type;
681
          return key !== 'autocorrect' && type === 'premium';
682
        });
597 daniel-mar 683
        var premiumPluginList = map(premiumPlugins, function (plugin) {
679 daniel-mar 684
          return '<li>' + global$1.translate(plugin.name) + '</li>';
597 daniel-mar 685
        }).join('');
637 daniel-mar 686
        return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$1.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$1.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
597 daniel-mar 687
      };
688
      var makeLink = function (p) {
689
        return '<a href="' + p.url + '" target="_blank" rel="noopener">' + p.name + '</a>';
690
      };
691
      var maybeUrlize = function (editor, key) {
692
        return find(urls, function (x) {
693
          return x.key === key;
694
        }).fold(function () {
695
          var getMetadata = editor.plugins[key].getMetadata;
696
          return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key;
697
        }, function (x) {
679 daniel-mar 698
          var name = x.type === 'premium' ? x.name + '*' : x.name;
597 daniel-mar 699
          return makeLink({
679 daniel-mar 700
            name: name,
597 daniel-mar 701
            url: 'https://www.tiny.cloud/docs/plugins/' + x.type + '/' + x.slug
702
          });
703
        });
704
      };
705
      var getPluginKeys = function (editor) {
706
        var keys$1 = keys(editor.plugins);
707
        var forced_plugins = getForcedPlugins(editor);
708
        return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) {
709
          return !contains(forced_plugins, k);
710
        });
711
      };
712
      var pluginLister = function (editor) {
713
        var pluginKeys = getPluginKeys(editor);
714
        var pluginLis = map(pluginKeys, function (key) {
715
          return '<li>' + maybeUrlize(editor, key) + '</li>';
716
        });
717
        var count = pluginLis.length;
718
        var pluginsString = pluginLis.join('');
637 daniel-mar 719
        var html = '<p><b>' + global$1.translate([
597 daniel-mar 720
          'Plugins installed ({0}):',
721
          count
722
        ]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
723
        return html;
724
      };
725
      var installedPlugins = function (editor) {
726
        if (editor == null) {
727
          return '';
728
        }
729
        return '<div data-mce-tabstop="1" tabindex="-1">' + pluginLister(editor) + '</div>';
730
      };
731
      var htmlPanel = {
732
        type: 'htmlpanel',
733
        presets: 'document',
734
        html: [
735
          installedPlugins(editor),
736
          availablePlugins()
737
        ].join('')
738
      };
739
      return {
740
        name: 'plugins',
741
        title: 'Plugins',
742
        items: [htmlPanel]
743
      };
744
    };
745
 
637 daniel-mar 746
    var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
597 daniel-mar 747
 
637 daniel-mar 748
    var tab = function () {
597 daniel-mar 749
      var getVersion = function (major, minor) {
750
        return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
751
      };
637 daniel-mar 752
      var version = getVersion(global.majorVersion, global.minorVersion);
597 daniel-mar 753
      var changeLogLink = '<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE ' + version + '</a>';
754
      var htmlPanel = {
755
        type: 'htmlpanel',
637 daniel-mar 756
        html: '<p>' + global$1.translate([
597 daniel-mar 757
          'You are using {0}',
758
          changeLogLink
759
        ]) + '</p>',
760
        presets: 'document'
761
      };
762
      return {
763
        name: 'versions',
764
        title: 'Version',
765
        items: [htmlPanel]
766
      };
767
    };
768
 
769
    var parseHelpTabsSetting = function (tabsFromSettings, tabs) {
770
      var newTabs = {};
771
      var names = map(tabsFromSettings, function (t) {
772
        if (typeof t === 'string') {
773
          if (has(tabs, t)) {
774
            newTabs[t] = tabs[t];
775
          }
776
          return t;
777
        } else {
778
          newTabs[t.name] = t;
779
          return t.name;
780
        }
781
      });
782
      return {
783
        tabs: newTabs,
784
        names: names
785
      };
786
    };
787
    var getNamesFromTabs = function (tabs) {
788
      var names = keys(tabs);
789
      var idx = names.indexOf('versions');
790
      if (idx !== -1) {
791
        names.splice(idx, 1);
792
        names.push('versions');
793
      }
794
      return {
795
        tabs: tabs,
796
        names: names
797
      };
798
    };
799
    var parseCustomTabs = function (editor, customTabs) {
800
      var _a;
637 daniel-mar 801
      var shortcuts = tab$2();
802
      var nav = tab$3();
803
      var plugins = tab$1(editor);
804
      var versions = tab();
597 daniel-mar 805
      var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get());
806
      return getHelpTabs(editor).fold(function () {
807
        return getNamesFromTabs(tabs);
808
      }, function (tabsFromSettings) {
809
        return parseHelpTabsSetting(tabsFromSettings, tabs);
810
      });
811
    };
812
    var init = function (editor, customTabs) {
813
      return function () {
814
        var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names;
815
        var foundTabs = map(names, function (name) {
637 daniel-mar 816
          return get(tabs, name);
597 daniel-mar 817
        });
818
        var dialogTabs = cat(foundTabs);
819
        var body = {
820
          type: 'tabpanel',
821
          tabs: dialogTabs
822
        };
823
        editor.windowManager.open({
824
          title: 'Help',
825
          size: 'medium',
826
          body: body,
827
          buttons: [{
828
              type: 'cancel',
829
              name: 'close',
830
              text: 'Close',
831
              primary: true
832
            }],
833
          initialData: {}
834
        });
835
      };
836
    };
837
 
838
    function Plugin () {
637 daniel-mar 839
      global$3.add('help', function (editor) {
597 daniel-mar 840
        var customTabs = Cell({});
637 daniel-mar 841
        var api = get$1(customTabs);
597 daniel-mar 842
        var dialogOpener = init(editor, customTabs);
637 daniel-mar 843
        register(editor, dialogOpener);
597 daniel-mar 844
        register$1(editor, dialogOpener);
845
        editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
846
        return api;
847
      });
848
    }
849
 
850
    Plugin();
851
 
852
}());