@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { keys } from "../translations/keys.js";
|
|
2
|
+
import { labelForKey } from "../translations/server.js";
|
|
3
|
+
import { localizedIf } from "../fields/localizedIf.js";
|
|
4
|
+
//#region src/email/departmentsField.ts
|
|
5
|
+
/**
|
|
6
|
+
* The department-emails array, for the host to place on any collection or global they own: a
|
|
7
|
+
* settings global, a tenants collection, a departments parent, wherever the addresses belong. The
|
|
8
|
+
* plugin never registers it and never guesses where it lives; the `email.departments` resolver reads
|
|
9
|
+
* it back, which is also where multi-tenant scoping goes: place this on the tenant-scoped document
|
|
10
|
+
* and have the resolver return only that tenant's addresses, derived from `req`.
|
|
11
|
+
*
|
|
12
|
+
* A row is a `label` (how the address is named when routing a submission to it) and the `email` it
|
|
13
|
+
* resolves to. Because `email` is `localized` by default, a host can hold a different address per
|
|
14
|
+
* locale without changing the stored shape. The array itself is not localized, so per-locale edits
|
|
15
|
+
* must address existing rows by their own auto-assigned `id` rather than re-sending id-less rows.
|
|
16
|
+
*
|
|
17
|
+
* It renders condensed: `admin.components.Field` is {@link CondensedArray}, which lays each row out
|
|
18
|
+
* flat as `[label, email]` at 50% each with no per-row collapsible, while keeping Payload's native
|
|
19
|
+
* per-locale storage and row ids.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* // The host's own collection or global:
|
|
23
|
+
* fields: [departmentsField()]
|
|
24
|
+
*
|
|
25
|
+
* // The plugin, reading it back to route a submission. `resolveDepartmentOptions` reads the array
|
|
26
|
+
* // (fetched at `locale: 'all'`) and resolves each row's address for the requesting locale:
|
|
27
|
+
* formBuilder({
|
|
28
|
+
* email: {
|
|
29
|
+
* departments: async ({ req }) => {
|
|
30
|
+
* const settings = await req.payload.findGlobal({ slug: 'settings', depth: 0, locale: 'all' })
|
|
31
|
+
* return resolveDepartmentOptions({ payload: req.payload, req, doc: settings })
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* })
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* The read above omits the save's `req` on purpose: threading it into a `locale: 'all'` read from
|
|
38
|
+
* within a form's save validation flips `req.locale` to `all` and corrupts the localized write of the
|
|
39
|
+
* document being saved. It reads already-committed data, so no transaction (`req`) is needed.
|
|
40
|
+
*/
|
|
41
|
+
const departmentsField = (options = {}) => {
|
|
42
|
+
const localize = options.localized !== false;
|
|
43
|
+
return {
|
|
44
|
+
name: options.name ?? "departmentEmails",
|
|
45
|
+
type: "array",
|
|
46
|
+
label: options.label ?? labelForKey(keys.departmentsField),
|
|
47
|
+
labels: {
|
|
48
|
+
singular: labelForKey(keys.departmentSingular),
|
|
49
|
+
plural: labelForKey(keys.departmentPlural)
|
|
50
|
+
},
|
|
51
|
+
admin: {
|
|
52
|
+
description: labelForKey(keys.departmentsFieldDescription),
|
|
53
|
+
components: { Field: "@10x-media/form-builder/client#CondensedArray" }
|
|
54
|
+
},
|
|
55
|
+
fields: [{
|
|
56
|
+
name: "label",
|
|
57
|
+
type: "text",
|
|
58
|
+
label: labelForKey(keys.departmentLabel),
|
|
59
|
+
admin: { width: "50%" },
|
|
60
|
+
...localizedIf(localize)
|
|
61
|
+
}, {
|
|
62
|
+
name: "email",
|
|
63
|
+
type: "text",
|
|
64
|
+
label: labelForKey(keys.departmentEmail),
|
|
65
|
+
admin: { width: "50%" },
|
|
66
|
+
...localizedIf(localize)
|
|
67
|
+
}]
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { departmentsField };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=departmentsField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"departmentsField.js","names":[],"sources":["../../src/email/departmentsField.ts"],"sourcesContent":["import type { ArrayField } from 'payload'\nimport { localizedIf } from '../fields/localizedIf'\nimport { keys } from '../translations/keys'\nimport { labelForKey } from '../translations/server'\n\nexport type DepartmentsFieldOptions = {\n\t/** Field name, i.e. what the row array is stored under. Defaults to `departmentEmails`. */\n\tname?: string\n\t/** Field label. Defaults to the plugin's translated one. */\n\tlabel?: ArrayField['label']\n\t/**\n\t * Whether each row's `email` (and its `label`) carry `localized: true`, so the same field can\n\t * hold a different address per locale. Default `true`; Payload strips the flag on hosts without\n\t * `localization`, so it is safe either way.\n\t */\n\tlocalized?: boolean\n}\n\n/**\n * The department-emails array, for the host to place on any collection or global they own: a\n * settings global, a tenants collection, a departments parent, wherever the addresses belong. The\n * plugin never registers it and never guesses where it lives; the `email.departments` resolver reads\n * it back, which is also where multi-tenant scoping goes: place this on the tenant-scoped document\n * and have the resolver return only that tenant's addresses, derived from `req`.\n *\n * A row is a `label` (how the address is named when routing a submission to it) and the `email` it\n * resolves to. Because `email` is `localized` by default, a host can hold a different address per\n * locale without changing the stored shape. The array itself is not localized, so per-locale edits\n * must address existing rows by their own auto-assigned `id` rather than re-sending id-less rows.\n *\n * It renders condensed: `admin.components.Field` is {@link CondensedArray}, which lays each row out\n * flat as `[label, email]` at 50% each with no per-row collapsible, while keeping Payload's native\n * per-locale storage and row ids.\n *\n * ```ts\n * // The host's own collection or global:\n * fields: [departmentsField()]\n *\n * // The plugin, reading it back to route a submission. `resolveDepartmentOptions` reads the array\n * // (fetched at `locale: 'all'`) and resolves each row's address for the requesting locale:\n * formBuilder({\n * email: {\n * departments: async ({ req }) => {\n * const settings = await req.payload.findGlobal({ slug: 'settings', depth: 0, locale: 'all' })\n * return resolveDepartmentOptions({ payload: req.payload, req, doc: settings })\n * },\n * },\n * })\n * ```\n *\n * The read above omits the save's `req` on purpose: threading it into a `locale: 'all'` read from\n * within a form's save validation flips `req.locale` to `all` and corrupts the localized write of the\n * document being saved. It reads already-committed data, so no transaction (`req`) is needed.\n */\nexport const departmentsField = (options: DepartmentsFieldOptions = {}): ArrayField => {\n\tconst localize = options.localized !== false\n\n\treturn {\n\t\tname: options.name ?? 'departmentEmails',\n\t\ttype: 'array',\n\t\tlabel: options.label ?? labelForKey(keys.departmentsField),\n\t\tlabels: {\n\t\t\tsingular: labelForKey(keys.departmentSingular),\n\t\t\tplural: labelForKey(keys.departmentPlural),\n\t\t},\n\t\tadmin: {\n\t\t\tdescription: labelForKey(keys.departmentsFieldDescription),\n\t\t\tcomponents: { Field: '@10x-media/form-builder/client#CondensedArray' },\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'label',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: labelForKey(keys.departmentLabel),\n\t\t\t\tadmin: { width: '50%' },\n\t\t\t\t...localizedIf(localize),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'email',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: labelForKey(keys.departmentEmail),\n\t\t\t\tadmin: { width: '50%' },\n\t\t\t\t...localizedIf(localize),\n\t\t\t},\n\t\t],\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,oBAAoB,UAAmC,CAAC,MAAkB;CACtF,MAAM,WAAW,QAAQ,cAAc;CAEvC,OAAO;EACN,MAAM,QAAQ,QAAQ;EACtB,MAAM;EACN,OAAO,QAAQ,SAAS,YAAY,KAAK,gBAAgB;EACzD,QAAQ;GACP,UAAU,YAAY,KAAK,kBAAkB;GAC7C,QAAQ,YAAY,KAAK,gBAAgB;EAC1C;EACA,OAAO;GACN,aAAa,YAAY,KAAK,2BAA2B;GACzD,YAAY,EAAE,OAAO,gDAAgD;EACtE;EACA,QAAQ,CACP;GACC,MAAM;GACN,MAAM;GACN,OAAO,YAAY,KAAK,eAAe;GACvC,OAAO,EAAE,OAAO,MAAM;GACtB,GAAG,YAAY,QAAQ;EACxB,GACA;GACC,MAAM;GACN,MAAM;GACN,OAAO,YAAY,KAAK,eAAe;GACvC,OAAO,EAAE,OAAO,MAAM;GACtB,GAAG,YAAY,QAAQ;EACxB,CACD;CACD;AACD"}
|
package/dist/exports/client.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import { ByteSizeField } from "../client/ByteSizeField.js";
|
|
2
|
+
import { CalcExpressionBuilder } from "../client/CalcExpressionBuilder.js";
|
|
3
|
+
import { ClosePollButton } from "../client/ClosePollButton.js";
|
|
4
|
+
import { CondensedArray } from "../client/CondensedArray.js";
|
|
5
|
+
import { ConsentBlockLabel } from "../client/ConsentBlockLabel.js";
|
|
6
|
+
import { ConsentSourceRowLabel } from "../client/ConsentSourceRowLabel.js";
|
|
7
|
+
import { EndpointOptionsSelect } from "../client/EndpointOptionsSelect.js";
|
|
8
|
+
import { FieldBlockLabel } from "../client/FieldBlockLabel.js";
|
|
9
|
+
import { FieldNameSelect } from "../client/FieldNameSelect.js";
|
|
1
10
|
import { FlowBuilder } from "../client/FlowBuilder.js";
|
|
2
11
|
import { FormConditionField } from "../client/FormConditionField.js";
|
|
3
|
-
|
|
12
|
+
import { RecipientsSelect } from "../client/RecipientsSelect.js";
|
|
13
|
+
import { RuleDescription } from "../client/RuleDescription.js";
|
|
14
|
+
import { FieldCountCell } from "../collections/cells/FieldCountCell.js";
|
|
15
|
+
import { FlowStepsCell } from "../collections/cells/FlowStepsCell.js";
|
|
16
|
+
export { ByteSizeField, CalcExpressionBuilder, ClosePollButton, CondensedArray, ConsentBlockLabel, ConsentSourceRowLabel, EndpointOptionsSelect, FieldBlockLabel, FieldCountCell, FieldNameSelect, FlowBuilder, FlowStepsCell, FormConditionField, RecipientsSelect, RuleDescription };
|
package/dist/exports/client.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ByteSizeField } from "../client/ByteSizeField.js";
|
|
3
|
+
import { CalcExpressionBuilder } from "../client/CalcExpressionBuilder.js";
|
|
4
|
+
import { ClosePollButton } from "../client/ClosePollButton.js";
|
|
5
|
+
import { CondensedArray } from "../client/CondensedArray.js";
|
|
6
|
+
import { ConsentBlockLabel } from "../client/ConsentBlockLabel.js";
|
|
7
|
+
import { ConsentSourceRowLabel } from "../client/ConsentSourceRowLabel.js";
|
|
8
|
+
import { EndpointOptionsSelect } from "../client/EndpointOptionsSelect.js";
|
|
9
|
+
import { FieldBlockLabel } from "../client/FieldBlockLabel.js";
|
|
10
|
+
import { FieldNameSelect } from "../client/FieldNameSelect.js";
|
|
2
11
|
import { FlowBuilder } from "../client/FlowBuilder.js";
|
|
3
12
|
import { FormConditionField } from "../client/FormConditionField.js";
|
|
4
|
-
|
|
13
|
+
import { RecipientsSelect } from "../client/RecipientsSelect.js";
|
|
14
|
+
import { RuleDescription } from "../client/RuleDescription.js";
|
|
15
|
+
import { FieldCountCell } from "../collections/cells/FieldCountCell.js";
|
|
16
|
+
import { FlowStepsCell } from "../collections/cells/FlowStepsCell.js";
|
|
17
|
+
export { ByteSizeField, CalcExpressionBuilder, ClosePollButton, CondensedArray, ConsentBlockLabel, ConsentSourceRowLabel, EndpointOptionsSelect, FieldBlockLabel, FieldCountCell, FieldNameSelect, FlowBuilder, FlowStepsCell, FormConditionField, RecipientsSelect, RuleDescription };
|
package/dist/exports/i18n.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { TranslationKey, keys } from "../translations/keys.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { de } from "../translations/de.js";
|
|
3
|
+
import { en } from "../translations/en.js";
|
|
4
|
+
import { TranslationBundle, TranslationsOption, bundles, translations } from "../translations/index.js";
|
|
5
|
+
import { clientRuntimeKeys } from "../translations/clientRuntimeKeys.js";
|
|
6
|
+
export { type TranslationKey as FormBuilderTranslationKeys, type TranslationBundle, type TranslationKey, type TranslationsOption, bundles, clientRuntimeKeys, de, en, keys, translations };
|
package/dist/exports/i18n.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { keys } from "../translations/keys.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { de } from "../translations/de.js";
|
|
3
|
+
import { en } from "../translations/en.js";
|
|
4
|
+
import { bundles, translations } from "../translations/index.js";
|
|
5
|
+
import { clientRuntimeKeys } from "../translations/clientRuntimeKeys.js";
|
|
6
|
+
export { bundles, clientRuntimeKeys, de, en, keys, translations };
|
package/dist/exports/react.d.ts
CHANGED
|
@@ -1,24 +1,48 @@
|
|
|
1
|
-
import { FormFieldInstance } from "../submissions/types.js";
|
|
2
|
-
import { AggregationBucket, FieldAggregation } from "../aggregation/types.js";
|
|
3
1
|
import { CalcExpression } from "../calc/types.js";
|
|
2
|
+
import { FormFieldInstance, SubmissionValue } from "../submissions/types.js";
|
|
3
|
+
import { de } from "../translations/de.js";
|
|
4
|
+
import { en } from "../translations/en.js";
|
|
5
|
+
import { TranslationBundle, bundles } from "../translations/index.js";
|
|
6
|
+
import { clientRuntimeKeys } from "../translations/clientRuntimeKeys.js";
|
|
7
|
+
import { BodyConverter, BodyConverterArgs, BodyRender, sanitizeUrl } from "../actions/body/converters.js";
|
|
8
|
+
import { BodyContext, serializeBody } from "../actions/body/serializeBody.js";
|
|
9
|
+
import { textOfBody } from "../actions/body/textOfBody.js";
|
|
10
|
+
import { AggregationBucket, FieldAggregation } from "../aggregation/types.js";
|
|
11
|
+
import { CalcResolved, evaluateCalc } from "../calc/evaluate.js";
|
|
4
12
|
import { computeCalcFields } from "../calc/computeCalcFields.js";
|
|
5
|
-
import {
|
|
13
|
+
import { formatCalc } from "../calc/formatCalc.js";
|
|
14
|
+
import { CalcDisplayConfig, formatCalcValue } from "../calc/formatCalcValue.js";
|
|
6
15
|
import { evaluateCondition } from "../conditions/evaluate.js";
|
|
16
|
+
import { ConsentStatement, ConsentStatements } from "../consent/resolveConsentStatements.js";
|
|
17
|
+
import { COUNTRIES, US_STATES } from "../fields/data/regions.js";
|
|
18
|
+
import { fieldKey } from "../fields/fieldKey.js";
|
|
7
19
|
import { firstStepId, isTerminalStepId, resolveNextStepId, stepFieldNames } from "../flow/engine.js";
|
|
20
|
+
import { FormButtonSettings, FormDocument, FormPollSettings, FormResponseSettings } from "../form/types.js";
|
|
21
|
+
import { ToFormDocumentOptions, toFormDocument } from "../form/toFormDocument.js";
|
|
8
22
|
import { PrefillOptions, valuesFromSearchParams } from "../prefill/valuesFromSearchParams.js";
|
|
23
|
+
import { FormAdapters, LoadScript, NavigateOptions, VoteStorage } from "../react/adapters.js";
|
|
24
|
+
import { CaptchaWidgetHandle } from "../react/captcha/types.js";
|
|
25
|
+
import { HCAPTCHA_SCRIPT_URL, HcaptchaCaptcha, HcaptchaCaptchaProps } from "../react/captcha/HcaptchaCaptcha.js";
|
|
26
|
+
import { RECAPTCHA_SCRIPT_URL, RecaptchaCaptcha, RecaptchaCaptchaHandle, RecaptchaCaptchaProps } from "../react/captcha/RecaptchaCaptcha.js";
|
|
27
|
+
import { TURNSTILE_SCRIPT_URL, TurnstileCaptcha, TurnstileCaptchaProps } from "../react/captcha/TurnstileCaptcha.js";
|
|
9
28
|
import { cn } from "../react/cn.js";
|
|
10
29
|
import { FieldRenderer, FieldRendererProps, RendererTranslate, defineFieldRenderer } from "../react/contract.js";
|
|
30
|
+
import { BackButtonRenderProps, FormControls, FormControlsProps, NextButtonRenderProps, SubmitButtonRenderProps } from "../react/FormControls.js";
|
|
11
31
|
import { FormPresentation, PresentationWrapperProps } from "../react/presentation/types.js";
|
|
12
32
|
import { PresentationOption, PresentationRegistry, PresentationsConfig, resolvePresentations } from "../react/presentation/registry.js";
|
|
13
33
|
import { RendererOption, RendererRegistry, RenderersConfig, resolveRenderers } from "../react/registry.js";
|
|
14
34
|
import { SubmitFormResult, SubmitHandler, submitForm } from "../react/submitForm.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
35
|
+
import { Form, FormProps, FormSuccessResponse, FormSuccessResult } from "../react/Form.js";
|
|
36
|
+
import { RecallResolver, buildRecallResolver } from "../recall/resolver.js";
|
|
37
|
+
import { FieldErrors, FormAction, FormState } from "../react/state.js";
|
|
38
|
+
import { FormContextValue, FormControlLabels, FormStepInfo, useFormContext } from "../react/FormContext.js";
|
|
39
|
+
import { FormFields, FormFieldsProps } from "../react/FormFields.js";
|
|
18
40
|
import { FieldWidth, FormLayout, FormLayoutProps, widthProps } from "../react/FormLayout.js";
|
|
19
41
|
import { FormResults, FormResultsProps } from "../react/FormResults.js";
|
|
42
|
+
import { FormSteps, FormStepsProps } from "../react/FormSteps.js";
|
|
20
43
|
import { FetchResultsInput, FetchResultsResult, fetchFormResults } from "../react/fetchResults.js";
|
|
21
44
|
import { Honeypot, HoneypotProps } from "../react/Honeypot.js";
|
|
45
|
+
import { VotedSubmission } from "../submissions/resolveVotedSubmission.js";
|
|
22
46
|
import { Poll, PollProps } from "../react/Poll.js";
|
|
23
47
|
import { Backdrop, BackdropProps } from "../react/presentation/Backdrop.js";
|
|
24
48
|
import { DialogSurface, DialogSurfaceProps } from "../react/presentation/DialogSurface.js";
|
|
@@ -27,19 +51,19 @@ import { UseDismissOptions, useDismiss } from "../react/presentation/useDismiss.
|
|
|
27
51
|
import { useFocusTrap } from "../react/presentation/useFocusTrap.js";
|
|
28
52
|
import { useScrollLock } from "../react/presentation/useScrollLock.js";
|
|
29
53
|
import { Checkbox, CheckboxProps } from "../react/primitives/Checkbox.js";
|
|
54
|
+
import { ChoiceGroup, ChoiceGroupProps, ChoiceOption } from "../react/primitives/ChoiceGroup.js";
|
|
30
55
|
import { FieldShell, FieldShellProps } from "../react/primitives/FieldShell.js";
|
|
31
56
|
import { Input, InputProps } from "../react/primitives/Input.js";
|
|
32
57
|
import { Select, SelectOption, SelectProps } from "../react/primitives/Select.js";
|
|
33
58
|
import { Textarea, TextareaProps } from "../react/primitives/Textarea.js";
|
|
34
59
|
import { defaultRenderers } from "../react/renderers/index.js";
|
|
35
|
-
import { toFormDocument } from "../react/toFormDocument.js";
|
|
36
60
|
import { UploadFileInput, UploadFileResult, uploadFile } from "../react/uploadFile.js";
|
|
61
|
+
import { useCalcValues } from "../react/useCalcValues.js";
|
|
37
62
|
import { UseFieldResult, useField } from "../react/useField.js";
|
|
38
63
|
import { useFormState } from "../react/useFormState.js";
|
|
39
64
|
import { useFormStep } from "../react/useFormStep.js";
|
|
40
65
|
import { interpolate } from "../recall/interpolate.js";
|
|
41
|
-
import { RecallResolver, buildRecallResolver } from "../recall/resolver.js";
|
|
42
66
|
import { CAPTCHA_TOKEN_KEY, DEFAULT_HONEYPOT_FIELD } from "../spam/constants.js";
|
|
43
|
-
import { en } from "../translations/en.js";
|
|
44
67
|
import { makeTranslate } from "../translations/makeTranslate.js";
|
|
45
|
-
|
|
68
|
+
import { formatBytes } from "../uploads/formatBytes.js";
|
|
69
|
+
export { type AggregationBucket, type BackButtonRenderProps, Backdrop, type BackdropProps, type BodyContext, type BodyConverter, type BodyConverterArgs, type BodyRender, CAPTCHA_TOKEN_KEY, COUNTRIES, type CalcDisplayConfig, type CalcExpression, type CalcResolved, type CaptchaWidgetHandle, Checkbox, type CheckboxProps, ChoiceGroup, type ChoiceGroupProps, type ChoiceOption, type ConsentStatement, type ConsentStatements, DEFAULT_HONEYPOT_FIELD, DialogSurface, type DialogSurfaceProps, type FetchResultsInput, type FetchResultsResult, type FieldAggregation, type FieldErrors, type FieldRenderer, type FieldRendererProps, FieldShell, type FieldShellProps, type FieldWidth, Form, type FormAction, type FormAdapters, type FormButtonSettings, type FormContextValue, type FormControlLabels, FormControls, type FormControlsProps, type FormDocument, type FormFieldInstance, FormFields, type FormFieldsProps, FormLayout, type FormLayoutProps, type FormPollSettings, type FormPresentation, type FormProps, type FormResponseSettings, FormResults, type FormResultsProps, type FormState, type FormStepInfo, FormSteps, type FormStepsProps, type FormSuccessResponse, type FormSuccessResult, HCAPTCHA_SCRIPT_URL, HcaptchaCaptcha, type HcaptchaCaptchaProps, Honeypot, type HoneypotProps, Input, type InputProps, type LoadScript, type NavigateOptions, type NextButtonRenderProps, Poll, type PollProps, type PrefillOptions, type PresentationOption, type PresentationRegistry, type PresentationWrapperProps, type PresentationsConfig, RECAPTCHA_SCRIPT_URL, type RecallResolver, RecaptchaCaptcha, type RecaptchaCaptchaHandle, type RecaptchaCaptchaProps, type RendererOption, type RendererRegistry, type RendererTranslate, type RenderersConfig, Select, type SelectOption, type SelectProps, type SubmissionValue, type SubmitButtonRenderProps, type SubmitFormResult, type SubmitHandler, TURNSTILE_SCRIPT_URL, Textarea, type TextareaProps, type ToFormDocumentOptions, type TranslationBundle, TurnstileCaptcha, type TurnstileCaptchaProps, US_STATES, type UploadFileInput, type UploadFileResult, type UseDismissOptions, type UseFieldResult, type VoteStorage, type VotedSubmission, buildRecallResolver, bundles, clientRuntimeKeys, cn, computeCalcFields, de, defaultPresentations, defaultRenderers, defineFieldRenderer, en, evaluateCalc, evaluateCondition, fetchFormResults, fieldKey, firstStepId, formatBytes, formatCalc, formatCalcValue, interpolate, isTerminalStepId, makeTranslate, resolveNextStepId, resolvePresentations, resolveRenderers, sanitizeUrl, serializeBody, stepFieldNames, submitForm, textOfBody, toFormDocument, uploadFile, useCalcValues, useDismiss, useField, useFocusTrap, useFormContext, useFormState, useFormStep, useScrollLock, valuesFromSearchParams, widthProps };
|
package/dist/exports/react.js
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { interpolate } from "../recall/interpolate.js";
|
|
3
|
-
import {
|
|
3
|
+
import { sanitizeUrl } from "../actions/body/converters.js";
|
|
4
|
+
import { serializeBody } from "../actions/body/serializeBody.js";
|
|
5
|
+
import { formatCalcValue } from "../calc/formatCalcValue.js";
|
|
6
|
+
import { fieldKey } from "../fields/fieldKey.js";
|
|
4
7
|
import { evaluateCalc } from "../calc/evaluate.js";
|
|
5
8
|
import { computeCalcFields } from "../calc/computeCalcFields.js";
|
|
9
|
+
import { textOfBody } from "../actions/body/textOfBody.js";
|
|
10
|
+
import { CAPTCHA_TOKEN_KEY, DEFAULT_HONEYPOT_FIELD } from "../spam/constants.js";
|
|
6
11
|
import { evaluateCondition } from "../conditions/evaluate.js";
|
|
12
|
+
import { de } from "../translations/de.js";
|
|
7
13
|
import { en } from "../translations/en.js";
|
|
14
|
+
import { bundles } from "../translations/index.js";
|
|
15
|
+
import { formatCalc } from "../calc/formatCalc.js";
|
|
16
|
+
import { COUNTRIES, US_STATES } from "../fields/data/regions.js";
|
|
17
|
+
import { toFormDocument } from "../form/toFormDocument.js";
|
|
8
18
|
import { valuesFromSearchParams } from "../prefill/valuesFromSearchParams.js";
|
|
9
19
|
import { buildRecallResolver } from "../recall/resolver.js";
|
|
20
|
+
import { formatBytes } from "../uploads/formatBytes.js";
|
|
10
21
|
import { firstStepId, isTerminalStepId, resolveNextStepId, stepFieldNames } from "../flow/engine.js";
|
|
22
|
+
import { HCAPTCHA_SCRIPT_URL, HcaptchaCaptcha } from "../react/captcha/HcaptchaCaptcha.js";
|
|
23
|
+
import { RECAPTCHA_SCRIPT_URL, RecaptchaCaptcha } from "../react/captcha/RecaptchaCaptcha.js";
|
|
24
|
+
import { TURNSTILE_SCRIPT_URL, TurnstileCaptcha } from "../react/captcha/TurnstileCaptcha.js";
|
|
11
25
|
import { cn } from "../react/cn.js";
|
|
12
26
|
import { defineFieldRenderer } from "../react/contract.js";
|
|
13
27
|
import { makeTranslate } from "../translations/makeTranslate.js";
|
|
28
|
+
import { useFormContext } from "../react/FormContext.js";
|
|
29
|
+
import { FormControls } from "../react/FormControls.js";
|
|
14
30
|
import { FormLayout, widthProps } from "../react/FormLayout.js";
|
|
31
|
+
import { useField } from "../react/useField.js";
|
|
32
|
+
import { FormFields } from "../react/FormFields.js";
|
|
15
33
|
import { Honeypot } from "../react/Honeypot.js";
|
|
16
34
|
import { Backdrop } from "../react/presentation/Backdrop.js";
|
|
17
35
|
import { useDismiss } from "../react/presentation/useDismiss.js";
|
|
@@ -25,16 +43,18 @@ import { FieldShell } from "../react/primitives/FieldShell.js";
|
|
|
25
43
|
import { Checkbox } from "../react/primitives/Checkbox.js";
|
|
26
44
|
import { Input } from "../react/primitives/Input.js";
|
|
27
45
|
import { uploadFile } from "../react/uploadFile.js";
|
|
28
|
-
import { useField } from "../react/useField.js";
|
|
29
46
|
import { Select } from "../react/primitives/Select.js";
|
|
47
|
+
import { ChoiceGroup } from "../react/primitives/ChoiceGroup.js";
|
|
30
48
|
import { Textarea } from "../react/primitives/Textarea.js";
|
|
31
49
|
import { defaultRenderers } from "../react/renderers/index.js";
|
|
32
50
|
import { submitForm } from "../react/submitForm.js";
|
|
33
51
|
import { Form } from "../react/Form.js";
|
|
34
52
|
import { FormResults } from "../react/FormResults.js";
|
|
53
|
+
import { FormSteps } from "../react/FormSteps.js";
|
|
35
54
|
import { fetchFormResults } from "../react/fetchResults.js";
|
|
36
55
|
import { Poll } from "../react/Poll.js";
|
|
37
|
-
import {
|
|
56
|
+
import { useCalcValues } from "../react/useCalcValues.js";
|
|
38
57
|
import { useFormState } from "../react/useFormState.js";
|
|
39
58
|
import { useFormStep } from "../react/useFormStep.js";
|
|
40
|
-
|
|
59
|
+
import { clientRuntimeKeys } from "../translations/clientRuntimeKeys.js";
|
|
60
|
+
export { Backdrop, CAPTCHA_TOKEN_KEY, COUNTRIES, Checkbox, ChoiceGroup, DEFAULT_HONEYPOT_FIELD, DialogSurface, FieldShell, Form, FormControls, FormFields, FormLayout, FormResults, FormSteps, HCAPTCHA_SCRIPT_URL, HcaptchaCaptcha, Honeypot, Input, Poll, RECAPTCHA_SCRIPT_URL, RecaptchaCaptcha, Select, TURNSTILE_SCRIPT_URL, Textarea, TurnstileCaptcha, US_STATES, buildRecallResolver, bundles, clientRuntimeKeys, cn, computeCalcFields, de, defaultPresentations, defaultRenderers, defineFieldRenderer, en, evaluateCalc, evaluateCondition, fetchFormResults, fieldKey, firstStepId, formatBytes, formatCalc, formatCalcValue, interpolate, isTerminalStepId, makeTranslate, resolveNextStepId, resolvePresentations, resolveRenderers, sanitizeUrl, serializeBody, stepFieldNames, submitForm, textOfBody, toFormDocument, uploadFile, useCalcValues, useDismiss, useField, useFocusTrap, useFormContext, useFormState, useFormStep, useScrollLock, valuesFromSearchParams, widthProps };
|
package/dist/exports/rsc.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { resolveConsentStatements } from "../consent/resolveConsentStatements.js";
|
|
2
|
+
import { toFormDocument } from "../form/toFormDocument.js";
|
|
3
|
+
import { VotedSubmission, resolveVotedSubmission } from "../submissions/resolveVotedSubmission.js";
|
|
4
|
+
import { FormContextReference, signFormContext, verifyFormContext } from "../context/formContext.js";
|
|
5
|
+
import { isPollClosed } from "../form/pollState.js";
|
|
6
|
+
import { resolveEffectivePollOptions } from "../poll/effectivePollOptions.js";
|
|
7
|
+
import { resolvePollOptions } from "../poll/resolvePollOptions.js";
|
|
8
|
+
import { resolvePollOutcome } from "../poll/resolvePollOutcome.js";
|
|
1
9
|
import { SubmissionAnswers } from "../submissions/SubmissionAnswers.js";
|
|
2
|
-
|
|
10
|
+
import { hasVotedCookie, votedCookieName } from "../submissions/votedCookie.js";
|
|
11
|
+
export { type FormContextReference, SubmissionAnswers, type VotedSubmission, hasVotedCookie, isPollClosed, resolveConsentStatements, resolveEffectivePollOptions, resolvePollOptions, resolvePollOutcome, resolveVotedSubmission, signFormContext, toFormDocument, verifyFormContext, votedCookieName };
|
package/dist/exports/rsc.js
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { isPollClosed } from "../form/pollState.js";
|
|
2
|
+
import { resolveConsentStatements } from "../consent/resolveConsentStatements.js";
|
|
3
|
+
import { resolvePollOptions } from "../poll/resolvePollOptions.js";
|
|
4
|
+
import { resolveEffectivePollOptions } from "../poll/effectivePollOptions.js";
|
|
5
|
+
import { resolvePollOutcome } from "../poll/resolvePollOutcome.js";
|
|
6
|
+
import { signFormContext, verifyFormContext } from "../context/formContext.js";
|
|
7
|
+
import { hasVotedCookie, votedCookieName } from "../submissions/votedCookie.js";
|
|
8
|
+
import { toFormDocument } from "../form/toFormDocument.js";
|
|
9
|
+
import { resolveVotedSubmission } from "../submissions/resolveVotedSubmission.js";
|
|
1
10
|
import { SubmissionAnswers } from "../submissions/SubmissionAnswers.js";
|
|
2
|
-
export { SubmissionAnswers };
|
|
11
|
+
export { SubmissionAnswers, hasVotedCookie, isPollClosed, resolveConsentStatements, resolveEffectivePollOptions, resolvePollOptions, resolvePollOutcome, resolveVotedSubmission, signFormContext, toFormDocument, verifyFormContext, votedCookieName };
|
package/dist/exports/types.d.ts
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
1
|
+
import { CalcExpression } from "../calc/types.js";
|
|
2
|
+
import { FormFieldInstance, SubmissionDescriptor, SubmissionFieldError, SubmissionValue, SubmissionWidth } from "../submissions/types.js";
|
|
1
3
|
import { FileFieldConfig, FileRef, FileRefError } from "../uploads/types.js";
|
|
2
|
-
import { AnyFormFieldDefinition, FormFieldDefinition, FormFieldFormat, FormFieldValidate, FormFieldValueKind } from "../fields/types.js";
|
|
3
|
-
import {
|
|
4
|
+
import { AnyFormFieldDefinition, FormFieldDefinition, FormFieldFormat, FormFieldValidate, FormFieldValueKind, OmittableSharedField } from "../fields/types.js";
|
|
5
|
+
import { RichTextBodyOption } from "../actions/body/serializeBody.js";
|
|
4
6
|
import { AggregationBucket, AggregationRow, FieldAggregation, FieldMeta, SubmissionStatusFilter } from "../aggregation/types.js";
|
|
5
|
-
import {
|
|
7
|
+
import { ConsentSourceEntry, ConsentSourcePage, ConsentSourcesResolver } from "../consent/types.js";
|
|
8
|
+
import { ConsentStatement, ConsentStatements, ResolveConsentStatementsArgs } from "../consent/resolveConsentStatements.js";
|
|
6
9
|
import { FlowStep, FlowTransition, FormFlow } from "../flow/types.js";
|
|
10
|
+
import { FormButtonSettings, FormDocument, FormPollSettings, FormResponseSettings } from "../form/types.js";
|
|
7
11
|
import { FieldTypeOption, FieldTypeRegistry, FieldTypesConfig } from "../fields/registry.js";
|
|
8
12
|
import { PrefillOptions } from "../prefill/valuesFromSearchParams.js";
|
|
9
13
|
import { FormEvent, FormEventSink } from "../events/types.js";
|
|
10
|
-
import { AnyValidationRuleDefinition, ValidationRuleDefinition, ValidationRuleResult
|
|
14
|
+
import { AnyValidationRuleDefinition, ValidationRuleDefinition, ValidationRuleResult } from "../validation/types.js";
|
|
11
15
|
import { PresentationDensity, PresentationDescriptor, PresentationSurface } from "../presentations/types.js";
|
|
12
16
|
import { RecallResolver } from "../recall/resolver.js";
|
|
17
|
+
import { PollOptionSourceOption, PollOptionSourceRegistry, PollOptionSourcesConfig } from "../poll/registry.js";
|
|
13
18
|
import { ActionDefinition, ActionRunArgs, AnyActionDefinition } from "../actions/defineAction.js";
|
|
19
|
+
import { FromAddressOption, FromAddressesResolver } from "../actions/fromAddresses.js";
|
|
14
20
|
import { ActionOption, ActionRegistry, ActionsConfig } from "../actions/registry.js";
|
|
15
21
|
import { ActionResult } from "../actions/runActions.js";
|
|
16
22
|
import { AggregateFieldResponsesArgs, AggregateFormResponsesArgs } from "../aggregation/aggregateResponses.js";
|
|
17
|
-
import { ResolveResultsRequestArgs, ResolveResultsRequestResult } from "../aggregation/resolveResultsRequest.js";
|
|
18
|
-
import {
|
|
19
|
-
import { UploadsCollectionConfig, UploadsOption } from "../collections/uploads.js";
|
|
23
|
+
import { FormResultsAccess, FormResultsAccessArgs, ResolveResultsRequestArgs, ResolveResultsRequestResult } from "../aggregation/resolveResultsRequest.js";
|
|
24
|
+
import { ButtonFieldsOverride, ButtonsOption, DefaultButtonFields } from "../collections/buttonFields.js";
|
|
20
25
|
import { FieldCondition } from "../conditions/types.js";
|
|
21
|
-
import { AnyConsentSource, ConsentLink, ConsentResolveArgs, ConsentResolved, ConsentSource } from "../consent/defineConsentSource.js";
|
|
22
|
-
import { ConsentSourceOption, ConsentSourceRegistry, ConsentSourcesConfig } from "../consent/registry.js";
|
|
23
26
|
import { ConsentProof } from "../consent/captureConsent.js";
|
|
24
|
-
import {
|
|
27
|
+
import { ConsentSourcesFieldOptions } from "../consent/consentSourcesField.js";
|
|
28
|
+
import { ResolveConsentEntriesArgs } from "../consent/resolveConsentEntries.js";
|
|
29
|
+
import { ConsentSourceOption, ResolveConsentSourcesRequestArgs, ResolveConsentSourcesRequestResult } from "../consent/resolveConsentSourcesRequest.js";
|
|
30
|
+
import { ResolvePublishedVersionRefArgs } from "../consent/resolvePublishedVersionRef.js";
|
|
31
|
+
import { CollectionOverrides, FieldsOverride } from "../plugin/collectionOverrides.js";
|
|
25
32
|
import { CaptchaProvider, CaptchaVerifyArgs, IdentifyFn, RateLimitCheckArgs, RateLimitConfig, RateLimitResult, RateLimiter, SpamConfig, SpamMetadataConfig, SpamOption } from "../spam/types.js";
|
|
33
|
+
import { UploadsOption } from "../plugin/uploadsCollection.js";
|
|
26
34
|
import { ValidationRuleOption, ValidationRuleRegistry, ValidationRulesConfig } from "../validation/registry.js";
|
|
27
|
-
import { FormBuilderPluginOptions } from "../
|
|
28
|
-
export type { ActionDefinition, ActionOption, ActionRegistry, ActionResult, ActionRunArgs, ActionsConfig, AggregateFieldResponsesArgs, AggregateFormResponsesArgs, AggregationBucket, AggregationRow, AnyActionDefinition,
|
|
35
|
+
import { FormBuilderPluginOptions } from "../options.js";
|
|
36
|
+
export type { ActionDefinition, ActionOption, ActionRegistry, ActionResult, ActionRunArgs, ActionsConfig, AggregateFieldResponsesArgs, AggregateFormResponsesArgs, AggregationBucket, AggregationRow, AnyActionDefinition, AnyFormFieldDefinition, AnyValidationRuleDefinition, ButtonFieldsOverride, ButtonsOption, CalcExpression, CaptchaProvider, CaptchaVerifyArgs, CollectionOverrides, ConsentProof, ConsentSourceEntry, ConsentSourceOption, ConsentSourcePage, ConsentSourcesFieldOptions, ConsentSourcesResolver, ConsentStatement, ConsentStatements, DefaultButtonFields, FieldAggregation, FieldCondition, FieldMeta, FieldTypeOption, FieldTypeRegistry, FieldTypesConfig, FieldsOverride, FileFieldConfig, FileRef, FileRefError, FlowStep, FlowTransition, FormBuilderPluginOptions, FormButtonSettings, FormDocument, FormEvent, FormEventSink, FormFieldDefinition, FormFieldFormat, FormFieldInstance, FormFieldValidate, FormFieldValueKind, FormFlow, FormPollSettings, FormResponseSettings, FormResultsAccess, FormResultsAccessArgs, FromAddressOption, FromAddressesResolver, IdentifyFn, OmittableSharedField, PollOptionSourceOption, PollOptionSourceRegistry, PollOptionSourcesConfig, PrefillOptions, PresentationDensity, PresentationDescriptor, PresentationSurface, RateLimitCheckArgs, RateLimitConfig, RateLimitResult, RateLimiter, RecallResolver, ResolveConsentEntriesArgs, ResolveConsentSourcesRequestArgs, ResolveConsentSourcesRequestResult, ResolveConsentStatementsArgs, ResolvePublishedVersionRefArgs, ResolveResultsRequestArgs, ResolveResultsRequestResult, RichTextBodyOption, SpamConfig, SpamMetadataConfig, SpamOption, SubmissionDescriptor, SubmissionFieldError, SubmissionStatusFilter, SubmissionValue, SubmissionWidth, UploadsOption, ValidationRuleDefinition, ValidationRuleOption, ValidationRuleRegistry, ValidationRuleResult, ValidationRulesConfig };
|
|
@@ -1,24 +1,45 @@
|
|
|
1
1
|
import { keys } from "../translations/keys.js";
|
|
2
2
|
import { labelFor } from "../translations/server.js";
|
|
3
3
|
import { buildConditionTypeMap } from "../conditions/conditionType.js";
|
|
4
|
-
import { buildConsentSourceConfig } from "../consent/buildConsentSourceConfig.js";
|
|
5
4
|
import { buildRuleBlocks } from "../validation/buildRuleBlocks.js";
|
|
6
|
-
import {
|
|
5
|
+
import { fieldBlockTabs } from "./sharedConfig.js";
|
|
7
6
|
//#region src/fields/buildFieldBlocks.ts
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const FIELD_BLOCK_LABEL_REF = "@10x-media/form-builder/client#FieldBlockLabel";
|
|
8
|
+
/**
|
|
9
|
+
* Replace Payload's default `blockName` row header (which reads "Untitled" until filled) with the
|
|
10
|
+
* field's own `label`, keyed to the type label as fallback. See `FieldBlockLabel`.
|
|
11
|
+
*/
|
|
12
|
+
const blockLabelAdmin = (typeLabelKey, ref = FIELD_BLOCK_LABEL_REF) => ({ components: { Label: {
|
|
13
|
+
path: ref,
|
|
14
|
+
clientProps: { typeLabelKey }
|
|
15
|
+
} } });
|
|
16
|
+
/** Whether `fields` contains a field named `name`, descending into presentational rows. */
|
|
17
|
+
const hasNameField = (fields) => fields.some((f) => {
|
|
18
|
+
if ("name" in f && f.name === "name") return true;
|
|
19
|
+
return f.type === "row" && hasNameField(f.fields);
|
|
20
|
+
});
|
|
21
|
+
/** The tab whose fields hold the shared basics and type config, found by the `name` field it carries. */
|
|
22
|
+
const fieldTabOf = (block) => {
|
|
23
|
+
return block.fields.find((f) => f.type === "tabs")?.tabs.find((tab) => hasNameField(tab.fields))?.fields;
|
|
24
|
+
};
|
|
25
|
+
const buildFieldBlocks = ({ registry, ruleRegistry, localize = true }) => {
|
|
10
26
|
const conditionTypes = buildConditionTypeMap(registry);
|
|
11
27
|
const blocks = [];
|
|
28
|
+
const bareSlugs = /* @__PURE__ */ new Set();
|
|
12
29
|
for (const definition of registry.values()) {
|
|
13
|
-
|
|
14
|
-
if (definition.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
const typeConfig = definition.config ?? [];
|
|
31
|
+
if (definition.bare === true) {
|
|
32
|
+
bareSlugs.add(definition.type);
|
|
33
|
+
blocks.push({
|
|
34
|
+
slug: definition.type,
|
|
35
|
+
labels: {
|
|
36
|
+
singular: labelFor(definition.label),
|
|
37
|
+
plural: labelFor(definition.label)
|
|
38
|
+
},
|
|
39
|
+
admin: blockLabelAdmin(definition.label, definition.blockLabel),
|
|
40
|
+
fields: typeConfig
|
|
41
|
+
});
|
|
42
|
+
continue;
|
|
22
43
|
}
|
|
23
44
|
blocks.push({
|
|
24
45
|
slug: definition.type,
|
|
@@ -26,31 +47,31 @@ const buildFieldBlocks = (registry, ruleRegistry, consentRegistry) => {
|
|
|
26
47
|
singular: labelFor(definition.label),
|
|
27
48
|
plural: labelFor(definition.label)
|
|
28
49
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
admin: blockLabelAdmin(definition.label, definition.blockLabel),
|
|
51
|
+
fields: [fieldBlockTabs({
|
|
52
|
+
conditionTypes,
|
|
53
|
+
typeConfig,
|
|
54
|
+
validations: {
|
|
33
55
|
name: "validations",
|
|
34
56
|
type: "blocks",
|
|
35
57
|
label: labelFor(keys.validationsLabel),
|
|
36
58
|
blocks: buildRuleBlocks(ruleRegistry, definition.type)
|
|
37
|
-
}
|
|
38
|
-
|
|
59
|
+
},
|
|
60
|
+
localize,
|
|
61
|
+
omitShared: definition.omitShared,
|
|
62
|
+
advancedConfig: definition.advancedConfig
|
|
63
|
+
})]
|
|
39
64
|
});
|
|
40
65
|
}
|
|
41
66
|
const repeaterBlock = blocks.find((b) => b.slug === "repeater");
|
|
42
67
|
if (repeaterBlock) {
|
|
43
|
-
const subFieldBlocks = blocks.filter((b) => b.slug !== "repeater");
|
|
44
|
-
const fieldsArr = repeaterBlock.fields;
|
|
45
|
-
const validationsIdx = fieldsArr.findIndex((f) => f.name === "validations");
|
|
46
68
|
const subFieldsField = {
|
|
47
69
|
name: "subFields",
|
|
48
70
|
type: "blocks",
|
|
49
71
|
label: labelFor(keys.configSubFields),
|
|
50
|
-
blocks:
|
|
72
|
+
blocks: blocks.filter((b) => b.slug !== "repeater" && !bareSlugs.has(b.slug))
|
|
51
73
|
};
|
|
52
|
-
|
|
53
|
-
else fieldsArr.push(subFieldsField);
|
|
74
|
+
(fieldTabOf(repeaterBlock) ?? repeaterBlock.fields).push(subFieldsField);
|
|
54
75
|
}
|
|
55
76
|
return blocks;
|
|
56
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFieldBlocks.js","names":[],"sources":["../../src/fields/buildFieldBlocks.ts"],"sourcesContent":["import type { Block, Field } from 'payload'\nimport { buildConditionTypeMap } from '../conditions/conditionType'\nimport {
|
|
1
|
+
{"version":3,"file":"buildFieldBlocks.js","names":[],"sources":["../../src/fields/buildFieldBlocks.ts"],"sourcesContent":["import type { Block, Field, TabsField } from 'payload'\nimport { buildConditionTypeMap } from '../conditions/conditionType'\nimport { keys } from '../translations/keys'\nimport { labelFor } from '../translations/server'\nimport { buildRuleBlocks } from '../validation/buildRuleBlocks'\nimport type { ValidationRuleRegistry } from '../validation/registry'\nimport type { FieldTypeRegistry } from './registry'\nimport { fieldBlockTabs } from './sharedConfig'\n\nconst FIELD_BLOCK_LABEL_REF = '@10x-media/form-builder/client#FieldBlockLabel'\n\n/**\n * Replace Payload's default `blockName` row header (which reads \"Untitled\" until filled) with the\n * field's own `label`, keyed to the type label as fallback. See `FieldBlockLabel`.\n */\nconst blockLabelAdmin = (\n\ttypeLabelKey: string,\n\tref: string = FIELD_BLOCK_LABEL_REF\n): NonNullable<Block['admin']> => ({\n\tcomponents: { Label: { path: ref, clientProps: { typeLabelKey } } },\n})\n\n/** Whether `fields` contains a field named `name`, descending into presentational rows. */\nconst hasNameField = (fields: Field[]): boolean =>\n\tfields.some((f) => {\n\t\tif ('name' in f && f.name === 'name') {\n\t\t\treturn true\n\t\t}\n\t\treturn f.type === 'row' && hasNameField(f.fields)\n\t})\n\n/** The tab whose fields hold the shared basics and type config, found by the `name` field it carries. */\nconst fieldTabOf = (block: Block): Field[] | undefined => {\n\tconst tabsField = block.fields.find((f): f is TabsField => f.type === 'tabs')\n\treturn tabsField?.tabs.find((tab) => hasNameField(tab.fields))?.fields\n}\n\n/**\n * One add-field block per registered type: tabs holding shared config, type config, and\n * validations. Bare definitions (e.g. `message`) skip all of that: their block is the\n * definition's `config` alone, no name/shared basics/tabs. `localize` controls whether the\n * shared content fields carry `localized: true`; per-type config fields carry their own flag\n * from the registry definitions.\n */\ntype BuildFieldBlocksArgs = {\n\tregistry: FieldTypeRegistry\n\truleRegistry: ValidationRuleRegistry\n\tlocalize?: boolean\n}\n\nexport const buildFieldBlocks = ({\n\tregistry,\n\truleRegistry,\n\tlocalize = true,\n}: BuildFieldBlocksArgs): Block[] => {\n\tconst conditionTypes = buildConditionTypeMap(registry)\n\tconst blocks: Block[] = []\n\tconst bareSlugs = new Set<string>()\n\tfor (const definition of registry.values()) {\n\t\tconst typeConfig: Field[] = definition.config ?? []\n\n\t\tif (definition.bare === true) {\n\t\t\tbareSlugs.add(definition.type)\n\t\t\tblocks.push({\n\t\t\t\tslug: definition.type,\n\t\t\t\tlabels: { singular: labelFor(definition.label), plural: labelFor(definition.label) },\n\t\t\t\tadmin: blockLabelAdmin(definition.label, definition.blockLabel),\n\t\t\t\tfields: typeConfig,\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\tblocks.push({\n\t\t\tslug: definition.type,\n\t\t\tlabels: { singular: labelFor(definition.label), plural: labelFor(definition.label) },\n\t\t\tadmin: blockLabelAdmin(definition.label, definition.blockLabel),\n\t\t\tfields: [\n\t\t\t\tfieldBlockTabs({\n\t\t\t\t\tconditionTypes,\n\t\t\t\t\ttypeConfig,\n\t\t\t\t\tvalidations: {\n\t\t\t\t\t\tname: 'validations',\n\t\t\t\t\t\ttype: 'blocks',\n\t\t\t\t\t\tlabel: labelFor(keys.validationsLabel),\n\t\t\t\t\t\tblocks: buildRuleBlocks(ruleRegistry, definition.type),\n\t\t\t\t\t},\n\t\t\t\t\tlocalize,\n\t\t\t\t\tomitShared: definition.omitShared,\n\t\t\t\t\tadvancedConfig: definition.advancedConfig,\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\t}\n\n\t// Second pass: inject subFields into the repeater block using all non-repeater blocks.\n\t// Done after the main loop so every sibling block is already built.\n\t// Repeater-in-repeater is not supported in v1; the repeater block is excluded from subFields.\n\t// Bare blocks are excluded too: repeater row plumbing (values, composite error paths) is name-keyed.\n\tconst repeaterBlock = blocks.find((b) => b.slug === 'repeater')\n\tif (repeaterBlock) {\n\t\tconst subFieldsField: Field = {\n\t\t\tname: 'subFields',\n\t\t\ttype: 'blocks',\n\t\t\tlabel: labelFor(keys.configSubFields),\n\t\t\tblocks: blocks.filter((b) => b.slug !== 'repeater' && !bareSlugs.has(b.slug)),\n\t\t}\n\t\tconst fieldTabFields = fieldTabOf(repeaterBlock)\n\t\t;(fieldTabFields ?? (repeaterBlock.fields as Field[])).push(subFieldsField)\n\t}\n\n\treturn blocks\n}\n"],"mappings":";;;;;;AASA,MAAM,wBAAwB;;;;;AAM9B,MAAM,mBACL,cACA,MAAc,2BACoB,EAClC,YAAY,EAAE,OAAO;CAAE,MAAM;CAAK,aAAa,EAAE,aAAa;AAAE,EAAE,EACnE;;AAGA,MAAM,gBAAgB,WACrB,OAAO,MAAM,MAAM;CAClB,IAAI,UAAU,KAAK,EAAE,SAAS,QAC7B,OAAO;CAER,OAAO,EAAE,SAAS,SAAS,aAAa,EAAE,MAAM;AACjD,CAAC;;AAGF,MAAM,cAAc,UAAsC;CAEzD,OADkB,MAAM,OAAO,MAAM,MAAsB,EAAE,SAAS,MACvD,GAAG,KAAK,MAAM,QAAQ,aAAa,IAAI,MAAM,CAAC,GAAG;AACjE;AAeA,MAAa,oBAAoB,EAChC,UACA,cACA,WAAW,WACyB;CACpC,MAAM,iBAAiB,sBAAsB,QAAQ;CACrD,MAAM,SAAkB,CAAC;CACzB,MAAM,4BAAY,IAAI,IAAY;CAClC,KAAK,MAAM,cAAc,SAAS,OAAO,GAAG;EAC3C,MAAM,aAAsB,WAAW,UAAU,CAAC;EAElD,IAAI,WAAW,SAAS,MAAM;GAC7B,UAAU,IAAI,WAAW,IAAI;GAC7B,OAAO,KAAK;IACX,MAAM,WAAW;IACjB,QAAQ;KAAE,UAAU,SAAS,WAAW,KAAK;KAAG,QAAQ,SAAS,WAAW,KAAK;IAAE;IACnF,OAAO,gBAAgB,WAAW,OAAO,WAAW,UAAU;IAC9D,QAAQ;GACT,CAAC;GACD;EACD;EAEA,OAAO,KAAK;GACX,MAAM,WAAW;GACjB,QAAQ;IAAE,UAAU,SAAS,WAAW,KAAK;IAAG,QAAQ,SAAS,WAAW,KAAK;GAAE;GACnF,OAAO,gBAAgB,WAAW,OAAO,WAAW,UAAU;GAC9D,QAAQ,CACP,eAAe;IACd;IACA;IACA,aAAa;KACZ,MAAM;KACN,MAAM;KACN,OAAO,SAAS,KAAK,gBAAgB;KACrC,QAAQ,gBAAgB,cAAc,WAAW,IAAI;IACtD;IACA;IACA,YAAY,WAAW;IACvB,gBAAgB,WAAW;GAC5B,CAAC,CACF;EACD,CAAC;CACF;CAMA,MAAM,gBAAgB,OAAO,MAAM,MAAM,EAAE,SAAS,UAAU;CAC9D,IAAI,eAAe;EAClB,MAAM,iBAAwB;GAC7B,MAAM;GACN,MAAM;GACN,OAAO,SAAS,KAAK,eAAe;GACpC,QAAQ,OAAO,QAAQ,MAAM,EAAE,SAAS,cAAc,CAAC,UAAU,IAAI,EAAE,IAAI,CAAC;EAC7E;EAEC,CADsB,WAAW,aACnB,KAAM,cAAc,QAAoB,KAAK,cAAc;CAC3E;CAEA,OAAO;AACR"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PayloadRequest } from "payload";
|
|
2
|
+
|
|
3
|
+
//#region src/fields/builtin/calculation.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Serializable calc-source metadata for the admin builder (threaded as clientProps): key, display
|
|
6
|
+
* label, and which modes the source implements (`scalar` = has `resolve`, `weights` = has
|
|
7
|
+
* `resolveWeights`). Derived where the registry is resolved; resolver functions never serialize.
|
|
8
|
+
*/
|
|
9
|
+
type CalcSourceClientMeta = {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string | Record<string, string>;
|
|
12
|
+
scalar: boolean;
|
|
13
|
+
weights: boolean;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CalcSourceClientMeta };
|
|
17
|
+
//# sourceMappingURL=calculation.d.ts.map
|