Files
klz-cables.com/.pnpm-store/v10/files/47/de619ff4cee22d224dd7eabfb44cfe97569ce7001a1c4633c36c7ae3fb7fb5dffa4c16ffed62bed0d4aa57d35a6c151f90d4e768240b99ac86dd011077f819
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
4.8 KiB
Plaintext

{"version":3,"file":"context.js","names":["createContext","use","createSelectorContext","useContextSelector","useContext","useFullContext","FormContext","DocumentFormContext","FormWatchContext","SubmittedContext","ProcessingContext","BackgroundProcessingContext","ModifiedContext","InitializingContext","FormFieldsContext","useForm","useDocumentForm","useWatchForm","useFormSubmitted","useFormProcessing","useFormBackgroundProcessing","useFormModified","useFormInitializing","useFormFields","selector","useAllFormFields"],"sources":["../../../src/forms/Form/context.ts"],"sourcesContent":["'use client'\nimport type { RenderedField } from 'payload'\n\nimport { createContext, use } from 'react'\nimport {\n createContext as createSelectorContext,\n useContextSelector,\n useContext as useFullContext,\n} from 'use-context-selector'\n\nimport type { Context, FormFieldsContext as FormFieldsContextType } from './types.js'\n\nconst FormContext = createContext({} as Context)\nconst DocumentFormContext = createContext({} as Context)\nconst FormWatchContext = createContext({} as Context)\nconst SubmittedContext = createContext(false)\nconst ProcessingContext = createContext(false)\n/**\n * If the form has started processing in the background (e.g.\n * if autosave is running), this will be true.\n */\nconst BackgroundProcessingContext = createContext(false)\nconst ModifiedContext = createContext(false)\nconst InitializingContext = createContext(false)\nconst FormFieldsContext = createSelectorContext<FormFieldsContextType>([{}, () => null])\n\nexport type RenderedFieldSlots = Map<string, RenderedField>\n\n/**\n * Get the state of the form, can be used to submit & validate the form.\n *\n * @see https://payloadcms.com/docs/admin/react-hooks#useform\n */\nconst useForm = (): Context => use(FormContext)\n/**\n * Get the state of the document-level form. This is useful if you need to access the document-level Form from within a child Form.\n * This is the case withing lexical Blocks, as each lexical blocks renders their own Form.\n */\nconst useDocumentForm = (): Context => use(DocumentFormContext)\n\nconst useWatchForm = (): Context => use(FormWatchContext)\nconst useFormSubmitted = (): boolean => use(SubmittedContext)\nconst useFormProcessing = (): boolean => use(ProcessingContext)\n/**\n * If the form has started processing in the background (e.g.\n * if autosave is running), this will be true.\n */\nconst useFormBackgroundProcessing = (): boolean => use(BackgroundProcessingContext)\nconst useFormModified = (): boolean => use(ModifiedContext)\nconst useFormInitializing = (): boolean => use(InitializingContext)\n\n/**\n * Get and set the value of a form field based on a selector\n *\n * @see https://payloadcms.com/docs/admin/react-hooks#useformfields\n */\nconst useFormFields = <Value = unknown>(\n selector: (context: FormFieldsContextType) => Value,\n): Value => useContextSelector(FormFieldsContext, selector)\n\n/**\n * Get the state of all form fields.\n *\n * @see https://payloadcms.com/docs/admin/react-hooks#useallformfields\n */\nconst useAllFormFields = (): FormFieldsContextType => useFullContext(FormFieldsContext)\n\nexport {\n BackgroundProcessingContext,\n DocumentFormContext,\n FormContext,\n FormFieldsContext,\n FormWatchContext,\n InitializingContext,\n ModifiedContext,\n ProcessingContext,\n SubmittedContext,\n useAllFormFields,\n useDocumentForm,\n useForm,\n useFormBackgroundProcessing,\n useFormFields,\n useFormInitializing,\n useFormModified,\n useFormProcessing,\n useFormSubmitted,\n useWatchForm,\n}\n"],"mappings":"AAAA;;AAGA,SAASA,aAAa,EAAEC,GAAG,QAAQ;AACnC,SACED,aAAA,IAAiBE,qBAAqB,EACtCC,kBAAkB,EAClBC,UAAA,IAAcC,cAAc,QACvB;AAIP,MAAMC,WAAA,GAAcN,aAAA,CAAc,CAAC;AACnC,MAAMO,mBAAA,GAAsBP,aAAA,CAAc,CAAC;AAC3C,MAAMQ,gBA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