payload-intl 1.2.1 → 1.2.3
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/LICENSE +21 -0
- package/dist/components/MessageFormField.d.ts +15 -0
- package/dist/components/MessageFormField.d.ts.map +1 -0
- package/dist/components/{MessageController.js → MessageFormField.js} +5 -3
- package/dist/components/MessageFormField.js.map +1 -0
- package/dist/components/MessagesForm.d.ts +3 -1
- package/dist/components/MessagesForm.d.ts.map +1 -1
- package/dist/components/MessagesForm.js +25 -36
- package/dist/components/MessagesForm.js.map +1 -1
- package/dist/components/{MessageFormContext.d.ts → MessagesFormProvider.d.ts} +6 -2
- package/dist/components/MessagesFormProvider.d.ts.map +1 -0
- package/dist/components/{MessageFormContext.js → MessagesFormProvider.js} +8 -4
- package/dist/components/MessagesFormProvider.js.map +1 -0
- package/dist/components/MessagesLink.js +5 -2
- package/dist/components/MessagesLink.js.map +1 -1
- package/dist/components/MessagesView.d.ts +1 -1
- package/dist/components/MessagesView.d.ts.map +1 -1
- package/dist/components/MessagesView.js +13 -4
- package/dist/components/MessagesView.js.map +1 -1
- package/dist/components/actions/CopyMessages.d.ts +2 -0
- package/dist/components/actions/CopyMessages.d.ts.map +1 -0
- package/dist/components/actions/{Move.js → CopyMessages.js} +6 -6
- package/dist/components/actions/CopyMessages.js.map +1 -0
- package/dist/components/actions/JsonImport.d.ts +4 -1
- package/dist/components/actions/JsonImport.d.ts.map +1 -1
- package/dist/components/actions/JsonImport.js +7 -25
- package/dist/components/actions/JsonImport.js.map +1 -1
- package/dist/components/hooks/useHtmlLexicalAdapter.d.ts +12 -0
- package/dist/components/hooks/useHtmlLexicalAdapter.d.ts.map +1 -0
- package/dist/components/hooks/useHtmlLexicalAdapter.js +63 -0
- package/dist/components/hooks/useHtmlLexicalAdapter.js.map +1 -0
- package/dist/components/hooks/useMessagesFormSubmit.d.ts +11 -0
- package/dist/components/hooks/useMessagesFormSubmit.d.ts.map +1 -0
- package/dist/components/hooks/useMessagesFormSubmit.js +44 -0
- package/dist/components/hooks/useMessagesFormSubmit.js.map +1 -0
- package/dist/components/inputs/FieldWrapper.d.ts +9 -0
- package/dist/components/inputs/FieldWrapper.d.ts.map +1 -0
- package/dist/components/inputs/FieldWrapper.js +24 -0
- package/dist/components/inputs/FieldWrapper.js.map +1 -0
- package/dist/components/inputs/{InputWrapper.module.css → FieldWrapper.module.css} +2 -12
- package/dist/components/inputs/LexicalInput.d.ts +2 -13
- package/dist/components/inputs/LexicalInput.d.ts.map +1 -1
- package/dist/components/inputs/LexicalInput.js +4 -63
- package/dist/components/inputs/LexicalInput.js.map +1 -1
- package/dist/components/inputs/MessageInput.d.ts +6 -3
- package/dist/components/inputs/MessageInput.d.ts.map +1 -1
- package/dist/components/inputs/MessageInput.js +47 -43
- package/dist/components/inputs/MessageInput.js.map +1 -1
- package/dist/components/inputs/MessageInput.module.css +23 -4
- package/dist/components/inputs/ReferencePopover.d.ts +7 -0
- package/dist/components/inputs/ReferencePopover.d.ts.map +1 -0
- package/dist/components/inputs/ReferencePopover.js +42 -0
- package/dist/components/inputs/ReferencePopover.js.map +1 -0
- package/dist/components/inputs/ReferencePopover.module.css +70 -0
- package/dist/components/inputs/SingleLinePlugin.d.ts +2 -0
- package/dist/components/inputs/SingleLinePlugin.d.ts.map +1 -0
- package/dist/components/inputs/SingleLinePlugin.js +24 -0
- package/dist/components/inputs/SingleLinePlugin.js.map +1 -0
- package/dist/components/inputs/variables/VariableChip.d.ts.map +1 -1
- package/dist/components/inputs/variables/VariableChip.js +31 -32
- package/dist/components/inputs/variables/VariableChip.js.map +1 -1
- package/dist/components/inputs/variables/VariableChip.module.css +3 -3
- package/dist/components/inputs/variables/VariableSuggestion.d.ts +4 -0
- package/dist/components/inputs/variables/VariableSuggestion.d.ts.map +1 -0
- package/dist/components/inputs/variables/VariableSuggestion.js +24 -0
- package/dist/components/inputs/variables/VariableSuggestion.js.map +1 -0
- package/dist/components/inputs/variables/editors/PluralVariableEditor.d.ts.map +1 -1
- package/dist/components/inputs/variables/editors/PluralVariableEditor.js +62 -60
- package/dist/components/inputs/variables/editors/PluralVariableEditor.js.map +1 -1
- package/dist/components/inputs/variables/editors/PluralVariableEditor.module.css +4 -4
- package/dist/components/inputs/variables/editors/TemporalVariableEditor.d.ts +11 -0
- package/dist/components/inputs/variables/editors/TemporalVariableEditor.d.ts.map +1 -0
- package/dist/components/inputs/variables/editors/{DateVariableEditor.js → TemporalVariableEditor.js} +3 -3
- package/dist/components/inputs/variables/editors/TemporalVariableEditor.js.map +1 -0
- package/dist/components/inputs/variables/pickers/NumericVariableEditor.d.ts +7 -0
- package/dist/components/inputs/variables/pickers/{NumericVariablePicker.d.ts.map → NumericVariableEditor.d.ts.map} +1 -1
- package/dist/components/inputs/variables/pickers/{NumericVariablePicker.js → NumericVariableEditor.js} +15 -9
- package/dist/components/inputs/variables/pickers/NumericVariableEditor.js.map +1 -0
- package/dist/components/inputs/variables/pickers/{NumericVariablePicker.module.css → NumericVariableEditor.module.css} +3 -3
- package/dist/components/inputs/variables/pickers/TemporalVariablePicker.d.ts +7 -0
- package/dist/components/inputs/variables/pickers/TemporalVariablePicker.d.ts.map +1 -0
- package/dist/components/inputs/variables/pickers/TemporalVariablePicker.js +57 -0
- package/dist/components/inputs/variables/pickers/TemporalVariablePicker.js.map +1 -0
- package/dist/components/inputs/variables/pickers/{TemporalElementEditor.module.css → TemporalVariablePicker.module.css} +3 -3
- package/dist/components/layout/GroupStatusDot.d.ts +6 -0
- package/dist/components/layout/GroupStatusDot.d.ts.map +1 -0
- package/dist/components/layout/GroupStatusDot.js +24 -0
- package/dist/components/layout/GroupStatusDot.js.map +1 -0
- package/dist/components/layout/MessageField.d.ts +2 -1
- package/dist/components/layout/MessageField.d.ts.map +1 -1
- package/dist/components/layout/MessageField.js +52 -33
- package/dist/components/layout/MessageField.js.map +1 -1
- package/dist/components/layout/MessageField.module.css +21 -10
- package/dist/components/layout/MessagesTabs.d.ts.map +1 -1
- package/dist/components/layout/MessagesTabs.js +3 -5
- package/dist/components/layout/MessagesTabs.js.map +1 -1
- package/dist/components/layout/MessagesTree.d.ts +1 -1
- package/dist/components/layout/MessagesTree.d.ts.map +1 -1
- package/dist/components/layout/MessagesTree.js +33 -43
- package/dist/components/layout/MessagesTree.js.map +1 -1
- package/dist/components/layout/MessagesTree.module.css +10 -5
- package/dist/components/layout/StatusDot.d.ts +7 -0
- package/dist/components/layout/StatusDot.d.ts.map +1 -0
- package/dist/components/layout/StatusDot.js +12 -0
- package/dist/components/layout/StatusDot.js.map +1 -0
- package/dist/components/layout/StatusDot.module.css +16 -0
- package/dist/const.d.ts +2 -2
- package/dist/const.js +1 -1
- package/dist/entities.js +1 -1
- package/dist/internals/index.d.ts.map +1 -0
- package/dist/internals/index.js.map +1 -0
- package/dist/internals/procedure.d.ts.map +1 -0
- package/dist/internals/procedure.js.map +1 -0
- package/dist/internals/urls.d.ts.map +1 -0
- package/dist/internals/urls.js.map +1 -0
- package/dist/internals/utils.d.ts.map +1 -0
- package/dist/internals/utils.js.map +1 -0
- package/dist/utils/sanitize.d.ts +7 -6
- package/dist/utils/sanitize.d.ts.map +1 -1
- package/dist/utils/sanitize.js +11 -8
- package/dist/utils/sanitize.js.map +1 -1
- package/package.json +29 -28
- package/dist/_common/index.d.ts.map +0 -1
- package/dist/_common/index.js.map +0 -1
- package/dist/_common/procedure.d.ts.map +0 -1
- package/dist/_common/procedure.js.map +0 -1
- package/dist/_common/urls.d.ts.map +0 -1
- package/dist/_common/urls.js.map +0 -1
- package/dist/_common/utils.d.ts.map +0 -1
- package/dist/_common/utils.js.map +0 -1
- package/dist/components/MessageController.d.ts +0 -13
- package/dist/components/MessageController.d.ts.map +0 -1
- package/dist/components/MessageController.js.map +0 -1
- package/dist/components/MessageFormContext.d.ts.map +0 -1
- package/dist/components/MessageFormContext.js.map +0 -1
- package/dist/components/actions/Move.d.ts +0 -2
- package/dist/components/actions/Move.d.ts.map +0 -1
- package/dist/components/actions/Move.js.map +0 -1
- package/dist/components/inputs/InputWrapper.d.ts +0 -8
- package/dist/components/inputs/InputWrapper.d.ts.map +0 -1
- package/dist/components/inputs/InputWrapper.js +0 -34
- package/dist/components/inputs/InputWrapper.js.map +0 -1
- package/dist/components/inputs/variables/editors/DateVariableEditor.d.ts +0 -10
- package/dist/components/inputs/variables/editors/DateVariableEditor.d.ts.map +0 -1
- package/dist/components/inputs/variables/editors/DateVariableEditor.js.map +0 -1
- package/dist/components/inputs/variables/editors/TimeVariableEditor.d.ts +0 -10
- package/dist/components/inputs/variables/editors/TimeVariableEditor.d.ts.map +0 -1
- package/dist/components/inputs/variables/editors/TimeVariableEditor.js +0 -15
- package/dist/components/inputs/variables/editors/TimeVariableEditor.js.map +0 -1
- package/dist/components/inputs/variables/pickers/NumericVariablePicker.d.ts +0 -7
- package/dist/components/inputs/variables/pickers/NumericVariablePicker.js.map +0 -1
- package/dist/components/inputs/variables/pickers/TemporalElementEditor.d.ts +0 -7
- package/dist/components/inputs/variables/pickers/TemporalElementEditor.d.ts.map +0 -1
- package/dist/components/inputs/variables/pickers/TemporalElementEditor.js +0 -58
- package/dist/components/inputs/variables/pickers/TemporalElementEditor.js.map +0 -1
- /package/dist/components/actions/{Move.module.css → CopyMessages.module.css} +0 -0
- /package/dist/{_common → internals}/index.d.ts +0 -0
- /package/dist/{_common → internals}/index.js +0 -0
- /package/dist/{_common → internals}/procedure.d.ts +0 -0
- /package/dist/{_common → internals}/procedure.js +0 -0
- /package/dist/{_common → internals}/urls.d.ts +0 -0
- /package/dist/{_common → internals}/urls.js +0 -0
- /package/dist/{_common → internals}/utils.d.ts +0 -0
- /package/dist/{_common → internals}/utils.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Move.d.ts","sourceRoot":"","sources":["../../../src/components/actions/Move.tsx"],"names":[],"mappings":"AAQA,wBAAgB,IAAI,4CA4BnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/actions/Move.tsx"],"sourcesContent":["import { Button } from '@payloadcms/ui';\nimport { IconBraces } from '@tabler/icons-react';\nimport { get } from 'lodash-es';\n\nimport { useMessagesForm } from '@/components/MessageFormContext';\n\nimport styles from './Move.module.css';\n\nexport function Move() {\n const { getValues, setValue, locales } = useMessagesForm();\n const handleMove = () => {\n const sourcePath = prompt('Source path');\n if (!sourcePath) {\n return;\n }\n const targetPath = prompt('Target path');\n if (!targetPath) {\n return;\n }\n\n locales.forEach((locale) => {\n const sourceValue = get(getValues(), [locale, sourcePath].join('.'));\n setValue([locale, targetPath].join('.'), sourceValue);\n });\n };\n return (\n <Button\n buttonStyle=\"subtle\"\n className={styles.button}\n icon={<IconBraces className={styles.icon} />}\n iconPosition=\"left\"\n onClick={handleMove}\n >\n Copy\n </Button>\n );\n}\n"],"names":["Button","IconBraces","get","useMessagesForm","styles","Move","getValues","setValue","locales","handleMove","sourcePath","prompt","targetPath","forEach","locale","sourceValue","join","buttonStyle","className","button","icon","iconPosition","onClick"],"mappings":";AAAA,SAASA,MAAM,QAAQ,iBAAiB;AACxC,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,GAAG,QAAQ,YAAY;AAEhC,SAASC,eAAe,QAAQ,kCAAkC;AAElE,OAAOC,YAAY,oBAAoB;AAEvC,OAAO,SAASC;IACd,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAGL;IACzC,MAAMM,aAAa;QACjB,MAAMC,aAAaC,OAAO;QAC1B,IAAI,CAACD,YAAY;YACf;QACF;QACA,MAAME,aAAaD,OAAO;QAC1B,IAAI,CAACC,YAAY;YACf;QACF;QAEAJ,QAAQK,OAAO,CAAC,CAACC;YACf,MAAMC,cAAcb,IAAII,aAAa;gBAACQ;gBAAQJ;aAAW,CAACM,IAAI,CAAC;YAC/DT,SAAS;gBAACO;gBAAQF;aAAW,CAACI,IAAI,CAAC,MAAMD;QAC3C;IACF;IACA,qBACE,KAACf;QACCiB,aAAY;QACZC,WAAWd,OAAOe,MAAM;QACxBC,oBAAM,KAACnB;YAAWiB,WAAWd,OAAOgB,IAAI;;QACxCC,cAAa;QACbC,SAASb;kBACV;;AAIL"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FieldError } from 'react-hook-form';
|
|
2
|
-
export interface InputWrapperProps {
|
|
3
|
-
label?: string;
|
|
4
|
-
error: FieldError | undefined;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function InputWrapper({ label, error, className, children, }: React.PropsWithChildren<InputWrapperProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=InputWrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/InputWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,2CAkB5C"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FieldLabel } from '@payloadcms/ui';
|
|
3
|
-
import styles from './InputWrapper.module.css';
|
|
4
|
-
export function InputWrapper({ label, error, className, children }) {
|
|
5
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
6
|
-
className: [
|
|
7
|
-
styles.wrapper,
|
|
8
|
-
className
|
|
9
|
-
].filter(Boolean).join(' '),
|
|
10
|
-
children: [
|
|
11
|
-
/*#__PURE__*/ _jsxs("fieldset", {
|
|
12
|
-
className: [
|
|
13
|
-
styles.fieldset,
|
|
14
|
-
error ? styles.fieldsetError : undefined
|
|
15
|
-
].filter(Boolean).join(' '),
|
|
16
|
-
children: [
|
|
17
|
-
label && /*#__PURE__*/ _jsx("legend", {
|
|
18
|
-
className: styles.legend,
|
|
19
|
-
children: /*#__PURE__*/ _jsx(FieldLabel, {
|
|
20
|
-
label: label
|
|
21
|
-
})
|
|
22
|
-
}),
|
|
23
|
-
children
|
|
24
|
-
]
|
|
25
|
-
}),
|
|
26
|
-
/*#__PURE__*/ _jsx("p", {
|
|
27
|
-
className: styles.errorMessage,
|
|
28
|
-
children: error?.message
|
|
29
|
-
})
|
|
30
|
-
]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=InputWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/inputs/InputWrapper.tsx"],"sourcesContent":["import { FieldLabel } from '@payloadcms/ui';\nimport type { FieldError } from 'react-hook-form';\n\nimport styles from './InputWrapper.module.css';\n\nexport interface InputWrapperProps {\n label?: string;\n error: FieldError | undefined;\n className?: string;\n}\n\nexport function InputWrapper({\n label,\n error,\n className,\n children,\n}: React.PropsWithChildren<InputWrapperProps>) {\n return (\n <div className={[styles.wrapper, className].filter(Boolean).join(' ')}>\n <fieldset\n className={[styles.fieldset, error ? styles.fieldsetError : undefined]\n .filter(Boolean)\n .join(' ')}\n >\n {label && (\n <legend className={styles.legend}>\n <FieldLabel label={label} />\n </legend>\n )}\n {children}\n </fieldset>\n <p className={styles.errorMessage}>{error?.message}</p>\n </div>\n );\n}\n"],"names":["FieldLabel","styles","InputWrapper","label","error","className","children","div","wrapper","filter","Boolean","join","fieldset","fieldsetError","undefined","legend","p","errorMessage","message"],"mappings":";AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAG5C,OAAOC,YAAY,4BAA4B;AAQ/C,OAAO,SAASC,aAAa,EAC3BC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACmC;IAC3C,qBACE,MAACC;QAAIF,WAAW;YAACJ,OAAOO,OAAO;YAAEH;SAAU,CAACI,MAAM,CAACC,SAASC,IAAI,CAAC;;0BAC/D,MAACC;gBACCP,WAAW;oBAACJ,OAAOW,QAAQ;oBAAER,QAAQH,OAAOY,aAAa,GAAGC;iBAAU,CACnEL,MAAM,CAACC,SACPC,IAAI,CAAC;;oBAEPR,uBACC,KAACY;wBAAOV,WAAWJ,OAAOc,MAAM;kCAC9B,cAAA,KAACf;4BAAWG,OAAOA;;;oBAGtBG;;;0BAEH,KAACU;gBAAEX,WAAWJ,OAAOgB,YAAY;0BAAGb,OAAOc;;;;AAGjD"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DateElement } from '../../../../types';
|
|
2
|
-
export interface DateVariableEditorProps {
|
|
3
|
-
name: string;
|
|
4
|
-
element: DateElement | undefined;
|
|
5
|
-
ref: React.Ref<{
|
|
6
|
-
getValue: () => string;
|
|
7
|
-
}>;
|
|
8
|
-
}
|
|
9
|
-
export declare function DateVariableEditor({ ref }: DateVariableEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=DateVariableEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateVariableEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/inputs/variables/editors/DateVariableEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;QAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5C;AAED,wBAAgB,kBAAkB,CAAC,EAAE,GAAG,EAAE,EAAE,uBAAuB,2CASlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/inputs/variables/editors/DateVariableEditor.tsx"],"sourcesContent":["import { useImperativeHandle } from 'react';\nimport type { DateElement } from '@/types';\n\nexport interface DateVariableEditorProps {\n name: string;\n element: DateElement | undefined;\n ref: React.Ref<{ getValue: () => string }>;\n}\n\nexport function DateVariableEditor({ ref }: DateVariableEditorProps) {\n useImperativeHandle(ref, () => ({\n getValue: () => {\n // TODO\n return '';\n },\n }));\n\n return <>DateElementEditor</>;\n}\n"],"names":["useImperativeHandle","DateVariableEditor","ref","getValue"],"mappings":";AAAA,SAASA,mBAAmB,QAAQ,QAAQ;AAS5C,OAAO,SAASC,mBAAmB,EAAEC,GAAG,EAA2B;IACjEF,oBAAoBE,KAAK,IAAO,CAAA;YAC9BC,UAAU;gBACR,OAAO;gBACP,OAAO;YACT;QACF,CAAA;IAEA,qBAAO;kBAAE;;AACX"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TimeElement } from '../../../../types';
|
|
2
|
-
export interface TimeElementEditorProps {
|
|
3
|
-
name: string;
|
|
4
|
-
element: TimeElement | undefined;
|
|
5
|
-
ref: React.Ref<{
|
|
6
|
-
getValue: () => string;
|
|
7
|
-
}>;
|
|
8
|
-
}
|
|
9
|
-
export declare function TimeElementEditor({ ref }: TimeElementEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=TimeVariableEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeVariableEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/inputs/variables/editors/TimeVariableEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;QAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5C;AAED,wBAAgB,iBAAiB,CAAC,EAAE,GAAG,EAAE,EAAE,sBAAsB,2CAShE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useImperativeHandle } from 'react';
|
|
3
|
-
export function TimeElementEditor({ ref }) {
|
|
4
|
-
useImperativeHandle(ref, ()=>({
|
|
5
|
-
getValue: ()=>{
|
|
6
|
-
// TODO
|
|
7
|
-
return '';
|
|
8
|
-
}
|
|
9
|
-
}));
|
|
10
|
-
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
11
|
-
children: "TimeElementEditor"
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=TimeVariableEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/inputs/variables/editors/TimeVariableEditor.tsx"],"sourcesContent":["import { useImperativeHandle } from 'react';\nimport type { TimeElement } from '@/types';\n\nexport interface TimeElementEditorProps {\n name: string;\n element: TimeElement | undefined;\n ref: React.Ref<{ getValue: () => string }>;\n}\n\nexport function TimeElementEditor({ ref }: TimeElementEditorProps) {\n useImperativeHandle(ref, () => ({\n getValue: () => {\n // TODO\n return '';\n },\n }));\n\n return <>TimeElementEditor</>;\n}\n"],"names":["useImperativeHandle","TimeElementEditor","ref","getValue"],"mappings":";AAAA,SAASA,mBAAmB,QAAQ,QAAQ;AAS5C,OAAO,SAASC,kBAAkB,EAAEC,GAAG,EAA0B;IAC/DF,oBAAoBE,KAAK,IAAO,CAAA;YAC9BC,UAAU;gBACR,OAAO;gBACP,OAAO;YACT;QACF,CAAA;IAEA,qBAAO;kBAAE;;AACX"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NumberElement, PluralElement } from '../../../../types';
|
|
2
|
-
export interface NumericVariablePickerProps {
|
|
3
|
-
element: NumberElement | PluralElement;
|
|
4
|
-
onUpdate: (value: string) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function NumericVariablePicker({ element, onUpdate, }: NumericVariablePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=NumericVariablePicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/inputs/variables/pickers/NumericVariablePicker.tsx"],"sourcesContent":["import { ToggleGroup } from 'radix-ui';\nimport { useEffect, useRef, useState } from 'react';\nimport type { NumberElement, PluralElement } from '@/types';\n\nimport { isNumberElement, isPluralElement } from '@/utils/guards';\n\nimport { PluralVariableEditor } from '../editors/PluralVariableEditor';\nimport styles from './NumericVariablePicker.module.css';\n\nconst NUMERIC_TYPES = [\n 'number',\n 'plural',\n // \"selectordinal\"\n] as const;\n\ntype NumericType = (typeof NUMERIC_TYPES)[number];\n\nexport interface NumericVariablePickerProps {\n element: NumberElement | PluralElement;\n onUpdate: (value: string) => void;\n}\n\nexport function NumericVariablePicker({\n element,\n onUpdate,\n}: NumericVariablePickerProps) {\n const [type, setType] = useState<NumericType | undefined>(() => {\n if (isNumberElement(element)) return 'number';\n if (isPluralElement(element)) return 'plural';\n return undefined;\n });\n const getValueRef = useRef<{ getValue: () => string }>(null);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: useEffectEvent\n useEffect(() => {\n return () => {\n if (!getValueRef.current) return;\n onUpdate(getValueRef.current.getValue());\n };\n }, []);\n\n return (\n <div>\n <ToggleGroup.Root\n className={styles.toggleGroup}\n onValueChange={(value) => setType(value as NumericType)}\n type=\"single\"\n value={type}\n >\n {NUMERIC_TYPES.map((type) => (\n <ToggleGroup.Item\n className={styles.toggleItem}\n key={type}\n value={type}\n >\n {type}\n </ToggleGroup.Item>\n ))}\n </ToggleGroup.Root>\n\n <div className={styles.content}>\n {type === 'plural' && (\n <PluralVariableEditor\n element={isPluralElement(element) ? element : undefined}\n ref={getValueRef}\n variableName={element.value}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["ToggleGroup","useEffect","useRef","useState","isNumberElement","isPluralElement","PluralVariableEditor","styles","NUMERIC_TYPES","NumericVariablePicker","element","onUpdate","type","setType","undefined","getValueRef","current","getValue","div","Root","className","toggleGroup","onValueChange","value","map","Item","toggleItem","content","ref","variableName"],"mappings":";AAAA,SAASA,WAAW,QAAQ,WAAW;AACvC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGpD,SAASC,eAAe,EAAEC,eAAe,QAAQ,iBAAiB;AAElE,SAASC,oBAAoB,QAAQ,kCAAkC;AACvE,OAAOC,YAAY,qCAAqC;AAExD,MAAMC,gBAAgB;IACpB;IACA;CAED;AASD,OAAO,SAASC,sBAAsB,EACpCC,OAAO,EACPC,QAAQ,EACmB;IAC3B,MAAM,CAACC,MAAMC,QAAQ,GAAGV,SAAkC;QACxD,IAAIC,gBAAgBM,UAAU,OAAO;QACrC,IAAIL,gBAAgBK,UAAU,OAAO;QACrC,OAAOI;IACT;IACA,MAAMC,cAAcb,OAAmC;IAEvD,0EAA0E;IAC1ED,UAAU;QACR,OAAO;YACL,IAAI,CAACc,YAAYC,OAAO,EAAE;YAC1BL,SAASI,YAAYC,OAAO,CAACC,QAAQ;QACvC;IACF,GAAG,EAAE;IAEL,qBACE,MAACC;;0BACC,KAAClB,YAAYmB,IAAI;gBACfC,WAAWb,OAAOc,WAAW;gBAC7BC,eAAe,CAACC,QAAUV,QAAQU;gBAClCX,MAAK;gBACLW,OAAOX;0BAENJ,cAAcgB,GAAG,CAAC,CAACZ,qBAClB,KAACZ,YAAYyB,IAAI;wBACfL,WAAWb,OAAOmB,UAAU;wBAE5BH,OAAOX;kCAENA;uBAHIA;;0BAQX,KAACM;gBAAIE,WAAWb,OAAOoB,OAAO;0BAC3Bf,SAAS,0BACR,KAACN;oBACCI,SAASL,gBAAgBK,WAAWA,UAAUI;oBAC9Cc,KAAKb;oBACLc,cAAcnB,QAAQa,KAAK;;;;;AAMvC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DateElement, TimeElement } from '../../../../types';
|
|
2
|
-
export interface TemporalElementEditorProps {
|
|
3
|
-
element: DateElement | TimeElement;
|
|
4
|
-
onUpdate: (value: string) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function TemporalElementEditor({ element, onUpdate, }: TemporalElementEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=TemporalElementEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemporalElementEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/inputs/variables/pickers/TemporalElementEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAYxD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,WAAW,GAAG,WAAW,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,QAAQ,GACT,EAAE,0BAA0B,2CAqD5B"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ToggleGroup } from 'radix-ui';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { isDateElement, isTimeElement } from '../../../../utils/guards';
|
|
5
|
-
import { DateVariableEditor } from '../editors/DateVariableEditor';
|
|
6
|
-
import { TimeElementEditor } from '../editors/TimeVariableEditor';
|
|
7
|
-
import styles from './TemporalElementEditor.module.css';
|
|
8
|
-
const TEMPORAL_TYPES = [
|
|
9
|
-
'date',
|
|
10
|
-
'time'
|
|
11
|
-
];
|
|
12
|
-
export function TemporalElementEditor({ element, onUpdate }) {
|
|
13
|
-
const [type, setType] = useState(()=>{
|
|
14
|
-
if (isDateElement(element)) return 'date';
|
|
15
|
-
if (isTimeElement(element)) return 'time';
|
|
16
|
-
return undefined;
|
|
17
|
-
});
|
|
18
|
-
const getValueRef = useRef(null);
|
|
19
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: useEffectEvent
|
|
20
|
-
useEffect(()=>{
|
|
21
|
-
return ()=>{
|
|
22
|
-
if (!getValueRef.current) return;
|
|
23
|
-
onUpdate(getValueRef.current.getValue());
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
27
|
-
children: [
|
|
28
|
-
/*#__PURE__*/ _jsx(ToggleGroup.Root, {
|
|
29
|
-
className: styles.toggleGroup,
|
|
30
|
-
onValueChange: (value)=>setType(value),
|
|
31
|
-
type: "single",
|
|
32
|
-
value: type,
|
|
33
|
-
children: TEMPORAL_TYPES.map((type)=>/*#__PURE__*/ _jsx(ToggleGroup.Item, {
|
|
34
|
-
className: styles.toggleItem,
|
|
35
|
-
value: type,
|
|
36
|
-
children: type
|
|
37
|
-
}, type))
|
|
38
|
-
}),
|
|
39
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
40
|
-
className: styles.content,
|
|
41
|
-
children: [
|
|
42
|
-
type === 'date' && /*#__PURE__*/ _jsx(DateVariableEditor, {
|
|
43
|
-
element: isDateElement(element) ? element : undefined,
|
|
44
|
-
name: element.value,
|
|
45
|
-
ref: getValueRef
|
|
46
|
-
}),
|
|
47
|
-
type === 'time' && /*#__PURE__*/ _jsx(TimeElementEditor, {
|
|
48
|
-
element: isTimeElement(element) ? element : undefined,
|
|
49
|
-
name: element.value,
|
|
50
|
-
ref: getValueRef
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=TemporalElementEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/inputs/variables/pickers/TemporalElementEditor.tsx"],"sourcesContent":["import { ToggleGroup } from 'radix-ui';\nimport { useEffect, useRef, useState } from 'react';\nimport type { DateElement, TimeElement } from '@/types';\n\nimport { isDateElement, isTimeElement } from '@/utils/guards';\n\nimport { DateVariableEditor } from '../editors/DateVariableEditor';\nimport { TimeElementEditor } from '../editors/TimeVariableEditor';\nimport styles from './TemporalElementEditor.module.css';\n\nconst TEMPORAL_TYPES = ['date', 'time'] as const;\n\ntype TemporalType = (typeof TEMPORAL_TYPES)[number];\n\nexport interface TemporalElementEditorProps {\n element: DateElement | TimeElement;\n onUpdate: (value: string) => void;\n}\n\nexport function TemporalElementEditor({\n element,\n onUpdate,\n}: TemporalElementEditorProps) {\n const [type, setType] = useState<TemporalType | undefined>(() => {\n if (isDateElement(element)) return 'date';\n if (isTimeElement(element)) return 'time';\n return undefined;\n });\n const getValueRef = useRef<{ getValue: () => string }>(null);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: useEffectEvent\n useEffect(() => {\n return () => {\n if (!getValueRef.current) return;\n onUpdate(getValueRef.current.getValue());\n };\n }, []);\n\n return (\n <div>\n <ToggleGroup.Root\n className={styles.toggleGroup}\n onValueChange={(value) => setType(value as TemporalType)}\n type=\"single\"\n value={type}\n >\n {TEMPORAL_TYPES.map((type) => (\n <ToggleGroup.Item\n className={styles.toggleItem}\n key={type}\n value={type}\n >\n {type}\n </ToggleGroup.Item>\n ))}\n </ToggleGroup.Root>\n\n <div className={styles.content}>\n {type === 'date' && (\n <DateVariableEditor\n element={isDateElement(element) ? element : undefined}\n name={element.value}\n ref={getValueRef}\n />\n )}\n {type === 'time' && (\n <TimeElementEditor\n element={isTimeElement(element) ? element : undefined}\n name={element.value}\n ref={getValueRef}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["ToggleGroup","useEffect","useRef","useState","isDateElement","isTimeElement","DateVariableEditor","TimeElementEditor","styles","TEMPORAL_TYPES","TemporalElementEditor","element","onUpdate","type","setType","undefined","getValueRef","current","getValue","div","Root","className","toggleGroup","onValueChange","value","map","Item","toggleItem","content","name","ref"],"mappings":";AAAA,SAASA,WAAW,QAAQ,WAAW;AACvC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGpD,SAASC,aAAa,EAAEC,aAAa,QAAQ,iBAAiB;AAE9D,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,OAAOC,YAAY,qCAAqC;AAExD,MAAMC,iBAAiB;IAAC;IAAQ;CAAO;AASvC,OAAO,SAASC,sBAAsB,EACpCC,OAAO,EACPC,QAAQ,EACmB;IAC3B,MAAM,CAACC,MAAMC,QAAQ,GAAGX,SAAmC;QACzD,IAAIC,cAAcO,UAAU,OAAO;QACnC,IAAIN,cAAcM,UAAU,OAAO;QACnC,OAAOI;IACT;IACA,MAAMC,cAAcd,OAAmC;IAEvD,0EAA0E;IAC1ED,UAAU;QACR,OAAO;YACL,IAAI,CAACe,YAAYC,OAAO,EAAE;YAC1BL,SAASI,YAAYC,OAAO,CAACC,QAAQ;QACvC;IACF,GAAG,EAAE;IAEL,qBACE,MAACC;;0BACC,KAACnB,YAAYoB,IAAI;gBACfC,WAAWb,OAAOc,WAAW;gBAC7BC,eAAe,CAACC,QAAUV,QAAQU;gBAClCX,MAAK;gBACLW,OAAOX;0BAENJ,eAAegB,GAAG,CAAC,CAACZ,qBACnB,KAACb,YAAY0B,IAAI;wBACfL,WAAWb,OAAOmB,UAAU;wBAE5BH,OAAOX;kCAENA;uBAHIA;;0BAQX,MAACM;gBAAIE,WAAWb,OAAOoB,OAAO;;oBAC3Bf,SAAS,wBACR,KAACP;wBACCK,SAASP,cAAcO,WAAWA,UAAUI;wBAC5Cc,MAAMlB,QAAQa,KAAK;wBACnBM,KAAKd;;oBAGRH,SAAS,wBACR,KAACN;wBACCI,SAASN,cAAcM,WAAWA,UAAUI;wBAC5Cc,MAAMlB,QAAQa,KAAK;wBACnBM,KAAKd;;;;;;AAMjB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|