vue2-bbl-editor 1.5.1 → 1.5.2
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.
- package/dist/vue2-bbl-editor.common.js +185 -89
- package/dist/vue2-bbl-editor.css +1 -1
- package/dist/vue2-bbl-editor.umd.js +185 -89
- package/dist/vue2-bbl-editor.umd.min.js +185 -89
- package/package.json +1 -1
|
@@ -370,9 +370,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
370
370
|
var heightMatch = style.match(/height:\s*(\d+)px/);
|
|
371
371
|
return {
|
|
372
372
|
src: element.getAttribute('src'),
|
|
373
|
-
width: widthMatch ? parseInt(widthMatch[1]) : element.getAttribute('width')
|
|
374
|
-
height: heightMatch ? parseInt(heightMatch[1]) : element.getAttribute('height')
|
|
373
|
+
width: widthMatch ? parseInt(widthMatch[1]) : element.getAttribute('width') ? parseInt(element.getAttribute('width')) : 560,
|
|
374
|
+
height: heightMatch ? parseInt(heightMatch[1]) : element.getAttribute('height') ? parseInt(element.getAttribute('height')) : 315,
|
|
375
375
|
align: element.getAttribute('data-align') || 'left',
|
|
376
|
+
display: element.getAttribute('data-display') || 'block',
|
|
376
377
|
spacing: element.getAttribute('data-spacing') || 'medium',
|
|
377
378
|
controls: element.getAttribute('controls') !== 'false',
|
|
378
379
|
nocookie: element.getAttribute('nocookie') === 'true'
|
|
@@ -387,9 +388,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
387
388
|
var heightMatch = style.match(/height:\s*(\d+)px/);
|
|
388
389
|
return {
|
|
389
390
|
src: element.getAttribute('src'),
|
|
390
|
-
width: widthMatch ? parseInt(widthMatch[1]) : element.getAttribute('width')
|
|
391
|
-
height: heightMatch ? parseInt(heightMatch[1]) : element.getAttribute('height')
|
|
391
|
+
width: widthMatch ? parseInt(widthMatch[1]) : element.getAttribute('width') ? parseInt(element.getAttribute('width')) : 560,
|
|
392
|
+
height: heightMatch ? parseInt(heightMatch[1]) : element.getAttribute('height') ? parseInt(element.getAttribute('height')) : 315,
|
|
392
393
|
align: element.getAttribute('data-align') || 'left',
|
|
394
|
+
display: element.getAttribute('data-display') || 'block',
|
|
393
395
|
spacing: element.getAttribute('data-spacing') || 'medium',
|
|
394
396
|
controls: element.getAttribute('controls') !== 'false',
|
|
395
397
|
nocookie: element.getAttribute('nocookie') === 'true'
|
|
@@ -408,9 +410,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
408
410
|
var heightMatch = style.match(/height:\s*(\d+)px/);
|
|
409
411
|
return {
|
|
410
412
|
src: iframe.getAttribute('src'),
|
|
411
|
-
width: widthMatch ? parseInt(widthMatch[1]) : iframe.getAttribute('width')
|
|
412
|
-
height: heightMatch ? parseInt(heightMatch[1]) : iframe.getAttribute('height')
|
|
413
|
+
width: widthMatch ? parseInt(widthMatch[1]) : iframe.getAttribute('width') ? parseInt(iframe.getAttribute('width')) : 560,
|
|
414
|
+
height: heightMatch ? parseInt(heightMatch[1]) : iframe.getAttribute('height') ? parseInt(iframe.getAttribute('height')) : 315,
|
|
413
415
|
align: element.getAttribute('data-align') || iframe.getAttribute('data-align') || 'left',
|
|
416
|
+
display: element.getAttribute('data-display') || iframe.getAttribute('data-display') || 'block',
|
|
414
417
|
spacing: element.getAttribute('data-spacing') || iframe.getAttribute('data-spacing') || 'medium',
|
|
415
418
|
controls: iframe.getAttribute('controls') !== 'false',
|
|
416
419
|
nocookie: iframe.getAttribute('nocookie') === 'true',
|
|
@@ -699,6 +702,14 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
699
702
|
iframe.style.margin = '0';
|
|
700
703
|
iframe.style.verticalAlign = 'top';
|
|
701
704
|
|
|
705
|
+
// Apply width and height from attributes to style for proper rendering
|
|
706
|
+
if (HTMLAttributes.width) {
|
|
707
|
+
iframe.style.width = HTMLAttributes.width + 'px';
|
|
708
|
+
}
|
|
709
|
+
if (HTMLAttributes.height) {
|
|
710
|
+
iframe.style.height = HTMLAttributes.height + 'px';
|
|
711
|
+
}
|
|
712
|
+
|
|
702
713
|
// Add resize handle
|
|
703
714
|
var resizeHandle = document.createElement('div');
|
|
704
715
|
resizeHandle.className = 'video-resize-handle';
|
|
@@ -1435,13 +1446,6 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
1435
1446
|
/* unused harmony reexport * */
|
|
1436
1447
|
|
|
1437
1448
|
|
|
1438
|
-
/***/ }),
|
|
1439
|
-
|
|
1440
|
-
/***/ "25e7":
|
|
1441
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1442
|
-
|
|
1443
|
-
// extracted by mini-css-extract-plugin
|
|
1444
|
-
|
|
1445
1449
|
/***/ }),
|
|
1446
1450
|
|
|
1447
1451
|
/***/ "2877":
|
|
@@ -1554,7 +1558,7 @@ function normalizeComponent(
|
|
|
1554
1558
|
|
|
1555
1559
|
"use strict";
|
|
1556
1560
|
|
|
1557
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a638e0e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/PremiumBblEditor.vue?vue&type=template&id=
|
|
1561
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a638e0e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/PremiumBblEditor.vue?vue&type=template&id=645beb94&scoped=true
|
|
1558
1562
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"premium-editor-container",class:[
|
|
1559
1563
|
("theme-" + _vm.theme),
|
|
1560
1564
|
_vm.editorClass
|
|
@@ -1562,7 +1566,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
|
|
|
1562
1566
|
var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',[_c('strong',[_vm._v("Missing Dependencies:")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"install-command"},[_c('p',[_c('strong',[_vm._v("Quick Fix:")])]),_c('code',[_vm._v("npm install @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"help-links"},[_c('a',{attrs:{"href":"https://github.com/kazi-shahin/vue2-bbl-editor#quick-setup","target":"_blank"}},[_vm._v("📖 Setup Guide")]),_c('a',{attrs:{"href":"https://github.com/kazi-shahin/vue2-bbl-editor/blob/main/TROUBLESHOOTING.md","target":"_blank"}},[_vm._v("🔧 Troubleshooting")])])}]
|
|
1563
1567
|
|
|
1564
1568
|
|
|
1565
|
-
// CONCATENATED MODULE: ./src/components/PremiumBblEditor.vue?vue&type=template&id=
|
|
1569
|
+
// CONCATENATED MODULE: ./src/components/PremiumBblEditor.vue?vue&type=template&id=645beb94&scoped=true
|
|
1566
1570
|
|
|
1567
1571
|
// EXTERNAL MODULE: external "@tiptap/vue-2"
|
|
1568
1572
|
var vue_2_ = __webpack_require__("9637");
|
|
@@ -2586,8 +2590,8 @@ var tables = __webpack_require__("e6b9");
|
|
|
2586
2590
|
});
|
|
2587
2591
|
// CONCATENATED MODULE: ./src/components/PremiumBblEditor.vue?vue&type=script&lang=js
|
|
2588
2592
|
/* harmony default export */ var components_PremiumBblEditorvue_type_script_lang_js = (PremiumBblEditorvue_type_script_lang_js);
|
|
2589
|
-
// EXTERNAL MODULE: ./src/components/PremiumBblEditor.vue?vue&type=style&index=0&id=
|
|
2590
|
-
var
|
|
2593
|
+
// EXTERNAL MODULE: ./src/components/PremiumBblEditor.vue?vue&type=style&index=0&id=645beb94&prod&scoped=true&lang=css
|
|
2594
|
+
var PremiumBblEditorvue_type_style_index_0_id_645beb94_prod_scoped_true_lang_css = __webpack_require__("ef69");
|
|
2591
2595
|
|
|
2592
2596
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2593
2597
|
var componentNormalizer = __webpack_require__("2877");
|
|
@@ -2607,24 +2611,13 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
2607
2611
|
staticRenderFns,
|
|
2608
2612
|
false,
|
|
2609
2613
|
null,
|
|
2610
|
-
"
|
|
2614
|
+
"645beb94",
|
|
2611
2615
|
null
|
|
2612
2616
|
|
|
2613
2617
|
)
|
|
2614
2618
|
|
|
2615
2619
|
/* harmony default export */ var PremiumBblEditor = __webpack_exports__["a"] = (component.exports);
|
|
2616
2620
|
|
|
2617
|
-
/***/ }),
|
|
2618
|
-
|
|
2619
|
-
/***/ "3132":
|
|
2620
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2621
|
-
|
|
2622
|
-
"use strict";
|
|
2623
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_2db30600_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bc05");
|
|
2624
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_2db30600_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_2db30600_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
|
|
2625
|
-
/* unused harmony reexport * */
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
2621
|
/***/ }),
|
|
2629
2622
|
|
|
2630
2623
|
/***/ "32d6":
|
|
@@ -3068,6 +3061,17 @@ module.exports = require("@tiptap/extension-table-header");
|
|
|
3068
3061
|
/* unused harmony reexport * */
|
|
3069
3062
|
|
|
3070
3063
|
|
|
3064
|
+
/***/ }),
|
|
3065
|
+
|
|
3066
|
+
/***/ "4ddd":
|
|
3067
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3068
|
+
|
|
3069
|
+
"use strict";
|
|
3070
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_cc6a3522_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("785c");
|
|
3071
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_cc6a3522_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditorOptionsAPI_vue_vue_type_style_index_0_id_cc6a3522_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
|
|
3072
|
+
/* unused harmony reexport * */
|
|
3073
|
+
|
|
3074
|
+
|
|
3071
3075
|
/***/ }),
|
|
3072
3076
|
|
|
3073
3077
|
/***/ "521c":
|
|
@@ -10303,6 +10307,13 @@ module.exports = require("@tiptap/extension-font-family");
|
|
|
10303
10307
|
|
|
10304
10308
|
/***/ }),
|
|
10305
10309
|
|
|
10310
|
+
/***/ "785c":
|
|
10311
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
10312
|
+
|
|
10313
|
+
// extracted by mini-css-extract-plugin
|
|
10314
|
+
|
|
10315
|
+
/***/ }),
|
|
10316
|
+
|
|
10306
10317
|
/***/ "7a7e":
|
|
10307
10318
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10308
10319
|
|
|
@@ -12834,16 +12845,20 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12834
12845
|
var shouldInsertNodeAtEnd = plugin.getState(newState);
|
|
12835
12846
|
var endPosition = doc.content.size;
|
|
12836
12847
|
var type = newState.schema.nodes[_this.options.node];
|
|
12837
|
-
if (!shouldInsertNodeAtEnd) {
|
|
12848
|
+
if (!shouldInsertNodeAtEnd || !type) {
|
|
12838
12849
|
return;
|
|
12839
12850
|
}
|
|
12840
12851
|
|
|
12841
12852
|
// Check if we need to add a trailing paragraph
|
|
12842
12853
|
var lastNode = doc.lastChild;
|
|
12843
12854
|
if (!lastNode || _this.options.blockElements.includes(lastNode.type.name)) {
|
|
12844
|
-
|
|
12855
|
+
// Ensure the insert position is valid
|
|
12856
|
+
var safeEndPosition = Math.min(endPosition, doc.content.size);
|
|
12857
|
+
if (safeEndPosition >= 0) {
|
|
12858
|
+
return tr.insert(safeEndPosition, type.create());
|
|
12859
|
+
}
|
|
12845
12860
|
}
|
|
12846
|
-
return
|
|
12861
|
+
return null;
|
|
12847
12862
|
},
|
|
12848
12863
|
state: {
|
|
12849
12864
|
init: function init(_, state) {
|
|
@@ -12865,6 +12880,7 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12865
12880
|
key: new state_dist["b" /* PluginKey */]('cursorPositioning'),
|
|
12866
12881
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
12867
12882
|
var tr = null;
|
|
12883
|
+
var docSize = newState.doc.content.size;
|
|
12868
12884
|
|
|
12869
12885
|
// Check if any transaction inserted a block element
|
|
12870
12886
|
transactions.forEach(function (transaction) {
|
|
@@ -12874,32 +12890,53 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12874
12890
|
var slice = step.slice;
|
|
12875
12891
|
if (slice && slice.content) {
|
|
12876
12892
|
slice.content.forEach(function (node) {
|
|
12893
|
+
var _node$attrs;
|
|
12877
12894
|
// If a block display element was inserted
|
|
12878
12895
|
var isBlockElement = _this.options.blockElements.includes(node.type.name);
|
|
12879
|
-
var isBlockDisplay = node.attrs.display === 'block' || node.type.name === 'table';
|
|
12896
|
+
var isBlockDisplay = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.display) === 'block' || node.type.name === 'table';
|
|
12880
12897
|
if (isBlockElement && isBlockDisplay) {
|
|
12881
12898
|
var insertPos = step.to || step.from;
|
|
12882
|
-
var nextPos = insertPos + node.nodeSize;
|
|
12899
|
+
var nextPos = Math.min(insertPos + node.nodeSize, docSize);
|
|
12883
12900
|
|
|
12884
|
-
//
|
|
12885
|
-
if (nextPos >=
|
|
12886
|
-
//
|
|
12887
|
-
if (
|
|
12888
|
-
|
|
12889
|
-
}
|
|
12890
|
-
var paragraphType = newState.schema.nodes.paragraph;
|
|
12891
|
-
tr.insert(nextPos, paragraphType.create());
|
|
12892
|
-
|
|
12893
|
-
// Position cursor in the new paragraph
|
|
12894
|
-
tr.setSelection(newState.selection.constructor.near(tr.doc.resolve(nextPos + 1)));
|
|
12895
|
-
} else {
|
|
12896
|
-
// Position cursor after the inserted element
|
|
12897
|
-
var nextNode = newState.doc.nodeAt(nextPos);
|
|
12898
|
-
if (nextNode && nextNode.type.name === 'paragraph') {
|
|
12901
|
+
// Ensure positions are within valid range
|
|
12902
|
+
if (insertPos >= 0 && insertPos <= docSize && nextPos >= 0 && nextPos <= docSize) {
|
|
12903
|
+
// Check if there's content after the inserted element
|
|
12904
|
+
if (nextPos >= docSize) {
|
|
12905
|
+
// Add a paragraph after the block element
|
|
12899
12906
|
if (!tr) {
|
|
12900
12907
|
tr = newState.tr;
|
|
12901
12908
|
}
|
|
12902
|
-
|
|
12909
|
+
var paragraphType = newState.schema.nodes.paragraph;
|
|
12910
|
+
var safeInsertPos = Math.min(nextPos, tr.doc.content.size);
|
|
12911
|
+
tr.insert(safeInsertPos, paragraphType.create());
|
|
12912
|
+
|
|
12913
|
+
// Position cursor in the new paragraph safely
|
|
12914
|
+
var cursorPos = Math.min(safeInsertPos + 1, tr.doc.content.size);
|
|
12915
|
+
if (cursorPos > 0 && cursorPos <= tr.doc.content.size) {
|
|
12916
|
+
try {
|
|
12917
|
+
tr.setSelection(newState.selection.constructor.near(tr.doc.resolve(cursorPos)));
|
|
12918
|
+
} catch (e) {
|
|
12919
|
+
// Fallback to end of document if position is invalid
|
|
12920
|
+
tr.setSelection(newState.selection.constructor.atEnd(tr.doc));
|
|
12921
|
+
}
|
|
12922
|
+
}
|
|
12923
|
+
} else {
|
|
12924
|
+
// Position cursor after the inserted element
|
|
12925
|
+
var nextNode = newState.doc.nodeAt(nextPos);
|
|
12926
|
+
if (nextNode && nextNode.type.name === 'paragraph') {
|
|
12927
|
+
if (!tr) {
|
|
12928
|
+
tr = newState.tr;
|
|
12929
|
+
}
|
|
12930
|
+
var _cursorPos = Math.min(nextPos + 1, newState.doc.content.size);
|
|
12931
|
+
if (_cursorPos > 0 && _cursorPos <= newState.doc.content.size) {
|
|
12932
|
+
try {
|
|
12933
|
+
tr.setSelection(newState.selection.constructor.near(tr.doc.resolve(_cursorPos)));
|
|
12934
|
+
} catch (e) {
|
|
12935
|
+
// Fallback to end of document if position is invalid
|
|
12936
|
+
tr.setSelection(newState.selection.constructor.atEnd(tr.doc));
|
|
12937
|
+
}
|
|
12938
|
+
}
|
|
12939
|
+
}
|
|
12903
12940
|
}
|
|
12904
12941
|
}
|
|
12905
12942
|
}
|
|
@@ -12935,15 +12972,29 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12935
12972
|
var tr = state.tr,
|
|
12936
12973
|
selection = state.selection;
|
|
12937
12974
|
var pos = selection.to;
|
|
12938
|
-
var
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12975
|
+
var docSize = tr.doc.content.size;
|
|
12976
|
+
|
|
12977
|
+
// Ensure position is within valid range
|
|
12978
|
+
if (pos >= 0 && pos <= docSize) {
|
|
12979
|
+
var nextNode = tr.doc.nodeAt(pos);
|
|
12980
|
+
if (!nextNode || _this2.options.blockElements.includes(nextNode.type.name)) {
|
|
12981
|
+
var paragraphType = state.schema.nodes.paragraph;
|
|
12982
|
+
var safeInsertPos = Math.min(pos, docSize);
|
|
12983
|
+
tr.insert(safeInsertPos, paragraphType.create());
|
|
12984
|
+
|
|
12985
|
+
// Position cursor in the new paragraph safely
|
|
12986
|
+
var newPos = Math.min(safeInsertPos + 1, tr.doc.content.size);
|
|
12987
|
+
if (newPos > 0 && newPos <= tr.doc.content.size) {
|
|
12988
|
+
try {
|
|
12989
|
+
tr.setSelection(selection.constructor.near(tr.doc.resolve(newPos)));
|
|
12990
|
+
dispatch(tr);
|
|
12991
|
+
} catch (e) {
|
|
12992
|
+
// Fallback to end of document if position is invalid
|
|
12993
|
+
tr.setSelection(selection.constructor.atEnd(tr.doc));
|
|
12994
|
+
dispatch(tr);
|
|
12995
|
+
}
|
|
12996
|
+
}
|
|
12997
|
+
}
|
|
12947
12998
|
}
|
|
12948
12999
|
}
|
|
12949
13000
|
return result;
|
|
@@ -12962,6 +13013,11 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12962
13013
|
var pos = selection.to;
|
|
12963
13014
|
var endPos = doc.content.size;
|
|
12964
13015
|
|
|
13016
|
+
// Ensure position is within valid range
|
|
13017
|
+
if (pos < 0 || pos > endPos) {
|
|
13018
|
+
return false;
|
|
13019
|
+
}
|
|
13020
|
+
|
|
12965
13021
|
// If we're at the end of the document
|
|
12966
13022
|
if (pos >= endPos - 1) {
|
|
12967
13023
|
var lastNode = doc.lastChild;
|
|
@@ -12969,7 +13025,8 @@ var state_dist = __webpack_require__("7c31");
|
|
|
12969
13025
|
// If the last node is a block element, add a paragraph
|
|
12970
13026
|
if (lastNode && _this2.options.blockElements.includes(lastNode.type.name)) {
|
|
12971
13027
|
var paragraphType = state.schema.nodes.paragraph;
|
|
12972
|
-
|
|
13028
|
+
var safeInsertPos = Math.min(endPos, doc.content.size);
|
|
13029
|
+
tr.insert(safeInsertPos, paragraphType.create());
|
|
12973
13030
|
if (dispatch) {
|
|
12974
13031
|
dispatch(tr);
|
|
12975
13032
|
}
|
|
@@ -23131,6 +23188,13 @@ var SplitCell_component = Object(componentNormalizer["a" /* default */])(
|
|
|
23131
23188
|
|
|
23132
23189
|
/***/ }),
|
|
23133
23190
|
|
|
23191
|
+
/***/ "a99c":
|
|
23192
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
23193
|
+
|
|
23194
|
+
// extracted by mini-css-extract-plugin
|
|
23195
|
+
|
|
23196
|
+
/***/ }),
|
|
23197
|
+
|
|
23134
23198
|
/***/ "aa88":
|
|
23135
23199
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
23136
23200
|
|
|
@@ -26778,13 +26842,6 @@ function _toPrimitive(t, r) {
|
|
|
26778
26842
|
|
|
26779
26843
|
/***/ }),
|
|
26780
26844
|
|
|
26781
|
-
/***/ "bc05":
|
|
26782
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
26783
|
-
|
|
26784
|
-
// extracted by mini-css-extract-plugin
|
|
26785
|
-
|
|
26786
|
-
/***/ }),
|
|
26787
|
-
|
|
26788
26845
|
/***/ "bc12":
|
|
26789
26846
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
26790
26847
|
|
|
@@ -29531,13 +29588,18 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
29531
29588
|
return [{
|
|
29532
29589
|
tag: 'img[src]',
|
|
29533
29590
|
getAttrs: function getAttrs(element) {
|
|
29591
|
+
// Extract width and height from style if available, fallback to attributes
|
|
29592
|
+
var style = element.getAttribute('style') || '';
|
|
29593
|
+
var widthMatch = style.match(/width:\s*(\d+)px/);
|
|
29594
|
+
var heightMatch = style.match(/height:\s*(\d+)px/);
|
|
29534
29595
|
return {
|
|
29535
29596
|
src: element.getAttribute('src'),
|
|
29536
29597
|
alt: element.getAttribute('alt'),
|
|
29537
29598
|
title: element.getAttribute('title'),
|
|
29538
|
-
width: element.getAttribute('width'),
|
|
29539
|
-
height: element.getAttribute('height'),
|
|
29599
|
+
width: widthMatch ? parseInt(widthMatch[1]) : element.getAttribute('width') ? parseInt(element.getAttribute('width')) : null,
|
|
29600
|
+
height: heightMatch ? parseInt(heightMatch[1]) : element.getAttribute('height') ? parseInt(element.getAttribute('height')) : null,
|
|
29540
29601
|
align: element.getAttribute('data-align') || 'left',
|
|
29602
|
+
display: element.getAttribute('data-display') || 'block',
|
|
29541
29603
|
spacing: element.getAttribute('data-spacing') || 'medium'
|
|
29542
29604
|
};
|
|
29543
29605
|
}
|
|
@@ -29556,9 +29618,34 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
29556
29618
|
src: img.getAttribute('src'),
|
|
29557
29619
|
alt: img.getAttribute('alt'),
|
|
29558
29620
|
title: img.getAttribute('title'),
|
|
29559
|
-
width: widthMatch ? widthMatch[1] : null,
|
|
29560
|
-
height: heightMatch ? heightMatch[1] : null,
|
|
29621
|
+
width: widthMatch ? parseInt(widthMatch[1]) : img.getAttribute('width') ? parseInt(img.getAttribute('width')) : null,
|
|
29622
|
+
height: heightMatch ? parseInt(heightMatch[1]) : img.getAttribute('height') ? parseInt(img.getAttribute('height')) : null,
|
|
29623
|
+
align: element.getAttribute('data-align') || 'left',
|
|
29624
|
+
display: element.getAttribute('data-display') || 'block',
|
|
29625
|
+
spacing: element.getAttribute('data-spacing') || 'medium',
|
|
29626
|
+
caption: figcaption ? figcaption.textContent : '',
|
|
29627
|
+
captionPosition: figcaption ? 'bottom' : 'none'
|
|
29628
|
+
};
|
|
29629
|
+
}
|
|
29630
|
+
}, {
|
|
29631
|
+
tag: 'div[data-display][data-align]',
|
|
29632
|
+
getAttrs: function getAttrs(element) {
|
|
29633
|
+
var img = element.querySelector('img');
|
|
29634
|
+
var figcaption = element.querySelector('figcaption');
|
|
29635
|
+
if (!img) return false;
|
|
29636
|
+
|
|
29637
|
+
// Extract width and height from img style
|
|
29638
|
+
var imgStyle = img.getAttribute('style') || '';
|
|
29639
|
+
var widthMatch = imgStyle.match(/width:\s*(\d+)px/);
|
|
29640
|
+
var heightMatch = imgStyle.match(/height:\s*(\d+)px/);
|
|
29641
|
+
return {
|
|
29642
|
+
src: img.getAttribute('src'),
|
|
29643
|
+
alt: img.getAttribute('alt'),
|
|
29644
|
+
title: img.getAttribute('title'),
|
|
29645
|
+
width: widthMatch ? parseInt(widthMatch[1]) : img.getAttribute('width') ? parseInt(img.getAttribute('width')) : null,
|
|
29646
|
+
height: heightMatch ? parseInt(heightMatch[1]) : img.getAttribute('height') ? parseInt(img.getAttribute('height')) : null,
|
|
29561
29647
|
align: element.getAttribute('data-align') || 'left',
|
|
29648
|
+
display: element.getAttribute('data-display') || 'block',
|
|
29562
29649
|
spacing: element.getAttribute('data-spacing') || 'medium',
|
|
29563
29650
|
caption: figcaption ? figcaption.textContent : '',
|
|
29564
29651
|
captionPosition: figcaption ? 'bottom' : 'none'
|
|
@@ -29574,9 +29661,10 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
29574
29661
|
src: img.getAttribute('src'),
|
|
29575
29662
|
alt: img.getAttribute('alt'),
|
|
29576
29663
|
title: img.getAttribute('title'),
|
|
29577
|
-
width: img.getAttribute('width'),
|
|
29578
|
-
height: img.getAttribute('height'),
|
|
29664
|
+
width: img.getAttribute('width') ? parseInt(img.getAttribute('width')) : null,
|
|
29665
|
+
height: img.getAttribute('height') ? parseInt(img.getAttribute('height')) : null,
|
|
29579
29666
|
align: element.getAttribute('data-align') || 'left',
|
|
29667
|
+
display: element.getAttribute('data-display') || 'block',
|
|
29580
29668
|
spacing: element.getAttribute('data-spacing') || 'medium',
|
|
29581
29669
|
caption: figcaption ? figcaption.textContent : '',
|
|
29582
29670
|
captionPosition: figcaption ? 'bottom' : 'none'
|
|
@@ -29860,6 +29948,14 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
29860
29948
|
img.style.margin = '0';
|
|
29861
29949
|
img.style.verticalAlign = 'top';
|
|
29862
29950
|
|
|
29951
|
+
// Apply width and height from attributes to style for proper rendering
|
|
29952
|
+
if (HTMLAttributes.width) {
|
|
29953
|
+
img.style.width = HTMLAttributes.width + 'px';
|
|
29954
|
+
}
|
|
29955
|
+
if (HTMLAttributes.height) {
|
|
29956
|
+
img.style.height = HTMLAttributes.height + 'px';
|
|
29957
|
+
}
|
|
29958
|
+
|
|
29863
29959
|
// Add resize handles
|
|
29864
29960
|
var resizeHandle = document.createElement('div');
|
|
29865
29961
|
resizeHandle.className = 'resize-handle';
|
|
@@ -30496,17 +30592,6 @@ var uploadMixin = {
|
|
|
30496
30592
|
/* unused harmony reexport * */
|
|
30497
30593
|
|
|
30498
30594
|
|
|
30499
|
-
/***/ }),
|
|
30500
|
-
|
|
30501
|
-
/***/ "dffc":
|
|
30502
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
30503
|
-
|
|
30504
|
-
"use strict";
|
|
30505
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_74a36ee2_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("25e7");
|
|
30506
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_74a36ee2_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_74a36ee2_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
|
|
30507
|
-
/* unused harmony reexport * */
|
|
30508
|
-
|
|
30509
|
-
|
|
30510
30595
|
/***/ }),
|
|
30511
30596
|
|
|
30512
30597
|
/***/ "e6b9":
|
|
@@ -30525,6 +30610,17 @@ var uploadMixin = {
|
|
|
30525
30610
|
/* unused harmony reexport * */
|
|
30526
30611
|
|
|
30527
30612
|
|
|
30613
|
+
/***/ }),
|
|
30614
|
+
|
|
30615
|
+
/***/ "ef69":
|
|
30616
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
30617
|
+
|
|
30618
|
+
"use strict";
|
|
30619
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_645beb94_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a99c");
|
|
30620
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_645beb94_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PremiumBblEditor_vue_vue_type_style_index_0_id_645beb94_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
|
|
30621
|
+
/* unused harmony reexport * */
|
|
30622
|
+
|
|
30623
|
+
|
|
30528
30624
|
/***/ }),
|
|
30529
30625
|
|
|
30530
30626
|
/***/ "f39e":
|
|
@@ -30854,7 +30950,7 @@ if (typeof window !== 'undefined') {
|
|
|
30854
30950
|
// EXTERNAL MODULE: ./src/components/PremiumBblEditor.vue + 4 modules
|
|
30855
30951
|
var PremiumBblEditor = __webpack_require__("2cce");
|
|
30856
30952
|
|
|
30857
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a638e0e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=template&id=
|
|
30953
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a638e0e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=template&id=cc6a3522&scoped=true
|
|
30858
30954
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"premium-editor-container",class:[
|
|
30859
30955
|
("theme-" + _vm.theme),
|
|
30860
30956
|
_vm.editorClass
|
|
@@ -30862,7 +30958,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
|
|
|
30862
30958
|
var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',[_c('strong',[_vm._v("Missing Dependencies:")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"install-command"},[_c('p',[_c('strong',[_vm._v("Quick Fix:")])]),_c('code',[_vm._v("npm install @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"help-links"},[_c('a',{attrs:{"href":"https://github.com/kazi-shahin/vue2-bbl-editor#quick-setup","target":"_blank"}},[_vm._v("📖 Setup Guide")]),_c('a',{attrs:{"href":"https://github.com/kazi-shahin/vue2-bbl-editor/blob/main/TROUBLESHOOTING.md","target":"_blank"}},[_vm._v("🔧 Troubleshooting")])])}]
|
|
30863
30959
|
|
|
30864
30960
|
|
|
30865
|
-
// CONCATENATED MODULE: ./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=template&id=
|
|
30961
|
+
// CONCATENATED MODULE: ./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=template&id=cc6a3522&scoped=true
|
|
30866
30962
|
|
|
30867
30963
|
// EXTERNAL MODULE: external "@tiptap/vue-2"
|
|
30868
30964
|
var vue_2_ = __webpack_require__("9637");
|
|
@@ -32591,8 +32687,8 @@ var LineHeight = core_["Extension"].create({
|
|
|
32591
32687
|
});
|
|
32592
32688
|
// CONCATENATED MODULE: ./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=script&lang=js
|
|
32593
32689
|
/* harmony default export */ var components_PremiumBblEditorOptionsAPIvue_type_script_lang_js = (PremiumBblEditorOptionsAPIvue_type_script_lang_js);
|
|
32594
|
-
// EXTERNAL MODULE: ./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=style&index=0&id=
|
|
32595
|
-
var
|
|
32690
|
+
// EXTERNAL MODULE: ./src/components/PremiumBblEditorOptionsAPI.vue?vue&type=style&index=0&id=cc6a3522&prod&scoped=true&lang=css
|
|
32691
|
+
var PremiumBblEditorOptionsAPIvue_type_style_index_0_id_cc6a3522_prod_scoped_true_lang_css = __webpack_require__("4ddd");
|
|
32596
32692
|
|
|
32597
32693
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
32598
32694
|
var componentNormalizer = __webpack_require__("2877");
|
|
@@ -32612,7 +32708,7 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
32612
32708
|
staticRenderFns,
|
|
32613
32709
|
false,
|
|
32614
32710
|
null,
|
|
32615
|
-
"
|
|
32711
|
+
"cc6a3522",
|
|
32616
32712
|
null
|
|
32617
32713
|
|
|
32618
32714
|
)
|