@10x-media/form-builder 0.1.0-beta.2 → 0.1.0-beta.21
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/CHANGELOG.md +360 -0
- package/README.md +7 -5
- package/dist/actions/assertNoBlockCollision.js +18 -0
- package/dist/actions/assertNoBlockCollision.js.map +1 -0
- package/dist/actions/body/converters.d.ts +20 -0
- package/dist/actions/body/converters.js +57 -0
- package/dist/actions/body/converters.js.map +1 -0
- package/dist/actions/body/escapeHtml.d.ts +6 -0
- package/dist/actions/body/escapeHtml.js +14 -0
- package/dist/actions/body/escapeHtml.js.map +1 -0
- package/dist/actions/body/serializeBody.d.ts +55 -0
- package/dist/actions/body/serializeBody.js +78 -0
- package/dist/actions/body/serializeBody.js.map +1 -0
- package/dist/actions/body/serializeSlate.js +31 -0
- package/dist/actions/body/serializeSlate.js.map +1 -0
- package/dist/actions/body/textOfBody.d.ts +13 -0
- package/dist/actions/body/textOfBody.js +35 -0
- package/dist/actions/body/textOfBody.js.map +1 -0
- package/dist/actions/body/wildcards.d.ts +10 -0
- package/dist/actions/body/wildcards.js +33 -0
- package/dist/actions/body/wildcards.js.map +1 -0
- package/dist/actions/buildActionBlocks.js +12 -9
- package/dist/actions/buildActionBlocks.js.map +1 -1
- package/dist/actions/builtin/confirmation.js +47 -43
- package/dist/actions/builtin/confirmation.js.map +1 -1
- package/dist/actions/builtin/emailAction.d.ts +20 -0
- package/dist/actions/builtin/emailAction.js +120 -0
- package/dist/actions/builtin/emailAction.js.map +1 -0
- package/dist/actions/builtin/emailTeam.js +20 -38
- package/dist/actions/builtin/emailTeam.js.map +1 -1
- package/dist/actions/builtin/index.d.ts +16 -1
- package/dist/actions/builtin/index.js +21 -7
- package/dist/actions/builtin/index.js.map +1 -1
- package/dist/actions/builtin/signedWebhook.js +6 -2
- package/dist/actions/builtin/signedWebhook.js.map +1 -1
- package/dist/actions/defineAction.d.ts +17 -5
- package/dist/actions/defineAction.js.map +1 -1
- package/dist/actions/dispatch.js +51 -6
- package/dist/actions/dispatch.js.map +1 -1
- package/dist/actions/dispatchContext.js +13 -0
- package/dist/actions/dispatchContext.js.map +1 -0
- package/dist/actions/emailRecipients.d.ts +12 -0
- package/dist/actions/emailRecipients.js +146 -0
- package/dist/actions/emailRecipients.js.map +1 -0
- package/dist/actions/fromAddresses.d.ts +37 -0
- package/dist/actions/fromAddresses.js +131 -0
- package/dist/actions/fromAddresses.js.map +1 -0
- package/dist/actions/recipientSources.d.ts +34 -0
- package/dist/actions/recipientSources.js +11 -0
- package/dist/actions/recipientSources.js.map +1 -0
- package/dist/actions/registry.d.ts +2 -1
- package/dist/actions/registry.js +5 -7
- package/dist/actions/registry.js.map +1 -1
- package/dist/actions/runActions.js +10 -1
- package/dist/actions/runActions.js.map +1 -1
- package/dist/actions/task.js +47 -16
- package/dist/actions/task.js.map +1 -1
- package/dist/aggregation/aggregateResponses.d.ts +9 -0
- package/dist/aggregation/aggregateResponses.js +8 -14
- package/dist/aggregation/aggregateResponses.js.map +1 -1
- package/dist/aggregation/resolveResultsRequest.d.ts +41 -6
- package/dist/aggregation/resolveResultsRequest.js +97 -11
- package/dist/aggregation/resolveResultsRequest.js.map +1 -1
- package/dist/calc/computeCalcFields.d.ts +5 -3
- package/dist/calc/computeCalcFields.js +6 -4
- package/dist/calc/computeCalcFields.js.map +1 -1
- package/dist/calc/evaluate.d.ts +26 -3
- package/dist/calc/evaluate.js +34 -13
- package/dist/calc/evaluate.js.map +1 -1
- package/dist/calc/formatCalc.d.ts +11 -0
- package/dist/calc/formatCalc.js +35 -0
- package/dist/calc/formatCalc.js.map +1 -0
- package/dist/calc/formatCalcValue.d.ts +17 -0
- package/dist/calc/formatCalcValue.js +17 -0
- package/dist/calc/formatCalcValue.js.map +1 -0
- package/dist/calc/normalizeCalc.d.ts +17 -3
- package/dist/calc/normalizeCalc.js +42 -33
- package/dist/calc/normalizeCalc.js.map +1 -1
- package/dist/calc/registry.d.ts +43 -0
- package/dist/calc/registry.js +27 -0
- package/dist/calc/registry.js.map +1 -0
- package/dist/calc/resolveCalcContext.d.ts +36 -0
- package/dist/calc/resolveCalcContext.js +87 -0
- package/dist/calc/resolveCalcContext.js.map +1 -0
- package/dist/calc/types.d.ts +25 -4
- package/dist/calc/types.js +23 -0
- package/dist/calc/types.js.map +1 -0
- package/dist/client/ByteSizeField.d.ts +29 -0
- package/dist/client/ByteSizeField.js +58 -0
- package/dist/client/ByteSizeField.js.map +1 -0
- package/dist/client/CalcExpressionBuilder.d.ts +20 -0
- package/dist/client/CalcExpressionBuilder.js +890 -0
- package/dist/client/CalcExpressionBuilder.js.map +1 -0
- package/dist/client/ClosePollButton.d.ts +15 -0
- package/dist/client/ClosePollButton.js +80 -0
- package/dist/client/ClosePollButton.js.map +1 -0
- package/dist/client/CondensedArray.d.ts +15 -0
- package/dist/client/CondensedArray.js +97 -0
- package/dist/client/CondensedArray.js.map +1 -0
- package/dist/client/ConditionBuilder.js +2 -1
- package/dist/client/ConditionBuilder.js.map +1 -1
- package/dist/client/ConsentBlockLabel.d.ts +15 -0
- package/dist/client/ConsentBlockLabel.js +71 -0
- package/dist/client/ConsentBlockLabel.js.map +1 -0
- package/dist/client/ConsentSourceRowLabel.d.ts +9 -0
- package/dist/client/ConsentSourceRowLabel.js +21 -0
- package/dist/client/ConsentSourceRowLabel.js.map +1 -0
- package/dist/client/EndpointOptionsSelect.d.ts +55 -0
- package/dist/client/EndpointOptionsSelect.js +112 -0
- package/dist/client/EndpointOptionsSelect.js.map +1 -0
- package/dist/client/FieldBlockLabel.d.ts +18 -0
- package/dist/client/FieldBlockLabel.js +34 -0
- package/dist/client/FieldBlockLabel.js.map +1 -0
- package/dist/client/FieldNameSelect.d.ts +37 -0
- package/dist/client/FieldNameSelect.js +72 -0
- package/dist/client/FieldNameSelect.js.map +1 -0
- package/dist/client/FlowBuilder.d.ts +2 -2
- package/dist/client/FlowBuilder.js +137 -88
- package/dist/client/FlowBuilder.js.map +1 -1
- package/dist/client/FormConditionField.js +1 -4
- package/dist/client/FormConditionField.js.map +1 -1
- package/dist/client/RecipientsSelect.d.ts +37 -0
- package/dist/client/RecipientsSelect.js +197 -0
- package/dist/client/RecipientsSelect.js.map +1 -0
- package/dist/client/RuleDescription.d.ts +21 -0
- package/dist/client/RuleDescription.js +19 -0
- package/dist/client/RuleDescription.js.map +1 -0
- package/dist/client/admin.css +557 -0
- package/dist/client/endpointOptions.d.ts +11 -0
- package/dist/client/endpointOptions.js +38 -0
- package/dist/client/endpointOptions.js.map +1 -0
- package/dist/client/flowAuthoring.js +142 -0
- package/dist/client/flowAuthoring.js.map +1 -0
- package/dist/client/synthesizeClientField.js +21 -10
- package/dist/client/synthesizeClientField.js.map +1 -1
- package/dist/client/toStaticLabel.js +13 -0
- package/dist/client/toStaticLabel.js.map +1 -0
- package/dist/collections/buttonFields.d.ts +34 -0
- package/dist/collections/buttonFields.js +35 -0
- package/dist/collections/buttonFields.js.map +1 -0
- package/dist/collections/cells/FieldCountCell.d.ts +15 -0
- package/dist/collections/cells/FieldCountCell.js +18 -0
- package/dist/collections/cells/FieldCountCell.js.map +1 -0
- package/dist/collections/cells/FlowStepsCell.d.ts +14 -0
- package/dist/collections/cells/FlowStepsCell.js +17 -0
- package/dist/collections/cells/FlowStepsCell.js.map +1 -0
- package/dist/collections/formSubmissions.js +114 -28
- package/dist/collections/formSubmissions.js.map +1 -1
- package/dist/collections/forms.js +449 -112
- package/dist/collections/forms.js.map +1 -1
- package/dist/collections/formsEndpoints.js +106 -0
- package/dist/collections/formsEndpoints.js.map +1 -0
- package/dist/collections/redirectFields.d.ts +29 -0
- package/dist/collections/settingsFields.d.ts +31 -0
- package/dist/collections/settingsFields.js +45 -0
- package/dist/collections/settingsFields.js.map +1 -0
- package/dist/conditions/conditionType.js +9 -2
- package/dist/conditions/conditionType.js.map +1 -1
- package/dist/conditions/evaluate.js +1 -1
- package/dist/conditions/evaluate.js.map +1 -1
- package/dist/conditions/fieldTypes.d.ts +3 -1
- package/dist/conditions/fieldTypes.js +4 -1
- package/dist/conditions/fieldTypes.js.map +1 -1
- package/dist/conditions/normalizeConditions.js +20 -6
- package/dist/conditions/normalizeConditions.js.map +1 -1
- package/dist/consent/applyConsentStatements.d.ts +14 -0
- package/dist/consent/applyConsentStatements.js +17 -0
- package/dist/consent/applyConsentStatements.js.map +1 -0
- package/dist/consent/captureConsent.d.ts +39 -11
- package/dist/consent/captureConsent.js +63 -13
- package/dist/consent/captureConsent.js.map +1 -1
- package/dist/consent/consentSourcesField.d.ts +66 -0
- package/dist/consent/consentSourcesField.js +98 -0
- package/dist/consent/consentSourcesField.js.map +1 -0
- package/dist/consent/effectiveStatement.js +16 -0
- package/dist/consent/effectiveStatement.js.map +1 -0
- package/dist/consent/resolveConsentEntries.d.ts +24 -0
- package/dist/consent/resolveConsentEntries.js +40 -0
- package/dist/consent/resolveConsentEntries.js.map +1 -0
- package/dist/consent/resolveConsentSourcesRequest.d.ts +37 -0
- package/dist/consent/resolveConsentSourcesRequest.js +54 -0
- package/dist/consent/resolveConsentSourcesRequest.js.map +1 -0
- package/dist/consent/resolveConsentStatements.d.ts +45 -0
- package/dist/consent/resolveConsentStatements.js +46 -0
- package/dist/consent/resolveConsentStatements.js.map +1 -0
- package/dist/consent/resolvePublishedVersionRef.d.ts +17 -11
- package/dist/consent/resolvePublishedVersionRef.js +13 -10
- package/dist/consent/resolvePublishedVersionRef.js.map +1 -1
- package/dist/consent/types.d.ts +69 -0
- package/dist/context/formContext.d.ts +30 -0
- package/dist/context/formContext.js +54 -0
- package/dist/context/formContext.js.map +1 -0
- package/dist/email/departments.d.ts +59 -0
- package/dist/email/departments.js +87 -0
- package/dist/email/departments.js.map +1 -0
- package/dist/email/departmentsField.d.ts +53 -0
- package/dist/email/departmentsField.js +73 -0
- package/dist/email/departmentsField.js.map +1 -0
- package/dist/exports/client.d.ts +14 -1
- package/dist/exports/client.js +14 -1
- package/dist/exports/i18n.d.ts +5 -2
- package/dist/exports/i18n.js +5 -2
- package/dist/exports/react.d.ts +34 -10
- package/dist/exports/react.js +24 -4
- package/dist/exports/rsc.d.ts +10 -1
- package/dist/exports/rsc.js +10 -1
- package/dist/exports/types.d.ts +20 -12
- package/dist/fields/buildFieldBlocks.js +46 -25
- package/dist/fields/buildFieldBlocks.js.map +1 -1
- package/dist/fields/builtin/calculation.d.ts +17 -0
- package/dist/fields/builtin/calculation.js +193 -18
- package/dist/fields/builtin/calculation.js.map +1 -1
- package/dist/fields/builtin/checkbox.js +23 -0
- package/dist/fields/builtin/checkbox.js.map +1 -1
- package/dist/fields/builtin/consent.js +49 -14
- package/dist/fields/builtin/consent.js.map +1 -1
- package/dist/fields/builtin/country.d.ts +13 -0
- package/dist/fields/builtin/country.js +30 -0
- package/dist/fields/builtin/country.js.map +1 -0
- package/dist/fields/builtin/date.js +31 -0
- package/dist/fields/builtin/date.js.map +1 -0
- package/dist/fields/builtin/email.js +8 -1
- package/dist/fields/builtin/email.js.map +1 -1
- package/dist/fields/builtin/file.d.ts +15 -0
- package/dist/fields/builtin/file.js +95 -8
- package/dist/fields/builtin/file.js.map +1 -1
- package/dist/fields/builtin/index.d.ts +30 -0
- package/dist/fields/builtin/index.js +37 -10
- package/dist/fields/builtin/index.js.map +1 -1
- package/dist/fields/builtin/message.js +30 -0
- package/dist/fields/builtin/message.js.map +1 -0
- package/dist/fields/builtin/repeater.js +8 -3
- package/dist/fields/builtin/repeater.js.map +1 -1
- package/dist/fields/builtin/select.js +28 -4
- package/dist/fields/builtin/select.js.map +1 -1
- package/dist/fields/builtin/state.d.ts +13 -0
- package/dist/fields/builtin/state.js +30 -0
- package/dist/fields/builtin/state.js.map +1 -0
- package/dist/fields/builtin/text.js +7 -0
- package/dist/fields/builtin/text.js.map +1 -1
- package/dist/fields/data/regions.d.ts +21 -0
- package/dist/fields/data/regions.js +1238 -0
- package/dist/fields/data/regions.js.map +1 -0
- package/dist/fields/fieldKey.d.ts +15 -0
- package/dist/fields/fieldKey.js +16 -0
- package/dist/fields/fieldKey.js.map +1 -0
- package/dist/fields/fieldNamesOfType.js +30 -0
- package/dist/fields/fieldNamesOfType.js.map +1 -0
- package/dist/fields/instanceOptions.js +20 -0
- package/dist/fields/instanceOptions.js.map +1 -0
- package/dist/fields/localizedIf.d.ts +13 -0
- package/dist/fields/localizedIf.js +12 -0
- package/dist/fields/localizedIf.js.map +1 -0
- package/dist/fields/registry.d.ts +3 -1
- package/dist/fields/registry.js +23 -8
- package/dist/fields/registry.js.map +1 -1
- package/dist/fields/sharedConfig.js +125 -59
- package/dist/fields/sharedConfig.js.map +1 -1
- package/dist/fields/types.d.ts +78 -9
- package/dist/flow/engine.d.ts +6 -4
- package/dist/flow/engine.js +11 -6
- package/dist/flow/engine.js.map +1 -1
- package/dist/flow/normalizeFlow.js +28 -9
- package/dist/flow/normalizeFlow.js.map +1 -1
- package/dist/flow/stepLabel.js +15 -0
- package/dist/flow/stepLabel.js.map +1 -0
- package/dist/flow/types.d.ts +12 -3
- package/dist/flow/types.js +11 -0
- package/dist/flow/types.js.map +1 -0
- package/dist/form/pollState.d.ts +23 -0
- package/dist/form/pollState.js +17 -0
- package/dist/form/pollState.js.map +1 -0
- package/dist/form/toFormDocument.d.ts +110 -0
- package/dist/form/toFormDocument.js +89 -0
- package/dist/form/toFormDocument.js.map +1 -0
- package/dist/form/types.d.ts +73 -0
- package/dist/index.d.ts +67 -61
- package/dist/index.js +120 -25
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +281 -0
- package/dist/plugin/applyRegistryConfig.d.ts +11 -0
- package/dist/plugin/applyRegistryConfig.js +20 -0
- package/dist/plugin/applyRegistryConfig.js.map +1 -0
- package/dist/plugin/customState.js +26 -0
- package/dist/plugin/customState.js.map +1 -0
- package/dist/plugin/registerCollections.js +43 -40
- package/dist/plugin/registerCollections.js.map +1 -1
- package/dist/plugin/uploadsCollection.d.ts +16 -0
- package/dist/plugin/uploadsCollection.js +53 -0
- package/dist/plugin/uploadsCollection.js.map +1 -0
- package/dist/poll/applyPollOptions.js +18 -0
- package/dist/poll/applyPollOptions.js.map +1 -0
- package/dist/poll/buildPollOptionSourceFields.js +50 -0
- package/dist/poll/buildPollOptionSourceFields.js.map +1 -0
- package/dist/poll/closeJob.d.ts +53 -0
- package/dist/poll/closeJob.js +121 -0
- package/dist/poll/closeJob.js.map +1 -0
- package/dist/poll/definePollOptionSource.d.ts +44 -0
- package/dist/poll/definePollOptionSource.js +6 -0
- package/dist/poll/definePollOptionSource.js.map +1 -0
- package/dist/poll/definePollType.d.ts +34 -0
- package/dist/poll/definePollType.js +6 -0
- package/dist/poll/definePollType.js.map +1 -0
- package/dist/poll/effectivePollOptions.d.ts +38 -0
- package/dist/poll/effectivePollOptions.js +64 -0
- package/dist/poll/effectivePollOptions.js.map +1 -0
- package/dist/poll/mostVoted.d.ts +21 -0
- package/dist/poll/mostVoted.js +32 -0
- package/dist/poll/mostVoted.js.map +1 -0
- package/dist/poll/outcomeBeforeChange.js +91 -0
- package/dist/poll/outcomeBeforeChange.js.map +1 -0
- package/dist/poll/outcomeFields.d.ts +38 -0
- package/dist/poll/outcomeFields.js +52 -0
- package/dist/poll/outcomeFields.js.map +1 -0
- package/dist/poll/pollTypeRegistry.d.ts +34 -0
- package/dist/poll/pollTypeRegistry.js +69 -0
- package/dist/poll/pollTypeRegistry.js.map +1 -0
- package/dist/poll/registry.d.ts +17 -0
- package/dist/poll/registry.js +12 -0
- package/dist/poll/registry.js.map +1 -0
- package/dist/poll/resolvePollCloseRequest.js +106 -0
- package/dist/poll/resolvePollCloseRequest.js.map +1 -0
- package/dist/poll/resolvePollOptions.d.ts +29 -0
- package/dist/poll/resolvePollOptions.js +52 -0
- package/dist/poll/resolvePollOptions.js.map +1 -0
- package/dist/poll/resolvePollOptionsRequest.js +50 -0
- package/dist/poll/resolvePollOptionsRequest.js.map +1 -0
- package/dist/poll/resolvePollOutcome.d.ts +40 -0
- package/dist/poll/resolvePollOutcome.js +90 -0
- package/dist/poll/resolvePollOutcome.js.map +1 -0
- package/dist/poll/resultsField.js +21 -0
- package/dist/poll/resultsField.js.map +1 -0
- package/dist/poll/votes/aggregateFromVotes.d.ts +27 -0
- package/dist/poll/votes/aggregateFromVotes.js +54 -0
- package/dist/poll/votes/aggregateFromVotes.js.map +1 -0
- package/dist/poll/votes/answerValues.js +16 -0
- package/dist/poll/votes/answerValues.js.map +1 -0
- package/dist/poll/votes/bumpPollVote.js +88 -0
- package/dist/poll/votes/bumpPollVote.js.map +1 -0
- package/dist/poll/votes/recountPollVotes.d.ts +20 -0
- package/dist/poll/votes/recountPollVotes.js +63 -0
- package/dist/poll/votes/recountPollVotes.js.map +1 -0
- package/dist/poll/votes/voteTallyHook.js +76 -0
- package/dist/poll/votes/voteTallyHook.js.map +1 -0
- package/dist/poll/votes/votesCollection.d.ts +19 -0
- package/dist/poll/votes/votesCollection.js +89 -0
- package/dist/poll/votes/votesCollection.js.map +1 -0
- package/dist/prefill/valuesFromSearchParams.js +5 -9
- package/dist/prefill/valuesFromSearchParams.js.map +1 -1
- package/dist/presentations/types.d.ts +3 -2
- package/dist/react/Form.d.ts +77 -35
- package/dist/react/Form.js +368 -222
- package/dist/react/Form.js.map +1 -1
- package/dist/react/FormContext.d.ts +51 -1
- package/dist/react/FormContext.js.map +1 -1
- package/dist/react/FormControls.d.ts +55 -0
- package/dist/react/FormControls.js +56 -0
- package/dist/react/FormControls.js.map +1 -0
- package/dist/react/FormFields.d.ts +18 -0
- package/dist/react/FormFields.js +114 -0
- package/dist/react/FormFields.js.map +1 -0
- package/dist/react/FormLayout.d.ts +4 -2
- package/dist/react/FormLayout.js +3 -2
- package/dist/react/FormLayout.js.map +1 -1
- package/dist/react/FormResults.d.ts +8 -3
- package/dist/react/FormResults.js +50 -29
- package/dist/react/FormResults.js.map +1 -1
- package/dist/react/FormSteps.d.ts +17 -0
- package/dist/react/FormSteps.js +35 -0
- package/dist/react/FormSteps.js.map +1 -0
- package/dist/react/Poll.d.ts +40 -6
- package/dist/react/Poll.js +137 -33
- package/dist/react/Poll.js.map +1 -1
- package/dist/react/adapters.d.ts +35 -0
- package/dist/react/adapters.js +11 -0
- package/dist/react/adapters.js.map +1 -0
- package/dist/react/captcha/HcaptchaCaptcha.d.ts +31 -0
- package/dist/react/captcha/HcaptchaCaptcha.js +53 -0
- package/dist/react/captcha/HcaptchaCaptcha.js.map +1 -0
- package/dist/react/captcha/RecaptchaCaptcha.d.ts +44 -0
- package/dist/react/captcha/RecaptchaCaptcha.js +93 -0
- package/dist/react/captcha/RecaptchaCaptcha.js.map +1 -0
- package/dist/react/captcha/TurnstileCaptcha.d.ts +31 -0
- package/dist/react/captcha/TurnstileCaptcha.js +53 -0
- package/dist/react/captcha/TurnstileCaptcha.js.map +1 -0
- package/dist/react/captcha/types.d.ts +8 -0
- package/dist/react/captcha/useCaptchaScript.js +63 -0
- package/dist/react/captcha/useCaptchaScript.js.map +1 -0
- package/dist/react/captcha/vendors.js +8 -0
- package/dist/react/captcha/vendors.js.map +1 -0
- package/dist/react/contract.d.ts +2 -3
- package/dist/react/contract.js.map +1 -1
- package/dist/react/fetchResults.d.ts +1 -1
- package/dist/react/fetchResults.js +1 -1
- package/dist/react/fetchResults.js.map +1 -1
- package/dist/react/presentation/DialogSurface.js +1 -4
- package/dist/react/presentation/DialogSurface.js.map +1 -1
- package/dist/react/primitives/Checkbox.d.ts +6 -2
- package/dist/react/primitives/Checkbox.js +4 -2
- package/dist/react/primitives/Checkbox.js.map +1 -1
- package/dist/react/primitives/ChoiceGroup.d.ts +40 -0
- package/dist/react/primitives/ChoiceGroup.js +33 -0
- package/dist/react/primitives/ChoiceGroup.js.map +1 -0
- package/dist/react/primitives/FieldShell.d.ts +13 -5
- package/dist/react/primitives/FieldShell.js +35 -32
- package/dist/react/primitives/FieldShell.js.map +1 -1
- package/dist/react/primitives/Input.d.ts +4 -2
- package/dist/react/primitives/Input.js +2 -1
- package/dist/react/primitives/Input.js.map +1 -1
- package/dist/react/renderers/calculation.js +7 -5
- package/dist/react/renderers/calculation.js.map +1 -1
- package/dist/react/renderers/checkbox.js +3 -5
- package/dist/react/renderers/checkbox.js.map +1 -1
- package/dist/react/renderers/consent.js +84 -36
- package/dist/react/renderers/consent.js.map +1 -1
- package/dist/react/renderers/date.js +33 -0
- package/dist/react/renderers/date.js.map +1 -0
- package/dist/react/renderers/email.js +4 -5
- package/dist/react/renderers/email.js.map +1 -1
- package/dist/react/renderers/file.js +29 -14
- package/dist/react/renderers/file.js.map +1 -1
- package/dist/react/renderers/index.js +7 -0
- package/dist/react/renderers/index.js.map +1 -1
- package/dist/react/renderers/message.js +41 -0
- package/dist/react/renderers/message.js.map +1 -0
- package/dist/react/renderers/number.js +1 -4
- package/dist/react/renderers/number.js.map +1 -1
- package/dist/react/renderers/region.js +43 -0
- package/dist/react/renderers/region.js.map +1 -0
- package/dist/react/renderers/repeater.js +32 -14
- package/dist/react/renderers/repeater.js.map +1 -1
- package/dist/react/renderers/select.js +21 -6
- package/dist/react/renderers/select.js.map +1 -1
- package/dist/react/renderers/text.js +4 -5
- package/dist/react/renderers/text.js.map +1 -1
- package/dist/react/renderers/textarea.js +1 -4
- package/dist/react/renderers/textarea.js.map +1 -1
- package/dist/react/state.d.ts +46 -3
- package/dist/react/state.js +73 -10
- package/dist/react/state.js.map +1 -1
- package/dist/react/submitForm.js +1 -1
- package/dist/react/submitForm.js.map +1 -1
- package/dist/react/uploadFile.d.ts +2 -2
- package/dist/react/uploadFile.js +1 -1
- package/dist/react/uploadFile.js.map +1 -1
- package/dist/react/useCalcValues.d.ts +10 -0
- package/dist/react/useCalcValues.js +13 -0
- package/dist/react/useCalcValues.js.map +1 -0
- package/dist/react/useField.d.ts +0 -1
- package/dist/react/useField.js +7 -6
- package/dist/react/useField.js.map +1 -1
- package/dist/react/useFormState.d.ts +1 -1
- package/dist/react/useFormState.js +1 -1
- package/dist/react/useFormState.js.map +1 -1
- package/dist/react/validateField.js +3 -6
- package/dist/react/validateField.js.map +1 -1
- package/dist/recall/interpolate.d.ts +4 -3
- package/dist/recall/interpolate.js +5 -4
- package/dist/recall/interpolate.js.map +1 -1
- package/dist/recall/resolver.d.ts +1 -1
- package/dist/recall/resolver.js +15 -3
- package/dist/recall/resolver.js.map +1 -1
- package/dist/spam/captcha.d.ts +4 -3
- package/dist/spam/captcha.js +4 -3
- package/dist/spam/captcha.js.map +1 -1
- package/dist/spam/clientIp.js +9 -0
- package/dist/spam/clientIp.js.map +1 -0
- package/dist/spam/constants.js +13 -1
- package/dist/spam/constants.js.map +1 -1
- package/dist/spam/identify.js +3 -6
- package/dist/spam/identify.js.map +1 -1
- package/dist/spam/providers/hcaptcha.d.ts +17 -0
- package/dist/spam/providers/hcaptcha.js +18 -0
- package/dist/spam/providers/hcaptcha.js.map +1 -0
- package/dist/spam/providers/recaptcha.d.ts +23 -0
- package/dist/spam/providers/recaptcha.js +23 -0
- package/dist/spam/providers/recaptcha.js.map +1 -0
- package/dist/spam/providers/siteverify.js +34 -0
- package/dist/spam/providers/siteverify.js.map +1 -0
- package/dist/spam/providers/turnstile.d.ts +17 -0
- package/dist/spam/providers/turnstile.js +18 -0
- package/dist/spam/providers/turnstile.js.map +1 -0
- package/dist/spam/resolveSpam.js +2 -1
- package/dist/spam/resolveSpam.js.map +1 -1
- package/dist/spam/spamGuard.js +25 -11
- package/dist/spam/spamGuard.js.map +1 -1
- package/dist/spam/types.d.ts +19 -4
- package/dist/submissions/SubmissionAnswers.js +6 -2
- package/dist/submissions/SubmissionAnswers.js.map +1 -1
- package/dist/submissions/SubmissionAnswersClient.js +100 -64
- package/dist/submissions/SubmissionAnswersClient.js.map +1 -1
- package/dist/submissions/coerceBoolean.js +14 -0
- package/dist/submissions/coerceBoolean.js.map +1 -0
- package/dist/submissions/createSubmission.d.ts +36 -0
- package/dist/submissions/createSubmission.js +26 -0
- package/dist/submissions/createSubmission.js.map +1 -0
- package/dist/submissions/formIdOf.js +13 -0
- package/dist/submissions/formIdOf.js.map +1 -0
- package/dist/submissions/resolveVotedSubmission.d.ts +27 -0
- package/dist/submissions/resolveVotedSubmission.js +51 -0
- package/dist/submissions/resolveVotedSubmission.js.map +1 -0
- package/dist/submissions/runSubmission.d.ts +10 -0
- package/dist/submissions/runSubmission.js +104 -54
- package/dist/submissions/runSubmission.js.map +1 -1
- package/dist/submissions/types.d.ts +11 -4
- package/dist/submissions/validateSubmission.js +99 -13
- package/dist/submissions/validateSubmission.js.map +1 -1
- package/dist/submissions/verifyContext.js +35 -0
- package/dist/submissions/verifyContext.js.map +1 -0
- package/dist/submissions/voteChangeEndpoint.js +105 -0
- package/dist/submissions/voteChangeEndpoint.js.map +1 -0
- package/dist/submissions/votedCookie.d.ts +15 -0
- package/dist/submissions/votedCookie.js +74 -0
- package/dist/submissions/votedCookie.js.map +1 -0
- package/dist/translations/clientRuntimeKeys.d.ts +17 -0
- package/dist/translations/clientRuntimeKeys.js +48 -0
- package/dist/translations/clientRuntimeKeys.js.map +1 -0
- package/dist/translations/de.d.ts +12 -0
- package/dist/translations/de.js +380 -0
- package/dist/translations/de.js.map +1 -0
- package/dist/translations/en.js +250 -28
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/index.d.ts +14 -5
- package/dist/translations/index.js +14 -3
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/keys.d.ts +245 -23
- package/dist/translations/keys.js +246 -24
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/makeTranslate.d.ts +7 -3
- package/dist/translations/makeTranslate.js +12 -3
- package/dist/translations/makeTranslate.js.map +1 -1
- package/dist/translations/server.js +8 -1
- package/dist/translations/server.js.map +1 -1
- package/dist/uploads/captureFileRef.d.ts +10 -3
- package/dist/uploads/captureFileRef.js +18 -9
- package/dist/uploads/captureFileRef.js.map +1 -1
- package/dist/uploads/formatBytes.d.ts +9 -0
- package/dist/uploads/formatBytes.js +25 -0
- package/dist/uploads/formatBytes.js.map +1 -0
- package/dist/uploads/resolveFileRef.js +3 -2
- package/dist/uploads/resolveFileRef.js.map +1 -1
- package/dist/uploads/types.d.ts +1 -2
- package/dist/validation/buildRuleBlocks.js +18 -17
- package/dist/validation/buildRuleBlocks.js.map +1 -1
- package/dist/validation/builtin/email.js +2 -1
- package/dist/validation/builtin/email.js.map +1 -1
- package/dist/validation/builtin/index.d.ts +14 -0
- package/dist/validation/builtin/index.js +14 -1
- package/dist/validation/builtin/index.js.map +1 -1
- package/dist/validation/builtin/integer.js +15 -0
- package/dist/validation/builtin/integer.js.map +1 -0
- package/dist/validation/builtin/matchesField.js +3 -7
- package/dist/validation/builtin/matchesField.js.map +1 -1
- package/dist/validation/builtin/max.js +1 -0
- package/dist/validation/builtin/max.js.map +1 -1
- package/dist/validation/builtin/maxDate.js +24 -0
- package/dist/validation/builtin/maxDate.js.map +1 -0
- package/dist/validation/builtin/maxLength.js +1 -0
- package/dist/validation/builtin/maxLength.js.map +1 -1
- package/dist/validation/builtin/min.js +1 -0
- package/dist/validation/builtin/min.js.map +1 -1
- package/dist/validation/builtin/minDate.js +24 -0
- package/dist/validation/builtin/minDate.js.map +1 -0
- package/dist/validation/builtin/minLength.js +1 -0
- package/dist/validation/builtin/minLength.js.map +1 -1
- package/dist/validation/builtin/notAlreadySubmitted.js +5 -1
- package/dist/validation/builtin/notAlreadySubmitted.js.map +1 -1
- package/dist/validation/builtin/oneOf.js +1 -0
- package/dist/validation/builtin/oneOf.js.map +1 -1
- package/dist/validation/builtin/pattern.js +11 -2
- package/dist/validation/builtin/pattern.js.map +1 -1
- package/dist/validation/builtin/url.js +1 -0
- package/dist/validation/builtin/url.js.map +1 -1
- package/dist/validation/builtin/validateDateBound.js +18 -0
- package/dist/validation/builtin/validateDateBound.js.map +1 -0
- package/dist/validation/builtin/validateRegexParams.js +44 -0
- package/dist/validation/builtin/validateRegexParams.js.map +1 -0
- package/dist/validation/emailPattern.js +10 -0
- package/dist/validation/emailPattern.js.map +1 -0
- package/dist/validation/fieldTargetParam.d.ts +22 -0
- package/dist/validation/fieldTargetParam.js +38 -0
- package/dist/validation/fieldTargetParam.js.map +1 -0
- package/dist/validation/registry.d.ts +2 -1
- package/dist/validation/registry.js +2 -9
- package/dist/validation/registry.js.map +1 -1
- package/dist/validation/runValidation.js +8 -29
- package/dist/validation/runValidation.js.map +1 -1
- package/dist/validation/types.d.ts +5 -11
- package/dist/validation/validateUrl.js +22 -0
- package/dist/validation/validateUrl.js.map +1 -0
- package/package.json +14 -6
- package/styles/form-builder.css +94 -190
- package/dist/collections/uploads.d.ts +0 -30
- package/dist/collections/uploads.js +0 -55
- package/dist/collections/uploads.js.map +0 -1
- package/dist/consent/buildConsentSourceConfig.js +0 -49
- package/dist/consent/buildConsentSourceConfig.js.map +0 -1
- package/dist/consent/builtin/index.d.ts +0 -7
- package/dist/consent/builtin/index.js +0 -11
- package/dist/consent/builtin/index.js.map +0 -1
- package/dist/consent/builtin/pageReference.js +0 -75
- package/dist/consent/builtin/pageReference.js.map +0 -1
- package/dist/consent/builtin/static.js +0 -44
- package/dist/consent/builtin/static.js.map +0 -1
- package/dist/consent/defineConsentSource.d.ts +0 -35
- package/dist/consent/defineConsentSource.js +0 -6
- package/dist/consent/defineConsentSource.js.map +0 -1
- package/dist/consent/registry.d.ts +0 -16
- package/dist/consent/registry.js +0 -16
- package/dist/consent/registry.js.map +0 -1
- package/dist/consent/resolveConsentLinks.d.ts +0 -19
- package/dist/consent/resolveConsentLinks.js +0 -26
- package/dist/consent/resolveConsentLinks.js.map +0 -1
- package/dist/presentations/registry.d.ts +0 -15
- package/dist/presentations/registry.js +0 -15
- package/dist/presentations/registry.js.map +0 -1
- package/dist/react/toFormDocument.d.ts +0 -24
- package/dist/react/toFormDocument.js +0 -22
- package/dist/react/toFormDocument.js.map +0 -1
package/styles/form-builder.css
CHANGED
|
@@ -72,6 +72,90 @@
|
|
|
72
72
|
right: 0.5rem;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/* Select field radio/buttons displays. */
|
|
76
|
+
.fb-choice {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 0.5rem;
|
|
80
|
+
}
|
|
81
|
+
.fb-choice__option {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: 0.5rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.fb-choice--buttons {
|
|
88
|
+
flex-direction: row;
|
|
89
|
+
flex-wrap: wrap;
|
|
90
|
+
}
|
|
91
|
+
.fb-choice--buttons .fb-choice__option {
|
|
92
|
+
position: relative;
|
|
93
|
+
padding: 0.5rem 1rem;
|
|
94
|
+
border: 1px solid var(--fb-choice-border, currentColor);
|
|
95
|
+
border-radius: 0.375rem;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
/* The input stays in the a11y tree and keyboard-operable; it is only visually hidden, not
|
|
99
|
+
* display:none, so focus and click targeting keep working through the label. */
|
|
100
|
+
.fb-choice--buttons .fb-choice__option input {
|
|
101
|
+
position: absolute;
|
|
102
|
+
width: 1px;
|
|
103
|
+
height: 1px;
|
|
104
|
+
margin: 0;
|
|
105
|
+
opacity: 0;
|
|
106
|
+
}
|
|
107
|
+
.fb-choice--buttons .fb-choice__option:has(input:checked) {
|
|
108
|
+
border-color: var(--fb-choice-selected, currentColor);
|
|
109
|
+
background: var(--fb-choice-selected-bg, rgba(0, 0, 0, 0.05));
|
|
110
|
+
}
|
|
111
|
+
.fb-choice--buttons .fb-choice__option:has(input:focus-visible) {
|
|
112
|
+
outline: 2px solid var(--fb-choice-focus, currentColor);
|
|
113
|
+
outline-offset: 2px;
|
|
114
|
+
}
|
|
115
|
+
.fb-choice--buttons .fb-choice__option:has(input:disabled) {
|
|
116
|
+
cursor: not-allowed;
|
|
117
|
+
opacity: var(--fb-choice-disabled-opacity, 0.5);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Checkbox field switch display: same input, appearance:none + track/thumb painted via background. */
|
|
121
|
+
.fb-switch {
|
|
122
|
+
appearance: none;
|
|
123
|
+
-webkit-appearance: none;
|
|
124
|
+
width: 2.5rem;
|
|
125
|
+
height: 1.5rem;
|
|
126
|
+
margin: 0;
|
|
127
|
+
border-radius: 999px;
|
|
128
|
+
background: var(--fb-switch-track, rgba(0, 0, 0, 0.25));
|
|
129
|
+
position: relative;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
flex-shrink: 0;
|
|
132
|
+
}
|
|
133
|
+
.fb-switch::before {
|
|
134
|
+
content: '';
|
|
135
|
+
position: absolute;
|
|
136
|
+
top: 0.125rem;
|
|
137
|
+
left: 0.125rem;
|
|
138
|
+
width: 1.25rem;
|
|
139
|
+
height: 1.25rem;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
background: var(--fb-switch-thumb, #fff);
|
|
142
|
+
transition: transform 0.15s ease;
|
|
143
|
+
}
|
|
144
|
+
.fb-switch:checked {
|
|
145
|
+
background: var(--fb-switch-track-checked, currentColor);
|
|
146
|
+
}
|
|
147
|
+
.fb-switch:checked::before {
|
|
148
|
+
transform: translateX(1rem);
|
|
149
|
+
}
|
|
150
|
+
.fb-switch:focus-visible {
|
|
151
|
+
outline: 2px solid var(--fb-choice-focus, currentColor);
|
|
152
|
+
outline-offset: 2px;
|
|
153
|
+
}
|
|
154
|
+
.fb-switch:disabled {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
opacity: var(--fb-choice-disabled-opacity, 0.5);
|
|
157
|
+
}
|
|
158
|
+
|
|
75
159
|
/* Poll / survey results: per-option bars. The text carries the meaning; the bar is decorative. */
|
|
76
160
|
.fb-results__field {
|
|
77
161
|
margin-block: 1rem;
|
|
@@ -101,198 +185,18 @@
|
|
|
101
185
|
height: 100%;
|
|
102
186
|
background: var(--fb-results-fill, currentColor);
|
|
103
187
|
}
|
|
104
|
-
.fb-
|
|
105
|
-
margin-block-start: 0.5rem;
|
|
106
|
-
opacity: 0.7;
|
|
107
|
-
font-size: 0.875em;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* Flow builder (admin UI only, requires Payload theme variables). */
|
|
111
|
-
.fb-flow-builder {
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
gap: 0.5rem;
|
|
115
|
-
margin-block-end: 1rem;
|
|
116
|
-
}
|
|
117
|
-
.fb-flow-builder__hint {
|
|
118
|
-
color: var(--theme-elevation-400);
|
|
119
|
-
font-size: 0.875rem;
|
|
120
|
-
margin: 0;
|
|
121
|
-
}
|
|
122
|
-
.fb-flow-builder__steps {
|
|
123
|
-
display: flex;
|
|
124
|
-
flex-direction: column;
|
|
125
|
-
gap: 0.5rem;
|
|
126
|
-
}
|
|
127
|
-
.fb-flow-builder__actions {
|
|
128
|
-
margin-block-start: 0.25rem;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.fb-flow-step__header-content {
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: 0.5rem;
|
|
135
|
-
overflow: hidden;
|
|
136
|
-
}
|
|
137
|
-
.fb-flow-step__index {
|
|
138
|
-
font-size: 0.6875rem;
|
|
139
|
-
font-weight: 600;
|
|
140
|
-
text-transform: uppercase;
|
|
141
|
-
letter-spacing: 0.04em;
|
|
142
|
-
color: var(--theme-elevation-400);
|
|
143
|
-
flex-shrink: 0;
|
|
144
|
-
}
|
|
145
|
-
.fb-flow-step__id-preview {
|
|
146
|
-
font-size: 0.875rem;
|
|
147
|
-
overflow: hidden;
|
|
148
|
-
text-overflow: ellipsis;
|
|
149
|
-
white-space: nowrap;
|
|
150
|
-
}
|
|
151
|
-
.fb-flow-step__id-preview em {
|
|
152
|
-
color: var(--theme-elevation-400);
|
|
153
|
-
font-style: italic;
|
|
154
|
-
}
|
|
155
|
-
.fb-flow-step__body {
|
|
156
|
-
padding: 0.75rem;
|
|
157
|
-
display: flex;
|
|
158
|
-
flex-direction: column;
|
|
159
|
-
gap: 0.25rem;
|
|
160
|
-
}
|
|
161
|
-
.fb-flow-step__row {
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
gap: 0.25rem;
|
|
165
|
-
}
|
|
166
|
-
.fb-flow-step__hint {
|
|
167
|
-
font-size: 0.75rem;
|
|
168
|
-
color: var(--theme-elevation-400);
|
|
169
|
-
margin: 0;
|
|
170
|
-
}
|
|
171
|
-
.fb-flow-step__field-picker {
|
|
172
|
-
display: flex;
|
|
173
|
-
flex-wrap: wrap;
|
|
174
|
-
gap: 0.25rem 1.25rem;
|
|
175
|
-
padding-block: 0.25rem;
|
|
176
|
-
}
|
|
177
|
-
.fb-flow-step__transitions {
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-direction: column;
|
|
180
|
-
gap: 0.5rem;
|
|
181
|
-
padding-block-start: 0.5rem;
|
|
182
|
-
}
|
|
183
|
-
.fb-flow-step__transitions-header {
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: baseline;
|
|
186
|
-
gap: 0.5rem;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.fb-flow-transition {
|
|
190
|
-
border: 1px solid var(--theme-border-color);
|
|
191
|
-
border-radius: var(--style-radius-s);
|
|
192
|
-
padding: 0.5rem 0.75rem;
|
|
193
|
-
display: flex;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
gap: 0.5rem;
|
|
196
|
-
}
|
|
197
|
-
.fb-flow-transition__header {
|
|
198
|
-
display: flex;
|
|
199
|
-
align-items: center;
|
|
200
|
-
gap: 0.5rem;
|
|
201
|
-
}
|
|
202
|
-
.fb-flow-transition__label {
|
|
203
|
-
font-size: 0.6875rem;
|
|
204
|
-
font-weight: 600;
|
|
205
|
-
text-transform: uppercase;
|
|
206
|
-
letter-spacing: 0.04em;
|
|
207
|
-
color: var(--theme-elevation-400);
|
|
208
|
-
flex-shrink: 0;
|
|
209
|
-
}
|
|
210
|
-
.fb-flow-transition__goto {
|
|
211
|
-
flex: 1;
|
|
212
|
-
min-width: 0;
|
|
213
|
-
}
|
|
214
|
-
.fb-flow-transition__actions {
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
gap: 0.25rem;
|
|
218
|
-
flex-shrink: 0;
|
|
219
|
-
}
|
|
220
|
-
.fb-flow-transition__when-label {
|
|
221
|
-
font-size: 0.6875rem;
|
|
188
|
+
.fb-results__bucket--winner {
|
|
222
189
|
font-weight: 600;
|
|
223
|
-
text-transform: uppercase;
|
|
224
|
-
letter-spacing: 0.04em;
|
|
225
|
-
color: var(--theme-elevation-400);
|
|
226
|
-
}
|
|
227
|
-
.fb-flow-transition__condition {
|
|
228
|
-
padding-inline-start: 0.25rem;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* Condition builder (admin UI only, requires Payload theme variables). */
|
|
232
|
-
.fb-condition-builder {
|
|
233
|
-
display: flex;
|
|
234
|
-
flex-direction: column;
|
|
235
|
-
gap: 0.5rem;
|
|
236
|
-
}
|
|
237
|
-
.fb-condition-builder__hint {
|
|
238
|
-
color: var(--theme-elevation-400);
|
|
239
|
-
font-size: 0.875rem;
|
|
240
|
-
margin: 0;
|
|
241
|
-
}
|
|
242
|
-
.fb-condition-builder__group {
|
|
243
|
-
display: flex;
|
|
244
|
-
flex-direction: column;
|
|
245
|
-
gap: 0.375rem;
|
|
246
|
-
padding: 0.75rem;
|
|
247
|
-
border: 1px solid var(--theme-border-color);
|
|
248
|
-
border-radius: var(--style-radius-m);
|
|
249
|
-
}
|
|
250
|
-
.fb-condition-builder__or-label {
|
|
251
|
-
display: inline-block;
|
|
252
|
-
font-size: 11px;
|
|
253
|
-
font-weight: 500;
|
|
254
|
-
text-transform: uppercase;
|
|
255
|
-
margin-block: 0.125rem;
|
|
256
|
-
}
|
|
257
|
-
.fb-condition-builder__and-row {
|
|
258
|
-
display: flex;
|
|
259
|
-
flex-direction: column;
|
|
260
|
-
gap: 0.25rem;
|
|
261
190
|
}
|
|
262
|
-
.fb-
|
|
263
|
-
|
|
264
|
-
font-
|
|
191
|
+
.fb-results__winner-badge {
|
|
192
|
+
margin-inline-start: 0.375rem;
|
|
193
|
+
font-size: 0.75em;
|
|
265
194
|
text-transform: uppercase;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
.fb-condition-builder__add-condition {
|
|
269
|
-
align-self: flex-start;
|
|
270
|
-
margin-block-start: 0.25rem;
|
|
271
|
-
}
|
|
272
|
-
.fb-condition-builder__actions {
|
|
273
|
-
display: flex;
|
|
274
|
-
gap: 0.5rem;
|
|
275
|
-
margin-top: 0.5rem;
|
|
276
|
-
}
|
|
277
|
-
.fb-condition-row {
|
|
278
|
-
display: flex;
|
|
279
|
-
align-items: flex-start;
|
|
280
|
-
gap: 0.5rem;
|
|
281
|
-
flex-wrap: nowrap;
|
|
282
|
-
}
|
|
283
|
-
.fb-condition-row__field {
|
|
284
|
-
flex: 1 1 9rem;
|
|
285
|
-
min-width: 0;
|
|
286
|
-
}
|
|
287
|
-
.fb-condition-row__operator {
|
|
288
|
-
flex: 0 1 9rem;
|
|
289
|
-
min-width: 0;
|
|
290
|
-
}
|
|
291
|
-
.fb-condition-row__value {
|
|
292
|
-
flex: 1 1 9rem;
|
|
293
|
-
min-width: 0;
|
|
195
|
+
letter-spacing: 0.05em;
|
|
196
|
+
opacity: 0.7;
|
|
294
197
|
}
|
|
295
|
-
.fb-
|
|
296
|
-
|
|
297
|
-
|
|
198
|
+
.fb-results__total {
|
|
199
|
+
margin-block-start: 0.5rem;
|
|
200
|
+
opacity: 0.7;
|
|
201
|
+
font-size: 0.875em;
|
|
298
202
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CollectionOverrides } from "../plugin/collectionOverrides.js";
|
|
2
|
-
import { CollectionConfig } from "payload";
|
|
3
|
-
|
|
4
|
-
//#region src/collections/uploads.d.ts
|
|
5
|
-
declare const FORM_UPLOADS_SLUG = "form-uploads";
|
|
6
|
-
/** Override surface for the built-in upload collection. */
|
|
7
|
-
type UploadsCollectionConfig = {
|
|
8
|
-
slug?: string; /** Merged onto the collection's `upload` config (e.g. `staticDir`, `mimeTypes`). `true` uses Payload defaults. */
|
|
9
|
-
upload?: NonNullable<CollectionConfig['upload']> | true; /** Replace access (defaults: anonymous create, authed read/update/delete). */
|
|
10
|
-
access?: CollectionConfig['access']; /** Append extra fields. */
|
|
11
|
-
fields?: CollectionConfig['fields'];
|
|
12
|
-
};
|
|
13
|
-
type UploadsOption = boolean | UploadsCollectionConfig;
|
|
14
|
-
/**
|
|
15
|
-
* The built-in upload collection backing the `file` field. Anonymous create (public forms upload here),
|
|
16
|
-
* authed read/update/delete (only admins read stored files; submitters cannot enumerate others' uploads).
|
|
17
|
-
* Per-field MIME/size is re-enforced at submit, so the collection stays permissive by default. No
|
|
18
|
-
* `imageSizes`, so it needs no `sharp`. Projects with their own upload collection set `uploads: false` and
|
|
19
|
-
* point the file field's `relationTo` at theirs.
|
|
20
|
-
*/
|
|
21
|
-
declare const buildUploadsCollection: (config?: UploadsCollectionConfig, overrides?: CollectionOverrides) => CollectionConfig;
|
|
22
|
-
/** Resolve the `uploads` plugin option: `false` disables, `true`/object enables the built-in collection. */
|
|
23
|
-
declare const resolveUploads: (option: UploadsOption | undefined) => {
|
|
24
|
-
enabled: boolean;
|
|
25
|
-
slug: string;
|
|
26
|
-
collection?: CollectionConfig;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
export { FORM_UPLOADS_SLUG, UploadsCollectionConfig, UploadsOption, buildUploadsCollection, resolveUploads };
|
|
30
|
-
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { isLoggedIn } from "../plugin/access.js";
|
|
2
|
-
//#region src/collections/uploads.ts
|
|
3
|
-
const FORM_UPLOADS_SLUG = "form-uploads";
|
|
4
|
-
/**
|
|
5
|
-
* The built-in upload collection backing the `file` field. Anonymous create (public forms upload here),
|
|
6
|
-
* authed read/update/delete (only admins read stored files; submitters cannot enumerate others' uploads).
|
|
7
|
-
* Per-field MIME/size is re-enforced at submit, so the collection stays permissive by default. No
|
|
8
|
-
* `imageSizes`, so it needs no `sharp`. Projects with their own upload collection set `uploads: false` and
|
|
9
|
-
* point the file field's `relationTo` at theirs.
|
|
10
|
-
*/
|
|
11
|
-
const buildUploadsCollection = (config = {}, overrides) => {
|
|
12
|
-
const defaultFields = [{
|
|
13
|
-
name: "owner",
|
|
14
|
-
type: "text",
|
|
15
|
-
admin: {
|
|
16
|
-
readOnly: true,
|
|
17
|
-
hidden: true
|
|
18
|
-
}
|
|
19
|
-
}, ...config.fields ?? []];
|
|
20
|
-
return {
|
|
21
|
-
...overrides ?? {},
|
|
22
|
-
slug: config.slug ?? "form-uploads",
|
|
23
|
-
access: {
|
|
24
|
-
create: () => true,
|
|
25
|
-
read: isLoggedIn,
|
|
26
|
-
update: isLoggedIn,
|
|
27
|
-
delete: isLoggedIn,
|
|
28
|
-
...config.access ?? {},
|
|
29
|
-
...overrides?.access ?? {}
|
|
30
|
-
},
|
|
31
|
-
admin: {
|
|
32
|
-
group: "Forms",
|
|
33
|
-
...overrides?.admin ?? {}
|
|
34
|
-
},
|
|
35
|
-
upload: config.upload && config.upload !== true ? config.upload : true,
|
|
36
|
-
fields: overrides?.fields ? overrides.fields({ defaultFields }) : defaultFields
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
/** Resolve the `uploads` plugin option: `false` disables, `true`/object enables the built-in collection. */
|
|
40
|
-
const resolveUploads = (option) => {
|
|
41
|
-
if (option === false) return {
|
|
42
|
-
enabled: false,
|
|
43
|
-
slug: FORM_UPLOADS_SLUG
|
|
44
|
-
};
|
|
45
|
-
const collection = buildUploadsCollection(option && option !== true ? option : {});
|
|
46
|
-
return {
|
|
47
|
-
enabled: true,
|
|
48
|
-
slug: collection.slug,
|
|
49
|
-
collection
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { FORM_UPLOADS_SLUG, buildUploadsCollection, resolveUploads };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=uploads.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.js","names":[],"sources":["../../src/collections/uploads.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\nimport { isLoggedIn } from '../plugin/access'\nimport type { CollectionOverrides } from '../plugin/collectionOverrides'\n\nexport const FORM_UPLOADS_SLUG = 'form-uploads'\n\n/** Override surface for the built-in upload collection. */\nexport type UploadsCollectionConfig = {\n\tslug?: string\n\t/** Merged onto the collection's `upload` config (e.g. `staticDir`, `mimeTypes`). `true` uses Payload defaults. */\n\tupload?: NonNullable<CollectionConfig['upload']> | true\n\t/** Replace access (defaults: anonymous create, authed read/update/delete). */\n\taccess?: CollectionConfig['access']\n\t/** Append extra fields. */\n\tfields?: CollectionConfig['fields']\n}\n\nexport type UploadsOption = boolean | UploadsCollectionConfig\n\n/**\n * The built-in upload collection backing the `file` field. Anonymous create (public forms upload here),\n * authed read/update/delete (only admins read stored files; submitters cannot enumerate others' uploads).\n * Per-field MIME/size is re-enforced at submit, so the collection stays permissive by default. No\n * `imageSizes`, so it needs no `sharp`. Projects with their own upload collection set `uploads: false` and\n * point the file field's `relationTo` at theirs.\n */\nexport const buildUploadsCollection = (\n\tconfig: UploadsCollectionConfig = {},\n\toverrides?: CollectionOverrides\n): CollectionConfig => {\n\tconst defaultFields: Field[] = [\n\t\t{ name: 'owner', type: 'text', admin: { readOnly: true, hidden: true } },\n\t\t...(config.fields ?? []),\n\t]\n\n\treturn {\n\t\t...(overrides ?? {}),\n\t\tslug: config.slug ?? FORM_UPLOADS_SLUG,\n\t\taccess: {\n\t\t\tcreate: () => true,\n\t\t\tread: isLoggedIn,\n\t\t\tupdate: isLoggedIn,\n\t\t\tdelete: isLoggedIn,\n\t\t\t...(config.access ?? {}),\n\t\t\t...(overrides?.access ?? {}),\n\t\t},\n\t\tadmin: { group: 'Forms', ...(overrides?.admin ?? {}) },\n\t\tupload: config.upload && config.upload !== true ? config.upload : true,\n\t\tfields: overrides?.fields ? overrides.fields({ defaultFields }) : defaultFields,\n\t}\n}\n\n/** Resolve the `uploads` plugin option: `false` disables, `true`/object enables the built-in collection. */\nexport const resolveUploads = (\n\toption: UploadsOption | undefined\n): { enabled: boolean; slug: string; collection?: CollectionConfig } => {\n\tif (option === false) {\n\t\treturn { enabled: false, slug: FORM_UPLOADS_SLUG }\n\t}\n\tconst config = option && option !== true ? option : {}\n\tconst collection = buildUploadsCollection(config)\n\treturn { enabled: true, slug: collection.slug as string, collection }\n}\n"],"mappings":";;AAIA,MAAa,oBAAoB;;;;;;;;AAsBjC,MAAa,0BACZ,SAAkC,CAAC,GACnC,cACsB;CACtB,MAAM,gBAAyB,CAC9B;EAAE,MAAM;EAAS,MAAM;EAAQ,OAAO;GAAE,UAAU;GAAM,QAAQ;EAAK;CAAE,GACvE,GAAI,OAAO,UAAU,CAAC,CACvB;CAEA,OAAO;EACN,GAAI,aAAa,CAAC;EAClB,MAAM,OAAO,QAAA;EACb,QAAQ;GACP,cAAc;GACd,MAAM;GACN,QAAQ;GACR,QAAQ;GACR,GAAI,OAAO,UAAU,CAAC;GACtB,GAAI,WAAW,UAAU,CAAC;EAC3B;EACA,OAAO;GAAE,OAAO;GAAS,GAAI,WAAW,SAAS,CAAC;EAAG;EACrD,QAAQ,OAAO,UAAU,OAAO,WAAW,OAAO,OAAO,SAAS;EAClE,QAAQ,WAAW,SAAS,UAAU,OAAO,EAAE,cAAc,CAAC,IAAI;CACnE;AACD;;AAGA,MAAa,kBACZ,WACuE;CACvE,IAAI,WAAW,OACd,OAAO;EAAE,SAAS;EAAO,MAAM;CAAkB;CAGlD,MAAM,aAAa,uBADJ,UAAU,WAAW,OAAO,SAAS,CAAC,CACL;CAChD,OAAO;EAAE,SAAS;EAAM,MAAM,WAAW;EAAgB;CAAW;AACrE"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { keys } from "../translations/keys.js";
|
|
2
|
-
import { labelFor } from "../translations/server.js";
|
|
3
|
-
//#region src/consent/buildConsentSourceConfig.ts
|
|
4
|
-
/**
|
|
5
|
-
* Builds the `source` select and `sourceConfig` group for the consent field block.
|
|
6
|
-
* Fields inside `sourceConfig` are annotated with `admin.condition` so only the
|
|
7
|
-
* fields that belong to the currently selected source type are visible in the admin UI.
|
|
8
|
-
*
|
|
9
|
-
* `resolveConsentLinks` reads `field.sourceConfig` as a flat object; field names within
|
|
10
|
-
* that group must be unique across all registered sources. Built-in sources (static,
|
|
11
|
-
* pageReference) have no overlapping names. Custom sources should follow the same rule.
|
|
12
|
-
*/
|
|
13
|
-
const buildConsentSourceConfig = (registry) => {
|
|
14
|
-
const sources = [...registry.values()];
|
|
15
|
-
const firstType = sources[0]?.type ?? "static";
|
|
16
|
-
const sourceConfigFields = sources.flatMap((source) => (source.config ?? []).map((field) => {
|
|
17
|
-
const existingAdmin = typeof field.admin === "object" && field.admin !== null ? field.admin : {};
|
|
18
|
-
return {
|
|
19
|
-
...field,
|
|
20
|
-
admin: {
|
|
21
|
-
...existingAdmin,
|
|
22
|
-
condition: (data) => data?.source === source.type
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}));
|
|
26
|
-
return [{
|
|
27
|
-
name: "source",
|
|
28
|
-
type: "select",
|
|
29
|
-
defaultValue: firstType,
|
|
30
|
-
label: labelFor(keys.consentConfigSource),
|
|
31
|
-
options: sources.map((s) => ({
|
|
32
|
-
label: labelFor(s.label),
|
|
33
|
-
value: s.type
|
|
34
|
-
}))
|
|
35
|
-
}, {
|
|
36
|
-
name: "sourceConfig",
|
|
37
|
-
type: "group",
|
|
38
|
-
label: labelFor(keys.consentConfigSourceConfig),
|
|
39
|
-
fields: sourceConfigFields.length > 0 ? sourceConfigFields : [{
|
|
40
|
-
name: "_placeholder",
|
|
41
|
-
type: "text",
|
|
42
|
-
admin: { hidden: true }
|
|
43
|
-
}]
|
|
44
|
-
}];
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
export { buildConsentSourceConfig };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=buildConsentSourceConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildConsentSourceConfig.js","names":[],"sources":["../../src/consent/buildConsentSourceConfig.ts"],"sourcesContent":["import type { Field } from 'payload'\nimport { keys } from '../translations/keys'\nimport { labelFor } from '../translations/server'\nimport type { ConsentSourceRegistry } from './registry'\n\n/**\n * Builds the `source` select and `sourceConfig` group for the consent field block.\n * Fields inside `sourceConfig` are annotated with `admin.condition` so only the\n * fields that belong to the currently selected source type are visible in the admin UI.\n *\n * `resolveConsentLinks` reads `field.sourceConfig` as a flat object; field names within\n * that group must be unique across all registered sources. Built-in sources (static,\n * pageReference) have no overlapping names. Custom sources should follow the same rule.\n */\nexport const buildConsentSourceConfig = (registry: ConsentSourceRegistry): Field[] => {\n\tconst sources = [...registry.values()]\n\tconst firstType = sources[0]?.type ?? 'static'\n\n\tconst sourceConfigFields: Field[] = sources.flatMap((source) =>\n\t\t(source.config ?? []).map((field) => {\n\t\t\tconst existingAdmin =\n\t\t\t\ttypeof field.admin === 'object' && field.admin !== null ? field.admin : {}\n\t\t\treturn {\n\t\t\t\t...field,\n\t\t\t\tadmin: {\n\t\t\t\t\t...existingAdmin,\n\t\t\t\t\tcondition: (data: unknown) => (data as Record<string, unknown>)?.source === source.type,\n\t\t\t\t},\n\t\t\t} as Field\n\t\t})\n\t)\n\n\treturn [\n\t\t{\n\t\t\tname: 'source',\n\t\t\ttype: 'select',\n\t\t\tdefaultValue: firstType,\n\t\t\tlabel: labelFor(keys.consentConfigSource),\n\t\t\toptions: sources.map((s) => ({\n\t\t\t\tlabel: labelFor(s.label),\n\t\t\t\tvalue: s.type,\n\t\t\t})),\n\t\t},\n\t\t{\n\t\t\tname: 'sourceConfig',\n\t\t\ttype: 'group',\n\t\t\tlabel: labelFor(keys.consentConfigSourceConfig),\n\t\t\tfields:\n\t\t\t\tsourceConfigFields.length > 0\n\t\t\t\t\t? sourceConfigFields\n\t\t\t\t\t: [{ name: '_placeholder', type: 'text', admin: { hidden: true } }],\n\t\t},\n\t]\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAa,4BAA4B,aAA6C;CACrF,MAAM,UAAU,CAAC,GAAG,SAAS,OAAO,CAAC;CACrC,MAAM,YAAY,QAAQ,IAAI,QAAQ;CAEtC,MAAM,qBAA8B,QAAQ,SAAS,YACnD,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU;EACpC,MAAM,gBACL,OAAO,MAAM,UAAU,YAAY,MAAM,UAAU,OAAO,MAAM,QAAQ,CAAC;EAC1E,OAAO;GACN,GAAG;GACH,OAAO;IACN,GAAG;IACH,YAAY,SAAmB,MAAkC,WAAW,OAAO;GACpF;EACD;CACD,CAAC,CACF;CAEA,OAAO,CACN;EACC,MAAM;EACN,MAAM;EACN,cAAc;EACd,OAAO,SAAS,KAAK,mBAAmB;EACxC,SAAS,QAAQ,KAAK,OAAO;GAC5B,OAAO,SAAS,EAAE,KAAK;GACvB,OAAO,EAAE;EACV,EAAE;CACH,GACA;EACC,MAAM;EACN,MAAM;EACN,OAAO,SAAS,KAAK,yBAAyB;EAC9C,QACC,mBAAmB,SAAS,IACzB,qBACA,CAAC;GAAE,MAAM;GAAgB,MAAM;GAAQ,OAAO,EAAE,QAAQ,KAAK;EAAE,CAAC;CACrE,CACD;AACD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AnyConsentSource } from "../defineConsentSource.js";
|
|
2
|
-
|
|
3
|
-
//#region src/consent/builtin/index.d.ts
|
|
4
|
-
declare const defaultConsentSources: Record<string, AnyConsentSource>;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { defaultConsentSources };
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { pageReferenceSource } from "./pageReference.js";
|
|
2
|
-
import { staticSource } from "./static.js";
|
|
3
|
-
//#region src/consent/builtin/index.ts
|
|
4
|
-
const defaultConsentSources = {
|
|
5
|
-
static: staticSource,
|
|
6
|
-
pageReference: pageReferenceSource
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { defaultConsentSources };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/consent/builtin/index.ts"],"sourcesContent":["import type { AnyConsentSource } from '../defineConsentSource'\nimport { pageReferenceSource } from './pageReference'\nimport { staticSource } from './static'\n\nexport const defaultConsentSources: Record<string, AnyConsentSource> = {\n\tstatic: staticSource as AnyConsentSource,\n\tpageReference: pageReferenceSource as AnyConsentSource,\n}\n"],"mappings":";;;AAIA,MAAa,wBAA0D;CACtE,QAAQ;CACR,eAAe;AAChB"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { keys } from "../../translations/keys.js";
|
|
2
|
-
import { labelFor } from "../../translations/server.js";
|
|
3
|
-
import { defineConsentSource } from "../defineConsentSource.js";
|
|
4
|
-
import { resolvePublishedVersionRef } from "../resolvePublishedVersionRef.js";
|
|
5
|
-
//#region src/consent/builtin/pageReference.ts
|
|
6
|
-
const pageReferenceSource = defineConsentSource({
|
|
7
|
-
type: "pageReference",
|
|
8
|
-
label: keys.consentSourcePageReference,
|
|
9
|
-
config: [
|
|
10
|
-
{
|
|
11
|
-
name: "relationTo",
|
|
12
|
-
type: "text",
|
|
13
|
-
label: labelFor(keys.consentConfigRelationTo)
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "docId",
|
|
17
|
-
type: "text",
|
|
18
|
-
label: labelFor(keys.consentConfigDocId)
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "urlField",
|
|
22
|
-
type: "text",
|
|
23
|
-
label: labelFor(keys.consentConfigUrlField),
|
|
24
|
-
defaultValue: "slug"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "captureVersion",
|
|
28
|
-
type: "checkbox",
|
|
29
|
-
label: labelFor(keys.consentConfigCaptureVersion)
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
resolve: async ({ config, payload, req, locale }) => {
|
|
33
|
-
const relationTo = String(config.relationTo ?? "");
|
|
34
|
-
const docId = String(config.docId ?? "");
|
|
35
|
-
const urlField = String(config.urlField ?? "slug");
|
|
36
|
-
const captureVersion = Boolean(config.captureVersion);
|
|
37
|
-
if (!relationTo || !docId) return { links: [] };
|
|
38
|
-
const doc = await payload.findByID({
|
|
39
|
-
collection: relationTo,
|
|
40
|
-
id: docId,
|
|
41
|
-
depth: 0,
|
|
42
|
-
locale,
|
|
43
|
-
req
|
|
44
|
-
}).catch(() => null);
|
|
45
|
-
if (!doc) return { links: [{
|
|
46
|
-
label: relationTo,
|
|
47
|
-
url: ""
|
|
48
|
-
}] };
|
|
49
|
-
const docRecord = doc;
|
|
50
|
-
const label = String(docRecord.title ?? docRecord[urlField] ?? relationTo);
|
|
51
|
-
const url = String(docRecord[urlField] ?? "");
|
|
52
|
-
if (!captureVersion) return { links: [{
|
|
53
|
-
label,
|
|
54
|
-
url
|
|
55
|
-
}] };
|
|
56
|
-
const v = await resolvePublishedVersionRef(payload, {
|
|
57
|
-
collection: relationTo,
|
|
58
|
-
id: docId
|
|
59
|
-
});
|
|
60
|
-
return {
|
|
61
|
-
links: [{
|
|
62
|
-
label,
|
|
63
|
-
url
|
|
64
|
-
}],
|
|
65
|
-
...v ? {
|
|
66
|
-
versionRef: v.versionId,
|
|
67
|
-
versionLabel: v.updatedAt
|
|
68
|
-
} : {}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
//#endregion
|
|
73
|
-
export { pageReferenceSource };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=pageReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageReference.js","names":[],"sources":["../../../src/consent/builtin/pageReference.ts"],"sourcesContent":["import { keys } from '../../translations/keys'\nimport { labelFor } from '../../translations/server'\nimport { defineConsentSource } from '../defineConsentSource'\nimport { resolvePublishedVersionRef } from '../resolvePublishedVersionRef'\n\ntype PageReferenceConfig = {\n\trelationTo?: string\n\tdocId?: string\n\turlField?: string\n\tcaptureVersion?: boolean\n}\n\nexport const pageReferenceSource = defineConsentSource<PageReferenceConfig>({\n\ttype: 'pageReference',\n\tlabel: keys.consentSourcePageReference,\n\tconfig: [\n\t\t{ name: 'relationTo', type: 'text', label: labelFor(keys.consentConfigRelationTo) },\n\t\t{ name: 'docId', type: 'text', label: labelFor(keys.consentConfigDocId) },\n\t\t{\n\t\t\tname: 'urlField',\n\t\t\ttype: 'text',\n\t\t\tlabel: labelFor(keys.consentConfigUrlField),\n\t\t\tdefaultValue: 'slug',\n\t\t},\n\t\t{\n\t\t\tname: 'captureVersion',\n\t\t\ttype: 'checkbox',\n\t\t\tlabel: labelFor(keys.consentConfigCaptureVersion),\n\t\t},\n\t],\n\tresolve: async ({ config, payload, req, locale }) => {\n\t\tconst relationTo = String(config.relationTo ?? '')\n\t\tconst docId = String(config.docId ?? '')\n\t\tconst urlField = String(config.urlField ?? 'slug')\n\t\tconst captureVersion = Boolean(config.captureVersion)\n\n\t\tif (!relationTo || !docId) {\n\t\t\treturn { links: [] }\n\t\t}\n\n\t\tconst doc = await payload\n\t\t\t.findByID({\n\t\t\t\tcollection: relationTo as never,\n\t\t\t\tid: docId,\n\t\t\t\tdepth: 0,\n\t\t\t\tlocale: locale as never,\n\t\t\t\treq,\n\t\t\t})\n\t\t\t.catch(() => null)\n\n\t\tif (!doc) {\n\t\t\treturn { links: [{ label: relationTo, url: '' }] }\n\t\t}\n\n\t\tconst docRecord = doc as Record<string, unknown>\n\t\tconst label = String(docRecord.title ?? docRecord[urlField] ?? relationTo)\n\t\tconst url = String(docRecord[urlField] ?? '')\n\n\t\tif (!captureVersion) {\n\t\t\treturn { links: [{ label, url }] }\n\t\t}\n\n\t\tconst v = await resolvePublishedVersionRef(payload, { collection: relationTo, id: docId })\n\t\treturn {\n\t\t\tlinks: [{ label, url }],\n\t\t\t...(v ? { versionRef: v.versionId, versionLabel: v.updatedAt } : {}),\n\t\t}\n\t},\n})\n"],"mappings":";;;;;AAYA,MAAa,sBAAsB,oBAAyC;CAC3E,MAAM;CACN,OAAO,KAAK;CACZ,QAAQ;EACP;GAAE,MAAM;GAAc,MAAM;GAAQ,OAAO,SAAS,KAAK,uBAAuB;EAAE;EAClF;GAAE,MAAM;GAAS,MAAM;GAAQ,OAAO,SAAS,KAAK,kBAAkB;EAAE;EACxE;GACC,MAAM;GACN,MAAM;GACN,OAAO,SAAS,KAAK,qBAAqB;GAC1C,cAAc;EACf;EACA;GACC,MAAM;GACN,MAAM;GACN,OAAO,SAAS,KAAK,2BAA2B;EACjD;CACD;CACA,SAAS,OAAO,EAAE,QAAQ,SAAS,KAAK,aAAa;EACpD,MAAM,aAAa,OAAO,OAAO,cAAc,EAAE;EACjD,MAAM,QAAQ,OAAO,OAAO,SAAS,EAAE;EACvC,MAAM,WAAW,OAAO,OAAO,YAAY,MAAM;EACjD,MAAM,iBAAiB,QAAQ,OAAO,cAAc;EAEpD,IAAI,CAAC,cAAc,CAAC,OACnB,OAAO,EAAE,OAAO,CAAC,EAAE;EAGpB,MAAM,MAAM,MAAM,QAChB,SAAS;GACT,YAAY;GACZ,IAAI;GACJ,OAAO;GACC;GACR;EACD,CAAC,EACA,YAAY,IAAI;EAElB,IAAI,CAAC,KACJ,OAAO,EAAE,OAAO,CAAC;GAAE,OAAO;GAAY,KAAK;EAAG,CAAC,EAAE;EAGlD,MAAM,YAAY;EAClB,MAAM,QAAQ,OAAO,UAAU,SAAS,UAAU,aAAa,UAAU;EACzE,MAAM,MAAM,OAAO,UAAU,aAAa,EAAE;EAE5C,IAAI,CAAC,gBACJ,OAAO,EAAE,OAAO,CAAC;GAAE;GAAO;EAAI,CAAC,EAAE;EAGlC,MAAM,IAAI,MAAM,2BAA2B,SAAS;GAAE,YAAY;GAAY,IAAI;EAAM,CAAC;EACzF,OAAO;GACN,OAAO,CAAC;IAAE;IAAO;GAAI,CAAC;GACtB,GAAI,IAAI;IAAE,YAAY,EAAE;IAAW,cAAc,EAAE;GAAU,IAAI,CAAC;EACnE;CACD;AACD,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { keys } from "../../translations/keys.js";
|
|
2
|
-
import { labelFor } from "../../translations/server.js";
|
|
3
|
-
import { defineConsentSource } from "../defineConsentSource.js";
|
|
4
|
-
//#region src/consent/builtin/static.ts
|
|
5
|
-
const staticSource = defineConsentSource({
|
|
6
|
-
type: "static",
|
|
7
|
-
label: keys.consentSourceStatic,
|
|
8
|
-
config: [
|
|
9
|
-
{
|
|
10
|
-
name: "label",
|
|
11
|
-
type: "text",
|
|
12
|
-
label: labelFor(keys.consentConfigLabel)
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "url",
|
|
16
|
-
type: "text",
|
|
17
|
-
label: labelFor(keys.consentConfigUrl)
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "version",
|
|
21
|
-
type: "text",
|
|
22
|
-
label: labelFor(keys.consentConfigVersion)
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
resolve({ config }) {
|
|
26
|
-
const label = String(config.label ?? "");
|
|
27
|
-
const url = String(config.url ?? "");
|
|
28
|
-
const version = config.version ? String(config.version) : void 0;
|
|
29
|
-
return {
|
|
30
|
-
links: [{
|
|
31
|
-
label,
|
|
32
|
-
url
|
|
33
|
-
}],
|
|
34
|
-
...version ? {
|
|
35
|
-
versionRef: version,
|
|
36
|
-
versionLabel: version
|
|
37
|
-
} : {}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
//#endregion
|
|
42
|
-
export { staticSource };
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=static.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","names":[],"sources":["../../../src/consent/builtin/static.ts"],"sourcesContent":["import { keys } from '../../translations/keys'\nimport { labelFor } from '../../translations/server'\nimport { defineConsentSource } from '../defineConsentSource'\n\ntype StaticConfig = { label?: string; url?: string; version?: string }\n\nexport const staticSource = defineConsentSource<StaticConfig>({\n\ttype: 'static',\n\tlabel: keys.consentSourceStatic,\n\tconfig: [\n\t\t{ name: 'label', type: 'text', label: labelFor(keys.consentConfigLabel) },\n\t\t{ name: 'url', type: 'text', label: labelFor(keys.consentConfigUrl) },\n\t\t{ name: 'version', type: 'text', label: labelFor(keys.consentConfigVersion) },\n\t],\n\tresolve({ config }) {\n\t\tconst label = String(config.label ?? '')\n\t\tconst url = String(config.url ?? '')\n\t\tconst version = config.version ? String(config.version) : undefined\n\t\treturn {\n\t\t\tlinks: [{ label, url }],\n\t\t\t...(version ? { versionRef: version, versionLabel: version } : {}),\n\t\t}\n\t},\n})\n"],"mappings":";;;;AAMA,MAAa,eAAe,oBAAkC;CAC7D,MAAM;CACN,OAAO,KAAK;CACZ,QAAQ;EACP;GAAE,MAAM;GAAS,MAAM;GAAQ,OAAO,SAAS,KAAK,kBAAkB;EAAE;EACxE;GAAE,MAAM;GAAO,MAAM;GAAQ,OAAO,SAAS,KAAK,gBAAgB;EAAE;EACpE;GAAE,MAAM;GAAW,MAAM;GAAQ,OAAO,SAAS,KAAK,oBAAoB;EAAE;CAC7E;CACA,QAAQ,EAAE,UAAU;EACnB,MAAM,QAAQ,OAAO,OAAO,SAAS,EAAE;EACvC,MAAM,MAAM,OAAO,OAAO,OAAO,EAAE;EACnC,MAAM,UAAU,OAAO,UAAU,OAAO,OAAO,OAAO,IAAI,KAAA;EAC1D,OAAO;GACN,OAAO,CAAC;IAAE;IAAO;GAAI,CAAC;GACtB,GAAI,UAAU;IAAE,YAAY;IAAS,cAAc;GAAQ,IAAI,CAAC;EACjE;CACD;AACD,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Field, Payload, PayloadRequest } from "payload";
|
|
2
|
-
|
|
3
|
-
//#region src/consent/defineConsentSource.d.ts
|
|
4
|
-
type ConsentLink = {
|
|
5
|
-
label: string;
|
|
6
|
-
url: string;
|
|
7
|
-
};
|
|
8
|
-
type ConsentResolved = {
|
|
9
|
-
links: ConsentLink[];
|
|
10
|
-
versionRef?: string;
|
|
11
|
-
versionLabel?: string;
|
|
12
|
-
};
|
|
13
|
-
type ConsentResolveArgs<TConfig extends Record<string, unknown> = Record<string, unknown>> = {
|
|
14
|
-
config: TConfig;
|
|
15
|
-
payload: Payload;
|
|
16
|
-
req?: PayloadRequest;
|
|
17
|
-
locale: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A consent source type, authored once: `config` is the admin `Field[]` for authoring;
|
|
21
|
-
* `resolve` returns localized policy links and an optional version reference at capture time.
|
|
22
|
-
* Built-ins use this same primitive.
|
|
23
|
-
*/
|
|
24
|
-
type ConsentSource<TConfig extends Record<string, unknown> = Record<string, unknown>> = {
|
|
25
|
-
type: string;
|
|
26
|
-
label: string;
|
|
27
|
-
config?: Field[];
|
|
28
|
-
resolve: (args: ConsentResolveArgs<TConfig>) => Promise<ConsentResolved> | ConsentResolved;
|
|
29
|
-
};
|
|
30
|
-
/** Erased shape stored in the registry; config re-narrows per matched type at resolution. */
|
|
31
|
-
type AnyConsentSource = ConsentSource<Record<string, unknown>>;
|
|
32
|
-
declare const defineConsentSource: <TConfig extends Record<string, unknown> = Record<string, unknown>>(source: ConsentSource<TConfig>) => ConsentSource<TConfig>;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { AnyConsentSource, ConsentLink, ConsentResolveArgs, ConsentResolved, ConsentSource, defineConsentSource };
|
|
35
|
-
//# sourceMappingURL=defineConsentSource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defineConsentSource.js","names":[],"sources":["../../src/consent/defineConsentSource.ts"],"sourcesContent":["import type { Field, Payload, PayloadRequest } from 'payload'\n\nexport type ConsentLink = { label: string; url: string }\nexport type ConsentResolved = { links: ConsentLink[]; versionRef?: string; versionLabel?: string }\n\nexport type ConsentResolveArgs<TConfig extends Record<string, unknown> = Record<string, unknown>> =\n\t{\n\t\tconfig: TConfig\n\t\tpayload: Payload\n\t\treq?: PayloadRequest\n\t\tlocale: string\n\t}\n\n/**\n * A consent source type, authored once: `config` is the admin `Field[]` for authoring;\n * `resolve` returns localized policy links and an optional version reference at capture time.\n * Built-ins use this same primitive.\n */\nexport type ConsentSource<TConfig extends Record<string, unknown> = Record<string, unknown>> = {\n\ttype: string\n\tlabel: string\n\tconfig?: Field[]\n\tresolve: (args: ConsentResolveArgs<TConfig>) => Promise<ConsentResolved> | ConsentResolved\n}\n\n/** Erased shape stored in the registry; config re-narrows per matched type at resolution. */\nexport type AnyConsentSource = ConsentSource<Record<string, unknown>>\n\nexport const defineConsentSource = <\n\tTConfig extends Record<string, unknown> = Record<string, unknown>,\n>(\n\tsource: ConsentSource<TConfig>\n): ConsentSource<TConfig> => source\n"],"mappings":";AA4BA,MAAa,uBAGZ,WAC4B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AnyConsentSource } from "./defineConsentSource.js";
|
|
2
|
-
|
|
3
|
-
//#region src/consent/registry.d.ts
|
|
4
|
-
type ConsentSourceRegistry = Map<string, AnyConsentSource>;
|
|
5
|
-
/** `false` removes a built-in, `true` keeps it, a definition adds or replaces one. */
|
|
6
|
-
type ConsentSourceOption = boolean | AnyConsentSource;
|
|
7
|
-
type ConsentSourcesConfig = Record<string, ConsentSourceOption>;
|
|
8
|
-
/**
|
|
9
|
-
* Resolve the active consent-source registry from built-in defaults and a consumer override map.
|
|
10
|
-
* `false` removes a type, `true` keeps the default (no-op when none exists), a definition adds or
|
|
11
|
-
* replaces. Mirrors the action and field-type registry convention.
|
|
12
|
-
*/
|
|
13
|
-
declare const resolveConsentSources: (defaults: Record<string, AnyConsentSource>, config?: ConsentSourcesConfig) => ConsentSourceRegistry;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { ConsentSourceOption, ConsentSourceRegistry, ConsentSourcesConfig, resolveConsentSources };
|
|
16
|
-
//# sourceMappingURL=registry.d.ts.map
|