@stratusjs/angular 0.3.10 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/package.json +4 -4
  2. package/src/angular.modules.js.map +1 -1
  3. package/src/app.module.js +7 -2
  4. package/src/app.module.js.map +1 -1
  5. package/src/app.module.min.js +1 -1
  6. package/src/app.module.ts +3 -0
  7. package/src/backend.service.js.map +1 -1
  8. package/src/base/base.component.js.map +1 -1
  9. package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
  10. package/src/editor/citation-dialog.component.html +50 -0
  11. package/src/editor/citation-dialog.component.js +202 -0
  12. package/src/editor/citation-dialog.component.js.map +1 -0
  13. package/src/editor/citation-dialog.component.min.html +1 -0
  14. package/src/editor/citation-dialog.component.min.js +1 -0
  15. package/src/editor/citation-dialog.component.ts +278 -0
  16. package/src/editor/code-view-dialog.component.js.map +1 -1
  17. package/src/editor/editor.component.js +52 -21
  18. package/src/editor/editor.component.js.map +1 -1
  19. package/src/editor/editor.component.min.js +1 -1
  20. package/src/editor/editor.component.ts +58 -19
  21. package/src/editor/link-dialog.component.js.map +1 -1
  22. package/src/editor/media-dialog.component.js.map +1 -1
  23. package/src/editor/quill-break-blot.plugin.js +38 -0
  24. package/src/editor/quill-break-blot.plugin.js.map +1 -0
  25. package/src/editor/quill-break-blot.plugin.min.js +1 -0
  26. package/src/editor/quill-html-edit.plugin.js +164 -0
  27. package/src/editor/quill-html-edit.plugin.js.map +1 -0
  28. package/src/editor/quill-html-edit.plugin.min.js +1 -0
  29. package/src/editor/quill-image-format.plugin.js +50 -0
  30. package/src/editor/quill-image-format.plugin.js.map +1 -0
  31. package/src/editor/quill-image-format.plugin.min.js +1 -0
  32. package/src/editor/quill-input-button.plugin.js +98 -0
  33. package/src/editor/quill-input-button.plugin.js.map +1 -0
  34. package/src/editor/quill-input-button.plugin.min.js +1 -0
  35. package/src/froala/editor/froala-editor.directive.js +328 -0
  36. package/src/froala/editor/froala-editor.directive.js.map +1 -0
  37. package/src/froala/editor/froala-editor.directive.min.js +1 -0
  38. package/src/froala/editor/froala-editor.module.js +37 -0
  39. package/src/froala/editor/froala-editor.module.js.map +1 -0
  40. package/src/froala/editor/froala-editor.module.min.js +1 -0
  41. package/src/froala/editor/index.js +22 -0
  42. package/src/froala/editor/index.js.map +1 -0
  43. package/src/froala/editor/index.min.js +1 -0
  44. package/src/froala/plugins/citationManager.css +23 -0
  45. package/src/froala/plugins/citationManager.css.map +1 -0
  46. package/src/froala/plugins/citationManager.js +102 -0
  47. package/src/froala/plugins/citationManager.js.map +1 -0
  48. package/src/froala/plugins/citationManager.min.css +1 -0
  49. package/src/froala/plugins/citationManager.min.js +1 -0
  50. package/src/froala/plugins/citationManager.scss +22 -0
  51. package/src/froala/plugins/citationManager.ts +132 -0
  52. package/src/froala/plugins/image_manager.js +364 -0
  53. package/src/froala/plugins/image_manager.js.map +1 -0
  54. package/src/froala/plugins/image_manager.min.js +1 -0
  55. package/src/froala/view/froala-view.directive.js +49 -0
  56. package/src/froala/view/froala-view.directive.js.map +1 -0
  57. package/src/froala/view/froala-view.directive.min.js +1 -0
  58. package/src/froala/view/froala-view.module.js +37 -0
  59. package/src/froala/view/froala-view.module.js.map +1 -0
  60. package/src/froala/view/froala-view.module.min.js +1 -0
  61. package/src/froala/view/index.js +22 -0
  62. package/src/froala/view/index.js.map +1 -0
  63. package/src/froala/view/index.min.js +1 -0
  64. package/src/material.js.map +1 -1
  65. package/src/media-selector/media-selector.component.js.map +1 -1
  66. package/src/root/root.component.js +43 -0
  67. package/src/root/root.component.js.map +1 -0
  68. package/src/root/root.component.min.js +1 -0
  69. package/src/selector/selector.component.js.map +1 -1
  70. package/src/test/test.directive.js.map +1 -1
  71. package/src/tree/tree-dialog.component.js.map +1 -1
  72. package/src/tree/tree-node.component.js.map +1 -1
  73. package/src/tree/tree.component.js.map +1 -1
  74. package/src/changeset-viewer/changeset-viewer-dialog.component.js +0 -62
  75. package/src/changeset-viewer/changeset-viewer-dialog.component.js.map +0 -1
  76. package/src/changeset-viewer/changeset-viewer-dialog.component.min.js +0 -1
  77. package/src/changeset-viewer/changeset-viewer-dialog.css +0 -2
  78. package/src/changeset-viewer/changeset-viewer-dialog.css.map +0 -1
  79. package/src/changeset-viewer/changeset-viewer-dialog.min.css +0 -0
  80. package/src/changeset-viewer/changeset-viewer.component.css +0 -4
  81. package/src/changeset-viewer/changeset-viewer.component.css.map +0 -1
  82. package/src/changeset-viewer/changeset-viewer.component.js +0 -127
  83. package/src/changeset-viewer/changeset-viewer.component.js.map +0 -1
  84. package/src/changeset-viewer/changeset-viewer.component.min.css +0 -1
  85. package/src/changeset-viewer/changeset-viewer.component.min.js +0 -1
