@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.
@@ -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-DB8F5E26.mjs";
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-CsjxcNiy.js");
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
- const resolved = new URL(stylesheet, document.baseURI).href;
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
- await reconcileThemeStyles(themeStyles);
88
- ref.current(PLUGIN_ID);
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-NZH5L_pW.mjs").then((m) => ({ default: m.default }))
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
- const resolved = new URL(stylesheet, document.baseURI).href;
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
- await reconcileThemeStyles(themeStyles);
89
- ref.current(PLUGIN_ID);
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-zyphJZp3.js")).then((m) => ({ default: m.default }))
150
+ Input: async () => Promise.resolve().then(() => require("./RichTextInput-EtL-yFqV.js")).then((m) => ({ default: m.default }))
140
151
  },
141
152
  options: {
142
153
  advanced: [
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CsjxcNiy.js");
2
+ const index = require("../_chunks/index-yXpX_VsO.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-DB8F5E26.mjs";
1
+ import { i } from "../_chunks/index-sX8SY6P-.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
@@ -17,13 +17,18 @@ export type ThemeColorEntry = {
17
17
  label: string;
18
18
  color: string;
19
19
  };
20
- export type TiptapThemeConfig = {
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.3-rc.6",
2
+ "version": "1.1.0",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "plugin",