@stratusjs/angular 0.5.2 → 0.5.3

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 (81) hide show
  1. package/dist/angular.bundle.min.js +1 -1
  2. package/package.json +1 -1
  3. package/src/angular.modules.js +33 -18
  4. package/src/angular.modules.js.map +1 -1
  5. package/src/app.module.js +254 -181
  6. package/src/app.module.js.map +1 -1
  7. package/src/backend.service.js +87 -66
  8. package/src/backend.service.js.map +1 -1
  9. package/src/base/base.component.js +124 -101
  10. package/src/base/base.component.js.map +1 -1
  11. package/src/boot.js +55 -42
  12. package/src/boot.js.map +1 -1
  13. package/src/confirm-dialog/confirm-dialog.component.js +60 -41
  14. package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
  15. package/src/core/base.interface.js +9 -1
  16. package/src/core/base.interface.js.map +1 -1
  17. package/src/core/refresh.interface.js +9 -1
  18. package/src/core/refresh.interface.js.map +1 -1
  19. package/src/core/responsive.component.js +58 -40
  20. package/src/core/responsive.component.js.map +1 -1
  21. package/src/core/responsive.interface.js +9 -1
  22. package/src/core/responsive.interface.js.map +1 -1
  23. package/src/core/root.component.js +43 -24
  24. package/src/core/root.component.js.map +1 -1
  25. package/src/core/trigger.interface.js +9 -1
  26. package/src/core/trigger.interface.js.map +1 -1
  27. package/src/data/contact-meta.interface.js +9 -1
  28. package/src/data/contact-meta.interface.js.map +1 -1
  29. package/src/data/content.interface.js +9 -1
  30. package/src/data/content.interface.js.map +1 -1
  31. package/src/data/convoy.interface.js +9 -1
  32. package/src/data/convoy.interface.js.map +1 -1
  33. package/src/editor/citation-dialog.component.js +207 -174
  34. package/src/editor/citation-dialog.component.js.map +1 -1
  35. package/src/editor/code-mirror-bridge.js +74 -60
  36. package/src/editor/code-mirror-bridge.js.map +1 -1
  37. package/src/editor/code-mirror-bridge.min.js +1 -1
  38. package/src/editor/code-view-dialog.component.js +116 -87
  39. package/src/editor/code-view-dialog.component.js.map +1 -1
  40. package/src/editor/editor.component.js +961 -903
  41. package/src/editor/editor.component.js.map +1 -1
  42. package/src/editor/link-dialog.component.js +395 -356
  43. package/src/editor/link-dialog.component.js.map +1 -1
  44. package/src/editor/media-dialog.component.js +303 -270
  45. package/src/editor/media-dialog.component.js.map +1 -1
  46. package/src/froala/plugins/citationManager.js +191 -170
  47. package/src/froala/plugins/citationManager.js.map +1 -1
  48. package/src/froala/plugins/inputButton.js +138 -122
  49. package/src/froala/plugins/inputButton.js.map +1 -1
  50. package/src/froala/plugins/linkManager.js +104 -89
  51. package/src/froala/plugins/linkManager.js.map +1 -1
  52. package/src/froala/plugins/mediaManager.js +87 -72
  53. package/src/froala/plugins/mediaManager.js.map +1 -1
  54. package/src/froala/plugins/menuButton.js +86 -71
  55. package/src/froala/plugins/menuButton.js.map +1 -1
  56. package/src/main.js +33 -13
  57. package/src/main.js.map +1 -1
  58. package/src/material.js +194 -99
  59. package/src/material.js.map +1 -1
  60. package/src/media-selector/media-selector.component.js +441 -406
  61. package/src/media-selector/media-selector.component.js.map +1 -1
  62. package/src/polyfills.js +16 -3
  63. package/src/polyfills.js.map +1 -1
  64. package/src/quill-plugins/quill-break-blot.plugin.js +35 -19
  65. package/src/quill-plugins/quill-break-blot.plugin.js.map +1 -1
  66. package/src/quill-plugins/quill-html-edit.plugin.js +153 -140
  67. package/src/quill-plugins/quill-html-edit.plugin.js.map +1 -1
  68. package/src/quill-plugins/quill-image-format.plugin.js +47 -33
  69. package/src/quill-plugins/quill-image-format.plugin.js.map +1 -1
  70. package/src/quill-plugins/quill-input-button.plugin.js +95 -77
  71. package/src/quill-plugins/quill-input-button.plugin.js.map +1 -1
  72. package/src/selector/selector.component.js +276 -241
  73. package/src/selector/selector.component.js.map +1 -1
  74. package/src/test/test.directive.js +66 -49
  75. package/src/test/test.directive.js.map +1 -1
  76. package/src/tree/tree-dialog.component.js +231 -202
  77. package/src/tree/tree-dialog.component.js.map +1 -1
  78. package/src/tree/tree-node.component.js +282 -253
  79. package/src/tree/tree-node.component.js.map +1 -1
  80. package/src/tree/tree.component.js +561 -531
  81. package/src/tree/tree.component.js.map +1 -1
