Files
klz-cables.com/.pnpm-store/v10/files/2a/c5e2bd0602ecd98c601167cbaa21f7b92422c87d519e793e75db1a86b52dff3bc206a6e4d5a644f92af6db31870647b64a4b20c1d43af9dae0550eeaa91647
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
3.2 KiB
Plaintext

{"version":3,"file":"index.js","names":["React","useRef","useForm","useFormModified","FormSubmit","useHotkey","useDocumentInfo","useEditDepth","useOperation","useTranslation","SaveButton","label","labelProp","uploadStatus","t","submit","modified","ref","editDepth","operation","disabled","cmdCtrlKey","keyCodes","e","preventDefault","stopPropagation","current","click","handleSubmit","_jsx","buttonId","onClick","size","type"],"sources":["../../../src/elements/SaveButton/index.tsx"],"sourcesContent":["'use client'\n\nimport type { SaveButtonClientProps } from 'payload'\n\nimport React, { useRef } from 'react'\n\nimport { useForm, useFormModified } from '../../forms/Form/context.js'\nimport { FormSubmit } from '../../forms/Submit/index.js'\nimport { useHotkey } from '../../hooks/useHotkey.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { useOperation } from '../../providers/Operation/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\n\nexport function SaveButton({ label: labelProp }: SaveButtonClientProps) {\n const { uploadStatus } = useDocumentInfo()\n const { t } = useTranslation()\n const { submit } = useForm()\n const modified = useFormModified()\n const label = labelProp || t('general:save')\n const ref = useRef<HTMLButtonElement>(null)\n const editDepth = useEditDepth()\n const operation = useOperation()\n\n const disabled = (operation === 'update' && !modified) || uploadStatus === 'uploading'\n\n useHotkey({ cmdCtrlKey: true, editDepth, keyCodes: ['s'] }, (e) => {\n if (disabled) {\n // absorb the event\n }\n\n e.preventDefault()\n e.stopPropagation()\n if (ref?.current) {\n ref.current.click()\n }\n })\n\n const handleSubmit = () => {\n if (uploadStatus === 'uploading') {\n return\n }\n\n return void submit()\n }\n\n return (\n <FormSubmit\n buttonId=\"action-save\"\n disabled={disabled}\n onClick={handleSubmit}\n ref={ref}\n size=\"medium\"\n type=\"button\"\n >\n {label}\n </FormSubmit>\n )\n}\n"],"mappings":"AAAA;;;AAIA,OAAOA,KAAA,IAASC,MAAM,QAAQ;AAE9B,SAASC,OAAO,EAAEC,eAAe,QAAQ;AACzC,SAASC,UAAU,QAAQ;AAC3B,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAC7B,SAASC,YAAY,QAAQ;AAC7B,SAASC,cAAc,QAAQ;AAE/B,OAAO,SAASC,WAAW;EAAEC,KAAA,EAAOC;AAAS,CAAyB;EACpE,MAAM;IAAEC;EAAY,CAAE,GAAGP,eAAA;EACzB,MAAM;IAAEQ;EAAC,CAAE,GAAGL,cAAA;EACd,MAAM;IAAEM;EAAM,CAAE,GAAGb,OAAA;EACnB,MAAMc,QAAA,GAAWb,eAAA;EACjB,MAAMQ,KAAA,GAAQC,SAAA,IAAaE,CAAA,CAAE;EAC7B,MAAMG,GAAA,GAAMhB,MAAA,CAA0B;EACtC,MAAMiB,SAAA,GAAYX,YAAA;EAClB,MAAMY,SAAA,GAAYX,YAAA;EAElB,MAAMY,QAAA,GAAWD,SAAC,KAAc,YAAY,CAACH,QAAA,IAAaH,YAAA,KAAiB;EAE3ER,SAAA,CAAU;IAAEgB,UAAA,EAAY;IAAMH,SAAA;IAAWI,QAAA,EAAU,CAAC;EAAK,GAAIC,CAAA;IAC3D,IAAIH,QAAA,EAAU;MACZ;IAAA;IAGFG,CAAA,CAAEC,cAAc;IAChBD,CAAA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