@alpaca-editor/core 1.0.4045 → 1.0.4047
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/editor/field-types/RichTextEditorComponent.js +3 -10
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/richtext/components/ReactSlate.js +297 -342
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleRichTextEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js +9 -9
- package/dist/editor/field-types/richtext/components/SimpleToolbar.js.map +1 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +7 -6
- package/dist/editor/field-types/richtext/config/pluginFactory.js +2 -1
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +24 -18
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -1
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +1 -1
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -1
- package/dist/editor/field-types/richtext/types.d.ts +236 -90
- package/dist/editor/field-types/richtext/types.js +3 -3
- package/dist/editor/field-types/richtext/types.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/conversion.d.ts +4 -2
- package/dist/editor/field-types/richtext/utils/conversion.js +79 -12
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/plugins.d.ts +66 -39
- package/dist/editor/field-types/richtext/utils/plugins.js +377 -233
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -1
- package/dist/editor/field-types/richtext/utils/profileMapper.js +22 -2
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/package.json +1 -1
- package/src/editor/field-types/RichTextEditorComponent.tsx +4 -10
- package/src/editor/field-types/richtext/components/ReactSlate.css +85 -24
- package/src/editor/field-types/richtext/components/ReactSlate.tsx +372 -427
- package/src/editor/field-types/richtext/components/SimpleRichTextEditor.tsx +4 -2
- package/src/editor/field-types/richtext/components/SimpleToolbar.tsx +3 -3
- package/src/editor/field-types/richtext/config/pluginFactory.tsx +2 -1
- package/src/editor/field-types/richtext/hooks/useProfileCache.ts +25 -19
- package/src/editor/field-types/richtext/hooks/useRichTextProfile.ts +1 -1
- package/src/editor/field-types/richtext/types.ts +150 -112
- package/src/editor/field-types/richtext/utils/conversion.ts +100 -27
- package/src/editor/field-types/richtext/utils/plugins.ts +469 -268
- package/src/editor/field-types/richtext/utils/profileMapper.ts +26 -3
- package/src/revision.ts +2 -2
|
@@ -4,7 +4,7 @@ import { useEditContextRef, } from "../client/editContext";
|
|
|
4
4
|
import { useFieldModification } from "../client/fieldModificationStore";
|
|
5
5
|
import { useThrottledCallback } from "use-debounce";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { ReactSlate } from "./richtext";
|
|
8
8
|
// Minimal fallback profile for when profile is null or undefined
|
|
9
9
|
const FALLBACK_PROFILE = {
|
|
10
10
|
toolbar: {
|
|
@@ -16,13 +16,6 @@ const FALLBACK_PROFILE = {
|
|
|
16
16
|
showIconsOnly: true,
|
|
17
17
|
options: [],
|
|
18
18
|
},
|
|
19
|
-
{
|
|
20
|
-
id: "basic-format",
|
|
21
|
-
label: "",
|
|
22
|
-
display: "dropdown",
|
|
23
|
-
showIconsOnly: false,
|
|
24
|
-
options: [{ type: "block", id: "no-tag" }],
|
|
25
|
-
},
|
|
26
19
|
],
|
|
27
20
|
},
|
|
28
21
|
};
|
|
@@ -75,7 +68,7 @@ export function RichTextEditorComponent({ field, readOnly, profile, updateFieldV
|
|
|
75
68
|
// Use the profile directly or fall back to the minimal profile
|
|
76
69
|
const editorProfile = profile ?? FALLBACK_PROFILE;
|
|
77
70
|
// const editorProfile = getDebugProfile(); // Debug profile with all options
|
|
78
|
-
//
|
|
79
|
-
return (_jsx("div", { ref: editorRef, children: _jsx(
|
|
71
|
+
//console.log(editorProfile);
|
|
72
|
+
return (_jsx("div", { ref: editorRef, children: _jsx(ReactSlate, { value: value, onChange: handleChange, onFocus: () => setFocused(true), onBlur: () => setFocused(false), readOnly: readOnly, placeholder: "Enter text here...", profile: editorProfile }) }));
|
|
80
73
|
}
|
|
81
74
|
//# sourceMappingURL=RichTextEditorComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorComponent.js","sourceRoot":"","sources":["../../../src/editor/field-types/RichTextEditorComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RichTextEditorComponent.js","sourceRoot":"","sources":["../../../src/editor/field-types/RichTextEditorComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAW,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,iEAAiE;AACjE,MAAM,gBAAgB,GAA0B;IAC9C,OAAO,EAAE;QACP,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,kBAAkB;gBACtB,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,SA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