@alpaca-editor/core 1.0.3992 → 1.0.3993
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/config/config.js +0 -12
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +6 -3
- package/dist/editor/ContentTree.d.ts +2 -1
- package/dist/editor/ContentTree.js +2 -2
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ItemInfo.js +1 -1
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -25
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditor.d.ts +2 -2
- package/dist/editor/field-types/RichTextEditor.js +15 -2
- package/dist/editor/field-types/RichTextEditor.js.map +1 -1
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +5 -5
- package/dist/editor/field-types/RichTextEditorComponent.js +40 -51
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +7 -5
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/field-types/richtext/components/EditorDropdown.d.ts +11 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js +96 -0
- package/dist/editor/field-types/richtext/components/EditorDropdown.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.d.ts +5 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js +558 -0
- package/dist/editor/field-types/richtext/components/ReactSlate.js.map +1 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.d.ts +3 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js +13 -0
- package/dist/editor/field-types/richtext/components/ToolbarButton.js.map +1 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.d.ts +17 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js +14 -0
- package/dist/editor/field-types/richtext/config/pluginFactory.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.d.ts +68 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js +208 -0
- package/dist/editor/field-types/richtext/hooks/useProfileCache.js.map +1 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.d.ts +25 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js +64 -0
- package/dist/editor/field-types/richtext/hooks/useRichTextProfile.js.map +1 -0
- package/dist/editor/field-types/richtext/index.d.ts +5 -0
- package/dist/editor/field-types/richtext/index.js +6 -0
- package/dist/editor/field-types/richtext/index.js.map +1 -0
- package/dist/editor/field-types/richtext/types.d.ts +139 -0
- package/dist/editor/field-types/richtext/types.js +107 -0
- package/dist/editor/field-types/richtext/types.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/conversion.d.ts +5 -0
- package/dist/editor/field-types/richtext/utils/conversion.js +539 -0
- package/dist/editor/field-types/richtext/utils/conversion.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/plugins.d.ts +97 -0
- package/dist/editor/field-types/richtext/utils/plugins.js +272 -0
- package/dist/editor/field-types/richtext/utils/plugins.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.d.ts +38 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js +366 -0
- package/dist/editor/field-types/richtext/utils/profileMapper.js.map +1 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.d.ts +37 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js +117 -0
- package/dist/editor/field-types/richtext/utils/profileServiceCache.js.map +1 -0
- package/dist/editor/services/contentService.d.ts +8 -0
- package/dist/editor/services/contentService.js +3 -0
- package/dist/editor/services/contentService.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +7 -1
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/ui/PerfectTree.d.ts +4 -2
- package/dist/editor/ui/PerfectTree.js +16 -7
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/utils/itemutils.js +3 -1
- package/dist/editor/utils/itemutils.js.map +1 -1
- package/dist/editor/views/ItemEditor.js +10 -3
- package/dist/editor/views/ItemEditor.js.map +1 -1
- package/dist/page-wizard/steps/ContentStep.js +1 -3
- package/dist/page-wizard/steps/ContentStep.js.map +1 -1
- package/dist/page-wizard/steps/usePageCreator.js +1 -1
- package/dist/page-wizard/steps/usePageCreator.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +9 -0
- package/package.json +4 -1
- package/src/config/config.tsx +0 -12
- package/src/config/types.ts +6 -3
- package/src/editor/ContentTree.tsx +3 -0
- package/src/editor/ItemInfo.tsx +2 -2
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +73 -69
- package/src/editor/field-types/RichTextEditor.tsx +31 -3
- package/src/editor/field-types/RichTextEditorComponent.tsx +52 -69
- package/src/editor/field-types/TreeListEditor.tsx +7 -7
- package/src/editor/field-types/richtext/components/EditorDropdown.tsx +180 -0
- package/src/editor/field-types/richtext/components/ReactSlate.css +163 -0
- package/src/editor/field-types/richtext/components/ReactSlate.tsx +792 -0
- package/src/editor/field-types/richtext/components/ToolbarButton.tsx +23 -0
- package/src/editor/field-types/richtext/config/pluginFactory.tsx +22 -0
- package/src/editor/field-types/richtext/hooks/useProfileCache.ts +270 -0
- package/src/editor/field-types/richtext/hooks/useRichTextProfile.ts +94 -0
- package/src/editor/field-types/richtext/index.ts +5 -0
- package/src/editor/field-types/richtext/types.ts +269 -0
- package/src/editor/field-types/richtext/utils/conversion.ts +589 -0
- package/src/editor/field-types/richtext/utils/plugins.ts +346 -0
- package/src/editor/field-types/richtext/utils/profileMapper.ts +424 -0
- package/src/editor/field-types/richtext/utils/profileServiceCache.ts +154 -0
- package/src/editor/services/contentService.ts +12 -0
- package/src/editor/sidebar/ComponentTree.tsx +12 -1
- package/src/editor/ui/PerfectTree.tsx +19 -6
- package/src/editor/utils/{itemutils.ts → itemutils.tsx} +12 -12
- package/src/editor/views/ItemEditor.tsx +22 -1
- package/src/page-wizard/steps/ContentStep.tsx +1 -3
- package/src/page-wizard/steps/usePageCreator.ts +1 -0
- package/src/revision.ts +2 -2
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { getCreateAndSwitchToNewVersionCommand } from "../commands/createVersionCommand";
|
|
2
2
|
import { Language } from "../pageModel";
|
|
3
3
|
import { EditContextType } from "../client/editContext";
|
|
4
|
+
import { TriangleAlert } from "lucide-react";
|
|
4
5
|
|
|
5
6
|
export const confirmCreateVersion = (
|
|
6
7
|
editContext: EditContextType,
|
|
7
|
-
language: Language
|
|
8
|
+
language: Language,
|
|
8
9
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
editContext.confirm({
|
|
11
|
+
message:
|
|
12
|
+
"This page has no version in language " +
|
|
13
|
+
language.name +
|
|
14
|
+
" (" +
|
|
15
|
+
language.languageCode +
|
|
16
|
+
"). Do you want to create a new version?",
|
|
17
|
+
header: "Create Language Version?",
|
|
18
|
+
icon: <TriangleAlert strokeWidth={1} className="h-4 w-4" />,
|
|
18
19
|
acceptLabel: "Yes, create version",
|
|
19
20
|
rejectLabel: "No",
|
|
20
21
|
accept: async () => {
|
|
@@ -23,7 +24,6 @@ export const confirmCreateVersion = (
|
|
|
23
24
|
language: language.languageCode,
|
|
24
25
|
}),
|
|
25
26
|
});
|
|
26
|
-
},
|
|
27
27
|
},
|
|
28
|
-
);
|
|
28
|
+
});
|
|
29
29
|
};
|
|
@@ -5,6 +5,7 @@ import { ItemInfo } from "../ItemInfo";
|
|
|
5
5
|
import { useEditContext } from "../client/editContext";
|
|
6
6
|
import { PageViewContext } from "../page-viewer/pageViewContext";
|
|
7
7
|
import { FullItem } from "../pageModel";
|
|
8
|
+
import { LanguageSelector } from "../menubar/LanguageSelector";
|
|
8
9
|
|
|
9
10
|
export function ItemEditor({
|
|
10
11
|
item,
|
|
@@ -43,7 +44,7 @@ export function ItemEditor({
|
|
|
43
44
|
)}
|
|
44
45
|
|
|
45
46
|
{editContext.itemVersions.length === 0 && (
|
|
46
|
-
<div className="flex
|
|
47
|
+
<div className="flex flex-col items-center gap-4 p-4">
|
|
47
48
|
<Button
|
|
48
49
|
onClick={async () => {
|
|
49
50
|
await editContext.operations.createVersion(item.descriptor);
|
|
@@ -51,6 +52,26 @@ export function ItemEditor({
|
|
|
51
52
|
>
|
|
52
53
|
Create First Version ({item.language})
|
|
53
54
|
</Button>
|
|
55
|
+
|
|
56
|
+
{/* Show LanguageSelector if other languages are available */}
|
|
57
|
+
{editContext.itemLanguages.length > 1 && (
|
|
58
|
+
<div className="flex flex-col items-center gap-2">
|
|
59
|
+
<div className="text-sm text-gray-600">
|
|
60
|
+
Or select a different language:
|
|
61
|
+
</div>
|
|
62
|
+
<LanguageSelector
|
|
63
|
+
selectedLanguage={item.language}
|
|
64
|
+
onLanguageSelected={(language) => {
|
|
65
|
+
editContext.loadItem({
|
|
66
|
+
id: item.descriptor.id,
|
|
67
|
+
language: language.languageCode,
|
|
68
|
+
version: 0,
|
|
69
|
+
});
|
|
70
|
+
}}
|
|
71
|
+
showAllLanguagesSwitch={false}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
54
75
|
</div>
|
|
55
76
|
)}
|
|
56
77
|
</div>
|
|
@@ -472,7 +472,6 @@ export function ContentStep({
|
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
console.log("Wiping components 2");
|
|
476
475
|
editContextRef.current?.itemsRepository.clear();
|
|
477
476
|
modifiedFieldsContext?.clear();
|
|
478
477
|
setInternalState((prev: any) => ({
|
|
@@ -488,10 +487,9 @@ export function ContentStep({
|
|
|
488
487
|
|
|
489
488
|
pageLoadedRef.current = false;
|
|
490
489
|
|
|
491
|
-
console.log("Wiping components 3");
|
|
492
490
|
editContextRef.current?.requestRefresh("immediate");
|
|
493
491
|
await waitForPageLoaded();
|
|
494
|
-
console.log("
|
|
492
|
+
console.log("Page loaded after wipe");
|
|
495
493
|
}
|
|
496
494
|
|
|
497
495
|
// Parse schema if it's a string
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-07-10
|
|
1
|
+
export const version = "1.0.3993";
|
|
2
|
+
export const buildDate = "2025-07-10 17:18:33";
|