@ostendis/grapesjs-preset-ostendis-adv 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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,10 +22181,32 @@ 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
|
});
|
|
22190
|
+
Blocks.add("tiktok", {
|
|
22191
|
+
label: opts.t9n.tiktokBlkLabelSite,
|
|
22192
|
+
category: opts.t9n.smSitesCategoryLabel,
|
|
22193
|
+
content: {
|
|
22194
|
+
type: "link",
|
|
22195
|
+
style: {
|
|
22196
|
+
display: "inline-block",
|
|
22197
|
+
margin: "3px",
|
|
22198
|
+
"text-decoration": "none",
|
|
22199
|
+
},
|
|
22200
|
+
attributes: {
|
|
22201
|
+
href: "https://www.tiktok.com/",
|
|
22202
|
+
target: "_blank",
|
|
22203
|
+
},
|
|
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>`,
|
|
22207
|
+
},
|
|
22208
|
+
attributes: { class: "fa-brands fa-tiktok" },
|
|
22209
|
+
});
|
|
22145
22210
|
// Social Media Share blocks
|
|
22146
22211
|
Blocks.add("facebookShare", {
|
|
22147
22212
|
label: opts.t9n.facebookBlkLabelShare,
|
|
@@ -22158,7 +22223,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22158
22223
|
target: "_blank",
|
|
22159
22224
|
"data-ost-simple-hide": "1",
|
|
22160
22225
|
},
|
|
22161
|
-
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>`,
|
|
22162
22230
|
},
|
|
22163
22231
|
attributes: { class: "fa-brands fa-square-facebook" },
|
|
22164
22232
|
});
|
|
@@ -22177,7 +22245,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22177
22245
|
target: "_blank",
|
|
22178
22246
|
"data-ost-simple-hide": "1",
|
|
22179
22247
|
},
|
|
22180
|
-
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>`,
|
|
22181
22252
|
},
|
|
22182
22253
|
attributes: { class: "fa-brands fa-linkedin" },
|
|
22183
22254
|
});
|
|
@@ -22196,7 +22267,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22196
22267
|
target: "_blank",
|
|
22197
22268
|
"data-ost-simple-hide": "1",
|
|
22198
22269
|
},
|
|
22199
|
-
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>`,
|
|
22200
22274
|
},
|
|
22201
22275
|
attributes: { class: "fa-brands fa-square-xing" },
|
|
22202
22276
|
});
|
|
@@ -22215,7 +22289,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22215
22289
|
target: "_blank",
|
|
22216
22290
|
"data-ost-simple-hide": "1",
|
|
22217
22291
|
},
|
|
22218
|
-
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>`,
|
|
22219
22296
|
},
|
|
22220
22297
|
attributes: { class: "fa-brands fa-square-x-twitter" },
|
|
22221
22298
|
});
|
|
@@ -22234,7 +22311,10 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22234
22311
|
href: "https://wa.me/?text=$$$ViewLink$$$",
|
|
22235
22312
|
target: "_blank",
|
|
22236
22313
|
},
|
|
22237
|
-
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>`,
|
|
22238
22318
|
},
|
|
22239
22319
|
attributes: { class: "fa-brands fa-square-whatsapp" },
|
|
22240
22320
|
});
|
|
@@ -22254,7 +22334,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22254
22334
|
target: "_blank",
|
|
22255
22335
|
"data-ost-simple-hide": "1",
|
|
22256
22336
|
},
|
|
22257
|
-
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>`,
|
|
22258
22340
|
},
|
|
22259
22341
|
attributes: { class: "fa-solid fa-square-envelope" },
|
|
22260
22342
|
});
|
|
@@ -22272,7 +22354,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22272
22354
|
href: "sms:?body=Sieh%20dir%20dieses%20Inserat%20an%20$$$ViewLink$$$",
|
|
22273
22355
|
"data-ost-simple-hide": "1",
|
|
22274
22356
|
},
|
|
22275
|
-
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>`,
|
|
22276
22360
|
},
|
|
22277
22361
|
attributes: { class: "fa-solid fa-comment-sms" },
|
|
22278
22362
|
});
|
|
@@ -22290,7 +22374,9 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22290
22374
|
href: "javascript:if(window.print)window.print()",
|
|
22291
22375
|
"data-ost-simple-hide": "1",
|
|
22292
22376
|
},
|
|
22293
|
-
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>`,
|
|
22294
22380
|
},
|
|
22295
22381
|
attributes: { class: "fa-solid fa-print" },
|
|
22296
22382
|
});
|
|
@@ -22322,67 +22408,186 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
22322
22408
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22323
22409
|
});
|
|
22324
22410
|
};
|
|
22325
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
22326
|
-
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);
|
|
22327
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
22328
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
22329
|
-
function step(op) {
|
|
22330
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
22331
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22332
|
-
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;
|
|
22333
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22334
|
-
switch (op[0]) {
|
|
22335
|
-
case 0: case 1: t = op; break;
|
|
22336
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22337
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
22338
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
22339
|
-
default:
|
|
22340
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
22341
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
22342
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
22343
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
22344
|
-
if (t[2]) _.ops.pop();
|
|
22345
|
-
_.trys.pop(); continue;
|
|
22346
|
-
}
|
|
22347
|
-
op = body.call(thisArg, _);
|
|
22348
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
22349
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
22350
|
-
}
|
|
22351
|
-
};
|
|
22352
22411
|
|
|
22353
22412
|
|
|
22354
22413
|
|
|
22355
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
(
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
stop: function () { },
|
|
22364
|
-
});
|
|
22365
|
-
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceTablet, {
|
|
22366
|
-
run: function (ed) { return ed.setDevice("Tablet"); },
|
|
22367
|
-
stop: function () { },
|
|
22368
|
-
});
|
|
22369
|
-
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceMobile, {
|
|
22370
|
-
run: function (ed) { return ed.setDevice("Mobile portrait"); },
|
|
22371
|
-
stop: function () { },
|
|
22372
|
-
});
|
|
22373
|
-
Commands.add("ost-blocks-visibility", {
|
|
22374
|
-
run: function (editor) {
|
|
22375
|
-
var cList = editor.Canvas.getBody().classList;
|
|
22376
|
-
cList.add("show-ost-blocks");
|
|
22377
|
-
},
|
|
22378
|
-
stop: function (editor) {
|
|
22379
|
-
var cList = editor.Canvas.getBody().classList;
|
|
22380
|
-
cList.remove("show-ost-blocks");
|
|
22381
|
-
},
|
|
22382
|
-
});
|
|
22383
|
-
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
|
+
},
|
|
22384
22422
|
});
|
|
22385
|
-
|
|
22423
|
+
Commands.add(_consts__WEBPACK_IMPORTED_MODULE_0__.cmdDeviceTablet, {
|
|
22424
|
+
run: (ed) => ed.setDevice("Tablet"),
|
|
22425
|
+
stop: () => {
|
|
22426
|
+
},
|
|
22427
|
+
});
|
|
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
|
+
}));
|
|
22386
22591
|
|
|
22387
22592
|
|
|
22388
22593
|
/***/ }),
|
|
@@ -22400,22 +22605,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22400
22605
|
/* harmony export */ });
|
|
22401
22606
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
22402
22607
|
|
|
22403
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22404
|
-
|
|
22608
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
22609
|
+
const { DomComponents } = editor;
|
|
22405
22610
|
// Add ostendis block trait to video components
|
|
22406
22611
|
var dType = DomComponents.getType("video");
|
|
22407
22612
|
var dModel = dType === null || dType === void 0 ? void 0 : dType.model;
|
|
22408
22613
|
var dView = dType === null || dType === void 0 ? void 0 : dType.view;
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22614
|
+
const yt = "yt";
|
|
22615
|
+
const vi = "vi";
|
|
22616
|
+
const ytnc = "ytnc";
|
|
22412
22617
|
DomComponents.addType("video", {
|
|
22413
22618
|
model: dModel.extend({
|
|
22414
|
-
updateTraits
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22619
|
+
updateTraits() {
|
|
22620
|
+
const { em } = this;
|
|
22621
|
+
const prov = this.get("provider");
|
|
22622
|
+
let tagName = "iframe";
|
|
22623
|
+
let traits;
|
|
22419
22624
|
switch (prov) {
|
|
22420
22625
|
case yt:
|
|
22421
22626
|
case ytnc:
|
|
@@ -22437,8 +22642,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22437
22642
|
{ id: "videoURL", name: opts.t9n.traitOstVideoURL },
|
|
22438
22643
|
],
|
|
22439
22644
|
});
|
|
22440
|
-
this.set({ tagName
|
|
22441
|
-
this.set({ traits
|
|
22645
|
+
this.set({ tagName }, { silent: true }); // avoid break in view
|
|
22646
|
+
this.set({ traits });
|
|
22442
22647
|
em.get("ready") && em.trigger("component:toggled");
|
|
22443
22648
|
},
|
|
22444
22649
|
}),
|
|
@@ -22446,7 +22651,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22446
22651
|
});
|
|
22447
22652
|
// Scale the new range
|
|
22448
22653
|
DomComponents.addType("scale", {
|
|
22449
|
-
isComponent:
|
|
22654
|
+
isComponent: (el) => {
|
|
22450
22655
|
return (el.tagName === "DIV" &&
|
|
22451
22656
|
(el.getAttribute("data-scale") === "true" ||
|
|
22452
22657
|
el.classList.contains("scale")));
|
|
@@ -22496,13 +22701,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22496
22701
|
(0,_consts__WEBPACK_IMPORTED_MODULE_0__.ostTypeHideInSimpleHtmlTrait)(opts),
|
|
22497
22702
|
],
|
|
22498
22703
|
},
|
|
22499
|
-
init
|
|
22704
|
+
init() {
|
|
22500
22705
|
var _a;
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
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"];
|
|
22506
22711
|
if (isNaN(p))
|
|
22507
22712
|
p = 66;
|
|
22508
22713
|
if (!f)
|
|
@@ -22516,10 +22721,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22516
22721
|
this.on("change:bgcolor", this.updateScale);
|
|
22517
22722
|
this.on("change:fcolor", this.updateScale);
|
|
22518
22723
|
},
|
|
22519
|
-
updateScale
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22724
|
+
updateScale() {
|
|
22725
|
+
let p = parseInt(this.get("percent"));
|
|
22726
|
+
const f = this.get("fcolor") || "#3b5998";
|
|
22727
|
+
const b = this.get("bgcolor") || "#CCCCCC";
|
|
22523
22728
|
if (isNaN(p))
|
|
22524
22729
|
p = 0;
|
|
22525
22730
|
p = Math.max(0, Math.min(100, p));
|
|
@@ -22528,17 +22733,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22528
22733
|
"data-percent": p,
|
|
22529
22734
|
"data-fcolor": f,
|
|
22530
22735
|
"data-bgcolor": b,
|
|
22531
|
-
"aria-label":
|
|
22736
|
+
"aria-label": `${p} %`,
|
|
22532
22737
|
});
|
|
22533
22738
|
this.addStyle({
|
|
22534
|
-
background:
|
|
22739
|
+
background: `linear-gradient(to right, ${f} ${p}%, ${b} ${p}%)`,
|
|
22535
22740
|
});
|
|
22536
22741
|
},
|
|
22537
22742
|
},
|
|
22538
22743
|
});
|
|
22539
22744
|
// INPUT
|
|
22540
22745
|
DomComponents.addType("range", {
|
|
22541
|
-
isComponent:
|
|
22746
|
+
isComponent: (el) => el.tagName == "INPUT",
|
|
22542
22747
|
model: {
|
|
22543
22748
|
defaults: {
|
|
22544
22749
|
tagName: "input",
|
|
@@ -22550,14 +22755,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22550
22755
|
},
|
|
22551
22756
|
extendFnView: ["updateAttributes"],
|
|
22552
22757
|
view: {
|
|
22553
|
-
updateAttributes
|
|
22758
|
+
updateAttributes() {
|
|
22554
22759
|
this.el.setAttribute("autocomplete", "on");
|
|
22555
22760
|
},
|
|
22556
22761
|
},
|
|
22557
22762
|
});
|
|
22558
22763
|
// Unsorted list item component
|
|
22559
22764
|
DomComponents.addType("ulistitem", {
|
|
22560
|
-
isComponent:
|
|
22765
|
+
isComponent: (el) => {
|
|
22561
22766
|
if (el.tagName === "LI" && el.classList.contains("ulistitem")) {
|
|
22562
22767
|
return { type: "ulistitem" };
|
|
22563
22768
|
}
|
|
@@ -22575,7 +22780,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22575
22780
|
});
|
|
22576
22781
|
// Unsorted list component with fontawesome
|
|
22577
22782
|
DomComponents.addType("ulist", {
|
|
22578
|
-
isComponent:
|
|
22783
|
+
isComponent: (el) => {
|
|
22579
22784
|
if (el.tagName === "UL" && el.classList.contains("ulist")) {
|
|
22580
22785
|
return { type: "ulist" };
|
|
22581
22786
|
}
|
|
@@ -22600,8 +22805,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22600
22805
|
});
|
|
22601
22806
|
// Header component
|
|
22602
22807
|
DomComponents.addType("header", {
|
|
22603
|
-
isComponent:
|
|
22604
|
-
|
|
22808
|
+
isComponent: (el) => {
|
|
22809
|
+
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
22605
22810
|
if (el.tagName && headings.includes(el.tagName.toLowerCase())) {
|
|
22606
22811
|
return { type: "header" };
|
|
22607
22812
|
}
|
|
@@ -22621,7 +22826,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22621
22826
|
});
|
|
22622
22827
|
// Icon component
|
|
22623
22828
|
DomComponents.addType("icon", {
|
|
22624
|
-
isComponent:
|
|
22829
|
+
isComponent: (el) => {
|
|
22625
22830
|
var classNames = [
|
|
22626
22831
|
"fa",
|
|
22627
22832
|
"fas",
|
|
@@ -22632,7 +22837,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22632
22837
|
"fa-brands",
|
|
22633
22838
|
];
|
|
22634
22839
|
if (el.tagName === "I" &&
|
|
22635
|
-
classNames.some(
|
|
22840
|
+
classNames.some((className) => el.classList.contains(className))) {
|
|
22636
22841
|
return { type: "icon" };
|
|
22637
22842
|
}
|
|
22638
22843
|
},
|
|
@@ -22733,6 +22938,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22733
22938
|
"use strict";
|
|
22734
22939
|
__webpack_require__.r(__webpack_exports__);
|
|
22735
22940
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
22941
|
+
/* harmony export */ BULLET_PATTERNS: () => (/* binding */ BULLET_PATTERNS),
|
|
22736
22942
|
/* harmony export */ cmdDeviceDesktop: () => (/* binding */ cmdDeviceDesktop),
|
|
22737
22943
|
/* harmony export */ cmdDeviceMobile: () => (/* binding */ cmdDeviceMobile),
|
|
22738
22944
|
/* harmony export */ cmdDeviceTablet: () => (/* binding */ cmdDeviceTablet),
|
|
@@ -22748,17 +22954,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22748
22954
|
/* harmony export */ });
|
|
22749
22955
|
/* harmony import */ var _ostTranslations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ostTranslations */ "./src/ostTranslations.ts");
|
|
22750
22956
|
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22957
|
+
const cmdDeviceDesktop = "set-device-desktop";
|
|
22958
|
+
const cmdDeviceTablet = "set-device-tablet";
|
|
22959
|
+
const cmdDeviceMobile = "set-device-mobile";
|
|
22960
|
+
const nameTrait = {
|
|
22755
22961
|
name: "name",
|
|
22756
22962
|
};
|
|
22757
|
-
|
|
22963
|
+
const valueTrait = {
|
|
22758
22964
|
name: "value",
|
|
22759
22965
|
label: _ostTranslations__WEBPACK_IMPORTED_MODULE_0__.ostTrans.traitBlkValue,
|
|
22760
22966
|
};
|
|
22761
|
-
|
|
22967
|
+
const uListItemContent = [
|
|
22762
22968
|
{
|
|
22763
22969
|
tagName: "span",
|
|
22764
22970
|
attributes: { class: "fa-li" },
|
|
@@ -22783,13 +22989,73 @@ var uListItemContent = [
|
|
|
22783
22989
|
style: { margin: "0", padding: "0", "text-align": "left" },
|
|
22784
22990
|
},
|
|
22785
22991
|
];
|
|
22786
|
-
|
|
22992
|
+
const ulListItem = {
|
|
22787
22993
|
type: "ulistitem",
|
|
22788
22994
|
tagName: "li",
|
|
22789
22995
|
attributes: { class: "ulistitem" },
|
|
22790
22996
|
style: { "text-align": "left" },
|
|
22791
22997
|
components: uListItemContent,
|
|
22792
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
|
+
];
|
|
22793
23059
|
// Define ostendis type trait for text and default components
|
|
22794
23060
|
function ostTypeTextTrait(opts) {
|
|
22795
23061
|
return {
|
|
@@ -22930,51 +23196,39 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22930
23196
|
/* harmony export */ });
|
|
22931
23197
|
/* harmony import */ var juice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! juice */ "./node_modules/juice/client.js");
|
|
22932
23198
|
/* harmony import */ var juice__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(juice__WEBPACK_IMPORTED_MODULE_0__);
|
|
22933
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
22934
|
-
__assign = Object.assign || function(t) {
|
|
22935
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22936
|
-
s = arguments[i];
|
|
22937
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22938
|
-
t[p] = s[p];
|
|
22939
|
-
}
|
|
22940
|
-
return t;
|
|
22941
|
-
};
|
|
22942
|
-
return __assign.apply(this, arguments);
|
|
22943
|
-
};
|
|
22944
23199
|
|
|
22945
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
22946
|
-
|
|
22947
|
-
|
|
23200
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23201
|
+
const cmdm = editor.Commands;
|
|
23202
|
+
const pfx = editor.getConfig().stylePrefix;
|
|
22948
23203
|
cmdm.add(opts.cmdInlineHtml, {
|
|
22949
|
-
run
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
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));
|
|
22953
23207
|
},
|
|
22954
23208
|
});
|
|
22955
23209
|
cmdm.add(opts.cmdOpenExport, {
|
|
22956
23210
|
containerEl: null,
|
|
22957
23211
|
codeEditorHtml: null,
|
|
22958
|
-
createCodeViewer
|
|
23212
|
+
createCodeViewer() {
|
|
22959
23213
|
return editor.CodeManager.createViewer({
|
|
22960
23214
|
codeName: "htmlmixed",
|
|
22961
23215
|
theme: opts.codeViewerTheme,
|
|
22962
23216
|
});
|
|
22963
23217
|
},
|
|
22964
|
-
createCodeEditor
|
|
22965
|
-
|
|
22966
|
-
|
|
23218
|
+
createCodeEditor() {
|
|
23219
|
+
const el = document.createElement("div");
|
|
23220
|
+
const codeEditor = this.createCodeViewer();
|
|
22967
23221
|
el.style.flex = "1 0 auto";
|
|
22968
23222
|
el.style.boxSizing = "border-box";
|
|
22969
|
-
el.className =
|
|
23223
|
+
el.className = `${pfx}export-code`;
|
|
22970
23224
|
el.appendChild(codeEditor.getElement());
|
|
22971
|
-
return { codeEditor
|
|
23225
|
+
return { codeEditor, el };
|
|
22972
23226
|
},
|
|
22973
|
-
getCodeContainer
|
|
22974
|
-
|
|
23227
|
+
getCodeContainer() {
|
|
23228
|
+
let containerEl = this.containerEl;
|
|
22975
23229
|
if (!containerEl) {
|
|
22976
23230
|
containerEl = document.createElement("div");
|
|
22977
|
-
containerEl.className =
|
|
23231
|
+
containerEl.className = `${pfx}export-container`;
|
|
22978
23232
|
containerEl.style.display = "flex";
|
|
22979
23233
|
containerEl.style.gap = "5px";
|
|
22980
23234
|
containerEl.style.flexDirection = "column";
|
|
@@ -22983,17 +23237,17 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
22983
23237
|
}
|
|
22984
23238
|
return containerEl;
|
|
22985
23239
|
},
|
|
22986
|
-
run
|
|
22987
|
-
|
|
22988
|
-
|
|
23240
|
+
run(editor) {
|
|
23241
|
+
let { codeEditorHtml } = this;
|
|
23242
|
+
const container = this.getCodeContainer();
|
|
22989
23243
|
// Init code viewer if not yet instantiated
|
|
22990
23244
|
if (!codeEditorHtml) {
|
|
22991
|
-
|
|
23245
|
+
const codeViewer = this.createCodeEditor();
|
|
22992
23246
|
codeEditorHtml = codeViewer.codeEditor;
|
|
22993
23247
|
this.codeEditorHtml = codeEditorHtml;
|
|
22994
23248
|
if (opts.t9n.modalLabelExport) {
|
|
22995
|
-
|
|
22996
|
-
labelEl.className =
|
|
23249
|
+
let labelEl = document.createElement("div");
|
|
23250
|
+
labelEl.className = `${pfx}export-label`;
|
|
22997
23251
|
labelEl.innerHTML = opts.t9n.modalLabelExport;
|
|
22998
23252
|
container.appendChild(labelEl);
|
|
22999
23253
|
}
|
|
@@ -23004,7 +23258,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
23004
23258
|
content: container,
|
|
23005
23259
|
});
|
|
23006
23260
|
if (codeEditorHtml) {
|
|
23007
|
-
|
|
23261
|
+
const tmpl = `${editor.getHtml()}<style>${editor.getCss()}</style>`;
|
|
23008
23262
|
codeEditorHtml.setContent(opts.inlineCss ? juice__WEBPACK_IMPORTED_MODULE_0___default()(tmpl, opts.juiceOpts) : tmpl);
|
|
23009
23263
|
codeEditorHtml.editor.refresh();
|
|
23010
23264
|
}
|
|
@@ -23026,33 +23280,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23026
23280
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23027
23281
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
23028
23282
|
/* harmony export */ });
|
|
23029
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23030
|
-
|
|
23031
|
-
|
|
23283
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23284
|
+
const cmdm = editor.Commands;
|
|
23285
|
+
const pfx = editor.getConfig().stylePrefix;
|
|
23032
23286
|
cmdm.add(opts.cmdOpenImport, {
|
|
23033
23287
|
containerEl: null,
|
|
23034
23288
|
codeEditorHtml: null,
|
|
23035
|
-
createCodeViewer
|
|
23289
|
+
createCodeViewer() {
|
|
23036
23290
|
return editor.CodeManager.createViewer({
|
|
23037
23291
|
codeName: "htmlmixed",
|
|
23038
23292
|
theme: opts.codeViewerTheme,
|
|
23039
23293
|
readOnly: false,
|
|
23040
23294
|
});
|
|
23041
23295
|
},
|
|
23042
|
-
createCodeEditor
|
|
23043
|
-
|
|
23044
|
-
|
|
23296
|
+
createCodeEditor() {
|
|
23297
|
+
const el = document.createElement("div");
|
|
23298
|
+
const codeEditor = this.createCodeViewer();
|
|
23045
23299
|
el.style.flex = "1 0 auto";
|
|
23046
23300
|
el.style.boxSizing = "border-box";
|
|
23047
|
-
el.className =
|
|
23301
|
+
el.className = `${pfx}import-code`;
|
|
23048
23302
|
el.appendChild(codeEditor.getElement());
|
|
23049
|
-
return { codeEditor
|
|
23303
|
+
return { codeEditor, el };
|
|
23050
23304
|
},
|
|
23051
|
-
getCodeContainer
|
|
23052
|
-
|
|
23305
|
+
getCodeContainer() {
|
|
23306
|
+
let containerEl = this.containerEl;
|
|
23053
23307
|
if (!containerEl) {
|
|
23054
23308
|
containerEl = document.createElement("div");
|
|
23055
|
-
containerEl.className =
|
|
23309
|
+
containerEl.className = `${pfx}import-container`;
|
|
23056
23310
|
containerEl.style.display = "flex";
|
|
23057
23311
|
containerEl.style.gap = "5px";
|
|
23058
23312
|
containerEl.style.flexDirection = "column";
|
|
@@ -23061,34 +23315,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23061
23315
|
}
|
|
23062
23316
|
return containerEl;
|
|
23063
23317
|
},
|
|
23064
|
-
run
|
|
23065
|
-
|
|
23066
|
-
|
|
23318
|
+
run(editor) {
|
|
23319
|
+
const container = this.getCodeContainer();
|
|
23320
|
+
let { codeEditorHtml } = this;
|
|
23067
23321
|
// Init code viewer if not yet instantiated
|
|
23068
23322
|
if (!codeEditorHtml) {
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
codeEditorHtml =
|
|
23323
|
+
const codeViewer = this.createCodeEditor();
|
|
23324
|
+
const btnImp = document.createElement("button");
|
|
23325
|
+
codeEditorHtml = codeViewer.codeEditor;
|
|
23072
23326
|
this.codeEditorHtml = codeEditorHtml;
|
|
23073
23327
|
if (opts.t9n.modalLabelImport) {
|
|
23074
|
-
|
|
23075
|
-
labelEl.className =
|
|
23328
|
+
let labelEl = document.createElement("div");
|
|
23329
|
+
labelEl.className = `${pfx}import-label`;
|
|
23076
23330
|
labelEl.innerHTML = opts.t9n.modalLabelImport;
|
|
23077
23331
|
container.appendChild(labelEl);
|
|
23078
23332
|
}
|
|
23079
23333
|
// Init import button
|
|
23080
23334
|
btnImp.innerHTML = opts.t9n.modalBtnImport;
|
|
23081
23335
|
btnImp.type = "button";
|
|
23082
|
-
btnImp.className =
|
|
23336
|
+
btnImp.className = `${pfx}btn-prim ${pfx}btn-import`;
|
|
23083
23337
|
btnImp.style.alignSelf = "flex-start";
|
|
23084
|
-
btnImp.onclick =
|
|
23085
|
-
|
|
23338
|
+
btnImp.onclick = () => {
|
|
23339
|
+
const code = codeViewer.codeEditor.editor.getValue();
|
|
23086
23340
|
editor.Components.clear();
|
|
23087
23341
|
editor.Css.clear();
|
|
23088
23342
|
editor.setComponents(code);
|
|
23089
23343
|
editor.Modal.close();
|
|
23090
23344
|
};
|
|
23091
|
-
container.appendChild(
|
|
23345
|
+
container.appendChild(codeViewer.el);
|
|
23092
23346
|
container.appendChild(btnImp);
|
|
23093
23347
|
}
|
|
23094
23348
|
editor.Modal.open({
|
|
@@ -23117,7 +23371,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23117
23371
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23118
23372
|
/* harmony export */ ostTrans: () => (/* binding */ ostTrans)
|
|
23119
23373
|
/* harmony export */ });
|
|
23120
|
-
|
|
23374
|
+
const ostTrans = {
|
|
23121
23375
|
cmdBtnDesktopLabel: "Desktop",
|
|
23122
23376
|
cmdBtnTabletLabel: "Tablet",
|
|
23123
23377
|
cmdBtnMobileLabel: "Mobile",
|
|
@@ -23170,6 +23424,7 @@ var ostTrans = {
|
|
|
23170
23424
|
linkedinBlkLabelSite: "LinkedIn link",
|
|
23171
23425
|
xingBlkLabelSite: "Xing link",
|
|
23172
23426
|
twitterBlkLabelSite: "Twitter link",
|
|
23427
|
+
tiktokBlkLabelSite: "TikTok link",
|
|
23173
23428
|
facebookBlkLabelShare: "Facebook share",
|
|
23174
23429
|
linkedinBlkLabelShare: "LinkedIn share",
|
|
23175
23430
|
xingBlkLabelShare: "Xing share",
|
|
@@ -23242,6 +23497,11 @@ var ostTrans = {
|
|
|
23242
23497
|
labelScalePercent: "Percent",
|
|
23243
23498
|
labelScaleBarColor: "Color 1",
|
|
23244
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",
|
|
23245
23505
|
ostToolbarClone: "Clone list element",
|
|
23246
23506
|
ostToolbarDelete: "Delete list element",
|
|
23247
23507
|
ostToolbarUp: "Move list element up",
|
|
@@ -23265,15 +23525,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23265
23525
|
/* harmony export */ });
|
|
23266
23526
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
23267
23527
|
|
|
23268
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23269
|
-
|
|
23270
|
-
|
|
23271
|
-
|
|
23272
|
-
|
|
23273
|
-
|
|
23274
|
-
|
|
23275
|
-
|
|
23276
|
-
|
|
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"';
|
|
23277
23537
|
// Turn off default devices select and create new one
|
|
23278
23538
|
editor.getConfig().showDevices = false;
|
|
23279
23539
|
Panels.getPanels().reset([
|
|
@@ -23344,7 +23604,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23344
23604
|
"data-tooltip": opts.t9n.cmdBtnExportLabel,
|
|
23345
23605
|
"data-tooltip-pos": "bottom",
|
|
23346
23606
|
},
|
|
23347
|
-
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>`,
|
|
23348
23610
|
},
|
|
23349
23611
|
{
|
|
23350
23612
|
id: cmdOpenImport,
|
|
@@ -23353,7 +23615,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23353
23615
|
"data-tooltip": opts.t9n.cmdBtnImportLabel,
|
|
23354
23616
|
"data-tooltip-pos": "bottom",
|
|
23355
23617
|
},
|
|
23356
|
-
label:
|
|
23618
|
+
label: `<svg ${iconStyle} viewBox="0 0 24 24">
|
|
23619
|
+
<path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
|
|
23620
|
+
</svg>`,
|
|
23357
23621
|
},
|
|
23358
23622
|
{
|
|
23359
23623
|
id: "undo",
|
|
@@ -23387,7 +23651,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23387
23651
|
"data-tooltip": opts.t9n.openStyleManager,
|
|
23388
23652
|
"data-tooltip-pos": "bottom",
|
|
23389
23653
|
},
|
|
23390
|
-
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>`,
|
|
23391
23657
|
},
|
|
23392
23658
|
{
|
|
23393
23659
|
id: openTraits,
|
|
@@ -23397,7 +23663,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23397
23663
|
"data-tooltip": opts.t9n.openTraits,
|
|
23398
23664
|
"data-tooltip-pos": "bottom",
|
|
23399
23665
|
},
|
|
23400
|
-
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>`,
|
|
23401
23669
|
},
|
|
23402
23670
|
{
|
|
23403
23671
|
id: openLayers,
|
|
@@ -23407,7 +23675,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23407
23675
|
"data-tooltip": opts.t9n.openLayers,
|
|
23408
23676
|
"data-tooltip-pos": "bottom",
|
|
23409
23677
|
},
|
|
23410
|
-
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>`,
|
|
23411
23681
|
},
|
|
23412
23682
|
{
|
|
23413
23683
|
id: openBlocks,
|
|
@@ -23417,28 +23687,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23417
23687
|
"data-tooltip": opts.t9n.openBlocks,
|
|
23418
23688
|
"data-tooltip-pos": "bottom",
|
|
23419
23689
|
},
|
|
23420
|
-
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>`,
|
|
23421
23693
|
},
|
|
23422
23694
|
],
|
|
23423
23695
|
},
|
|
23424
23696
|
]);
|
|
23425
|
-
editor.onReady(
|
|
23697
|
+
editor.onReady(() => {
|
|
23426
23698
|
if (opts.showOutlineOnLoad) {
|
|
23427
|
-
|
|
23699
|
+
const btn = Panels.getButton("options", activateOutline);
|
|
23428
23700
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23429
23701
|
}
|
|
23430
23702
|
if (opts.showBlocksOnLoad) {
|
|
23431
|
-
|
|
23703
|
+
const btn = Panels.getButton("views", openBlocks);
|
|
23432
23704
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23433
23705
|
}
|
|
23434
23706
|
if (opts.showTraitsOnLoad) {
|
|
23435
|
-
|
|
23707
|
+
const btn = Panels.getButton("views", openTraits);
|
|
23436
23708
|
btn === null || btn === void 0 ? void 0 : btn.set("active", true);
|
|
23437
23709
|
}
|
|
23438
23710
|
//Beautify tooltips
|
|
23439
|
-
document.querySelectorAll("*[data-tooltip-pos]").forEach(
|
|
23711
|
+
document.querySelectorAll("*[data-tooltip-pos]").forEach((el) => {
|
|
23440
23712
|
var _a;
|
|
23441
|
-
|
|
23713
|
+
const title = (_a = el.getAttribute("title")) === null || _a === void 0 ? void 0 : _a.trim();
|
|
23442
23714
|
if (title) {
|
|
23443
23715
|
el.setAttribute("data-tooltip", title);
|
|
23444
23716
|
el.removeAttribute("title");
|
|
@@ -23470,45 +23742,14 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23470
23742
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23471
23743
|
});
|
|
23472
23744
|
};
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
23480
|
-
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;
|
|
23481
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23482
|
-
switch (op[0]) {
|
|
23483
|
-
case 0: case 1: t = op; break;
|
|
23484
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23485
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23486
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
23487
|
-
default:
|
|
23488
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
23489
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
23490
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
23491
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
23492
|
-
if (t[2]) _.ops.pop();
|
|
23493
|
-
_.trys.pop(); continue;
|
|
23494
|
-
}
|
|
23495
|
-
op = body.call(thisArg, _);
|
|
23496
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
23497
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
23498
|
-
}
|
|
23499
|
-
};
|
|
23500
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (editor, opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23501
|
-
var RichTextEditor;
|
|
23502
|
-
return __generator(this, function (_a) {
|
|
23503
|
-
RichTextEditor = editor.RichTextEditor;
|
|
23504
|
-
RichTextEditor.add("removeFormat", {
|
|
23505
|
-
icon: '<i class="fa-solid fa-text-slash"></i>',
|
|
23506
|
-
attributes: { title: opts.t9n.cmdRteRemoveFormat },
|
|
23507
|
-
result: function (rte) { return rte.exec("removeFormat"); },
|
|
23508
|
-
});
|
|
23509
|
-
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"),
|
|
23510
23751
|
});
|
|
23511
|
-
})
|
|
23752
|
+
}));
|
|
23512
23753
|
|
|
23513
23754
|
|
|
23514
23755
|
/***/ }),
|
|
@@ -23524,47 +23765,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23524
23765
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23525
23766
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
23526
23767
|
/* harmony export */ });
|
|
23527
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
23528
|
-
|
|
23768
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((editor, opts) => {
|
|
23769
|
+
const { TraitManager } = editor;
|
|
23529
23770
|
// Ostendis-Blocks trait
|
|
23530
23771
|
TraitManager.addType("ost-blocks-select", {
|
|
23531
|
-
createInput
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
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
|
|
23536
23776
|
? traitOpts
|
|
23537
23777
|
: [{ id: "", name: "None", disabled: "disabled" }];
|
|
23538
|
-
|
|
23539
|
-
el.innerHTML =
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
.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>`;
|
|
23544
23788
|
return el;
|
|
23545
23789
|
},
|
|
23546
|
-
onEvent
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
var element = elInput.querySelector("#" + [traitName]);
|
|
23551
|
-
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;
|
|
23552
23794
|
if (dataOstType == "") {
|
|
23553
23795
|
component.removeAttributes(traitName);
|
|
23554
23796
|
}
|
|
23555
23797
|
else {
|
|
23556
|
-
component.addAttributes(
|
|
23798
|
+
component.addAttributes({ [traitName]: dataOstType });
|
|
23557
23799
|
}
|
|
23558
23800
|
updateTrait(element);
|
|
23559
23801
|
},
|
|
23560
|
-
onUpdate
|
|
23561
|
-
|
|
23562
|
-
var traitName = trait.get("name") || "ost-block-select-default";
|
|
23802
|
+
onUpdate({ elInput, component, trait }) {
|
|
23803
|
+
const traitName = trait.get("name") || "ost-block-select-default";
|
|
23563
23804
|
if (elInput !== null) {
|
|
23564
|
-
|
|
23805
|
+
let element = elInput.querySelector("#" + [traitName]);
|
|
23565
23806
|
updateTrait(element);
|
|
23566
23807
|
// Set select
|
|
23567
|
-
|
|
23808
|
+
const dataOstType = component.getAttributes()[traitName] || "";
|
|
23568
23809
|
element = elInput.querySelector("#" + [traitName]);
|
|
23569
23810
|
element.value = dataOstType;
|
|
23570
23811
|
}
|
|
@@ -23578,15 +23819,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23578
23819
|
events: {
|
|
23579
23820
|
keyup: "onChange",
|
|
23580
23821
|
},
|
|
23581
|
-
onValueChange
|
|
23822
|
+
onValueChange() {
|
|
23582
23823
|
var _a;
|
|
23583
|
-
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
for (
|
|
23588
|
-
|
|
23589
|
-
|
|
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("::");
|
|
23590
23831
|
optComps.push({
|
|
23591
23832
|
type: "range",
|
|
23592
23833
|
components: option[1] || option[0],
|
|
@@ -23600,15 +23841,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23600
23841
|
function updateTrait(element) {
|
|
23601
23842
|
var _a;
|
|
23602
23843
|
// Set Array to 0
|
|
23603
|
-
opts.usedOstBlocks.forEach(
|
|
23844
|
+
opts.usedOstBlocks.forEach((el) => {
|
|
23604
23845
|
el.count = 0;
|
|
23605
23846
|
});
|
|
23606
23847
|
var wrapper = editor.DomComponents.getWrapper();
|
|
23607
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();
|
|
23608
23849
|
// List all data-ost-type
|
|
23609
|
-
elements === null || elements === void 0 ? void 0 : elements.forEach(
|
|
23850
|
+
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
|
23610
23851
|
var type = element.getAttribute("data-ost-type") || "";
|
|
23611
|
-
|
|
23852
|
+
let index = opts.usedOstBlocks.findIndex((item) => item.name === type);
|
|
23612
23853
|
if (index === -1) {
|
|
23613
23854
|
opts.usedOstBlocks.push({ name: type, count: 1 });
|
|
23614
23855
|
}
|
|
@@ -23619,7 +23860,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23619
23860
|
// Display update select input
|
|
23620
23861
|
Array.from(element.options).forEach(function (optionElement, optionIndex) {
|
|
23621
23862
|
if (optionElement.value != "") {
|
|
23622
|
-
|
|
23863
|
+
const usedOstBlockIndex = opts.usedOstBlocks.findIndex((e) => e.name === optionElement.value);
|
|
23623
23864
|
// Reset
|
|
23624
23865
|
var optionEl = element.options[optionIndex];
|
|
23625
23866
|
optionEl.text = optionEl.text.replace(/^\(.*\)\s*/g, "");
|
|
@@ -23736,17 +23977,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23736
23977
|
/* harmony import */ var _rte__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rte */ "./src/rte.ts");
|
|
23737
23978
|
/* harmony import */ var _ostTranslations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ostTranslations */ "./src/ostTranslations.ts");
|
|
23738
23979
|
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./consts */ "./src/consts.ts");
|
|
23739
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
23740
|
-
__assign = Object.assign || function(t) {
|
|
23741
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23742
|
-
s = arguments[i];
|
|
23743
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
23744
|
-
t[p] = s[p];
|
|
23745
|
-
}
|
|
23746
|
-
return t;
|
|
23747
|
-
};
|
|
23748
|
-
return __assign.apply(this, arguments);
|
|
23749
|
-
};
|
|
23750
23980
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23751
23981
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23752
23982
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23756,42 +23986,6 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
23756
23986
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23757
23987
|
});
|
|
23758
23988
|
};
|
|
23759
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
23760
|
-
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);
|
|
23761
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
23762
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
23763
|
-
function step(op) {
|
|
23764
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23765
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
23766
|
-
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;
|
|
23767
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23768
|
-
switch (op[0]) {
|
|
23769
|
-
case 0: case 1: t = op; break;
|
|
23770
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23771
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23772
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
23773
|
-
default:
|
|
23774
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
23775
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
23776
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
23777
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
23778
|
-
if (t[2]) _.ops.pop();
|
|
23779
|
-
_.trys.pop(); continue;
|
|
23780
|
-
}
|
|
23781
|
-
op = body.call(thisArg, _);
|
|
23782
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
23783
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
23784
|
-
}
|
|
23785
|
-
};
|
|
23786
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
23787
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
23788
|
-
if (ar || !(i in from)) {
|
|
23789
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
23790
|
-
ar[i] = from[i];
|
|
23791
|
-
}
|
|
23792
|
-
}
|
|
23793
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23794
|
-
};
|
|
23795
23989
|
|
|
23796
23990
|
|
|
23797
23991
|
|
|
@@ -23800,225 +23994,275 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
23800
23994
|
|
|
23801
23995
|
|
|
23802
23996
|
|
|
23803
|
-
|
|
23804
|
-
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23809
|
-
|
|
23810
|
-
|
|
23811
|
-
|
|
23812
|
-
|
|
23813
|
-
|
|
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 built-in toolbar with paste button
|
|
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
|
+
selected.set({
|
|
24076
|
+
toolbar: ulToolbar,
|
|
24077
|
+
});
|
|
24078
|
+
// Hide OST toolbar for UL elements
|
|
24079
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24080
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
24081
|
+
}
|
|
24082
|
+
else {
|
|
24083
|
+
// For other elements, show default toolbar without paste button
|
|
24084
|
+
const defaultToolbar = [
|
|
24085
|
+
{
|
|
24086
|
+
attributes: { class: "fa-solid fa-arrow-up" },
|
|
24087
|
+
command: "select-parent",
|
|
24088
|
+
},
|
|
24089
|
+
{
|
|
24090
|
+
attributes: { class: "fa-solid fa-arrows-up-down-left-right" },
|
|
24091
|
+
command: "tlb-move",
|
|
24092
|
+
},
|
|
24093
|
+
{
|
|
24094
|
+
attributes: { class: "fa-regular fa-copy" },
|
|
24095
|
+
command: "tlb-clone"
|
|
24096
|
+
},
|
|
24097
|
+
{
|
|
24098
|
+
attributes: { class: "fa-solid fa-trash" },
|
|
24099
|
+
command: "tlb-delete"
|
|
24100
|
+
},
|
|
24101
|
+
];
|
|
24102
|
+
selected.set({
|
|
24103
|
+
toolbar: defaultToolbar,
|
|
24104
|
+
});
|
|
24105
|
+
// Hide OST toolbar for other elements
|
|
24106
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24107
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
23814
24108
|
}
|
|
23815
|
-
return false;
|
|
23816
24109
|
}
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
|
|
23830
|
-
|
|
23831
|
-
|
|
23832
|
-
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
24110
|
+
});
|
|
24111
|
+
// On deselected components
|
|
24112
|
+
editor.on("component:deselected", () => {
|
|
24113
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24114
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
24115
|
+
});
|
|
24116
|
+
function isChildOfElement(element, tag) {
|
|
24117
|
+
while (element === null || element === void 0 ? void 0 : element.parentNode) {
|
|
24118
|
+
element = element.parentNode;
|
|
24119
|
+
if (element.tagName === tag)
|
|
24120
|
+
return element;
|
|
24121
|
+
}
|
|
24122
|
+
return false;
|
|
24123
|
+
}
|
|
24124
|
+
function showOstToolbar(listItem) {
|
|
24125
|
+
var _a;
|
|
24126
|
+
const elPos = (listItem === null || listItem === void 0 ? void 0 : listItem.index()) || 0;
|
|
24127
|
+
const elLast = (_a = listItem === null || listItem === void 0 ? void 0 : listItem.parent()) === null || _a === void 0 ? void 0 : _a.getLastChild().index();
|
|
24128
|
+
const ostToolbar = document.querySelector(".gjs-ost-toolbar");
|
|
24129
|
+
if (ostToolbar != undefined) {
|
|
24130
|
+
ostToolbar.innerHTML = "";
|
|
24131
|
+
// Add clone button
|
|
24132
|
+
const cBtn = document.createElement("div");
|
|
24133
|
+
cBtn.innerHTML =
|
|
24134
|
+
'<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>';
|
|
24135
|
+
cBtn.classList.add("gjs-ost-toolbar-item", "clone");
|
|
24136
|
+
cBtn.title = options.t9n.ostToolbarClone;
|
|
24137
|
+
cBtn.addEventListener("click", () => {
|
|
24138
|
+
var _a;
|
|
24139
|
+
if (!listItem || !editor)
|
|
24140
|
+
return;
|
|
24141
|
+
const clonedItem = listItem === null || listItem === void 0 ? void 0 : listItem.clone();
|
|
24142
|
+
(_a = listItem === null || listItem === void 0 ? void 0 : listItem.parent()) === null || _a === void 0 ? void 0 : _a.append(clonedItem, { at: elPos + 1 });
|
|
24143
|
+
});
|
|
24144
|
+
ostToolbar.appendChild(cBtn);
|
|
24145
|
+
//Add delete button
|
|
24146
|
+
const dBtn = document.createElement("div");
|
|
24147
|
+
dBtn.innerHTML =
|
|
24148
|
+
'<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>';
|
|
24149
|
+
dBtn.title = options.t9n.ostToolbarDelete;
|
|
24150
|
+
dBtn.classList.add("gjs-ost-toolbar-item", "del");
|
|
24151
|
+
if (elLast != 0) {
|
|
24152
|
+
dBtn.addEventListener("click", () => {
|
|
24153
|
+
listItem === null || listItem === void 0 ? void 0 : listItem.remove();
|
|
24154
|
+
ostToolbar === null || ostToolbar === void 0 ? void 0 : ostToolbar.classList.remove("show");
|
|
23836
24155
|
});
|
|
23837
|
-
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
// Add move up button
|
|
23855
|
-
var upBtn = document.createElement("div");
|
|
23856
|
-
upBtn.innerHTML =
|
|
23857
|
-
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M1.9 20.75 12 3.25l10.1 17.5Z"/></svg>';
|
|
23858
|
-
upBtn.title = options.t9n.ostToolbarUp;
|
|
23859
|
-
upBtn.classList.add("gjs-ost-toolbar-item", "up");
|
|
23860
|
-
if (elPos > 0) {
|
|
23861
|
-
upBtn.addEventListener("click", function () {
|
|
23862
|
-
if (elPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
23863
|
-
var parent_1 = listItem.parent();
|
|
23864
|
-
if (parent_1) {
|
|
23865
|
-
listItem === null || listItem === void 0 ? void 0 : listItem.move(parent_1, { at: elPos - 1 });
|
|
23866
|
-
}
|
|
23867
|
-
editor.selectRemove(listItem);
|
|
23868
|
-
editor.select(listItem);
|
|
24156
|
+
}
|
|
24157
|
+
else {
|
|
24158
|
+
dBtn.classList.add("disable");
|
|
24159
|
+
}
|
|
24160
|
+
ostToolbar.appendChild(dBtn);
|
|
24161
|
+
// Add move up button
|
|
24162
|
+
const upBtn = document.createElement("div");
|
|
24163
|
+
upBtn.innerHTML =
|
|
24164
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M1.9 20.75 12 3.25l10.1 17.5Z"/></svg>';
|
|
24165
|
+
upBtn.title = options.t9n.ostToolbarUp;
|
|
24166
|
+
upBtn.classList.add("gjs-ost-toolbar-item", "up");
|
|
24167
|
+
if (elPos > 0) {
|
|
24168
|
+
upBtn.addEventListener("click", () => {
|
|
24169
|
+
if (elPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
24170
|
+
let parent = listItem.parent();
|
|
24171
|
+
if (parent) {
|
|
24172
|
+
listItem === null || listItem === void 0 ? void 0 : listItem.move(parent, { at: elPos - 1 });
|
|
23869
24173
|
}
|
|
23870
|
-
|
|
23871
|
-
|
|
23872
|
-
else {
|
|
23873
|
-
upBtn.classList.add("disable");
|
|
23874
|
-
}
|
|
23875
|
-
ostToolbar.appendChild(upBtn);
|
|
23876
|
-
// Add move down button
|
|
23877
|
-
var dwnBtn = document.createElement("div");
|
|
23878
|
-
dwnBtn.innerHTML =
|
|
23879
|
-
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M22.4 3.25 12 20.75 1.6 3.25Z"/></svg>';
|
|
23880
|
-
dwnBtn.title = options.t9n.ostToolbarDown;
|
|
23881
|
-
dwnBtn.classList.add("gjs-ost-toolbar-item", "down");
|
|
23882
|
-
if (elPos != elLast) {
|
|
23883
|
-
var toPos = elPos + 2;
|
|
23884
|
-
if (elPos == elLast) {
|
|
23885
|
-
toPos = 0;
|
|
24174
|
+
editor.selectRemove(listItem);
|
|
24175
|
+
editor.select(listItem);
|
|
23886
24176
|
}
|
|
23887
|
-
|
|
23888
|
-
|
|
23889
|
-
|
|
23890
|
-
|
|
23891
|
-
|
|
23892
|
-
|
|
23893
|
-
|
|
23894
|
-
|
|
23895
|
-
|
|
23896
|
-
|
|
23897
|
-
|
|
23898
|
-
|
|
23899
|
-
|
|
24177
|
+
});
|
|
24178
|
+
}
|
|
24179
|
+
else {
|
|
24180
|
+
upBtn.classList.add("disable");
|
|
24181
|
+
}
|
|
24182
|
+
ostToolbar.appendChild(upBtn);
|
|
24183
|
+
// Add move down button
|
|
24184
|
+
const dwnBtn = document.createElement("div");
|
|
24185
|
+
dwnBtn.innerHTML =
|
|
24186
|
+
'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M22.4 3.25 12 20.75 1.6 3.25Z"/></svg>';
|
|
24187
|
+
dwnBtn.title = options.t9n.ostToolbarDown;
|
|
24188
|
+
dwnBtn.classList.add("gjs-ost-toolbar-item", "down");
|
|
24189
|
+
if (elPos != elLast) {
|
|
24190
|
+
let toPos = elPos + 2;
|
|
24191
|
+
if (elPos == elLast) {
|
|
24192
|
+
toPos = 0;
|
|
23900
24193
|
}
|
|
23901
|
-
|
|
23902
|
-
|
|
23903
|
-
|
|
23904
|
-
|
|
23905
|
-
|
|
23906
|
-
var config, options;
|
|
23907
|
-
if (opts === void 0) { opts = {}; }
|
|
23908
|
-
return __generator(this, function (_a) {
|
|
23909
|
-
switch (_a.label) {
|
|
23910
|
-
case 0:
|
|
23911
|
-
config = editor.getConfig();
|
|
23912
|
-
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);
|
|
23913
|
-
// Change some config
|
|
23914
|
-
config.devicePreviewMode = true;
|
|
23915
|
-
(0,_components__WEBPACK_IMPORTED_MODULE_4__["default"])(editor, options);
|
|
23916
|
-
(0,_traits__WEBPACK_IMPORTED_MODULE_3__["default"])(editor, options);
|
|
23917
|
-
return [4 /*yield*/, (0,_commands__WEBPACK_IMPORTED_MODULE_1__["default"])(editor, options)];
|
|
23918
|
-
case 1:
|
|
23919
|
-
_a.sent();
|
|
23920
|
-
(0,_blocks__WEBPACK_IMPORTED_MODULE_0__["default"])(editor, options);
|
|
23921
|
-
(0,_panels__WEBPACK_IMPORTED_MODULE_2__["default"])(editor, options);
|
|
23922
|
-
return [4 /*yield*/, (0,_rte__WEBPACK_IMPORTED_MODULE_5__["default"])(editor, options)];
|
|
23923
|
-
case 2:
|
|
23924
|
-
_a.sent();
|
|
23925
|
-
// On load
|
|
23926
|
-
editor.on("load", function () {
|
|
23927
|
-
// Create ostendis toolbar
|
|
23928
|
-
var tools = document.getElementById("gjs-tools");
|
|
23929
|
-
var ostTools = document.createElement("div");
|
|
23930
|
-
ostTools.classList.add("gjs-ost-toolbar");
|
|
23931
|
-
tools === null || tools === void 0 ? void 0 : tools.append(ostTools);
|
|
23932
|
-
// Change all elements with header tags from type text to header
|
|
23933
|
-
var changeHeaderType = function (component) {
|
|
23934
|
-
var tagName = component.get("tagName");
|
|
23935
|
-
var headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
23936
|
-
if (tagName &&
|
|
23937
|
-
headings.includes(tagName.toLowerCase()) &&
|
|
23938
|
-
component.get("type") === "text") {
|
|
23939
|
-
component.set({ type: "header" });
|
|
23940
|
-
component.setTraits([
|
|
23941
|
-
{ name: "id" },
|
|
23942
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.headerTrait)(options),
|
|
23943
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeTextTrait)(options),
|
|
23944
|
-
(0,_consts__WEBPACK_IMPORTED_MODULE_7__.ostTypeHideInSimpleHtmlTrait)(options),
|
|
23945
|
-
]);
|
|
23946
|
-
}
|
|
23947
|
-
var children = component.components();
|
|
23948
|
-
children.each(function (child) { return changeHeaderType(child); });
|
|
23949
|
-
};
|
|
23950
|
-
var wrapper = editor.getWrapper();
|
|
23951
|
-
var components = wrapper === null || wrapper === void 0 ? void 0 : wrapper.components();
|
|
23952
|
-
components === null || components === void 0 ? void 0 : components.each(function (component) { return changeHeaderType(component); });
|
|
23953
|
-
});
|
|
23954
|
-
// On selected components
|
|
23955
|
-
editor.on("component:selected", function () {
|
|
23956
|
-
var _a, _b;
|
|
23957
|
-
var selected = editor.getSelected();
|
|
23958
|
-
if (selected != undefined) {
|
|
23959
|
-
if (selected.is("ulistitem")) {
|
|
23960
|
-
showOstToolbar(selected);
|
|
23961
|
-
}
|
|
23962
|
-
else if (selected.isChildOf("ulistitem")) {
|
|
23963
|
-
showOstToolbar(selected.closestType("ulistitem"));
|
|
23964
|
-
}
|
|
23965
|
-
else if (((_a = selected.getEl()) === null || _a === void 0 ? void 0 : _a.tagName) === "LI") {
|
|
23966
|
-
// If list element is empty replace with placeholder text (M&E case:)
|
|
23967
|
-
if (selected.components().length === 0 && !selected.get("content")) {
|
|
23968
|
-
var selectedPosition = selected.index();
|
|
23969
|
-
var newComponent = (_b = selected
|
|
23970
|
-
.parent()) === null || _b === void 0 ? void 0 : _b.append("<li>Text</li>", { at: selectedPosition });
|
|
23971
|
-
selected.remove();
|
|
23972
|
-
editor.select(newComponent);
|
|
23973
|
-
selected = editor.getSelected();
|
|
23974
|
-
}
|
|
23975
|
-
showOstToolbar(selected);
|
|
23976
|
-
}
|
|
23977
|
-
else if (isChildOfElement(selected.getEl(), "LI")) {
|
|
23978
|
-
showOstToolbar(selected.closest("li"));
|
|
23979
|
-
}
|
|
24194
|
+
dwnBtn.addEventListener("click", () => {
|
|
24195
|
+
if (toPos && (listItem === null || listItem === void 0 ? void 0 : listItem.parent()) != undefined) {
|
|
24196
|
+
let parent = listItem.parent();
|
|
24197
|
+
if (parent) {
|
|
24198
|
+
listItem.move(parent, { at: toPos });
|
|
23980
24199
|
}
|
|
23981
|
-
|
|
23982
|
-
|
|
23983
|
-
|
|
23984
|
-
|
|
23985
|
-
|
|
23986
|
-
|
|
23987
|
-
|
|
23988
|
-
editor.on("storage:start", function () {
|
|
23989
|
-
// Reset all Components
|
|
23990
|
-
var getAllComponents = function (model, result) {
|
|
23991
|
-
if (result === void 0) { result = []; }
|
|
23992
|
-
result.push(model);
|
|
23993
|
-
model.components().each(function (mod) { return getAllComponents(mod, result); });
|
|
23994
|
-
return result;
|
|
23995
|
-
};
|
|
23996
|
-
var allComponents = getAllComponents(editor.DomComponents.getWrapper());
|
|
23997
|
-
allComponents.forEach(function (compo) {
|
|
23998
|
-
return compo.set({
|
|
23999
|
-
draggable: true,
|
|
24000
|
-
removable: true,
|
|
24001
|
-
copyable: true,
|
|
24002
|
-
toolbar: [
|
|
24003
|
-
{
|
|
24004
|
-
attributes: { class: "fa-solid fa-arrow-up" },
|
|
24005
|
-
command: "select-parent",
|
|
24006
|
-
},
|
|
24007
|
-
{
|
|
24008
|
-
attributes: { class: "fa-solid fa-arrows-up-down-left-right" },
|
|
24009
|
-
command: "tlb-move",
|
|
24010
|
-
},
|
|
24011
|
-
{ attributes: { class: "fa-regular fa-copy" }, command: "tlb-clone" },
|
|
24012
|
-
{ attributes: { class: "fa-solid fa-trash" }, command: "tlb-delete" },
|
|
24013
|
-
],
|
|
24014
|
-
});
|
|
24015
|
-
});
|
|
24016
|
-
});
|
|
24017
|
-
return [2 /*return*/];
|
|
24200
|
+
editor.selectRemove(listItem);
|
|
24201
|
+
editor.select(listItem);
|
|
24202
|
+
}
|
|
24203
|
+
});
|
|
24204
|
+
}
|
|
24205
|
+
else {
|
|
24206
|
+
dwnBtn.classList.add("disable");
|
|
24018
24207
|
}
|
|
24208
|
+
ostToolbar.appendChild(dwnBtn);
|
|
24209
|
+
// Add show
|
|
24210
|
+
ostToolbar.classList.add("show");
|
|
24211
|
+
}
|
|
24212
|
+
}
|
|
24213
|
+
// On storage start
|
|
24214
|
+
editor.on("storage:start", () => {
|
|
24215
|
+
// Reset all Components
|
|
24216
|
+
const getAllComponents = (model, result = []) => {
|
|
24217
|
+
result.push(model);
|
|
24218
|
+
model.components().each((mod) => getAllComponents(mod, result));
|
|
24219
|
+
return result;
|
|
24220
|
+
};
|
|
24221
|
+
const allComponents = getAllComponents(editor.DomComponents.getWrapper());
|
|
24222
|
+
allComponents.forEach((compo) => {
|
|
24223
|
+
var _a;
|
|
24224
|
+
const defaultToolbar = [
|
|
24225
|
+
{
|
|
24226
|
+
attributes: { class: "fa-solid fa-arrow-up" },
|
|
24227
|
+
command: "select-parent",
|
|
24228
|
+
},
|
|
24229
|
+
{
|
|
24230
|
+
attributes: { class: "fa-solid fa-arrows-up-down-left-right" },
|
|
24231
|
+
command: "tlb-move",
|
|
24232
|
+
},
|
|
24233
|
+
{
|
|
24234
|
+
attributes: {
|
|
24235
|
+
class: "fa-regular fa-copy"
|
|
24236
|
+
},
|
|
24237
|
+
command: "tlb-clone"
|
|
24238
|
+
},
|
|
24239
|
+
{
|
|
24240
|
+
attributes: {
|
|
24241
|
+
class: "fa-solid fa-trash"
|
|
24242
|
+
},
|
|
24243
|
+
command: "tlb-delete"
|
|
24244
|
+
},
|
|
24245
|
+
];
|
|
24246
|
+
// Add paste button only for UL elements
|
|
24247
|
+
if (compo.getEl && ((_a = compo.getEl()) === null || _a === void 0 ? void 0 : _a.tagName) === "UL") {
|
|
24248
|
+
defaultToolbar.push({
|
|
24249
|
+
attributes: {
|
|
24250
|
+
class: "fa-solid fa-file-word",
|
|
24251
|
+
"data-tooltip": options.t9n.ostToolbarPasteFromWord,
|
|
24252
|
+
"data-tooltip-pos": "bottom"
|
|
24253
|
+
},
|
|
24254
|
+
command: "paste-from-word",
|
|
24255
|
+
});
|
|
24256
|
+
}
|
|
24257
|
+
compo.set({
|
|
24258
|
+
draggable: true,
|
|
24259
|
+
removable: true,
|
|
24260
|
+
copyable: true,
|
|
24261
|
+
toolbar: defaultToolbar,
|
|
24262
|
+
});
|
|
24019
24263
|
});
|
|
24020
24264
|
});
|
|
24021
|
-
};
|
|
24265
|
+
});
|
|
24022
24266
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
|
|
24023
24267
|
|
|
24024
24268
|
})();
|