@paroicms/quill-editor-plugin 1.20.0 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,17 +10,17 @@ async function convertQuillDeltaToHtml(service, delta, options) {
10
10
  preprocessDelta(ops);
11
11
  const converter = new quill_delta_to_html_1.QuillDeltaToHtmlAsyncConverter(ops, {
12
12
  multiLineParagraph: false,
13
- customTagAttributes(op) {
14
- if (op.isLink()) {
15
- const href = (0, data_formatters_lib_1.strValOrUndef)(op.attributes?.link);
16
- if (href) {
17
- const url = new URL(href);
18
- const target = url.hostname === service.fqdn ? "" : "_blank";
19
- return {
20
- target,
21
- };
22
- }
23
- }
13
+ linkTarget: (href) => {
14
+ if (href.startsWith("/"))
15
+ return; // path-only url
16
+ const regex = /^https?:\/\/([^\/]+)/;
17
+ const match = href.match(regex);
18
+ if (!match)
19
+ return;
20
+ const [, domainAndPort] = match;
21
+ const domain = domainAndPort.split(":")[0];
22
+ if (domain !== service.fqdn)
23
+ return "_blank";
24
24
  },
25
25
  });
26
26
  converter.renderCustomWith(async (customOp) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/quill-editor-plugin",
3
- "version": "1.20.0",
3
+ "version": "1.21.1",
4
4
  "description": "Quill Editor plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -29,7 +29,7 @@
29
29
  "clear": "rimraf backend/dist/* bo-front/dist/*"
30
30
  },
31
31
  "dependencies": {
32
- "@paroi/quill-delta-to-html": "~0.12.2",
32
+ "@paroi/quill-delta-to-html": "~0.12.3",
33
33
  "@paroi/data-formatters-lib": "~0.4.0"
34
34
  },
35
35
  "peerDependencies": {
@@ -37,9 +37,9 @@
37
37
  "@paroicms/public-server-lib": "0"
38
38
  },
39
39
  "devDependencies": {
40
- "@paroicms/public-anywhere-lib": "0.11.0",
41
- "@paroicms/public-bo-lib": "0.17.0",
42
- "@paroicms/public-server-lib": "0.19.0",
40
+ "@paroicms/public-anywhere-lib": "0.12.0",
41
+ "@paroicms/public-bo-lib": "0.18.0",
42
+ "@paroicms/public-server-lib": "0.20.0",
43
43
  "@solid-primitives/i18n": "~2.1.1",
44
44
  "@types/node": "~20.14.8",
45
45
  "highlight.js": "~11.10.0",
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "3.1",
2
+ "version": "4.0",
3
3
  "languages": ["en", "fr"],
4
4
  "fieldTypes": [
5
5
  {
6
6
  "name": "leadParagraph",
7
- "storedOn": "section",
7
+ "storedOn": "nodel",
8
8
  "storedAs": "text",
9
9
  "dataType": "quillDelta",
10
10
  "useAsExcerpt": 1,
@@ -16,7 +16,7 @@
16
16
  },
17
17
  {
18
18
  "name": "htmlContent",
19
- "storedOn": "section",
19
+ "storedOn": "nodel",
20
20
  "storedAs": "text",
21
21
  "dataType": "quillDelta",
22
22
  "withGallery": true,
@@ -27,7 +27,7 @@
27
27
  },
28
28
  {
29
29
  "name": "footerMention",
30
- "storedOn": "section",
30
+ "storedOn": "nodel",
31
31
  "storedAs": "text",
32
32
  "dataType": "quillDelta",
33
33
  "backOffice": {
@@ -19,7 +19,7 @@ export interface HtmlEditorVideoPlugin {
19
19
  }
20
20
 
21
21
  export interface HtmlEditorInternalLinkPlugin {
22
- getDocumentTitle(sectionId: string): Promise<string | undefined>;
22
+ getDocumentTitle(nodelId: string): Promise<string | undefined>;
23
23
  openDialog(
24
24
  documentId: string | undefined,
25
25
  options: {