@plumix/core 0.6.0 → 0.7.0
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/dist/cache/embedded-tags.d.ts +5 -0
- package/dist/cache/embedded-tags.d.ts.map +1 -0
- package/dist/cache/embedded-tags.js +30 -0
- package/dist/cache/embedded-tags.js.map +1 -0
- package/dist/entries/read-service.d.ts.map +1 -1
- package/dist/entries/read-service.js +5 -3
- package/dist/entries/read-service.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/errors.d.ts +7 -1
- package/dist/plugin/errors.d.ts.map +1 -1
- package/dist/plugin/errors.js +5 -0
- package/dist/plugin/errors.js.map +1 -1
- package/dist/plugin/fields/builder.d.ts +106 -0
- package/dist/plugin/fields/builder.d.ts.map +1 -0
- package/dist/plugin/fields/builder.js +162 -0
- package/dist/plugin/fields/builder.js.map +1 -0
- package/dist/plugin/fields/color.d.ts +78 -18
- package/dist/plugin/fields/color.d.ts.map +1 -1
- package/dist/plugin/fields/color.js +116 -25
- package/dist/plugin/fields/color.js.map +1 -1
- package/dist/plugin/fields/condition.d.ts +40 -0
- package/dist/plugin/fields/condition.d.ts.map +1 -0
- package/dist/plugin/fields/condition.js +115 -0
- package/dist/plugin/fields/condition.js.map +1 -0
- package/dist/plugin/fields/contributions.d.ts +233 -0
- package/dist/plugin/fields/contributions.d.ts.map +1 -0
- package/dist/plugin/fields/contributions.js +1 -0
- package/dist/plugin/fields/contributions.js.map +1 -0
- package/dist/plugin/fields/entry.d.ts +18 -22
- package/dist/plugin/fields/entry.d.ts.map +1 -1
- package/dist/plugin/fields/entry.js +13 -21
- package/dist/plugin/fields/entry.js.map +1 -1
- package/dist/plugin/fields/errors.d.ts +23 -11
- package/dist/plugin/fields/errors.d.ts.map +1 -1
- package/dist/plugin/fields/errors.js +20 -13
- package/dist/plugin/fields/errors.js.map +1 -1
- package/dist/plugin/fields/group.d.ts +90 -0
- package/dist/plugin/fields/group.d.ts.map +1 -0
- package/dist/plugin/fields/group.js +124 -0
- package/dist/plugin/fields/group.js.map +1 -0
- package/dist/plugin/fields/index.d.ts +22 -45
- package/dist/plugin/fields/index.d.ts.map +1 -1
- package/dist/plugin/fields/index.js +25 -30
- package/dist/plugin/fields/index.js.map +1 -1
- package/dist/plugin/fields/json.d.ts +71 -9
- package/dist/plugin/fields/json.d.ts.map +1 -1
- package/dist/plugin/fields/json.js +110 -16
- package/dist/plugin/fields/json.js.map +1 -1
- package/dist/plugin/fields/link.d.ts +96 -0
- package/dist/plugin/fields/link.d.ts.map +1 -0
- package/dist/plugin/fields/link.js +160 -0
- package/dist/plugin/fields/link.js.map +1 -0
- package/dist/plugin/fields/number.d.ts +86 -13
- package/dist/plugin/fields/number.d.ts.map +1 -1
- package/dist/plugin/fields/number.js +133 -20
- package/dist/plugin/fields/number.js.map +1 -1
- package/dist/plugin/fields/range.d.ts +101 -17
- package/dist/plugin/fields/range.d.ts.map +1 -1
- package/dist/plugin/fields/range.js +153 -38
- package/dist/plugin/fields/range.js.map +1 -1
- package/dist/plugin/fields/reference.d.ts +171 -0
- package/dist/plugin/fields/reference.d.ts.map +1 -0
- package/dist/plugin/fields/reference.js +193 -0
- package/dist/plugin/fields/reference.js.map +1 -0
- package/dist/plugin/fields/repeater.d.ts +111 -8
- package/dist/plugin/fields/repeater.d.ts.map +1 -1
- package/dist/plugin/fields/repeater.js +157 -66
- package/dist/plugin/fields/repeater.js.map +1 -1
- package/dist/plugin/fields/richtext-validate.d.ts +7 -0
- package/dist/plugin/fields/richtext-validate.d.ts.map +1 -1
- package/dist/plugin/fields/richtext-validate.js +11 -5
- package/dist/plugin/fields/richtext-validate.js.map +1 -1
- package/dist/plugin/fields/richtext.d.ts +78 -12
- package/dist/plugin/fields/richtext.d.ts.map +1 -1
- package/dist/plugin/fields/richtext.js +121 -26
- package/dist/plugin/fields/richtext.js.map +1 -1
- package/dist/plugin/fields/select.d.ts +150 -10
- package/dist/plugin/fields/select.d.ts.map +1 -1
- package/dist/plugin/fields/select.js +205 -17
- package/dist/plugin/fields/select.js.map +1 -1
- package/dist/plugin/fields/sub-fields.d.ts +12 -0
- package/dist/plugin/fields/sub-fields.d.ts.map +1 -0
- package/dist/plugin/fields/sub-fields.js +62 -0
- package/dist/plugin/fields/sub-fields.js.map +1 -0
- package/dist/plugin/fields/temporal.d.ts +124 -0
- package/dist/plugin/fields/temporal.d.ts.map +1 -0
- package/dist/plugin/fields/temporal.js +180 -0
- package/dist/plugin/fields/temporal.js.map +1 -0
- package/dist/plugin/fields/term.d.ts +11 -16
- package/dist/plugin/fields/term.d.ts.map +1 -1
- package/dist/plugin/fields/term.js +11 -19
- package/dist/plugin/fields/term.js.map +1 -1
- package/dist/plugin/fields/toggle.d.ts +97 -0
- package/dist/plugin/fields/toggle.d.ts.map +1 -0
- package/dist/plugin/fields/toggle.js +135 -0
- package/dist/plugin/fields/toggle.js.map +1 -0
- package/dist/plugin/fields/user.d.ts +14 -26
- package/dist/plugin/fields/user.d.ts.map +1 -1
- package/dist/plugin/fields/user.js +11 -25
- package/dist/plugin/fields/user.js.map +1 -1
- package/dist/plugin/lookup.d.ts +70 -1
- package/dist/plugin/lookup.d.ts.map +1 -1
- package/dist/plugin/manifest.d.ts +308 -128
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +94 -4
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/setup-context.d.ts +5 -4
- package/dist/plugin/setup-context.d.ts.map +1 -1
- package/dist/plugin/setup-context.js +10 -3
- package/dist/plugin/setup-context.js.map +1 -1
- package/dist/plugin/validation/meta-box-fields.d.ts.map +1 -1
- package/dist/plugin/validation/meta-box-fields.js +16 -0
- package/dist/plugin/validation/meta-box-fields.js.map +1 -1
- package/dist/route/render/build-resolved-entries.d.ts.map +1 -1
- package/dist/route/render/build-resolved-entries.js +7 -2
- package/dist/route/render/build-resolved-entries.js.map +1 -1
- package/dist/route/render/render-template.d.ts.map +1 -1
- package/dist/route/render/render-template.js +12 -2
- package/dist/route/render/render-template.js.map +1 -1
- package/dist/route/render/template-builders.d.ts +15 -10
- package/dist/route/render/template-builders.d.ts.map +1 -1
- package/dist/route/render/template-builders.js.map +1 -1
- package/dist/rpc/base.d.ts +7 -0
- package/dist/rpc/base.d.ts.map +1 -1
- package/dist/rpc/errors.d.ts +7 -0
- package/dist/rpc/errors.d.ts.map +1 -1
- package/dist/rpc/errors.js +16 -0
- package/dist/rpc/errors.js.map +1 -1
- package/dist/rpc/meta/core.d.ts +89 -10
- package/dist/rpc/meta/core.d.ts.map +1 -1
- package/dist/rpc/meta/core.js +465 -282
- package/dist/rpc/meta/core.js.map +1 -1
- package/dist/rpc/meta/field-messages.d.ts +67 -0
- package/dist/rpc/meta/field-messages.d.ts.map +1 -0
- package/dist/rpc/meta/field-messages.js +67 -0
- package/dist/rpc/meta/field-messages.js.map +1 -0
- package/dist/rpc/meta/field-pipeline.d.ts +52 -0
- package/dist/rpc/meta/field-pipeline.d.ts.map +1 -0
- package/dist/rpc/meta/field-pipeline.js +501 -0
- package/dist/rpc/meta/field-pipeline.js.map +1 -0
- package/dist/rpc/procedures/auth/allowed-domains/create.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/create.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/delete.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/index.d.ts +28 -0
- package/dist/rpc/procedures/auth/allowed-domains/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/update.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/update.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/admin-list.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/admin-list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/admin-revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/admin-revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/create.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/create.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/index.d.ts +35 -0
- package/dist/rpc/procedures/auth/api-tokens/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/delete.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/credentials/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/rename.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/rename.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/approve.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/approve.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/deny.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/deny.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/device-flow/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/lookup.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/index.d.ts +154 -0
- package/dist/rpc/procedures/auth/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/login-links.d.ts +7 -0
- package/dist/rpc/procedures/auth/login-links.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/mailer/index.d.ts +7 -0
- package/dist/rpc/procedures/auth/mailer/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/mailer/test-send.d.ts +7 -0
- package/dist/rpc/procedures/auth/mailer/test-send.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/oauth-providers.d.ts +7 -0
- package/dist/rpc/procedures/auth/oauth-providers.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/session.d.ts +7 -0
- package/dist/rpc/procedures/auth/session.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/sessions/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/revoke-others.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/revoke-others.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/activity.d.ts +7 -0
- package/dist/rpc/procedures/entry/activity.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/bulk.d.ts +21 -0
- package/dist/rpc/procedures/entry/bulk.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create-preview-link.d.ts +7 -0
- package/dist/rpc/procedures/entry/create-preview-link.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create.d.ts +8 -1
- package/dist/rpc/procedures/entry/create.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create.js +8 -8
- package/dist/rpc/procedures/entry/create.js.map +1 -1
- package/dist/rpc/procedures/entry/dashboard.d.ts +14 -0
- package/dist/rpc/procedures/entry/dashboard.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/delete-permanent.d.ts +7 -0
- package/dist/rpc/procedures/entry/delete-permanent.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/discard-draft.d.ts +7 -0
- package/dist/rpc/procedures/entry/discard-draft.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/duplicate.d.ts +7 -0
- package/dist/rpc/procedures/entry/duplicate.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/duplicate.js +2 -2
- package/dist/rpc/procedures/entry/duplicate.js.map +1 -1
- package/dist/rpc/procedures/entry/get.d.ts +7 -0
- package/dist/rpc/procedures/entry/get.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/get.js +2 -2
- package/dist/rpc/procedures/entry/get.js.map +1 -1
- package/dist/rpc/procedures/entry/index.d.ts +156 -2
- package/dist/rpc/procedures/entry/index.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/list.d.ts +7 -0
- package/dist/rpc/procedures/entry/list.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/lookup.d.ts +8 -2
- package/dist/rpc/procedures/entry/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/lookup.js +60 -1
- package/dist/rpc/procedures/entry/lookup.js.map +1 -1
- package/dist/rpc/procedures/entry/meta.d.ts +37 -3
- package/dist/rpc/procedures/entry/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/meta.js +63 -7
- package/dist/rpc/procedures/entry/meta.js.map +1 -1
- package/dist/rpc/procedures/entry/publish.d.ts +7 -0
- package/dist/rpc/procedures/entry/publish.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/publish.js +6 -4
- package/dist/rpc/procedures/entry/publish.js.map +1 -1
- package/dist/rpc/procedures/entry/refresh-block-loader.d.ts +7 -0
- package/dist/rpc/procedures/entry/refresh-block-loader.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/restore.d.ts +7 -0
- package/dist/rpc/procedures/entry/restore.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/revisions.d.ts +56 -0
- package/dist/rpc/procedures/entry/revisions.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/schemas.d.ts +2 -2
- package/dist/rpc/procedures/entry/schemas.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/schemas.js +9 -2
- package/dist/rpc/procedures/entry/schemas.js.map +1 -1
- package/dist/rpc/procedures/entry/trash.d.ts +7 -0
- package/dist/rpc/procedures/entry/trash.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/update.d.ts +8 -1
- package/dist/rpc/procedures/entry/update.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/update.js +77 -18
- package/dist/rpc/procedures/entry/update.js.map +1 -1
- package/dist/rpc/procedures/lookup/index.d.ts +14 -0
- package/dist/rpc/procedures/lookup/index.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/list.d.ts +7 -0
- package/dist/rpc/procedures/lookup/list.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/resolve.d.ts +7 -0
- package/dist/rpc/procedures/lookup/resolve.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/resolve.js +1 -1
- package/dist/rpc/procedures/lookup/resolve.js.map +1 -1
- package/dist/rpc/procedures/search/index.d.ts +7 -0
- package/dist/rpc/procedures/search/index.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/get.d.ts +7 -0
- package/dist/rpc/procedures/settings/get.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/index.d.ts +14 -0
- package/dist/rpc/procedures/settings/index.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/upsert.d.ts +7 -0
- package/dist/rpc/procedures/settings/upsert.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/upsert.js +9 -0
- package/dist/rpc/procedures/settings/upsert.js.map +1 -1
- package/dist/rpc/procedures/term/create.d.ts +7 -0
- package/dist/rpc/procedures/term/create.d.ts.map +1 -1
- package/dist/rpc/procedures/term/create.js +3 -3
- package/dist/rpc/procedures/term/create.js.map +1 -1
- package/dist/rpc/procedures/term/delete.d.ts +7 -0
- package/dist/rpc/procedures/term/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/term/get.d.ts +7 -0
- package/dist/rpc/procedures/term/get.d.ts.map +1 -1
- package/dist/rpc/procedures/term/index.d.ts +35 -0
- package/dist/rpc/procedures/term/index.d.ts.map +1 -1
- package/dist/rpc/procedures/term/list.d.ts +7 -0
- package/dist/rpc/procedures/term/list.d.ts.map +1 -1
- package/dist/rpc/procedures/term/lookup.d.ts +7 -2
- package/dist/rpc/procedures/term/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/term/lookup.js +26 -0
- package/dist/rpc/procedures/term/lookup.js.map +1 -1
- package/dist/rpc/procedures/term/meta.d.ts +3 -2
- package/dist/rpc/procedures/term/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/term/meta.js +7 -5
- package/dist/rpc/procedures/term/meta.js.map +1 -1
- package/dist/rpc/procedures/term/update.d.ts +7 -0
- package/dist/rpc/procedures/term/update.d.ts.map +1 -1
- package/dist/rpc/procedures/term/update.js +4 -4
- package/dist/rpc/procedures/term/update.js.map +1 -1
- package/dist/rpc/procedures/user/cancel-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/cancel-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/delete.d.ts +7 -0
- package/dist/rpc/procedures/user/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/user/disable.d.ts +7 -0
- package/dist/rpc/procedures/user/disable.d.ts.map +1 -1
- package/dist/rpc/procedures/user/enable.d.ts +7 -0
- package/dist/rpc/procedures/user/enable.d.ts.map +1 -1
- package/dist/rpc/procedures/user/get.d.ts +7 -0
- package/dist/rpc/procedures/user/get.d.ts.map +1 -1
- package/dist/rpc/procedures/user/get.js +2 -2
- package/dist/rpc/procedures/user/get.js.map +1 -1
- package/dist/rpc/procedures/user/index.d.ts +77 -0
- package/dist/rpc/procedures/user/index.d.ts.map +1 -1
- package/dist/rpc/procedures/user/invite.d.ts +7 -0
- package/dist/rpc/procedures/user/invite.d.ts.map +1 -1
- package/dist/rpc/procedures/user/list.d.ts +7 -0
- package/dist/rpc/procedures/user/list.d.ts.map +1 -1
- package/dist/rpc/procedures/user/lookup.d.ts +6 -2
- package/dist/rpc/procedures/user/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/user/lookup.js +29 -0
- package/dist/rpc/procedures/user/lookup.js.map +1 -1
- package/dist/rpc/procedures/user/meta.d.ts +3 -2
- package/dist/rpc/procedures/user/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/user/meta.js +7 -5
- package/dist/rpc/procedures/user/meta.js.map +1 -1
- package/dist/rpc/procedures/user/pending-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/pending-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/request-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/request-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/set-locale.d.ts +7 -0
- package/dist/rpc/procedures/user/set-locale.d.ts.map +1 -1
- package/dist/rpc/procedures/user/update.d.ts +7 -0
- package/dist/rpc/procedures/user/update.d.ts.map +1 -1
- package/dist/rpc/procedures/user/update.js +4 -4
- package/dist/rpc/procedures/user/update.js.map +1 -1
- package/dist/rpc/router.d.ts +457 -2
- package/dist/rpc/router.d.ts.map +1 -1
- package/dist/rpc/validation.d.ts +1 -0
- package/dist/rpc/validation.d.ts.map +1 -1
- package/dist/rpc/validation.js +1 -0
- package/dist/rpc/validation.js.map +1 -1
- package/dist/runtime/dispatcher.d.ts.map +1 -1
- package/dist/runtime/dispatcher.js +20 -10
- package/dist/runtime/dispatcher.js.map +1 -1
- package/dist/seo/feed.d.ts.map +1 -1
- package/dist/seo/feed.js +7 -1
- package/dist/seo/feed.js.map +1 -1
- package/dist/settings-core.js +1 -1
- package/dist/settings-core.js.map +1 -1
- package/dist/template-registry.d.ts +0 -16
- package/dist/template-registry.d.ts.map +1 -1
- package/dist/terms/read-service.js +2 -2
- package/dist/terms/read-service.js.map +1 -1
- package/dist/test/traced-context.d.ts +1 -1
- package/dist/test/traced-context.d.ts.map +1 -1
- package/dist/test/traced-context.js +2 -2
- package/dist/test/traced-context.js.map +1 -1
- package/package.json +2 -2
- package/dist/plugin/fields/checkbox.d.ts +0 -19
- package/dist/plugin/fields/checkbox.d.ts.map +0 -1
- package/dist/plugin/fields/checkbox.js +0 -20
- package/dist/plugin/fields/checkbox.js.map +0 -1
- package/dist/plugin/fields/date.d.ts +0 -24
- package/dist/plugin/fields/date.d.ts.map +0 -1
- package/dist/plugin/fields/date.js +0 -23
- package/dist/plugin/fields/date.js.map +0 -1
- package/dist/plugin/fields/datetime.d.ts +0 -26
- package/dist/plugin/fields/datetime.d.ts.map +0 -1
- package/dist/plugin/fields/datetime.js +0 -25
- package/dist/plugin/fields/datetime.js.map +0 -1
- package/dist/plugin/fields/email.d.ts +0 -17
- package/dist/plugin/fields/email.d.ts.map +0 -1
- package/dist/plugin/fields/email.js +0 -18
- package/dist/plugin/fields/email.js.map +0 -1
- package/dist/plugin/fields/entry-list.d.ts +0 -28
- package/dist/plugin/fields/entry-list.d.ts.map +0 -1
- package/dist/plugin/fields/entry-list.js +0 -31
- package/dist/plugin/fields/entry-list.js.map +0 -1
- package/dist/plugin/fields/multiselect.d.ts +0 -21
- package/dist/plugin/fields/multiselect.d.ts.map +0 -1
- package/dist/plugin/fields/multiselect.js +0 -43
- package/dist/plugin/fields/multiselect.js.map +0 -1
- package/dist/plugin/fields/password.d.ts +0 -24
- package/dist/plugin/fields/password.d.ts.map +0 -1
- package/dist/plugin/fields/password.js +0 -25
- package/dist/plugin/fields/password.js.map +0 -1
- package/dist/plugin/fields/radio.d.ts +0 -16
- package/dist/plugin/fields/radio.d.ts.map +0 -1
- package/dist/plugin/fields/radio.js +0 -17
- package/dist/plugin/fields/radio.js.map +0 -1
- package/dist/plugin/fields/repeater-validate.d.ts +0 -34
- package/dist/plugin/fields/repeater-validate.d.ts.map +0 -1
- package/dist/plugin/fields/repeater-validate.js +0 -104
- package/dist/plugin/fields/repeater-validate.js.map +0 -1
- package/dist/plugin/fields/term-list.d.ts +0 -27
- package/dist/plugin/fields/term-list.d.ts.map +0 -1
- package/dist/plugin/fields/term-list.js +0 -30
- package/dist/plugin/fields/term-list.js.map +0 -1
- package/dist/plugin/fields/text.d.ts +0 -37
- package/dist/plugin/fields/text.d.ts.map +0 -1
- package/dist/plugin/fields/text.js +0 -31
- package/dist/plugin/fields/text.js.map +0 -1
- package/dist/plugin/fields/textarea.d.ts +0 -20
- package/dist/plugin/fields/textarea.d.ts.map +0 -1
- package/dist/plugin/fields/textarea.js +0 -21
- package/dist/plugin/fields/textarea.js.map +0 -1
- package/dist/plugin/fields/time.d.ts +0 -24
- package/dist/plugin/fields/time.d.ts.map +0 -1
- package/dist/plugin/fields/time.js +0 -23
- package/dist/plugin/fields/time.js.map +0 -1
- package/dist/plugin/fields/url.d.ts +0 -17
- package/dist/plugin/fields/url.d.ts.map +0 -1
- package/dist/plugin/fields/url.js +0 -18
- package/dist/plugin/fields/url.js.map +0 -1
- package/dist/plugin/fields/user-list.d.ts +0 -29
- package/dist/plugin/fields/user-list.d.ts.map +0 -1
- package/dist/plugin/fields/user-list.js +0 -31
- package/dist/plugin/fields/user-list.js.map +0 -1
|
@@ -1,16 +1,119 @@
|
|
|
1
1
|
import type { Label } from "../../i18n/label.js";
|
|
2
|
-
import type { MetaBoxField, MetaBoxFieldSpan, RepeaterMetaBoxField } from "../manifest.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly
|
|
2
|
+
import type { FieldBuilder, MetaBoxField, MetaBoxFieldInput, MetaBoxFieldSpan, RepeaterDialogSize, RepeaterLayout, RepeaterMetaBoxField } from "../manifest.js";
|
|
3
|
+
import type { MetaFieldCondition, MetaFieldConditionRule } from "./condition.js";
|
|
4
|
+
import type { InferFields, InferStoredFields } from "./contributions.js";
|
|
5
|
+
interface RepeaterFieldState {
|
|
6
|
+
readonly subFields: readonly MetaBoxField[];
|
|
7
|
+
readonly visibleWhen?: MetaFieldCondition;
|
|
8
|
+
readonly label?: Label;
|
|
7
9
|
readonly description?: Label;
|
|
8
|
-
readonly
|
|
10
|
+
readonly required?: true;
|
|
9
11
|
readonly span?: MetaBoxFieldSpan;
|
|
10
12
|
readonly capability?: string;
|
|
11
|
-
readonly
|
|
13
|
+
readonly showInApi?: true;
|
|
12
14
|
readonly min?: number;
|
|
13
15
|
readonly max?: number;
|
|
16
|
+
readonly addLabel?: Label;
|
|
17
|
+
readonly layout?: RepeaterLayout;
|
|
18
|
+
readonly collapsed?: string;
|
|
19
|
+
readonly dialogSize?: RepeaterDialogSize;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Entry point of the `repeater()` chain — only `.fields()` is available
|
|
23
|
+
* until the row schema is declared, so a repeater without sub-fields
|
|
24
|
+
* can't reach `build()` (registration surfaces require a `build`
|
|
25
|
+
* method), and `.collapsed()` can be typed against the declared keys.
|
|
26
|
+
*/
|
|
27
|
+
export declare class RepeaterFieldSeed<K extends string = string> {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(key: K);
|
|
30
|
+
/**
|
|
31
|
+
* Declare the row schema — infers the typed row shape. Sub-fields may
|
|
32
|
+
* be any registered field type, including nested repeaters and
|
|
33
|
+
* groups; types recurse. Validated eagerly (key shape, uniqueness,
|
|
34
|
+
* prototype-pollution guard).
|
|
35
|
+
*/
|
|
36
|
+
fields<const F extends readonly MetaBoxFieldInput[]>(fields: F): RepeaterFieldBuilder<F, K>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fluent chain for repeater fields. Immutable — every call returns a
|
|
40
|
+
* fresh instance, so a shared base chain can be forked without
|
|
41
|
+
* aliasing.
|
|
42
|
+
*
|
|
43
|
+
* `F` is the declared row-schema tuple (drives the recursive row type
|
|
44
|
+
* and `.collapsed()` key typing); `K` is the literal field key; `V` is
|
|
45
|
+
* the phantom read type — `readonly InferFields<F>[] | undefined`,
|
|
46
|
+
* narrowed to the non-optional array by `.required()`; `S` is the
|
|
47
|
+
* phantom stored shape (`InferStoredFields<F>` rows). All purely
|
|
48
|
+
* type-level — nothing at runtime carries them.
|
|
49
|
+
*/
|
|
50
|
+
export declare class RepeaterFieldBuilder<F extends readonly MetaBoxFieldInput[], K extends string = string, V = readonly InferFields<F>[] | undefined, S = readonly InferStoredFields<F>[] | undefined> implements FieldBuilder<RepeaterMetaBoxField> {
|
|
51
|
+
#private;
|
|
52
|
+
/** Phantom literal key of the field — type-level only, never assigned. */
|
|
53
|
+
readonly _key: K;
|
|
54
|
+
/** Phantom read type of the field — type-level only, never assigned. */
|
|
55
|
+
readonly _value: V;
|
|
56
|
+
/** Phantom stored shape of the field — type-level only, never assigned. */
|
|
57
|
+
readonly _stored: S;
|
|
58
|
+
constructor(key: string, state: RepeaterFieldState);
|
|
59
|
+
/** Override the derived (humanized-key) label. */
|
|
60
|
+
label(label: Label): RepeaterFieldBuilder<F, K, V, S>;
|
|
61
|
+
/** Help text rendered under the label. */
|
|
62
|
+
description(description: Label): RepeaterFieldBuilder<F, K, V, S>;
|
|
63
|
+
/** Minimum row count — enforced server-side by the constraint walker. */
|
|
64
|
+
min(min: number): RepeaterFieldBuilder<F, K, V, S>;
|
|
65
|
+
/** Maximum row count — enforced server-side and by the admin add button. */
|
|
66
|
+
max(max: number): RepeaterFieldBuilder<F, K, V, S>;
|
|
67
|
+
/** Custom label for the admin add-row button. */
|
|
68
|
+
addLabel(addLabel: Label): RepeaterFieldBuilder<F, K, V, S>;
|
|
69
|
+
/** Admin row layout — see {@link RepeaterLayout}. */
|
|
70
|
+
layout(layout: RepeaterLayout): RepeaterFieldBuilder<F, K, V, S>;
|
|
71
|
+
/**
|
|
72
|
+
* Width of the row-editor dialog — see {@link RepeaterDialogSize}.
|
|
73
|
+
* Widen it for dense, multi-column rows; default `md`.
|
|
74
|
+
*/
|
|
75
|
+
dialogSize(dialogSize: RepeaterDialogSize): RepeaterFieldBuilder<F, K, V, S>;
|
|
76
|
+
/**
|
|
77
|
+
* Make rows collapsible in the admin, labelling each collapsed row by
|
|
78
|
+
* the chosen sub-field's stored value. The key is typed against the
|
|
79
|
+
* declared row schema, so a nonexistent sub-field is a compile error.
|
|
80
|
+
*/
|
|
81
|
+
collapsed(subFieldKey: keyof InferFields<F> & string): RepeaterFieldBuilder<F, K, V, S>;
|
|
82
|
+
/** Mark the field required — narrows the read/stored types to the
|
|
83
|
+
* non-optional array (rejects zero rows server-side). */
|
|
84
|
+
required(): RepeaterFieldBuilder<F, K, readonly InferFields<F>[], readonly InferStoredFields<F>[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Column span within the box's 12-column grid — a universal layout
|
|
87
|
+
* hint; surfaces that can't honor it (the entry editor rail) ignore it.
|
|
88
|
+
*/
|
|
89
|
+
span(span: MetaBoxFieldSpan): RepeaterFieldBuilder<F, K, V, S>;
|
|
90
|
+
/** Capability gate for this field — see `MetaBoxFieldBase.capability`. */
|
|
91
|
+
capability(capability: string): RepeaterFieldBuilder<F, K, V, S>;
|
|
92
|
+
/** Opt this field's value into public REST responses (default-deny). */
|
|
93
|
+
showInApi(): RepeaterFieldBuilder<F, K, V, S>;
|
|
94
|
+
/** Rule factory: this repeater has no rows (unset or cleared). */
|
|
95
|
+
isEmpty(): MetaFieldConditionRule;
|
|
96
|
+
/** Rule factory: this repeater has at least one row. */
|
|
97
|
+
isNotEmpty(): MetaFieldConditionRule;
|
|
98
|
+
/**
|
|
99
|
+
* Show this field only when every rule passes (one AND group) —
|
|
100
|
+
* rules come from sibling fields' condition factories. Replaces any
|
|
101
|
+
* previously declared condition; `.orVisibleWhen()` adds
|
|
102
|
+
* alternatives.
|
|
103
|
+
*/
|
|
104
|
+
visibleWhen(...rules: MetaFieldConditionRule[]): RepeaterFieldBuilder<F, K, V, S>;
|
|
105
|
+
/** Add an OR alternative — one more AND group of rules. */
|
|
106
|
+
orVisibleWhen(...rules: MetaFieldConditionRule[]): RepeaterFieldBuilder<F, K, V, S>;
|
|
107
|
+
/** Compile the chain into the wire/manifest field definition. */
|
|
108
|
+
build(): RepeaterMetaBoxField;
|
|
14
109
|
}
|
|
15
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Repeatable list of structured rows —
|
|
112
|
+
* `repeater("links").fields([text("label"), url("href")])`. Only
|
|
113
|
+
* `.fields()` is available on the bare constructor; the returned
|
|
114
|
+
* builder carries row-count bounds (`.min()`/`.max()`), UX affordances
|
|
115
|
+
* (`.addLabel()`, `.layout()`, `.collapsed()`), and the universal chain.
|
|
116
|
+
*/
|
|
117
|
+
export declare function repeater<K extends string>(key: K): RepeaterFieldSeed<K>;
|
|
118
|
+
export {};
|
|
16
119
|
//# sourceMappingURL=repeater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeater.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/repeater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"repeater.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/repeater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKzE,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
var _a;
|
|
2
|
+
import { compileMetaBoxFields } from "../manifest.js";
|
|
3
|
+
import { humanizeFieldKey } from "./builder.js";
|
|
4
|
+
import { assertSubFields } from "./sub-fields.js";
|
|
5
|
+
/**
|
|
6
|
+
* Entry point of the `repeater()` chain — only `.fields()` is available
|
|
7
|
+
* until the row schema is declared, so a repeater without sub-fields
|
|
8
|
+
* can't reach `build()` (registration surfaces require a `build`
|
|
9
|
+
* method), and `.collapsed()` can be typed against the declared keys.
|
|
10
|
+
*/
|
|
11
|
+
export class RepeaterFieldSeed {
|
|
12
|
+
#key;
|
|
13
|
+
constructor(key) {
|
|
14
|
+
this.#key = key;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Declare the row schema — infers the typed row shape. Sub-fields may
|
|
18
|
+
* be any registered field type, including nested repeaters and
|
|
19
|
+
* groups; types recurse. Validated eagerly (key shape, uniqueness,
|
|
20
|
+
* prototype-pollution guard).
|
|
21
|
+
*/
|
|
22
|
+
fields(fields) {
|
|
23
|
+
const subFields = compileMetaBoxFields(fields);
|
|
24
|
+
assertSubFields("repeater", this.#key, subFields);
|
|
25
|
+
return new RepeaterFieldBuilder(this.#key, { subFields });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Fluent chain for repeater fields. Immutable — every call returns a
|
|
30
|
+
* fresh instance, so a shared base chain can be forked without
|
|
31
|
+
* aliasing.
|
|
32
|
+
*
|
|
33
|
+
* `F` is the declared row-schema tuple (drives the recursive row type
|
|
34
|
+
* and `.collapsed()` key typing); `K` is the literal field key; `V` is
|
|
35
|
+
* the phantom read type — `readonly InferFields<F>[] | undefined`,
|
|
36
|
+
* narrowed to the non-optional array by `.required()`; `S` is the
|
|
37
|
+
* phantom stored shape (`InferStoredFields<F>` rows). All purely
|
|
38
|
+
* type-level — nothing at runtime carries them.
|
|
39
|
+
*/
|
|
40
|
+
export class RepeaterFieldBuilder {
|
|
41
|
+
#key;
|
|
42
|
+
#state;
|
|
43
|
+
constructor(key, state) {
|
|
44
|
+
this.#key = key;
|
|
45
|
+
this.#state = state;
|
|
46
|
+
}
|
|
47
|
+
#fork(patch) {
|
|
48
|
+
return new _a(this.#key, {
|
|
49
|
+
...this.#state,
|
|
50
|
+
...patch,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Override the derived (humanized-key) label. */
|
|
54
|
+
label(label) {
|
|
55
|
+
return this.#fork({ label });
|
|
56
|
+
}
|
|
57
|
+
/** Help text rendered under the label. */
|
|
58
|
+
description(description) {
|
|
59
|
+
return this.#fork({ description });
|
|
60
|
+
}
|
|
61
|
+
/** Minimum row count — enforced server-side by the constraint walker. */
|
|
62
|
+
min(min) {
|
|
63
|
+
return this.#fork({ min });
|
|
64
|
+
}
|
|
65
|
+
/** Maximum row count — enforced server-side and by the admin add button. */
|
|
66
|
+
max(max) {
|
|
67
|
+
return this.#fork({ max });
|
|
68
|
+
}
|
|
69
|
+
/** Custom label for the admin add-row button. */
|
|
70
|
+
addLabel(addLabel) {
|
|
71
|
+
return this.#fork({ addLabel });
|
|
72
|
+
}
|
|
73
|
+
/** Admin row layout — see {@link RepeaterLayout}. */
|
|
74
|
+
layout(layout) {
|
|
75
|
+
return this.#fork({ layout });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Width of the row-editor dialog — see {@link RepeaterDialogSize}.
|
|
79
|
+
* Widen it for dense, multi-column rows; default `md`.
|
|
80
|
+
*/
|
|
81
|
+
dialogSize(dialogSize) {
|
|
82
|
+
return this.#fork({ dialogSize });
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Make rows collapsible in the admin, labelling each collapsed row by
|
|
86
|
+
* the chosen sub-field's stored value. The key is typed against the
|
|
87
|
+
* declared row schema, so a nonexistent sub-field is a compile error.
|
|
88
|
+
*/
|
|
89
|
+
collapsed(subFieldKey) {
|
|
90
|
+
return this.#fork({ collapsed: subFieldKey });
|
|
91
|
+
}
|
|
92
|
+
/** Mark the field required — narrows the read/stored types to the
|
|
93
|
+
* non-optional array (rejects zero rows server-side). */
|
|
94
|
+
required() {
|
|
95
|
+
return this.#fork({ required: true });
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Column span within the box's 12-column grid — a universal layout
|
|
99
|
+
* hint; surfaces that can't honor it (the entry editor rail) ignore it.
|
|
100
|
+
*/
|
|
101
|
+
span(span) {
|
|
102
|
+
return this.#fork({ span });
|
|
103
|
+
}
|
|
104
|
+
/** Capability gate for this field — see `MetaBoxFieldBase.capability`. */
|
|
105
|
+
capability(capability) {
|
|
106
|
+
return this.#fork({ capability });
|
|
107
|
+
}
|
|
108
|
+
/** Opt this field's value into public REST responses (default-deny). */
|
|
109
|
+
showInApi() {
|
|
110
|
+
return this.#fork({ showInApi: true });
|
|
111
|
+
}
|
|
112
|
+
/** Rule factory: this repeater has no rows (unset or cleared). */
|
|
113
|
+
isEmpty() {
|
|
114
|
+
return { key: this.#key, op: "empty" };
|
|
115
|
+
}
|
|
116
|
+
/** Rule factory: this repeater has at least one row. */
|
|
117
|
+
isNotEmpty() {
|
|
118
|
+
return { key: this.#key, op: "not_empty" };
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Show this field only when every rule passes (one AND group) —
|
|
122
|
+
* rules come from sibling fields' condition factories. Replaces any
|
|
123
|
+
* previously declared condition; `.orVisibleWhen()` adds
|
|
124
|
+
* alternatives.
|
|
125
|
+
*/
|
|
126
|
+
visibleWhen(...rules) {
|
|
127
|
+
return this.#fork({ visibleWhen: [rules] });
|
|
128
|
+
}
|
|
129
|
+
/** Add an OR alternative — one more AND group of rules. */
|
|
130
|
+
orVisibleWhen(...rules) {
|
|
131
|
+
return this.#fork({
|
|
132
|
+
visibleWhen: [...(this.#state.visibleWhen ?? []), rules],
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** Compile the chain into the wire/manifest field definition. */
|
|
136
|
+
build() {
|
|
137
|
+
const { subFields, ...state } = this.#state;
|
|
138
|
+
return {
|
|
139
|
+
...state,
|
|
140
|
+
key: this.#key,
|
|
141
|
+
label: state.label ?? humanizeFieldKey(this.#key),
|
|
142
|
+
type: "json",
|
|
143
|
+
inputType: "repeater",
|
|
144
|
+
subFields,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
_a = RepeaterFieldBuilder;
|
|
149
|
+
/**
|
|
150
|
+
* Repeatable list of structured rows —
|
|
151
|
+
* `repeater("links").fields([text("label"), url("href")])`. Only
|
|
152
|
+
* `.fields()` is available on the bare constructor; the returned
|
|
153
|
+
* builder carries row-count bounds (`.min()`/`.max()`), UX affordances
|
|
154
|
+
* (`.addLabel()`, `.layout()`, `.collapsed()`), and the universal chain.
|
|
155
|
+
*/
|
|
156
|
+
export function repeater(key) {
|
|
157
|
+
return new RepeaterFieldSeed(key);
|
|
67
158
|
}
|
|
68
159
|
//# sourceMappingURL=repeater.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeater.js","sourceRoot":"","sources":["../../../src/plugin/fields/repeater.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repeater.js","sourceRoot":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E,EAAE,EAAE,OAAO,EAAE,CAAC;IACzC,CAAC;IAED,wDAAwD;IACxD,UAAU;QACR,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,WAAW,CACT,GAAG,KAA+B;QAElC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,2DAA2D;IAC3D,aAAa,CACX,GAAG,KAA+B;QAElC,OAAO,IAAI,CAAC,KAAK,CAAC;YAChB,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;SACzD,CAAC,CAAC;IACL,CAAC;IAED,iEAAiE;IACjE,KAAK;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,OAAO;YACL,GAAG,KAAK;YACR,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YACjD,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,UAAU;YACrB,SAAS;SACV,CAAC;IACJ,CAAC;CACF;;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAmB,GAAM;IAC/C,OAAO,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Final href gate. Mirrors the regex in `route/render/tiptap.ts`'s
|
|
3
|
+
* `sanitizeHref` — keep them in sync. Blocks `javascript:`, `data:`,
|
|
4
|
+
* `vbscript:`, `file:` and their variants. Fragment / query-only /
|
|
5
|
+
* relative refs pass.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SAFE_HREF_RE: RegExp;
|
|
1
8
|
interface RichtextAllowlist {
|
|
2
9
|
readonly marks?: readonly string[];
|
|
3
10
|
readonly nodes?: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richtext-validate.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/richtext-validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"richtext-validate.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/richtext-validate.ts"],"names":[],"mappings":"AA+CA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAAiD,CAAC;AAa3E,UAAU,iBAAiB;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,GAC3B,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAmB7B;AAED,KAAK,wBAAwB,GAC3B,iBAAiB,GAAG,iBAAiB,GAAG,aAAa,GAAG,eAAe,CAAC;AAE1E;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAKhD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAE1C,OAAO;IAUP,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,uBAAuB;IAQ3B,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAQzE,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAQtE,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,uBAAuB;IAQ3B,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAQzE,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAQtE,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,uBAAuB;IAQ3B,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,uBAAuB;CAS5B"}
|
|
@@ -12,15 +12,21 @@
|
|
|
12
12
|
// surfaced; reject loud here so the editor's allowlist + server's
|
|
13
13
|
// allowlist stay in lockstep).
|
|
14
14
|
/**
|
|
15
|
-
* Always-allowed type names
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `
|
|
15
|
+
* Always-allowed type names — the structural nodes the shared editor
|
|
16
|
+
* emits regardless of a field's `.nodes()` allowlist, so the editor's
|
|
17
|
+
* schema and this validator stay in lockstep. ProseMirror requires
|
|
18
|
+
* `doc` / `text`; the editor mounts an implicit paragraph; `hardBreak`
|
|
19
|
+
* is the universal Shift+Enter line break; and `listItem` is pulled in
|
|
20
|
+
* structurally by any allowed list (authors declare the list node, not
|
|
21
|
+
* its item). All are content-free wrappers / inline breaks — none can
|
|
22
|
+
* smuggle a script or href — so admitting them implicitly is safe.
|
|
19
23
|
*/
|
|
20
24
|
const IMPLICIT_NODES = new Set([
|
|
21
25
|
"doc",
|
|
22
26
|
"paragraph",
|
|
23
27
|
"text",
|
|
28
|
+
"hardBreak",
|
|
29
|
+
"listItem",
|
|
24
30
|
]);
|
|
25
31
|
// `legacyAliases` lived on the v1 BlockSpec; the v2 surface dropped it
|
|
26
32
|
// since stored content now uses canonical names everywhere. Keeping the
|
|
@@ -34,7 +40,7 @@ function expandAliases(allowlist) {
|
|
|
34
40
|
* `vbscript:`, `file:` and their variants. Fragment / query-only /
|
|
35
41
|
* relative refs pass.
|
|
36
42
|
*/
|
|
37
|
-
const SAFE_HREF_RE = /^(https?:\/\/|mailto:|tel:|\/|#|\?|\.\.?\/)/i;
|
|
43
|
+
export const SAFE_HREF_RE = /^(https?:\/\/|mailto:|tel:|\/|#|\?|\.\.?\/)/i;
|
|
38
44
|
/**
|
|
39
45
|
* Maximum nesting depth the validator will recurse through. The
|
|
40
46
|
* meta-pipeline byte cap (256 KiB) doesn't bound depth alone — a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richtext-validate.js","sourceRoot":"","sources":["../../../src/plugin/fields/richtext-validate.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;AACjE,oEAAoE;AACpE,0BAA0B;AAC1B,EAAE;AACF,kEAAkE;AAClE,+DAA+D;AAC/D,iEAAiE;AACjE,mEAAmE;AACnE,+DAA+D;AAC/D,8DAA8D;AAC9D,kEAAkE;AAClE,+BAA+B;AAU/B
|
|
1
|
+
{"version":3,"file":"richtext-validate.js","sourceRoot":"","sources":["../../../src/plugin/fields/richtext-validate.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;AACjE,oEAAoE;AACpE,0BAA0B;AAC1B,EAAE;AACF,kEAAkE;AAClE,+DAA+D;AAC/D,iEAAiE;AACjE,mEAAmE;AACnE,+DAA+D;AAC/D,8DAA8D;AAC9D,kEAAkE;AAClE,+BAA+B;AAU/B;;;;;;;;;GASG;AACH,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,KAAK;IACL,WAAW;IACX,MAAM;IACN,WAAW;IACX,UAAU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,sDAAsD;IACtD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzE,MAAM,KAAK,GAAG,IAAI,CAAC,KAA0C,CAAC;QAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YACvD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;gBAChE,MAAM,uBAAuB,CAAC,UAAU,CAAC;oBACvC,IAAI;oBACJ,QAAQ,EAAE,OAAO,IAAI;iBACtB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +1,91 @@
|
|
|
1
1
|
import type { Label } from "../../i18n/label.js";
|
|
2
|
-
import type { MetaBoxFieldSpan, RichtextMetaBoxField } from "../manifest.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly
|
|
6
|
-
readonly label
|
|
7
|
-
readonly required?: boolean;
|
|
2
|
+
import type { FieldBuilder, MetaBoxFieldSpan, MetaBoxFieldValidate, RichtextMetaBoxField } from "../manifest.js";
|
|
3
|
+
import type { MetaFieldCondition, MetaFieldConditionRule } from "./condition.js";
|
|
4
|
+
interface RichtextFieldState {
|
|
5
|
+
readonly visibleWhen?: MetaFieldCondition;
|
|
6
|
+
readonly label?: Label;
|
|
8
7
|
readonly description?: Label;
|
|
9
8
|
readonly default?: unknown;
|
|
9
|
+
readonly required?: true;
|
|
10
10
|
readonly span?: MetaBoxFieldSpan;
|
|
11
11
|
readonly capability?: string;
|
|
12
|
+
readonly showInApi?: true;
|
|
12
13
|
readonly marks?: readonly string[];
|
|
13
14
|
readonly nodes?: readonly string[];
|
|
14
15
|
readonly blocks?: readonly string[];
|
|
16
|
+
readonly validate?: MetaBoxFieldValidate;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Fluent chain for the `richtext` field. Storage is Tiptap's
|
|
18
20
|
* ProseMirror JSON shape, round-tripped through the `json` storage
|
|
19
|
-
* primitive. The
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* primitive. The constraint walker rejects nodes/marks/blocks outside
|
|
22
|
+
* the allowlist (and unsafe link hrefs) server-side — there is
|
|
23
|
+
* deliberately no `.sanitize()` on this chain, so a custom callback
|
|
24
|
+
* can never bypass that enforcement.
|
|
23
25
|
*/
|
|
24
|
-
export declare
|
|
26
|
+
export declare class RichtextFieldBuilder<K extends string = string> implements FieldBuilder<RichtextMetaBoxField> {
|
|
27
|
+
#private;
|
|
28
|
+
/** Phantom literal key of the field — type-level only, never assigned. */
|
|
29
|
+
readonly _key: K;
|
|
30
|
+
/** Phantom read type of the field — type-level only, never assigned. */
|
|
31
|
+
readonly _value: unknown;
|
|
32
|
+
/** Phantom stored shape of the field — type-level only, never assigned. */
|
|
33
|
+
readonly _stored: unknown;
|
|
34
|
+
constructor(key: string, state?: RichtextFieldState);
|
|
35
|
+
/** Override the derived (humanized-key) label. */
|
|
36
|
+
label(label: Label): RichtextFieldBuilder<K>;
|
|
37
|
+
/** Help text rendered under the label. */
|
|
38
|
+
description(description: Label): RichtextFieldBuilder<K>;
|
|
39
|
+
/** Default for absent keys — a ProseMirror doc JSON value, applied
|
|
40
|
+
* at read decode (and seeded into the admin form). */
|
|
41
|
+
default(value: unknown): RichtextFieldBuilder<K>;
|
|
42
|
+
/** Mark the field required. */
|
|
43
|
+
required(): RichtextFieldBuilder<K>;
|
|
44
|
+
/**
|
|
45
|
+
* Column span within the box's 12-column grid — a universal layout
|
|
46
|
+
* hint; surfaces that can't honor it (the entry editor rail) ignore it.
|
|
47
|
+
*/
|
|
48
|
+
span(span: MetaBoxFieldSpan): RichtextFieldBuilder<K>;
|
|
49
|
+
/** Capability gate for this field — see `MetaBoxFieldBase.capability`. */
|
|
50
|
+
capability(capability: string): RichtextFieldBuilder<K>;
|
|
51
|
+
/** Opt this field's value into public REST responses (default-deny). */
|
|
52
|
+
showInApi(): RichtextFieldBuilder<K>;
|
|
53
|
+
/** Rule factory: this field's value equals `value` — pass the rule
|
|
54
|
+
* to a dependent field's `.visibleWhen()`. */
|
|
55
|
+
is(value: unknown): MetaFieldConditionRule;
|
|
56
|
+
/** Rule factory: this field's value differs from `value`. */
|
|
57
|
+
isNot(value: unknown): MetaFieldConditionRule;
|
|
58
|
+
/** Rule factory: this field has no value (unset or cleared). */
|
|
59
|
+
isEmpty(): MetaFieldConditionRule;
|
|
60
|
+
/** Rule factory: this field has a value. */
|
|
61
|
+
isNotEmpty(): MetaFieldConditionRule;
|
|
62
|
+
/**
|
|
63
|
+
* Show this field only when every rule passes (one AND group) —
|
|
64
|
+
* rules come from sibling fields' condition factories. Replaces any
|
|
65
|
+
* previously declared condition; `.orVisibleWhen()` adds
|
|
66
|
+
* alternatives.
|
|
67
|
+
*/
|
|
68
|
+
visibleWhen(...rules: MetaFieldConditionRule[]): RichtextFieldBuilder<K>;
|
|
69
|
+
/** Add an OR alternative — one more AND group of rules. */
|
|
70
|
+
orVisibleWhen(...rules: MetaFieldConditionRule[]): RichtextFieldBuilder<K>;
|
|
71
|
+
/** Mark allowlist (`bold`, `italic`, `link`, …). Omitted = deny all. */
|
|
72
|
+
marks(marks: readonly string[]): RichtextFieldBuilder<K>;
|
|
73
|
+
/** Node allowlist (`heading`, `bulletList`, …). Omitted = deny all but doc/paragraph/text. */
|
|
74
|
+
nodes(nodes: readonly string[]): RichtextFieldBuilder<K>;
|
|
75
|
+
/** Embedded-block allowlist. Omitted = deny all. */
|
|
76
|
+
blocks(blocks: readonly string[]): RichtextFieldBuilder<K>;
|
|
77
|
+
/**
|
|
78
|
+
* Custom validation — `true` for valid, or an i18n-able failure
|
|
79
|
+
* message (sync or async). Runs after the injected allowlist walker.
|
|
80
|
+
*/
|
|
81
|
+
validate(validate: (value: unknown) => true | Label | Promise<true | Label>): RichtextFieldBuilder<K>;
|
|
82
|
+
/** Compile the chain into the wire/manifest field definition. */
|
|
83
|
+
build(): RichtextMetaBoxField;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Rich text stored as ProseMirror JSON, constrained by the
|
|
87
|
+
* `.marks()` / `.nodes()` / `.blocks()` allowlists.
|
|
88
|
+
*/
|
|
89
|
+
export declare function richtext<K extends string>(key: K): RichtextFieldBuilder<K>;
|
|
90
|
+
export {};
|
|
25
91
|
//# sourceMappingURL=richtext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richtext.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/richtext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"richtext.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/richtext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAGxB,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,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