@zeedhi/zd-richtext-vue 1.0.5 → 1.1.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.
@@ -0,0 +1,305 @@
1
+ import { Prop, Component } from 'vue-property-decorator';
2
+ import { RichText } from '@zeedhi/zd-richtext-common';
3
+ import { ZdComponentRender, Vuetify } from '@zeedhi/vuetify';
4
+ import Vue from 'vue';
5
+ import 'tiptap-vuetify/dist/main.css';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+
22
+ function __decorate(decorators, target, key, desc) {
23
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
25
+ 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;
26
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
27
+ }
28
+
29
+ function __metadata(metadataKey, metadataValue) {
30
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
31
+ }
32
+
33
+ const { Bold, Italic, Strike, Underline, Code, ListItem, BulletList, OrderedList, HorizontalRule, Heading } = require('tiptap-vuetify');
34
+ let ZdRichText = class ZdRichText extends ZdComponentRender {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.extensions = [
38
+ Bold,
39
+ Italic,
40
+ Strike,
41
+ Underline,
42
+ [Heading,
43
+ {
44
+ options: {
45
+ levels: [1, 2, 3]
46
+ }
47
+ }
48
+ ],
49
+ Code,
50
+ HorizontalRule,
51
+ ListItem,
52
+ BulletList,
53
+ OrderedList
54
+ ];
55
+ this.instanceType = RichText;
56
+ }
57
+ onKeyDown(event) {
58
+ this.instance.onkeydown(this.$el, event.key);
59
+ }
60
+ };
61
+ __decorate([
62
+ Prop({ type: String, default: 'json' }),
63
+ __metadata("design:type", String)
64
+ ], ZdRichText.prototype, "outputFormat", void 0);
65
+ __decorate([
66
+ Prop({ type: String, default: '' }),
67
+ __metadata("design:type", String)
68
+ ], ZdRichText.prototype, "placeholder", void 0);
69
+ __decorate([
70
+ Prop({ type: [Boolean, String], default: false }),
71
+ __metadata("design:type", Object)
72
+ ], ZdRichText.prototype, "disabled", void 0);
73
+ __decorate([
74
+ Prop({ type: String, default: 'var(--v-primary-base)' }),
75
+ __metadata("design:type", String)
76
+ ], ZdRichText.prototype, "toolbarColor", void 0);
77
+ __decorate([
78
+ Prop({ type: String, default: '' }),
79
+ __metadata("design:type", String)
80
+ ], ZdRichText.prototype, "cardColor", void 0);
81
+ __decorate([
82
+ Prop({ type: [Boolean, String], default: false }),
83
+ __metadata("design:type", Object)
84
+ ], ZdRichText.prototype, "outlined", void 0);
85
+ __decorate([
86
+ Prop({ type: [Number, String], default: '' }),
87
+ __metadata("design:type", Object)
88
+ ], ZdRichText.prototype, "width", void 0);
89
+ __decorate([
90
+ Prop({ type: [Number, String], default: '' }),
91
+ __metadata("design:type", Object)
92
+ ], ZdRichText.prototype, "height", void 0);
93
+ ZdRichText = __decorate([
94
+ Component
95
+ ], ZdRichText);
96
+ var script = ZdRichText;
97
+
98
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
99
+ if (typeof shadowMode !== 'boolean') {
100
+ createInjectorSSR = createInjector;
101
+ createInjector = shadowMode;
102
+ shadowMode = false;
103
+ }
104
+ // Vue.extend constructor export interop.
105
+ const options = typeof script === 'function' ? script.options : script;
106
+ // render functions
107
+ if (template && template.render) {
108
+ options.render = template.render;
109
+ options.staticRenderFns = template.staticRenderFns;
110
+ options._compiled = true;
111
+ // functional template
112
+ if (isFunctionalTemplate) {
113
+ options.functional = true;
114
+ }
115
+ }
116
+ // scopedId
117
+ if (scopeId) {
118
+ options._scopeId = scopeId;
119
+ }
120
+ let hook;
121
+ if (moduleIdentifier) {
122
+ // server build
123
+ hook = function (context) {
124
+ // 2.3 injection
125
+ context =
126
+ context || // cached call
127
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
128
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
129
+ // 2.2 with runInNewContext: true
130
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
131
+ context = __VUE_SSR_CONTEXT__;
132
+ }
133
+ // inject component styles
134
+ if (style) {
135
+ style.call(this, createInjectorSSR(context));
136
+ }
137
+ // register component module identifier for async chunk inference
138
+ if (context && context._registeredComponents) {
139
+ context._registeredComponents.add(moduleIdentifier);
140
+ }
141
+ };
142
+ // used by ssr in case component is cached and beforeCreate
143
+ // never gets called
144
+ options._ssrRegister = hook;
145
+ }
146
+ else if (style) {
147
+ hook = shadowMode
148
+ ? function (context) {
149
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
150
+ }
151
+ : function (context) {
152
+ style.call(this, createInjector(context));
153
+ };
154
+ }
155
+ if (hook) {
156
+ if (options.functional) {
157
+ // register for functional component in vue file
158
+ const originalRender = options.render;
159
+ options.render = function renderWithStyleInjection(h, context) {
160
+ hook.call(context);
161
+ return originalRender(h, context);
162
+ };
163
+ }
164
+ else {
165
+ // inject component registration as beforeCreate hook
166
+ const existing = options.beforeCreate;
167
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
168
+ }
169
+ }
170
+ return script;
171
+ }
172
+
173
+ const isOldIE = typeof navigator !== 'undefined' &&
174
+ /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
175
+ function createInjector(context) {
176
+ return (id, style) => addStyle(id, style);
177
+ }
178
+ let HEAD;
179
+ const styles = {};
180
+ function addStyle(id, css) {
181
+ const group = isOldIE ? css.media || 'default' : id;
182
+ const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
183
+ if (!style.ids.has(id)) {
184
+ style.ids.add(id);
185
+ let code = css.source;
186
+ if (css.map) {
187
+ // https://developer.chrome.com/devtools/docs/javascript-debugging
188
+ // this makes source maps inside style tags work properly in Chrome
189
+ code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
190
+ // http://stackoverflow.com/a/26603875
191
+ code +=
192
+ '\n/*# sourceMappingURL=data:application/json;base64,' +
193
+ btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
194
+ ' */';
195
+ }
196
+ if (!style.element) {
197
+ style.element = document.createElement('style');
198
+ style.element.type = 'text/css';
199
+ if (css.media)
200
+ style.element.setAttribute('media', css.media);
201
+ if (HEAD === undefined) {
202
+ HEAD = document.head || document.getElementsByTagName('head')[0];
203
+ }
204
+ HEAD.appendChild(style.element);
205
+ }
206
+ if ('styleSheet' in style.element) {
207
+ style.styles.push(code);
208
+ style.element.styleSheet.cssText = style.styles
209
+ .filter(Boolean)
210
+ .join('\n');
211
+ }
212
+ else {
213
+ const index = style.ids.size - 1;
214
+ const textNode = document.createTextNode(code);
215
+ const nodes = style.element.childNodes;
216
+ if (nodes[index])
217
+ style.element.removeChild(nodes[index]);
218
+ if (nodes.length)
219
+ style.element.insertBefore(textNode, nodes[index]);
220
+ else
221
+ style.element.appendChild(textNode);
222
+ }
223
+ }
224
+ }
225
+
226
+ /* script */
227
+ const __vue_script__ = script;
228
+
229
+ /* template */
230
+ var __vue_render__ = function() {
231
+ var _vm = this;
232
+ var _h = _vm.$createElement;
233
+ var _c = _vm._self._c || _h;
234
+ return _c("tiptap-vuetify", {
235
+ attrs: {
236
+ "output-format": _vm.instance.outputFormat,
237
+ extensions: _vm.extensions,
238
+ "toolbar-attributes": {
239
+ color: _vm.instance.toolbarColor,
240
+ class: "rounded-t",
241
+ width: _vm.instance.width
242
+ },
243
+ "card-props": {
244
+ color: _vm.instance.cardColor,
245
+ class: "rounded-b-md",
246
+ outlined: _vm.instance.outlined,
247
+ width: _vm.instance.width,
248
+ height: _vm.instance.height
249
+ },
250
+ placeholder: _vm.instance.placeholder,
251
+ disabled: _vm.instance.disabled
252
+ },
253
+ on: { keydown: _vm.onKeyDown },
254
+ model: {
255
+ value: _vm.instance.content,
256
+ callback: function($$v) {
257
+ _vm.$set(_vm.instance, "content", $$v);
258
+ },
259
+ expression: "instance.content"
260
+ }
261
+ })
262
+ };
263
+ var __vue_staticRenderFns__ = [];
264
+ __vue_render__._withStripped = true;
265
+
266
+ /* style */
267
+ const __vue_inject_styles__ = function (inject) {
268
+ if (!inject) return
269
+ inject("data-v-646cc640_0", { source: "button.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n\n/*# sourceMappingURL=RichText.vue.map */", map: {"version":3,"sources":["/Users/zedmartins/workfolder/zeedhi/richtext/packages/vue/src/RichText.vue","RichText.vue"],"names":[],"mappings":"AA2BA;EACA,cAAA;AC1BA;;AAEA,uCAAuC","file":"RichText.vue","sourcesContent":["<template>\n <tiptap-vuetify\n v-model=\"instance.content\"\n :output-format=\"instance.outputFormat\"\n :extensions=\"extensions\"\n :toolbar-attributes=\"{\n color: instance.toolbarColor,\n class: 'rounded-t',\n width: instance.width,\n }\"\n :card-props=\"{\n color: instance.cardColor,\n class: 'rounded-b-md',\n outlined: instance.outlined,\n width: instance.width,\n height: instance.height,\n }\"\n :placeholder=\"instance.placeholder\"\n :disabled=\"instance.disabled\"\n @keydown=\"onKeyDown\"\n >\n </tiptap-vuetify>\n</template>\n\n<script lang=\"ts\" src=\"./RichText.ts\"></script>\n\n<style lang=\"scss\">\nbutton.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n</style>","button.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n\n/*# sourceMappingURL=RichText.vue.map */"]}, media: undefined });
270
+
271
+ };
272
+ /* scoped */
273
+ const __vue_scope_id__ = undefined;
274
+ /* module identifier */
275
+ const __vue_module_identifier__ = undefined;
276
+ /* functional template */
277
+ const __vue_is_functional_template__ = false;
278
+ /* style inject SSR */
279
+
280
+ /* style inject shadow dom */
281
+
282
+
283
+
284
+ const __vue_component__ = /*#__PURE__*/normalizeComponent(
285
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
286
+ __vue_inject_styles__,
287
+ __vue_script__,
288
+ __vue_scope_id__,
289
+ __vue_is_functional_template__,
290
+ __vue_module_identifier__,
291
+ false,
292
+ createInjector,
293
+ undefined,
294
+ undefined
295
+ );
296
+
297
+ const TiptapVuetify = require('tiptap-vuetify');
298
+ // tiptap-vuetify
299
+ Vue.use(TiptapVuetify.TiptapVuetifyPlugin, {
300
+ vuetify: new Vuetify(),
301
+ iconsGroup: 'mdi'
302
+ });
303
+ Vue.component('tiptap-vuetify', TiptapVuetify.TiptapVuetify);
304
+
305
+ export { __vue_component__ as RichText };
@@ -0,0 +1,313 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue-property-decorator'), require('@zeedhi/zd-richtext-common'), require('@zeedhi/vuetify'), require('vue'), require('tiptap-vuetify/dist/main.css')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vue-property-decorator', '@zeedhi/zd-richtext-common', '@zeedhi/vuetify', 'vue', 'tiptap-vuetify/dist/main.css'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/zd-richtext-vue"] = {}, global["vue-property-decorator"], global["@zeedhi/zd-richtext-common"], global["@zeedhi/vuetify"], global.vue));
5
+ })(this, (function (exports, vuePropertyDecorator, zdRichtextCommon, vuetify, Vue) { 'use strict';
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
10
+
11
+ /*! *****************************************************************************
12
+ Copyright (c) Microsoft Corporation.
13
+
14
+ Permission to use, copy, modify, and/or distribute this software for any
15
+ purpose with or without fee is hereby granted.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
+ PERFORMANCE OF THIS SOFTWARE.
24
+ ***************************************************************************** */
25
+
26
+ function __decorate(decorators, target, key, desc) {
27
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
+ 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;
30
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31
+ }
32
+
33
+ function __metadata(metadataKey, metadataValue) {
34
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
35
+ }
36
+
37
+ const { Bold, Italic, Strike, Underline, Code, ListItem, BulletList, OrderedList, HorizontalRule, Heading } = require('tiptap-vuetify');
38
+ let ZdRichText = class ZdRichText extends vuetify.ZdComponentRender {
39
+ constructor() {
40
+ super(...arguments);
41
+ this.extensions = [
42
+ Bold,
43
+ Italic,
44
+ Strike,
45
+ Underline,
46
+ [Heading,
47
+ {
48
+ options: {
49
+ levels: [1, 2, 3]
50
+ }
51
+ }
52
+ ],
53
+ Code,
54
+ HorizontalRule,
55
+ ListItem,
56
+ BulletList,
57
+ OrderedList
58
+ ];
59
+ this.instanceType = zdRichtextCommon.RichText;
60
+ }
61
+ onKeyDown(event) {
62
+ this.instance.onkeydown(this.$el, event.key);
63
+ }
64
+ };
65
+ __decorate([
66
+ vuePropertyDecorator.Prop({ type: String, default: 'json' }),
67
+ __metadata("design:type", String)
68
+ ], ZdRichText.prototype, "outputFormat", void 0);
69
+ __decorate([
70
+ vuePropertyDecorator.Prop({ type: String, default: '' }),
71
+ __metadata("design:type", String)
72
+ ], ZdRichText.prototype, "placeholder", void 0);
73
+ __decorate([
74
+ vuePropertyDecorator.Prop({ type: [Boolean, String], default: false }),
75
+ __metadata("design:type", Object)
76
+ ], ZdRichText.prototype, "disabled", void 0);
77
+ __decorate([
78
+ vuePropertyDecorator.Prop({ type: String, default: 'var(--v-primary-base)' }),
79
+ __metadata("design:type", String)
80
+ ], ZdRichText.prototype, "toolbarColor", void 0);
81
+ __decorate([
82
+ vuePropertyDecorator.Prop({ type: String, default: '' }),
83
+ __metadata("design:type", String)
84
+ ], ZdRichText.prototype, "cardColor", void 0);
85
+ __decorate([
86
+ vuePropertyDecorator.Prop({ type: [Boolean, String], default: false }),
87
+ __metadata("design:type", Object)
88
+ ], ZdRichText.prototype, "outlined", void 0);
89
+ __decorate([
90
+ vuePropertyDecorator.Prop({ type: [Number, String], default: '' }),
91
+ __metadata("design:type", Object)
92
+ ], ZdRichText.prototype, "width", void 0);
93
+ __decorate([
94
+ vuePropertyDecorator.Prop({ type: [Number, String], default: '' }),
95
+ __metadata("design:type", Object)
96
+ ], ZdRichText.prototype, "height", void 0);
97
+ ZdRichText = __decorate([
98
+ vuePropertyDecorator.Component
99
+ ], ZdRichText);
100
+ var script = ZdRichText;
101
+
102
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
103
+ if (typeof shadowMode !== 'boolean') {
104
+ createInjectorSSR = createInjector;
105
+ createInjector = shadowMode;
106
+ shadowMode = false;
107
+ }
108
+ // Vue.extend constructor export interop.
109
+ const options = typeof script === 'function' ? script.options : script;
110
+ // render functions
111
+ if (template && template.render) {
112
+ options.render = template.render;
113
+ options.staticRenderFns = template.staticRenderFns;
114
+ options._compiled = true;
115
+ // functional template
116
+ if (isFunctionalTemplate) {
117
+ options.functional = true;
118
+ }
119
+ }
120
+ // scopedId
121
+ if (scopeId) {
122
+ options._scopeId = scopeId;
123
+ }
124
+ let hook;
125
+ if (moduleIdentifier) {
126
+ // server build
127
+ hook = function (context) {
128
+ // 2.3 injection
129
+ context =
130
+ context || // cached call
131
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
132
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
133
+ // 2.2 with runInNewContext: true
134
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
135
+ context = __VUE_SSR_CONTEXT__;
136
+ }
137
+ // inject component styles
138
+ if (style) {
139
+ style.call(this, createInjectorSSR(context));
140
+ }
141
+ // register component module identifier for async chunk inference
142
+ if (context && context._registeredComponents) {
143
+ context._registeredComponents.add(moduleIdentifier);
144
+ }
145
+ };
146
+ // used by ssr in case component is cached and beforeCreate
147
+ // never gets called
148
+ options._ssrRegister = hook;
149
+ }
150
+ else if (style) {
151
+ hook = shadowMode
152
+ ? function (context) {
153
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
154
+ }
155
+ : function (context) {
156
+ style.call(this, createInjector(context));
157
+ };
158
+ }
159
+ if (hook) {
160
+ if (options.functional) {
161
+ // register for functional component in vue file
162
+ const originalRender = options.render;
163
+ options.render = function renderWithStyleInjection(h, context) {
164
+ hook.call(context);
165
+ return originalRender(h, context);
166
+ };
167
+ }
168
+ else {
169
+ // inject component registration as beforeCreate hook
170
+ const existing = options.beforeCreate;
171
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
172
+ }
173
+ }
174
+ return script;
175
+ }
176
+
177
+ const isOldIE = typeof navigator !== 'undefined' &&
178
+ /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
179
+ function createInjector(context) {
180
+ return (id, style) => addStyle(id, style);
181
+ }
182
+ let HEAD;
183
+ const styles = {};
184
+ function addStyle(id, css) {
185
+ const group = isOldIE ? css.media || 'default' : id;
186
+ const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
187
+ if (!style.ids.has(id)) {
188
+ style.ids.add(id);
189
+ let code = css.source;
190
+ if (css.map) {
191
+ // https://developer.chrome.com/devtools/docs/javascript-debugging
192
+ // this makes source maps inside style tags work properly in Chrome
193
+ code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
194
+ // http://stackoverflow.com/a/26603875
195
+ code +=
196
+ '\n/*# sourceMappingURL=data:application/json;base64,' +
197
+ btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
198
+ ' */';
199
+ }
200
+ if (!style.element) {
201
+ style.element = document.createElement('style');
202
+ style.element.type = 'text/css';
203
+ if (css.media)
204
+ style.element.setAttribute('media', css.media);
205
+ if (HEAD === undefined) {
206
+ HEAD = document.head || document.getElementsByTagName('head')[0];
207
+ }
208
+ HEAD.appendChild(style.element);
209
+ }
210
+ if ('styleSheet' in style.element) {
211
+ style.styles.push(code);
212
+ style.element.styleSheet.cssText = style.styles
213
+ .filter(Boolean)
214
+ .join('\n');
215
+ }
216
+ else {
217
+ const index = style.ids.size - 1;
218
+ const textNode = document.createTextNode(code);
219
+ const nodes = style.element.childNodes;
220
+ if (nodes[index])
221
+ style.element.removeChild(nodes[index]);
222
+ if (nodes.length)
223
+ style.element.insertBefore(textNode, nodes[index]);
224
+ else
225
+ style.element.appendChild(textNode);
226
+ }
227
+ }
228
+ }
229
+
230
+ /* script */
231
+ const __vue_script__ = script;
232
+
233
+ /* template */
234
+ var __vue_render__ = function() {
235
+ var _vm = this;
236
+ var _h = _vm.$createElement;
237
+ var _c = _vm._self._c || _h;
238
+ return _c("tiptap-vuetify", {
239
+ attrs: {
240
+ "output-format": _vm.instance.outputFormat,
241
+ extensions: _vm.extensions,
242
+ "toolbar-attributes": {
243
+ color: _vm.instance.toolbarColor,
244
+ class: "rounded-t",
245
+ width: _vm.instance.width
246
+ },
247
+ "card-props": {
248
+ color: _vm.instance.cardColor,
249
+ class: "rounded-b-md",
250
+ outlined: _vm.instance.outlined,
251
+ width: _vm.instance.width,
252
+ height: _vm.instance.height
253
+ },
254
+ placeholder: _vm.instance.placeholder,
255
+ disabled: _vm.instance.disabled
256
+ },
257
+ on: { keydown: _vm.onKeyDown },
258
+ model: {
259
+ value: _vm.instance.content,
260
+ callback: function($$v) {
261
+ _vm.$set(_vm.instance, "content", $$v);
262
+ },
263
+ expression: "instance.content"
264
+ }
265
+ })
266
+ };
267
+ var __vue_staticRenderFns__ = [];
268
+ __vue_render__._withStripped = true;
269
+
270
+ /* style */
271
+ const __vue_inject_styles__ = function (inject) {
272
+ if (!inject) return
273
+ inject("data-v-646cc640_0", { source: "button.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n\n/*# sourceMappingURL=RichText.vue.map */", map: {"version":3,"sources":["/Users/zedmartins/workfolder/zeedhi/richtext/packages/vue/src/RichText.vue","RichText.vue"],"names":[],"mappings":"AA2BA;EACA,cAAA;AC1BA;;AAEA,uCAAuC","file":"RichText.vue","sourcesContent":["<template>\n <tiptap-vuetify\n v-model=\"instance.content\"\n :output-format=\"instance.outputFormat\"\n :extensions=\"extensions\"\n :toolbar-attributes=\"{\n color: instance.toolbarColor,\n class: 'rounded-t',\n width: instance.width,\n }\"\n :card-props=\"{\n color: instance.cardColor,\n class: 'rounded-b-md',\n outlined: instance.outlined,\n width: instance.width,\n height: instance.height,\n }\"\n :placeholder=\"instance.placeholder\"\n :disabled=\"instance.disabled\"\n @keydown=\"onKeyDown\"\n >\n </tiptap-vuetify>\n</template>\n\n<script lang=\"ts\" src=\"./RichText.ts\"></script>\n\n<style lang=\"scss\">\nbutton.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n</style>","button.v-btn.v-btn--icon.v-btn--round.theme--light.v-size--small.tiptap-vuetify-editor__action-render-btn {\n color: #ffffff;\n}\n\n/*# sourceMappingURL=RichText.vue.map */"]}, media: undefined });
274
+
275
+ };
276
+ /* scoped */
277
+ const __vue_scope_id__ = undefined;
278
+ /* module identifier */
279
+ const __vue_module_identifier__ = undefined;
280
+ /* functional template */
281
+ const __vue_is_functional_template__ = false;
282
+ /* style inject SSR */
283
+
284
+ /* style inject shadow dom */
285
+
286
+
287
+
288
+ const __vue_component__ = /*#__PURE__*/normalizeComponent(
289
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
290
+ __vue_inject_styles__,
291
+ __vue_script__,
292
+ __vue_scope_id__,
293
+ __vue_is_functional_template__,
294
+ __vue_module_identifier__,
295
+ false,
296
+ createInjector,
297
+ undefined,
298
+ undefined
299
+ );
300
+
301
+ const TiptapVuetify = require('tiptap-vuetify');
302
+ // tiptap-vuetify
303
+ Vue__default["default"].use(TiptapVuetify.TiptapVuetifyPlugin, {
304
+ vuetify: new vuetify.Vuetify(),
305
+ iconsGroup: 'mdi'
306
+ });
307
+ Vue__default["default"].component('tiptap-vuetify', TiptapVuetify.TiptapVuetify);
308
+
309
+ exports.RichText = __vue_component__;
310
+
311
+ Object.defineProperty(exports, '__esModule', { value: true });
312
+
313
+ }));
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@zeedhi/zd-richtext-vue",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "RichTextVue by BVR",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
5
8
  "main": "dist/rich-text-vue.umd.js",
