@notum-cz/strapi-plugin-tiptap-editor 1.0.3-rc.6 → 1.1.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/dist/_chunks/{RichTextInput-NZH5L_pW.mjs → RichTextInput-B8CLPOyo.mjs} +1 -1
- package/dist/_chunks/{RichTextInput-zyphJZp3.js → RichTextInput-EtL-yFqV.js} +1 -1
- package/dist/_chunks/{index-DB8F5E26.mjs → index-sX8SY6P-.mjs} +15 -4
- package/dist/_chunks/{index-CsjxcNiy.js → index-yXpX_VsO.js} +15 -4
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/shared/types.d.ts +8 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import ReactDOM, { flushSync } from "react-dom";
|
|
|
6
6
|
import styled from "styled-components";
|
|
7
7
|
import { useField, useFetchClient } from "@strapi/strapi/admin";
|
|
8
8
|
import { Quotes, Code as Code$1, NumberList, BulletList as BulletList$1, StrikeThrough, Underline as Underline$1, Italic as Italic$1, Bold as Bold$1, Link as Link$1, Trash, Image as Image$1, GridNine } from "@strapi/icons";
|
|
9
|
-
import { g as getMediaLibraryComponent, a as getThemeCache } from "./index-
|
|
9
|
+
import { g as getMediaLibraryComponent, a as getThemeCache } from "./index-sX8SY6P-.mjs";
|
|
10
10
|
var shim = { exports: {} };
|
|
11
11
|
var useSyncExternalStoreShim_production = {};
|
|
12
12
|
/**
|
|
@@ -8,7 +8,7 @@ const ReactDOM = require("react-dom");
|
|
|
8
8
|
const styled = require("styled-components");
|
|
9
9
|
const admin = require("@strapi/strapi/admin");
|
|
10
10
|
const icons = require("@strapi/icons");
|
|
11
|
-
const index = require("./index-
|
|
11
|
+
const index = require("./index-yXpX_VsO.js");
|
|
12
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
13
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
14
14
|
const ReactDOM__default = /* @__PURE__ */ _interopDefault(ReactDOM);
|
|
@@ -47,7 +47,13 @@ function reconcileThemeStyles(theme) {
|
|
|
47
47
|
document.head.appendChild(style);
|
|
48
48
|
return Promise.resolve();
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
let resolved;
|
|
51
|
+
try {
|
|
52
|
+
resolved = new URL(stylesheet, document.baseURI).href;
|
|
53
|
+
} catch {
|
|
54
|
+
console.warn("[TiptapEditor] Invalid stylesheet URL:", stylesheet);
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
51
57
|
if (existing && existing.tagName === "LINK" && existing.href === resolved && existing.sheet) {
|
|
52
58
|
return Promise.resolve();
|
|
53
59
|
}
|
|
@@ -84,8 +90,13 @@ const Initializer = ({ setPlugin }) => {
|
|
|
84
90
|
} catch (error) {
|
|
85
91
|
console.warn("[TiptapEditor] Failed to fetch theme config:", error);
|
|
86
92
|
}
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
try {
|
|
94
|
+
await reconcileThemeStyles(themeStyles);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.warn("[TiptapEditor] Failed to reconcile theme styles:", error);
|
|
97
|
+
} finally {
|
|
98
|
+
ref.current(PLUGIN_ID);
|
|
99
|
+
}
|
|
89
100
|
};
|
|
90
101
|
fetchTheme();
|
|
91
102
|
}, []);
|
|
@@ -135,7 +146,7 @@ const richTextField = {
|
|
|
135
146
|
},
|
|
136
147
|
icon: Paragraph,
|
|
137
148
|
components: {
|
|
138
|
-
Input: async () => import("./RichTextInput-
|
|
149
|
+
Input: async () => import("./RichTextInput-B8CLPOyo.mjs").then((m) => ({ default: m.default }))
|
|
139
150
|
},
|
|
140
151
|
options: {
|
|
141
152
|
advanced: [
|
|
@@ -48,7 +48,13 @@ function reconcileThemeStyles(theme) {
|
|
|
48
48
|
document.head.appendChild(style);
|
|
49
49
|
return Promise.resolve();
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
let resolved;
|
|
52
|
+
try {
|
|
53
|
+
resolved = new URL(stylesheet, document.baseURI).href;
|
|
54
|
+
} catch {
|
|
55
|
+
console.warn("[TiptapEditor] Invalid stylesheet URL:", stylesheet);
|
|
56
|
+
return Promise.resolve();
|
|
57
|
+
}
|
|
52
58
|
if (existing && existing.tagName === "LINK" && existing.href === resolved && existing.sheet) {
|
|
53
59
|
return Promise.resolve();
|
|
54
60
|
}
|
|
@@ -85,8 +91,13 @@ const Initializer = ({ setPlugin }) => {
|
|
|
85
91
|
} catch (error) {
|
|
86
92
|
console.warn("[TiptapEditor] Failed to fetch theme config:", error);
|
|
87
93
|
}
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
try {
|
|
95
|
+
await reconcileThemeStyles(themeStyles);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.warn("[TiptapEditor] Failed to reconcile theme styles:", error);
|
|
98
|
+
} finally {
|
|
99
|
+
ref.current(PLUGIN_ID);
|
|
100
|
+
}
|
|
90
101
|
};
|
|
91
102
|
fetchTheme();
|
|
92
103
|
}, []);
|
|
@@ -136,7 +147,7 @@ const richTextField = {
|
|
|
136
147
|
},
|
|
137
148
|
icon: icons.Paragraph,
|
|
138
149
|
components: {
|
|
139
|
-
Input: async () => Promise.resolve().then(() => require("./RichTextInput-
|
|
150
|
+
Input: async () => Promise.resolve().then(() => require("./RichTextInput-EtL-yFqV.js")).then((m) => ({ default: m.default }))
|
|
140
151
|
},
|
|
141
152
|
options: {
|
|
142
153
|
advanced: [
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
package/dist/shared/types.d.ts
CHANGED
|
@@ -17,13 +17,18 @@ export type ThemeColorEntry = {
|
|
|
17
17
|
label: string;
|
|
18
18
|
color: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
colors?: ThemeColorEntry[];
|
|
20
|
+
type ThemeStyleSource = {
|
|
22
21
|
/** A browser-fetchable URL for an external stylesheet */
|
|
23
22
|
stylesheet?: string;
|
|
23
|
+
css?: never;
|
|
24
|
+
} | {
|
|
25
|
+
stylesheet?: never;
|
|
24
26
|
/** Inline CSS content to inject via a <style> tag */
|
|
25
27
|
css?: string;
|
|
26
28
|
};
|
|
29
|
+
export type TiptapThemeConfig = {
|
|
30
|
+
colors?: ThemeColorEntry[];
|
|
31
|
+
} & ThemeStyleSource;
|
|
27
32
|
export interface TiptapPresetConfig {
|
|
28
33
|
bold?: boolean | Record<string, unknown>;
|
|
29
34
|
italic?: boolean | Record<string, unknown>;
|
|
@@ -67,3 +72,4 @@ export declare const isFeatureEnabled: (value: TiptapPresetConfig[keyof TiptapPr
|
|
|
67
72
|
* NOTE: false returns null — DIVERGES from dist where false returns defaults.
|
|
68
73
|
*/
|
|
69
74
|
export declare const getFeatureOptions: <T extends Record<string, unknown>>(value: boolean | T | undefined, defaults: T) => T | null;
|
|
75
|
+
export {};
|
package/package.json
CHANGED