@notum-cz/strapi-plugin-tiptap-editor 1.2.1 → 1.2.4
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-B4D0Djcf.mjs → admin/RichTextInput-BuTgY6jA.mjs} +90 -58
- package/dist/{_chunks/RichTextInput-1uZSm3Nc.js → admin/RichTextInput-D9UyIRfa.js} +90 -58
- package/dist/{_chunks/index-BVPd2eP4.mjs → admin/index-CJyApDMr.mjs} +2 -2
- package/dist/{_chunks/index-CTcKIvYv.js → admin/index-DbZOvKJG.js} +2 -2
- package/dist/admin/index.js +3 -2
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/BaseTiptapInput.d.ts +2 -3
- package/dist/admin/src/components/EditorErrorBoundary.d.ts +1 -1
- package/dist/admin/src/components/ImageAltPopover.d.ts +1 -1
- package/dist/admin/src/components/LinkDialog.d.ts +1 -1
- package/dist/admin/src/components/RichTextInput.d.ts +1 -2
- package/dist/admin/src/components/TiptapInput.d.ts +2 -3
- package/dist/admin/src/components/TiptapInputStyles.d.ts +1 -1
- package/dist/admin/src/extensions/Heading.d.ts +2 -2
- package/dist/admin/src/extensions/Image.d.ts +3 -3
- package/dist/admin/src/fields/richTextField.d.ts +2 -2
- package/dist/admin/src/index.d.ts +1 -1
- package/dist/admin/src/utils/strapiApp.d.ts +2 -2
- package/dist/admin/src/utils/tiptapUtils.d.ts +3 -4
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/controllers/index.d.ts +5 -5
- package/dist/server/src/controllers/preset.d.ts +2 -2
- package/dist/server/src/controllers/theme.d.ts +2 -2
- package/dist/server/src/destroy.d.ts +1 -1
- package/dist/server/src/index.d.ts +14 -14
- package/dist/server/src/register.d.ts +1 -1
- package/dist/server/src/services/index.d.ts +5 -5
- package/dist/server/src/services/preset.d.ts +1 -1
- package/dist/server/src/services/theme.d.ts +1 -1
- package/package.json +16 -16
- package/dist/shared/fields.d.ts +0 -1
- package/dist/shared/pluginId.d.ts +0 -1
- package/dist/shared/types.d.ts +0 -75
- /package/dist/{_chunks → admin}/en-HTqMhvt6.mjs +0 -0
- /package/dist/{_chunks → admin}/en-fytkVDTF.js +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1
4
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
5
|
import React, { useRef, useState, useDebugValue, useEffect, useLayoutEffect, forwardRef, createRef, memo, createElement, createContext, version, useContext, useMemo, Component, useCallback } from "react";
|
|
3
6
|
import { useIntl } from "react-intl";
|
|
@@ -6,7 +9,7 @@ import ReactDOM, { flushSync } from "react-dom";
|
|
|
6
9
|
import styled from "styled-components";
|
|
7
10
|
import { useField, useFetchClient } from "@strapi/strapi/admin";
|
|
8
11
|
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, Cross, Trash, Image as Image$1, GridNine } from "@strapi/icons";
|
|
9
|
-
import { g as getMediaLibraryComponent, a as getThemeCache } from "./index-
|
|
12
|
+
import { g as getMediaLibraryComponent, a as getThemeCache } from "./index-CJyApDMr.mjs";
|
|
10
13
|
var shim = { exports: {} };
|
|
11
14
|
var useSyncExternalStoreShim_production = {};
|
|
12
15
|
/**
|
|
@@ -80,7 +83,7 @@ var hasRequiredUseSyncExternalStoreShim_development;
|
|
|
80
83
|
function requireUseSyncExternalStoreShim_development() {
|
|
81
84
|
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
82
85
|
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
83
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
86
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
84
87
|
function is(x, y) {
|
|
85
88
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
86
89
|
}
|
|
@@ -136,15 +139,21 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
136
139
|
var React$1 = React, objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React$1.useState, useEffect2 = React$1.useEffect, useLayoutEffect2 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
137
140
|
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim2;
|
|
138
141
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
139
|
-
}();
|
|
142
|
+
})();
|
|
140
143
|
return useSyncExternalStoreShim_development;
|
|
141
144
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
var hasRequiredShim;
|
|
146
|
+
function requireShim() {
|
|
147
|
+
if (hasRequiredShim) return shim.exports;
|
|
148
|
+
hasRequiredShim = 1;
|
|
149
|
+
if (process.env.NODE_ENV === "production") {
|
|
150
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
151
|
+
} else {
|
|
152
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
153
|
+
}
|
|
154
|
+
return shim.exports;
|
|
146
155
|
}
|
|
147
|
-
var shimExports =
|
|
156
|
+
var shimExports = requireShim();
|
|
148
157
|
function OrderedMap(content) {
|
|
149
158
|
this.content = content;
|
|
150
159
|
}
|
|
@@ -18708,7 +18717,7 @@ var hasRequiredWithSelector_production;
|
|
|
18708
18717
|
function requireWithSelector_production() {
|
|
18709
18718
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
18710
18719
|
hasRequiredWithSelector_production = 1;
|
|
18711
|
-
var React$1 = React, shim2 =
|
|
18720
|
+
var React$1 = React, shim2 = requireShim();
|
|
18712
18721
|
function is(x, y) {
|
|
18713
18722
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
18714
18723
|
}
|
|
@@ -18780,12 +18789,12 @@ var hasRequiredWithSelector_development;
|
|
|
18780
18789
|
function requireWithSelector_development() {
|
|
18781
18790
|
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
18782
18791
|
hasRequiredWithSelector_development = 1;
|
|
18783
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
18792
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
18784
18793
|
function is(x, y) {
|
|
18785
18794
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
18786
18795
|
}
|
|
18787
18796
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
18788
|
-
var React$1 = React, shim2 =
|
|
18797
|
+
var React$1 = React, shim2 = requireShim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React$1.useRef, useEffect2 = React$1.useEffect, useMemo2 = React$1.useMemo, useDebugValue2 = React$1.useDebugValue;
|
|
18789
18798
|
withSelector_development.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
18790
18799
|
var instRef = useRef2(null);
|
|
18791
18800
|
if (null === instRef.current) {
|
|
@@ -18839,15 +18848,21 @@ function requireWithSelector_development() {
|
|
|
18839
18848
|
return value;
|
|
18840
18849
|
};
|
|
18841
18850
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
18842
|
-
}();
|
|
18851
|
+
})();
|
|
18843
18852
|
return withSelector_development;
|
|
18844
18853
|
}
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18854
|
+
var hasRequiredWithSelector;
|
|
18855
|
+
function requireWithSelector() {
|
|
18856
|
+
if (hasRequiredWithSelector) return withSelector.exports;
|
|
18857
|
+
hasRequiredWithSelector = 1;
|
|
18858
|
+
if (process.env.NODE_ENV === "production") {
|
|
18859
|
+
withSelector.exports = requireWithSelector_production();
|
|
18860
|
+
} else {
|
|
18861
|
+
withSelector.exports = requireWithSelector_development();
|
|
18862
|
+
}
|
|
18863
|
+
return withSelector.exports;
|
|
18849
18864
|
}
|
|
18850
|
-
var withSelectorExports =
|
|
18865
|
+
var withSelectorExports = requireWithSelector();
|
|
18851
18866
|
var mergeRefs = (...refs) => {
|
|
18852
18867
|
return (node) => {
|
|
18853
18868
|
refs.forEach((ref) => {
|
|
@@ -20044,7 +20059,7 @@ const BaseTiptapInput = forwardRef(
|
|
|
20044
20059
|
paddingLeft: 0,
|
|
20045
20060
|
paddingRight: 0,
|
|
20046
20061
|
children: [
|
|
20047
|
-
noPresetConfigured && /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 2, children: /* @__PURE__ */ jsx(Status, { variant: "secondary",
|
|
20062
|
+
noPresetConfigured && /* @__PURE__ */ jsx(Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 2, children: /* @__PURE__ */ jsx(Status, { variant: "secondary", children: /* @__PURE__ */ jsx(Typography, { variant: "pi", children: formatMessage({
|
|
20048
20063
|
id: "tiptap-editor.noPreset.message",
|
|
20049
20064
|
defaultMessage: "No editor preset configured — showing minimal editor"
|
|
20050
20065
|
}) }) }) }),
|
|
@@ -20077,16 +20092,19 @@ const ErrorFallback = ({ onRetry }) => {
|
|
|
20077
20092
|
] });
|
|
20078
20093
|
};
|
|
20079
20094
|
class EditorErrorBoundary extends Component {
|
|
20080
|
-
|
|
20095
|
+
constructor() {
|
|
20096
|
+
super(...arguments);
|
|
20097
|
+
__publicField(this, "state", { hasError: false, error: null });
|
|
20098
|
+
__publicField(this, "handleRetry", () => {
|
|
20099
|
+
this.setState({ hasError: false, error: null });
|
|
20100
|
+
});
|
|
20101
|
+
}
|
|
20081
20102
|
static getDerivedStateFromError(error) {
|
|
20082
20103
|
return { hasError: true, error };
|
|
20083
20104
|
}
|
|
20084
20105
|
componentDidCatch(error, errorInfo) {
|
|
20085
20106
|
console.error("[TiptapEditor] Editor crashed:", error, errorInfo);
|
|
20086
20107
|
}
|
|
20087
|
-
handleRetry = () => {
|
|
20088
|
-
this.setState({ hasError: false, error: null });
|
|
20089
|
-
};
|
|
20090
20108
|
render() {
|
|
20091
20109
|
if (this.state.hasError) {
|
|
20092
20110
|
return /* @__PURE__ */ jsx(ErrorFallback, { onRetry: this.handleRetry });
|
|
@@ -20656,7 +20674,7 @@ function useHeading(editor, props = { disabled: false }) {
|
|
|
20656
20674
|
placeholder: formatMessage({ id: "tiptap-editor.heading.style", defaultMessage: "Style" }),
|
|
20657
20675
|
"aria-label": formatMessage({ id: "tiptap-editor.heading.textStyle", defaultMessage: "Text style" }),
|
|
20658
20676
|
value: editorState?.headingLevel ? `h${editorState.headingLevel}` : "p",
|
|
20659
|
-
onChange: (v) => v && onChangeHeading(v),
|
|
20677
|
+
onChange: (v) => v != null && onChangeHeading(String(v)),
|
|
20660
20678
|
disabled: !editor || props.disabled,
|
|
20661
20679
|
size: "S",
|
|
20662
20680
|
children: [
|
|
@@ -20671,7 +20689,7 @@ function useHeading(editor, props = { disabled: false }) {
|
|
|
20671
20689
|
placeholder: formatMessage({ id: "tiptap-editor.heading.seoTag", defaultMessage: "SEO Tag" }),
|
|
20672
20690
|
"aria-label": formatMessage({ id: "tiptap-editor.heading.seoTagAriaLabel", defaultMessage: "Heading's HTML tag for SEO purposes" }),
|
|
20673
20691
|
value: editorState?.headingTag,
|
|
20674
|
-
onChange: (v) => v && onChangeHeadingTag(v),
|
|
20692
|
+
onChange: (v) => v != null && onChangeHeadingTag(String(v)),
|
|
20675
20693
|
disabled: !editor || props.disabled || !editorState?.headingLevel,
|
|
20676
20694
|
size: "S",
|
|
20677
20695
|
children: [
|
|
@@ -21392,34 +21410,48 @@ const TableSizeDialog = ({
|
|
|
21392
21410
|
children: open && /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
21393
21411
|
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({ id: "tiptap-editor.table.insertTable", defaultMessage: "Insert table" }) }),
|
|
21394
21412
|
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs(Flex, { gap: 4, alignItems: "flex-end", children: [
|
|
21395
|
-
/* @__PURE__ */ jsxs(
|
|
21396
|
-
|
|
21397
|
-
|
|
21398
|
-
|
|
21399
|
-
{
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21413
|
+
/* @__PURE__ */ jsxs(
|
|
21414
|
+
Field.Root,
|
|
21415
|
+
{
|
|
21416
|
+
width: "100%",
|
|
21417
|
+
hint: formatMessage({ id: "tiptap-editor.table.minMax", defaultMessage: "Min {min}, max {max}" }, { min, max }),
|
|
21418
|
+
children: [
|
|
21419
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({ id: "tiptap-editor.table.rows", defaultMessage: "Rows" }) }),
|
|
21420
|
+
/* @__PURE__ */ jsx(
|
|
21421
|
+
TextInput,
|
|
21422
|
+
{
|
|
21423
|
+
name: "table-rows",
|
|
21424
|
+
type: "number",
|
|
21425
|
+
value: String(rows),
|
|
21426
|
+
onChange: (e) => setRows(clamp(parseNum(e.target.value, rows), min, max)),
|
|
21427
|
+
placeholder: String(defaultRows)
|
|
21428
|
+
}
|
|
21429
|
+
),
|
|
21430
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
21431
|
+
]
|
|
21432
|
+
}
|
|
21433
|
+
),
|
|
21434
|
+
/* @__PURE__ */ jsxs(
|
|
21435
|
+
Field.Root,
|
|
21436
|
+
{
|
|
21437
|
+
width: "100%",
|
|
21438
|
+
hint: formatMessage({ id: "tiptap-editor.table.minMax", defaultMessage: "Min {min}, max {max}" }, { min, max }),
|
|
21439
|
+
children: [
|
|
21440
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({ id: "tiptap-editor.table.columns", defaultMessage: "Columns" }) }),
|
|
21441
|
+
/* @__PURE__ */ jsx(
|
|
21442
|
+
TextInput,
|
|
21443
|
+
{
|
|
21444
|
+
name: "table-cols",
|
|
21445
|
+
type: "number",
|
|
21446
|
+
value: String(cols),
|
|
21447
|
+
onChange: (e) => setCols(clamp(parseNum(e.target.value, cols), min, max)),
|
|
21448
|
+
placeholder: String(defaultCols)
|
|
21449
|
+
}
|
|
21450
|
+
),
|
|
21451
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
21452
|
+
]
|
|
21453
|
+
}
|
|
21454
|
+
)
|
|
21423
21455
|
] }) }),
|
|
21424
21456
|
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
21425
21457
|
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", fullWidth: true, onClick: onClose, children: formatMessage({ id: "tiptap-editor.table.cancel", defaultMessage: "Cancel" }) }) }),
|
|
@@ -24237,10 +24269,10 @@ var Link = Mark2.create({
|
|
|
24237
24269
|
return plugins;
|
|
24238
24270
|
}
|
|
24239
24271
|
});
|
|
24240
|
-
var
|
|
24272
|
+
var __defProp2 = Object.defineProperty;
|
|
24241
24273
|
var __export = (target, all) => {
|
|
24242
24274
|
for (var name in all)
|
|
24243
|
-
|
|
24275
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
24244
24276
|
};
|
|
24245
24277
|
var ListItemName = "listItem";
|
|
24246
24278
|
var TextStyleName = "textStyle";
|
|
@@ -25865,7 +25897,7 @@ RopeSequence.from = function from(values) {
|
|
|
25865
25897
|
}
|
|
25866
25898
|
return values && values.length ? new Leaf(values) : RopeSequence.empty;
|
|
25867
25899
|
};
|
|
25868
|
-
var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
25900
|
+
var Leaf = /* @__PURE__ */ (function(RopeSequence3) {
|
|
25869
25901
|
function Leaf2(values) {
|
|
25870
25902
|
RopeSequence3.call(this);
|
|
25871
25903
|
this.values = values;
|
|
@@ -25918,9 +25950,9 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
25918
25950
|
};
|
|
25919
25951
|
Object.defineProperties(Leaf2.prototype, prototypeAccessors);
|
|
25920
25952
|
return Leaf2;
|
|
25921
|
-
}(RopeSequence);
|
|
25953
|
+
})(RopeSequence);
|
|
25922
25954
|
RopeSequence.empty = new Leaf([]);
|
|
25923
|
-
var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
25955
|
+
var Append = /* @__PURE__ */ (function(RopeSequence3) {
|
|
25924
25956
|
function Append2(left, right) {
|
|
25925
25957
|
RopeSequence3.call(this);
|
|
25926
25958
|
this.left = left;
|
|
@@ -25987,7 +26019,7 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
25987
26019
|
return new Append2(this, other);
|
|
25988
26020
|
};
|
|
25989
26021
|
return Append2;
|
|
25990
|
-
}(RopeSequence);
|
|
26022
|
+
})(RopeSequence);
|
|
25991
26023
|
const max_empty_items = 500;
|
|
25992
26024
|
class Branch {
|
|
25993
26025
|
constructor(items, eventCount) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
6
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
7
|
const React = require("react");
|
|
@@ -8,7 +11,7 @@ const ReactDOM = require("react-dom");
|
|
|
8
11
|
const styled = require("styled-components");
|
|
9
12
|
const admin = require("@strapi/strapi/admin");
|
|
10
13
|
const icons = require("@strapi/icons");
|
|
11
|
-
const index = require("./index-
|
|
14
|
+
const index = require("./index-DbZOvKJG.js");
|
|
12
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
13
16
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
14
17
|
const ReactDOM__default = /* @__PURE__ */ _interopDefault(ReactDOM);
|
|
@@ -86,7 +89,7 @@ var hasRequiredUseSyncExternalStoreShim_development;
|
|
|
86
89
|
function requireUseSyncExternalStoreShim_development() {
|
|
87
90
|
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
88
91
|
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
89
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
92
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
90
93
|
function is(x, y) {
|
|
91
94
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
92
95
|
}
|
|
@@ -142,15 +145,21 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
142
145
|
var React2 = React__default.default, objectIs = "function" === typeof Object.is ? Object.is : is, useState = React2.useState, useEffect = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
143
146
|
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim2;
|
|
144
147
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
145
|
-
}();
|
|
148
|
+
})();
|
|
146
149
|
return useSyncExternalStoreShim_development;
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
var hasRequiredShim;
|
|
152
|
+
function requireShim() {
|
|
153
|
+
if (hasRequiredShim) return shim.exports;
|
|
154
|
+
hasRequiredShim = 1;
|
|
155
|
+
if (process.env.NODE_ENV === "production") {
|
|
156
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
157
|
+
} else {
|
|
158
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
159
|
+
}
|
|
160
|
+
return shim.exports;
|
|
152
161
|
}
|
|
153
|
-
var shimExports =
|
|
162
|
+
var shimExports = requireShim();
|
|
154
163
|
function OrderedMap(content) {
|
|
155
164
|
this.content = content;
|
|
156
165
|
}
|
|
@@ -18714,7 +18723,7 @@ var hasRequiredWithSelector_production;
|
|
|
18714
18723
|
function requireWithSelector_production() {
|
|
18715
18724
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
18716
18725
|
hasRequiredWithSelector_production = 1;
|
|
18717
|
-
var React2 = React__default.default, shim2 =
|
|
18726
|
+
var React2 = React__default.default, shim2 = requireShim();
|
|
18718
18727
|
function is(x, y) {
|
|
18719
18728
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
18720
18729
|
}
|
|
@@ -18786,12 +18795,12 @@ var hasRequiredWithSelector_development;
|
|
|
18786
18795
|
function requireWithSelector_development() {
|
|
18787
18796
|
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
18788
18797
|
hasRequiredWithSelector_development = 1;
|
|
18789
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
18798
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
18790
18799
|
function is(x, y) {
|
|
18791
18800
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
18792
18801
|
}
|
|
18793
18802
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
18794
|
-
var React2 = React__default.default, shim2 =
|
|
18803
|
+
var React2 = React__default.default, shim2 = requireShim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef = React2.useRef, useEffect = React2.useEffect, useMemo = React2.useMemo, useDebugValue = React2.useDebugValue;
|
|
18795
18804
|
withSelector_development.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
18796
18805
|
var instRef = useRef(null);
|
|
18797
18806
|
if (null === instRef.current) {
|
|
@@ -18845,15 +18854,21 @@ function requireWithSelector_development() {
|
|
|
18845
18854
|
return value;
|
|
18846
18855
|
};
|
|
18847
18856
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
18848
|
-
}();
|
|
18857
|
+
})();
|
|
18849
18858
|
return withSelector_development;
|
|
18850
18859
|
}
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
|
|
18860
|
+
var hasRequiredWithSelector;
|
|
18861
|
+
function requireWithSelector() {
|
|
18862
|
+
if (hasRequiredWithSelector) return withSelector.exports;
|
|
18863
|
+
hasRequiredWithSelector = 1;
|
|
18864
|
+
if (process.env.NODE_ENV === "production") {
|
|
18865
|
+
withSelector.exports = requireWithSelector_production();
|
|
18866
|
+
} else {
|
|
18867
|
+
withSelector.exports = requireWithSelector_development();
|
|
18868
|
+
}
|
|
18869
|
+
return withSelector.exports;
|
|
18855
18870
|
}
|
|
18856
|
-
var withSelectorExports =
|
|
18871
|
+
var withSelectorExports = requireWithSelector();
|
|
18857
18872
|
var mergeRefs = (...refs) => {
|
|
18858
18873
|
return (node) => {
|
|
18859
18874
|
refs.forEach((ref) => {
|
|
@@ -20050,7 +20065,7 @@ const BaseTiptapInput = React.forwardRef(
|
|
|
20050
20065
|
paddingLeft: 0,
|
|
20051
20066
|
paddingRight: 0,
|
|
20052
20067
|
children: [
|
|
20053
|
-
noPresetConfigured && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { variant: "secondary",
|
|
20068
|
+
noPresetConfigured && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, paddingRight: 2, paddingTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: formatMessage({
|
|
20054
20069
|
id: "tiptap-editor.noPreset.message",
|
|
20055
20070
|
defaultMessage: "No editor preset configured — showing minimal editor"
|
|
20056
20071
|
}) }) }) }),
|
|
@@ -20083,16 +20098,19 @@ const ErrorFallback = ({ onRetry }) => {
|
|
|
20083
20098
|
] });
|
|
20084
20099
|
};
|
|
20085
20100
|
class EditorErrorBoundary extends React.Component {
|
|
20086
|
-
|
|
20101
|
+
constructor() {
|
|
20102
|
+
super(...arguments);
|
|
20103
|
+
__publicField(this, "state", { hasError: false, error: null });
|
|
20104
|
+
__publicField(this, "handleRetry", () => {
|
|
20105
|
+
this.setState({ hasError: false, error: null });
|
|
20106
|
+
});
|
|
20107
|
+
}
|
|
20087
20108
|
static getDerivedStateFromError(error) {
|
|
20088
20109
|
return { hasError: true, error };
|
|
20089
20110
|
}
|
|
20090
20111
|
componentDidCatch(error, errorInfo) {
|
|
20091
20112
|
console.error("[TiptapEditor] Editor crashed:", error, errorInfo);
|
|
20092
20113
|
}
|
|
20093
|
-
handleRetry = () => {
|
|
20094
|
-
this.setState({ hasError: false, error: null });
|
|
20095
|
-
};
|
|
20096
20114
|
render() {
|
|
20097
20115
|
if (this.state.hasError) {
|
|
20098
20116
|
return /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, { onRetry: this.handleRetry });
|
|
@@ -20662,7 +20680,7 @@ function useHeading(editor, props = { disabled: false }) {
|
|
|
20662
20680
|
placeholder: formatMessage({ id: "tiptap-editor.heading.style", defaultMessage: "Style" }),
|
|
20663
20681
|
"aria-label": formatMessage({ id: "tiptap-editor.heading.textStyle", defaultMessage: "Text style" }),
|
|
20664
20682
|
value: editorState?.headingLevel ? `h${editorState.headingLevel}` : "p",
|
|
20665
|
-
onChange: (v) => v && onChangeHeading(v),
|
|
20683
|
+
onChange: (v) => v != null && onChangeHeading(String(v)),
|
|
20666
20684
|
disabled: !editor || props.disabled,
|
|
20667
20685
|
size: "S",
|
|
20668
20686
|
children: [
|
|
@@ -20677,7 +20695,7 @@ function useHeading(editor, props = { disabled: false }) {
|
|
|
20677
20695
|
placeholder: formatMessage({ id: "tiptap-editor.heading.seoTag", defaultMessage: "SEO Tag" }),
|
|
20678
20696
|
"aria-label": formatMessage({ id: "tiptap-editor.heading.seoTagAriaLabel", defaultMessage: "Heading's HTML tag for SEO purposes" }),
|
|
20679
20697
|
value: editorState?.headingTag,
|
|
20680
|
-
onChange: (v) => v && onChangeHeadingTag(v),
|
|
20698
|
+
onChange: (v) => v != null && onChangeHeadingTag(String(v)),
|
|
20681
20699
|
disabled: !editor || props.disabled || !editorState?.headingLevel,
|
|
20682
20700
|
size: "S",
|
|
20683
20701
|
children: [
|
|
@@ -21398,34 +21416,48 @@ const TableSizeDialog = ({
|
|
|
21398
21416
|
children: open && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
|
21399
21417
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: formatMessage({ id: "tiptap-editor.table.insertTable", defaultMessage: "Insert table" }) }),
|
|
21400
21418
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "flex-end", children: [
|
|
21401
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
{
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21419
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21420
|
+
designSystem.Field.Root,
|
|
21421
|
+
{
|
|
21422
|
+
width: "100%",
|
|
21423
|
+
hint: formatMessage({ id: "tiptap-editor.table.minMax", defaultMessage: "Min {min}, max {max}" }, { min, max }),
|
|
21424
|
+
children: [
|
|
21425
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({ id: "tiptap-editor.table.rows", defaultMessage: "Rows" }) }),
|
|
21426
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21427
|
+
designSystem.TextInput,
|
|
21428
|
+
{
|
|
21429
|
+
name: "table-rows",
|
|
21430
|
+
type: "number",
|
|
21431
|
+
value: String(rows),
|
|
21432
|
+
onChange: (e) => setRows(clamp(parseNum(e.target.value, rows), min, max)),
|
|
21433
|
+
placeholder: String(defaultRows)
|
|
21434
|
+
}
|
|
21435
|
+
),
|
|
21436
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
21437
|
+
]
|
|
21438
|
+
}
|
|
21439
|
+
),
|
|
21440
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21441
|
+
designSystem.Field.Root,
|
|
21442
|
+
{
|
|
21443
|
+
width: "100%",
|
|
21444
|
+
hint: formatMessage({ id: "tiptap-editor.table.minMax", defaultMessage: "Min {min}, max {max}" }, { min, max }),
|
|
21445
|
+
children: [
|
|
21446
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({ id: "tiptap-editor.table.columns", defaultMessage: "Columns" }) }),
|
|
21447
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21448
|
+
designSystem.TextInput,
|
|
21449
|
+
{
|
|
21450
|
+
name: "table-cols",
|
|
21451
|
+
type: "number",
|
|
21452
|
+
value: String(cols),
|
|
21453
|
+
onChange: (e) => setCols(clamp(parseNum(e.target.value, cols), min, max)),
|
|
21454
|
+
placeholder: String(defaultCols)
|
|
21455
|
+
}
|
|
21456
|
+
),
|
|
21457
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
21458
|
+
]
|
|
21459
|
+
}
|
|
21460
|
+
)
|
|
21429
21461
|
] }) }),
|
|
21430
21462
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
|
21431
21463
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", fullWidth: true, onClick: onClose, children: formatMessage({ id: "tiptap-editor.table.cancel", defaultMessage: "Cancel" }) }) }),
|
|
@@ -24243,10 +24275,10 @@ var Link = Mark2.create({
|
|
|
24243
24275
|
return plugins;
|
|
24244
24276
|
}
|
|
24245
24277
|
});
|
|
24246
|
-
var
|
|
24278
|
+
var __defProp2 = Object.defineProperty;
|
|
24247
24279
|
var __export = (target, all) => {
|
|
24248
24280
|
for (var name in all)
|
|
24249
|
-
|
|
24281
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
24250
24282
|
};
|
|
24251
24283
|
var ListItemName = "listItem";
|
|
24252
24284
|
var TextStyleName = "textStyle";
|
|
@@ -25871,7 +25903,7 @@ RopeSequence.from = function from(values) {
|
|
|
25871
25903
|
}
|
|
25872
25904
|
return values && values.length ? new Leaf(values) : RopeSequence.empty;
|
|
25873
25905
|
};
|
|
25874
|
-
var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
25906
|
+
var Leaf = /* @__PURE__ */ (function(RopeSequence3) {
|
|
25875
25907
|
function Leaf2(values) {
|
|
25876
25908
|
RopeSequence3.call(this);
|
|
25877
25909
|
this.values = values;
|
|
@@ -25924,9 +25956,9 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
25924
25956
|
};
|
|
25925
25957
|
Object.defineProperties(Leaf2.prototype, prototypeAccessors);
|
|
25926
25958
|
return Leaf2;
|
|
25927
|
-
}(RopeSequence);
|
|
25959
|
+
})(RopeSequence);
|
|
25928
25960
|
RopeSequence.empty = new Leaf([]);
|
|
25929
|
-
var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
25961
|
+
var Append = /* @__PURE__ */ (function(RopeSequence3) {
|
|
25930
25962
|
function Append2(left, right) {
|
|
25931
25963
|
RopeSequence3.call(this);
|
|
25932
25964
|
this.left = left;
|
|
@@ -25993,7 +26025,7 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
|
|
|
25993
26025
|
return new Append2(this, other);
|
|
25994
26026
|
};
|
|
25995
26027
|
return Append2;
|
|
25996
|
-
}(RopeSequence);
|
|
26028
|
+
})(RopeSequence);
|
|
25997
26029
|
const max_empty_items = 500;
|
|
25998
26030
|
class Branch {
|
|
25999
26031
|
constructor(items, eventCount) {
|
|
@@ -116,7 +116,7 @@ function PresetSelect({ value, onChange, name }) {
|
|
|
116
116
|
name,
|
|
117
117
|
value: value || "",
|
|
118
118
|
onChange: (val) => {
|
|
119
|
-
onChange({ target: { name, value: val, type: "select" } });
|
|
119
|
+
onChange({ target: { name, value: String(val), type: "select" } });
|
|
120
120
|
},
|
|
121
121
|
placeholder: presets.length === 0 ? formatMessage({ id: "tiptap-editor.preset.noPresetsAvailable", defaultMessage: "No presets available" }) : formatMessage({ id: "tiptap-editor.preset.selectPreset", defaultMessage: "Select a preset" }),
|
|
122
122
|
disabled: isLoading || presets.length === 0,
|
|
@@ -146,7 +146,7 @@ const richTextField = {
|
|
|
146
146
|
},
|
|
147
147
|
icon: Paragraph,
|
|
148
148
|
components: {
|
|
149
|
-
Input: async () => import("./RichTextInput-
|
|
149
|
+
Input: async () => import("./RichTextInput-BuTgY6jA.mjs").then((m) => ({ default: m.default }))
|
|
150
150
|
},
|
|
151
151
|
options: {
|
|
152
152
|
advanced: [
|
|
@@ -117,7 +117,7 @@ function PresetSelect({ value, onChange, name }) {
|
|
|
117
117
|
name,
|
|
118
118
|
value: value || "",
|
|
119
119
|
onChange: (val) => {
|
|
120
|
-
onChange({ target: { name, value: val, type: "select" } });
|
|
120
|
+
onChange({ target: { name, value: String(val), type: "select" } });
|
|
121
121
|
},
|
|
122
122
|
placeholder: presets.length === 0 ? formatMessage({ id: "tiptap-editor.preset.noPresetsAvailable", defaultMessage: "No presets available" }) : formatMessage({ id: "tiptap-editor.preset.selectPreset", defaultMessage: "Select a preset" }),
|
|
123
123
|
disabled: isLoading || presets.length === 0,
|
|
@@ -147,7 +147,7 @@ const richTextField = {
|
|
|
147
147
|
},
|
|
148
148
|
icon: icons.Paragraph,
|
|
149
149
|
components: {
|
|
150
|
-
Input: async () => Promise.resolve().then(() => require("./RichTextInput-
|
|
150
|
+
Input: async () => Promise.resolve().then(() => require("./RichTextInput-D9UyIRfa.js")).then((m) => ({ default: m.default }))
|
|
151
151
|
},
|
|
152
152
|
options: {
|
|
153
153
|
advanced: [
|
package/dist/admin/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const index = require("./index-DbZOvKJG.js");
|
|
4
|
+
exports.default = index.index;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { type InputProps } from '@strapi/strapi/admin';
|
|
1
|
+
import { InputProps } from '@strapi/strapi/admin';
|
|
3
2
|
import { Editor } from '@tiptap/core';
|
|
4
3
|
import { FieldValue } from '../utils/tiptapUtils';
|
|
5
4
|
type TiptapInputProps = InputProps & {
|
|
@@ -9,5 +8,5 @@ type TiptapInputProps = InputProps & {
|
|
|
9
8
|
children?: React.ReactNode;
|
|
10
9
|
noPresetConfigured?: boolean;
|
|
11
10
|
};
|
|
12
|
-
declare const BaseTiptapInput: import(
|
|
11
|
+
declare const BaseTiptapInput: import('react').ForwardRefExoticComponent<TiptapInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
12
|
export default BaseTiptapInput;
|
|
@@ -16,6 +16,6 @@ export declare class EditorErrorBoundary extends Component<Props, State> {
|
|
|
16
16
|
static getDerivedStateFromError(error: Error): Partial<State>;
|
|
17
17
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
18
18
|
handleRetry: () => void;
|
|
19
|
-
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import(
|
|
19
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NodeViewProps } from '@tiptap/react';
|
|
2
2
|
export declare function ImageNodeView({ node, updateAttributes, deleteNode, selected, extension }: NodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ImageNodeView;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TiptapInputProps } from '../utils/tiptapUtils';
|
|
3
2
|
type RichTextInputProps = TiptapInputProps & {
|
|
4
3
|
attribute?: {
|
|
@@ -7,5 +6,5 @@ type RichTextInputProps = TiptapInputProps & {
|
|
|
7
6
|
};
|
|
8
7
|
};
|
|
9
8
|
};
|
|
10
|
-
declare const RichTextInput: import(
|
|
9
|
+
declare const RichTextInput: import('react').ForwardRefExoticComponent<RichTextInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
10
|
export default RichTextInput;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { type InputProps } from '@strapi/strapi/admin';
|
|
1
|
+
import { InputProps } from '@strapi/strapi/admin';
|
|
3
2
|
type TiptapInputProps = InputProps & {
|
|
4
3
|
labelAction?: React.ReactNode;
|
|
5
4
|
};
|
|
6
|
-
declare const TiptapInput: import(
|
|
5
|
+
declare const TiptapInput: import('react').ForwardRefExoticComponent<TiptapInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
6
|
export default TiptapInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const TiptapInputStyles: import(
|
|
2
|
+
export declare const TiptapInputStyles: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
|
-
export declare const BaseHeadingWithSEOTag: import(
|
|
3
|
-
export declare const HeadingWithSEOTag: import(
|
|
2
|
+
export declare const BaseHeadingWithSEOTag: import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any>;
|
|
3
|
+
export declare const HeadingWithSEOTag: import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any>;
|
|
4
4
|
export declare function useHeading(editor: Editor | null, props?: {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
levels?: number[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImageOptions } from '@tiptap/extension-image';
|
|
2
|
+
import { NodeViewProps, Editor } from '@tiptap/react';
|
|
2
3
|
interface StrapiImageOptions extends ImageOptions {
|
|
3
4
|
enableContentCheck: boolean;
|
|
4
5
|
}
|
|
5
|
-
import type { NodeViewProps, Editor } from '@tiptap/react';
|
|
6
6
|
export declare function ImageNodeViewReadOnly({ node }: NodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const StrapiImage: import(
|
|
7
|
+
export declare const StrapiImage: import('@tiptap/core').Node<StrapiImageOptions, any>;
|
|
8
8
|
export declare function useImage(editor: Editor | null, props?: {
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}): {
|
|
@@ -14,13 +14,13 @@ export declare const richTextField: {
|
|
|
14
14
|
readonly icon: ComponentType<any>;
|
|
15
15
|
readonly components: {
|
|
16
16
|
readonly Input: () => Promise<{
|
|
17
|
-
default: import(
|
|
17
|
+
default: import('react').ForwardRefExoticComponent<(import('../utils/tiptapUtils').TiptapInputProps & {
|
|
18
18
|
attribute?: {
|
|
19
19
|
options?: {
|
|
20
20
|
preset?: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
22
|
} | undefined;
|
|
23
|
-
}) & import(
|
|
23
|
+
}) & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
24
|
}>;
|
|
25
25
|
};
|
|
26
26
|
readonly options: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { StrapiFile } from '../components/MediaLibraryWrapper';
|
|
3
3
|
export interface MediaLibraryDialogProps {
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
onSelectAssets: (assets: StrapiFile[]) => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Extensions, JSONContent } from '@tiptap/core';
|
|
3
|
-
import {
|
|
2
|
+
import { InputProps } from '@strapi/strapi/admin';
|
|
4
3
|
export type { FieldValue } from '@strapi/strapi/admin';
|
|
5
4
|
export type TiptapInputProps = InputProps & {
|
|
6
5
|
labelAction?: React.ReactNode;
|
|
7
6
|
};
|
|
8
7
|
export declare function tiptapContent(text: string): JSONContent;
|
|
9
8
|
export declare function useTiptapEditor(name: string, defaultValue?: string, extensions?: Extensions): {
|
|
10
|
-
editor: import(
|
|
11
|
-
field: import(
|
|
9
|
+
editor: import('@tiptap/core').Editor;
|
|
10
|
+
field: import('@strapi/strapi/admin').FieldValue<any>;
|
|
12
11
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/// <reference types="koa" />
|
|
2
2
|
declare const _default: {
|
|
3
3
|
preset: ({ strapi }: {
|
|
4
|
-
strapi: import(
|
|
4
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
5
5
|
}) => {
|
|
6
|
-
find(ctx: import(
|
|
7
|
-
findOne(ctx: import(
|
|
6
|
+
find(ctx: import('koa').Context): Promise<void>;
|
|
7
|
+
findOne(ctx: import('koa').Context): Promise<void>;
|
|
8
8
|
};
|
|
9
9
|
theme: ({ strapi }: {
|
|
10
|
-
strapi: import(
|
|
10
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
11
11
|
}) => {
|
|
12
|
-
find(ctx: import(
|
|
12
|
+
find(ctx: import('koa').Context): Promise<void>;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/// <reference types="koa" />
|
|
2
2
|
declare const _default: {
|
|
3
3
|
readonly register: ({ strapi }: {
|
|
4
|
-
strapi: import(
|
|
4
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
5
5
|
}) => void;
|
|
6
6
|
readonly bootstrap: ({ strapi }: {
|
|
7
|
-
strapi: import(
|
|
7
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
8
8
|
}) => void;
|
|
9
9
|
readonly destroy: ({ strapi }: {
|
|
10
|
-
strapi: import(
|
|
10
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
11
11
|
}) => void;
|
|
12
12
|
readonly config: {
|
|
13
13
|
default: {
|
|
14
|
-
presets: Record<string, import(
|
|
14
|
+
presets: Record<string, import('../../shared/types').TiptapPresetConfig>;
|
|
15
15
|
};
|
|
16
16
|
validator(pluginConfig: unknown): void;
|
|
17
17
|
};
|
|
18
18
|
readonly controllers: {
|
|
19
19
|
preset: ({ strapi }: {
|
|
20
|
-
strapi: import(
|
|
20
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
21
21
|
}) => {
|
|
22
|
-
find(ctx: import(
|
|
23
|
-
findOne(ctx: import(
|
|
22
|
+
find(ctx: import('koa').Context): Promise<void>;
|
|
23
|
+
findOne(ctx: import('koa').Context): Promise<void>;
|
|
24
24
|
};
|
|
25
25
|
theme: ({ strapi }: {
|
|
26
|
-
strapi: import(
|
|
26
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
27
27
|
}) => {
|
|
28
|
-
find(ctx: import(
|
|
28
|
+
find(ctx: import('koa').Context): Promise<void>;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
readonly routes: {
|
|
@@ -59,18 +59,18 @@ declare const _default: {
|
|
|
59
59
|
};
|
|
60
60
|
readonly services: {
|
|
61
61
|
preset: ({ strapi }: {
|
|
62
|
-
strapi: import(
|
|
62
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
63
63
|
}) => {
|
|
64
|
-
getConfig(): import(
|
|
64
|
+
getConfig(): import('../../shared/types').TiptapPluginConfig;
|
|
65
65
|
listPresetNames(): string[];
|
|
66
|
-
getPreset(name: string): import(
|
|
66
|
+
getPreset(name: string): import('../../shared/types').TiptapPresetConfig; /**
|
|
67
67
|
* [ERROR] server/src/index.ts:19:1 - TS2742: The inferred type of 'default' cannot be named without a reference to '@strapi/core/node_modules/@strapi/types/dist/core'. This is likely not portable. A type annotation is necessary.
|
|
68
68
|
*/
|
|
69
69
|
};
|
|
70
70
|
theme: ({ strapi }: {
|
|
71
|
-
strapi: import(
|
|
71
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
72
72
|
}) => {
|
|
73
|
-
getTheme(): import(
|
|
73
|
+
getTheme(): import('../../shared/types').TiptapThemeConfig;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
readonly contentTypes: {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
preset: ({ strapi }: {
|
|
3
|
-
strapi: import(
|
|
3
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
4
4
|
}) => {
|
|
5
|
-
getConfig(): import(
|
|
5
|
+
getConfig(): import('..').TiptapPluginConfig;
|
|
6
6
|
listPresetNames(): string[];
|
|
7
|
-
getPreset(name: string): import(
|
|
7
|
+
getPreset(name: string): import('..').TiptapPresetConfig;
|
|
8
8
|
};
|
|
9
9
|
theme: ({ strapi }: {
|
|
10
|
-
strapi: import(
|
|
10
|
+
strapi: import('@strapi/types/dist/core').Strapi;
|
|
11
11
|
}) => {
|
|
12
|
-
getTheme(): import(
|
|
12
|
+
getTheme(): import('..').TiptapThemeConfig;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.
|
|
2
|
+
"version": "1.2.4",
|
|
3
3
|
"keywords": [
|
|
4
4
|
"strapi",
|
|
5
5
|
"plugin",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@strapi/design-system": "2.2.0",
|
|
44
44
|
"@strapi/icons": "2.2.0",
|
|
45
|
-
"react-intl": "
|
|
45
|
+
"react-intl": "8.1.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@strapi/sdk-plugin": "
|
|
48
|
+
"@strapi/sdk-plugin": "6.1.0",
|
|
49
49
|
"@strapi/strapi": "5.39.0",
|
|
50
50
|
"@strapi/typescript-utils": "5.39.0",
|
|
51
51
|
"@tiptap/core": "3.20.1",
|
|
@@ -67,22 +67,22 @@
|
|
|
67
67
|
"@tiptap/react": "3.20.1",
|
|
68
68
|
"@tiptap/starter-kit": "3.20.1",
|
|
69
69
|
"@types/react": "19.2.14",
|
|
70
|
-
"@types/react-dom": "
|
|
71
|
-
"prettier": "
|
|
72
|
-
"react": "
|
|
73
|
-
"react-dom": "
|
|
74
|
-
"react-router-dom": "
|
|
70
|
+
"@types/react-dom": "19.2.3",
|
|
71
|
+
"prettier": "3.8.1",
|
|
72
|
+
"react": "18.3.1",
|
|
73
|
+
"react-dom": "18.3.1",
|
|
74
|
+
"react-router-dom": "6.30.3",
|
|
75
75
|
"styled-components": "6.3.11",
|
|
76
|
-
"typescript": "
|
|
77
|
-
"vitest": "
|
|
76
|
+
"typescript": "5.9.3",
|
|
77
|
+
"vitest": "4.1.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@strapi/sdk-plugin": "
|
|
81
|
-
"@strapi/strapi": "
|
|
82
|
-
"react": "
|
|
83
|
-
"react-dom": "
|
|
84
|
-
"react-router-dom": "
|
|
85
|
-
"styled-components": "
|
|
80
|
+
"@strapi/sdk-plugin": "6.1.0",
|
|
81
|
+
"@strapi/strapi": "5.39.0",
|
|
82
|
+
"react": "18.3.1",
|
|
83
|
+
"react-dom": "18.3.1",
|
|
84
|
+
"react-router-dom": "6.30.3",
|
|
85
|
+
"styled-components": "6.3.11"
|
|
86
86
|
},
|
|
87
87
|
"strapi": {
|
|
88
88
|
"kind": "plugin",
|
package/dist/shared/fields.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RICH_TEXT_FIELD_NAME = "RichText";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PLUGIN_ID = "tiptap-editor";
|
package/dist/shared/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
-
export type LinkConfig = {
|
|
3
|
-
openOnClick?: boolean;
|
|
4
|
-
HTMLAttributes?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
export type TableConfig = {
|
|
7
|
-
resizable?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type TextAlignConfig = {
|
|
10
|
-
types?: string[];
|
|
11
|
-
alignments?: Array<'left' | 'center' | 'right' | 'justify'>;
|
|
12
|
-
};
|
|
13
|
-
export type HeadingConfig = {
|
|
14
|
-
levels?: HeadingLevel[];
|
|
15
|
-
};
|
|
16
|
-
export type ThemeColorEntry = {
|
|
17
|
-
label: string;
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
type ThemeStyleSource = {
|
|
21
|
-
/** A browser-fetchable URL for an external stylesheet */
|
|
22
|
-
stylesheet?: string;
|
|
23
|
-
css?: never;
|
|
24
|
-
} | {
|
|
25
|
-
stylesheet?: never;
|
|
26
|
-
/** Inline CSS content to inject via a <style> tag */
|
|
27
|
-
css?: string;
|
|
28
|
-
};
|
|
29
|
-
export type TiptapThemeConfig = {
|
|
30
|
-
colors?: ThemeColorEntry[];
|
|
31
|
-
} & ThemeStyleSource;
|
|
32
|
-
export interface TiptapPresetConfig {
|
|
33
|
-
bold?: boolean | Record<string, unknown>;
|
|
34
|
-
italic?: boolean | Record<string, unknown>;
|
|
35
|
-
strike?: boolean | Record<string, unknown>;
|
|
36
|
-
underline?: boolean | Record<string, unknown>;
|
|
37
|
-
code?: boolean | Record<string, unknown>;
|
|
38
|
-
codeBlock?: boolean | Record<string, unknown>;
|
|
39
|
-
blockquote?: boolean | Record<string, unknown>;
|
|
40
|
-
bulletList?: boolean | Record<string, unknown>;
|
|
41
|
-
orderedList?: boolean | Record<string, unknown>;
|
|
42
|
-
hardBreak?: boolean | Record<string, unknown>;
|
|
43
|
-
horizontalRule?: boolean | Record<string, unknown>;
|
|
44
|
-
history?: boolean | Record<string, unknown>;
|
|
45
|
-
heading?: boolean | HeadingConfig;
|
|
46
|
-
link?: boolean | LinkConfig;
|
|
47
|
-
table?: boolean | TableConfig;
|
|
48
|
-
textAlign?: boolean | TextAlignConfig;
|
|
49
|
-
superscript?: boolean | Record<string, unknown>;
|
|
50
|
-
subscript?: boolean | Record<string, unknown>;
|
|
51
|
-
textColor?: boolean;
|
|
52
|
-
highlightColor?: boolean;
|
|
53
|
-
mediaLibrary?: boolean | Record<string, unknown>;
|
|
54
|
-
}
|
|
55
|
-
export interface TiptapPluginConfig {
|
|
56
|
-
presets: Record<string, TiptapPresetConfig>;
|
|
57
|
-
theme?: TiptapThemeConfig;
|
|
58
|
-
}
|
|
59
|
-
export declare const PRESET_FEATURE_KEYS: Array<keyof TiptapPresetConfig>;
|
|
60
|
-
export declare const MINIMAL_PRESET_CONFIG: TiptapPresetConfig;
|
|
61
|
-
/**
|
|
62
|
-
* Returns true when a preset feature value is enabled.
|
|
63
|
-
* undefined (absent key) returns false — a preset defines what's ON, everything else is OFF.
|
|
64
|
-
*/
|
|
65
|
-
export declare const isFeatureEnabled: (value: TiptapPresetConfig[keyof TiptapPresetConfig]) => boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Returns the effective options for a feature.
|
|
68
|
-
* - false → null (feature explicitly disabled, no options)
|
|
69
|
-
* - true | undefined → defaults (feature enabled with default options)
|
|
70
|
-
* - object → merged with defaults (feature enabled with custom options)
|
|
71
|
-
*
|
|
72
|
-
* NOTE: false returns null — DIVERGES from dist where false returns defaults.
|
|
73
|
-
*/
|
|
74
|
-
export declare const getFeatureOptions: <T extends Record<string, unknown>>(value: boolean | T | undefined, defaults: T) => T | null;
|
|
75
|
-
export {};
|
|
File without changes
|
|
File without changes
|