@ostendis/grapesjs-preset-ostendis-adv 1.2.4 → 1.3.1
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.
|
@@ -21785,28 +21785,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21785
21785
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21786
21786
|
/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)
|
|
21787
21787
|
/* harmony export */ });
|
|
21788
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
21789
|
-
__assign = Object.assign || function(t) {
|
|
21790
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21791
|
-
s = arguments[i];
|
|
21792
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21793
|
-
t[p] = s[p];
|
|
21794
|
-
}
|
|
21795
|
-
return t;
|
|
21796
|
-
};
|
|
21797
|
-
return __assign.apply(this, arguments);
|
|
21798
|
-
};
|
|
21799
21788
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(editor, opts) {
|
|
21800
|
-
|
|
21801
|
-
|
|
21789
|
+
const { Blocks } = editor;
|
|
21790
|
+
const addBlock = (id, blockDef) => {
|
|
21802
21791
|
opts.blocks.indexOf(id) >= 0 &&
|
|
21803
|
-
editor.Blocks.add(id,
|
|
21792
|
+
editor.Blocks.add(id, Object.assign(Object.assign({ select: true }, blockDef), opts.block(id)));
|
|
21804
21793
|
};
|
|
21805
21794
|
Blocks.getAll().reset();
|
|
21806
21795
|
Blocks.add("applyQrCode", {
|
|
21807
21796
|
label: opts.t9n.applyQrCodeBlkLabel,
|
|
21808
21797
|
category: opts.t9n.categoryLabel,
|
|
21809
|
-
media:
|
|
21798
|
+
media: `<svg style="width:60px;" viewBox="0 0 12.7 9.525">
|
|
21799
|
+
<path fill="currentColor" d="m2.7781 1.1906v2.2964h2.2964v-2.2964zm3.1469 0v0.76565h0.76507v-0.76565zm1.7005 0v2.2964h2.2964v-2.2964zm-4.0817 0.76565h0.76507v0.76507h-0.76507zm4.8474 0h0.76507v0.76507h-0.76507zm-2.4661 0.82902v0.76507h0.76507v-0.76507zm-3.1469 1.5947v0.76507h0.76565v-0.76507zm1.5307 0v0.76507h0.76565v-0.76507zm1.6162 0v0.76507h0.76507v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm-3.2312 1.5947v0.76507h0.76507v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm-6.3781 0.063368v2.2964h2.2964v-2.2964zm0.76565 0.76565h0.76507v0.76507h-0.76507zm2.3813 0.76507v0.76565h0.76507v-0.76565zm1.6156 0v0.76565h0.76565v-0.76565zm1.6156 0v0.76565h0.76565v-0.76565z" stroke-width=".51027"/>
|
|
21800
|
+
</svg>`,
|
|
21810
21801
|
content: {
|
|
21811
21802
|
type: "image",
|
|
21812
21803
|
editable: false,
|
|
@@ -21820,7 +21811,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21820
21811
|
Blocks.add("viewQrCode", {
|
|
21821
21812
|
label: opts.t9n.viewQrCodeBlkLabel,
|
|
21822
21813
|
category: opts.t9n.categoryLabel,
|
|
21823
|
-
media:
|
|
21814
|
+
media: `<svg style="width:60px;" viewBox="0 0 12.7 9.525">
|
|
21815
|
+
<path fill="currentColor" d="m2.7781 1.1906v2.2964h2.2964v-2.2964zm3.1469 0v0.76565h0.76507v-0.76565zm1.7005 0v2.2964h2.2964v-2.2964zm-4.0817 0.76565h0.76507v0.76507h-0.76507zm4.8474 0h0.76507v0.76507h-0.76507zm-2.4661 0.82902v0.76507h0.76507v-0.76507zm-3.1469 1.5947v0.76507h0.76565v-0.76507zm1.5307 0v0.76507h0.76565v-0.76507zm1.6162 0v0.76507h0.76507v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm-3.2312 1.5947v0.76507h0.76507v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm1.6156 0v0.76507h0.76565v-0.76507zm-6.3781 0.063368v2.2964h2.2964v-2.2964zm0.76565 0.76565h0.76507v0.76507h-0.76507zm2.3813 0.76507v0.76565h0.76507v-0.76565zm1.6156 0v0.76565h0.76565v-0.76565zm1.6156 0v0.76565h0.76565v-0.76565z" stroke-width=".51027"/>
|
|
21816
|
+
</svg>`,
|
|
21824
21817
|
content: {
|
|
21825
21818
|
type: "image",
|
|
21826
21819
|
editable: false,
|
|
@@ -21831,27 +21824,33 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21831
21824
|
},
|
|
21832
21825
|
},
|
|
21833
21826
|
});
|
|
21834
|
-
var btnStyle =
|
|
21827
|
+
var btnStyle = `display: block; padding: 10px 30px; margin: 10px auto; text-decoration: none; border: none; color: #fff; text-align: center; background-color: #4b75cd; border-radius: 0.25rem 0.25rem 0.25em 0.25rem;`;
|
|
21835
21828
|
Blocks.add("applyButton", {
|
|
21836
21829
|
label: opts.t9n.buttonApplyBlkLabel,
|
|
21837
21830
|
category: opts.t9n.categoryLabel,
|
|
21838
|
-
content:
|
|
21831
|
+
content: `<a data-gjs-type="link" href="$$$ApplyLink$$$" target="_blank" role="button" style="` +
|
|
21839
21832
|
btnStyle +
|
|
21840
|
-
"
|
|
21841
|
-
media:
|
|
21833
|
+
`">${opts.t9n.buttonApplyBlkText}</a>`,
|
|
21834
|
+
media: `<svg style="width:54px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21835
|
+
<path fill="currentColor" d="m0.87695 1.1856c-0.46379 0-0.87695 0.3355-0.87695 0.7891v3.2851c0 0.4536 0.41316 0.7891 0.87695 0.7891h5.3676v1.7446c0 0.12334 0.099882 0.22273 0.22221 0.22273 0.063691 0 0.12549-0.027437 0.16795-0.075964l0.83509-0.9555 0.58704 1.1762c0.079866 0.15973 0.27435 0.22404 0.43408 0.14418 0.15973-0.079866 0.22404-0.27383 0.14418-0.43357l-0.57309-1.1493h1.1942c0.12334 0 0.22324-0.10042 0.22324-0.22376 0-0.063691-0.027421-0.12394-0.074931-0.1664l-0.31884-0.28319h2.7363c0.46379 0 0.87695-0.3355 0.87695-0.7891v-3.2851c0-0.4536-0.41316-0.7891-0.87695-0.7891zm0 0.48214h10.945c0.2413 0 0.39688 0.15381 0.39688 0.30696v3.2851c0 0.15315-0.15557 0.30644-0.39688 0.30644h-3.2789l-1.9084-1.696c-0.043471-0.038418-0.09792-0.059945-0.15555-0.059945-0.1294 0-0.23461 0.10521-0.23461 0.23461v1.5214h-5.3676c-0.2413 0-0.39429-0.15329-0.39429-0.30644v-3.2851c0-0.15315 0.15299-0.30696 0.39429-0.30696z"/>
|
|
21836
|
+
</svg>`,
|
|
21842
21837
|
});
|
|
21843
21838
|
Blocks.add("button", {
|
|
21844
21839
|
label: opts.t9n.buttonBlkLabel,
|
|
21845
21840
|
category: opts.t9n.categoryLabel,
|
|
21846
|
-
content:
|
|
21841
|
+
content: `<a data-gjs-type="link" role="button" style="` +
|
|
21847
21842
|
btnStyle +
|
|
21848
|
-
"
|
|
21849
|
-
media:
|
|
21843
|
+
`">Button</a>`,
|
|
21844
|
+
media: `<svg style="width:54px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21845
|
+
<path fill="currentColor" d="m0.87695 1.1856c-0.46379 0-0.87695 0.3355-0.87695 0.7891v3.2851c0 0.4536 0.41316 0.7891 0.87695 0.7891h5.3676v1.7446c0 0.12334 0.099882 0.22273 0.22221 0.22273 0.063691 0 0.12549-0.027437 0.16795-0.075964l0.83509-0.9555 0.58704 1.1762c0.079866 0.15973 0.27435 0.22404 0.43408 0.14418 0.15973-0.079866 0.22404-0.27383 0.14418-0.43357l-0.57309-1.1493h1.1942c0.12334 0 0.22324-0.10042 0.22324-0.22376 0-0.063691-0.027421-0.12394-0.074931-0.1664l-0.31884-0.28319h2.7363c0.46379 0 0.87695-0.3355 0.87695-0.7891v-3.2851c0-0.4536-0.41316-0.7891-0.87695-0.7891zm0 0.48214h10.945c0.2413 0 0.39688 0.15381 0.39688 0.30696v3.2851c0 0.15315-0.15557 0.30644-0.39688 0.30644h-3.2789l-1.9084-1.696c-0.043471-0.038418-0.09792-0.059945-0.15555-0.059945-0.1294 0-0.23461 0.10521-0.23461 0.23461v1.5214h-5.3676c-0.2413 0-0.39429-0.15329-0.39429-0.30644v-3.2851c0-0.15315 0.15299-0.30696 0.39429-0.30696z"/>
|
|
21846
|
+
</svg>`,
|
|
21850
21847
|
});
|
|
21851
21848
|
Blocks.add("header", {
|
|
21852
21849
|
label: opts.t9n.headerBlkLabel,
|
|
21853
21850
|
category: opts.t9n.categoryLabel,
|
|
21854
|
-
media:
|
|
21851
|
+
media: `<svg style="width:60px;" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21852
|
+
<path fill="currentColor" d="m8.4664 2.3913 0.3777 1.3753-0.31258 0.082201c-0.14652-0.27506-0.2963-0.55011-0.46886-0.68922-0.17257-0.13595-0.37444-0.13595-0.57306-0.13595h-0.814v3.3196c0 0.15808 0 0.31616 0.10745 0.3952 0.1107 0.079039 0.3256 0.079039 0.54375 0.079039v0.31616h-1.9536v-0.31616c0.21815 0 0.43305 0 0.54375-0.07904 0.10745-0.079039 0.10745-0.23712 0.10745-0.3952v-3.3196h-0.814c-0.19862 0-0.40049 0-0.57306 0.13595-0.17257 0.13911-0.32234 0.41417-0.46886 0.68922l-0.31258-0.082201 0.3777-1.3753z" stroke-width=".32084"/>
|
|
21853
|
+
</svg>`,
|
|
21855
21854
|
content: {
|
|
21856
21855
|
type: "header",
|
|
21857
21856
|
content: "Title",
|
|
@@ -21860,7 +21859,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21860
21859
|
Blocks.add("text", {
|
|
21861
21860
|
label: opts.t9n.textBlkLabel,
|
|
21862
21861
|
category: opts.t9n.categoryLabel,
|
|
21863
|
-
media:
|
|
21862
|
+
media: `<svg style="width:60px;" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21863
|
+
<path fill="currentColor" d="m1.8299 1.9461v0.52917h9.0403v-0.52917h-9.0403zm0 1.0206v0.52917h7.2135v-0.52917h-7.2135zm0 1.0206v0.52917h9.0403v-0.52917h-9.0403zm0 1.0211v0.52917h7.2135v-0.52917h-7.2135zm0 1.0206v0.52917h9.0403v-0.52917h-9.0403zm0 1.0206v0.52917h7.2135v-0.52917h-7.2135z"/>
|
|
21864
|
+
</svg>`,
|
|
21864
21865
|
content: {
|
|
21865
21866
|
type: "text",
|
|
21866
21867
|
content: "Text",
|
|
@@ -21869,7 +21870,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21869
21870
|
Blocks.add("text2", {
|
|
21870
21871
|
label: opts.t9n.textBlkLabelWithSpace,
|
|
21871
21872
|
category: opts.t9n.categoryLabel,
|
|
21872
|
-
media:
|
|
21873
|
+
media: `<svg style="width:60px;" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21874
|
+
<path fill="currentColor" d="m1.8299 1.9461v0.52917h9.0403v-0.52917h-9.0403zm0 1.0206v0.52917h7.2135v-0.52917h-7.2135zm0 1.0206v0.52917h9.0403v-0.52917h-9.0403zm0 1.0211v0.52917h7.2135v-0.52917h-7.2135zm0 1.0206v0.52917h9.0403v-0.52917h-9.0403zm0 1.0206v0.52917h7.2135v-0.52917h-7.2135z"/>
|
|
21875
|
+
</svg>`,
|
|
21873
21876
|
content: {
|
|
21874
21877
|
type: "text",
|
|
21875
21878
|
content: "Text",
|
|
@@ -21879,7 +21882,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21879
21882
|
Blocks.add("titleAndText", {
|
|
21880
21883
|
label: opts.t9n.titleAndTextBlkLabel,
|
|
21881
21884
|
category: opts.t9n.categoryLabel,
|
|
21882
|
-
media:
|
|
21885
|
+
media: `<svg style="width:60px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21886
|
+
<path fill="currentColor" d="m1.8299 1.9461v1.0583h8.1695v-1.0583h-8.1695zm0 2.0412v0.52917h9.0403v-0.52917h-9.0403zm0 1.0211v0.52917h7.2135v-0.52917h-7.2135zm0 1.0206v0.52917h9.0403v-0.52917h-9.0403zm0 1.0206v0.52917h7.2135v-0.52917h-7.2135z" stroke-width=".3322"/>
|
|
21887
|
+
</svg>`,
|
|
21883
21888
|
content: [
|
|
21884
21889
|
{
|
|
21885
21890
|
tagname: "div",
|
|
@@ -21897,13 +21902,17 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21897
21902
|
Blocks.add("ulist", {
|
|
21898
21903
|
label: opts.t9n.ulistBlkLabel,
|
|
21899
21904
|
category: opts.t9n.categoryLabel,
|
|
21900
|
-
media:
|
|
21905
|
+
media: `<svg style="width:60px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21906
|
+
<path fill="currentColor" d="m2.3859 2.1921a0.52917 0.52917 0 0 0-0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917-0.52917 0.52917 0.52917 0 0 0-0.52917-0.52917zm1.2707 0.26458v0.52917h7.2135v-0.52917h-7.2135zm-1.2707 1.7766a0.52917 0.52917 0 0 0-0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917-0.52917 0.52917 0.52917 0 0 0-0.52917-0.52917zm1.2707 0.26458v0.52917h7.2135v-0.52917h-7.2135zm-1.2707 1.7766a0.52917 0.52917 0 0 0-0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917-0.52917 0.52917 0.52917 0 0 0-0.52917-0.52917zm1.2707 0.26458v0.52917h7.2135v-0.52917h-7.2135z"/>
|
|
21907
|
+
</svg>`,
|
|
21901
21908
|
content: { type: "ulist" },
|
|
21902
21909
|
});
|
|
21903
21910
|
Blocks.add("titleAndList", {
|
|
21904
21911
|
label: opts.t9n.titleAndListBlkLabel,
|
|
21905
21912
|
category: opts.t9n.categoryLabel,
|
|
21906
|
-
media:
|
|
21913
|
+
media: `<svg style="width:60px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21914
|
+
<path fill="currentColor" d="m1.8299 2.1854v1.0583h8.1623v-1.0583h-8.1623zm0.55604 2.0479a0.52917 0.52917 0 0 0-0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917-0.52917 0.52917 0.52917 0 0 0-0.52917-0.52917zm1.2707 0.26458v0.52917h7.2135v-0.52917h-7.2135zm-1.2707 1.7766a0.52917 0.52917 0 0 0-0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917 0.52917 0.52917 0.52917 0 0 0 0.52917-0.52917 0.52917 0.52917 0 0 0-0.52917-0.52917zm1.2707 0.26458v0.52917h7.2135v-0.52917h-7.2135z"/>
|
|
21915
|
+
</svg>`,
|
|
21907
21916
|
content: [
|
|
21908
21917
|
{
|
|
21909
21918
|
tagname: "div",
|
|
@@ -21921,13 +21930,17 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21921
21930
|
Blocks.add("divider", {
|
|
21922
21931
|
label: opts.t9n.dividerBlkLabel,
|
|
21923
21932
|
category: opts.t9n.categoryLabel,
|
|
21924
|
-
content:
|
|
21925
|
-
media:
|
|
21933
|
+
content: `<hr style="border-top: 1px solid #2b303b;">`,
|
|
21934
|
+
media: `<svg style="width:60px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21935
|
+
<path fill="currentColor" d="m-1.4833e-5 4.5835h12.7v0.35797h-12.7z"/>
|
|
21936
|
+
</svg>`,
|
|
21926
21937
|
});
|
|
21927
21938
|
Blocks.add("icon", {
|
|
21928
21939
|
label: opts.t9n.iconBlkLabel,
|
|
21929
21940
|
category: opts.t9n.categoryLabel,
|
|
21930
|
-
media:
|
|
21941
|
+
media: `<svg style="width:60px" viewBox="0 0 12.7 9.525" xmlns="http://www.w3.org/2000/svg">
|
|
21942
|
+
<path fill="currentColor" d="m6.1759 1.5875c-0.067716 0-0.13494 0.025902-0.18655 0.077515l-1.9275 1.9265-0.87023-0.8692c-0.10323-0.10323-0.27091-0.10323-0.37414 0-0.10323 0.10323-0.10323 0.27091 0 0.37414l1.0568 1.0568c0.10323 0.10323 0.27091 0.10323 0.37414 0l2.1141-2.1136c0.10322-0.10323 0.10322-0.27143 0-0.37465h0.0010336c-0.051608-0.051613-0.11987-0.077515-0.18759-0.077515zm2.3988 0a1.3854 1.3854 0 0 0-1.3854 1.3854 1.3854 1.3854 0 0 0 1.3854 1.386 1.3854 1.3854 0 0 0 1.3854-1.386 1.3854 1.3854 0 0 0-1.3854-1.3854zm0 0.49661a0.889 0.889 0 0 1 0.88935 0.88883 0.889 0.889 0 0 1-0.88935 0.88935 0.889 0.889 0 0 1-0.88883-0.88935 0.889 0.889 0 0 1 0.88883-0.88883zm-0.096118 2.8897c-0.063262 0-0.12645 0.024129-0.17467 0.072347-0.096436 0.096436-0.096436 0.2529 0 0.34933l0.8139 0.81339h-2.3668c-0.13655 0-0.24701 0.10994-0.24701 0.2465 0 0.13655 0.11046 0.24701 0.24701 0.24701h2.3657l-0.81235 0.81339c-0.096436 0.096436-0.096436 0.2529 0 0.34933 0.096436 0.096436 0.25341 0.096436 0.34985 0l1.234-1.2346-5.167e-4 -5.167e-4c0.096436-0.096436 0.096436-0.2529 0-0.34933l-1.2346-1.2346c-0.048218-0.048218-0.1114-0.072347-0.17467-0.072347zm-4.2344 0.045475c-0.0701 0-0.13304 0.039629-0.16381 0.10232l-0.3669 0.75396-0.81804 0.12092c-0.068389 0.010262-0.12567 0.057966-0.14676 0.12351-0.021088 0.06554-0.0040554 0.13811 0.044958 0.18655l0.59428 0.58756-0.14056 0.83044c-0.011402 0.068389 0.017477 0.13782 0.073897 0.17828 0.056422 0.040464 0.13069 0.045922 0.19224 0.013436l0.73122-0.39067 0.73122 0.39067c0.061552 0.032485 0.13633 0.027597 0.19275-0.013436 0.056423-0.041034 0.08478-0.10989 0.07338-0.17828l-0.14056-0.83044 0.59376-0.58756c0.049012-0.048444 0.066616-0.12101 0.044958-0.18655-0.021657-0.06554-0.077856-0.11325-0.14624-0.12351l-0.81907-0.12092-0.36639-0.75396c-0.030206-0.06269-0.094231-0.10232-0.16433-0.10232z" stroke-width=".34931"/>
|
|
21943
|
+
</svg>`,
|
|
21931
21944
|
content: { type: "icon" },
|
|
21932
21945
|
});
|
|
21933
21946
|
Blocks.add("image", {
|
|
@@ -21955,7 +21968,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21955
21968
|
Blocks.add("box", {
|
|
21956
21969
|
label: opts.t9n.boxBlkLabel,
|
|
21957
21970
|
category: opts.t9n.categoryLabel,
|
|
21958
|
-
media:
|
|
21971
|
+
media: `<svg style="width:60px" viewBox="0 0 24 24">
|
|
21972
|
+
<path fill="currentColor" d="M2 20h20V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1Z"></path>
|
|
21973
|
+
</svg>`,
|
|
21959
21974
|
content: {
|
|
21960
21975
|
style: {
|
|
21961
21976
|
padding: "20px",
|
|
@@ -21965,25 +21980,43 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
21965
21980
|
Blocks.add("sect55", {
|
|
21966
21981
|
label: opts.t9n.sect55BlkLabel,
|
|
21967
21982
|
category: opts.t9n.categoryLabel,
|
|
21968
|
-
media:
|
|
21969
|
-
|
|
21983
|
+
media: `<svg style="width:60px" viewBox="0 0 23 24">
|
|
21984
|
+
<path fill="currentColor" d="M2 20h8V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM13 20h8V4h-8v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1Z"></path>
|
|
21985
|
+
</svg>`,
|
|
21986
|
+
content: `<div style="display:flex; flex-wrap: wrap; padding: 0.2rem 0">
|
|
21987
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 280px; padding:20px;"></div>
|
|
21988
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 280px; padding:20px;"></div>
|
|
21989
|
+
</div>`,
|
|
21970
21990
|
});
|
|
21971
21991
|
Blocks.add("sect37", {
|
|
21972
21992
|
label: opts.t9n.sect37BlkLabel,
|
|
21973
21993
|
category: opts.t9n.categoryLabel,
|
|
21974
|
-
media:
|
|
21975
|
-
|
|
21994
|
+
media: `<svg style="width:60px" viewBox="0 0 24 24">
|
|
21995
|
+
<path fill="currentColor" d="M2 20h5V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM10 20h12V4H10v16Zm-1 0V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H10a1 1 0 0 1-1-1Z"></path>
|
|
21996
|
+
</svg>`,
|
|
21997
|
+
content: `<div style="display:flex; flex-wrap: wrap; padding: 0.2rem 0">
|
|
21998
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 38.2%; min-width:200px; padding:20px;"></div>
|
|
21999
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 61.8%; padding:20px;"></div>
|
|
22000
|
+
</div>`,
|
|
21976
22001
|
});
|
|
21977
22002
|
Blocks.add("sect333", {
|
|
21978
22003
|
label: opts.t9n.sect333BlkLabel,
|
|
21979
22004
|
category: opts.t9n.categoryLabel,
|
|
21980
|
-
media:
|
|
21981
|
-
|
|
22005
|
+
media: `<svg style="width:60px" viewBox="0 0 23 24">
|
|
22006
|
+
<path fill="currentColor" d="M2 20h4V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM17 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1ZM9.5 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1Z"></path>
|
|
22007
|
+
</svg>`,
|
|
22008
|
+
content: `<div style="display:flex; flex-wrap: wrap; padding: 0.2rem 0">
|
|
22009
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 200px; padding:20px;"></div>
|
|
22010
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 200px; padding:20px;"></div>
|
|
22011
|
+
<div style="flex-grow: 1; flex-shrink: 1; flex-basis: 200px; padding:20px;"></div>
|
|
22012
|
+
</div>`,
|
|
21982
22013
|
});
|
|
21983
22014
|
Blocks.add("box", {
|
|
21984
22015
|
label: "Box",
|
|
21985
22016
|
category: opts.t9n.categoryLabel,
|
|
21986
|
-
media:
|
|
22017
|
+
media: `<svg style="width:60px" viewBox="0 0 24 24">
|
|
22018
|
+
<path fill="currentColor" d="M2 20h20V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1Z"></path>
|
|
22019
|
+
</svg>`,
|
|
21987
22020
|
content: {
|
|
21988
22021
|
style: {
|
|
21989
22022
|
padding: "20px 20px 20px 20px",
|
|
@@ -22048,7 +22081,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22048
22081
|
href: "https://facebook.com/",
|
|
22049
22082
|
target: "_blank",
|
|
22050
22083
|
},
|
|
22051
|
-
components:
|
|
22084
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22085
|
+
<i aria-hidden="true" class="fa-brands fa-square-facebook"></i>
|
|
22086
|
+
</div>`,
|
|
22052
22087
|
},
|
|
22053
22088
|
attributes: { class: "fa-brands fa-square-facebook" },
|
|
22054
22089
|
});
|
|
@@ -22066,7 +22101,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22066
22101
|
href: "https://instagram.com/",
|
|
22067
22102
|
target: "_blank",
|
|
22068
22103
|
},
|
|
22069
|
-
components:
|
|
22104
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22105
|
+
<i aria-hidden="true" class="fab fa-instagram-square"></i>
|
|
22106
|
+
</div>`,
|
|
22070
22107
|
},
|
|
22071
22108
|
attributes: { class: "fa-brands fa-square-instagram" },
|
|
22072
22109
|
});
|
|
@@ -22084,7 +22121,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22084
22121
|
href: "https://www.youtube.com/",
|
|
22085
22122
|
target: "_blank",
|
|
22086
22123
|
},
|
|
22087
|
-
components:
|
|
22124
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22125
|
+
<i class="fa-brands fa-square-youtube"></i>
|
|
22126
|
+
</div>`,
|
|
22088
22127
|
},
|
|
22089
22128
|
attributes: { class: "fa-brands fa-square-youtube" },
|
|
22090
22129
|
});
|
|
@@ -22102,7 +22141,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22102
22141
|
href: "https://linkedin.com/",
|
|
22103
22142
|
target: "_blank",
|
|
22104
22143
|
},
|
|
22105
|
-
components:
|
|
22144
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22145
|
+
<i aria-hidden="true" class="fab fa-linkedin"></i>
|
|
22146
|
+
</div>`,
|
|
22106
22147
|
},
|
|
22107
22148
|
attributes: { class: "fa-brands fa-linkedin" },
|
|
22108
22149
|
});
|
|
@@ -22120,7 +22161,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22120
22161
|
href: "https://xing.com/",
|
|
22121
22162
|
target: "_blank",
|
|
22122
22163
|
},
|
|
22123
|
-
components:
|
|
22164
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22165
|
+
<i aria-hidden="true" class="fa-brands fa-square-xing"></i>
|
|
22166
|
+
</div>`,
|
|
22124
22167
|
},
|
|
22125
22168
|
attributes: { class: "fa-brands fa-square-xing" },
|
|
22126
22169
|
});
|
|
@@ -22138,7 +22181,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22138
22181
|
href: "https://twitter.com/",
|
|
22139
22182
|
target: "_blank",
|
|
22140
22183
|
},
|
|
22141
|
-
components:
|
|
22184
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22185
|
+
<i class="fa-brands fa-square-x-twitter"></i>
|
|
22186
|
+
</div>`,
|
|
22142
22187
|
},
|
|
22143
22188
|
attributes: { class: "fa-brands fa-square-x-twitter" },
|
|
22144
22189
|
});
|
|
@@ -22156,7 +22201,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22156
22201
|
href: "https://www.tiktok.com/",
|
|
22157
22202
|
target: "_blank",
|
|
22158
22203
|
},
|
|
22159
|
-
components:
|
|
22204
|
+
components: `<div style="display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22205
|
+
<i class="fa-brands fa-tiktok"></i>
|
|
22206
|
+
</div>`,
|
|
22160
22207
|
},
|
|
22161
22208
|
attributes: { class: "fa-brands fa-tiktok" },
|
|
22162
22209
|
});
|
|
@@ -22176,7 +22223,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22176
22223
|
target: "_blank",
|
|
22177
22224
|
"data-ost-simple-hide": "1",
|
|
22178
22225
|
},
|
|
22179
|
-
components:
|
|
22226
|
+
components: `<div style="border: 2px solid #293133; border-radius: 3px; display:flex; justify-content: space-around; align-items: center; text-align:center; width:60px; height:28px; font-size:21px; color:#293133;">
|
|
22227
|
+
<i class="fa-solid fa-share"></i>
|
|
22228
|
+
<i class="fa-brands fa-facebook-f"></i>
|
|
22229
|
+
</div>`,
|
|
22180
22230
|
},
|
|
22181
22231
|
attributes: { class: "fa-brands fa-square-facebook" },
|
|
22182
22232
|
});
|
|
@@ -22195,7 +22245,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22195
22245
|
target: "_blank",
|
|
22196
22246
|
"data-ost-simple-hide": "1",
|
|
22197
22247
|
},
|
|
22198
|
-
components:
|
|
22248
|
+
components: `<div style="border: 2px solid #293133; border-radius: 3px; display:flex; justify-content: space-around; align-items: center; text-align:center; width:60px; height:28px; font-size:21px; color:#293133;">
|
|
22249
|
+
<i class="fa-solid fa-share"></i>
|
|
22250
|
+
<i class="fa-brands fa-linkedin-in"></i>
|
|
22251
|
+
</div>`,
|
|
22199
22252
|
},
|
|
22200
22253
|
attributes: { class: "fa-brands fa-linkedin" },
|
|
22201
22254
|
});
|
|
@@ -22214,7 +22267,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22214
22267
|
target: "_blank",
|
|
22215
22268
|
"data-ost-simple-hide": "1",
|
|
22216
22269
|
},
|
|
22217
|
-
components:
|
|
22270
|
+
components: `<div style="border: 2px solid #293133; border-radius: 3px; display:flex; justify-content: space-around; align-items: center; text-align:center; width:60px; height:28px; font-size:21px; color:#293133;">
|
|
22271
|
+
<i class="fa-solid fa-share"></i>
|
|
22272
|
+
<i class="fa-brands fa-xing"></i>
|
|
22273
|
+
</div>`,
|
|
22218
22274
|
},
|
|
22219
22275
|
attributes: { class: "fa-brands fa-square-xing" },
|
|
22220
22276
|
});
|
|
@@ -22233,7 +22289,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22233
22289
|
target: "_blank",
|
|
22234
22290
|
"data-ost-simple-hide": "1",
|
|
22235
22291
|
},
|
|
22236
|
-
components:
|
|
22292
|
+
components: `<div style="border: 2px solid #293133; border-radius: 3px; display:flex; justify-content: space-around; align-items: center; text-align:center; width:60px; height:28px; font-size:21px; color:#293133;">
|
|
22293
|
+
<i class="fa-solid fa-share"></i>
|
|
22294
|
+
<i class="fa-brands fa-x-twitter"></i>
|
|
22295
|
+
</div>`,
|
|
22237
22296
|
},
|
|
22238
22297
|
attributes: { class: "fa-brands fa-square-x-twitter" },
|
|
22239
22298
|
});
|
|
@@ -22252,7 +22311,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22252
22311
|
href: "https://wa.me/?text=$$$ViewLink$$$",
|
|
22253
22312
|
target: "_blank",
|
|
22254
22313
|
},
|
|
22255
|
-
components:
|
|
22314
|
+
components: `<div style="border: 2px solid #293133; border-radius: 3px; display:flex; justify-content: space-around; align-items: center; text-align:center; width:60px; height:28px; font-size:21px; color:#293133;">
|
|
22315
|
+
<i class="fa-solid fa-share"></i>
|
|
22316
|
+
<i class="fa-brands fa-whatsapp"></i>
|
|
22317
|
+
</div>`,
|
|
22256
22318
|
},
|
|
22257
22319
|
attributes: { class: "fa-brands fa-square-whatsapp" },
|
|
22258
22320
|
});
|
|
@@ -22272,7 +22334,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22272
22334
|
target: "_blank",
|
|
22273
22335
|
"data-ost-simple-hide": "1",
|
|
22274
22336
|
},
|
|
22275
|
-
components:
|
|
22337
|
+
components: `<div style="display:inline-block; text-align:center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22338
|
+
<i class="fa-solid fa-envelope"></i>
|
|
22339
|
+
</div>`,
|
|
22276
22340
|
},
|
|
22277
22341
|
attributes: { class: "fa-solid fa-square-envelope" },
|
|
22278
22342
|
});
|
|
@@ -22290,7 +22354,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22290
22354
|
href: "sms:?body=Sieh%20dir%20dieses%20Inserat%20an%20$$$ViewLink$$$",
|
|
22291
22355
|
"data-ost-simple-hide": "1",
|
|
22292
22356
|
},
|
|
22293
|
-
components:
|
|
22357
|
+
components: `<div style="display:inline-block; text-align:center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22358
|
+
<i class="fa-solid fa-comment-sms"></i>
|
|
22359
|
+
</div>`,
|
|
22294
22360
|
},
|
|
22295
22361
|
attributes: { class: "fa-solid fa-comment-sms" },
|
|
22296
22362
|
});
|
|
@@ -22308,7 +22374,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22308
22374
|
href: "javascript:if(window.print)window.print()",
|
|
22309
22375
|
"data-ost-simple-hide": "1",
|
|
22310
22376
|
},
|
|
22311
|
-
components:
|
|
22377
|
+
components: `<div style="display:inline-block; text-align:center; width:28px; height:28px; font-size:28px; color:#293133;">
|
|
22378
|
+
<i class="fa-solid fa-print"></i>
|
|
22379
|
+
</div>`,
|
|
22312
22380
|
},
|
|
22313
22381
|
attributes: { class: "fa-solid fa-print" },
|
|
22314
22382
|
});
|
|
@@ -22340,67 +22408,186 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
22340
22408
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22341
22409
|
});
|
|
22342
22410
|
};
|
|
22343
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
22344
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
22345
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
22346
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
22347
|
-
function step(op) {
|
|
22348
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
22349
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22350
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22351
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22352
|
-
switch (op[0]) {
|
|
22353
|
-
case 0: case 1: t = op; break;
|
|
22354
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22355
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
22356
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
22357
|
-
default:
|
|
22358
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
22359
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
22360
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
22361
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
22362
|
-
if (t[2]) _.ops.pop();
|
|
22363
|
-
_.trys.pop(); continue;
|
|
22364
|
-
}
|
|
22365
|
-
op = body.call(thisArg, _);
|
|
22366
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
22367
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
22368
|
-
}
|
|
22369
|
-
};
|
|
22370
22411
|
|
|
22371
22412
|
|
|
22372
22413
|
|
|
22373
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22378
|
-
(
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
});
|
|
22387
|
-
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceMobile, {
|
|
22388
|
-
run: function (ed) { return ed.setDevice("Mobile portrait"); },
|
|
22389
|
-
stop: function () { },
|
|
22390
|
-
});
|
|
22391
|
-
Commands.add("ost-blocks-visibility", {
|
|
22392
|
-
run: function (editor) {
|
|
22393
|
-
var cList = editor.Canvas.getBody().classList;
|
|
22394
|
-
cList.add("show-ost-blocks");
|
|
22395
|
-
},
|
|
22396
|
-
stop: function (editor) {
|
|
22397
|
-
var cList = editor.Canvas.getBody().classList;
|
|
22398
|
-
cList.remove("show-ost-blocks");
|
|
22399
|
-
},
|
|
22400
|
-
});
|
|
22401
|
-
return [2 /*return*/];
|
|
22414
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22415
|
+
const { Commands } = editor;
|
|
22416
|
+
(0,_openImportCommand__WEBPACK_IMPORTED_MODULE_2__["default"])(editor, opts);
|
|
22417
|
+
(0,_openExportCommand__WEBPACK_IMPORTED_MODULE_1__["default"])(editor, opts);
|
|
22418
|
+
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceDesktop, {
|
|
22419
|
+
run: (ed) => ed.setDevice("Desktop"),
|
|
22420
|
+
stop: () => {
|
|
22421
|
+
},
|
|
22422
|
+
});
|
|
22423
|
+
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceTablet, {
|
|
22424
|
+
run: (ed) => ed.setDevice("Tablet"),
|
|
22425
|
+
stop: () => {
|
|
22426
|
+
},
|
|
22402
22427
|
});
|
|
22403
|
-
|
|
22428
|
+
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceMobile, {
|
|
22429
|
+
run: (ed) => ed.setDevice("Mobile portrait"),
|
|
22430
|
+
stop: () => {
|
|
22431
|
+
},
|
|
22432
|
+
});
|
|
22433
|
+
Commands.add("ost-blocks-visibility", {
|
|
22434
|
+
run(editor) {
|
|
22435
|
+
const cList = editor.Canvas.getBody().classList;
|
|
22436
|
+
cList.add("show-ost-blocks");
|
|
22437
|
+
},
|
|
22438
|
+
stop(editor) {
|
|
22439
|
+
const cList = editor.Canvas.getBody().classList;
|
|
22440
|
+
cList.remove("show-ost-blocks");
|
|
22441
|
+
},
|
|
22442
|
+
});
|
|
22443
|
+
// Helper function to check if a line is a bullet point
|
|
22444
|
+
function isBulletPoint(line) {
|
|
22445
|
+
const trimmedLine = line.trim();
|
|
22446
|
+
return _consts__WEBPACK_IMPORTED_MODULE_0__.BULLET_PATTERNS.some(pattern => pattern.test(trimmedLine));
|
|
22447
|
+
}
|
|
22448
|
+
// Helper function to remove bullet point markers
|
|
22449
|
+
function removeBulletPoint(line) {
|
|
22450
|
+
let trimmedLine = line.trim();
|
|
22451
|
+
for (const pattern of _consts__WEBPACK_IMPORTED_MODULE_0__.BULLET_PATTERNS) {
|
|
22452
|
+
trimmedLine = trimmedLine.replace(pattern, '');
|
|
22453
|
+
}
|
|
22454
|
+
return trimmedLine.trim() || 'Text';
|
|
22455
|
+
}
|
|
22456
|
+
// Helper function to clean individual item content
|
|
22457
|
+
function cleanItemContent(content) {
|
|
22458
|
+
content = content.replace(/<br\s*\/?>/gi, ' ');
|
|
22459
|
+
content = content.replace(/<[^>]+>/g, '');
|
|
22460
|
+
const entityMap = {
|
|
22461
|
+
'&': '&',
|
|
22462
|
+
'<': '<',
|
|
22463
|
+
'>': '>',
|
|
22464
|
+
'"': '"',
|
|
22465
|
+
''': "'",
|
|
22466
|
+
' ': ' ',
|
|
22467
|
+
'•': '•',
|
|
22468
|
+
'‣': '‣',
|
|
22469
|
+
'⁃': '⁃',
|
|
22470
|
+
'•': '•',
|
|
22471
|
+
'·': '·'
|
|
22472
|
+
};
|
|
22473
|
+
for (const [entity, char] of Object.entries(entityMap)) {
|
|
22474
|
+
content = content.replace(new RegExp(entity, 'g'), char);
|
|
22475
|
+
}
|
|
22476
|
+
content = content.replace(/\s+/g, ' ').trim();
|
|
22477
|
+
if (!content || /^[•·▪▫‣⁃◦‧⦿⦾\-*+.()]+$/.test(content)) {
|
|
22478
|
+
content = 'Text';
|
|
22479
|
+
}
|
|
22480
|
+
return content;
|
|
22481
|
+
}
|
|
22482
|
+
// Helper function to clean Word content and convert to list items
|
|
22483
|
+
function cleanWordContentToListItems(content) {
|
|
22484
|
+
content = content.replace(/<!--[\s\S]*?-->/g, '');
|
|
22485
|
+
content = content.replace(/<o:p\s*\/?>|<\/o:p>/gi, '');
|
|
22486
|
+
content = content.replace(/<w:[\s\S]*?>/gi, '');
|
|
22487
|
+
content = content.replace(/\s*mso-[^:]+:[^;"]*;?/gi, '');
|
|
22488
|
+
content = content.replace(/\s*class="[^"]*Mso[^"]*"/gi, '');
|
|
22489
|
+
content = content.replace(/<span[^>]*>\s*<\/span>/gi, '');
|
|
22490
|
+
content = content.replace(/<p[^>]*>/gi, '\n').replace(/<\/p>/gi, '');
|
|
22491
|
+
content = content.replace(/[ \t]+/g, ' ');
|
|
22492
|
+
content = content.replace(/\n\s+/g, '\n');
|
|
22493
|
+
content = content.trim();
|
|
22494
|
+
let items = [];
|
|
22495
|
+
if (content.includes('<li>') || content.includes('<LI>')) {
|
|
22496
|
+
const liMatches = content.match(/<li[^>]*>(.*?)<\/li>/gi);
|
|
22497
|
+
if (liMatches) {
|
|
22498
|
+
items = liMatches.map(li => {
|
|
22499
|
+
const itemContent = li.replace(/<li[^>]*>|<\/li>/gi, '').trim();
|
|
22500
|
+
return cleanItemContent(itemContent);
|
|
22501
|
+
});
|
|
22502
|
+
}
|
|
22503
|
+
}
|
|
22504
|
+
else {
|
|
22505
|
+
const lines = content.split(/\r?\n/).map(line => line.trim()).filter(line => line.length > 0);
|
|
22506
|
+
for (const line of lines) {
|
|
22507
|
+
if (isBulletPoint(line)) {
|
|
22508
|
+
const itemContent = removeBulletPoint(line);
|
|
22509
|
+
const cleaned = cleanItemContent(itemContent);
|
|
22510
|
+
if (cleaned.trim().length > 0) {
|
|
22511
|
+
items.push(cleaned);
|
|
22512
|
+
}
|
|
22513
|
+
}
|
|
22514
|
+
else if (line.trim().length > 0) {
|
|
22515
|
+
const cleaned = cleanItemContent(line);
|
|
22516
|
+
if (cleaned.trim().length > 0) {
|
|
22517
|
+
items.push(cleaned);
|
|
22518
|
+
}
|
|
22519
|
+
}
|
|
22520
|
+
}
|
|
22521
|
+
}
|
|
22522
|
+
items = items.filter(item => item.trim().length > 0);
|
|
22523
|
+
if (items.length === 0) {
|
|
22524
|
+
items = ['Text'];
|
|
22525
|
+
}
|
|
22526
|
+
return items;
|
|
22527
|
+
}
|
|
22528
|
+
// Add Word paste command
|
|
22529
|
+
Commands.add("paste-from-word", {
|
|
22530
|
+
run(editor) {
|
|
22531
|
+
var _a;
|
|
22532
|
+
const selected = editor.getSelected();
|
|
22533
|
+
if (!selected)
|
|
22534
|
+
return;
|
|
22535
|
+
if (((_a = selected.getEl()) === null || _a === void 0 ? void 0 : _a.tagName) !== "UL") {
|
|
22536
|
+
console.warn("Paste from Word is only available for UL elements");
|
|
22537
|
+
return;
|
|
22538
|
+
}
|
|
22539
|
+
const modal = editor.Modal;
|
|
22540
|
+
const modalContent = `
|
|
22541
|
+
<div>
|
|
22542
|
+
<p id="paste-from-word-text">${opts.t9n.labelPasteFromWordText}</p>
|
|
22543
|
+
<textarea id="paste-from-word-content" placeholder="${opts.t9n.labelPasteFromWordPlaceholder}"></textarea>
|
|
22544
|
+
<div id="paste-from-word-footer">
|
|
22545
|
+
<button id="paste-from-word-apply">${opts.t9n.labelPasteFromWordButton}</button>
|
|
22546
|
+
</div>
|
|
22547
|
+
</div>
|
|
22548
|
+
`;
|
|
22549
|
+
modal.setTitle(opts.t9n.labelPasteFromWord);
|
|
22550
|
+
modal.setContent(modalContent);
|
|
22551
|
+
modal.open();
|
|
22552
|
+
setTimeout(() => {
|
|
22553
|
+
const textarea = document.getElementById('paste-from-word-content');
|
|
22554
|
+
const applyBtn = document.getElementById('paste-from-word-apply');
|
|
22555
|
+
if (textarea) {
|
|
22556
|
+
textarea.focus();
|
|
22557
|
+
}
|
|
22558
|
+
if (applyBtn) {
|
|
22559
|
+
applyBtn.addEventListener('click', () => {
|
|
22560
|
+
if (textarea && selected) {
|
|
22561
|
+
const content = textarea.value;
|
|
22562
|
+
const listItems = cleanWordContentToListItems(content);
|
|
22563
|
+
selected.components().reset();
|
|
22564
|
+
selected.addAttributes({
|
|
22565
|
+
'class': 'ulist fa-ul',
|
|
22566
|
+
'style': 'padding: 0.2rem 0; margin-left: 2em; line-height: 1.4em;'
|
|
22567
|
+
});
|
|
22568
|
+
listItems.forEach(itemContent => {
|
|
22569
|
+
const liHtml = `<li class="ulistitem" style="text-align: left;"><span class="fa-li" style="left: -2em; width: 2em;"><i class="fas fa-circle" style="font-size: 0.4em; line-height: inherit; display: block;"></i></span><p style="margin: 0; padding: 0; text-align: left;">${itemContent}</p></li>`;
|
|
22570
|
+
selected.append(liHtml);
|
|
22571
|
+
});
|
|
22572
|
+
modal.close();
|
|
22573
|
+
editor.trigger('component:update', selected);
|
|
22574
|
+
}
|
|
22575
|
+
});
|
|
22576
|
+
}
|
|
22577
|
+
if (textarea) {
|
|
22578
|
+
textarea.addEventListener('keydown', (e) => {
|
|
22579
|
+
if (e.ctrlKey && e.key === 'Enter') {
|
|
22580
|
+
applyBtn === null || applyBtn === void 0 ? void 0 : applyBtn.click();
|
|
22581
|
+
}
|
|
22582
|
+
else if (e.key === 'Escape') {
|
|
22583
|
+
modal.close();
|
|
22584
|
+
}
|
|
22585
|
+
});
|
|
22586
|
+
}
|
|
22587
|
+
}, 100);
|
|
22588
|
+
},
|
|
22589
|
+
});
|
|
22590
|
+
}));
|
|
22404
22591
|
|
|
22405
22592
|
|
|
22406
22593
|
/***/ }),
|
|
@@ -22418,22 +22605,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22418
22605
|
/* harmony export */ });
|
|
22419
22606
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
22420
22607
|
|
|
22421
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22422
|
-
|
|
22608
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
22609
|
+
const { DomComponents } = editor;
|
|
22423
22610
|
// Add ostendis block trait to video components
|
|
22424
22611
|
var dType = DomComponents.getType("video");
|
|
22425
22612
|
var dModel = dType === null || dType === void 0 ? void 0 : dType.model;
|
|
22426
22613
|
var dView = dType === null || dType === void 0 ? void 0 : dType.view;
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22614
|
+
const yt = "yt";
|
|
22615
|
+
const vi = "vi";
|
|
22616
|
+
const ytnc = "ytnc";
|
|
22430
22617
|
DomComponents.addType("video", {
|
|
22431
22618
|
model: dModel.extend({
|
|
22432
|
-
updateTraits
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22619
|
+
updateTraits() {
|
|
22620
|
+
const { em } = this;
|
|
22621
|
+
const prov = this.get("provider");
|
|
22622
|
+
let tagName = "iframe";
|
|
22623
|
+
let traits;
|
|
22437
22624
|
switch (prov) {
|
|
22438
22625
|
case yt:
|
|
22439
22626
|
case ytnc:
|
|
@@ -22455,8 +22642,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22455
22642
|
{ id: "videoURL", name: opts.t9n.traitOstVideoURL },
|
|
22456
22643
|
],
|
|
22457
22644
|
});
|
|
22458
|
-
this.set({ tagName
|
|
22459
|
-
this.set({ traits
|
|
22645
|
+
this.set({ tagName }, { silent: true }); // avoid break in view
|
|
22646
|
+
this.set({ traits });
|
|
22460
22647
|
em.get("ready") && em.trigger("component:toggled");
|
|
22461
22648
|
},
|
|
22462
22649
|
}),
|
|
@@ -22464,7 +22651,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22464
22651
|
});
|
|
22465
22652
|
// Scale the new range
|
|
22466
22653
|
DomComponents.addType("scale", {
|
|
22467
|
-
isComponent:
|
|
22654
|
+
isComponent: (el) => {
|
|
22468
22655
|
return (el.tagName === "DIV" &&
|
|
22469
22656
|
(el.getAttribute("data-scale") === "true" ||
|
|
22470
22657
|
el.classList.contains("scale")));
|
|
@@ -22514,13 +22701,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22514
22701
|
(0,_consts__WEBPACK_IMPORTED_MODULE_0__.ostTypeHideInSimpleHtmlTrait)(opts),
|
|
22515
22702
|
],
|
|
22516
22703
|
},
|
|
22517
|
-
init
|
|
22704
|
+
init() {
|
|
22518
22705
|
var _a;
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22706
|
+
const attr = this.getAttributes();
|
|
22707
|
+
const el = (_a = this.view) === null || _a === void 0 ? void 0 : _a.el;
|
|
22708
|
+
let p = parseInt(attr["data-percent"]);
|
|
22709
|
+
let f = attr["data-fcolor"];
|
|
22710
|
+
let b = attr["data-bgcolor"];
|
|
22524
22711
|
if (isNaN(p))
|
|
22525
22712
|
p = 66;
|
|
22526
22713
|
if (!f)
|
|
@@ -22534,10 +22721,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22534
22721
|
this.on("change:bgcolor", this.updateScale);
|
|
22535
22722
|
this.on("change:fcolor", this.updateScale);
|
|
22536
22723
|
},
|
|
22537
|
-
updateScale
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22724
|
+
updateScale() {
|
|
22725
|
+
let p = parseInt(this.get("percent"));
|
|
22726
|
+
const f = this.get("fcolor") || "#3b5998";
|
|
22727
|
+
const b = this.get("bgcolor") || "#CCCCCC";
|
|
22541
22728
|
if (isNaN(p))
|
|
22542
22729
|
p = 0;
|
|
22543
22730
|
p = Math.max(0, Math.min(100, p));
|
|
@@ -22546,17 +22733,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22546
22733
|
"data-percent": p,
|
|
22547
22734
|
"data-fcolor": f,
|
|
22548
22735
|
"data-bgcolor": b,
|
|
22549
|
-
"aria-label":
|
|
22736
|
+
"aria-label": `${p} %`,
|
|
22550
22737
|
});
|
|
22551
22738
|
this.addStyle({
|
|
22552
|
-
background:
|
|
22739
|
+
background: `linear-gradient(to right, ${f} ${p}%, ${b} ${p}%)`,
|
|
22553
22740
|
});
|
|
22554
22741
|
},
|
|
22555
22742
|
},
|
|
22556
22743
|
});
|
|
22557
22744
|
// INPUT
|
|
22558
22745
|
DomComponents.addType("range", {
|
|
22559
|
-
isComponent:
|
|
22746
|
+
isComponent: (el) => el.tagName == "INPUT",
|
|
22560
22747
|
model: {
|
|
22561
22748
|
defaults: {
|
|
22562
22749
|
tagName: "input",
|
|
@@ -22568,14 +22755,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22568
22755
|
},
|
|
22569
22756
|
extendFnView: ["updateAttributes"],
|
|
22570
22757
|
view: {
|
|
22571
|
-
updateAttributes
|
|
22758
|
+
updateAttributes() {
|
|
22572
22759
|
this.el.setAttribute("autocomplete", "on");
|
|
22573
22760
|
},
|
|
22574
22761
|
},
|
|
22575
22762
|
});
|
|
22576
22763
|
// Unsorted list item component
|
|
22577
22764
|
DomComponents.addType("ulistitem", {
|
|
22578
|
-
isComponent:
|
|
22765
|
+
isComponent: (el) => {
|
|
22579
22766
|
if (el.tagName === "LI" && el.classList.contains("ulistitem")) {
|
|
22580
22767
|
return { type: "ulistitem" };
|
|
22581
22768
|
}
|
|
@@ -22593,7 +22780,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22593
22780
|
});
|
|
22594
22781
|
// Unsorted list component with fontawesome
|
|
22595
22782
|
DomComponents.addType("ulist", {
|
|
22596
|
-
isComponent:
|
|
22783
|
+
isComponent: (el) => {
|
|
22597
22784
|
if (el.tagName === "UL" && el.classList.contains("ulist")) {
|
|
22598
22785
|
return { type: "ulist" };
|
|
22599
22786
|
}
|
|
@@ -22618,8 +22805,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22618
22805
|
});
|
|
22619
22806
|
// Header component
|
|
22620
22807
|
DomComponents.addType("header", {
|
|
22621
|
-
isComponent:
|
|
22622
|
-
|
|
22808
|
+
isComponent: (el) => {
|
|
22809
|
+
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
22623
22810
|
if (el.tagName && headings.includes(el.tagName.toLowerCase())) {
|
|
22624
22811
|
return { type: "header" };
|
|
22625
22812
|
}
|
|
@@ -22639,7 +22826,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22639
22826
|
});
|
|
22640
22827
|
// Icon component
|
|
22641
22828
|
DomComponents.addType("icon", {
|
|
22642
|
-
isComponent:
|
|
22829
|
+
isComponent: (el) => {
|
|
22643
22830
|
var classNames = [
|
|
22644
22831
|
"fa",
|
|
22645
22832
|
"fas",
|
|
@@ -22650,7 +22837,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22650
22837
|
"fa-brands",
|
|
22651
22838
|
];
|
|
22652
22839
|
if (el.tagName === "I" &&
|
|
22653
|
-
classNames.some(
|
|
22840
|
+
classNames.some((className) => el.classList.contains(className))) {
|
|
22654
22841
|
return { type: "icon" };
|
|
22655
22842
|
}
|
|
22656
22843
|
},
|
|
@@ -22751,6 +22938,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22751
22938
|
"use strict";
|
|
22752
22939
|
__webpack_require__.r(__webpack_exports__);
|
|
22753
22940
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22941
|
+
/* harmony export */ BULLET_PATTERNS: () => (/* binding */ BULLET_PATTERNS),
|
|
22754
22942
|
/* harmony export */ cmdDeviceDesktop: () => (/* binding */ cmdDeviceDesktop),
|
|
22755
22943
|
/* harmony export */ cmdDeviceMobile: () => (/* binding */ cmdDeviceMobile),
|
|
22756
22944
|
/* harmony export */ cmdDeviceTablet: () => (/* binding */ cmdDeviceTablet),
|
|
@@ -22766,17 +22954,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22766
22954
|
/* harmony export */ });
|
|
22767
22955
|
/* harmony import */ var _ostTranslations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ostTranslations */ "./src/ostTranslations.ts");
|
|
22768
22956
|
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22957
|
+
const cmdDeviceDesktop = "set-device-desktop";
|
|
22958
|
+
const cmdDeviceTablet = "set-device-tablet";
|
|
22959
|
+
const cmdDeviceMobile = "set-device-mobile";
|
|
22960
|
+
const nameTrait = {
|
|
22773
22961
|
name: "name",
|
|
22774
22962
|
};
|
|
22775
|
-
|
|
22963
|
+
const valueTrait = {
|
|
22776
22964
|
name: "value",
|
|
22777
22965
|
label: _ostTranslations__WEBPACK_IMPORTED_MODULE_0__.ostTrans.traitBlkValue,
|
|
22778
22966
|
};
|
|
22779
|
-
|
|
22967
|
+
const uListItemContent = [
|
|
22780
22968
|
{
|
|
22781
22969
|
tagName: "span",
|
|
22782
22970
|
attributes: { class: "fa-li" },
|
|
@@ -22801,13 +22989,73 @@ var uListItemContent = [
|
|
|
22801
22989
|
style: { margin: "0", padding: "0", "text-align": "left" },
|
|
22802
22990
|
},
|
|
22803
22991
|
];
|
|
22804
|
-
|
|
22992
|
+
const ulListItem = {
|
|
22805
22993
|
type: "ulistitem",
|
|
22806
22994
|
tagName: "li",
|
|
22807
22995
|
attributes: { class: "ulistitem" },
|
|
22808
22996
|
style: { "text-align": "left" },
|
|
22809
22997
|
components: uListItemContent,
|
|
22810
22998
|
};
|
|
22999
|
+
// Comprehensive bullet point patterns for detection and removal
|
|
23000
|
+
const BULLET_PATTERNS = [
|
|
23001
|
+
// Parenthesized numeric/alphabetic markers: (1), (a), (A)
|
|
23002
|
+
/^\(\d+\)\s+/,
|
|
23003
|
+
/^\([a-zA-Z]\)\s+/,
|
|
23004
|
+
// Hierarchical numbering: 1. / 1) / 1.2. / 2.3.4)
|
|
23005
|
+
/^\d+(?:\.\d+)*[.)]\s+/,
|
|
23006
|
+
// Single alphabetic list markers: a) a. A) A.
|
|
23007
|
+
/^[a-zA-Z][.)]\s+/,
|
|
23008
|
+
// Roman numerals (bounded, followed by . or ) and space)
|
|
23009
|
+
/^[IVXLCDM]{1,12}[.)]\s+/i,
|
|
23010
|
+
// Word style lowercase o bullet (kept broad per request)
|
|
23011
|
+
/^o\s+/i,
|
|
23012
|
+
// Basic ASCII bullets (hyphen, asterisk, plus)
|
|
23013
|
+
/^[-*+]\s+/,
|
|
23014
|
+
// Dashes often used as bullets (en/em)
|
|
23015
|
+
/^[–—]\s+/,
|
|
23016
|
+
// Common Unicode bullets & similar symbols
|
|
23017
|
+
/^[•·▪▫‣⁃◦‧⦿⦾⚬]/u,
|
|
23018
|
+
// Private use (Word/Wingdings)
|
|
23019
|
+
/^[\uF0A7\uF0B6\uF0FC\uF0A8\uF076\uF0D8\uF0E0]/u,
|
|
23020
|
+
// Section sign
|
|
23021
|
+
/^§\s+/u,
|
|
23022
|
+
// Circles and dots
|
|
23023
|
+
/^[○●◘◙]/u,
|
|
23024
|
+
// Squares
|
|
23025
|
+
/^[■□]/u,
|
|
23026
|
+
// Diamonds
|
|
23027
|
+
/^[◆◇⬥❖]/u,
|
|
23028
|
+
// Arrows (incl. guillemets)
|
|
23029
|
+
/^[►➔➢➤→⇒▸▹⏵⮚›»]/u,
|
|
23030
|
+
// Checkmarks
|
|
23031
|
+
/^[✓✗]/u,
|
|
23032
|
+
// Stars and similar asterisks
|
|
23033
|
+
/^[⭐✦✧✱✲✳✴]/u,
|
|
23034
|
+
// Circled numbers ①-⑳
|
|
23035
|
+
/^[\u2460-\u2473]/u,
|
|
23036
|
+
// Circled zero variants
|
|
23037
|
+
/^[⓪⓿]/u,
|
|
23038
|
+
// Circled lowercase letters ⓐ-ⓩ
|
|
23039
|
+
/^[\u24D0-\u24E9]/u,
|
|
23040
|
+
// Circled uppercase letters Ⓐ-Ⓩ
|
|
23041
|
+
/^[\u24B6-\u24CF]/u,
|
|
23042
|
+
// HTML named entities
|
|
23043
|
+
/^•\s+/,
|
|
23044
|
+
/^·\s+/,
|
|
23045
|
+
// HTML decimal entities (selected)
|
|
23046
|
+
/^•\s+/, // •
|
|
23047
|
+
/^‣\s+/, // ‣
|
|
23048
|
+
/^⁃\s+/, // ⁃
|
|
23049
|
+
/^→\s+/, // →
|
|
23050
|
+
/^⇒\s+/, // ⇒
|
|
23051
|
+
/^■\s+/, // ■
|
|
23052
|
+
/^□\s+/, // □
|
|
23053
|
+
/^◆\s+/, // ◆
|
|
23054
|
+
/^◇\s+/, // ◇
|
|
23055
|
+
/^○\s+/, // ○
|
|
23056
|
+
/^●\s+/, // ●
|
|
23057
|
+
/^➤\s+/, // ➤
|
|
23058
|
+
];
|
|
22811
23059
|
// Define ostendis type trait for text and default components
|
|
22812
23060
|
function ostTypeTextTrait(opts) {
|
|
22813
23061
|
return {
|
|
@@ -22948,51 +23196,39 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22948
23196
|
/* harmony export */ });
|
|
22949
23197
|
/* harmony import */ var juice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! juice */ "./node_modules/juice/client.js");
|
|
22950
23198
|
/* harmony import */ var juice__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(juice__WEBPACK_IMPORTED_MODULE_0__);
|
|
22951
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
22952
|
-
__assign = Object.assign || function(t) {
|
|
22953
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22954
|
-
s = arguments[i];
|
|
22955
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22956
|
-
t[p] = s[p];
|
|
22957
|
-
}
|
|
22958
|
-
return t;
|
|
22959
|
-
};
|
|
22960
|
-
return __assign.apply(this, arguments);
|
|
22961
|
-
};
|
|
22962
23199
|
|
|
22963
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22964
|
-
|
|
22965
|
-
|
|
23200
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23201
|
+
const cmdm = editor.Commands;
|
|
23202
|
+
const pfx = editor.getConfig().stylePrefix;
|
|
22966
23203
|
cmdm.add(opts.cmdInlineHtml, {
|
|
22967
|
-
run
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
return juice__WEBPACK_IMPORTED_MODULE_0___default()(tmpl, __assign(__assign({}, opts.juiceOpts), opts));
|
|
23204
|
+
run(editor, s, opts = {}) {
|
|
23205
|
+
const tmpl = editor.getHtml() + `<style>${editor.getCss()}</style>`;
|
|
23206
|
+
return juice__WEBPACK_IMPORTED_MODULE_0___default()(tmpl, Object.assign(Object.assign({}, opts.juiceOpts), opts));
|
|
22971
23207
|
},
|
|
22972
23208
|
});
|
|
22973
23209
|
cmdm.add(opts.cmdOpenExport, {
|
|
22974
23210
|
containerEl: null,
|
|
22975
23211
|
codeEditorHtml: null,
|
|
22976
|
-
createCodeViewer
|
|
23212
|
+
createCodeViewer() {
|
|
22977
23213
|
return editor.CodeManager.createViewer({
|
|
22978
23214
|
codeName: "htmlmixed",
|
|
22979
23215
|
theme: opts.codeViewerTheme,
|
|
22980
23216
|
});
|
|
22981
23217
|
},
|
|
22982
|
-
createCodeEditor
|
|
22983
|
-
|
|
22984
|
-
|
|
23218
|
+
createCodeEditor() {
|
|
23219
|
+
const el = document.createElement("div");
|
|
23220
|
+
const codeEditor = this.createCodeViewer();
|
|
22985
23221
|
el.style.flex = "1 0 auto";
|
|
22986
23222
|
el.style.boxSizing = "border-box";
|
|
22987
|
-
el.className =
|
|
23223
|
+
el.className = `${pfx}export-code`;
|
|
22988
23224
|
el.appendChild(codeEditor.getElement());
|
|
22989
|
-
return { codeEditor
|
|
23225
|
+
return { codeEditor, el };
|
|
22990
23226
|
},
|
|
22991
|
-
getCodeContainer
|
|
22992
|
-
|
|
23227
|
+
getCodeContainer() {
|
|
23228
|
+
let containerEl = this.containerEl;
|
|
22993
23229
|
if (!containerEl) {
|
|
22994
23230
|
containerEl = document.createElement("div");
|
|
22995
|
-
containerEl.className =
|
|
23231
|
+
containerEl.className = `${pfx}export-container`;
|
|
22996
23232
|
containerEl.style.display = "flex";
|
|
22997
23233
|
containerEl.style.gap = "5px";
|
|
22998
23234
|
containerEl.style.flexDirection = "column";
|
|
@@ -23001,17 +23237,17 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
23001
23237
|
}
|
|
23002
23238
|
return containerEl;
|
|
23003
23239
|
},
|
|
23004
|
-
run
|
|
23005
|
-
|
|
23006
|
-
|
|
23240
|
+
run(editor) {
|
|
23241
|
+
let { codeEditorHtml } = this;
|
|
23242
|
+
const container = this.getCodeContainer();
|
|
23007
23243
|
// Init code viewer if not yet instantiated
|
|
23008
23244
|
if (!codeEditorHtml) {
|
|
23009
|
-
|
|
23245
|
+
const codeViewer = this.createCodeEditor();
|
|
23010
23246
|
codeEditorHtml = codeViewer.codeEditor;
|
|
23011
23247
|
this.codeEditorHtml = codeEditorHtml;
|
|
23012
23248
|
if (opts.t9n.modalLabelExport) {
|
|
23013
|
-
|
|
23014
|
-
labelEl.className =
|
|
23249
|
+
let labelEl = document.createElement("div");
|
|
23250
|
+
labelEl.className = `${pfx}export-label`;
|
|
23015
23251
|
labelEl.innerHTML = opts.t9n.modalLabelExport;
|
|
23016
23252
|
container.appendChild(labelEl);
|
|
23017
23253
|
}
|
|
@@ -23022,7 +23258,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
23022
23258
|
content: container,
|
|
23023
23259
|
});
|
|
23024
23260
|
if (codeEditorHtml) {
|
|
23025
|
-
|
|
23261
|
+
const tmpl = `${editor.getHtml()}<style>${editor.getCss()}</style>`;
|
|
23026
23262
|
codeEditorHtml.setContent(opts.inlineCss ? juice__WEBPACK_IMPORTED_MODULE_0___default()(tmpl, opts.juiceOpts) : tmpl);
|
|
23027
23263
|
codeEditorHtml.editor.refresh();
|
|
23028
23264
|
}
|
|
@@ -23044,33 +23280,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23044
23280
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23045
23281
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
23046
23282
|
/* harmony export */ });
|
|
23047
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23048
|
-
|
|
23049
|
-
|
|
23283
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23284
|
+
const cmdm = editor.Commands;
|
|
23285
|
+
const pfx = editor.getConfig().stylePrefix;
|
|
23050
23286
|
cmdm.add(opts.cmdOpenImport, {
|
|
23051
23287
|
containerEl: null,
|
|
23052
23288
|
codeEditorHtml: null,
|
|
23053
|
-
createCodeViewer
|
|
23289
|
+
createCodeViewer() {
|
|
23054
23290
|
return editor.CodeManager.createViewer({
|
|
23055
23291
|
codeName: "htmlmixed",
|
|
23056
23292
|
theme: opts.codeViewerTheme,
|
|
23057
23293
|
readOnly: false,
|
|
23058
23294
|
});
|
|
23059
23295
|
},
|
|
23060
|
-
createCodeEditor
|
|
23061
|
-
|
|
23062
|
-
|
|
23296
|
+
createCodeEditor() {
|
|
23297
|
+
const el = document.createElement("div");
|
|
23298
|
+
const codeEditor = this.createCodeViewer();
|
|
23063
23299
|
el.style.flex = "1 0 auto";
|
|
23064
23300
|
el.style.boxSizing = "border-box";
|
|
23065
|
-
el.className =
|
|
23301
|
+
el.className = `${pfx}import-code`;
|
|
23066
23302
|
el.appendChild(codeEditor.getElement());
|
|
23067
|
-
return { codeEditor
|
|
23303
|
+
return { codeEditor, el };
|
|
23068
23304
|
},
|
|
23069
|
-
getCodeContainer
|
|
23070
|
-
|
|
23305
|
+
getCodeContainer() {
|
|
23306
|
+
let containerEl = this.containerEl;
|
|
23071
23307
|
if (!containerEl) {
|
|
23072
23308
|
containerEl = document.createElement("div");
|
|
23073
|
-
containerEl.className =
|
|
23309
|
+
containerEl.className = `${pfx}import-container`;
|
|
23074
23310
|
containerEl.style.display = "flex";
|
|
23075
23311
|
containerEl.style.gap = "5px";
|
|
23076
23312
|
containerEl.style.flexDirection = "column";
|
|
@@ -23079,34 +23315,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23079
23315
|
}
|
|
23080
23316
|
return containerEl;
|
|
23081
23317
|
},
|
|
23082
|
-
run
|
|
23083
|
-
|
|
23084
|
-
|
|
23318
|
+
run(editor) {
|
|
23319
|
+
const container = this.getCodeContainer();
|
|
23320
|
+
let { codeEditorHtml } = this;
|
|
23085
23321
|
// Init code viewer if not yet instantiated
|
|
23086
23322
|
if (!codeEditorHtml) {
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
codeEditorHtml =
|
|
23323
|
+
const codeViewer = this.createCodeEditor();
|
|
23324
|
+
const btnImp = document.createElement("button");
|
|
23325
|
+
codeEditorHtml = codeViewer.codeEditor;
|
|
23090
23326
|
this.codeEditorHtml = codeEditorHtml;
|
|
23091
23327
|
if (opts.t9n.modalLabelImport) {
|
|
23092
|
-
|
|
23093
|
-
labelEl.className =
|
|
23328
|
+
let labelEl = document.createElement("div");
|
|
23329
|
+
labelEl.className = `${pfx}import-label`;
|
|
23094
23330
|
labelEl.innerHTML = opts.t9n.modalLabelImport;
|
|
23095
23331
|
container.appendChild(labelEl);
|
|
23096
23332
|
}
|
|
23097
23333
|
// Init import button
|
|
23098
23334
|
btnImp.innerHTML = opts.t9n.modalBtnImport;
|
|
23099
23335
|
btnImp.type = "button";
|
|
23100
|
-
btnImp.className =
|
|
23336
|
+
btnImp.className = `${pfx}btn-prim ${pfx}btn-import`;
|
|
23101
23337
|
btnImp.style.alignSelf = "flex-start";
|
|
23102
|
-
btnImp.onclick =
|
|
23103
|
-
|
|
23338
|
+
btnImp.onclick = () => {
|
|
23339
|
+
const code = codeViewer.codeEditor.editor.getValue();
|
|
23104
23340
|
editor.Components.clear();
|
|
23105
23341
|
editor.Css.clear();
|
|
23106
23342
|
editor.setComponents(code);
|
|
23107
23343
|
editor.Modal.close();
|
|
23108
23344
|
};
|
|
23109
|
-
container.appendChild(
|
|
23345
|
+
container.appendChild(codeViewer.el);
|
|
23110
23346
|
container.appendChild(btnImp);
|
|
23111
23347
|
}
|
|
23112
23348
|
editor.Modal.open({
|
|
@@ -23135,7 +23371,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23135
23371
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23136
23372
|
/* harmony export */ ostTrans: () => (/* binding */ ostTrans)
|
|
23137
23373
|
/* harmony export */ });
|
|
23138
|
-
|
|
23374
|
+
const ostTrans = {
|
|
23139
23375
|
cmdBtnDesktopLabel: "Desktop",
|
|
23140
23376
|
cmdBtnTabletLabel: "Tablet",
|
|
23141
23377
|
cmdBtnMobileLabel: "Mobile",
|
|
@@ -23261,6 +23497,11 @@ var ostTrans = {
|
|
|
23261
23497
|
labelScalePercent: "Percent",
|
|
23262
23498
|
labelScaleBarColor: "Color 1",
|
|
23263
23499
|
labelScaleBgColor: "Color 2",
|
|
23500
|
+
labelPasteFromWord: "Paste from Word",
|
|
23501
|
+
labelPasteFromWordButton: "Replace List Content",
|
|
23502
|
+
labelPasteFromWordPlaceholder: "Paste your Word list content here...",
|
|
23503
|
+
labelPasteFromWordText: "Paste your list content from Word text editor below.</br>The formatting will be cleaned and converted to list items. This will replace all existing content in the list.",
|
|
23504
|
+
ostToolbarPasteFromWord: "Paste from Word",
|
|
23264
23505
|
ostToolbarClone: "Clone list element",
|
|
23265
23506
|
ostToolbarDelete: "Delete list element",
|
|
23266
23507
|
ostToolbarUp: "Move list element up",
|
|
@@ -23284,15 +23525,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23284
23525
|
/* harmony export */ });
|
|
23285
23526
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
23286
23527
|
|
|
23287
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
|
|
23291
|
-
|
|
23292
|
-
|
|
23293
|
-
|
|
23294
|
-
|
|
23295
|
-
|
|
23528
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23529
|
+
const { Panels } = editor;
|
|
23530
|
+
const { cmdOpenImport, cmdOpenExport } = opts;
|
|
23531
|
+
const openStyleManager = "open-sm";
|
|
23532
|
+
const openTraits = "open-tm";
|
|
23533
|
+
const openLayers = "open-layers";
|
|
23534
|
+
const openBlocks = "open-blocks";
|
|
23535
|
+
const activateOutline = "sw-visibility";
|
|
23536
|
+
const iconStyle = 'style="display: block; max-width: 22px"';
|
|
23296
23537
|
// Turn off default devices select and create new one
|
|
23297
23538
|
editor.getConfig().showDevices = false;
|
|
23298
23539
|
Panels.getPanels().reset([
|
|
@@ -23363,7 +23604,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23363
23604
|
"data-tooltip": opts.t9n.cmdBtnExportLabel,
|
|
23364
23605
|
"data-tooltip-pos": "bottom",
|
|
23365
23606
|
},
|
|
23366
|
-
label:
|
|
23607
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23608
|
+
<path fill="currentColor" d="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z" />
|
|
23609
|
+
</svg>`,
|
|
23367
23610
|
},
|
|
23368
23611
|
{
|
|
23369
23612
|
id: cmdOpenImport,
|
|
@@ -23372,7 +23615,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23372
23615
|
"data-tooltip": opts.t9n.cmdBtnImportLabel,
|
|
23373
23616
|
"data-tooltip-pos": "bottom",
|
|
23374
23617
|
},
|
|
23375
|
-
label:
|
|
23618
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23619
|
+
<path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
|
|
23620
|
+
</svg>`,
|
|
23376
23621
|
},
|
|
23377
23622
|
{
|
|
23378
23623
|
id: "undo",
|
|
@@ -23406,7 +23651,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23406
23651
|
"data-tooltip": opts.t9n.openStyleManager,
|
|
23407
23652
|
"data-tooltip-pos": "bottom",
|
|
23408
23653
|
},
|
|
23409
|
-
label:
|
|
23654
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23655
|
+
<path fill="currentColor" d="M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z" />
|
|
23656
|
+
</svg>`,
|
|
23410
23657
|
},
|
|
23411
23658
|
{
|
|
23412
23659
|
id: openTraits,
|
|
@@ -23416,7 +23663,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23416
23663
|
"data-tooltip": opts.t9n.openTraits,
|
|
23417
23664
|
"data-tooltip-pos": "bottom",
|
|
23418
23665
|
},
|
|
23419
|
-
label:
|
|
23666
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23667
|
+
<path fill="currentColor" d="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"></path>
|
|
23668
|
+
</svg>`,
|
|
23420
23669
|
},
|
|
23421
23670
|
{
|
|
23422
23671
|
id: openLayers,
|
|
@@ -23426,7 +23675,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23426
23675
|
"data-tooltip": opts.t9n.openLayers,
|
|
23427
23676
|
"data-tooltip-pos": "bottom",
|
|
23428
23677
|
},
|
|
23429
|
-
label:
|
|
23678
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23679
|
+
<path fill="currentColor" d="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z" />
|
|
23680
|
+
</svg>`,
|
|
23430
23681
|
},
|
|
23431
23682
|
{
|
|
23432
23683
|
id: openBlocks,
|
|
@@ -23436,28 +23687,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23436
23687
|
"data-tooltip": opts.t9n.openBlocks,
|
|
23437
23688
|
"data-tooltip-pos": "bottom",
|
|
23438
23689
|
},
|
|
23439
|
-
label:
|
|
23690
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23691
|
+
<path fill="currentColor" d="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" />
|
|
23692
|
+
</svg>`,
|
|
23440
23693
|
},
|
|
23441
23694
|
],
|
|
23442
23695
|
},
|
|
23443
23696
|
]);
|
|
23444
|
-
editor.onReady(
|
|
23697
|
+
editor.onReady(() => {
|
|
23445
23698
|
if (opts.showOutlineOnLoad) {
|
|
23446
|
-
|
|
23699
|
+
const btn = Panels.getButton("options", activateOutline);
|
|
23447
23700
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23448
23701
|
}
|
|
23449
23702
|
if (opts.showBlocksOnLoad) {
|
|
23450
|
-
|
|
23703
|
+
const btn = Panels.getButton("views", openBlocks);
|
|
23451
23704
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23452
23705
|
}
|
|
23453
23706
|
if (opts.showTraitsOnLoad) {
|
|
23454
|
-
|
|
23707
|
+
const btn = Panels.getButton("views", openTraits);
|
|
23455
23708
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23456
23709
|
}
|
|
23457
23710
|
//Beautify tooltips
|
|
23458
|
-
document.querySelectorAll("*[data-tooltip-pos]").forEach(
|
|
23711
|
+
document.querySelectorAll("*[data-tooltip-pos]").forEach((el) => {
|
|
23459
23712
|
var _a;
|
|
23460
|
-
|
|
23713
|
+
const title = (_a = el.getAttribute("title")) === null || _a === void 0 ? void 0 : _a.trim();
|
|
23461
23714
|
if (title) {
|
|
23462
23715
|
el.setAttribute("data-tooltip", title);
|
|
23463
23716
|
el.removeAttribute("title");
|
|
@@ -23489,45 +23742,14 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23489
23742
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23490
23743
|
});
|
|
23491
23744
|
};
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
23499
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
23500
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23501
|
-
switch (op[0]) {
|
|
23502
|
-
case 0: case 1: t = op; break;
|
|
23503
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23504
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23505
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
23506
|
-
default:
|
|
23507
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
23508
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
23509
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
23510
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
23511
|
-
if (t[2]) _.ops.pop();
|
|
23512
|
-
_.trys.pop(); continue;
|
|
23513
|
-
}
|
|
23514
|
-
op = body.call(thisArg, _);
|
|
23515
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
23516
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
23517
|
-
}
|
|
23518
|
-
};
|
|
23519
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (editor, opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23520
|
-
var RichTextEditor;
|
|
23521
|
-
return __generator(this, function (_a) {
|
|
23522
|
-
RichTextEditor = editor.RichTextEditor;
|
|
23523
|
-
RichTextEditor.add("removeFormat", {
|
|
23524
|
-
icon: '<i class="fa-solid fa-text-slash"></i>',
|
|
23525
|
-
attributes: { title: opts.t9n.cmdRteRemoveFormat },
|
|
23526
|
-
result: function (rte) { return rte.exec("removeFormat"); },
|
|
23527
|
-
});
|
|
23528
|
-
return [2 /*return*/];
|
|
23745
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23746
|
+
const { RichTextEditor } = editor;
|
|
23747
|
+
RichTextEditor.add("removeFormat", {
|
|
23748
|
+
icon: '<i class="fa-solid fa-text-slash"></i>',
|
|
23749
|
+
attributes: { title: opts.t9n.cmdRteRemoveFormat },
|
|
23750
|
+
result: (rte) => rte.exec("removeFormat"),
|
|
23529
23751
|
});
|
|
23530
|
-
})
|
|
23752
|
+
}));
|
|
23531
23753
|
|
|
23532
23754
|
|
|
23533
23755
|
/***/ }),
|
|
@@ -23543,47 +23765,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23543
23765
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23544
23766
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
23545
23767
|
/* harmony export */ });
|
|
23546
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23547
|
-
|
|
23768
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23769
|
+
const { TraitManager } = editor;
|
|
23548
23770
|
// Ostendis-Blocks trait
|
|
23549
23771
|
TraitManager.addType("ost-blocks-select", {
|
|
23550
|
-
createInput
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
var options = traitOpts.length
|
|
23772
|
+
createInput({ trait }) {
|
|
23773
|
+
const traitOpts = trait.get("options") || [];
|
|
23774
|
+
const traitName = trait.get("name") || "ost-block-select";
|
|
23775
|
+
const options = traitOpts.length
|
|
23555
23776
|
? traitOpts
|
|
23556
23777
|
: [{ id: "", name: "None", disabled: "disabled" }];
|
|
23557
|
-
|
|
23558
|
-
el.innerHTML =
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
.join("")
|
|
23778
|
+
const el = document.createElement("div");
|
|
23779
|
+
el.innerHTML = `
|
|
23780
|
+
<select class="ost-blocks-select" id="${traitName}">
|
|
23781
|
+
${options
|
|
23782
|
+
.map((opt) => `<option value="${opt.id}" ${opt.disabled}>${opt.name}</option>`)
|
|
23783
|
+
.join("")}
|
|
23784
|
+
</select>
|
|
23785
|
+
<div class="gjs-sel-arrow">
|
|
23786
|
+
<div class="gjs-d-s-arrow"></div>
|
|
23787
|
+
</div>`;
|
|
23563
23788
|
return el;
|
|
23564
23789
|
},
|
|
23565
|
-
onEvent
|
|
23566
|
-
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
var element = elInput.querySelector("#" + [traitName]);
|
|
23570
|
-
var dataOstType = element.value;
|
|
23790
|
+
onEvent({ elInput, component, trait }) {
|
|
23791
|
+
const traitName = trait.get("name") || "ost-block-select-default";
|
|
23792
|
+
let element = elInput.querySelector("#" + [traitName]);
|
|
23793
|
+
const dataOstType = element.value;
|
|
23571
23794
|
if (dataOstType == "") {
|
|
23572
23795
|
component.removeAttributes(traitName);
|
|
23573
23796
|
}
|
|
23574
23797
|
else {
|
|
23575
|
-
component.addAttributes(
|
|
23798
|
+
component.addAttributes({ [traitName]: dataOstType });
|
|
23576
23799
|
}
|
|
23577
23800
|
updateTrait(element);
|
|
23578
23801
|
},
|
|
23579
|
-
onUpdate
|
|
23580
|
-
|
|
23581
|
-
var traitName = trait.get("name") || "ost-block-select-default";
|
|
23802
|
+
onUpdate({ elInput, component, trait }) {
|
|
23803
|
+
const traitName = trait.get("name") || "ost-block-select-default";
|
|
23582
23804
|
if (elInput !== null) {
|
|
23583
|
-
|
|
23805
|
+
let element = elInput.querySelector("#" + [traitName]);
|
|
23584
23806
|
updateTrait(element);
|
|
23585
23807
|
// Set select
|
|
23586
|
-
|
|
23808
|
+
const dataOstType = component.getAttributes()[traitName] || "";
|
|
23587
23809
|
element = elInput.querySelector("#" + [traitName]);
|
|
23588
23810
|
element.value = dataOstType;
|
|
23589
23811
|
}
|
|
@@ -23597,15 +23819,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23597
23819
|
events: {
|
|
23598
23820
|
keyup: "onChange",
|
|
23599
23821
|
},
|
|
23600
|
-
onValueChange
|
|
23822
|
+
onValueChange() {
|
|
23601
23823
|
var _a;
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
for (
|
|
23607
|
-
|
|
23608
|
-
|
|
23824
|
+
const { model, target } = this;
|
|
23825
|
+
const optionsStr = model.get("value").trim();
|
|
23826
|
+
const options = optionsStr.split("\n");
|
|
23827
|
+
const optComps = [];
|
|
23828
|
+
for (let i = 0; i < options.length; i++) {
|
|
23829
|
+
const optionStr = options[i];
|
|
23830
|
+
const option = optionStr.split("::");
|
|
23609
23831
|
optComps.push({
|
|
23610
23832
|
type: "range",
|
|
23611
23833
|
components: option[1] || option[0],
|
|
@@ -23619,15 +23841,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23619
23841
|
function updateTrait(element) {
|
|
23620
23842
|
var _a;
|
|
23621
23843
|
// Set Array to 0
|
|
23622
|
-
opts.usedOstBlocks.forEach(
|
|
23844
|
+
opts.usedOstBlocks.forEach((el) => {
|
|
23623
23845
|
el.count = 0;
|
|
23624
23846
|
});
|
|
23625
23847
|
var wrapper = editor.DomComponents.getWrapper();
|
|
23626
23848
|
var elements = (_a = wrapper === null || wrapper === void 0 ? void 0 : wrapper.view) === null || _a === void 0 ? void 0 : _a.$el.find("[data-ost-type]").get();
|
|
23627
23849
|
// List all data-ost-type
|
|
23628
|
-
elements === null || elements === void 0 ? void 0 : elements.forEach(
|
|
23850
|
+
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
|
23629
23851
|
var type = element.getAttribute("data-ost-type") || "";
|
|
23630
|
-
|
|
23852
|
+
let index = opts.usedOstBlocks.findIndex((item) => item.name === type);
|
|
23631
23853
|
if (index === -1) {
|
|
23632
23854
|
opts.usedOstBlocks.push({ name: type, count: 1 });
|
|
23633
23855
|
}
|
|
@@ -23638,7 +23860,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23638
23860
|
// Display update select input
|
|
23639
23861
|
Array.from(element.options).forEach(function (optionElement, optionIndex) {
|
|
23640
23862
|
if (optionElement.value != "") {
|
|
23641
|
-
|
|
23863
|
+
const usedOstBlockIndex = opts.usedOstBlocks.findIndex((e) => e.name === optionElement.value);
|
|
23642
23864
|
// Reset
|
|
23643
23865
|
var optionEl = element.options[optionIndex];
|
|
23644
23866
|
optionEl.text = optionEl.text.replace(/^\(.*\)\s*/g, "");
|
|
@@ -23755,17 +23977,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23755
23977
|
/* harmony import */ var _rte__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rte */ "./src/rte.ts");
|
|
23756
23978
|
/* harmony import */ var _ostTranslations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ostTranslations */ "./src/ostTranslations.ts");
|
|
23757
23979
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
23758
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
23759
|
-
__assign = Object.assign || function(t) {
|
|
23760
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23761
|
-
s = arguments[i];
|
|
23762
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
23763
|
-
t[p] = s[p];
|
|
23764
|
-
}
|
|
23765
|
-
return t;
|
|
23766
|
-
};
|
|
23767
|
-
return __assign.apply(this, arguments);
|
|
23768
|
-
};
|
|
23769
23980
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23770
23981
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23771
23982
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23775,42 +23986,6 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23775
23986
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23776
23987
|
});
|
|
23777
23988
|
};
|
|
23778
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
23779
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23780
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
23781
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
23782
|
-
function step(op) {
|
|
23783
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23784
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
23785
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
23786
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23787
|
-
switch (op[0]) {
|
|
23788
|
-
case 0: case 1: t = op; break;
|
|
23789
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23790
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23791
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
23792
|
-
default:
|
|
23793
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
23794
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
23795
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
23796
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
23797
|
-
if (t[2]) _.ops.pop();
|
|
23798
|
-
_.trys.pop(); continue;
|
|
23799
|
-
}
|
|
23800
|
-
op = body.call(thisArg, _);
|
|
23801
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
23802
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
23803
|
-
}
|
|
23804
|
-
};
|
|
23805
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
23806
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
23807
|
-
if (ar || !(i in from)) {
|
|
23808
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
23809
|
-
ar[i] = from[i];
|
|
23810
|
-
}
|
|
23811
|
-
}
|
|
23812
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23813
|
-
};
|
|
23814
23989
|
|
|
23815
23990
|
|
|
23816
23991
|
|
|
@@ -23819,225 +23994,217 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
23819
23994
|
|
|
23820
23995
|
|
|
23821
23996
|
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
|
|
23830
|
-
|
|
23831
|
-
|
|
23832
|
-
|
|
23997
|
+
const plugin = (editor_1, ...args_1) => __awaiter(void 0, [editor_1, ...args_1], void 0, function* (editor, opts = {}) {
|
|
23998
|
+
let config = editor.getConfig();
|
|
23999
|
+
const options = Object.assign({ blocks: [], block: () => ({}), usedOstBlocks: [], cmdOpenExport: "gjs-open-export-template", cmdOpenImport: "gjs-open-import-template", cmdInlineHtml: "gjs-get-inlined-html", codeViewerTheme: "hopscotch", inlineCss: true, juiceOpts: {}, updateStyleManager: true, showStylesOnChange: true, showBlocksOnLoad: false, showTraitsOnLoad: true, showOutlineOnLoad: true, t9n: _ostTranslations__WEBPACK_IMPORTED_MODULE_6__.ostTrans }, opts);
|
|
24000
|
+
// Change some config
|
|
24001
|
+
config.devicePreviewMode = true;
|
|
24002
|
+
(0,_components__WEBPACK_IMPORTED_MODULE_4__["default"])(editor, options);
|
|
24003
|
+
(0,_traits__WEBPACK_IMPORTED_MODULE_3__["default"])(editor, options);
|
|
24004
|
+
yield (0,_commands__WEBPACK_IMPORTED_MODULE_1__["default"])(editor, options);
|
|
24005
|
+
(0,_blocks__WEBPACK_IMPORTED_MODULE_0__["default"])(editor, options);
|
|
24006
|
+
(0,_panels__WEBPACK_IMPORTED_MODULE_2__["default"])(editor, options);
|
|
24007
|
+
yield (0,_rte__WEBPACK_IMPORTED_MODULE_5__["default"])(editor, options);
|
|
24008
|
+
// On load
|
|
24009
|
+
editor.on("load", () => {
|
|
24010
|
+
// Create ostendis toolbar
|
|
24011
|
+
const tools = document.getElementById("gjs-tools");
|
|
24012
|
+
const ostTools = document.createElement("div");
|
|
24013
|
+
ostTools.classList.add("gjs-ost-toolbar");
|
|
24014
|
+
tools === null || tools === void 0 ? void 0 : tools.append(ostTools);
|
|
24015
|
+
// Change all elements with header tags from type text to header
|
|
24016
|
+
const changeHeaderType = (component) => {
|
|
24017
|
+
const tagName = component.get("tagName");
|
|
24018
|
+
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
24019
|
+
if (tagName &&
|
|
24020
|
+
headings.includes(tagName.toLowerCase()) &&
|
|
24021
|
+
component.get("type") === "text") {
|
|
24022
|
+
component.set({ type: "header" });
|
|
24023
|
+
component.setTraits([
|
|
24024
|
+
{ name: "id" },
|
|
24025
|
+
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.headerTrait)(options),
|
|
24026
|
+
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeTextTrait)(options),
|
|
24027
|
+
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeHideInSimpleHtmlTrait)(options),
|
|
24028
|
+
]);
|
|
24029
|
+
}
|
|
24030
|
+
const children = component.components();
|
|
24031
|
+
children.each((child) => changeHeaderType(child));
|
|
24032
|
+
};
|
|
24033
|
+
const wrapper = editor.getWrapper();
|
|
24034
|
+
const components = wrapper === null || wrapper === void 0 ? void 0 : wrapper.components();
|
|
24035
|
+
components === null || components === void 0 ? void 0 : components.each((component) => changeHeaderType(component));
|
|
24036
|
+
});
|
|
24037
|
+
// On selected components
|
|
24038
|
+
editor.on("component:selected", () => {
|
|
24039
|
+
var _a, _b, _c;
|
|
24040
|
+
let selected = editor.getSelected();
|
|
24041
|
+
if (selected != undefined) {
|
|
24042
|
+
if (selected.is("ulistitem")) {
|
|
24043
|
+
showOstToolbar(selected);
|
|
24044
|
+
}
|
|
24045
|
+
else if (selected.isChildOf("ulistitem")) {
|
|
24046
|
+
showOstToolbar(selected.closestType("ulistitem"));
|
|
24047
|
+
}
|
|
24048
|
+
else if (((_a = selected.getEl()) === null || _a === void 0 ? void 0 : _a.tagName) === "LI") {
|
|
24049
|
+
// If list element is empty replace with placeholder text (M&E case:)
|
|
24050
|
+
if (selected.components().length === 0 && !selected.get("content")) {
|
|
24051
|
+
const selectedPosition = selected.index();
|
|
24052
|
+
const newComponent = (_b = selected
|
|
24053
|
+
.parent()) === null || _b === void 0 ? void 0 : _b.append("<li>Text</li>", { at: selectedPosition });
|
|
24054
|
+
selected.remove();
|
|
24055
|
+
editor.select(newComponent);
|
|
24056
|
+
selected = editor.getSelected();
|
|
24057
|
+
}
|
|
24058
|
+
showOstToolbar(selected);
|
|
24059
|
+
}
|
|
24060
|
+
else if (isChildOfElement(selected.getEl(), "LI")) {
|
|
24061
|
+
showOstToolbar(selected.closest("li"));
|
|
24062
|
+
}
|
|
24063
|
+
else if (((_c = selected.getEl()) === null || _c === void 0 ? void 0 : _c.tagName) === "UL") {
|
|
24064
|
+
// UL is selected - show toolbar with paste-from-word and standard buttons with SVG icons
|
|
24065
|
+
const ulToolbar = [
|
|
24066
|
+
{
|
|
24067
|
+
attributes: {
|
|
24068
|
+
class: "fa-solid fa-file-word",
|
|
24069
|
+
"data-tooltip": options.t9n.ostToolbarPasteFromWord,
|
|
24070
|
+
"data-tooltip-pos": "bottom"
|
|
24071
|
+
},
|
|
24072
|
+
command: "paste-from-word",
|
|
24073
|
+
},
|
|
24074
|
+
{
|
|
24075
|
+
label: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z"></path></svg>',
|
|
24076
|
+
command: "select-parent",
|
|
24077
|
+
},
|
|
24078
|
+
{
|
|
24079
|
+
label: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"></path></svg>',
|
|
24080
|
+
command: "tlb-move",
|
|
24081
|
+
},
|
|
24082
|
+
{
|
|
24083
|
+
label: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg>',
|
|
24084
|
+
command: "tlb-clone"
|
|
24085
|
+
},
|
|
24086
|
+
{
|
|
24087
|
+
label: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"></path></svg>',
|
|
24088
|
+
command: "tlb-delete"
|
|
24089
|
+
},
|
|
24090
|
+
];
|
|
24091
|
+
selected.set({
|
|
24092
|
+
toolbar: ulToolbar,
|
|
24093
|
+
});
|
|
24094
|
+
// Hide OST toolbar for UL elements
|
|
24095
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24096
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
24097
|
+
}
|
|
24098
|
+
else {
|
|
24099
|
+
// For other elements, just hide OST toolbar
|
|
24100
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24101
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
23833
24102
|
}
|
|
23834
|
-
return false;
|
|
23835
24103
|
}
|
|
23836
|
-
|
|
23837
|
-
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
|
|
24104
|
+
});
|
|
24105
|
+
// On deselected components
|
|
24106
|
+
editor.on("component:deselected", () => {
|
|
24107
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24108
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
24109
|
+
});
|
|
24110
|
+
function isChildOfElement(element, tag) {
|
|
24111
|
+
while (element === null || element === void 0 ? void 0 : element.parentNode) {
|
|
24112
|
+
element = element.parentNode;
|
|
24113
|
+
if (element.tagName === tag)
|
|
24114
|
+
return element;
|
|
24115
|
+
}
|
|
24116
|
+
return false;
|
|
24117
|
+
}
|
|
24118
|
+
function showOstToolbar(listItem) {
|
|
24119
|
+
var _a;
|
|
24120
|
+
const elPos = (listItem === null || listItem === void 0 ? void 0 : listItem.index()) || 0;
|
|
24121
|
+
const elLast = (_a = listItem === null || listItem === void 0 ? void 0 : listItem.parent()) === null || _a === void 0 ? void 0 : _a.getLastChild().index();
|
|
24122
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24123
|
+
if (ostToolbar != undefined) {
|
|
24124
|
+
ostToolbar.innerHTML = "";
|
|
24125
|
+
// Add clone button
|
|
24126
|
+
const cBtn = document.createElement("div");
|
|
24127
|
+
cBtn.innerHTML =
|
|
24128
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12 3a9 9 0 0 0 0 18 9 9 0 0 0 0-18zm-1.3 3.88h2.6v3.82h3.82v2.6H13.3v3.82h-2.6V13.3H6.88v-2.6h3.82z"/></svg>';
|
|
24129
|
+
cBtn.classList.add("gjs-ost-toolbar-item", "clone");
|
|
24130
|
+
cBtn.title = options.t9n.ostToolbarClone;
|
|
24131
|
+
cBtn.addEventListener("click", () => {
|
|
24132
|
+
var _a;
|
|
24133
|
+
if (!listItem || !editor)
|
|
24134
|
+
return;
|
|
24135
|
+
const clonedItem = listItem === null || listItem === void 0 ? void 0 : listItem.clone();
|
|
24136
|
+
(_a = listItem === null || listItem === void 0 ? void 0 : listItem.parent()) === null || _a === void 0 ? void 0 : _a.append(clonedItem, { at: elPos + 1 });
|
|
24137
|
+
});
|
|
24138
|
+
ostToolbar.appendChild(cBtn);
|
|
24139
|
+
//Add delete button
|
|
24140
|
+
const dBtn = document.createElement("div");
|
|
24141
|
+
dBtn.innerHTML =
|
|
24142
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm5.12 7.7v2.6H6.88v-2.6z"/></svg>';
|
|
24143
|
+
dBtn.title = options.t9n.ostToolbarDelete;
|
|
24144
|
+
dBtn.classList.add("gjs-ost-toolbar-item", "del");
|
|
24145
|
+
if (elLast != 0) {
|
|
24146
|
+
dBtn.addEventListener("click", () => {
|
|
24147
|
+
listItem === null || listItem === void 0 ? void 0 : listItem.remove();
|
|
24148
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
23855
24149
|
});
|
|
23856
|
-
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
|
|
23861
|
-
|
|
23862
|
-
|
|
23863
|
-
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
23867
|
-
|
|
23868
|
-
|
|
23869
|
-
|
|
23870
|
-
|
|
23871
|
-
|
|
23872
|
-
|
|
23873
|
-
// Add move up button
|
|
23874
|
-
var upBtn = document.createElement("div");
|
|
23875
|
-
upBtn.innerHTML =
|
|
23876
|
-
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M1.9 20.75 12 3.25l10.1 17.5Z"/></svg>';
|
|
23877
|
-
upBtn.title = options.t9n.ostToolbarUp;
|
|
23878
|
-
upBtn.classList.add("gjs-ost-toolbar-item", "up");
|
|
23879
|
-
if (elPos > 0) {
|
|
23880
|
-
upBtn.addEventListener("click", function () {
|
|
23881
|
-
if (elPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
23882
|
-
var parent_1 = listItem.parent();
|
|
23883
|
-
if (parent_1) {
|
|
23884
|
-
listItem === null || listItem === void 0 ? void 0 : listItem.move(parent_1, { at: elPos - 1 });
|
|
23885
|
-
}
|
|
23886
|
-
editor.selectRemove(listItem);
|
|
23887
|
-
editor.select(listItem);
|
|
24150
|
+
}
|
|
24151
|
+
else {
|
|
24152
|
+
dBtn.classList.add("disable");
|
|
24153
|
+
}
|
|
24154
|
+
ostToolbar.appendChild(dBtn);
|
|
24155
|
+
// Add move up button
|
|
24156
|
+
const upBtn = document.createElement("div");
|
|
24157
|
+
upBtn.innerHTML =
|
|
24158
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M1.9 20.75 12 3.25l10.1 17.5Z"/></svg>';
|
|
24159
|
+
upBtn.title = options.t9n.ostToolbarUp;
|
|
24160
|
+
upBtn.classList.add("gjs-ost-toolbar-item", "up");
|
|
24161
|
+
if (elPos > 0) {
|
|
24162
|
+
upBtn.addEventListener("click", () => {
|
|
24163
|
+
if (elPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
24164
|
+
let parent = listItem.parent();
|
|
24165
|
+
if (parent) {
|
|
24166
|
+
listItem === null || listItem === void 0 ? void 0 : listItem.move(parent, { at: elPos - 1 });
|
|
23888
24167
|
}
|
|
23889
|
-
|
|
23890
|
-
|
|
23891
|
-
else {
|
|
23892
|
-
upBtn.classList.add("disable");
|
|
23893
|
-
}
|
|
23894
|
-
ostToolbar.appendChild(upBtn);
|
|
23895
|
-
// Add move down button
|
|
23896
|
-
var dwnBtn = document.createElement("div");
|
|
23897
|
-
dwnBtn.innerHTML =
|
|
23898
|
-
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M22.4 3.25 12 20.75 1.6 3.25Z"/></svg>';
|
|
23899
|
-
dwnBtn.title = options.t9n.ostToolbarDown;
|
|
23900
|
-
dwnBtn.classList.add("gjs-ost-toolbar-item", "down");
|
|
23901
|
-
if (elPos != elLast) {
|
|
23902
|
-
var toPos = elPos + 2;
|
|
23903
|
-
if (elPos == elLast) {
|
|
23904
|
-
toPos = 0;
|
|
24168
|
+
editor.selectRemove(listItem);
|
|
24169
|
+
editor.select(listItem);
|
|
23905
24170
|
}
|
|
23906
|
-
|
|
23907
|
-
|
|
23908
|
-
|
|
23909
|
-
|
|
23910
|
-
|
|
23911
|
-
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23915
|
-
|
|
23916
|
-
|
|
23917
|
-
|
|
23918
|
-
|
|
24171
|
+
});
|
|
24172
|
+
}
|
|
24173
|
+
else {
|
|
24174
|
+
upBtn.classList.add("disable");
|
|
24175
|
+
}
|
|
24176
|
+
ostToolbar.appendChild(upBtn);
|
|
24177
|
+
// Add move down button
|
|
24178
|
+
const dwnBtn = document.createElement("div");
|
|
24179
|
+
dwnBtn.innerHTML =
|
|
24180
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M22.4 3.25 12 20.75 1.6 3.25Z"/></svg>';
|
|
24181
|
+
dwnBtn.title = options.t9n.ostToolbarDown;
|
|
24182
|
+
dwnBtn.classList.add("gjs-ost-toolbar-item", "down");
|
|
24183
|
+
if (elPos != elLast) {
|
|
24184
|
+
let toPos = elPos + 2;
|
|
24185
|
+
if (elPos == elLast) {
|
|
24186
|
+
toPos = 0;
|
|
23919
24187
|
}
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
var config, options;
|
|
23926
|
-
if (opts === void 0) { opts = {}; }
|
|
23927
|
-
return __generator(this, function (_a) {
|
|
23928
|
-
switch (_a.label) {
|
|
23929
|
-
case 0:
|
|
23930
|
-
config = editor.getConfig();
|
|
23931
|
-
options = __assign({ blocks: [], block: function () { return ({}); }, usedOstBlocks: [], cmdOpenExport: "gjs-open-export-template", cmdOpenImport: "gjs-open-import-template", cmdInlineHtml: "gjs-get-inlined-html", codeViewerTheme: "hopscotch", inlineCss: true, juiceOpts: {}, updateStyleManager: true, showStylesOnChange: true, showBlocksOnLoad: false, showTraitsOnLoad: true, showOutlineOnLoad: true, t9n: _ostTranslations__WEBPACK_IMPORTED_MODULE_6__.ostTrans }, opts);
|
|
23932
|
-
// Change some config
|
|
23933
|
-
config.devicePreviewMode = true;
|
|
23934
|
-
(0,_components__WEBPACK_IMPORTED_MODULE_4__["default"])(editor, options);
|
|
23935
|
-
(0,_traits__WEBPACK_IMPORTED_MODULE_3__["default"])(editor, options);
|
|
23936
|
-
return [4 /*yield*/, (0,_commands__WEBPACK_IMPORTED_MODULE_1__["default"])(editor, options)];
|
|
23937
|
-
case 1:
|
|
23938
|
-
_a.sent();
|
|
23939
|
-
(0,_blocks__WEBPACK_IMPORTED_MODULE_0__["default"])(editor, options);
|
|
23940
|
-
(0,_panels__WEBPACK_IMPORTED_MODULE_2__["default"])(editor, options);
|
|
23941
|
-
return [4 /*yield*/, (0,_rte__WEBPACK_IMPORTED_MODULE_5__["default"])(editor, options)];
|
|
23942
|
-
case 2:
|
|
23943
|
-
_a.sent();
|
|
23944
|
-
// On load
|
|
23945
|
-
editor.on("load", function () {
|
|
23946
|
-
// Create ostendis toolbar
|
|
23947
|
-
var tools = document.getElementById("gjs-tools");
|
|
23948
|
-
var ostTools = document.createElement("div");
|
|
23949
|
-
ostTools.classList.add("gjs-ost-toolbar");
|
|
23950
|
-
tools === null || tools === void 0 ? void 0 : tools.append(ostTools);
|
|
23951
|
-
// Change all elements with header tags from type text to header
|
|
23952
|
-
var changeHeaderType = function (component) {
|
|
23953
|
-
var tagName = component.get("tagName");
|
|
23954
|
-
var headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
23955
|
-
if (tagName &&
|
|
23956
|
-
headings.includes(tagName.toLowerCase()) &&
|
|
23957
|
-
component.get("type") === "text") {
|
|
23958
|
-
component.set({ type: "header" });
|
|
23959
|
-
component.setTraits([
|
|
23960
|
-
{ name: "id" },
|
|
23961
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.headerTrait)(options),
|
|
23962
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeTextTrait)(options),
|
|
23963
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeHideInSimpleHtmlTrait)(options),
|
|
23964
|
-
]);
|
|
23965
|
-
}
|
|
23966
|
-
var children = component.components();
|
|
23967
|
-
children.each(function (child) { return changeHeaderType(child); });
|
|
23968
|
-
};
|
|
23969
|
-
var wrapper = editor.getWrapper();
|
|
23970
|
-
var components = wrapper === null || wrapper === void 0 ? void 0 : wrapper.components();
|
|
23971
|
-
components === null || components === void 0 ? void 0 : components.each(function (component) { return changeHeaderType(component); });
|
|
23972
|
-
});
|
|
23973
|
-
// On selected components
|
|
23974
|
-
editor.on("component:selected", function () {
|
|
23975
|
-
var _a, _b;
|
|
23976
|
-
var selected = editor.getSelected();
|
|
23977
|
-
if (selected != undefined) {
|
|
23978
|
-
if (selected.is("ulistitem")) {
|
|
23979
|
-
showOstToolbar(selected);
|
|
23980
|
-
}
|
|
23981
|
-
else if (selected.isChildOf("ulistitem")) {
|
|
23982
|
-
showOstToolbar(selected.closestType("ulistitem"));
|
|
23983
|
-
}
|
|
23984
|
-
else if (((_a = selected.getEl()) === null || _a === void 0 ? void 0 : _a.tagName) === "LI") {
|
|
23985
|
-
// If list element is empty replace with placeholder text (M&E case:)
|
|
23986
|
-
if (selected.components().length === 0 && !selected.get("content")) {
|
|
23987
|
-
var selectedPosition = selected.index();
|
|
23988
|
-
var newComponent = (_b = selected
|
|
23989
|
-
.parent()) === null || _b === void 0 ? void 0 : _b.append("<li>Text</li>", { at: selectedPosition });
|
|
23990
|
-
selected.remove();
|
|
23991
|
-
editor.select(newComponent);
|
|
23992
|
-
selected = editor.getSelected();
|
|
23993
|
-
}
|
|
23994
|
-
showOstToolbar(selected);
|
|
23995
|
-
}
|
|
23996
|
-
else if (isChildOfElement(selected.getEl(), "LI")) {
|
|
23997
|
-
showOstToolbar(selected.closest("li"));
|
|
23998
|
-
}
|
|
24188
|
+
dwnBtn.addEventListener("click", () => {
|
|
24189
|
+
if (toPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
24190
|
+
let parent = listItem.parent();
|
|
24191
|
+
if (parent) {
|
|
24192
|
+
listItem.move(parent, { at: toPos });
|
|
23999
24193
|
}
|
|
24000
|
-
|
|
24001
|
-
|
|
24002
|
-
|
|
24003
|
-
|
|
24004
|
-
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
24005
|
-
});
|
|
24006
|
-
// On storage start
|
|
24007
|
-
editor.on("storage:start", function () {
|
|
24008
|
-
// Reset all Components
|
|
24009
|
-
var getAllComponents = function (model, result) {
|
|
24010
|
-
if (result === void 0) { result = []; }
|
|
24011
|
-
result.push(model);
|
|
24012
|
-
model.components().each(function (mod) { return getAllComponents(mod, result); });
|
|
24013
|
-
return result;
|
|
24014
|
-
};
|
|
24015
|
-
var allComponents = getAllComponents(editor.DomComponents.getWrapper());
|
|
24016
|
-
allComponents.forEach(function (compo) {
|
|
24017
|
-
return compo.set({
|
|
24018
|
-
draggable: true,
|
|
24019
|
-
removable: true,
|
|
24020
|
-
copyable: true,
|
|
24021
|
-
toolbar: [
|
|
24022
|
-
{
|
|
24023
|
-
attributes: { class: "fa-solid fa-arrow-up" },
|
|
24024
|
-
command: "select-parent",
|
|
24025
|
-
},
|
|
24026
|
-
{
|
|
24027
|
-
attributes: { class: "fa-solid fa-arrows-up-down-left-right" },
|
|
24028
|
-
command: "tlb-move",
|
|
24029
|
-
},
|
|
24030
|
-
{ attributes: { class: "fa-regular fa-copy" }, command: "tlb-clone" },
|
|
24031
|
-
{ attributes: { class: "fa-solid fa-trash" }, command: "tlb-delete" },
|
|
24032
|
-
],
|
|
24033
|
-
});
|
|
24034
|
-
});
|
|
24035
|
-
});
|
|
24036
|
-
return [2 /*return*/];
|
|
24194
|
+
editor.selectRemove(listItem);
|
|
24195
|
+
editor.select(listItem);
|
|
24196
|
+
}
|
|
24197
|
+
});
|
|
24037
24198
|
}
|
|
24038
|
-
|
|
24039
|
-
|
|
24040
|
-
}
|
|
24199
|
+
else {
|
|
24200
|
+
dwnBtn.classList.add("disable");
|
|
24201
|
+
}
|
|
24202
|
+
ostToolbar.appendChild(dwnBtn);
|
|
24203
|
+
// Add show
|
|
24204
|
+
ostToolbar.classList.add("show");
|
|
24205
|
+
}
|
|
24206
|
+
}
|
|
24207
|
+
});
|
|
24041
24208
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
|
|
24042
24209
|
|
|
24043
24210
|
})();
|