@paroicms/quill-editor-plugin 1.12.0 → 1.13.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.
package/backend/dist/plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
4
|
+
const public_server_lib_1 = require("@paroicms/public-server-lib");
|
|
4
5
|
const node_path_1 = require("node:path");
|
|
5
6
|
const quill_delta_1 = require("./quill-delta");
|
|
6
7
|
const projectDir = (0, node_path_1.dirname)(__dirname);
|
|
@@ -9,6 +10,7 @@ const version = (0, data_formatters_lib_1.strVal)(require((0, node_path_1.join)(
|
|
|
9
10
|
const plugin = {
|
|
10
11
|
version,
|
|
11
12
|
siteInit(service) {
|
|
13
|
+
service.setPublicAssetsDirectory((0, node_path_1.join)(packageDir, "public-front", "dist"));
|
|
12
14
|
service.setBoAssetsDirectory((0, node_path_1.join)(packageDir, "bo-front", "dist"));
|
|
13
15
|
service.registerSiteSchemaLibrary((0, node_path_1.join)(packageDir, "site-schema-lib"));
|
|
14
16
|
service.registerFieldPreprocessor("quillDelta", (service, value, options) => {
|
|
@@ -19,6 +21,7 @@ const plugin = {
|
|
|
19
21
|
return (0, quill_delta_1.convertQuillDeltaToHtml)(service, delta, options);
|
|
20
22
|
}
|
|
21
23
|
});
|
|
24
|
+
service.addHeadTag(`<link rel="stylesheet" href="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/style.css`)}">`, `<script type="module" src="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/public-front-plugin.mjs`)}"></script>`);
|
|
22
25
|
if (service.pluginConf.bo?.code) {
|
|
23
26
|
service.addHeadTag(`<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/default.min.css">`, `<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/highlight.min.js"></script>`, `<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/languages/typescript.min.js"></script>`, `<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/languages/javascript.min.js"></script>`, `<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/languages/xml.min.js"></script>`, `<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/languages/json.min.js"></script>`, `<script>
|
|
24
27
|
hljs.highlightAll();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/quill-editor-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Quill Editor plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"dev:bo": "(cd bo-front && vite)",
|
|
20
|
-
"build": "npm run build:backend && npm run build:bo",
|
|
20
|
+
"build": "npm run build:backend && npm run build:bo && npm run build:public",
|
|
21
21
|
"build:backend": "(cd backend && tsc)",
|
|
22
22
|
"build:bo": "(cd bo-front && tsc && vite build)",
|
|
23
|
+
"build:public": "(cd public-front && tsc && vite build)",
|
|
24
|
+
"build:public:watch": "(cd public-front && tsc && vite build --watch)",
|
|
23
25
|
"build:bo:watch": "(cd bo-front && vite build --watch)",
|
|
24
26
|
"clear": "rimraf backend/dist/* bo-front/dist/*"
|
|
25
27
|
},
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"main": "backend/dist/plugin.js",
|
|
52
54
|
"files": [
|
|
53
55
|
"backend/dist",
|
|
56
|
+
"public-front/dist",
|
|
54
57
|
"bo-front/dist",
|
|
55
58
|
"site-schema-lib"
|
|
56
59
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="p-icon" aria-hidden="true"><path d="M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z" fill="#fff"></path></svg>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function f(n) {
|
|
2
|
+
let t = n;
|
|
3
|
+
const e = t.indexOf("?");
|
|
4
|
+
e !== -1 && (t = t.substring(0, e));
|
|
5
|
+
const o = t.indexOf("#");
|
|
6
|
+
o !== -1 && (t = t.substring(0, o));
|
|
7
|
+
const i = t.lastIndexOf("/");
|
|
8
|
+
return i === -1 ? void 0 : t.slice(0, i);
|
|
9
|
+
}
|
|
10
|
+
const a = f(import.meta.url);
|
|
11
|
+
function m(n) {
|
|
12
|
+
const t = `${n}/index.css`, e = document.createElement("link");
|
|
13
|
+
e.rel = "stylesheet", e.href = t, document.head.appendChild(e);
|
|
14
|
+
}
|
|
15
|
+
const s = "_$DX_DELEGATE";
|
|
16
|
+
function g(n, t, e) {
|
|
17
|
+
let o;
|
|
18
|
+
const i = () => {
|
|
19
|
+
const r = document.createElement("template");
|
|
20
|
+
return r.innerHTML = n, r.content.firstChild;
|
|
21
|
+
}, c = () => (o || (o = i())).cloneNode(!0);
|
|
22
|
+
return c.cloneNode = c, c;
|
|
23
|
+
}
|
|
24
|
+
function p(n, t = window.document) {
|
|
25
|
+
const e = t[s] || (t[s] = /* @__PURE__ */ new Set());
|
|
26
|
+
for (let o = 0, i = n.length; o < i; o++) {
|
|
27
|
+
const c = n[o];
|
|
28
|
+
e.has(c) || (e.add(c), t.addEventListener(c, h));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function l(n, t, e) {
|
|
32
|
+
e == null ? n.removeAttribute(t) : n.setAttribute(t, e);
|
|
33
|
+
}
|
|
34
|
+
function h(n) {
|
|
35
|
+
const t = `$$${n.type}`;
|
|
36
|
+
let e = n.composedPath && n.composedPath()[0] || n.target;
|
|
37
|
+
for (n.target !== e && Object.defineProperty(n, "target", {
|
|
38
|
+
configurable: !0,
|
|
39
|
+
value: e
|
|
40
|
+
}), Object.defineProperty(n, "currentTarget", {
|
|
41
|
+
configurable: !0,
|
|
42
|
+
get() {
|
|
43
|
+
return e || document;
|
|
44
|
+
}
|
|
45
|
+
}); e; ) {
|
|
46
|
+
const o = e[t];
|
|
47
|
+
if (o && !e.disabled) {
|
|
48
|
+
const i = e[`${t}Data`];
|
|
49
|
+
if (i !== void 0 ? o.call(e, i, n) : o.call(e, n), n.cancelBubble) return;
|
|
50
|
+
}
|
|
51
|
+
e = e._$host || e.parentNode || e.host;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var b = /* @__PURE__ */ g('<div class=ImageZoomViewer><button type=button class=ImageZoomViewer-closeBtn><img alt=⨯ width=30 height=30></button><img class=ImageZoomViewer-img alt="">');
|
|
55
|
+
function $() {
|
|
56
|
+
const n = document.querySelectorAll("[data-zoom-src]");
|
|
57
|
+
for (const t of n) {
|
|
58
|
+
if (!(t instanceof HTMLElement)) continue;
|
|
59
|
+
const e = t.dataset.zoomSrc?.trim();
|
|
60
|
+
e && E(t, {
|
|
61
|
+
dataZoomSrc: e
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function E(n, {
|
|
66
|
+
dataZoomSrc: t
|
|
67
|
+
}) {
|
|
68
|
+
n.classList.add("Zoomable"), n.setAttribute("tabindex", "0"), n.addEventListener("click", (e) => {
|
|
69
|
+
e.preventDefault(), v(t);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function v(n) {
|
|
73
|
+
const t = document.body, e = (() => {
|
|
74
|
+
var c = b(), r = c.firstChild, d = r.firstChild, u = r.nextSibling;
|
|
75
|
+
return r.$$click = i, l(d, "src", `${a}/cross.svg`), l(u, "src", n), c;
|
|
76
|
+
})();
|
|
77
|
+
function o(c) {
|
|
78
|
+
c.key === "Escape" && i();
|
|
79
|
+
}
|
|
80
|
+
function i() {
|
|
81
|
+
e.remove(), t.removeEventListener("keyup", o);
|
|
82
|
+
}
|
|
83
|
+
t.addEventListener("keyup", o), t.appendChild(e);
|
|
84
|
+
}
|
|
85
|
+
p(["click"]);
|
|
86
|
+
$();
|
|
87
|
+
m(a ?? ".");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Zoomable{cursor:pointer}.ImageZoomViewer{align-items:center;background:#00000080;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:999}.ImageZoomViewer-img{height:100%;object-fit:contain;width:100%}.ImageZoomViewer-closeBtn{background-color:#00000080;cursor:pointer;display:flex;margin:20px;position:absolute;right:0;top:0}
|