@@ -1,926 +1,984 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { ChangeDetectorRef, Component, ElementRef, Input, } from '@angular/core';
11
- import { FormBuilder, FormControl } from '@angular/forms';
12
- import { MatDialog } from '@angular/material/dialog';
13
- import { Observable, Subject, timer } from 'rxjs';
14
- import { catchError, debounce } from 'rxjs/operators';
15
- import { DomSanitizer } from '@angular/platform-browser';
16
- import { Stratus } from '@stratusjs/runtime/stratus';
17
- import _ from 'lodash';
18
- import { RootComponent } from '../core/root.component';
19
- import { CitationDialogComponent } from './citation-dialog.component';
20
- import { LinkDialogComponent } from './link-dialog.component';
21
- import { MediaDialogComponent } from './media-dialog.component';
22
- import { CodeViewDialogComponent } from './code-view-dialog.component';
23
- import { CodeMirrorBridge } from './code-mirror-bridge';
24
- import { Registry } from '@stratusjs/angularjs/services/registry';
25
- import { cookie } from '@stratusjs/core/environment';
26
- import { EventManager } from '@stratusjs/core/events/eventManager';
27
- import { EditorView, basicSetup } from 'codemirror';
28
- import { html } from '@codemirror/lang-html';
29
- import 'html2pdf';
30
- import 'font-awesome';
31
- import 'froala-plugins';
32
- import 'froala-embedly';
33
- import 'froala-font-awesome';
34
- import 'froala-image-tui';
35
- import '../froala/plugins/citationManager';
36
- import '../froala/plugins/linkManager';
37
- import '../froala/plugins/mediaManager';
38
- const systemPackage = '@stratusjs/angular';
39
- const froalaPackage = 'froala-editor';
40
- const moduleName = 'editor';
41
- const min = !cookie('env') ? '.min' : '';
42
- const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
43
- const froalaDir = `${Stratus.BaseUrl}${boot.configuration.paths[froalaPackage].replace(/js\/[^\/]*$/, '')}`;
44
- const has = (object, path) => _.has(object, path) && !_.isEmpty(_.get(object, path));
45
- let EditorComponent = class EditorComponent extends RootComponent {
46
- constructor(sanitizer, ref, elementRef, fb, dialog) {
47
- super();
48
- this.sanitizer = sanitizer;
49
- this.ref = ref;
50
- this.elementRef = elementRef;
51
- this.fb = fb;
52
- this.dialog = dialog;
53
- this.title = moduleName + '_component';
54
- this.dev = !!cookie('env');
55
- this.editor = 'froala';
56
- this._ = _;
57
- this.has = has;
58
- this.log = console.log;
59
- this.Stratus = Stratus;
60
- this.registry = new Registry();
61
- this.onChange = new Subject();
62
- this.svgIcons = {};
63
- this.initialized = false;
64
- this.styled = false;
65
- this.blurred = false;
66
- this.focused = false;
67
- this.form = this.fb.group({
68
- dataString: new FormControl(),
69
- });
70
- this.dataChangeLog = [];
71
- this.dataString = '';
72
- this.debounceSave = true;
73
- this.debounceTime = 5000;
74
- this.forceSave = true;
75
- this.froalaButtons = [
76
- 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|', 'formatBlock',
77
- 'blockStyle', 'inlineStyle', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL',
78
- 'formatUL', 'outdent', 'indent', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertFile',
79
- 'insertTable', '|', 'undo', 'redo', 'removeFormat', 'wordPaste', 'help', 'html', 'fullscreen'
80
- ];
81
- this.froalaStandardButtons = {
82
- moreText: [
83
- 'bold',
84
- 'italic',
85
- 'underline',
86
- 'strikeThrough',
87
- 'subscript',
88
- 'superscript',
89
- 'fontFamily',
90
- 'fontSize',
91
- 'textColor',
92
- 'backgroundColor',
93
- 'inlineClass',
94
- 'inlineStyle',
95
- 'clearFormatting'
96
- ],
97
- moreParagraph: [
98
- 'linkManager',
99
- 'formatOL',
100
- 'formatUL',
101
- 'indent',
102
- 'outdent',
103
- 'quote',
104
- 'paragraphFormat',
105
- 'paragraphStyle',
106
- 'alignLeft',
107
- 'alignCenter',
108
- 'alignRight',
109
- 'alignJustify',
110
- ],
111
- moreRich: [
112
- 'mediaManager',
113
- 'insertTable',
114
- 'insertImage',
115
- 'insertVideo',
116
- 'insertFile',
117
- 'citationInsert',
118
- 'insertHR',
119
- 'specialCharacters',
120
- ],
121
- moreMisc: [
122
- 'html',
123
- 'undo',
124
- 'redo',
125
- 'fullscreen',
126
- 'print',
127
- 'selectAll',
128
- 'help'
129
- ],
130
- };
131
- this.froalaConfig = {
132
- attribution: false,
133
- key: Stratus.Environment.get('froalaKey'),
134
- zIndex: 9999,
135
- events: {
136
- initialized: (froalaEditorDirective) => {
137
- this.froalaEditorDirective = froalaEditorDirective;
138
- },
1
+ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog", "rxjs", "rxjs/operators", "@angular/platform-browser", "@stratusjs/runtime/stratus", "lodash", "../core/root.component", "./citation-dialog.component", "./link-dialog.component", "./media-dialog.component", "./code-view-dialog.component", "./code-mirror-bridge", "@stratusjs/angularjs/services/registry", "@stratusjs/core/environment", "@stratusjs/core/events/eventManager", "codemirror", "@codemirror/lang-html", "html2pdf", "font-awesome", "froala-plugins", "froala-embedly", "froala-font-awesome", "froala-image-tui", "../froala/plugins/citationManager", "../froala/plugins/linkManager", "../froala/plugins/mediaManager"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ var core_1, forms_1, dialog_1, rxjs_1, operators_1, platform_browser_1, stratus_1, lodash_1, root_component_1, citation_dialog_component_1, link_dialog_component_1, media_dialog_component_1, code_view_dialog_component_1, code_mirror_bridge_1, registry_1, environment_1, eventManager_1, codemirror_1, lang_html_1, systemPackage, froalaPackage, moduleName, min, localDir, froalaDir, has, EditorComponent;
13
+ var __moduleName = context_1 && context_1.id;
14
+ return {
15
+ setters: [
16
+ function (core_1_1) {
17
+ core_1 = core_1_1;
139
18
  },
140
- codeBeautifierOptions: {
141
- end_with_newline: true,
142
- indent_inner_html: true,
143
- extra_liners: '["p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "pre", "ul", "ol", "table", "dl"]',
144
- brace_style: 'expand',
145
- indent_char: ' ',
146
- indent_size: 4,
147
- wrap_line_length: 0
19
+ function (forms_1_1) {
20
+ forms_1 = forms_1_1;
148
21
  },
149
- codeMirror: {
150
- fromTextArea: (el, opts) => {
151
- return new CodeMirrorBridge({
152
- extensions: [
153
- basicSetup,
154
- html({}),
155
- EditorView.lineWrapping
156
- ]
157
- }).fromTextArea(el, opts);
158
- }
22
+ function (dialog_1_1) {
23
+ dialog_1 = dialog_1_1;
159
24
  },
160
- codeMirrorOptions: {
161
- indentWithTabs: false,
162
- lineNumbers: true,
163
- lineWrapping: true,
164
- mode: 'text/html',
165
- tabMode: 'space',
166
- tabSize: 4
25
+ function (rxjs_1_1) {
26
+ rxjs_1 = rxjs_1_1;
167
27
  },
168
- fileInsertButtons: [
169
- 'fileBack',
170
- ],
171
- fileUploadURL: 'https://app.sitetheory.io/?session=' + cookie('SITETHEORY'),
172
- fontFamily: {
173
- 'Arial,Helvetica,sans-serif': 'Arial',
174
- 'Georgia,serif': 'Georgia',
175
- 'Impact,Charcoal,sans-serif': 'Impact',
176
- 'Tahoma,Geneva,sans-serif': 'Tahoma',
177
- '"Times New Roman",Times,serif': 'Times New Roman',
178
- 'Verdana,Geneva,sans-serif': 'Verdana'
28
+ function (operators_1_1) {
29
+ operators_1 = operators_1_1;
179
30
  },
180
- heightMax: window.innerHeight || document.documentElement.clientHeight || 500,
181
- htmlAllowedAttrs: [
182
- 'aria-.+',
183
- 'data-.+',
184
- 'ng-.+',
185
- 'stratus-.+',
186
- 'sa-.+',
187
- 'accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'allowfullscreen',
188
- 'allowtransparency', 'alt', 'async', 'autocomplete', 'autofocus',
189
- 'autoplay', 'autosave',
190
- 'background', 'bgcolor', 'border',
191
- 'charset', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'color',
192
- 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls',
193
- 'coords',
194
- 'data', 'datetime', 'default', 'defer', 'dir', 'dirname',
195
- 'disabled', 'download', 'draggable', 'dropzone',
196
- 'enctype',
197
- 'for', 'form', 'formaction', 'frameborder',
198
- 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'http-equiv',
199
- 'icon', 'id', 'ismap', 'itemprop',
200
- 'keytype', 'kind',
201
- 'label', 'lang', 'language', 'list', 'loop', 'low',
202
- 'max', 'maxlength', 'media', 'method', 'min', 'mozallowfullscreen', 'multiple',
203
- 'muted',
204
- 'name', 'novalidate',
205
- 'open', 'optimum',
206
- 'pattern', 'ping', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate',
207
- 'radiogroup', 'readonly', 'rel', 'required', 'reversed', 'rows', 'rowspan',
208
- 'sandbox', 'scope', 'scoped', 'scrolling', 'seamless', 'selected', 'shape',
209
- 'size', 'sizes', 'span', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step',
210
- 'summary', 'spellcheck', 'style',
211
- 'tabindex', 'target', 'title', 'type', 'translate',
212
- 'usemap',
213
- 'value', 'valign',
214
- 'webkitallowfullscreen', 'width', 'wrap',
215
- 'xmlns',
216
- 'xmlns:xlink',
217
- 'accent-height', 'accumulate', 'additive', 'alignment-baseline', 'alphabetic', 'amplitude', 'arabic-form', 'ascent',
218
- 'attributeName', 'attributeType', 'azimuth',
219
- 'baseFrequency', 'baseline-shift', 'baseProfile', 'bbox', 'begin', 'bias', 'by',
220
- 'calcMode', 'cap-height', 'clip', 'clipPathUnits', 'clip-path', 'clip-rule', 'color-interpolation',
221
- 'color-interpolation-filters', 'color-profile', 'color-rendering', 'contentScriptType', 'contentStyleType', 'crossorigin',
222
- 'cursor', 'cx', 'cy',
223
- 'd', 'decelerate', 'descent', 'diffuseConstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'dx', 'dy',
224
- 'edgeMode', 'elevation', 'enable-background', 'end', 'exponent', 'externalResourcesRequired',
225
- 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterRes', 'filterUnits', 'flood-color', 'flood-opacity', 'font-family',
226
- 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'format', 'from',
227
- 'fr', 'fx', 'fy',
228
- 'g1', 'g2', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'glyphRef', 'gradientTransform',
229
- 'gradientUnits',
230
- 'hanging', 'horiz-adv-x', 'horiz-origin-x',
231
- 'ideographic', 'image-rendering', 'in', 'in2', 'intercept',
232
- 'k', 'k1', 'k2', 'k3', 'k4', 'kernelMatrix', 'kernelUnitLength', 'kerning', 'keyPoints', 'keySplines', 'keyTimes',
233
- 'lengthAdjust', 'letter-spacing', 'lighting-color', 'limitingConeAngle', 'local',
234
- 'marker-end', 'marker-mid', 'marker-start', 'markerHeight', 'markerUnits', 'markerWidth', 'mask', 'maskContentUnits',
235
- 'maskUnits', 'mathematical', 'mode',
236
- 'numOctaves',
237
- 'offset', 'opacity', 'operator', 'order', 'orient', 'orientation', 'origin', 'overflow', 'overline-position',
238
- 'overline-thickness',
239
- 'panose-1', 'paint-order', 'path', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointer-events',
240
- 'points', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits',
241
- 'r', 'radius', 'referrerPolicy', 'refX', 'refY', 'rendering-intent', 'repeatCount', 'repeatDur', 'requiredExtensions',
242
- 'requiredFeatures', 'restart', 'result', 'rotate', 'rx', 'ry',
243
- 'scale', 'seed', 'shape-rendering', 'slope', 'spacing', 'specularConstant', 'specularExponent', 'speed', 'spreadMethod',
244
- 'startOffset', 'stdDeviation', 'stemh', 'stemv', 'stitchTiles', 'stop-color', 'stop-opacity', 'strikethrough-position',
245
- 'strikethrough-thickness', 'string', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin',
246
- 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'surfaceScale', 'systemLanguage',
247
- 'tableValues', 'targetX', 'targetY', 'text-anchor', 'text-decoration', 'text-rendering', 'textLength', 'to', 'transform',
248
- 'transform-origin',
249
- 'u1', 'u2', 'underline-position', 'underline-thickness', 'unicode', 'unicode-bidi', 'unicode-range', 'units-per-em',
250
- 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'values', 'vector-effect', 'version', 'vert-adv-y',
251
- 'vert-origin-x', 'vert-origin-y', 'viewBox', 'viewTarget', 'visibility',
252
- 'widths', 'word-spacing', 'writing-mode',
253
- 'x', 'x-height', 'x1', 'x2', 'xChannelSelector',
254
- 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show',
255
- 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space',
256
- 'y', 'y1', 'y2', 'yChannelSelector',
257
- 'z', 'zoomAndPan'
258
- ],
259
- htmlAllowedEmptyTags: [
260
- 'textarea', 'a', 'iframe', 'object', 'video', 'style', 'script',
261
- 'hr', 'div',
262
- 'animate', 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'defs', 'desc', 'discard', 'ellipse',
263
- 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
264
- 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG',
265
- 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset',
266
- 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence',
267
- 'filter', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'mpath',
268
- 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'stop', 'svg', 'switch',
269
- 'symbol', 'text', 'textPath', 'tspan', 'unknown', 'use', 'view',
270
- 'ng-app', 'ng-bind', 'ng-bind-html', 'ng-bind-template', 'ng-blur', 'ng-change', 'ng-checked', 'ng-class', 'ng-class-even',
271
- 'ng-class-odd', 'ng-click', 'ng-cloak', 'ng-controller', 'ng-copy', 'ng-csp', 'ng-cut', 'ng-dblclick', 'ng-disabled',
272
- 'ng-focus', 'ng-form', 'ng-hide', 'ng-href', 'ng-if', 'ng-include', 'ng-init', 'ng-jq', 'ng-keydown', 'ng-keypress', 'ng-keyup',
273
- 'ng-list', 'ng-maxlength', 'ng-minlength', 'ng-model', 'ng-model-options', 'ng-mousedown', 'ng-mouseenter', 'ng-mouseleave',
274
- 'ng-mousemove', 'ng-mouseover', 'ng-mouseup', 'ng-non-bindable', 'ng-on', 'ng-open', 'ng-options', 'ng-paste', 'ng-pattern',
275
- 'ng-pluralize', 'ng-prop', 'ng-readonly', 'ng-ref', 'ng-repeat', 'ng-required', 'ng-selected', 'ng-show', 'ng-src', 'ng-srcset',
276
- 'ng-style', 'ng-submit', 'ng-switch', 'ng-transclude', 'ng-value', 'ng-animate-children', 'ng-animate-swap', 'ng-outlet',
277
- 'ng-message', 'ng-message-default', 'ng-message-exp', 'ng-messages', 'ng-messages-include', 'ng-view', 'ng-swipe-left',
278
- 'ng-swipe-right',
279
- 'md-autocomplete', 'md-autofocus', 'md-button', 'md-calendar', 'md-card', 'md-checkbox', 'md-chip', 'md-chip-remove',
280
- 'md-chips', 'md-colors', 'md-contact-chips', 'md-content', 'md-datepicker', 'md-dialog', 'md-divider', 'md-fab-actions',
281
- 'md-fab-speed-dial', 'md-fab-toolbar', 'md-force-height', 'md-grid-list', 'md-grid-tile', 'md-highlight-text', 'md-icon',
282
- 'md-ink-ripple', 'md-input', 'md-input-container', 'md-list', 'md-list-item', 'md-menu', 'md-menu-bar', 'md-nav-bar',
283
- 'md-nav-item', 'md-optgroup', 'md-option', 'md-progress-circular', 'md-progress-linear', 'md-radio-button', 'md-radio-group',
284
- 'md-select', 'md-select-on-focus', 'md-sidenav', 'md-slider', 'md-slider-container', 'md-subheader', 'md-swipe-down',
285
- 'md-swipe-left', 'md-swipe-right', 'md-swipe-up', 'md-switch', 'md-tab', 'md-tabs', 'md-toolbar', 'md-tooltip', 'md-truncate',
286
- 'md-virtual-repeat', 'md-virtual-repeat-container', 'md-whiteframe',
287
- 'md-svg-src',
288
- 'stratus-citation-notitle',
289
- 'sa-boot',
290
- 'sa-editor',
291
- 'sa-map',
292
- 'sa-media-selector',
293
- 'sa-selector',
294
- 'sa-stripe-payment-method-list',
295
- 'sa-stripe-payment-method-selector',
296
- 'sa-tree',
297
- ],
298
- htmlAllowedStyleProps: [
299
- '.*'
300
- ],
301
- htmlAllowedTags: [
302
- 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio',
303
- 'b', 'base', 'bdi', 'bdo', 'blockquote', 'br', 'button',
304
- 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup',
305
- 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt',
306
- 'em', 'embed',
307
- 'fieldset', 'figcaption', 'figure', 'footer', 'form',
308
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',
309
- 'i', 'iframe', 'img', 'input', 'ins',
310
- 'kbd', 'keygen',
311
- 'label', 'legend', 'li', 'link',
312
- 'main', 'map', 'mark', 'menu', 'menuitem', 'meter',
313
- 'nav', 'noscript',
314
- 'object', 'ol', 'optgroup', 'option', 'output',
315
- 'p', 'param', 'pre', 'progress',
316
- 'queue',
317
- 'rp', 'rt', 'ruby',
318
- 's', 'samp', 'script', 'style', 'section', 'select', 'small',
319
- 'source', 'span', 'strike', 'strong', 'sub', 'summary', 'sup',
320
- 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track',
321
- 'u', 'ul',
322
- 'var', 'video',
323
- 'wbr',
324
- 'animate', 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'defs', 'desc', 'discard', 'ellipse',
325
- 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
326
- 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG',
327
- 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset',
328
- 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence',
329
- 'filter', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'mpath',
330
- 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'stop', 'svg', 'switch',
331
- 'symbol', 'text', 'textPath', 'tspan', 'unknown', 'use', 'view',
332
- 'ng-app', 'ng-bind', 'ng-bind-html', 'ng-bind-template', 'ng-blur', 'ng-change', 'ng-checked', 'ng-class', 'ng-class-even',
333
- 'ng-class-odd', 'ng-click', 'ng-cloak', 'ng-controller', 'ng-copy', 'ng-csp', 'ng-cut', 'ng-dblclick', 'ng-disabled',
334
- 'ng-focus', 'ng-form', 'ng-hide', 'ng-href', 'ng-if', 'ng-include', 'ng-init', 'ng-jq', 'ng-keydown', 'ng-keypress', 'ng-keyup',
335
- 'ng-list', 'ng-maxlength', 'ng-minlength', 'ng-model', 'ng-model-options', 'ng-mousedown', 'ng-mouseenter', 'ng-mouseleave',
336
- 'ng-mousemove', 'ng-mouseover', 'ng-mouseup', 'ng-non-bindable', 'ng-on', 'ng-open', 'ng-options', 'ng-paste', 'ng-pattern',
337
- 'ng-pluralize', 'ng-prop', 'ng-readonly', 'ng-ref', 'ng-repeat', 'ng-required', 'ng-selected', 'ng-show', 'ng-src', 'ng-srcset',
338
- 'ng-style', 'ng-submit', 'ng-switch', 'ng-transclude', 'ng-value', 'ng-animate-children', 'ng-animate-swap', 'ng-outlet',
339
- 'ng-message', 'ng-message-default', 'ng-message-exp', 'ng-messages', 'ng-messages-include', 'ng-view', 'ng-swipe-left',
340
- 'ng-swipe-right',
341
- 'md-autocomplete', 'md-autofocus', 'md-button', 'md-calendar', 'md-card', 'md-checkbox', 'md-chip', 'md-chip-remove',
342
- 'md-chips', 'md-colors', 'md-contact-chips', 'md-content', 'md-datepicker', 'md-dialog', 'md-divider', 'md-fab-actions',
343
- 'md-fab-speed-dial', 'md-fab-toolbar', 'md-force-height', 'md-grid-list', 'md-grid-tile', 'md-highlight-text', 'md-icon',
344
- 'md-ink-ripple', 'md-input', 'md-input-container', 'md-list', 'md-list-item', 'md-menu', 'md-menu-bar', 'md-nav-bar',
345
- 'md-nav-item', 'md-optgroup', 'md-option', 'md-progress-circular', 'md-progress-linear', 'md-radio-button', 'md-radio-group',
346
- 'md-select', 'md-select-on-focus', 'md-sidenav', 'md-slider', 'md-slider-container', 'md-subheader', 'md-swipe-down',
347
- 'md-swipe-left', 'md-swipe-right', 'md-swipe-up', 'md-switch', 'md-tab', 'md-tabs', 'md-toolbar', 'md-tooltip', 'md-truncate',
348
- 'md-virtual-repeat', 'md-virtual-repeat-container', 'md-whiteframe',
349
- 'md-svg-src',
350
- 'sa-boot',
351
- 'sa-editor',
352
- 'sa-map',
353
- 'sa-media-selector',
354
- 'sa-selector',
355
- 'sa-stripe-payment-method-list',
356
- 'sa-stripe-payment-method-selector',
357
- 'sa-tree',
358
- 'stratus-.+',
359
- ],
360
- htmlRemoveTags: [],
361
- htmlSimpleAmpersand: false,
362
- imageInsertButtons: [
363
- 'imageBack',
364
- '|',
365
- 'imageUpload',
366
- 'imageByURL',
367
- ],
368
- imageUpload: true,
369
- imageUploadRemoteUrls: true,
370
- imageUploadURL: 'https://app.sitetheory.io/?session=' + cookie('SITETHEORY'),
371
- imageManagerPageSize: 20,
372
- imageManagerScrollOffset: 10,
373
- imageManagerLoadMethod: 'GET',
374
- imageManagerLoadURL: '/Api/Media?payload-only=true',
375
- linkEditButtons: [
376
- 'linkOpen',
377
- 'linkManagerEdit',
378
- 'linkRemove',
379
- ],
380
- linkInsertButtons: [
381
- 'linkBack',
382
- ],
383
- multiLine: true,
384
- paragraphStyles: {
385
- btn: 'Button',
386
- header: 'Header',
387
- title: 'Title',
388
- 'alt-title': 'Alt Title (over)',
389
- subtitle: 'Subtitle',
390
- pullout: 'Pullout Quote',
31
+ function (platform_browser_1_1) {
32
+ platform_browser_1 = platform_browser_1_1;
391
33
  },
392
- pasteDeniedAttrs: [
393
- 'id',
394
- 'class',
395
- 'style',
396
- 'dir',
397
- 'data-.+',
398
- 'aria-.+',
399
- 'ng-.+',
400
- 'stratus-.+',
401
- 'sa-.+'
402
- ],
403
- pasteDeniedTags: [
404
- 'form', 'input', 'label',
405
- 'style'
406
- ],
407
- pastePlain: false,
408
- pluginsEnabled: [
409
- 'align',
410
- 'charCounter',
411
- 'codeBeautifier',
412
- 'codeView',
413
- 'colors',
414
- 'draggable',
415
- 'embedly',
416
- 'entities',
417
- 'file',
418
- 'fontAwesome',
419
- 'fontFamily',
420
- 'fontSize',
421
- 'fullscreen',
422
- 'help',
423
- 'image',
424
- 'imageTUI',
425
- 'inlineStyle',
426
- 'inlineClass',
427
- 'lineBreaker',
428
- 'link',
429
- 'linkManager',
430
- 'citationManager',
431
- 'lists',
432
- 'mediaManager',
433
- 'paragraphFormat',
434
- 'paragraphStyle',
435
- 'print',
436
- 'quickInsert',
437
- 'quote',
438
- 'save',
439
- 'specialCharacters',
440
- 'table',
441
- 'url',
442
- 'video',
443
- 'wordPaste',
444
- ],
445
- quickInsertButtons: [
446
- 'media',
447
- 'link',
448
- 'video',
449
- 'embedly',
450
- 'table',
451
- 'ul',
452
- 'ol',
453
- 'hr'
454
- ],
455
- scrollableContainer: Stratus.Environment.get('viewPort') || 'body',
456
- spellcheck: true,
457
- toolbarSticky: true,
458
- toolbarButtons: {
459
- moreText: {
460
- buttons: this.froalaStandardButtons.moreText,
461
- buttonsVisible: 3
462
- },
463
- moreParagraph: {
464
- buttons: this.froalaStandardButtons.moreParagraph,
465
- buttonsVisible: 8
466
- },
467
- moreRich: {
468
- buttons: this.froalaStandardButtons.moreRich,
469
- buttonsVisible: 1
470
- },
471
- moreMisc: {
472
- buttons: this.froalaStandardButtons.moreMisc,
473
- align: 'right',
474
- buttonsVisible: 1
475
- }
34
+ function (stratus_1_1) {
35
+ stratus_1 = stratus_1_1;
476
36
  },
477
- toolbarButtonsSM: {
478
- moreText: {
479
- buttons: this.froalaStandardButtons.moreText,
480
- buttonsVisible: 3
481
- },
482
- moreParagraph: {
483
- buttons: this.froalaStandardButtons.moreParagraph,
484
- buttonsVisible: 0
485
- },
486
- moreRich: {
487
- buttons: this.froalaStandardButtons.moreRich,
488
- buttonsVisible: 3
489
- },
490
- moreMisc: {
491
- buttons: this.froalaStandardButtons.moreMisc,
492
- align: 'right',
493
- buttonsVisible: 0
494
- }
37
+ function (lodash_1_1) {
38
+ lodash_1 = lodash_1_1;
495
39
  },
496
- toolbarButtonsXS: {
497
- moreText: {
498
- buttons: this.froalaStandardButtons.moreText,
499
- buttonsVisible: 0
500
- },
501
- moreParagraph: {
502
- buttons: this.froalaStandardButtons.moreParagraph,
503
- buttonsVisible: 0
504
- },
505
- moreRich: {
506
- buttons: this.froalaStandardButtons.moreRich,
507
- buttonsVisible: 0
508
- },
509
- moreMisc: {
510
- buttons: this.froalaStandardButtons.moreMisc,
511
- align: 'right',
512
- buttonsVisible: 0
513
- }
40
+ function (root_component_1_1) {
41
+ root_component_1 = root_component_1_1;
42
+ },
43
+ function (citation_dialog_component_1_1) {
44
+ citation_dialog_component_1 = citation_dialog_component_1_1;
45
+ },
46
+ function (link_dialog_component_1_1) {
47
+ link_dialog_component_1 = link_dialog_component_1_1;
48
+ },
49
+ function (media_dialog_component_1_1) {
50
+ media_dialog_component_1 = media_dialog_component_1_1;
51
+ },
52
+ function (code_view_dialog_component_1_1) {
53
+ code_view_dialog_component_1 = code_view_dialog_component_1_1;
54
+ },
55
+ function (code_mirror_bridge_1_1) {
56
+ code_mirror_bridge_1 = code_mirror_bridge_1_1;
57
+ },
58
+ function (registry_1_1) {
59
+ registry_1 = registry_1_1;
60
+ },
61
+ function (environment_1_1) {
62
+ environment_1 = environment_1_1;
63
+ },
64
+ function (eventManager_1_1) {
65
+ eventManager_1 = eventManager_1_1;
66
+ },
67
+ function (codemirror_1_1) {
68
+ codemirror_1 = codemirror_1_1;
69
+ },
70
+ function (lang_html_1_1) {
71
+ lang_html_1 = lang_html_1_1;
72
+ },
73
+ function (_1) {
74
+ },
75
+ function (_2) {
76
+ },
77
+ function (_3) {
78
+ },
79
+ function (_4) {
80
+ },
81
+ function (_5) {
82
+ },
83
+ function (_6) {
84
+ },
85
+ function (_7) {
86
+ },
87
+ function (_8) {
514
88
  },
515
- useClasses: true,
516
- videoInsertButtons: [
517
- 'videoBack',
518
- '|',
519
- 'videoByURL',
520
- 'videoEmbed',
521
- 'videoUpload',
522
- ],
523
- videoUpload: true,
524
- videoUploadURL: 'https://app.sitetheory.io/?session=' + cookie('SITETHEORY')
525
- };
526
- this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName)}_component_`);
527
- Stratus.Instances[this.uid] = this;
528
- Stratus.Internals.LoadCss([
529
- `${localDir}${moduleName}/${moduleName}.component${min}.css`,
530
- `${froalaDir}css/froala_editor.pkgd${min}.css`,
531
- `${froalaDir}css/third_party/embedly${min}.css`,
532
- `${froalaDir}css/third_party/font_awesome${min}.css`,
533
- `${froalaDir}css/third_party/image_tui${min}.css`,
534
- ]).then(() => {
535
- this.styled = true;
536
- this.refresh();
537
- }).catch((e) => {
538
- console.error(e);
539
- console.warn('Issue detected in CSS Loader for Component:', this.uid);
540
- this.styled = true;
541
- this.refresh();
542
- });
543
- this.hydrate(elementRef, sanitizer, ["title", "uid", "dev", "debug", "editor", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "property", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "initialized", "styled", "blurred", "focused", "codeViewIsOpen", "form", "dataChangeLog", "dataString", "debounceSave", "debounceTime", "forceSave", "froalaEditorDirective", "froalaButtons", "froalaStandardButtons", "froalaConfig", "sanitizer", "ref", "elementRef", "fb", "dialog", "ngOnInit", "modelSave", "listDuplicates", "normalizeIn", "normalizeOut", "changeImgSize", "handleError", "fetchData", "dataDefer", "dataRef", "onDataChange", "created", "changedEditor", "onChangeEvent", "onFocus", "onBlur", "bypassHTML", "trigger", "openCitationDialog", "openLinkDialog", "openMediaDialog", "openCodeViewDialog", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
544
- this.fetchData()
545
- .then(data => {
546
- if (!data || !(data instanceof EventManager)) {
547
- console.warn('Unable to bind data from Registry!');
548
- return;
89
+ function (_9) {
549
90
  }
550
- const onDataChange = () => {
551
- if (!data.completed) {
552
- return;
91
+ ],
92
+ execute: function () {
93
+ systemPackage = '@stratusjs/angular';
94
+ froalaPackage = 'froala-editor';
95
+ moduleName = 'editor';
96
+ min = !environment_1.cookie('env') ? '.min' : '';
97
+ localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
98
+ froalaDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[froalaPackage].replace(/js\/[^\/]*$/, '')}`;
99
+ has = (object, path) => lodash_1.default.has(object, path) && !lodash_1.default.isEmpty(lodash_1.default.get(object, path));
100
+ EditorComponent = class EditorComponent extends root_component_1.RootComponent {
101
+ constructor(sanitizer, ref, elementRef, fb, dialog) {
102
+ super();
103
+ this.sanitizer = sanitizer;
104
+ this.ref = ref;
105
+ this.elementRef = elementRef;
106
+ this.fb = fb;
107
+ this.dialog = dialog;
108
+ this.title = moduleName + '_component';
109
+ this.dev = !!environment_1.cookie('env');
110
+ this.editor = 'froala';
111
+ this._ = lodash_1.default;
112
+ this.has = has;
113
+ this.log = console.log;
114
+ this.Stratus = stratus_1.Stratus;
115
+ this.registry = new registry_1.Registry();
116
+ this.onChange = new rxjs_1.Subject();
117
+ this.svgIcons = {};
118
+ this.initialized = false;
119
+ this.styled = false;
120
+ this.blurred = false;
121
+ this.focused = false;
122
+ this.form = this.fb.group({
123
+ dataString: new forms_1.FormControl(),
124
+ });
125
+ this.dataChangeLog = [];
126
+ this.dataString = '';
127
+ this.debounceSave = true;
128
+ this.debounceTime = 5000;
129
+ this.forceSave = true;
130
+ this.froalaButtons = [
131
+ 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|', 'formatBlock',
132
+ 'blockStyle', 'inlineStyle', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL',
133
+ 'formatUL', 'outdent', 'indent', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertFile',
134
+ 'insertTable', '|', 'undo', 'redo', 'removeFormat', 'wordPaste', 'help', 'html', 'fullscreen'
135
+ ];
136
+ this.froalaStandardButtons = {
137
+ moreText: [
138
+ 'bold',
139
+ 'italic',
140
+ 'underline',
141
+ 'strikeThrough',
142
+ 'subscript',
143
+ 'superscript',
144
+ 'fontFamily',
145
+ 'fontSize',
146
+ 'textColor',
147
+ 'backgroundColor',
148
+ 'inlineClass',
149
+ 'inlineStyle',
150
+ 'clearFormatting'
151
+ ],
152
+ moreParagraph: [
153
+ 'linkManager',
154
+ 'formatOL',
155
+ 'formatUL',
156
+ 'indent',
157
+ 'outdent',
158
+ 'quote',
159
+ 'paragraphFormat',
160
+ 'paragraphStyle',
161
+ 'alignLeft',
162
+ 'alignCenter',
163
+ 'alignRight',
164
+ 'alignJustify',
165
+ ],
166
+ moreRich: [
167
+ 'mediaManager',
168
+ 'insertTable',
169
+ 'insertImage',
170
+ 'insertVideo',
171
+ 'insertFile',
172
+ 'citationInsert',
173
+ 'insertHR',
174
+ 'specialCharacters',
175
+ ],
176
+ moreMisc: [
177
+ 'html',
178
+ 'undo',
179
+ 'redo',
180
+ 'fullscreen',
181
+ 'print',
182
+ 'selectAll',
183
+ 'help'
184
+ ],
185
+ };
186
+ this.froalaConfig = {
187
+ attribution: false,
188
+ key: stratus_1.Stratus.Environment.get('froalaKey'),
189
+ zIndex: 9999,
190
+ events: {
191
+ initialized: (froalaEditorDirective) => {
192
+ this.froalaEditorDirective = froalaEditorDirective;
193
+ },
194
+ },
195
+ codeBeautifierOptions: {
196
+ end_with_newline: true,
197
+ indent_inner_html: true,
198
+ extra_liners: '["p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "pre", "ul", "ol", "table", "dl"]',
199
+ brace_style: 'expand',
200
+ indent_char: ' ',
201
+ indent_size: 4,
202
+ wrap_line_length: 0
203
+ },
204
+ codeMirror: {
205
+ fromTextArea: (el, opts) => {
206
+ return new code_mirror_bridge_1.CodeMirrorBridge({
207
+ extensions: [
208
+ codemirror_1.basicSetup,
209
+ lang_html_1.html({}),
210
+ codemirror_1.EditorView.lineWrapping
211
+ ]
212
+ }).fromTextArea(el, opts);
213
+ }
214
+ },
215
+ codeMirrorOptions: {
216
+ indentWithTabs: false,
217
+ lineNumbers: true,
218
+ lineWrapping: true,
219
+ mode: 'text/html',
220
+ tabMode: 'space',
221
+ tabSize: 4
222
+ },
223
+ fileInsertButtons: [
224
+ 'fileBack',
225
+ ],
226
+ fileUploadURL: 'https://app.sitetheory.io/?session=' + environment_1.cookie('SITETHEORY'),
227
+ fontFamily: {
228
+ 'Arial,Helvetica,sans-serif': 'Arial',
229
+ 'Georgia,serif': 'Georgia',
230
+ 'Impact,Charcoal,sans-serif': 'Impact',
231
+ 'Tahoma,Geneva,sans-serif': 'Tahoma',
232
+ '"Times New Roman",Times,serif': 'Times New Roman',
233
+ 'Verdana,Geneva,sans-serif': 'Verdana'
234
+ },
235
+ heightMax: window.innerHeight || document.documentElement.clientHeight || 500,
236
+ htmlAllowedAttrs: [
237
+ 'aria-.+',
238
+ 'data-.+',
239
+ 'ng-.+',
240
+ 'stratus-.+',
241
+ 'sa-.+',
242
+ 'accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'allowfullscreen',
243
+ 'allowtransparency', 'alt', 'async', 'autocomplete', 'autofocus',
244
+ 'autoplay', 'autosave',
245
+ 'background', 'bgcolor', 'border',
246
+ 'charset', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'color',
247
+ 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls',
248
+ 'coords',
249
+ 'data', 'datetime', 'default', 'defer', 'dir', 'dirname',
250
+ 'disabled', 'download', 'draggable', 'dropzone',
251
+ 'enctype',
252
+ 'for', 'form', 'formaction', 'frameborder',
253
+ 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'http-equiv',
254
+ 'icon', 'id', 'ismap', 'itemprop',
255
+ 'keytype', 'kind',
256
+ 'label', 'lang', 'language', 'list', 'loop', 'low',
257
+ 'max', 'maxlength', 'media', 'method', 'min', 'mozallowfullscreen', 'multiple',
258
+ 'muted',
259
+ 'name', 'novalidate',
260
+ 'open', 'optimum',
261
+ 'pattern', 'ping', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate',
262
+ 'radiogroup', 'readonly', 'rel', 'required', 'reversed', 'rows', 'rowspan',
263
+ 'sandbox', 'scope', 'scoped', 'scrolling', 'seamless', 'selected', 'shape',
264
+ 'size', 'sizes', 'span', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step',
265
+ 'summary', 'spellcheck', 'style',
266
+ 'tabindex', 'target', 'title', 'type', 'translate',
267
+ 'usemap',
268
+ 'value', 'valign',
269
+ 'webkitallowfullscreen', 'width', 'wrap',
270
+ 'xmlns',
271
+ 'xmlns:xlink',
272
+ 'accent-height', 'accumulate', 'additive', 'alignment-baseline', 'alphabetic', 'amplitude', 'arabic-form', 'ascent',
273
+ 'attributeName', 'attributeType', 'azimuth',
274
+ 'baseFrequency', 'baseline-shift', 'baseProfile', 'bbox', 'begin', 'bias', 'by',
275
+ 'calcMode', 'cap-height', 'clip', 'clipPathUnits', 'clip-path', 'clip-rule', 'color-interpolation',
276
+ 'color-interpolation-filters', 'color-profile', 'color-rendering', 'contentScriptType', 'contentStyleType', 'crossorigin',
277
+ 'cursor', 'cx', 'cy',
278
+ 'd', 'decelerate', 'descent', 'diffuseConstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'dx', 'dy',
279
+ 'edgeMode', 'elevation', 'enable-background', 'end', 'exponent', 'externalResourcesRequired',
280
+ 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterRes', 'filterUnits', 'flood-color', 'flood-opacity', 'font-family',
281
+ 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'format', 'from',
282
+ 'fr', 'fx', 'fy',
283
+ 'g1', 'g2', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'glyphRef', 'gradientTransform',
284
+ 'gradientUnits',
285
+ 'hanging', 'horiz-adv-x', 'horiz-origin-x',
286
+ 'ideographic', 'image-rendering', 'in', 'in2', 'intercept',
287
+ 'k', 'k1', 'k2', 'k3', 'k4', 'kernelMatrix', 'kernelUnitLength', 'kerning', 'keyPoints', 'keySplines', 'keyTimes',
288
+ 'lengthAdjust', 'letter-spacing', 'lighting-color', 'limitingConeAngle', 'local',
289
+ 'marker-end', 'marker-mid', 'marker-start', 'markerHeight', 'markerUnits', 'markerWidth', 'mask', 'maskContentUnits',
290
+ 'maskUnits', 'mathematical', 'mode',
291
+ 'numOctaves',
292
+ 'offset', 'opacity', 'operator', 'order', 'orient', 'orientation', 'origin', 'overflow', 'overline-position',
293
+ 'overline-thickness',
294
+ 'panose-1', 'paint-order', 'path', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointer-events',
295
+ 'points', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits',
296
+ 'r', 'radius', 'referrerPolicy', 'refX', 'refY', 'rendering-intent', 'repeatCount', 'repeatDur', 'requiredExtensions',
297
+ 'requiredFeatures', 'restart', 'result', 'rotate', 'rx', 'ry',
298
+ 'scale', 'seed', 'shape-rendering', 'slope', 'spacing', 'specularConstant', 'specularExponent', 'speed', 'spreadMethod',
299
+ 'startOffset', 'stdDeviation', 'stemh', 'stemv', 'stitchTiles', 'stop-color', 'stop-opacity', 'strikethrough-position',
300
+ 'strikethrough-thickness', 'string', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin',
301
+ 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'surfaceScale', 'systemLanguage',
302
+ 'tableValues', 'targetX', 'targetY', 'text-anchor', 'text-decoration', 'text-rendering', 'textLength', 'to', 'transform',
303
+ 'transform-origin',
304
+ 'u1', 'u2', 'underline-position', 'underline-thickness', 'unicode', 'unicode-bidi', 'unicode-range', 'units-per-em',
305
+ 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'values', 'vector-effect', 'version', 'vert-adv-y',
306
+ 'vert-origin-x', 'vert-origin-y', 'viewBox', 'viewTarget', 'visibility',
307
+ 'widths', 'word-spacing', 'writing-mode',
308
+ 'x', 'x-height', 'x1', 'x2', 'xChannelSelector',
309
+ 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show',
310
+ 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space',
311
+ 'y', 'y1', 'y2', 'yChannelSelector',
312
+ 'z', 'zoomAndPan'
313
+ ],
314
+ htmlAllowedEmptyTags: [
315
+ 'textarea', 'a', 'iframe', 'object', 'video', 'style', 'script',
316
+ 'hr', 'div',
317
+ 'animate', 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'defs', 'desc', 'discard', 'ellipse',
318
+ 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
319
+ 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG',
320
+ 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset',
321
+ 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence',
322
+ 'filter', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'mpath',
323
+ 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'stop', 'svg', 'switch',
324
+ 'symbol', 'text', 'textPath', 'tspan', 'unknown', 'use', 'view',
325
+ 'ng-app', 'ng-bind', 'ng-bind-html', 'ng-bind-template', 'ng-blur', 'ng-change', 'ng-checked', 'ng-class', 'ng-class-even',
326
+ 'ng-class-odd', 'ng-click', 'ng-cloak', 'ng-controller', 'ng-copy', 'ng-csp', 'ng-cut', 'ng-dblclick', 'ng-disabled',
327
+ 'ng-focus', 'ng-form', 'ng-hide', 'ng-href', 'ng-if', 'ng-include', 'ng-init', 'ng-jq', 'ng-keydown', 'ng-keypress', 'ng-keyup',
328
+ 'ng-list', 'ng-maxlength', 'ng-minlength', 'ng-model', 'ng-model-options', 'ng-mousedown', 'ng-mouseenter', 'ng-mouseleave',
329
+ 'ng-mousemove', 'ng-mouseover', 'ng-mouseup', 'ng-non-bindable', 'ng-on', 'ng-open', 'ng-options', 'ng-paste', 'ng-pattern',
330
+ 'ng-pluralize', 'ng-prop', 'ng-readonly', 'ng-ref', 'ng-repeat', 'ng-required', 'ng-selected', 'ng-show', 'ng-src', 'ng-srcset',
331
+ 'ng-style', 'ng-submit', 'ng-switch', 'ng-transclude', 'ng-value', 'ng-animate-children', 'ng-animate-swap', 'ng-outlet',
332
+ 'ng-message', 'ng-message-default', 'ng-message-exp', 'ng-messages', 'ng-messages-include', 'ng-view', 'ng-swipe-left',
333
+ 'ng-swipe-right',
334
+ 'md-autocomplete', 'md-autofocus', 'md-button', 'md-calendar', 'md-card', 'md-checkbox', 'md-chip', 'md-chip-remove',
335
+ 'md-chips', 'md-colors', 'md-contact-chips', 'md-content', 'md-datepicker', 'md-dialog', 'md-divider', 'md-fab-actions',
336
+ 'md-fab-speed-dial', 'md-fab-toolbar', 'md-force-height', 'md-grid-list', 'md-grid-tile', 'md-highlight-text', 'md-icon',
337
+ 'md-ink-ripple', 'md-input', 'md-input-container', 'md-list', 'md-list-item', 'md-menu', 'md-menu-bar', 'md-nav-bar',
338
+ 'md-nav-item', 'md-optgroup', 'md-option', 'md-progress-circular', 'md-progress-linear', 'md-radio-button', 'md-radio-group',
339
+ 'md-select', 'md-select-on-focus', 'md-sidenav', 'md-slider', 'md-slider-container', 'md-subheader', 'md-swipe-down',
340
+ 'md-swipe-left', 'md-swipe-right', 'md-swipe-up', 'md-switch', 'md-tab', 'md-tabs', 'md-toolbar', 'md-tooltip', 'md-truncate',
341
+ 'md-virtual-repeat', 'md-virtual-repeat-container', 'md-whiteframe',
342
+ 'md-svg-src',
343
+ 'stratus-citation-notitle',
344
+ 'sa-boot',
345
+ 'sa-editor',
346
+ 'sa-map',
347
+ 'sa-media-selector',
348
+ 'sa-selector',
349
+ 'sa-stripe-payment-method-list',
350
+ 'sa-stripe-payment-method-selector',
351
+ 'sa-tree',
352
+ ],
353
+ htmlAllowedStyleProps: [
354
+ '.*'
355
+ ],
356
+ htmlAllowedTags: [
357
+ 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio',
358
+ 'b', 'base', 'bdi', 'bdo', 'blockquote', 'br', 'button',
359
+ 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup',
360
+ 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt',
361
+ 'em', 'embed',
362
+ 'fieldset', 'figcaption', 'figure', 'footer', 'form',
363
+ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',
364
+ 'i', 'iframe', 'img', 'input', 'ins',
365
+ 'kbd', 'keygen',
366
+ 'label', 'legend', 'li', 'link',
367
+ 'main', 'map', 'mark', 'menu', 'menuitem', 'meter',
368
+ 'nav', 'noscript',
369
+ 'object', 'ol', 'optgroup', 'option', 'output',
370
+ 'p', 'param', 'pre', 'progress',
371
+ 'queue',
372
+ 'rp', 'rt', 'ruby',
373
+ 's', 'samp', 'script', 'style', 'section', 'select', 'small',
374
+ 'source', 'span', 'strike', 'strong', 'sub', 'summary', 'sup',
375
+ 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track',
376
+ 'u', 'ul',
377
+ 'var', 'video',
378
+ 'wbr',
379
+ 'animate', 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'defs', 'desc', 'discard', 'ellipse',
380
+ 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
381
+ 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG',
382
+ 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset',
383
+ 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence',
384
+ 'filter', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'mpath',
385
+ 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'stop', 'svg', 'switch',
386
+ 'symbol', 'text', 'textPath', 'tspan', 'unknown', 'use', 'view',
387
+ 'ng-app', 'ng-bind', 'ng-bind-html', 'ng-bind-template', 'ng-blur', 'ng-change', 'ng-checked', 'ng-class', 'ng-class-even',
388
+ 'ng-class-odd', 'ng-click', 'ng-cloak', 'ng-controller', 'ng-copy', 'ng-csp', 'ng-cut', 'ng-dblclick', 'ng-disabled',
389
+ 'ng-focus', 'ng-form', 'ng-hide', 'ng-href', 'ng-if', 'ng-include', 'ng-init', 'ng-jq', 'ng-keydown', 'ng-keypress', 'ng-keyup',
390
+ 'ng-list', 'ng-maxlength', 'ng-minlength', 'ng-model', 'ng-model-options', 'ng-mousedown', 'ng-mouseenter', 'ng-mouseleave',
391
+ 'ng-mousemove', 'ng-mouseover', 'ng-mouseup', 'ng-non-bindable', 'ng-on', 'ng-open', 'ng-options', 'ng-paste', 'ng-pattern',
392
+ 'ng-pluralize', 'ng-prop', 'ng-readonly', 'ng-ref', 'ng-repeat', 'ng-required', 'ng-selected', 'ng-show', 'ng-src', 'ng-srcset',
393
+ 'ng-style', 'ng-submit', 'ng-switch', 'ng-transclude', 'ng-value', 'ng-animate-children', 'ng-animate-swap', 'ng-outlet',
394
+ 'ng-message', 'ng-message-default', 'ng-message-exp', 'ng-messages', 'ng-messages-include', 'ng-view', 'ng-swipe-left',
395
+ 'ng-swipe-right',
396
+ 'md-autocomplete', 'md-autofocus', 'md-button', 'md-calendar', 'md-card', 'md-checkbox', 'md-chip', 'md-chip-remove',
397
+ 'md-chips', 'md-colors', 'md-contact-chips', 'md-content', 'md-datepicker', 'md-dialog', 'md-divider', 'md-fab-actions',
398
+ 'md-fab-speed-dial', 'md-fab-toolbar', 'md-force-height', 'md-grid-list', 'md-grid-tile', 'md-highlight-text', 'md-icon',
399
+ 'md-ink-ripple', 'md-input', 'md-input-container', 'md-list', 'md-list-item', 'md-menu', 'md-menu-bar', 'md-nav-bar',
400
+ 'md-nav-item', 'md-optgroup', 'md-option', 'md-progress-circular', 'md-progress-linear', 'md-radio-button', 'md-radio-group',
401
+ 'md-select', 'md-select-on-focus', 'md-sidenav', 'md-slider', 'md-slider-container', 'md-subheader', 'md-swipe-down',
402
+ 'md-swipe-left', 'md-swipe-right', 'md-swipe-up', 'md-switch', 'md-tab', 'md-tabs', 'md-toolbar', 'md-tooltip', 'md-truncate',
403
+ 'md-virtual-repeat', 'md-virtual-repeat-container', 'md-whiteframe',
404
+ 'md-svg-src',
405
+ 'sa-boot',
406
+ 'sa-editor',
407
+ 'sa-map',
408
+ 'sa-media-selector',
409
+ 'sa-selector',
410
+ 'sa-stripe-payment-method-list',
411
+ 'sa-stripe-payment-method-selector',
412
+ 'sa-tree',
413
+ 'stratus-.+',
414
+ ],
415
+ htmlRemoveTags: [],
416
+ htmlSimpleAmpersand: false,
417
+ imageInsertButtons: [
418
+ 'imageBack',
419
+ '|',
420
+ 'imageUpload',
421
+ 'imageByURL',
422
+ ],
423
+ imageUpload: true,
424
+ imageUploadRemoteUrls: true,
425
+ imageUploadURL: 'https://app.sitetheory.io/?session=' + environment_1.cookie('SITETHEORY'),
426
+ imageManagerPageSize: 20,
427
+ imageManagerScrollOffset: 10,
428
+ imageManagerLoadMethod: 'GET',
429
+ imageManagerLoadURL: '/Api/Media?payload-only=true',
430
+ linkEditButtons: [
431
+ 'linkOpen',
432
+ 'linkManagerEdit',
433
+ 'linkRemove',
434
+ ],
435
+ linkInsertButtons: [
436
+ 'linkBack',
437
+ ],
438
+ multiLine: true,
439
+ paragraphStyles: {
440
+ btn: 'Button',
441
+ header: 'Header',
442
+ title: 'Title',
443
+ 'alt-title': 'Alt Title (over)',
444
+ subtitle: 'Subtitle',
445
+ pullout: 'Pullout Quote',
446
+ },
447
+ pasteDeniedAttrs: [
448
+ 'id',
449
+ 'class',
450
+ 'style',
451
+ 'dir',
452
+ 'data-.+',
453
+ 'aria-.+',
454
+ 'ng-.+',
455
+ 'stratus-.+',
456
+ 'sa-.+'
457
+ ],
458
+ pasteDeniedTags: [
459
+ 'form', 'input', 'label',
460
+ 'style'
461
+ ],
462
+ pastePlain: false,
463
+ pluginsEnabled: [
464
+ 'align',
465
+ 'charCounter',
466
+ 'codeBeautifier',
467
+ 'codeView',
468
+ 'colors',
469
+ 'draggable',
470
+ 'embedly',
471
+ 'entities',
472
+ 'file',
473
+ 'fontAwesome',
474
+ 'fontFamily',
475
+ 'fontSize',
476
+ 'fullscreen',
477
+ 'help',
478
+ 'image',
479
+ 'imageTUI',
480
+ 'inlineStyle',
481
+ 'inlineClass',
482
+ 'lineBreaker',
483
+ 'link',
484
+ 'linkManager',
485
+ 'citationManager',
486
+ 'lists',
487
+ 'mediaManager',
488
+ 'paragraphFormat',
489
+ 'paragraphStyle',
490
+ 'print',
491
+ 'quickInsert',
492
+ 'quote',
493
+ 'save',
494
+ 'specialCharacters',
495
+ 'table',
496
+ 'url',
497
+ 'video',
498
+ 'wordPaste',
499
+ ],
500
+ quickInsertButtons: [
501
+ 'media',
502
+ 'link',
503
+ 'video',
504
+ 'embedly',
505
+ 'table',
506
+ 'ul',
507
+ 'ol',
508
+ 'hr'
509
+ ],
510
+ scrollableContainer: stratus_1.Stratus.Environment.get('viewPort') || 'body',
511
+ spellcheck: true,
512
+ toolbarSticky: true,
513
+ toolbarButtons: {
514
+ moreText: {
515
+ buttons: this.froalaStandardButtons.moreText,
516
+ buttonsVisible: 3
517
+ },
518
+ moreParagraph: {
519
+ buttons: this.froalaStandardButtons.moreParagraph,
520
+ buttonsVisible: 8
521
+ },
522
+ moreRich: {
523
+ buttons: this.froalaStandardButtons.moreRich,
524
+ buttonsVisible: 1
525
+ },
526
+ moreMisc: {
527
+ buttons: this.froalaStandardButtons.moreMisc,
528
+ align: 'right',
529
+ buttonsVisible: 1
530
+ }
531
+ },
532
+ toolbarButtonsSM: {
533
+ moreText: {
534
+ buttons: this.froalaStandardButtons.moreText,
535
+ buttonsVisible: 3
536
+ },
537
+ moreParagraph: {
538
+ buttons: this.froalaStandardButtons.moreParagraph,
539
+ buttonsVisible: 0
540
+ },
541
+ moreRich: {
542
+ buttons: this.froalaStandardButtons.moreRich,
543
+ buttonsVisible: 3
544
+ },
545
+ moreMisc: {
546
+ buttons: this.froalaStandardButtons.moreMisc,
547
+ align: 'right',
548
+ buttonsVisible: 0
549
+ }
550
+ },
551
+ toolbarButtonsXS: {
552
+ moreText: {
553
+ buttons: this.froalaStandardButtons.moreText,
554
+ buttonsVisible: 0
555
+ },
556
+ moreParagraph: {
557
+ buttons: this.froalaStandardButtons.moreParagraph,
558
+ buttonsVisible: 0
559
+ },
560
+ moreRich: {
561
+ buttons: this.froalaStandardButtons.moreRich,
562
+ buttonsVisible: 0
563
+ },
564
+ moreMisc: {
565
+ buttons: this.froalaStandardButtons.moreMisc,
566
+ align: 'right',
567
+ buttonsVisible: 0
568
+ }
569
+ },
570
+ useClasses: true,
571
+ videoInsertButtons: [
572
+ 'videoBack',
573
+ '|',
574
+ 'videoByURL',
575
+ 'videoEmbed',
576
+ 'videoUpload',
577
+ ],
578
+ videoUpload: true,
579
+ videoUploadURL: 'https://app.sitetheory.io/?session=' + environment_1.cookie('SITETHEORY')
580
+ };
581
+ this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
582
+ stratus_1.Stratus.Instances[this.uid] = this;
583
+ stratus_1.Stratus.Internals.LoadCss([
584
+ `${localDir}${moduleName}/${moduleName}.component${min}.css`,
585
+ `${froalaDir}css/froala_editor.pkgd${min}.css`,
586
+ `${froalaDir}css/third_party/embedly${min}.css`,
587
+ `${froalaDir}css/third_party/font_awesome${min}.css`,
588
+ `${froalaDir}css/third_party/image_tui${min}.css`,
589
+ ]).then(() => {
590
+ this.styled = true;
591
+ this.refresh();
592
+ }).catch((e) => {
593
+ console.error(e);
594
+ console.warn('Issue detected in CSS Loader for Component:', this.uid);
595
+ this.styled = true;
596
+ this.refresh();
597
+ });
598
+ this.hydrate(elementRef, sanitizer, ["title", "uid", "dev", "debug", "editor", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "property", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "initialized", "styled", "blurred", "focused", "codeViewIsOpen", "form", "dataChangeLog", "dataString", "debounceSave", "debounceTime", "forceSave", "froalaEditorDirective", "froalaButtons", "froalaStandardButtons", "froalaConfig", "sanitizer", "ref", "elementRef", "fb", "dialog", "ngOnInit", "modelSave", "listDuplicates", "normalizeIn", "normalizeOut", "changeImgSize", "handleError", "fetchData", "dataDefer", "dataRef", "onDataChange", "created", "changedEditor", "onChangeEvent", "onFocus", "onBlur", "bypassHTML", "trigger", "openCitationDialog", "openLinkDialog", "openMediaDialog", "openCodeViewDialog", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
599
+ this.fetchData()
600
+ .then(data => {
601
+ if (!data || !(data instanceof eventManager_1.EventManager)) {
602
+ console.warn('Unable to bind data from Registry!');
603
+ return;
604
+ }
605
+ const onDataChange = () => {
606
+ if (!data.completed) {
607
+ return;
608
+ }
609
+ this.dataDefer(this.subscriber);
610
+ if (this.codeViewIsOpen) {
611
+ return;
612
+ }
613
+ };
614
+ data.on('change', onDataChange);
615
+ onDataChange();
616
+ });
617
+ this.dataSub = new rxjs_1.Observable(subscriber => {
618
+ if (this.dev) {
619
+ console.warn(`[observable] creating subscriber on ${this.uid}`, subscriber);
620
+ }
621
+ return this.dataDefer(subscriber);
622
+ });
623
+ this.dataSub.pipe(operators_1.debounce(() => rxjs_1.timer(250)), operators_1.catchError(this.handleError)).subscribe(evt => {
624
+ if (this.focused) {
625
+ if (this.dev) {
626
+ console.warn(`[subscriber] waiting on updates due to focus on ${this.uid}`);
627
+ }
628
+ return;
629
+ }
630
+ const dataControl = this.form.get('dataString');
631
+ if (dataControl.value === evt) {
632
+ if (this.initialized) {
633
+ this.refresh();
634
+ }
635
+ return;
636
+ }
637
+ dataControl.patchValue(evt);
638
+ this.refresh();
639
+ });
553
640
  }
554
- this.dataDefer(this.subscriber);
555
- if (this.codeViewIsOpen) {
556
- return;
641
+ ngOnInit() {
642
+ this.initialized = true;
643
+ const dataControl = this.form.get('dataString');
644
+ if (this.debounceSave) {
645
+ dataControl.valueChanges.pipe(operators_1.debounce(() => rxjs_1.timer(this.debounceTime)), operators_1.catchError(this.handleError)).subscribe((evt) => this.modelSave(evt));
646
+ dataControl.valueChanges.pipe(operators_1.debounce(() => rxjs_1.timer(250)), operators_1.catchError(this.handleError)).subscribe((evt) => {
647
+ if (this.model.changedExternal) {
648
+ return;
649
+ }
650
+ this.model.changedExternal = true;
651
+ this.model.trigger('change');
652
+ });
653
+ }
654
+ else {
655
+ dataControl.valueChanges.forEach((value) => this.modelSave(value));
656
+ }
657
+ if (this.dev) {
658
+ this.listDuplicates(this.froalaConfig);
659
+ }
557
660
  }
558
- };
559
- data.on('change', onDataChange);
560
- onDataChange();
561
- });
562
- this.dataSub = new Observable(subscriber => {
563
- if (this.dev) {
564
- console.warn(`[observable] creating subscriber on ${this.uid}`, subscriber);
565
- }
566
- return this.dataDefer(subscriber);
567
- });
568
- this.dataSub.pipe(debounce(() => timer(250)), catchError(this.handleError)).subscribe(evt => {
569
- if (this.focused) {
570
- if (this.dev) {
571
- console.warn(`[subscriber] waiting on updates due to focus on ${this.uid}`);
661
+ modelSave(value) {
662
+ if (!this.model.completed) {
663
+ return;
664
+ }
665
+ let innerHTML = null;
666
+ if (!this.froalaConfig.useClasses
667
+ && this.froalaEditorDirective
668
+ && this.froalaEditorDirective.getEditor()
669
+ && this.froalaEditorDirective.getEditor().el
670
+ && this.froalaEditorDirective.getEditor().el.innerHTML) {
671
+ innerHTML = this.froalaEditorDirective.getEditor().el.innerHTML;
672
+ }
673
+ this.model.set(this.property, this.normalizeOut(innerHTML || value));
674
+ this.model.changedExternal = false;
675
+ if (this.forceSave && !lodash_1.default.isEmpty(this.model.getIdentifier())) {
676
+ this.model.save();
677
+ }
572
678
  }
573
- return;
574
- }
575
- const dataControl = this.form.get('dataString');
576
- if (dataControl.value === evt) {
577
- if (this.initialized) {
679
+ listDuplicates(data) {
680
+ lodash_1.default.forEach(data, (value, key) => {
681
+ if (!lodash_1.default.isArray(value)) {
682
+ return;
683
+ }
684
+ const catalog = {};
685
+ value.forEach((e) => catalog[e] = (catalog[e] || 0) + 1);
686
+ const duplicates = lodash_1.default.filter(lodash_1.default.map(catalog, ((v, k) => v > 1 ? k : null)));
687
+ if (!duplicates.length) {
688
+ return;
689
+ }
690
+ console.warn('Froala Config:', key, 'has duplicates:', duplicates);
691
+ });
692
+ return data;
693
+ }
694
+ normalizeIn(data) {
695
+ if (!data || !lodash_1.default.isString(data)) {
696
+ return '';
697
+ }
698
+ return this.changeImgSize(data, 'hq');
699
+ }
700
+ normalizeOut(data) {
701
+ if (data === null) {
702
+ return '';
703
+ }
704
+ if (!lodash_1.default.isString(data)) {
705
+ return data;
706
+ }
707
+ return this.changeImgSize(data, 'xs');
708
+ }
709
+ changeImgSize(data, size) {
710
+ if (!data || !lodash_1.default.isString(data)) {
711
+ return data;
712
+ }
713
+ if (!size || !lodash_1.default.isString(size)) {
714
+ return data;
715
+ }
716
+ const imgRegex = /<img([\w\W]+?)>/gi;
717
+ let imgMatch;
718
+ while (imgMatch = imgRegex.exec(data)) {
719
+ const el = imgMatch[0];
720
+ if (el.includes('data:image')) {
721
+ continue;
722
+ }
723
+ const srcRegex = /^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi;
724
+ const srcMatch = srcRegex.exec(el);
725
+ if (srcMatch === null) {
726
+ console.warn('Unable to find file name for image src:', el);
727
+ continue;
728
+ }
729
+ if (!el.includes('data-stratus-src')) {
730
+ if (!el.includes('cdn.sitetheory.io')) {
731
+ continue;
732
+ }
733
+ if (lodash_1.default.isEmpty(srcMatch[2])) {
734
+ continue;
735
+ }
736
+ data = data.replace(el, `<img data-stratus-src ${srcMatch[1]}-${size}.${srcMatch[3]}>`);
737
+ continue;
738
+ }
739
+ data = data.replace(el, `<img ${srcMatch[1]}-${size}.${srcMatch[3]}>`);
740
+ }
741
+ return data;
742
+ }
743
+ handleError(err) {
744
+ console.error(err);
745
+ return err;
746
+ }
747
+ fetchData() {
748
+ if (this.fetched) {
749
+ return this.fetched;
750
+ }
751
+ return this.fetched = this.registry.fetch(stratus_1.Stratus.Select(this.elementRef.nativeElement), this);
752
+ }
753
+ dataDefer(subscriber) {
754
+ this.subscriber = this.subscriber || subscriber;
755
+ if (!this.subscriber) {
756
+ if (this.dev) {
757
+ console.warn(`[defer] debouncing due to empty subscriber on ${this.uid}`);
758
+ }
759
+ setTimeout(() => {
760
+ if (this.dev) {
761
+ console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
762
+ }
763
+ this.dataDefer(subscriber);
764
+ }, 250);
765
+ return;
766
+ }
767
+ const prevString = lodash_1.default.clone(this.dataString);
768
+ const dataString = this.dataRef();
769
+ if (prevString === dataString) {
770
+ return;
771
+ }
772
+ if (!dataString && (!this.data || !this.data.completed)) {
773
+ if (this.dev) {
774
+ console.warn(`[defer] debouncing subscriber due to unavailable data on ${this.uid}`, this.data);
775
+ }
776
+ setTimeout(() => {
777
+ if (this.dev) {
778
+ console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
779
+ }
780
+ this.dataDefer(subscriber);
781
+ }, 250);
782
+ return;
783
+ }
784
+ if (!this.froalaConfig.useClasses) {
785
+ if (prevString === dataString) {
786
+ return;
787
+ }
788
+ }
789
+ if (this.dev) {
790
+ console.warn(`[subscriber] new value submitted on ${this.uid}:`, dataString);
791
+ }
792
+ this.subscriber.next(dataString);
793
+ }
794
+ dataRef() {
795
+ if (!this.model) {
796
+ return '';
797
+ }
798
+ return this.dataString = this.normalizeIn(this.model.get(this.property));
799
+ }
800
+ onDataChange() {
801
+ this.dataDefer(this.subscriber);
578
802
  this.refresh();
579
803
  }
580
- return;
581
- }
582
- dataControl.patchValue(evt);
583
- this.refresh();
584
- });
585
- }
586
- ngOnInit() {
587
- this.initialized = true;
588
- const dataControl = this.form.get('dataString');
589
- if (this.debounceSave) {
590
- dataControl.valueChanges.pipe(debounce(() => timer(this.debounceTime)), catchError(this.handleError)).subscribe((evt) => this.modelSave(evt));
591
- dataControl.valueChanges.pipe(debounce(() => timer(250)), catchError(this.handleError)).subscribe((evt) => {
592
- if (this.model.changedExternal) {
593
- return;
804
+ created() {
594
805
  }
595
- this.model.changedExternal = true;
596
- this.model.trigger('change');
597
- });
598
- }
599
- else {
600
- dataControl.valueChanges.forEach((value) => this.modelSave(value));
601
- }
602
- if (this.dev) {
603
- this.listDuplicates(this.froalaConfig);
604
- }
605
- }
606
- modelSave(value) {
607
- if (!this.model.completed) {
608
- return;
609
- }
610
- let innerHTML = null;
611
- if (!this.froalaConfig.useClasses
612
- && this.froalaEditorDirective
613
- && this.froalaEditorDirective.getEditor()
614
- && this.froalaEditorDirective.getEditor().el
615
- && this.froalaEditorDirective.getEditor().el.innerHTML) {
616
- innerHTML = this.froalaEditorDirective.getEditor().el.innerHTML;
617
- }
618
- this.model.set(this.property, this.normalizeOut(innerHTML || value));
619
- this.model.changedExternal = false;
620
- if (this.forceSave && !_.isEmpty(this.model.getIdentifier())) {
621
- this.model.save();
622
- }
623
- }
624
- listDuplicates(data) {
625
- _.forEach(data, (value, key) => {
626
- if (!_.isArray(value)) {
627
- return;
628
- }
629
- const catalog = {};
630
- value.forEach((e) => catalog[e] = (catalog[e] || 0) + 1);
631
- const duplicates = _.filter(_.map(catalog, ((v, k) => v > 1 ? k : null)));
632
- if (!duplicates.length) {
633
- return;
634
- }
635
- console.warn('Froala Config:', key, 'has duplicates:', duplicates);
636
- });
637
- return data;
638
- }
639
- normalizeIn(data) {
640
- if (!data || !_.isString(data)) {
641
- return '';
642
- }
643
- return this.changeImgSize(data, 'hq');
644
- }
645
- normalizeOut(data) {
646
- if (data === null) {
647
- return '';
648
- }
649
- if (!_.isString(data)) {
650
- return data;
651
- }
652
- return this.changeImgSize(data, 'xs');
653
- }
654
- changeImgSize(data, size) {
655
- if (!data || !_.isString(data)) {
656
- return data;
657
- }
658
- if (!size || !_.isString(size)) {
659
- return data;
660
- }
661
- const imgRegex = /<img([\w\W]+?)>/gi;
662
- let imgMatch;
663
- while (imgMatch = imgRegex.exec(data)) {
664
- const el = imgMatch[0];
665
- if (el.includes('data:image')) {
666
- continue;
667
- }
668
- const srcRegex = /^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi;
669
- const srcMatch = srcRegex.exec(el);
670
- if (srcMatch === null) {
671
- console.warn('Unable to find file name for image src:', el);
672
- continue;
673
- }
674
- if (!el.includes('data-stratus-src')) {
675
- if (!el.includes('cdn.sitetheory.io')) {
676
- continue;
806
+ changedEditor(event) {
807
+ console.log('editor-change:', event);
677
808
  }
678
- if (_.isEmpty(srcMatch[2])) {
679
- continue;
809
+ onChangeEvent($event) {
810
+ console.log('change:', $event);
680
811
  }
681
- data = data.replace(el, `<img data-stratus-src ${srcMatch[1]}-${size}.${srcMatch[3]}>`);
682
- continue;
683
- }
684
- data = data.replace(el, `<img ${srcMatch[1]}-${size}.${srcMatch[3]}>`);
685
- }
686
- return data;
687
- }
688
- handleError(err) {
689
- console.error(err);
690
- return err;
691
- }
692
- fetchData() {
693
- if (this.fetched) {
694
- return this.fetched;
695
- }
696
- return this.fetched = this.registry.fetch(Stratus.Select(this.elementRef.nativeElement), this);
697
- }
698
- dataDefer(subscriber) {
699
- this.subscriber = this.subscriber || subscriber;
700
- if (!this.subscriber) {
701
- if (this.dev) {
702
- console.warn(`[defer] debouncing due to empty subscriber on ${this.uid}`);
703
- }
704
- setTimeout(() => {
705
- if (this.dev) {
706
- console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
812
+ onFocus($event) {
813
+ this.focused = true;
814
+ this.blurred = false;
707
815
  }
708
- this.dataDefer(subscriber);
709
- }, 250);
710
- return;
711
- }
712
- const prevString = _.clone(this.dataString);
713
- const dataString = this.dataRef();
714
- if (prevString === dataString) {
715
- return;
716
- }
717
- if (!dataString && (!this.data || !this.data.completed)) {
718
- if (this.dev) {
719
- console.warn(`[defer] debouncing subscriber due to unavailable data on ${this.uid}`, this.data);
720
- }
721
- setTimeout(() => {
722
- if (this.dev) {
723
- console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
816
+ onBlur($event) {
817
+ this.focused = false;
818
+ this.blurred = true;
724
819
  }
725
- this.dataDefer(subscriber);
726
- }, 250);
727
- return;
728
- }
729
- if (!this.froalaConfig.useClasses) {
730
- if (prevString === dataString) {
731
- return;
732
- }
733
- }
734
- if (this.dev) {
735
- console.warn(`[subscriber] new value submitted on ${this.uid}:`, dataString);
736
- }
737
- this.subscriber.next(dataString);
738
- }
739
- dataRef() {
740
- if (!this.model) {
741
- return '';
742
- }
743
- return this.dataString = this.normalizeIn(this.model.get(this.property));
744
- }
745
- onDataChange() {
746
- this.dataDefer(this.subscriber);
747
- this.refresh();
748
- }
749
- created() {
750
- }
751
- changedEditor(event) {
752
- console.log('editor-change:', event);
753
- }
754
- onChangeEvent($event) {
755
- console.log('change:', $event);
756
- }
757
- onFocus($event) {
758
- this.focused = true;
759
- this.blurred = false;
760
- }
761
- onBlur($event) {
762
- this.focused = false;
763
- this.blurred = true;
764
- }
765
- bypassHTML(html) {
766
- return this.sanitizer.bypassSecurityTrustHtml(html);
767
- }
768
- trigger(name, data, callee) {
769
- if (this.dev && this.debug) {
770
- console.log('editor.trigger:', name, callee);
771
- }
772
- if (name === 'media-library') {
773
- this.openMediaDialog(callee);
774
- }
775
- else if (name === 'citation-input') {
776
- this.openCitationDialog(callee);
777
- }
778
- else if (name === 'link-library') {
779
- this.openLinkDialog(callee, data);
780
- }
781
- else if (name === 'code-view') {
782
- this.openCodeViewDialog();
820
+ bypassHTML(html) {
821
+ return this.sanitizer.bypassSecurityTrustHtml(html);
822
+ }
823
+ trigger(name, data, callee) {
824
+ if (this.dev && this.debug) {
825
+ console.log('editor.trigger:', name, callee);
826
+ }
827
+ if (name === 'media-library') {
828
+ this.openMediaDialog(callee);
829
+ }
830
+ else if (name === 'citation-input') {
831
+ this.openCitationDialog(callee);
832
+ }
833
+ else if (name === 'link-library') {
834
+ this.openLinkDialog(callee, data);
835
+ }
836
+ else if (name === 'code-view') {
837
+ this.openCodeViewDialog();
838
+ }
839
+ }
840
+ openCitationDialog(callee) {
841
+ const dialogRef = this.dialog.open(citation_dialog_component_1.CitationDialogComponent, {
842
+ width: '1000px',
843
+ data: {
844
+ editor: this,
845
+ eventManager: callee,
846
+ form: this.form,
847
+ model: this.model,
848
+ property: this.property,
849
+ }
850
+ });
851
+ const that = this;
852
+ dialogRef.afterClosed().subscribe((result) => {
853
+ if (!result || lodash_1.default.isEmpty(result)) {
854
+ return;
855
+ }
856
+ that.refresh();
857
+ if (this.dev && result) {
858
+ console.log('citation dialog result:', result);
859
+ }
860
+ });
861
+ }
862
+ openLinkDialog(callee, data) {
863
+ const dialogRef = this.dialog.open(link_dialog_component_1.LinkDialogComponent, {
864
+ width: '500px',
865
+ data: {
866
+ editor: this,
867
+ eventManager: callee,
868
+ element: data,
869
+ form: this.form,
870
+ model: this.model,
871
+ property: this.property
872
+ }
873
+ });
874
+ this.refresh();
875
+ const that = this;
876
+ dialogRef.afterClosed().subscribe((result) => {
877
+ if (!result || lodash_1.default.isEmpty(result)) {
878
+ return;
879
+ }
880
+ that.refresh();
881
+ if (this.dev && result) {
882
+ console.log('link dialog result:', result);
883
+ }
884
+ });
885
+ }
886
+ openMediaDialog(callee) {
887
+ const dialogRef = this.dialog.open(media_dialog_component_1.MediaDialogComponent, {
888
+ width: '1000px',
889
+ data: {
890
+ editor: this,
891
+ eventManager: callee,
892
+ form: this.form,
893
+ model: this.model,
894
+ property: this.property
895
+ }
896
+ });
897
+ this.refresh();
898
+ const that = this;
899
+ dialogRef.afterClosed().subscribe((result) => {
900
+ if (!result || lodash_1.default.isEmpty(result)) {
901
+ return;
902
+ }
903
+ that.refresh();
904
+ if (this.dev && result) {
905
+ console.log('media dialog result:', result);
906
+ }
907
+ });
908
+ }
909
+ openCodeViewDialog() {
910
+ this.codeViewIsOpen = true;
911
+ const dialogRef = this.dialog.open(code_view_dialog_component_1.CodeViewDialogComponent, {
912
+ width: '1000px',
913
+ data: {
914
+ form: this.form,
915
+ model: this.model,
916
+ property: this.property
917
+ }
918
+ });
919
+ this.refresh();
920
+ dialogRef.afterClosed().subscribe((result) => {
921
+ this.codeViewIsOpen = false;
922
+ if (!result || lodash_1.default.isEmpty(result)) {
923
+ return;
924
+ }
925
+ this.refresh();
926
+ if (this.dev && result) {
927
+ console.log('code view dialog result:', result);
928
+ }
929
+ });
930
+ }
931
+ };
932
+ __decorate([
933
+ core_1.Input(),
934
+ __metadata("design:type", String)
935
+ ], EditorComponent.prototype, "target", void 0);
936
+ __decorate([
937
+ core_1.Input(),
938
+ __metadata("design:type", String)
939
+ ], EditorComponent.prototype, "targetSuffix", void 0);
940
+ __decorate([
941
+ core_1.Input(),
942
+ __metadata("design:type", Number)
943
+ ], EditorComponent.prototype, "id", void 0);
944
+ __decorate([
945
+ core_1.Input(),
946
+ __metadata("design:type", Boolean)
947
+ ], EditorComponent.prototype, "manifest", void 0);
948
+ __decorate([
949
+ core_1.Input(),
950
+ __metadata("design:type", Boolean)
951
+ ], EditorComponent.prototype, "decouple", void 0);
952
+ __decorate([
953
+ core_1.Input(),
954
+ __metadata("design:type", Boolean)
955
+ ], EditorComponent.prototype, "direct", void 0);
956
+ __decorate([
957
+ core_1.Input(),
958
+ __metadata("design:type", Object)
959
+ ], EditorComponent.prototype, "api", void 0);
960
+ __decorate([
961
+ core_1.Input(),
962
+ __metadata("design:type", String)
963
+ ], EditorComponent.prototype, "urlRoot", void 0);
964
+ __decorate([
965
+ core_1.Input(),
966
+ __metadata("design:type", String)
967
+ ], EditorComponent.prototype, "property", void 0);
968
+ EditorComponent = __decorate([
969
+ core_1.Component({
970
+ selector: `sa-${moduleName}`,
971
+ templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
972
+ }),
973
+ __metadata("design:paramtypes", [platform_browser_1.DomSanitizer,
974
+ core_1.ChangeDetectorRef,
975
+ core_1.ElementRef,
976
+ forms_1.FormBuilder,
977
+ dialog_1.MatDialog])
978
+ ], EditorComponent);
979
+ exports_1("EditorComponent", EditorComponent);
783
980
  }
784
- }
785
- openCitationDialog(callee) {
786
- const dialogRef = this.dialog.open(CitationDialogComponent, {
787
- width: '1000px',
788
- data: {
789
- editor: this,
790
- eventManager: callee,
791
- form: this.form,
792
- model: this.model,
793
- property: this.property,
794
- }
795
- });
796
- const that = this;
797
- dialogRef.afterClosed().subscribe((result) => {
798
- if (!result || _.isEmpty(result)) {
799
- return;
800
- }
801
- that.refresh();
802
- if (this.dev && result) {
803
- console.log('citation dialog result:', result);
804
- }
805
- });
806
- }
807
- openLinkDialog(callee, data) {
808
- const dialogRef = this.dialog.open(LinkDialogComponent, {
809
- width: '500px',
810
- data: {
811
- editor: this,
812
- eventManager: callee,
813
- element: data,
814
- form: this.form,
815
- model: this.model,
816
- property: this.property
817
- }
818
- });
819
- this.refresh();
820
- const that = this;
821
- dialogRef.afterClosed().subscribe((result) => {
822
- if (!result || _.isEmpty(result)) {
823
- return;
824
- }
825
- that.refresh();
826
- if (this.dev && result) {
827
- console.log('link dialog result:', result);
828
- }
829
- });
830
- }
831
- openMediaDialog(callee) {
832
- const dialogRef = this.dialog.open(MediaDialogComponent, {
833
- width: '1000px',
834
- data: {
835
- editor: this,
836
- eventManager: callee,
837
- form: this.form,
838
- model: this.model,
839
- property: this.property
840
- }
841
- });
842
- this.refresh();
843
- const that = this;
844
- dialogRef.afterClosed().subscribe((result) => {
845
- if (!result || _.isEmpty(result)) {
846
- return;
847
- }
848
- that.refresh();
849
- if (this.dev && result) {
850
- console.log('media dialog result:', result);
851
- }
852
- });
853
- }
854
- openCodeViewDialog() {
855
- this.codeViewIsOpen = true;
856
- const dialogRef = this.dialog.open(CodeViewDialogComponent, {
857
- width: '1000px',
858
- data: {
859
- form: this.form,
860
- model: this.model,
861
- property: this.property
862
- }
863
- });
864
- this.refresh();
865
- dialogRef.afterClosed().subscribe((result) => {
866
- this.codeViewIsOpen = false;
867
- if (!result || _.isEmpty(result)) {
868
- return;
869
- }
870
- this.refresh();
871
- if (this.dev && result) {
872
- console.log('code view dialog result:', result);
873
- }
874
- });
875
- }
876
- };
877
- __decorate([
878
- Input(),
879
- __metadata("design:type", String)
880
- ], EditorComponent.prototype, "target", void 0);
881
- __decorate([
882
- Input(),
883
- __metadata("design:type", String)
884
- ], EditorComponent.prototype, "targetSuffix", void 0);
885
- __decorate([
886
- Input(),
887
- __metadata("design:type", Number)
888
- ], EditorComponent.prototype, "id", void 0);
889
- __decorate([
890
- Input(),
891
- __metadata("design:type", Boolean)
892
- ], EditorComponent.prototype, "manifest", void 0);
893
- __decorate([
894
- Input(),
895
- __metadata("design:type", Boolean)
896
- ], EditorComponent.prototype, "decouple", void 0);
897
- __decorate([
898
- Input(),
899
- __metadata("design:type", Boolean)
900
- ], EditorComponent.prototype, "direct", void 0);
901
- __decorate([
902
- Input(),
903
- __metadata("design:type", Object)
904
- ], EditorComponent.prototype, "api", void 0);
905
- __decorate([
906
- Input(),
907
- __metadata("design:type", String)
908
- ], EditorComponent.prototype, "urlRoot", void 0);
909
- __decorate([
910
- Input(),
911
- __metadata("design:type", String)
912
- ], EditorComponent.prototype, "property", void 0);
913
- EditorComponent = __decorate([
914
- Component({
915
- selector: `sa-${moduleName}`,
916
- templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
917
- }),
918
- __metadata("design:paramtypes", [DomSanitizer,
919
- ChangeDetectorRef,
920
- ElementRef,
921
- FormBuilder,
922
- MatDialog])
923
- ], EditorComponent);
924
- export { EditorComponent };
981
+ };
982
+ });
925
983
 
926
984
  //# sourceMappingURL=editor.component.js.map