mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 02:32:00 +10:00
Compare commits
1 Commits
feat/add-c
...
feat/add-f
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a334e95d4 |
@ -5,7 +5,7 @@ import { msg } from '@lingui/core/macro';
|
|||||||
import { Trans, useLingui } from '@lingui/react/macro';
|
import { Trans, useLingui } from '@lingui/react/macro';
|
||||||
import { FieldType, RecipientRole } from '@prisma/client';
|
import { FieldType, RecipientRole } from '@prisma/client';
|
||||||
import { FileTextIcon } from 'lucide-react';
|
import { FileTextIcon } from 'lucide-react';
|
||||||
import { Link } from 'react-router';
|
import { Link, useSearchParams } from 'react-router';
|
||||||
import { isDeepEqual } from 'remeda';
|
import { isDeepEqual } from 'remeda';
|
||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
@ -65,6 +65,8 @@ const FieldSettingsTypeTranslations: Record<FieldType, MessageDescriptor> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const EnvelopeEditorFieldsPage = () => {
|
export const EnvelopeEditorFieldsPage = () => {
|
||||||
|
const [searchParams] = useSearchParams();
|
||||||
|
|
||||||
const { envelope, editorFields, relativePath } = useCurrentEnvelopeEditor();
|
const { envelope, editorFields, relativePath } = useCurrentEnvelopeEditor();
|
||||||
|
|
||||||
const { currentEnvelopeItem } = useCurrentEnvelopeRender();
|
const { currentEnvelopeItem } = useCurrentEnvelopeRender();
|
||||||
@ -208,6 +210,37 @@ export const EnvelopeEditorFieldsPage = () => {
|
|||||||
<section>
|
<section>
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
|
|
||||||
|
{searchParams.get('devmode') && (
|
||||||
|
<>
|
||||||
|
<div className="px-4">
|
||||||
|
<h3 className="text-foreground mb-3 text-sm font-semibold">
|
||||||
|
<Trans>Developer Mode</Trans>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div className="bg-muted/50 border-border text-foreground space-y-2 rounded-md border p-3 text-sm">
|
||||||
|
<p>
|
||||||
|
<span className="text-muted-foreground min-w-12">Pos X: </span>
|
||||||
|
{selectedField.positionX.toFixed(2)}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="text-muted-foreground min-w-12">Pos Y: </span>
|
||||||
|
{selectedField.positionY.toFixed(2)}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="text-muted-foreground min-w-12">Width: </span>
|
||||||
|
{selectedField.width.toFixed(2)}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="text-muted-foreground min-w-12">Height: </span>
|
||||||
|
{selectedField.height.toFixed(2)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Separator className="my-4" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="[&_label]:text-foreground/70 px-4 [&_label]:text-xs">
|
<div className="[&_label]:text-foreground/70 px-4 [&_label]:text-xs">
|
||||||
<h3 className="text-sm font-semibold">
|
<h3 className="text-sm font-semibold">
|
||||||
{t(FieldSettingsTypeTranslations[selectedField.type])}
|
{t(FieldSettingsTypeTranslations[selectedField.type])}
|
||||||
|
|||||||
@ -1,16 +1,6 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export const SUPPORTED_LANGUAGE_CODES = [
|
export const SUPPORTED_LANGUAGE_CODES = ['de', 'en', 'fr', 'es', 'it', 'pl'] as const;
|
||||||
'de',
|
|
||||||
'en',
|
|
||||||
'fr',
|
|
||||||
'es',
|
|
||||||
'it',
|
|
||||||
'pl',
|
|
||||||
'ja',
|
|
||||||
'ko',
|
|
||||||
'zh',
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
|
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
|
||||||
|
|
||||||
@ -64,18 +54,6 @@ export const SUPPORTED_LANGUAGES: Record<string, SupportedLanguage> = {
|
|||||||
short: 'pl',
|
short: 'pl',
|
||||||
full: 'Polish',
|
full: 'Polish',
|
||||||
},
|
},
|
||||||
ja: {
|
|
||||||
short: 'ja',
|
|
||||||
full: 'Japanese',
|
|
||||||
},
|
|
||||||
ko: {
|
|
||||||
short: 'ko',
|
|
||||||
full: 'Korean',
|
|
||||||
},
|
|
||||||
zh: {
|
|
||||||
short: 'zh',
|
|
||||||
full: 'Chinese',
|
|
||||||
},
|
|
||||||
} satisfies Record<SupportedLanguageCodes, SupportedLanguage>;
|
} satisfies Record<SupportedLanguageCodes, SupportedLanguage>;
|
||||||
|
|
||||||
export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes =>
|
export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes =>
|
||||||
|
|||||||
Reference in New Issue
Block a user