@@ -0,0 +1,164 @@
1
+ System.register(["quill"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var quill_1, debug, Logger, QuillHtmlEditPlugin;
4
+ var __moduleName = context_1 && context_1.id;
5
+ function $create(elName) {
6
+ return document.createElement(elName);
7
+ }
8
+ function $setAttr(el, key, value) {
9
+ return el.setAttribute(key, value);
10
+ }
11
+ function launchPopupEditor(quill, options) {
12
+ const htmlFromEditor = quill.container.querySelector('.ql-editor').innerHTML;
13
+ const popupContainer = $create('div');
14
+ const overlayContainer = $create('div');
15
+ const msg = options.msg || 'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced';
16
+ const cancelText = options.cancelText || 'Cancel';
17
+ const okText = options.okText || 'Ok';
18
+ $setAttr(overlayContainer, 'class', 'ql-html-overlayContainer');
19
+ $setAttr(popupContainer, 'class', 'ql-html-popupContainer');
20
+ const popupTitle = $create('i');
21
+ $setAttr(popupTitle, 'class', 'ql-html-popupTitle');
22
+ popupTitle.innerText = msg;
23
+ const textContainer = $create('div');
24
+ textContainer.appendChild(popupTitle);
25
+ $setAttr(textContainer, 'class', 'ql-html-textContainer');
26
+ const textArea = $create('textarea');
27
+ $setAttr(textArea, 'class', 'ql-html-textArea');
28
+ textArea.value = formatHTML(htmlFromEditor);
29
+ const buttonCancel = $create('button');
30
+ buttonCancel.innerHTML = cancelText;
31
+ $setAttr(buttonCancel, 'class', 'ql-html-buttonCancel');
32
+ const buttonOk = $create('button');
33
+ buttonOk.innerHTML = okText;
34
+ const buttonGroup = $create('div');
35
+ $setAttr(buttonGroup, 'class', 'ql-html-buttonGroup');
36
+ buttonGroup.appendChild(buttonCancel);
37
+ buttonGroup.appendChild(buttonOk);
38
+ textContainer.appendChild(textArea);
39
+ textContainer.appendChild(buttonGroup);
40
+ popupContainer.appendChild(textContainer);
41
+ overlayContainer.appendChild(popupContainer);
42
+ document.body.appendChild(overlayContainer);
43
+ buttonCancel.onclick = () => {
44
+ document.body.removeChild(overlayContainer);
45
+ };
46
+ overlayContainer.onclick = buttonCancel.onclick;
47
+ popupContainer.onclick = (e) => {
48
+ e.preventDefault();
49
+ e.stopPropagation();
50
+ };
51
+ buttonOk.onclick = () => {
52
+ const output = textArea.value.split(/\r?\n/g).map((el) => el.trim());
53
+ const noNewlines = output.join('');
54
+ quill.container.querySelector('.ql-editor').innerHTML = noNewlines;
55
+ document.body.removeChild(overlayContainer);
56
+ };
57
+ }
58
+ function formatHTML(code) {
59
+ 'use strict';
60
+ const stripWhiteSpaces = true;
61
+ const stripEmptyLines = true;
62
+ const whitespace = ' '.repeat(2);
63
+ let currentIndent = 0;
64
+ const newlineChar = '\n';
65
+ let char = null;
66
+ let nextChar = null;
67
+ let result = '';
68
+ for (let pos = 0; pos <= code.length; pos++) {
69
+ char = code.substr(pos, 1);
70
+ nextChar = code.substr(pos + 1, 1);
71
+ const isBrTag = code.substr(pos, 4) === '<br>';
72
+ const isOpeningTag = char === '<' && nextChar !== '/' && !isBrTag;
73
+ const isClosingTag = char === '<' && nextChar === '/' && !isBrTag;
74
+ if (isBrTag) {
75
+ result += newlineChar;
76
+ currentIndent--;
77
+ pos += 4;
78
+ }
79
+ if (isOpeningTag) {
80
+ result += newlineChar + whitespace.repeat(currentIndent);
81
+ currentIndent++;
82
+ }
83
+ else if (isClosingTag) {
84
+ if (--currentIndent < 0) {
85
+ currentIndent = 0;
86
+ }
87
+ result += newlineChar + whitespace.repeat(currentIndent);
88
+ }
89
+ else if (stripWhiteSpaces === true && char === ' ' && nextChar === ' ') {
90
+ char = '';
91
+ }
92
+ else if (stripEmptyLines === true && char === newlineChar) {
93
+ if (code.substr(pos, code.substr(pos).indexOf('<')).trim() === '') {
94
+ char = '';
95
+ }
96
+ }
97
+ result += char;
98
+ }
99
+ Logger.log('formatHTML', {
100
+ before: code,
101
+ after: result
102
+ });
103
+ return result;
104
+ }
105
+ return {
106
+ setters: [
107
+ function (quill_1_1) {
108
+ quill_1 = quill_1_1;
109
+ }
110
+ ],
111
+ execute: function () {
112
+ debug = false;
113
+ Logger = {
114
+ prefixString() {
115
+ return `</> quill-html-edit-button: `;
116
+ },
117
+ get log() {
118
+ if (!debug) {
119
+ return () => { };
120
+ }
121
+ const boundLogFn = console.log.bind(console, this.prefixString());
122
+ return boundLogFn;
123
+ }
124
+ };
125
+ QuillHtmlEditPlugin = class QuillHtmlEditPlugin {
126
+ constructor(quill, options) {
127
+ debug = options && options.debug;
128
+ Logger.log('logging enabled');
129
+ const toolbarModule = quill.getModule('toolbar');
130
+ if (!toolbarModule) {
131
+ throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');
132
+ }
133
+ this.registerDivModule();
134
+ const toolbarEl = toolbarModule.container;
135
+ const buttonContainer = $create('span');
136
+ $setAttr(buttonContainer, 'class', 'ql-formats');
137
+ const button = $create('button');
138
+ button.innerHTML = options.buttonHTML || '&lt;&gt;';
139
+ button.title = options.buttonTitle || 'Show HTML source';
140
+ button.onclick = (e) => {
141
+ e.preventDefault();
142
+ launchPopupEditor(quill, options);
143
+ };
144
+ buttonContainer.appendChild(button);
145
+ toolbarEl.appendChild(buttonContainer);
146
+ }
147
+ registerDivModule() {
148
+ const Block = quill_1.default.import('blots/block');
149
+ class Div extends Block {
150
+ }
151
+ Div.tagName = 'div';
152
+ Div.blotName = 'div';
153
+ Div.allowedChildren = Block.allowedChildren;
154
+ Div.allowedChildren.push(Block);
155
+ quill_1.default.register(Div);
156
+ }
157
+ };
158
+ exports_1("QuillHtmlEditPlugin", QuillHtmlEditPlugin);
159
+ exports_1("default", QuillHtmlEditPlugin);
160
+ }
161
+ };
162
+ });
163
+
164
+ //# sourceMappingURL=quill-html-edit.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["quill-html-edit.plugin.ts"],"names":[],"mappings":";;;;IAQA,SAAS,OAAO,CAAC,MAAW;QACxB,OAAO,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,SAAS,QAAQ,CAAC,EAAO,EAAE,GAAQ,EAAE,KAAU;QAC3C,OAAO,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACtC,CAAC;IAuDD,SAAS,iBAAiB,CAAC,KAAU,EAAE,OAAY;QAC/C,MAAM,cAAc,GAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,SAAS,CAAA;QACjF,MAAM,cAAc,GAAQ,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1C,MAAM,gBAAgB,GAAQ,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5C,MAAM,GAAG,GAAQ,OAAO,CAAC,GAAG,IAAI,mFAAmF,CAAA;QACnH,MAAM,UAAU,GAAQ,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAA;QACtD,MAAM,MAAM,GAAQ,OAAO,CAAC,MAAM,IAAI,IAAI,CAAA;QAE1C,QAAQ,CAAC,gBAAgB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAA;QAC/D,QAAQ,CAAC,cAAc,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAAA;QAC3D,MAAM,UAAU,GAAQ,OAAO,CAAC,GAAG,CAAC,CAAA;QACpC,QAAQ,CAAC,UAAU,EAAE,OAAO,EAAE,oBAAoB,CAAC,CA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B,CAAA;oBACxD,MAAM,CAAC,OAAO,GAAG,CAAC,CAAM,EAAE,EAAE;wBACxB,CAAC,CAAC,cAAc,EAAE,CAAA;wBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;oBACrC,CAAC,CAAA;oBACD,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;oBACnC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;gBAC1C,CAAC;gBAED,iBAAiB;oBAGb,MAAM,KAAK,GAAG,eAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;oBACzC,MAAM,GAAI,SAAQ,KAAK;qBAAG;oBAC1B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;oBACnB,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAA;oBACpB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAA;oBAC3C,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBAC/B,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gBACvB,CAAC;aACJ,CAAA;;iCA6Gc,mBAAmB;QAElC,CAAC","file":"quill-html-edit.plugin.js"}
@@ -0,0 +1 @@
1
+ System.register(["quill"],function(t,e){"use strict";var n,l,o,i;e&&e.id;function r(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}function c(t,e){const n=t.container.querySelector(".ql-editor").innerHTML,l=r("div"),i=r("div"),c=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',u=e.cancelText||"Cancel",d=e.okText||"Ok";s(i,"class","ql-html-overlayContainer"),s(l,"class","ql-html-popupContainer");const a=r("i");s(a,"class","ql-html-popupTitle"),a.innerText=c;const p=r("div");p.appendChild(a),s(p,"class","ql-html-textContainer");const h=r("textarea");s(h,"class","ql-html-textArea"),h.value=function(t){const e=!0,n=!0,l=" ".repeat(2);let i=0;const r="\n";let s=null,c=null,u="";for(let o=0;o<=t.length;o++){s=t.substr(o,1),c=t.substr(o+1,1);const d="<br>"===t.substr(o,4),a="<"===s&&"/"===c&&!d;d&&(u+=r,i--,o+=4),"<"===s&&"/"!==c&&!d?(u+=r+l.repeat(i),i++):a?(--i<0&&(i=0),u+=r+l.repeat(i)):(!0===e&&" "===s&&" "===c||!0===n&&s===r&&""===t.substr(o,t.substr(o).indexOf("<")).trim())&&(s=""),u+=s}return o.log("formatHTML",{before:t,after:u}),u}(n);const b=r("button");b.innerHTML=u,s(b,"class","ql-html-buttonCancel");const m=r("button");m.innerHTML=d;const g=r("div");s(g,"class","ql-html-buttonGroup"),g.appendChild(b),g.appendChild(m),p.appendChild(h),p.appendChild(g),l.appendChild(p),i.appendChild(l),document.body.appendChild(i),b.onclick=()=>{document.body.removeChild(i)},i.onclick=b.onclick,l.onclick=t=>{t.preventDefault(),t.stopPropagation()},m.onclick=()=>{const e=h.value.split(/\r?\n/g).map(t=>t.trim()).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(i)}}return{setters:[function(t){n=t}],execute:function(){l=!1,o={prefixString:()=>"</> quill-html-edit-button: ",get log(){if(!l)return()=>{};return console.log.bind(console,this.prefixString())}},t("QuillHtmlEditPlugin",i=class{constructor(t,e){l=e&&e.debug,o.log("logging enabled");const n=t.getModule("toolbar");if(!n)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();const i=n.container,u=r("span");s(u,"class","ql-formats");const d=r("button");d.innerHTML=e.buttonHTML||"&lt;&gt;",d.title=e.buttonTitle||"Show HTML source",d.onclick=n=>{n.preventDefault(),c(t,e)},u.appendChild(d),i.appendChild(u)}registerDivModule(){const t=n.default.import("blots/block");class e extends t{}e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),n.default.register(e)}}),t("default",i)}}});
@@ -0,0 +1,50 @@
1
+ System.register(["quill"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
4
+ var __moduleName = context_1 && context_1.id;
5
+ return {
6
+ setters: [
7
+ function (quill_1_1) {
8
+ quill_1 = quill_1_1;
9
+ }
10
+ ],
11
+ execute: function () {
12
+ BaseImage = quill_1.default.import('formats/image');
13
+ ATTRIBUTES = [
14
+ 'alt',
15
+ 'height',
16
+ 'width',
17
+ 'stratus-src',
18
+ 'stratusSrc'
19
+ ];
20
+ QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
21
+ constructor() {
22
+ super(...arguments);
23
+ this.blotName = 'imageCustom';
24
+ this.tagName = 'IMG';
25
+ }
26
+ format(name, value) {
27
+ console.log('format:', name, value, this.domNode.getAttribute('src'));
28
+ if (ATTRIBUTES.indexOf(name) === -1) {
29
+ super.format(name, value);
30
+ return;
31
+ }
32
+ if (!value) {
33
+ this.domNode.removeAttribute(name);
34
+ return;
35
+ }
36
+ if (name === 'stratus-src') {
37
+ console.log('stratus-src:', value);
38
+ }
39
+ if (name === 'stratusSrc') {
40
+ console.log('stratusSrc:', value);
41
+ }
42
+ this.domNode.setAttribute(name, value);
43
+ }
44
+ };
45
+ exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
46
+ }
47
+ };
48
+ });
49
+
50
+ //# sourceMappingURL=quill-image-format.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["quill-image-format.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;YACM,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;YAEzC,UAAU,GAAG;gBACf,KAAK;gBACL,QAAQ;gBACR,OAAO;gBACP,aAAa;gBACb,YAAY;aACf,CAAA;YAED,yBAAA,MAAa,sBAAuB,SAAQ,SAAS;gBAArD;;oBAGI,aAAQ,GAAG,aAAa,CAAA;oBACxB,YAAO,GAAG,KAAK,CAAA;gBA2DnB,CAAC;gBApBG,MAAM,CAAC,IAAS,EAAE,KAAU;oBACxB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;oBACrE,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;wBACjC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;wBACzB,OAAM;qBACT;oBACD,IAAI,CAAC,KAAK,EAAE;wBACR,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;wBAClC,OAAM;qBACT;oBACD,IAAI,IAAI,KAAK,aAAa,EAAE;wBACxB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;qBAErC;oBACD,IAAI,IAAI,KAAK,YAAY,EAAE;wBACvB,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;qBAEpC;oBACD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;gBAC1C,CAAC;aACJ,CAAA;;QACD,CAAC","file":"quill-image-format.plugin.js"}
@@ -0,0 +1 @@
1
+ System.register(["quill"],function(t,s){"use strict";var e,r,o,i;s&&s.id;return{setters:[function(t){e=t}],execute:function(){r=e.default.import("formats/image"),o=["alt","height","width","stratus-src","stratusSrc"],i=class extends r{constructor(){super(...arguments),this.blotName="imageCustom",this.tagName="IMG"}format(t,s){console.log("format:",t,s,this.domNode.getAttribute("src")),-1!==o.indexOf(t)?s?("stratus-src"===t&&console.log("stratus-src:",s),"stratusSrc"===t&&console.log("stratusSrc:",s),this.domNode.setAttribute(t,s)):this.domNode.removeAttribute(t):super.format(t,s)}},t("QuillImageFormatPlugin",i)}}});
@@ -0,0 +1,98 @@
1
+ System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
4
+ var __moduleName = context_1 && context_1.id;
5
+ return {
6
+ setters: [
7
+ function (stratus_1_1) {
8
+ stratus_1 = stratus_1_1;
9
+ },
10
+ function (lodash_1_1) {
11
+ lodash_1 = lodash_1_1;
12
+ },
13
+ function (quill_1_1) {
14
+ quill_1 = quill_1_1;
15
+ }
16
+ ],
17
+ execute: function () {
18
+ QuillInputButtonPlugin = class QuillInputButtonPlugin {
19
+ constructor(quill, options) {
20
+ this.debug = false;
21
+ this.buttonHTML = '<i class="fas fa-carrot"></i>';
22
+ this.buttonTitle = 'Input Button';
23
+ this.name = 'inputButton';
24
+ this.eventName = 'input-button';
25
+ this.uid = lodash_1.default.uniqueId(`quill_input_button_`);
26
+ stratus_1.Stratus.Instances[this.uid] = this;
27
+ this.debug = options && options.debug;
28
+ if (!options || typeof options !== 'object') {
29
+ options = {};
30
+ }
31
+ this.buttonHTML = options.buttonHTML || this.buttonHTML;
32
+ this.buttonTitle = options.buttonTitle || this.buttonTitle;
33
+ this.name = options.name || this.name;
34
+ this.eventName = options.eventName || this.eventName;
35
+ this.createToolbarModule(quill);
36
+ }
37
+ createToolbarModule(quill) {
38
+ const toolbarModule = quill.getModule('toolbar');
39
+ if (!toolbarModule) {
40
+ throw new Error(`quill.${this.name} requires the "toolbar" module`);
41
+ }
42
+ this.registerDivModule();
43
+ const toolbarEl = toolbarModule.container;
44
+ const buttonContainer = document.createElement('span');
45
+ buttonContainer.setAttribute('class', 'ql-formats');
46
+ const button = document.createElement('button');
47
+ button.innerHTML = this.buttonHTML;
48
+ button.title = this.buttonTitle;
49
+ button.onclick = (e) => {
50
+ e.preventDefault();
51
+ this.onClick(quill);
52
+ };
53
+ buttonContainer.appendChild(button);
54
+ toolbarEl.appendChild(buttonContainer);
55
+ }
56
+ registerDivModule() {
57
+ const Block = quill_1.default.import('blots/block');
58
+ class Div extends Block {
59
+ }
60
+ Div.tagName = 'div';
61
+ Div.blotName = 'div';
62
+ Div.allowedChildren = Block.allowedChildren;
63
+ Div.allowedChildren.push(Block);
64
+ quill_1.default.register(Div);
65
+ }
66
+ findUID(el) {
67
+ if ('uid' in el.dataset) {
68
+ return el.dataset.uid;
69
+ }
70
+ return this.findUID(el.parentElement);
71
+ }
72
+ getInstance(uid) {
73
+ if (!(uid in stratus_1.Stratus.Instances)) {
74
+ return undefined;
75
+ }
76
+ return stratus_1.Stratus.Instances[uid];
77
+ }
78
+ onClick(quill) {
79
+ const container = quill.container;
80
+ const uid = this.findUID(container);
81
+ const instance = this.getInstance(uid);
82
+ if (!instance) {
83
+ return;
84
+ }
85
+ instance.trigger(this.eventName, null, this);
86
+ }
87
+ trigger(name, data, callee) {
88
+ if (this.debug) {
89
+ console.log(`quill.${this.name}.trigger:`, name, data, callee);
90
+ }
91
+ }
92
+ };
93
+ exports_1("QuillInputButtonPlugin", QuillInputButtonPlugin);
94
+ }
95
+ };
96
+ });
97
+
98
+ //# sourceMappingURL=quill-input-button.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["quill-input-button.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;YAeA,yBAAA,MAAa,sBAAsB;gBAY/B,YAAY,KAAU,EAAE,OAAY;oBAPpC,UAAK,GAAG,KAAK,CAAA;oBACb,eAAU,GAAG,+BAA+B,CAAA;oBAC5C,gBAAW,GAAG,cAAc,CAAA;oBAC5B,SAAI,GAAG,aAAa,CAAA;oBACpB,cAAS,GAAG,cAAc,CAAA;oBAKtB,IAAI,CAAC,GAAG,GAAG,gBAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAA;oBAC5C,iBAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;oBAElC,IAAI,CAAC,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,KAAK,CAAA;oBAGrC,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;wBACzC,OAAO,GAAG,EAAE,CAAA;qBACf;oBACD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI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AAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;qBACjE;gBACL,CAAC;aACJ,CAAA;;QAID,CAAC","file":"quill-input-button.plugin.js"}
@@ -0,0 +1 @@
1
+ System.register(["@stratusjs/runtime/stratus","lodash","quill"],function(t,e){"use strict";var n,i,s;e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t}],execute:function(){t("QuillInputButtonPlugin",class{constructor(t,e){this.debug=!1,this.buttonHTML='<i class="fas fa-carrot"></i>',this.buttonTitle="Input Button",this.name="inputButton",this.eventName="input-button",this.uid=i.default.uniqueId("quill_input_button_"),n.Stratus.Instances[this.uid]=this,this.debug=e&&e.debug,e&&"object"==typeof e||(e={}),this.buttonHTML=e.buttonHTML||this.buttonHTML,this.buttonTitle=e.buttonTitle||this.buttonTitle,this.name=e.name||this.name,this.eventName=e.eventName||this.eventName,this.createToolbarModule(t)}createToolbarModule(t){const e=t.getModule("toolbar");if(!e)throw new Error(`quill.${this.name} requires the "toolbar" module`);this.registerDivModule();const n=e.container,i=document.createElement("span");i.setAttribute("class","ql-formats");const s=document.createElement("button");s.innerHTML=this.buttonHTML,s.title=this.buttonTitle,s.onclick=e=>{e.preventDefault(),this.onClick(t)},i.appendChild(s),n.appendChild(i)}registerDivModule(){const t=s.default.import("blots/block");class e extends t{}e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),s.default.register(e)}findUID(t){return"uid"in t.dataset?t.dataset.uid:this.findUID(t.parentElement)}getInstance(t){if(t in n.Stratus.Instances)return n.Stratus.Instances[t]}onClick(t){const e=t.container,n=this.findUID(e),i=this.getInstance(n);i&&i.trigger(this.eventName,null,this)}trigger(t,e,n){this.debug&&console.log(`quill.${this.name}.trigger:`,t,e,n)}})}}});