6
9
  "module": "dist/rich-text-vue.esm.js",
7
10
  "typings": "types/index.d.ts",
@@ -15,10 +18,10 @@
15
18
  },
16
19
  "peerDependencies": {
17
20
  "@zeedhi/vuetify": "*",
21
+ "@zeedhi/zd-richtext-common": "file:packages/common",
18
22
  "vue": "^2.6.12",
19
23
  "vue-class-component": "^7.2.6",
20
- "vue-property-decorator": "^9.1.2",
21
- "zd-rich-text-common": "file:packages/common"
24
+ "vue-property-decorator": "^9.1.2"
22
25
  },
23
- "gitHead": "6167df0f22df4a4694cc987de22de584f8e4fc2a"
26
+ "gitHead": "7f88f3d7f9bc750789f2ecea3b363472c61ee6c4"
24
27
  }
@@ -0,0 +1,16 @@
1
+ import { RichText } from '@zeedhi/zd-richtext-common';
2
+ import { ZdComponentRender } from '@zeedhi/vuetify';
3
+ export default class ZdRichText extends ZdComponentRender {
4
+ outputFormat: string;
5
+ placeholder: string;
6
+ disabled: boolean | string;
7
+ toolbarColor: string;
8
+ cardColor: string;
9
+ outlined: boolean | string;
10
+ width: number | string;
11
+ height: number | string;
12
+ extensions: Array<any>;
13
+ instance: RichText;
14
+ instanceType: typeof RichText;
15
+ onKeyDown(event: KeyboardEvent): void;
16
+ }
@@ -0,0 +1,3 @@
1
+ import RichText from './RichText.vue';
2
+ import 'tiptap-vuetify/dist/main.css';
3
+ export { RichText };
@@ -0,0 +1,2 @@
1
+ import RichText from './RichText';
2
+ export { RichText };