diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts index 4f11a03d..40c3d680 100644 --- a/apps/web/next-env.d.ts +++ b/apps/web/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/package.json b/package.json index 29991274..821ed450 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "turbo build", "build-packages": "turbo build --filter=@manifest-editor/* --filter=manifest-editor", - "dev": "turbo dev", + "dev": "turbo dev --filter=web... --concurrency 15", "lint": "turbo lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "mismatch": "syncpack list-mismatches", diff --git a/packages/components/src/ManifestOverviewEmptyState.tsx b/packages/components/src/ManifestOverviewEmptyState.tsx index 49a0af30..c0826e24 100644 --- a/packages/components/src/ManifestOverviewEmptyState.tsx +++ b/packages/components/src/ManifestOverviewEmptyState.tsx @@ -9,10 +9,10 @@ export function ManifestOverviewEmptyState({ onCreate, canCreate }: { onCreate: onClick={canCreate ? onCreate : undefined} className="border-2 border-dotted bg-black/5 aspect-[3/4] rounded w-32 border-black" /> -
Good to go!
-
- Add a title and top level information for this manifest using the editing panel, and then add some canvases and - content. +
Let's get started!
+
+ Add a title and top level information for this manifest using the editing panel on the right, and then add some + canvases and content.
{canCreate ? ( + + + ); +} diff --git a/packages/creators/src/Annotation/CaptionedImageAnnotation/index.tsx b/packages/creators/src/Annotation/CaptionedImageAnnotation/index.tsx new file mode 100644 index 00000000..09a94ccb --- /dev/null +++ b/packages/creators/src/Annotation/CaptionedImageAnnotation/index.tsx @@ -0,0 +1,25 @@ +import { AddImageIcon, HTMLIcon } from "@manifest-editor/components"; +import type { CreatorDefinition } from "@manifest-editor/creator-api"; +import { CreateCaptionedImageAnnotation, createCaptionedImageAnnotation } from "./create-captioned-image-annotation"; + +export const captionedImageAnnotation: CreatorDefinition = { + id: "@manifest-editor/captioned-image-annotation", + create: createCaptionedImageAnnotation, + label: "Captioned image", + summary: "Add an image from a URL with caption", + icon: , + render(ctx) { + return ; + }, + resourceType: "Annotation", + resourceFields: ["id", "type", "motivation", "body", "target"], + additionalTypes: ["Canvas"], + supports: { + initialData: true, + parentTypes: ["AnnotationPage"], + parentFields: ["items"], + }, + staticFields: { + type: "Annotation", + }, +}; diff --git a/packages/creators/src/index.ts b/packages/creators/src/index.ts index b6494cd2..b92754fb 100644 --- a/packages/creators/src/index.ts +++ b/packages/creators/src/index.ts @@ -1,19 +1,20 @@ -import { emptyCanvas } from "./Canvas/EmptyCanvas"; -import { plaintextCreator } from "./ContentResource/PlaintextCreator"; -import { webPageCreator } from "./ContentResource/WebPageCreator"; -import { htmlBodyCreator } from "./ContentResource/HTMLBodyCreator"; +import { audioAnnotation } from "./Annotation/AudioAnnotation"; +import { captionedImageAnnotation } from "./Annotation/CaptionedImageAnnotation"; import { htmlAnnotation } from "./Annotation/HTMLAnnotation"; -import { emptyAnnotationPage } from "./AnnotationPage/EmptyAnnotationPage"; -import { youTubeBodyCreator } from "./ContentResource/YouTubeCreator"; -import { imageUrlCreator } from "./ContentResource/ImageUrlCreator"; -import { imageServiceCreator } from "./ContentResource/ImageServiceCreator"; import { imageServiceAnnotation } from "./Annotation/ImageServiceAnnotation"; -import { noBodyAnnotation } from "./Annotation/NoBodyAnnotation"; -import { iiifBrowserCreator } from "./ContentResource/IIIFBrowserCreator"; -import { internalCanvas } from "./Canvas/InternalCanvas"; import { imageUrlAnnotation } from "./Annotation/ImageUrlAnnotation"; -import { audioAnnotation } from "./Annotation/AudioAnnotation"; +import { noBodyAnnotation } from "./Annotation/NoBodyAnnotation"; import { videoAnnotation } from "./Annotation/VideoAnnotation"; +import { emptyAnnotationPage } from "./AnnotationPage/EmptyAnnotationPage"; +import { emptyCanvas } from "./Canvas/EmptyCanvas"; +import { internalCanvas } from "./Canvas/InternalCanvas"; +import { htmlBodyCreator } from "./ContentResource/HTMLBodyCreator"; +import { iiifBrowserCreator } from "./ContentResource/IIIFBrowserCreator"; +import { imageServiceCreator } from "./ContentResource/ImageServiceCreator"; +import { imageUrlCreator } from "./ContentResource/ImageUrlCreator"; +import { plaintextCreator } from "./ContentResource/PlaintextCreator"; +import { webPageCreator } from "./ContentResource/WebPageCreator"; +import { youTubeBodyCreator } from "./ContentResource/YouTubeCreator"; import { manifestBrowserCreator } from "./Manifest/ManifestBrowserCreator"; export const allCreators = [ @@ -34,6 +35,7 @@ export const allCreators = [ emptyAnnotationPage, noBodyAnnotation, internalCanvas, + captionedImageAnnotation, ]; export { @@ -53,6 +55,7 @@ export { imageUrlAnnotation, audioAnnotation, videoAnnotation, + captionedImageAnnotation, // Not included manifestBrowserCreator, }; diff --git a/packages/editors/src/components/RichTextLanguageField/RichTextLanguageField.tsx b/packages/editors/src/components/RichTextLanguageField/RichTextLanguageField.tsx index 6e524762..a3255e66 100644 --- a/packages/editors/src/components/RichTextLanguageField/RichTextLanguageField.tsx +++ b/packages/editors/src/components/RichTextLanguageField/RichTextLanguageField.tsx @@ -54,7 +54,7 @@ const decorator = new CompositeDecorator([ ]); export function RichTextLanguageField(props: RichTextLanguageField) { - const isHtml = props.value[0] === "<"; + const isHtml = (props.value || [])[0] === "<"; const editorRef = useRef(null); const [htmlMode, setHtmlMode] = useState(isHtml); const [focus, _setIsFocused] = useState(false); diff --git a/packages/editors/src/definitions/HTMLBodyEditor/HTMLEditor.tsx b/packages/editors/src/definitions/HTMLBodyEditor/HTMLEditor.tsx index fbfb163b..9d829c67 100644 --- a/packages/editors/src/definitions/HTMLBodyEditor/HTMLEditor.tsx +++ b/packages/editors/src/definitions/HTMLBodyEditor/HTMLEditor.tsx @@ -1,4 +1,4 @@ -import { Reference } from "@iiif/presentation-3"; +import type { Reference } from "@iiif/presentation-3"; import { useConfig, useEditor, useGenericEditor } from "@manifest-editor/shell"; import { PaddedSidebarContainer } from "@manifest-editor/ui/atoms/PaddedSidebarContainer"; import { InputContainer, InputLabel } from "../../components/Input"; @@ -13,7 +13,7 @@ export function HTMLEditor() { return ( {body.map((item) => ( - + ))} ); @@ -25,7 +25,13 @@ function HTMLEditorItem({ item }: { item: Reference }) { const { textGranularity } = editor.extensions; const { language, value } = editor.descriptive; - const { motivation } = editor.technical; + const { motivation, mediaType } = editor.technical; + + const mt = mediaType.get(); + + if (mt === "Image") { + return ; + } return ( <> @@ -41,7 +47,7 @@ function HTMLEditorItem({ item }: { item: Reference }) { /> - {motivation.get() !== "painting" ? ( + {i18n.textGranularityEnabled && motivation.get() !== "painting" ? ( Advanced Language Mode + + + + + Enable text granularity +