emdash 1.3.1 → 1.5.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/action-token-CKphU6ur.mjs +26 -0
- package/dist/action-token-CKphU6ur.mjs.map +1 -0
- package/dist/activation-X5iMalte.mjs +387 -0
- package/dist/activation-X5iMalte.mjs.map +1 -0
- package/dist/adapters-DFsc9XjW.d.mts +173 -0
- package/dist/adapters-DFsc9XjW.d.mts.map +1 -0
- package/dist/after-B3AvMfBQ.mjs +50 -0
- package/dist/after-B3AvMfBQ.mjs.map +1 -0
- package/dist/allowed-origins-BFDNF-05.mjs +116 -0
- package/dist/allowed-origins-BFDNF-05.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +7 -65
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +7 -12
- package/dist/api-tokens-B-p5eI6J.mjs +9 -0
- package/dist/api-tokens-B-p5eI6J.mjs.map +1 -0
- package/dist/api-tokens-D27OQ0oQ.mjs +173 -0
- package/dist/api-tokens-D27OQ0oQ.mjs.map +1 -0
- package/dist/apply-Culv7QJl.mjs +1774 -0
- package/dist/apply-Culv7QJl.mjs.map +1 -0
- package/dist/approvals-oLE5G5jw.mjs +460 -0
- package/dist/approvals-oLE5G5jw.mjs.map +1 -0
- package/dist/artifact-fetch-ByK_1pck.mjs +659 -0
- package/dist/artifact-fetch-ByK_1pck.mjs.map +1 -0
- package/dist/artifacts-BXKMIV2F.mjs +323 -0
- package/dist/artifacts-BXKMIV2F.mjs.map +1 -0
- package/dist/astro/index.d.mts +17 -14
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +257 -24
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +15 -12
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +62 -25
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +5 -7
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -1
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +18 -26
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +128 -80
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +15 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +62 -158
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +1 -5
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
- package/dist/astro/routes/PluginRegistry.mjs +11 -10
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +3 -18
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +3 -18
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -8
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -9
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -8
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +8 -33
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +8 -33
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +8 -32
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +9 -25
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +16 -25
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +3 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +5 -23
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/core-update.mjs +160 -10
- package/dist/astro/routes/api/admin/core-update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -8
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +6 -25
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +4 -29
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +5 -36
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -7
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -7
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +4 -10
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +4 -10
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +3 -87
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -8
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +4 -86
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +5 -86
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +9 -97
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +3 -87
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -8
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +3 -86
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +9 -97
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +3 -86
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +7 -86
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +14 -98
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +6 -10
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +11 -89
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +4 -8
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +8 -87
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +7 -86
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +4 -8
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +3 -86
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -8
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +3 -86
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +1 -5
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +6 -50
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +6 -50
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +8 -52
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +8 -51
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +9 -54
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +9 -53
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +10 -54
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +8 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +9 -54
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +11 -54
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -6
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -5
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +4 -19
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +11 -10
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +3 -18
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +10 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/handover.mjs +3 -9
- package/dist/astro/routes/api/auth/handover.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +11 -26
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +13 -23
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -23
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +2 -6
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.mjs +15 -26
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +5 -20
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/me.d.mts +3 -1
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +30 -30
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +2 -6
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +6 -14
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +3 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +3 -18
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -26
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -23
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -24
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -26
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +11 -26
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -24
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -5
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -1
- package/dist/astro/routes/api/calendar.mjs +5 -19
- package/dist/astro/routes/api/calendar.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +5 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +8 -26
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +14 -24
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -6
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +9 -24
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -7
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +2 -13
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -43
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -23
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +5 -45
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +5 -45
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -7
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs +16 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +2 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +28 -7
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.mjs +29 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -24
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +32 -38
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +7 -23
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +28 -52
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +5 -19
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +4 -19
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +141 -21
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +2 -6
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -1
- package/dist/astro/routes/api/dev/scheduled-tasks.mjs +4 -125
- package/dist/astro/routes/api/dev/scheduled-tasks.mjs.map +1 -1
- package/dist/astro/routes/api/health.mjs +3 -7
- package/dist/astro/routes/api/health.mjs.map +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +4 -3
- package/dist/astro/routes/api/import/probe.d.mts.map +1 -1
- package/dist/astro/routes/api/import/probe.mjs +6 -37
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts +6 -3
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +10 -32
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +32 -14
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +147 -47
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -27
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +10 -26
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -39
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -37
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +189 -61
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.d.mts.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +32 -13
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +130 -126
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +50 -30
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +5 -20
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -10
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.mjs +6 -38
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +5 -36
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +4 -7
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +52 -13
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +5 -20
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +5 -20
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -6
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -6
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/index.mjs +2 -6
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +8 -23
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +20 -43
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -25
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +8 -25
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +5 -6
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -9
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/code.mjs +6 -13
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/token.mjs +5 -12
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/register.mjs +4 -9
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -9
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -9
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/token.mjs +5 -10
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
- package/dist/astro/routes/api/openapi.json.mjs +15 -31
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +2 -13
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +5 -28
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +5 -28
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +6 -29
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +6 -29
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +5 -45
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +5 -45
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -6
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +7 -23
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/index.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +4 -22
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +5 -87
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +3 -86
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +5 -26
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +4 -25
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +5 -26
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +3 -14
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +4 -25
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +5 -25
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +5 -25
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +4 -10
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +3 -10
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +4 -10
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +5 -11
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/domain-notify.d.mts.map +1 -1
- package/dist/astro/routes/api/settings/domain-notify.mjs +14 -14
- package/dist/astro/routes/api/settings/domain-notify.mjs.map +1 -1
- package/dist/astro/routes/api/settings/domain.mjs +8 -27
- package/dist/astro/routes/api/settings/domain.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.d.mts +2 -1
- package/dist/astro/routes/api/settings/email.d.mts.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +124 -16
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.mjs +7 -35
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -29
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +10 -24
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +13 -58
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -6
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +14 -65
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -7
- package/dist/astro/routes/api/setup/status.mjs.map +1 -1
- package/dist/astro/routes/api/site/domain-proof.mjs +2 -21
- package/dist/astro/routes/api/site/domain-proof.mjs.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +6 -13
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +5 -32
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +13 -46
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +4 -10
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +3 -7
- package/dist/astro/routes/api/typegen.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/action-token.mjs +3 -10
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +3 -26
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +1 -5
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/auth.mjs +4 -3
- package/dist/astro/routes/api/well-known/auth.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +11 -22
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -15
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -27
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +2 -6
- package/dist/astro/routes/api/widget-components.mjs.map +1 -1
- package/dist/astro/routes/robots.txt.d.mts.map +1 -1
- package/dist/astro/routes/robots.txt.mjs +6 -24
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +11 -25
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +5 -23
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +49 -23
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-T3NRtoQ5.mjs +127 -0
- package/dist/audit-T3NRtoQ5.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/auth/providers/microsoft.d.mts +1 -1
- package/dist/authoritative-records-Cd5BVXRs.mjs +5183 -0
- package/dist/authoritative-records-Cd5BVXRs.mjs.map +1 -0
- package/dist/authorize-B-4ogCQG.mjs +74 -0
- package/dist/authorize-B-4ogCQG.mjs.map +1 -0
- package/dist/backup-BQhg3MEK.mjs +246 -0
- package/dist/backup-BQhg3MEK.mjs.map +1 -0
- package/dist/base64-GXviT28w.mjs +63 -0
- package/dist/base64-GXviT28w.mjs.map +1 -0
- package/dist/block-types-BTzqdEZV.mjs +132 -0
- package/dist/block-types-BTzqdEZV.mjs.map +1 -0
- package/dist/block-values-DzZIh7WN.mjs +215 -0
- package/dist/block-values-DzZIh7WN.mjs.map +1 -0
- package/dist/byline--sweE_MZ.mjs +930 -0
- package/dist/byline--sweE_MZ.mjs.map +1 -0
- package/dist/byline-fields-Czdq4Yad.mjs +123 -0
- package/dist/byline-fields-Czdq4Yad.mjs.map +1 -0
- package/dist/byline-registry-Cr7kjrxM.mjs +406 -0
- package/dist/byline-registry-Cr7kjrxM.mjs.map +1 -0
- package/dist/bylines-DnuH3H8z.mjs +234 -0
- package/dist/bylines-DnuH3H8z.mjs.map +1 -0
- package/dist/bylines-txlwgzIK.mjs +150 -0
- package/dist/bylines-txlwgzIK.mjs.map +1 -0
- package/dist/cache-BjnpmIpb.mjs +151 -0
- package/dist/cache-BjnpmIpb.mjs.map +1 -0
- package/dist/canonical-Cb-rJGRU.mjs +174 -0
- package/dist/canonical-Cb-rJGRU.mjs.map +1 -0
- package/dist/capture-triggers-BZmIEdX2.mjs +362 -0
- package/dist/capture-triggers-BZmIEdX2.mjs.map +1 -0
- package/dist/challenge-store-B0PoBBqW.mjs +51 -0
- package/dist/challenge-store-B0PoBBqW.mjs.map +1 -0
- package/dist/checksum-CH9TyM-N.mjs +162 -0
- package/dist/checksum-CH9TyM-N.mjs.map +1 -0
- package/dist/chrome-tags-BocDVqqx.mjs +24 -0
- package/dist/chrome-tags-BocDVqqx.mjs.map +1 -0
- package/dist/chunks-DRnEstVb.mjs +25 -0
- package/dist/chunks-DRnEstVb.mjs.map +1 -0
- package/dist/cli/index.mjs +892 -94
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +97 -97
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +15 -6
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-slugs-cache-CYMrqHZ6.mjs +91 -0
- package/dist/collection-slugs-cache-CYMrqHZ6.mjs.map +1 -0
- package/dist/comment-BGeXmJ8F.mjs +335 -0
- package/dist/comment-BGeXmJ8F.mjs.map +1 -0
- package/dist/comment-reaction-ty-JEDYR.mjs +85 -0
- package/dist/comment-reaction-ty-JEDYR.mjs.map +1 -0
- package/dist/comments-ByrrLvZL.mjs +99 -0
- package/dist/comments-ByrrLvZL.mjs.map +1 -0
- package/dist/comments-DqhARoef.mjs +195 -0
- package/dist/comments-DqhARoef.mjs.map +1 -0
- package/dist/components-u2HE5Mu9.mjs +112 -0
- package/dist/components-u2HE5Mu9.mjs.map +1 -0
- package/dist/config-B4F2ttAZ.d.mts +7230 -0
- package/dist/config-B4F2ttAZ.d.mts.map +1 -0
- package/dist/config-BnrtMvHW.mjs +228 -0
- package/dist/config-BnrtMvHW.mjs.map +1 -0
- package/dist/config-DEse9gaE.d.mts +41 -0
- package/dist/config-DEse9gaE.d.mts.map +1 -0
- package/dist/connection-BaIVuaDX.mjs +36 -0
- package/dist/connection-BaIVuaDX.mjs.map +1 -0
- package/dist/content-Dxztag5t.mjs +2270 -0
- package/dist/content-Dxztag5t.mjs.map +1 -0
- package/dist/content-list-query-yYbBU-dB.d.mts +26 -0
- package/dist/content-list-query-yYbBU-dB.d.mts.map +1 -0
- package/dist/content-policy-Drm9sqdA.mjs +68 -0
- package/dist/content-policy-Drm9sqdA.mjs.map +1 -0
- package/dist/content-repair-2PdahlgZ.mjs +443 -0
- package/dist/content-repair-2PdahlgZ.mjs.map +1 -0
- package/dist/content-save-KMll0S7E.mjs +202 -0
- package/dist/content-save-KMll0S7E.mjs.map +1 -0
- package/dist/context-C3OZjexd.mjs +2225 -0
- package/dist/context-C3OZjexd.mjs.map +1 -0
- package/dist/credits-C8uXoWfN.mjs +110 -0
- package/dist/credits-C8uXoWfN.mjs.map +1 -0
- package/dist/cron-CrjBjDuy.mjs +310 -0
- package/dist/cron-CrjBjDuy.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -4
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +2 -7
- package/dist/db/libsql-migrations.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +2 -7
- package/dist/db/postgres-migrations.mjs.map +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +2 -7
- package/dist/db/sqlite-migrations.mjs.map +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/default-DPoN3H5H.mjs +81 -0
- package/dist/default-DPoN3H5H.mjs.map +1 -0
- package/dist/deferred-tasks-uSx5qCFn.d.mts +10 -0
- package/dist/deferred-tasks-uSx5qCFn.d.mts.map +1 -0
- package/dist/deferred-tasks-yv85msJv.mjs +52 -0
- package/dist/deferred-tasks-yv85msJv.mjs.map +1 -0
- package/dist/destination-BNL1K7Mz.mjs +18 -0
- package/dist/destination-BNL1K7Mz.mjs.map +1 -0
- package/dist/dev-typegen-BVQAguf4.mjs +29 -0
- package/dist/dev-typegen-BVQAguf4.mjs.map +1 -0
- package/dist/device-flow-hT8lKWXq.mjs +519 -0
- package/dist/device-flow-hT8lKWXq.mjs.map +1 -0
- package/dist/dialect-helpers-DqUMP9fJ.mjs +350 -0
- package/dist/dialect-helpers-DqUMP9fJ.mjs.map +1 -0
- package/dist/digest-xYRiuW_E.mjs +194 -0
- package/dist/digest-xYRiuW_E.mjs.map +1 -0
- package/dist/direct-executor-CZ2SH1bq.mjs +117 -0
- package/dist/direct-executor-CZ2SH1bq.mjs.map +1 -0
- package/dist/dist-kxThYgdL.mjs +810 -0
- package/dist/dist-kxThYgdL.mjs.map +1 -0
- package/dist/email-console-CochjAlh.mjs +50 -0
- package/dist/email-console-CochjAlh.mjs.map +1 -0
- package/dist/email-locale-BoxaIPG8.mjs +25 -0
- package/dist/email-locale-BoxaIPG8.mjs.map +1 -0
- package/dist/email-smtp-BnHR_Ccx.mjs +643 -0
- package/dist/email-smtp-BnHR_Ccx.mjs.map +1 -0
- package/dist/emdash-runtime-CXsdCQnM.mjs +5262 -0
- package/dist/emdash-runtime-CXsdCQnM.mjs.map +1 -0
- package/dist/enrich-BReo_COC.mjs +203 -0
- package/dist/enrich-BReo_COC.mjs.map +1 -0
- package/dist/entry-lock-BfnhlRhC.mjs +207 -0
- package/dist/entry-lock-BfnhlRhC.mjs.map +1 -0
- package/dist/entry-lock-DsVhZcJN.mjs +1228 -0
- package/dist/entry-lock-DsVhZcJN.mjs.map +1 -0
- package/dist/entry-locks-D_kjygT1.mjs +173 -0
- package/dist/entry-locks-D_kjygT1.mjs.map +1 -0
- package/dist/env-types-CXI9uaMU.mjs +38 -0
- package/dist/env-types-CXI9uaMU.mjs.map +1 -0
- package/dist/error-DcDNU7hZ.mjs +92 -0
- package/dist/error-DcDNU7hZ.mjs.map +1 -0
- package/dist/errors-BYdjOimY.mjs +18 -0
- package/dist/errors-BYdjOimY.mjs.map +1 -0
- package/dist/errors-CJ6711al.mjs +120 -0
- package/dist/errors-CJ6711al.mjs.map +1 -0
- package/dist/errors-CwYHYcWF.mjs +502 -0
- package/dist/errors-CwYHYcWF.mjs.map +1 -0
- package/dist/escape-YSAGQRHa.mjs +9 -0
- package/dist/escape-YSAGQRHa.mjs.map +1 -0
- package/dist/fence-C3MLClBo.mjs +162 -0
- package/dist/fence-C3MLClBo.mjs.map +1 -0
- package/dist/field-defs-cache-Cpk0eFsQ.mjs +79 -0
- package/dist/field-defs-cache-Cpk0eFsQ.mjs.map +1 -0
- package/dist/field-map-6o9hPcRl.mjs +84 -0
- package/dist/field-map-6o9hPcRl.mjs.map +1 -0
- package/dist/focal-point-Cup37tLI.mjs +23 -0
- package/dist/focal-point-Cup37tLI.mjs.map +1 -0
- package/dist/fts-manager-B3iLXCGz.mjs +500 -0
- package/dist/fts-manager-B3iLXCGz.mjs.map +1 -0
- package/dist/gc-D24C-KP7.mjs +62 -0
- package/dist/gc-D24C-KP7.mjs.map +1 -0
- package/dist/hash-SY9Nq5FH.mjs +37 -0
- package/dist/hash-SY9Nq5FH.mjs.map +1 -0
- package/dist/hook-result-BU5rI-6M.d.mts +31 -0
- package/dist/hook-result-BU5rI-6M.d.mts.map +1 -0
- package/dist/hook-result-CO4E3zDv.mjs +3854 -0
- package/dist/hook-result-CO4E3zDv.mjs.map +1 -0
- package/dist/hreflang-Bzvlo9Ci.mjs +105 -0
- package/dist/hreflang-Bzvlo9Ci.mjs.map +1 -0
- package/dist/hreflang-Ds0WbBOu.d.mts +51 -0
- package/dist/hreflang-Ds0WbBOu.d.mts.map +1 -0
- package/dist/http-route-dispatch-BsjkWBZF.mjs +348 -0
- package/dist/http-route-dispatch-BsjkWBZF.mjs.map +1 -0
- package/dist/identity-CahxkBZC.mjs +35 -0
- package/dist/identity-CahxkBZC.mjs.map +1 -0
- package/dist/index-BauU0yTw.d.mts +261 -0
- package/dist/index-BauU0yTw.d.mts.map +1 -0
- package/dist/index.d.mts +26 -24
- package/dist/index.mjs +2111 -121
- package/dist/index.mjs.map +1 -0
- package/dist/init-lock-Dn7efXfy.mjs +56 -0
- package/dist/init-lock-Dn7efXfy.mjs.map +1 -0
- package/dist/install-finalization-CIl610wT.mjs +58 -0
- package/dist/install-finalization-CIl610wT.mjs.map +1 -0
- package/dist/json-recordset-CrS6ZqMk.mjs +12 -0
- package/dist/json-recordset-CrS6ZqMk.mjs.map +1 -0
- package/dist/json-schema-CBcJlGcY.mjs +15 -0
- package/dist/json-schema-CBcJlGcY.mjs.map +1 -0
- package/dist/keys-DJ62Wt5b.mjs +61 -0
- package/dist/keys-DJ62Wt5b.mjs.map +1 -0
- package/dist/kinds-D7_f3Qu3.mjs +974 -0
- package/dist/kinds-D7_f3Qu3.mjs.map +1 -0
- package/dist/lifecycle-DPCkpFHV.mjs +49 -0
- package/dist/lifecycle-DPCkpFHV.mjs.map +1 -0
- package/dist/limits-Bv6mXNM-.mjs +44 -0
- package/dist/limits-Bv6mXNM-.mjs.map +1 -0
- package/dist/load-r9P0fsRH.mjs +36 -0
- package/dist/load-r9P0fsRH.mjs.map +1 -0
- package/dist/loader-CSEfTKzr.mjs +1537 -0
- package/dist/loader-CSEfTKzr.mjs.map +1 -0
- package/dist/loops-BxzrcxPO.mjs +217 -0
- package/dist/loops-BxzrcxPO.mjs.map +1 -0
- package/dist/manifest-builder-BLWqITXR.mjs +196 -0
- package/dist/manifest-builder-BLWqITXR.mjs.map +1 -0
- package/dist/manifest-schema-BRpk5V7x.mjs +497 -0
- package/dist/manifest-schema-BRpk5V7x.mjs.map +1 -0
- package/dist/marketplace-5YFgYPVr.mjs +257 -0
- package/dist/marketplace-5YFgYPVr.mjs.map +1 -0
- package/dist/marketplace-zPVE4UY5.mjs +965 -0
- package/dist/marketplace-zPVE4UY5.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +2 -1
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +10 -5
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +4 -4
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +17 -14
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +3 -20
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-C5fg1Xte.d.mts +203 -0
- package/dist/media-C5fg1Xte.d.mts.map +1 -0
- package/dist/media-CPETKjop.mjs +424 -0
- package/dist/media-CPETKjop.mjs.map +1 -0
- package/dist/media-Cid3xIHk.mjs +294 -0
- package/dist/media-Cid3xIHk.mjs.map +1 -0
- package/dist/media-DJaAAYI2.mjs +2805 -0
- package/dist/media-DJaAAYI2.mjs.map +1 -0
- package/dist/media-allowlist-B7JwNf-U.mjs +75 -0
- package/dist/media-allowlist-B7JwNf-U.mjs.map +1 -0
- package/dist/media-folders-BI7B7XUM.mjs +210 -0
- package/dist/media-folders-BI7B7XUM.mjs.map +1 -0
- package/dist/media-url-xWuPVfqO.mjs +43 -0
- package/dist/media-url-xWuPVfqO.mjs.map +1 -0
- package/dist/media-usage-SwtWPxy4.mjs +282 -0
- package/dist/media-usage-SwtWPxy4.mjs.map +1 -0
- package/dist/media-usage-activation-BTa1H4wE.mjs +78 -0
- package/dist/media-usage-activation-BTa1H4wE.mjs.map +1 -0
- package/dist/media-usage-work-BxHWfbKq.mjs +1036 -0
- package/dist/media-usage-work-BxHWfbKq.mjs.map +1 -0
- package/dist/media-usage-work-DYenZS8y.mjs +151 -0
- package/dist/media-usage-work-DYenZS8y.mjs.map +1 -0
- package/dist/menu-FtSf33fF.mjs +420 -0
- package/dist/menu-FtSf33fF.mjs.map +1 -0
- package/dist/menus--MSfZ5Eu.mjs +433 -0
- package/dist/menus--MSfZ5Eu.mjs.map +1 -0
- package/dist/menus-C8h6Jtpu.mjs +92 -0
- package/dist/menus-C8h6Jtpu.mjs.map +1 -0
- package/dist/menus-CpFAi_LK.mjs +434 -0
- package/dist/menus-CpFAi_LK.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +2 -6
- package/dist/mime-Dx6aHTsR.mjs +82 -0
- package/dist/mime-Dx6aHTsR.mjs.map +1 -0
- package/dist/mode-D6Qg_-2J.mjs +23 -0
- package/dist/mode-D6Qg_-2J.mjs.map +1 -0
- package/dist/node-sqlite-compat-DvYkqx7Q.mjs +63 -0
- package/dist/node-sqlite-compat-DvYkqx7Q.mjs.map +1 -0
- package/dist/normalize-qcU0SKGf.mjs +220 -0
- package/dist/normalize-qcU0SKGf.mjs.map +1 -0
- package/dist/oauth-authorization-CBxtOboy.mjs +287 -0
- package/dist/oauth-authorization-CBxtOboy.mjs.map +1 -0
- package/dist/oauth-clients-HLGHmHqI.mjs +266 -0
- package/dist/oauth-clients-HLGHmHqI.mjs.map +1 -0
- package/dist/oauth-state-store-B4YAveSb.mjs +80 -0
- package/dist/oauth-state-store-B4YAveSb.mjs.map +1 -0
- package/dist/oauth-user-lookup-CTYMaKlq.mjs +26 -0
- package/dist/oauth-user-lookup-CTYMaKlq.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-DeATK4vw.mjs +805 -0
- package/dist/object-cache-DeATK4vw.mjs.map +1 -0
- package/dist/options-BJZMHnpx.d.mts +81 -0
- package/dist/options-BJZMHnpx.d.mts.map +1 -0
- package/dist/options-CMocxAku.mjs +208 -0
- package/dist/options-CMocxAku.mjs.map +1 -0
- package/dist/ownership-46c5NS0I.mjs +12 -0
- package/dist/ownership-46c5NS0I.mjs.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +23 -27
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-B1E5cdyD.mjs +82 -0
- package/dist/parse-B1E5cdyD.mjs.map +1 -0
- package/dist/parse-Clt6wmpy.d.mts +178 -0
- package/dist/parse-Clt6wmpy.d.mts.map +1 -0
- package/dist/parts-CMwESQ6e.mjs +68 -0
- package/dist/parts-CMwESQ6e.mjs.map +1 -0
- package/dist/passkey-config-DiVZI-cx.mjs +46 -0
- package/dist/passkey-config-DiVZI-cx.mjs.map +1 -0
- package/dist/paths-NrYImb_h.mjs +77 -0
- package/dist/paths-NrYImb_h.mjs.map +1 -0
- package/dist/patterns-BxMSQThP.mjs +174 -0
- package/dist/patterns-BxMSQThP.mjs.map +1 -0
- package/dist/placeholder-B0vI-EQ9.d.mts +316 -0
- package/dist/placeholder-B0vI-EQ9.d.mts.map +1 -0
- package/dist/plan-CSb3BdFS.mjs +135 -0
- package/dist/plan-CSb3BdFS.mjs.map +1 -0
- package/dist/plugin-settings-HdYYRFi3.mjs +162 -0
- package/dist/plugin-settings-HdYYRFi3.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +24 -15
- package/dist/plugin-test-runtime.d.mts.map +1 -1
- package/dist/plugin-test-runtime.mjs +11 -127
- package/dist/plugin-tool-name-CCXxYq3K.mjs +27 -0
- package/dist/plugin-tool-name-CCXxYq3K.mjs.map +1 -0
- package/dist/plugin-types.d.mts +2 -2
- package/dist/plugin-utils.d.mts +15 -12
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +15 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +6 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +13 -6
- package/dist/plugins/host.d.mts.map +1 -0
- package/dist/plugins/host.mjs +10 -63
- package/dist/plugins-Bc70Xs37.mjs +261 -0
- package/dist/plugins-Bc70Xs37.mjs.map +1 -0
- package/dist/policy-C-ngDrxa.mjs +56 -0
- package/dist/policy-C-ngDrxa.mjs.map +1 -0
- package/dist/portable-text-T17rOqF7.mjs +454 -0
- package/dist/portable-text-T17rOqF7.mjs.map +1 -0
- package/dist/protocol-CmSX4cXv.d.mts +65 -0
- package/dist/protocol-CmSX4cXv.d.mts.map +1 -0
- package/dist/public-plugin-api-routes-_xsWTlwE.mjs +316 -0
- package/dist/public-plugin-api-routes-_xsWTlwE.mjs.map +1 -0
- package/dist/public-submission-ui3pFYtq.mjs +253 -0
- package/dist/public-submission-ui3pFYtq.mjs.map +1 -0
- package/dist/public-url-DMRZPAiW.mjs +123 -0
- package/dist/public-url-DMRZPAiW.mjs.map +1 -0
- package/dist/query-C1K9PzUc.mjs +41 -0
- package/dist/query-C1K9PzUc.mjs.map +1 -0
- package/dist/query-DdmHrvie.mjs +1201 -0
- package/dist/query-DdmHrvie.mjs.map +1 -0
- package/dist/query-EVjg8-Bq.mjs +37 -0
- package/dist/query-EVjg8-Bq.mjs.map +1 -0
- package/dist/range-BaF0521t.mjs +51 -0
- package/dist/range-BaF0521t.mjs.map +1 -0
- package/dist/rate-limit-6MngP0_m.mjs +127 -0
- package/dist/rate-limit-6MngP0_m.mjs.map +1 -0
- package/dist/receipt-BFm5eaN7.mjs +43 -0
- package/dist/receipt-BFm5eaN7.mjs.map +1 -0
- package/dist/redirect-ChcHI1KC.mjs +466 -0
- package/dist/redirect-ChcHI1KC.mjs.map +1 -0
- package/dist/redirect-EpidEf_5.mjs +19 -0
- package/dist/redirect-EpidEf_5.mjs.map +1 -0
- package/dist/redirect-paths-B9cXh9Wv.mjs +36 -0
- package/dist/redirect-paths-B9cXh9Wv.mjs.map +1 -0
- package/dist/redirects-D3zHoxhn.mjs +446 -0
- package/dist/redirects-D3zHoxhn.mjs.map +1 -0
- package/dist/redirects-dFPJ0HrD.mjs +148 -0
- package/dist/redirects-dFPJ0HrD.mjs.map +1 -0
- package/dist/registry/testing.mjs +2 -3
- package/dist/registry/testing.mjs.map +1 -1
- package/dist/registry-CDzYrAFY.mjs +6074 -0
- package/dist/registry-CDzYrAFY.mjs.map +1 -0
- package/dist/registry-Cf9vkVxW.mjs +1449 -0
- package/dist/registry-Cf9vkVxW.mjs.map +1 -0
- package/dist/registry-mZi_lxtT.mjs +755 -0
- package/dist/registry-mZi_lxtT.mjs.map +1 -0
- package/dist/relations-Eyop_U4o.mjs +798 -0
- package/dist/relations-Eyop_U4o.mjs.map +1 -0
- package/dist/request-cache-BYMs-BGX.mjs +104 -0
- package/dist/request-cache-BYMs-BGX.mjs.map +1 -0
- package/dist/request-context.d.mts +16 -3
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +22 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/request-meta-DsSkOdO0.mjs +141 -0
- package/dist/request-meta-DsSkOdO0.mjs.map +1 -0
- package/dist/resolve-Z5YK_6ew.mjs +199 -0
- package/dist/resolve-Z5YK_6ew.mjs.map +1 -0
- package/dist/resolve-s7ANHtFx.mjs +92 -0
- package/dist/resolve-s7ANHtFx.mjs.map +1 -0
- package/dist/rev-B6HS7337.mjs +50 -0
- package/dist/rev-B6HS7337.mjs.map +1 -0
- package/dist/revision-D7EedSdU.mjs +503 -0
- package/dist/revision-D7EedSdU.mjs.map +1 -0
- package/dist/rooms/index.d.mts +48 -0
- package/dist/rooms/index.d.mts.map +1 -0
- package/dist/rooms/index.mjs +6 -0
- package/dist/rooms/node/index.d.mts +25 -0
- package/dist/rooms/node/index.d.mts.map +1 -0
- package/dist/rooms/node/index.mjs +583 -0
- package/dist/rooms/node/index.mjs.map +1 -0
- package/dist/rooms/notifications.d.mts +47 -0
- package/dist/rooms/notifications.d.mts.map +1 -0
- package/dist/rooms/notifications.mjs +125 -0
- package/dist/rooms/notifications.mjs.map +1 -0
- package/dist/rooms/room.d.mts +76 -0
- package/dist/rooms/room.d.mts.map +1 -0
- package/dist/rooms/room.mjs +1257 -0
- package/dist/rooms/room.mjs.map +1 -0
- package/dist/rooms/site.d.mts +23 -0
- package/dist/rooms/site.d.mts.map +1 -0
- package/dist/rooms/site.mjs +146 -0
- package/dist/rooms/site.mjs.map +1 -0
- package/dist/rooms-CSNLTJsG.mjs +331 -0
- package/dist/rooms-CSNLTJsG.mjs.map +1 -0
- package/dist/rooms-CVsLla78.mjs +169 -0
- package/dist/rooms-CVsLla78.mjs.map +1 -0
- package/dist/rooms-CyXG83RZ.d.mts +4653 -0
- package/dist/rooms-CyXG83RZ.d.mts.map +1 -0
- package/dist/route-cache-CBpXPq-N.mjs +30 -0
- package/dist/route-cache-CBpXPq-N.mjs.map +1 -0
- package/dist/route-cache-DkhMwAIC.mjs +20 -0
- package/dist/route-cache-DkhMwAIC.mjs.map +1 -0
- package/dist/route-wire-DKSTaEz_.mjs +197 -0
- package/dist/route-wire-DKSTaEz_.mjs.map +1 -0
- package/dist/routes-QcHRiebw.mjs +272 -0
- package/dist/routes-QcHRiebw.mjs.map +1 -0
- package/dist/runner-4BfB04Rg.mjs +6950 -0
- package/dist/runner-4BfB04Rg.mjs.map +1 -0
- package/dist/runner-CAHS_KER.d.mts +79 -0
- package/dist/runner-CAHS_KER.d.mts.map +1 -0
- package/dist/runtime-holder-0g6pqbzx.mjs +36 -0
- package/dist/runtime-holder-0g6pqbzx.mjs.map +1 -0
- package/dist/runtime.d.mts +16 -13
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +1 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scheduler-health-C5HEg2Yl.mjs +31 -0
- package/dist/scheduler-health-C5HEg2Yl.mjs.map +1 -0
- package/dist/schema/project-env-types.mjs +7 -55
- package/dist/schema/project-env-types.mjs.map +1 -1
- package/dist/schema-DS7ooMmp.mjs +13 -0
- package/dist/schema-DS7ooMmp.mjs.map +1 -0
- package/dist/schema-Mjtj7n1t.mjs +815 -0
- package/dist/schema-Mjtj7n1t.mjs.map +1 -0
- package/dist/scopes-BaR6WUyq.mjs +34 -0
- package/dist/scopes-BaR6WUyq.mjs.map +1 -0
- package/dist/search-B9RFgr0N.mjs +450 -0
- package/dist/search-B9RFgr0N.mjs.map +1 -0
- package/dist/secrets-C4UrjPiG.mjs +369 -0
- package/dist/secrets-C4UrjPiG.mjs.map +1 -0
- package/dist/sections-Bfa0oF8Q.mjs +129 -0
- package/dist/sections-Bfa0oF8Q.mjs.map +1 -0
- package/dist/sections-Bn2C6we7.mjs +222 -0
- package/dist/sections-Bn2C6we7.mjs.map +1 -0
- package/dist/seed/index.d.mts +3 -3
- package/dist/seed/index.mjs +6 -54
- package/dist/seo/index.d.mts +8 -6
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +10 -41
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-DPW6k5_-.mjs +188 -0
- package/dist/seo-DPW6k5_-.mjs.map +1 -0
- package/dist/service-B4mHMku9.mjs +150 -0
- package/dist/service-B4mHMku9.mjs.map +1 -0
- package/dist/session-user-CF2jNfj7.mjs +61 -0
- package/dist/session-user-CF2jNfj7.mjs.map +1 -0
- package/dist/settings-4r88LLIM.mjs +66 -0
- package/dist/settings-4r88LLIM.mjs.map +1 -0
- package/dist/settings-BB2xxz3Y.mjs +74 -0
- package/dist/settings-BB2xxz3Y.mjs.map +1 -0
- package/dist/settings-BTkGl-bX.mjs +413 -0
- package/dist/settings-BTkGl-bX.mjs.map +1 -0
- package/dist/settings-y8Jx8b7g.mjs +157 -0
- package/dist/settings-y8Jx8b7g.mjs.map +1 -0
- package/dist/setup-complete-BGRiC59t.mjs +65 -0
- package/dist/setup-complete-BGRiC59t.mjs.map +1 -0
- package/dist/setup-nonce-D43FsOgZ.mjs +25 -0
- package/dist/setup-nonce-D43FsOgZ.mjs.map +1 -0
- package/dist/single-flight-cache-BCP1Tvcm.mjs +104 -0
- package/dist/single-flight-cache-BCP1Tvcm.mjs.map +1 -0
- package/dist/site-domain-CFX7g6ik.mjs +131 -0
- package/dist/site-domain-CFX7g6ik.mjs.map +1 -0
- package/dist/site-settings-C0D9fv7e.mjs +50 -0
- package/dist/site-settings-C0D9fv7e.mjs.map +1 -0
- package/dist/site-title-C0JVN6en.mjs +14 -0
- package/dist/site-title-C0JVN6en.mjs.map +1 -0
- package/dist/site-url-DzVnHJ8j.mjs +45 -0
- package/dist/site-url-DzVnHJ8j.mjs.map +1 -0
- package/dist/sitemap-name-Ja_Cvwx9.mjs +26 -0
- package/dist/sitemap-name-Ja_Cvwx9.mjs.map +1 -0
- package/dist/slug-CO2jtUda.mjs +16 -0
- package/dist/slug-CO2jtUda.mjs.map +1 -0
- package/dist/slugify-sxuydlHd.mjs +22 -0
- package/dist/slugify-sxuydlHd.mjs.map +1 -0
- package/dist/snapshot-C9OWUtFr.mjs +466 -0
- package/dist/snapshot-C9OWUtFr.mjs.map +1 -0
- package/dist/snapshot-CR5tan8p.mjs +184 -0
- package/dist/snapshot-CR5tan8p.mjs.map +1 -0
- package/dist/ssrf-Lj1KZxYt.mjs +406 -0
- package/dist/ssrf-Lj1KZxYt.mjs.map +1 -0
- package/dist/stage-ChbGIslu.mjs +662 -0
- package/dist/stage-ChbGIslu.mjs.map +1 -0
- package/dist/staged-BN8pRZwX.mjs +686 -0
- package/dist/staged-BN8pRZwX.mjs.map +1 -0
- package/dist/state-DtcE0eN3.mjs +178 -0
- package/dist/state-DtcE0eN3.mjs.map +1 -0
- package/dist/status-vvme29qV.mjs +30 -0
- package/dist/status-vvme29qV.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-BDUX3Cef.d.mts +1608 -0
- package/dist/storage-query-BDUX3Cef.d.mts.map +1 -0
- package/dist/tar-CAvEHFbE.mjs +449 -0
- package/dist/tar-CAvEHFbE.mjs.map +1 -0
- package/dist/target-BM_6fT9m.mjs +27 -0
- package/dist/target-BM_6fT9m.mjs.map +1 -0
- package/dist/taxonomies-BMuFLd53.mjs +722 -0
- package/dist/taxonomies-BMuFLd53.mjs.map +1 -0
- package/dist/taxonomies-ClkYcmcH.mjs +937 -0
- package/dist/taxonomies-ClkYcmcH.mjs.map +1 -0
- package/dist/taxonomy-s1GcBCRo.mjs +593 -0
- package/dist/taxonomy-s1GcBCRo.mjs.map +1 -0
- package/dist/tokens-Cpm6FIKJ.mjs +171 -0
- package/dist/tokens-Cpm6FIKJ.mjs.map +1 -0
- package/dist/transaction-SKrr6u84.mjs +44 -0
- package/dist/transaction-SKrr6u84.mjs.map +1 -0
- package/dist/transfer-B3CsI5MG.mjs +8963 -0
- package/dist/transfer-B3CsI5MG.mjs.map +1 -0
- package/dist/transfer-DqUiK3ca.mjs +166 -0
- package/dist/transfer-DqUiK3ca.mjs.map +1 -0
- package/dist/transfer-download-CWPfhL91.mjs +33 -0
- package/dist/transfer-download-CWPfhL91.mjs.map +1 -0
- package/dist/transformations-ClH4dJeM.mjs +196 -0
- package/dist/transformations-ClH4dJeM.mjs.map +1 -0
- package/dist/transport-C6Ps8ejN.mjs +144 -0
- package/dist/transport-C6Ps8ejN.mjs.map +1 -0
- package/dist/transport-D4hWYmO_.d.mts +42 -0
- package/dist/transport-D4hWYmO_.d.mts.map +1 -0
- package/dist/trusted-proxy-CWX1sqgb.mjs +51 -0
- package/dist/trusted-proxy-CWX1sqgb.mjs.map +1 -0
- package/dist/turnstile-B6zM50Mh.mjs +58 -0
- package/dist/turnstile-B6zM50Mh.mjs.map +1 -0
- package/dist/types-BBH-w_KS.mjs +133 -0
- package/dist/types-BBH-w_KS.mjs.map +1 -0
- package/dist/types-Ba3bWb9D.mjs +37 -0
- package/dist/types-Ba3bWb9D.mjs.map +1 -0
- package/dist/types-BmBK2cqf.mjs +201 -0
- package/dist/types-BmBK2cqf.mjs.map +1 -0
- package/dist/types-C0M6z2A4.mjs +16 -0
- package/dist/types-C0M6z2A4.mjs.map +1 -0
- package/dist/types-CG1dR_Cm.d.mts +934 -0
- package/dist/types-CG1dR_Cm.d.mts.map +1 -0
- package/dist/types-CImd8MBY.d.mts +1756 -0
- package/dist/types-CImd8MBY.d.mts.map +1 -0
- package/dist/types-CML-oGr6.d.mts +293 -0
- package/dist/types-CML-oGr6.d.mts.map +1 -0
- package/dist/types-CZO9f_vJ.d.mts +381 -0
- package/dist/types-CZO9f_vJ.d.mts.map +1 -0
- package/dist/types-CpFfDrGH.mjs +18 -0
- package/dist/types-CpFfDrGH.mjs.map +1 -0
- package/dist/types-D2zSjG0c.mjs +63 -0
- package/dist/types-D2zSjG0c.mjs.map +1 -0
- package/dist/types-DLKviL1s.d.mts +93 -0
- package/dist/types-DLKviL1s.d.mts.map +1 -0
- package/dist/types-Df0R58Wu.mjs +77 -0
- package/dist/types-Df0R58Wu.mjs.map +1 -0
- package/dist/types-DwNwhyWP.d.mts +227 -0
- package/dist/types-DwNwhyWP.d.mts.map +1 -0
- package/dist/types-DwZgl0Zn.d.mts +366 -0
- package/dist/types-DwZgl0Zn.d.mts.map +1 -0
- package/dist/types-Dyb_OuSw.d.mts +125 -0
- package/dist/types-Dyb_OuSw.d.mts.map +1 -0
- package/dist/types-iOnPkHRk.d.mts +209 -0
- package/dist/types-iOnPkHRk.d.mts.map +1 -0
- package/dist/ui-comments.d.mts +66 -0
- package/dist/ui-search.d.mts +75 -0
- package/dist/ui-webmcp-search.d.mts +29 -0
- package/dist/ui.d.mts +576 -0
- package/dist/upload-attempts-5Ot7-vsw.mjs +32 -0
- package/dist/upload-attempts-5Ot7-vsw.mjs.map +1 -0
- package/dist/url-BVdd-tah.mjs +104 -0
- package/dist/url-BVdd-tah.mjs.map +1 -0
- package/dist/url-ZCjpMO-q.mjs +74 -0
- package/dist/url-ZCjpMO-q.mjs.map +1 -0
- package/dist/url-pattern-BQT-sGmD.mjs +41 -0
- package/dist/url-pattern-BQT-sGmD.mjs.map +1 -0
- package/dist/urls-Cq_hUk4P.mjs +79 -0
- package/dist/urls-Cq_hUk4P.mjs.map +1 -0
- package/dist/user-C4km6fox.mjs +184 -0
- package/dist/user-C4km6fox.mjs.map +1 -0
- package/dist/utils-Cpo0_V09.d.mts +374 -0
- package/dist/utils-Cpo0_V09.d.mts.map +1 -0
- package/dist/utils-DMDmdhU3.mjs +450 -0
- package/dist/utils-DMDmdhU3.mjs.map +1 -0
- package/dist/validate-BNupiQtz.mjs +524 -0
- package/dist/validate-BNupiQtz.mjs.map +1 -0
- package/dist/validate-DBfkJa3O.d.mts +472 -0
- package/dist/validate-DBfkJa3O.d.mts.map +1 -0
- package/dist/validation-W_efZFgP.mjs +204 -0
- package/dist/validation-W_efZFgP.mjs.map +1 -0
- package/dist/version-C61rw8-y.mjs +9 -0
- package/dist/version-C61rw8-y.mjs.map +1 -0
- package/dist/version-DhGLeLRo.mjs +7 -0
- package/dist/version-DhGLeLRo.mjs.map +1 -0
- package/dist/version-eqLBDtcz.mjs +49 -0
- package/dist/version-eqLBDtcz.mjs.map +1 -0
- package/dist/video-My3h7vwE.mjs +18 -0
- package/dist/video-My3h7vwE.mjs.map +1 -0
- package/dist/virtual-modules-BZKqvjRC.mjs +568 -0
- package/dist/virtual-modules-BZKqvjRC.mjs.map +1 -0
- package/dist/widgets-DAdni19y.mjs +134 -0
- package/dist/widgets-DAdni19y.mjs.map +1 -0
- package/dist/wxr-DDPJOgkM.mjs +1054 -0
- package/dist/wxr-DDPJOgkM.mjs.map +1 -0
- package/dist/wxr-taxonomies-B0U2fJgs.mjs +735 -0
- package/dist/wxr-taxonomies-B0U2fJgs.mjs.map +1 -0
- package/dist/wxr-taxonomies-CyP2k4-Q.d.mts +34 -0
- package/dist/wxr-taxonomies-CyP2k4-Q.d.mts.map +1 -0
- package/dist/zod-generator-ChRSYUix.mjs +425 -0
- package/dist/zod-generator-ChRSYUix.mjs.map +1 -0
- package/package.json +81 -33
- package/src/api/content-save.ts +281 -0
- package/src/api/error.ts +6 -2
- package/src/api/errors.ts +11 -0
- package/src/api/handlers/content.ts +92 -26
- package/src/api/handlers/device-flow.ts +1 -3
- package/src/api/handlers/entry-lock.ts +69 -14
- package/src/api/handlers/marketplace.ts +8 -2
- package/src/api/handlers/media-allowlist.ts +56 -0
- package/src/api/handlers/media-upload.ts +9 -1
- package/src/api/handlers/menus.ts +3 -3
- package/src/api/handlers/oauth-authorization.ts +1 -3
- package/src/api/handlers/plugins.ts +4 -4
- package/src/api/handlers/registry.ts +33 -21
- package/src/api/handlers/relations.ts +20 -4
- package/src/api/handlers/revision.ts +29 -0
- package/src/api/handlers/rooms.ts +233 -0
- package/src/api/handlers/site-domain.ts +1 -1
- package/src/api/handlers/snapshot.ts +90 -30
- package/src/api/handlers/staged-references.ts +14 -0
- package/src/api/list-preconditions.ts +101 -0
- package/src/api/openapi/document.ts +5 -5
- package/src/api/parse.ts +3 -2
- package/src/api/public-url.ts +21 -0
- package/src/api/schemas/auth.ts +57 -1
- package/src/api/schemas/content.ts +14 -0
- package/src/api/schemas/entry-lock.ts +6 -1
- package/src/api/schemas/import.ts +6 -0
- package/src/api/schemas/index.ts +1 -0
- package/src/api/schemas/media.ts +20 -0
- package/src/api/schemas/rooms.ts +27 -0
- package/src/api/schemas/schema.ts +9 -1
- package/src/api/schemas/settings.ts +2 -0
- package/src/api/site-title.ts +13 -0
- package/src/api/types.ts +3 -0
- package/src/astro/integration/admin-nav.ts +52 -0
- package/src/astro/integration/index.ts +26 -5
- package/src/astro/integration/routes.ts +15 -5
- package/src/astro/integration/runtime.ts +46 -0
- package/src/astro/integration/shims/use-sync-external-store-with-selector.js +2 -0
- package/src/astro/integration/shims/use-sync-external-store.js +4 -1
- package/src/astro/integration/virtual-modules.ts +80 -17
- package/src/astro/integration/vite-config.ts +136 -0
- package/src/astro/middleware/auth.ts +53 -18
- package/src/astro/middleware/media-usage-write-fence.ts +4 -0
- package/src/astro/middleware/redirect.ts +11 -1
- package/src/astro/middleware/request-context.ts +57 -27
- package/src/astro/middleware.ts +44 -29
- package/src/astro/routes/PluginRegistry.tsx +21 -17
- package/src/astro/routes/api/admin/comments/[id]/status.ts +9 -1
- package/src/astro/routes/api/admin/comments/[id].ts +10 -3
- package/src/astro/routes/api/admin/comments/bulk.ts +18 -4
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +1 -1
- package/src/astro/routes/api/admin/plugins/registry/install.ts +1 -1
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +9 -2
- package/src/astro/routes/api/auth/dev-bypass.ts +20 -1
- package/src/astro/routes/api/auth/invite/complete.ts +2 -1
- package/src/astro/routes/api/auth/invite/index.ts +9 -2
- package/src/astro/routes/api/auth/invite/register-options.ts +2 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +9 -2
- package/src/astro/routes/api/auth/me.ts +38 -17
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +6 -11
- package/src/astro/routes/api/auth/oauth/[provider].ts +6 -11
- package/src/astro/routes/api/auth/passkey/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/register/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/register/verify.ts +2 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +2 -1
- package/src/astro/routes/api/auth/signup/complete.ts +2 -1
- package/src/astro/routes/api/auth/signup/request.ts +2 -1
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +1 -0
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +6 -3
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +6 -2
- package/src/astro/routes/api/content/[collection]/[id]/revisions/editors.ts +30 -0
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +37 -1
- package/src/astro/routes/api/content/[collection]/[id]/room.ts +43 -0
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +3 -1
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +54 -2
- package/src/astro/routes/api/content/[collection]/[id].ts +22 -73
- package/src/astro/routes/api/import/wordpress/analyze.ts +16 -29
- package/src/astro/routes/api/import/wordpress/execute.ts +193 -15
- package/src/astro/routes/api/import/wordpress/media.ts +6 -1
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +9 -5
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +25 -19
- package/src/astro/routes/api/manifest.ts +40 -5
- package/src/astro/routes/api/media/[id]/confirm.ts +42 -14
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +1 -0
- package/src/astro/routes/api/media/file/[...key].ts +19 -4
- package/src/astro/routes/api/media/upload-url.ts +1 -1
- package/src/astro/routes/api/media.ts +14 -4
- package/src/astro/routes/api/oauth/device/authorize.ts +0 -2
- package/src/astro/routes/api/oauth/token.ts +5 -1
- package/src/astro/routes/api/revisions/[revisionId]/restore.ts +1 -1
- package/src/astro/routes/api/settings/domain-notify.ts +9 -2
- package/src/astro/routes/api/settings/email.ts +197 -8
- package/src/astro/routes/api/setup/admin-verify.ts +2 -1
- package/src/astro/routes/api/setup/admin.ts +2 -1
- package/src/astro/routes/api/setup/dev-bypass.ts +3 -1
- package/src/astro/routes/api/setup/index.ts +5 -2
- package/src/astro/routes/api/well-known/auth.ts +2 -1
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +7 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +2 -1
- package/src/astro/routes/api/widget-areas/[name].ts +2 -1
- package/src/astro/routes/api/widget-areas/index.ts +2 -1
- package/src/astro/routes/robots.txt.ts +9 -10
- package/src/astro/routes/sitemap-[collection].xml.ts +5 -6
- package/src/astro/routes/sitemap.xml.ts +2 -6
- package/src/astro/runtime-holder.ts +41 -0
- package/src/astro/types.ts +46 -8
- package/src/auth/api-tokens.ts +3 -0
- package/src/auth/oauth-env.ts +35 -0
- package/src/bylines/field-defs-cache.ts +9 -4
- package/src/cleanup.ts +44 -0
- package/src/cli/commands/export-seed.ts +4 -3
- package/src/cli/commands/import/wordpress.ts +158 -56
- package/src/cli/commands/import.ts +139 -0
- package/src/cli/commands/login.ts +26 -1
- package/src/cli/commands/schema.ts +2 -2
- package/src/cli/commands/seed.ts +3 -3
- package/src/cli/credentials.ts +58 -17
- package/src/cli/index.ts +4 -1
- package/src/cli/wxr/parser.ts +15 -13
- package/src/client/index.ts +38 -24
- package/src/client/portable-text.ts +390 -192
- package/src/client/transport.ts +14 -4
- package/src/comments/public-submission.ts +7 -0
- package/src/comments/route-cache.ts +39 -0
- package/src/components/Columns.astro +2 -4
- package/src/components/CommentForm.astro +6 -0
- package/src/components/Comments.astro +5 -1
- package/src/components/Cover.astro +2 -4
- package/src/components/EmDashHead.astro +9 -7
- package/src/components/EmDashImage.astro +161 -34
- package/src/components/EmDashMedia.astro +36 -31
- package/src/components/Embed.astro +49 -17
- package/src/components/Gallery.astro +6 -2
- package/src/components/Image.astro +15 -3
- package/src/components/InlinePortableTextEditor.tsx +1 -0
- package/src/components/LiveSearch.astro +23 -1
- package/src/components/PortableText.astro +5 -8
- package/src/components/inline-bubble-menu.tsx +109 -95
- package/src/components/inline-image.tsx +54 -48
- package/src/components/marks/Link.astro +7 -0
- package/src/components/widgets/Archives.astro +6 -2
- package/src/components/widgets/Categories.astro +7 -2
- package/src/components/widgets/RecentPosts.astro +23 -13
- package/src/components/widgets/Search.astro +3 -1
- package/src/components/widgets/Tags.astro +7 -2
- package/src/config/options-schema.ts +124 -0
- package/src/content/converters/video.ts +6 -65
- package/src/database/dialect-helpers.ts +67 -3
- package/src/database/migrations/092_plugin_kv_options.ts +93 -0
- package/src/database/migrations/093_menu_item_orphans.ts +21 -0
- package/src/database/migrations/094_media_usage_file_url_reindex.ts +57 -0
- package/src/database/migrations/095_plugin_storage_unique_scope.ts +134 -0
- package/src/database/migrations/096_revision_kind_and_editors.ts +29 -0
- package/src/database/migrations/097_room_storage.ts +43 -0
- package/src/database/migrations/content-sized.ts +16 -0
- package/src/database/migrations/policy.ts +6 -1
- package/src/database/migrations/runner.ts +37 -8
- package/src/database/plugin-storage-index-name.ts +29 -0
- package/src/database/repositories/byline.ts +99 -86
- package/src/database/repositories/content.ts +179 -17
- package/src/database/repositories/entry-locks.ts +35 -29
- package/src/database/repositories/media-usage.ts +1 -1
- package/src/database/repositories/media.ts +40 -0
- package/src/database/repositories/menu.ts +193 -135
- package/src/database/repositories/redirect.ts +116 -46
- package/src/database/repositories/revision.ts +216 -20
- package/src/database/repositories/seo.ts +2 -0
- package/src/database/repositories/taxonomy.ts +91 -27
- package/src/database/repositories/types.ts +3 -3
- package/src/database/repositories/user.ts +34 -0
- package/src/database/transaction.ts +23 -2
- package/src/database/types.ts +24 -2
- package/src/emdash-runtime.ts +1071 -247
- package/src/i18n/resolve.ts +10 -0
- package/src/import/index.ts +0 -12
- package/src/import/menus.ts +202 -151
- package/src/import/registry.ts +30 -1
- package/src/import/utils.ts +15 -2
- package/src/index.ts +11 -0
- package/src/loader.ts +209 -115
- package/src/mcp/server.ts +103 -29
- package/src/media/content-disposition.ts +56 -0
- package/src/media/enrich.ts +20 -4
- package/src/media/image-endpoint.ts +1 -0
- package/src/media/mime.ts +1 -0
- package/src/media/normalize.ts +2 -0
- package/src/media/placeholder.ts +4 -0
- package/src/media/portable-text-file-refs.ts +98 -0
- package/src/media/responsive.ts +29 -1
- package/src/media/types.ts +2 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/content-fields.ts +2 -1
- package/src/media/usage/content-snapshots.ts +111 -34
- package/src/media/usage/extractor.ts +42 -8
- package/src/media/usage/types.ts +5 -0
- package/src/menus/index.ts +137 -25
- package/src/object-cache/index.ts +402 -17
- package/src/page/jsonld.ts +26 -11
- package/src/plugin-test-runtime.ts +1 -0
- package/src/plugins/adapt-sandbox-entry.ts +2 -0
- package/src/plugins/content-policy.ts +36 -2
- package/src/plugins/context.ts +17 -7
- package/src/plugins/cron.ts +6 -3
- package/src/plugins/define-plugin.ts +5 -1
- package/src/plugins/editor-draft.ts +9 -3
- package/src/plugins/email-smtp.ts +936 -0
- package/src/plugins/hooks.ts +34 -8
- package/src/plugins/host.ts +2 -0
- package/src/plugins/http-route-dispatch.ts +3 -1
- package/src/plugins/lifecycle.ts +25 -1
- package/src/plugins/manager.ts +3 -0
- package/src/plugins/sandbox/types.ts +10 -1
- package/src/plugins/storage-indexes.ts +64 -55
- package/src/plugins/types.ts +16 -1
- package/src/query.ts +116 -47
- package/src/redirects/cache.ts +3 -2
- package/src/redirects/loops.ts +20 -4
- package/src/redirects/patterns.ts +16 -0
- package/src/request-context.ts +29 -1
- package/src/rooms/document.ts +99 -0
- package/src/rooms/hash.ts +19 -0
- package/src/rooms/index.ts +28 -0
- package/src/rooms/kysely-store.ts +279 -0
- package/src/rooms/limits.ts +41 -0
- package/src/rooms/merge.ts +115 -0
- package/src/rooms/node/index.ts +30 -0
- package/src/rooms/node/registry.ts +232 -0
- package/src/rooms/node/signals.ts +89 -0
- package/src/rooms/node/upgrades.ts +210 -0
- package/src/rooms/notifications.ts +157 -0
- package/src/rooms/parts.ts +74 -0
- package/src/rooms/room.ts +1559 -0
- package/src/rooms/site.ts +185 -0
- package/src/rooms/snapshot.ts +11 -0
- package/src/rooms/types.ts +298 -0
- package/src/scheduled-publish.ts +18 -5
- package/src/schema/registry.ts +14 -3
- package/src/schema/types.ts +17 -8
- package/src/search/errors.ts +22 -0
- package/src/search/fts-manager.ts +26 -9
- package/src/search/index.ts +2 -0
- package/src/seed/apply.ts +161 -92
- package/src/seed/index.ts +1 -1
- package/src/seed/load.ts +9 -0
- package/src/seed/types.ts +23 -14
- package/src/seo/hreflang.ts +5 -4
- package/src/seo/index.ts +10 -4
- package/src/seo/title-field.ts +19 -0
- package/src/settings/index.ts +36 -3
- package/src/settings/types.ts +7 -0
- package/src/taxonomies/index.ts +77 -76
- package/src/transfer/analyze/target.ts +5 -0
- package/src/transfer/domain.ts +23 -0
- package/src/transfer/export/readers.ts +6 -2
- package/src/transfer/format/columns.ts +4 -0
- package/src/transfer/format/settings.ts +1 -0
- package/src/transfer/import/advance.ts +12 -1
- package/src/transfer/import/scaffold.ts +73 -9
- package/src/transfer/import/stages.ts +53 -2
- package/src/ui.ts +18 -19
- package/src/utils/revalidating-cache.ts +85 -0
- package/src/virtual-modules.d.ts +20 -3
- package/src/visual-editing/toolbar.ts +79 -52
- package/src/widgets/index.ts +27 -13
- package/src/widgets/recent-posts.ts +13 -0
- package/dist/action-token-B1ds4laA.mjs +0 -26
- package/dist/action-token-B1ds4laA.mjs.map +0 -1
- package/dist/activation-sGF9br3X.mjs +0 -387
- package/dist/activation-sGF9br3X.mjs.map +0 -1
- package/dist/adapters-BOMSX9PU.d.mts +0 -173
- package/dist/adapters-BOMSX9PU.d.mts.map +0 -1
- package/dist/after-PcEvMY_6.mjs +0 -96
- package/dist/after-PcEvMY_6.mjs.map +0 -1
- package/dist/allowed-origins-CovsTkm3.mjs +0 -116
- package/dist/allowed-origins-CovsTkm3.mjs.map +0 -1
- package/dist/api-C_LxFnOm.mjs +0 -5077
- package/dist/api-C_LxFnOm.mjs.map +0 -1
- package/dist/api-tokens-C7l0GUAF.mjs +0 -3
- package/dist/api-tokens-DQ9Ee-vP.mjs +0 -173
- package/dist/api-tokens-DQ9Ee-vP.mjs.map +0 -1
- package/dist/apply-CLjfxvyH.mjs +0 -1758
- package/dist/apply-CLjfxvyH.mjs.map +0 -1
- package/dist/approvals-ocK89i4H.mjs +0 -460
- package/dist/approvals-ocK89i4H.mjs.map +0 -1
- package/dist/artifact-fetch-CgvvpoWQ.mjs +0 -659
- package/dist/artifact-fetch-CgvvpoWQ.mjs.map +0 -1
- package/dist/artifacts-DwOYYBQm.mjs +0 -323
- package/dist/artifacts-DwOYYBQm.mjs.map +0 -1
- package/dist/audit-B8XE-0UV.mjs +0 -127
- package/dist/audit-B8XE-0UV.mjs.map +0 -1
- package/dist/authoritative-records-LPtrIGOY.mjs +0 -5183
- package/dist/authoritative-records-LPtrIGOY.mjs.map +0 -1
- package/dist/authorize-CoDsRRp5.mjs +0 -74
- package/dist/authorize-CoDsRRp5.mjs.map +0 -1
- package/dist/backup-2Wj-hTCN.mjs +0 -246
- package/dist/backup-2Wj-hTCN.mjs.map +0 -1
- package/dist/base64-BQBZwXCx.mjs +0 -63
- package/dist/base64-BQBZwXCx.mjs.map +0 -1
- package/dist/block-types-C3gJEe7l.mjs +0 -132
- package/dist/block-types-C3gJEe7l.mjs.map +0 -1
- package/dist/block-values-CgbMtSGU.mjs +0 -215
- package/dist/block-values-CgbMtSGU.mjs.map +0 -1
- package/dist/byline-CzGZC2Zs.mjs +0 -922
- package/dist/byline-CzGZC2Zs.mjs.map +0 -1
- package/dist/byline-fields-B1qHvRps.mjs +0 -280
- package/dist/byline-fields-B1qHvRps.mjs.map +0 -1
- package/dist/byline-fields-vYd_4Q1e.mjs +0 -123
- package/dist/byline-fields-vYd_4Q1e.mjs.map +0 -1
- package/dist/byline-registry-BhzpO41z.mjs +0 -406
- package/dist/byline-registry-BhzpO41z.mjs.map +0 -1
- package/dist/bylines-BF555iIz.mjs +0 -150
- package/dist/bylines-BF555iIz.mjs.map +0 -1
- package/dist/bylines-DJx6IWWi.mjs +0 -234
- package/dist/bylines-DJx6IWWi.mjs.map +0 -1
- package/dist/cache-BWzswWB-.mjs +0 -151
- package/dist/cache-BWzswWB-.mjs.map +0 -1
- package/dist/canonical-DjF_z6GI.mjs +0 -174
- package/dist/canonical-DjF_z6GI.mjs.map +0 -1
- package/dist/capture-triggers-D7g3fOZj.mjs +0 -362
- package/dist/capture-triggers-D7g3fOZj.mjs.map +0 -1
- package/dist/challenge-store-Cfjdvw86.mjs +0 -51
- package/dist/challenge-store-Cfjdvw86.mjs.map +0 -1
- package/dist/checksum-BF4acJwn.mjs +0 -162
- package/dist/checksum-BF4acJwn.mjs.map +0 -1
- package/dist/chrome-tags-BDs29G3g.mjs +0 -24
- package/dist/chrome-tags-BDs29G3g.mjs.map +0 -1
- package/dist/chunks-CYBOL-zn.mjs +0 -25
- package/dist/chunks-CYBOL-zn.mjs.map +0 -1
- package/dist/collection-slugs-cache-B2J5aESO.mjs +0 -91
- package/dist/collection-slugs-cache-B2J5aESO.mjs.map +0 -1
- package/dist/comment-DV7dybcs.mjs +0 -335
- package/dist/comment-DV7dybcs.mjs.map +0 -1
- package/dist/comment-reaction-CWwqiT6x.mjs +0 -85
- package/dist/comment-reaction-CWwqiT6x.mjs.map +0 -1
- package/dist/comments-DVjWJm8X.mjs +0 -99
- package/dist/comments-DVjWJm8X.mjs.map +0 -1
- package/dist/comments-Q-ILHCEI.mjs +0 -195
- package/dist/comments-Q-ILHCEI.mjs.map +0 -1
- package/dist/components-DnOmvvgg.mjs +0 -112
- package/dist/components-DnOmvvgg.mjs.map +0 -1
- package/dist/config-9IzA83_U.d.mts +0 -6811
- package/dist/config-9IzA83_U.d.mts.map +0 -1
- package/dist/config-BdQzFtmR.mjs +0 -228
- package/dist/config-BdQzFtmR.mjs.map +0 -1
- package/dist/config-Cs2RBkJ6.d.mts +0 -41
- package/dist/config-Cs2RBkJ6.d.mts.map +0 -1
- package/dist/connection-CiXgZyCY.mjs +0 -36
- package/dist/connection-CiXgZyCY.mjs.map +0 -1
- package/dist/content-Dt0Os_WQ.mjs +0 -2109
- package/dist/content-Dt0Os_WQ.mjs.map +0 -1
- package/dist/content-list-query-BK26u9Ly.d.mts +0 -26
- package/dist/content-list-query-BK26u9Ly.d.mts.map +0 -1
- package/dist/content-policy-BLDbNJOb.mjs +0 -46
- package/dist/content-policy-BLDbNJOb.mjs.map +0 -1
- package/dist/content-repair-CjwbLy4m.mjs +0 -442
- package/dist/content-repair-CjwbLy4m.mjs.map +0 -1
- package/dist/context-ErV7UdQY.mjs +0 -2089
- package/dist/context-ErV7UdQY.mjs.map +0 -1
- package/dist/credits-BRyjafiF.mjs +0 -110
- package/dist/credits-BRyjafiF.mjs.map +0 -1
- package/dist/cron-Bm5xa7tv.mjs +0 -306
- package/dist/cron-Bm5xa7tv.mjs.map +0 -1
- package/dist/dashboard-DVxQ5XiI.mjs +0 -168
- package/dist/dashboard-DVxQ5XiI.mjs.map +0 -1
- package/dist/default-B9Tf2n94.mjs +0 -81
- package/dist/default-B9Tf2n94.mjs.map +0 -1
- package/dist/deferred-tasks-CpPEqsga.d.mts +0 -9
- package/dist/deferred-tasks-CpPEqsga.d.mts.map +0 -1
- package/dist/destination-DR3IHjmy.mjs +0 -18
- package/dist/destination-DR3IHjmy.mjs.map +0 -1
- package/dist/dev-typegen-ZeWYV8Jp.mjs +0 -29
- package/dist/dev-typegen-ZeWYV8Jp.mjs.map +0 -1
- package/dist/device-flow-BbYNZ9Xi.mjs +0 -521
- package/dist/device-flow-BbYNZ9Xi.mjs.map +0 -1
- package/dist/dialect-helpers-7_IqPdh9.mjs +0 -307
- package/dist/dialect-helpers-7_IqPdh9.mjs.map +0 -1
- package/dist/digest-DlBa7kJl.mjs +0 -194
- package/dist/digest-DlBa7kJl.mjs.map +0 -1
- package/dist/direct-executor-5T8gkhvA.mjs +0 -117
- package/dist/direct-executor-5T8gkhvA.mjs.map +0 -1
- package/dist/dist-DY0aOmAP.mjs +0 -810
- package/dist/dist-DY0aOmAP.mjs.map +0 -1
- package/dist/email-console-v3OM8It-.mjs +0 -50
- package/dist/email-console-v3OM8It-.mjs.map +0 -1
- package/dist/email-locale-CoZo-oZx.mjs +0 -25
- package/dist/email-locale-CoZo-oZx.mjs.map +0 -1
- package/dist/emdash-runtime-DwezbIqQ.mjs +0 -4392
- package/dist/emdash-runtime-DwezbIqQ.mjs.map +0 -1
- package/dist/enrich-C3XIJi0O.mjs +0 -194
- package/dist/enrich-C3XIJi0O.mjs.map +0 -1
- package/dist/entry-lock-CY7XpdSw.d.mts +0 -4568
- package/dist/entry-lock-CY7XpdSw.d.mts.map +0 -1
- package/dist/entry-lock-DDuWaAiP.mjs +0 -1211
- package/dist/entry-lock-DDuWaAiP.mjs.map +0 -1
- package/dist/entry-lock-D_Og9Gy3.mjs +0 -163
- package/dist/entry-lock-D_Og9Gy3.mjs.map +0 -1
- package/dist/entry-locks-Cp8_BcQQ.mjs +0 -167
- package/dist/entry-locks-Cp8_BcQQ.mjs.map +0 -1
- package/dist/env-types-Br8uywYA.mjs +0 -38
- package/dist/env-types-Br8uywYA.mjs.map +0 -1
- package/dist/error-CT2SsX5S.mjs +0 -90
- package/dist/error-CT2SsX5S.mjs.map +0 -1
- package/dist/errors-BMaCpLeS.mjs +0 -479
- package/dist/errors-BMaCpLeS.mjs.map +0 -1
- package/dist/errors-DlJwot7q.mjs +0 -120
- package/dist/errors-DlJwot7q.mjs.map +0 -1
- package/dist/escape-BfbDyuQ-.mjs +0 -9
- package/dist/escape-BfbDyuQ-.mjs.map +0 -1
- package/dist/fence-BOD3SxZG.mjs +0 -162
- package/dist/fence-BOD3SxZG.mjs.map +0 -1
- package/dist/field-defs-cache-C7sR7ZeU.mjs +0 -77
- package/dist/field-defs-cache-C7sR7ZeU.mjs.map +0 -1
- package/dist/field-map-C_rDXfdJ.mjs +0 -84
- package/dist/field-map-C_rDXfdJ.mjs.map +0 -1
- package/dist/focal-point-CgCcr1Ca.mjs +0 -23
- package/dist/focal-point-CgCcr1Ca.mjs.map +0 -1
- package/dist/fts-manager-BzFo0xx6.mjs +0 -483
- package/dist/fts-manager-BzFo0xx6.mjs.map +0 -1
- package/dist/gc-B_c3DPpi.mjs +0 -75
- package/dist/gc-B_c3DPpi.mjs.map +0 -1
- package/dist/hash-A-o2ZX8O.mjs +0 -37
- package/dist/hash-A-o2ZX8O.mjs.map +0 -1
- package/dist/hook-result-f8t7hIuu.d.mts +0 -31
- package/dist/hook-result-f8t7hIuu.d.mts.map +0 -1
- package/dist/hreflang-BpUK9Lcu.mjs +0 -105
- package/dist/hreflang-BpUK9Lcu.mjs.map +0 -1
- package/dist/hreflang-D07R-RbI.d.mts +0 -50
- package/dist/hreflang-D07R-RbI.d.mts.map +0 -1
- package/dist/http-route-dispatch-C2Ep2Uf6.mjs +0 -342
- package/dist/http-route-dispatch-C2Ep2Uf6.mjs.map +0 -1
- package/dist/identity-BivQ8wkV.mjs +0 -35
- package/dist/identity-BivQ8wkV.mjs.map +0 -1
- package/dist/import-B4UvHNJz.mjs +0 -2126
- package/dist/import-B4UvHNJz.mjs.map +0 -1
- package/dist/index-C37Ty40w.d.mts +0 -623
- package/dist/index-C37Ty40w.d.mts.map +0 -1
- package/dist/init-lock-BGmew3r1.mjs +0 -56
- package/dist/init-lock-BGmew3r1.mjs.map +0 -1
- package/dist/install-finalization-BbYaB4wj.mjs +0 -58
- package/dist/install-finalization-BbYaB4wj.mjs.map +0 -1
- package/dist/json-recordset-BjYIWFkV.mjs +0 -12
- package/dist/json-recordset-BjYIWFkV.mjs.map +0 -1
- package/dist/json-schema-Cde7le0s.mjs +0 -15
- package/dist/json-schema-Cde7le0s.mjs.map +0 -1
- package/dist/keys-CusTXpw-.mjs +0 -61
- package/dist/keys-CusTXpw-.mjs.map +0 -1
- package/dist/kinds-DogmNB6n.mjs +0 -974
- package/dist/kinds-DogmNB6n.mjs.map +0 -1
- package/dist/lifecycle-BLCoCz4T.mjs +0 -25
- package/dist/lifecycle-BLCoCz4T.mjs.map +0 -1
- package/dist/load-Dds3KhXr.mjs +0 -28
- package/dist/load-Dds3KhXr.mjs.map +0 -1
- package/dist/loader-D4w4XE7q.mjs +0 -1420
- package/dist/loader-D4w4XE7q.mjs.map +0 -1
- package/dist/loops-IYgzQdQu.mjs +0 -205
- package/dist/loops-IYgzQdQu.mjs.map +0 -1
- package/dist/manifest-builder-CGF5kujD.mjs +0 -196
- package/dist/manifest-builder-CGF5kujD.mjs.map +0 -1
- package/dist/manifest-schema-B0BxPSjB.mjs +0 -497
- package/dist/manifest-schema-B0BxPSjB.mjs.map +0 -1
- package/dist/marketplace-DNvEGLqU.mjs +0 -257
- package/dist/marketplace-DNvEGLqU.mjs.map +0 -1
- package/dist/media-BL9MRrSG.mjs +0 -294
- package/dist/media-BL9MRrSG.mjs.map +0 -1
- package/dist/media-B_x5B9EA.mjs +0 -373
- package/dist/media-B_x5B9EA.mjs.map +0 -1
- package/dist/media-allowlist-CpmqBbIQ.mjs +0 -45
- package/dist/media-allowlist-CpmqBbIQ.mjs.map +0 -1
- package/dist/media-folders-CNs_A_B-.mjs +0 -210
- package/dist/media-folders-CNs_A_B-.mjs.map +0 -1
- package/dist/media-qTTHVkls.mjs +0 -416
- package/dist/media-qTTHVkls.mjs.map +0 -1
- package/dist/media-url-GJboA1fl.mjs +0 -43
- package/dist/media-url-GJboA1fl.mjs.map +0 -1
- package/dist/media-usage-ClWgrX0d.mjs +0 -282
- package/dist/media-usage-ClWgrX0d.mjs.map +0 -1
- package/dist/media-usage-activation-B8Fjtq0h.mjs +0 -78
- package/dist/media-usage-activation-B8Fjtq0h.mjs.map +0 -1
- package/dist/media-usage-work-L8-Au4j-.mjs +0 -1036
- package/dist/media-usage-work-L8-Au4j-.mjs.map +0 -1
- package/dist/media-usage-work-LXgze5j9.mjs +0 -151
- package/dist/media-usage-work-LXgze5j9.mjs.map +0 -1
- package/dist/menus-BAxcbsbv.mjs +0 -818
- package/dist/menus-BAxcbsbv.mjs.map +0 -1
- package/dist/menus-BI6oBXco.mjs +0 -92
- package/dist/menus-BI6oBXco.mjs.map +0 -1
- package/dist/menus-fvGFd4m6.mjs +0 -3725
- package/dist/menus-fvGFd4m6.mjs.map +0 -1
- package/dist/mime-DwhtRyUt.mjs +0 -81
- package/dist/mime-DwhtRyUt.mjs.map +0 -1
- package/dist/mode-DIDSUwuN.mjs +0 -23
- package/dist/mode-DIDSUwuN.mjs.map +0 -1
- package/dist/node-sqlite-compat-Ddr_mlR9.mjs +0 -63
- package/dist/node-sqlite-compat-Ddr_mlR9.mjs.map +0 -1
- package/dist/normalize-Ip_hFAm8.mjs +0 -216
- package/dist/normalize-Ip_hFAm8.mjs.map +0 -1
- package/dist/oauth-authorization-CcMgeT8R.mjs +0 -274
- package/dist/oauth-authorization-CcMgeT8R.mjs.map +0 -1
- package/dist/oauth-clients-C_osi0PU.mjs +0 -266
- package/dist/oauth-clients-C_osi0PU.mjs.map +0 -1
- package/dist/oauth-state-store-DGLP-6CK.mjs +0 -50
- package/dist/oauth-state-store-DGLP-6CK.mjs.map +0 -1
- package/dist/oauth-user-lookup-z77Ee0Hm.mjs +0 -26
- package/dist/oauth-user-lookup-z77Ee0Hm.mjs.map +0 -1
- package/dist/object-cache-EjasjtoQ.mjs +0 -586
- package/dist/object-cache-EjasjtoQ.mjs.map +0 -1
- package/dist/options-CmUpkyKW.d.mts +0 -81
- package/dist/options-CmUpkyKW.d.mts.map +0 -1
- package/dist/options-DhrI7eMv.mjs +0 -208
- package/dist/options-DhrI7eMv.mjs.map +0 -1
- package/dist/ownership-DCk5NutQ.mjs +0 -12
- package/dist/ownership-DCk5NutQ.mjs.map +0 -1
- package/dist/parse-2W-E2f7w.mjs +0 -81
- package/dist/parse-2W-E2f7w.mjs.map +0 -1
- package/dist/parse-6pN8Xqg5.d.mts +0 -176
- package/dist/parse-6pN8Xqg5.d.mts.map +0 -1
- package/dist/passkey-config-DTTZB6EI.mjs +0 -46
- package/dist/passkey-config-DTTZB6EI.mjs.map +0 -1
- package/dist/paths-CQA62503.mjs +0 -77
- package/dist/paths-CQA62503.mjs.map +0 -1
- package/dist/patterns-CryGz_EV.mjs +0 -159
- package/dist/patterns-CryGz_EV.mjs.map +0 -1
- package/dist/placeholder-BlfXkucE.d.mts +0 -313
- package/dist/placeholder-BlfXkucE.d.mts.map +0 -1
- package/dist/plan-B95eiwnF.mjs +0 -135
- package/dist/plan-B95eiwnF.mjs.map +0 -1
- package/dist/plugin-tool-name-BDA7m4Xa.mjs +0 -27
- package/dist/plugin-tool-name-BDA7m4Xa.mjs.map +0 -1
- package/dist/plugins-BhxLJ008.mjs +0 -261
- package/dist/plugins-BhxLJ008.mjs.map +0 -1
- package/dist/policy-DOJ2sPqB.mjs +0 -53
- package/dist/policy-DOJ2sPqB.mjs.map +0 -1
- package/dist/portable-text-RCMpCj47.mjs +0 -311
- package/dist/portable-text-RCMpCj47.mjs.map +0 -1
- package/dist/preview-DFwL5APO.mjs +0 -107
- package/dist/preview-DFwL5APO.mjs.map +0 -1
- package/dist/protocol-B-ztxp_y.d.mts +0 -65
- package/dist/protocol-B-ztxp_y.d.mts.map +0 -1
- package/dist/public-plugin-api-routes-ik4fPZMv.mjs +0 -316
- package/dist/public-plugin-api-routes-ik4fPZMv.mjs.map +0 -1
- package/dist/public-submission-C5JZIykp.mjs +0 -251
- package/dist/public-submission-C5JZIykp.mjs.map +0 -1
- package/dist/public-url-CQwzRljH.mjs +0 -101
- package/dist/public-url-CQwzRljH.mjs.map +0 -1
- package/dist/query-BFHjCzSh.mjs +0 -37
- package/dist/query-BFHjCzSh.mjs.map +0 -1
- package/dist/query-DuwyFr5Z.mjs +0 -41
- package/dist/query-DuwyFr5Z.mjs.map +0 -1
- package/dist/query-eR_Nz70M.mjs +0 -1157
- package/dist/query-eR_Nz70M.mjs.map +0 -1
- package/dist/range-BQWPjWgQ.mjs +0 -51
- package/dist/range-BQWPjWgQ.mjs.map +0 -1
- package/dist/rate-limit-mPKeQ3sm.mjs +0 -127
- package/dist/rate-limit-mPKeQ3sm.mjs.map +0 -1
- package/dist/receipt-CmUpyuW5.mjs +0 -43
- package/dist/receipt-CmUpyuW5.mjs.map +0 -1
- package/dist/redirect-BtiMkehU.mjs +0 -19
- package/dist/redirect-BtiMkehU.mjs.map +0 -1
- package/dist/redirect-DcmNMvOs.mjs +0 -423
- package/dist/redirect-DcmNMvOs.mjs.map +0 -1
- package/dist/redirect-paths-K5i3xYfR.mjs +0 -36
- package/dist/redirect-paths-K5i3xYfR.mjs.map +0 -1
- package/dist/redirects-BA_TvtuH.mjs +0 -148
- package/dist/redirects-BA_TvtuH.mjs.map +0 -1
- package/dist/redirects-BIrRvgn4.mjs +0 -446
- package/dist/redirects-BIrRvgn4.mjs.map +0 -1
- package/dist/registry-DymfZkAN.mjs +0 -8374
- package/dist/registry-DymfZkAN.mjs.map +0 -1
- package/dist/relations-DrEs3Sc1.mjs +0 -789
- package/dist/relations-DrEs3Sc1.mjs.map +0 -1
- package/dist/request-cache-5z2WzWmh.mjs +0 -104
- package/dist/request-cache-5z2WzWmh.mjs.map +0 -1
- package/dist/request-meta-o8RIf9pa.mjs +0 -141
- package/dist/request-meta-o8RIf9pa.mjs.map +0 -1
- package/dist/resolve-CVy9xgy_.mjs +0 -102
- package/dist/resolve-CVy9xgy_.mjs.map +0 -1
- package/dist/resolve-DdNXBJSr.mjs +0 -199
- package/dist/resolve-DdNXBJSr.mjs.map +0 -1
- package/dist/revision-Dx7Uth1X.mjs +0 -374
- package/dist/revision-Dx7Uth1X.mjs.map +0 -1
- package/dist/route-cache-DAG5dPhh.mjs +0 -20
- package/dist/route-cache-DAG5dPhh.mjs.map +0 -1
- package/dist/route-wire-Xbsu8Vih.mjs +0 -197
- package/dist/route-wire-Xbsu8Vih.mjs.map +0 -1
- package/dist/routes-YQkSOsws.mjs +0 -272
- package/dist/routes-YQkSOsws.mjs.map +0 -1
- package/dist/runner-CLorw5vo.mjs +0 -6669
- package/dist/runner-CLorw5vo.mjs.map +0 -1
- package/dist/runner-g1A9P-wD.d.mts +0 -73
- package/dist/runner-g1A9P-wD.d.mts.map +0 -1
- package/dist/schema-Bss8qImF.mjs +0 -13
- package/dist/schema-Bss8qImF.mjs.map +0 -1
- package/dist/schema-C036pqEw.mjs +0 -815
- package/dist/schema-C036pqEw.mjs.map +0 -1
- package/dist/scopes-C_SoYl9x.mjs +0 -34
- package/dist/scopes-C_SoYl9x.mjs.map +0 -1
- package/dist/search-uNqCgePJ.mjs +0 -450
- package/dist/search-uNqCgePJ.mjs.map +0 -1
- package/dist/secrets-Cc_O3Kp-.mjs +0 -369
- package/dist/secrets-Cc_O3Kp-.mjs.map +0 -1
- package/dist/sections-BLusMa96.mjs +0 -346
- package/dist/sections-BLusMa96.mjs.map +0 -1
- package/dist/seo-BodxIpws.mjs +0 -188
- package/dist/seo-BodxIpws.mjs.map +0 -1
- package/dist/seo-DaMYIQY8.mjs +0 -133
- package/dist/seo-DaMYIQY8.mjs.map +0 -1
- package/dist/service-BuM1BRsA.mjs +0 -150
- package/dist/service-BuM1BRsA.mjs.map +0 -1
- package/dist/session-user-2DpQDMKw.mjs +0 -61
- package/dist/session-user-2DpQDMKw.mjs.map +0 -1
- package/dist/settings-B3ZmPF_8.mjs +0 -73
- package/dist/settings-B3ZmPF_8.mjs.map +0 -1
- package/dist/settings-P5hwPX6_.mjs +0 -66
- package/dist/settings-P5hwPX6_.mjs.map +0 -1
- package/dist/settings-yIqoN-Ok.mjs +0 -519
- package/dist/settings-yIqoN-Ok.mjs.map +0 -1
- package/dist/setup-complete-eu6MUQnt.mjs +0 -65
- package/dist/setup-complete-eu6MUQnt.mjs.map +0 -1
- package/dist/setup-nonce-CyPOapqY.mjs +0 -25
- package/dist/setup-nonce-CyPOapqY.mjs.map +0 -1
- package/dist/single-flight-cache-D0EaGbN1.mjs +0 -104
- package/dist/single-flight-cache-D0EaGbN1.mjs.map +0 -1
- package/dist/site-domain-8lEJl_0U.mjs +0 -131
- package/dist/site-domain-8lEJl_0U.mjs.map +0 -1
- package/dist/site-settings-uPkW0e6o.mjs +0 -50
- package/dist/site-settings-uPkW0e6o.mjs.map +0 -1
- package/dist/site-url-25SGVXwL.mjs +0 -45
- package/dist/site-url-25SGVXwL.mjs.map +0 -1
- package/dist/sitemap-name-DTK7CYnY.mjs +0 -26
- package/dist/sitemap-name-DTK7CYnY.mjs.map +0 -1
- package/dist/slug-BEDl2IJY.mjs +0 -16
- package/dist/slug-BEDl2IJY.mjs.map +0 -1
- package/dist/slugify-BDEG9pLk.mjs +0 -22
- package/dist/slugify-BDEG9pLk.mjs.map +0 -1
- package/dist/snapshot-CvkIBRLY.mjs +0 -414
- package/dist/snapshot-CvkIBRLY.mjs.map +0 -1
- package/dist/ssrf-BBXcxG-f.mjs +0 -1
- package/dist/ssrf-mcCKMH6B.mjs +0 -406
- package/dist/ssrf-mcCKMH6B.mjs.map +0 -1
- package/dist/stage-BQfGzGOy.mjs +0 -662
- package/dist/stage-BQfGzGOy.mjs.map +0 -1
- package/dist/staged-B5vQGeSf.mjs +0 -686
- package/dist/staged-B5vQGeSf.mjs.map +0 -1
- package/dist/state-dO6t6OxV.mjs +0 -178
- package/dist/state-dO6t6OxV.mjs.map +0 -1
- package/dist/status-DSURZwKS.mjs +0 -30
- package/dist/status-DSURZwKS.mjs.map +0 -1
- package/dist/storage-query-Cy0SZ8iG.d.mts +0 -1619
- package/dist/storage-query-Cy0SZ8iG.d.mts.map +0 -1
- package/dist/tar-DWzcUZ_Q.mjs +0 -449
- package/dist/tar-DWzcUZ_Q.mjs.map +0 -1
- package/dist/target-C9htUbrT.mjs +0 -27
- package/dist/target-C9htUbrT.mjs.map +0 -1
- package/dist/taxonomies-By2aGvq2.mjs +0 -729
- package/dist/taxonomies-By2aGvq2.mjs.map +0 -1
- package/dist/taxonomies-CVRd_jz0.mjs +0 -937
- package/dist/taxonomies-CVRd_jz0.mjs.map +0 -1
- package/dist/taxonomy-BG_xu2Qf.mjs +0 -563
- package/dist/taxonomy-BG_xu2Qf.mjs.map +0 -1
- package/dist/tokens-U5vzgSrM.mjs +0 -171
- package/dist/tokens-U5vzgSrM.mjs.map +0 -1
- package/dist/transaction-CkoQ5wqQ.mjs +0 -29
- package/dist/transaction-CkoQ5wqQ.mjs.map +0 -1
- package/dist/transfer-DA0OSfaT.mjs +0 -8873
- package/dist/transfer-DA0OSfaT.mjs.map +0 -1
- package/dist/transfer-Pyf3d7ka.mjs +0 -166
- package/dist/transfer-Pyf3d7ka.mjs.map +0 -1
- package/dist/transfer-download-cX7SuWEy.mjs +0 -33
- package/dist/transfer-download-cX7SuWEy.mjs.map +0 -1
- package/dist/transformations-DczubD4j.mjs +0 -196
- package/dist/transformations-DczubD4j.mjs.map +0 -1
- package/dist/transport-Dm5QzpT_.d.mts +0 -42
- package/dist/transport-Dm5QzpT_.d.mts.map +0 -1
- package/dist/transport-DtIrjEFO.mjs +0 -137
- package/dist/transport-DtIrjEFO.mjs.map +0 -1
- package/dist/trusted-proxy-CDRd5Kmw.mjs +0 -51
- package/dist/trusted-proxy-CDRd5Kmw.mjs.map +0 -1
- package/dist/turnstile-Ct5YuFNY.mjs +0 -58
- package/dist/turnstile-Ct5YuFNY.mjs.map +0 -1
- package/dist/types-Bgujop4S.d.mts +0 -374
- package/dist/types-Bgujop4S.d.mts.map +0 -1
- package/dist/types-BirHUEXt.mjs +0 -18
- package/dist/types-BirHUEXt.mjs.map +0 -1
- package/dist/types-BqJgTL_y.d.mts +0 -293
- package/dist/types-BqJgTL_y.d.mts.map +0 -1
- package/dist/types-C-lrOt9T.d.mts +0 -87
- package/dist/types-C-lrOt9T.d.mts.map +0 -1
- package/dist/types-CCEHAhOv.d.mts +0 -916
- package/dist/types-CCEHAhOv.d.mts.map +0 -1
- package/dist/types-CLVwYRBr.d.mts +0 -227
- package/dist/types-CLVwYRBr.d.mts.map +0 -1
- package/dist/types-C_asjp1J.mjs +0 -201
- package/dist/types-C_asjp1J.mjs.map +0 -1
- package/dist/types-CadaL_k8.d.mts +0 -366
- package/dist/types-CadaL_k8.d.mts.map +0 -1
- package/dist/types-DVbTb4Hk.mjs +0 -77
- package/dist/types-DVbTb4Hk.mjs.map +0 -1
- package/dist/types-Ddku19Zw.d.mts +0 -209
- package/dist/types-Ddku19Zw.d.mts.map +0 -1
- package/dist/types-DwhEvIVb.mjs +0 -133
- package/dist/types-DwhEvIVb.mjs.map +0 -1
- package/dist/types-FIiGQ3PE.mjs +0 -16
- package/dist/types-FIiGQ3PE.mjs.map +0 -1
- package/dist/types-OauzCOY0.mjs +0 -37
- package/dist/types-OauzCOY0.mjs.map +0 -1
- package/dist/types-mQGTpP-4.d.mts +0 -1741
- package/dist/types-mQGTpP-4.d.mts.map +0 -1
- package/dist/types-nbjz3Mgm.d.mts +0 -125
- package/dist/types-nbjz3Mgm.d.mts.map +0 -1
- package/dist/update-check-hW32-0pf.mjs +0 -161
- package/dist/update-check-hW32-0pf.mjs.map +0 -1
- package/dist/upload-attempts-Bpik1TLF.mjs +0 -32
- package/dist/upload-attempts-Bpik1TLF.mjs.map +0 -1
- package/dist/url-DTfGDJhI.mjs +0 -104
- package/dist/url-DTfGDJhI.mjs.map +0 -1
- package/dist/url-pattern-CJeCyNij.mjs +0 -41
- package/dist/url-pattern-CJeCyNij.mjs.map +0 -1
- package/dist/user-nQInBZbE.mjs +0 -171
- package/dist/user-nQInBZbE.mjs.map +0 -1
- package/dist/utils-govudc_U.mjs +0 -442
- package/dist/utils-govudc_U.mjs.map +0 -1
- package/dist/validate-BxLvcDYh.mjs +0 -524
- package/dist/validate-BxLvcDYh.mjs.map +0 -1
- package/dist/validate-mnoVfASU.d.mts +0 -468
- package/dist/validate-mnoVfASU.d.mts.map +0 -1
- package/dist/validation-DQDEvh87.mjs +0 -221
- package/dist/validation-DQDEvh87.mjs.map +0 -1
- package/dist/version-BOFfLiVT.mjs +0 -49
- package/dist/version-BOFfLiVT.mjs.map +0 -1
- package/dist/version-Dcvx_C9g.mjs +0 -7
- package/dist/version-Dcvx_C9g.mjs.map +0 -1
- package/dist/version-DzTJ3gD7.mjs +0 -9
- package/dist/version-DzTJ3gD7.mjs.map +0 -1
- package/dist/video-BX7AI5nJ.mjs +0 -54
- package/dist/video-BX7AI5nJ.mjs.map +0 -1
- package/dist/virtual-modules-CU29aip9.mjs +0 -515
- package/dist/virtual-modules-CU29aip9.mjs.map +0 -1
- package/dist/widgets-HIeFmZxt.mjs +0 -121
- package/dist/widgets-HIeFmZxt.mjs.map +0 -1
- package/dist/wxr-taxonomies-Dy2i2ON3.d.mts +0 -34
- package/dist/wxr-taxonomies-Dy2i2ON3.d.mts.map +0 -1
- package/dist/wxr-taxonomies-DyOGhl8W.mjs +0 -454
- package/dist/wxr-taxonomies-DyOGhl8W.mjs.map +0 -1
- package/dist/zod-generator-VxCPVDpo.mjs +0 -425
- package/dist/zod-generator-VxCPVDpo.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,129 +1,2119 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as getMigrationStatus, s as getExactMigrationStatus, t as MIGRATION_NAMES } from "./runner-4BfB04Rg.mjs";
|
|
2
2
|
import { t as EmDashDatabaseError } from "./errors-9P_FDrJ_.mjs";
|
|
3
|
-
import "./dialect-helpers-7_IqPdh9.mjs";
|
|
4
3
|
import { n as getFallbackChain, r as getI18nConfig, s as isI18nEnabled, u as resolveContentCreateLocale } from "./config-Cs_AwWXI.mjs";
|
|
5
|
-
import "./
|
|
6
|
-
import { A as file, C as definePlugin, D as portableTextIdentityExtensions, E as prosemirrorToPortableText, M as EmDashConfigurationError, O as portableText, T as portableTextToProsemirror, _ as isContentSaveRejection, a as getComments, b as createHookPipeline, c as inspectSandboxHookResult, d as createNoopSandboxRunner, f as NodeCronScheduler, g as ContentSaveRejectedError, i as getCommentCount, j as image, k as reference, l as NoopSandboxRunner, m as createPluginManager, n as getMenuWithCacheHint, o as MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH, p as PluginManager, r as getMenus, s as SANDBOX_HOOK_RESULT_VERSION, t as getMenu, u as SandboxNotAvailableError, w as definePluginRoute, y as HookPipeline } from "./menus-fvGFd4m6.mjs";
|
|
7
|
-
import { t as after } from "./after-PcEvMY_6.mjs";
|
|
4
|
+
import { i as EmDashConfigurationError, n as getMenuWithCacheHint, r as getMenus, t as getMenu } from "./menus-CpFAi_LK.mjs";
|
|
8
5
|
import { getRequestContext, runWithContext } from "./request-context.mjs";
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import "./
|
|
12
|
-
import { t as ContentRepository } from "./content-
|
|
13
|
-
import "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import "./
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import "./
|
|
26
|
-
import {
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
29
|
-
import "./
|
|
30
|
-
import "./
|
|
31
|
-
import "./
|
|
32
|
-
import "./
|
|
33
|
-
import "./
|
|
34
|
-
import { n as
|
|
35
|
-
import "./
|
|
36
|
-
import {
|
|
37
|
-
import "./
|
|
38
|
-
import "./
|
|
39
|
-
import { i as
|
|
40
|
-
import "./
|
|
41
|
-
import "./cache-BWzswWB-.mjs";
|
|
42
|
-
import "./artifacts-DwOYYBQm.mjs";
|
|
43
|
-
import { t as SEARCH_TOKENIZERS } from "./types-BirHUEXt.mjs";
|
|
44
|
-
import { t as FTSManager } from "./fts-manager-BzFo0xx6.mjs";
|
|
45
|
-
import "./loader-D4w4XE7q.mjs";
|
|
46
|
-
import "./json-recordset-BjYIWFkV.mjs";
|
|
47
|
-
import "./collection-slugs-cache-B2J5aESO.mjs";
|
|
48
|
-
import { a as getTaxonomyDefs, c as getTerm, d as invalidateTermCache, i as getTaxonomyDef, l as getTermsForEntries, n as getEntriesByTerm, o as getTaxonomyTerms, r as getEntryTerms, s as getTaxonomyTermsWithCacheHint, t as getAllTermsForEntries } from "./taxonomies-By2aGvq2.mjs";
|
|
49
|
-
import { A as handleContentDelete, B as handleContentSchedule, C as generateManifest, D as handleContentCountScheduled, E as handleContentCompare, F as handleContentList, G as handleScheduledPolicyRejection, H as handleContentUnpublish, I as handleContentListTrashed, L as handleContentPermanentDelete, M as handleContentDuplicate, N as handleContentGet, O as handleContentCountTrashed, P as handleContentGetIncludingTrashed, R as handleContentPublish, T as handleContentAuthors, U as handleContentUnschedule, V as handleContentTranslations, W as handleContentUpdate, b as handleRevisionList, j as handleContentDiscardDraft, k as handleContentCreate, x as handleRevisionRestore, y as handleRevisionGet, z as handleContentRestore } from "./api-C_LxFnOm.mjs";
|
|
50
|
-
import "./media-usage-work-L8-Au4j-.mjs";
|
|
51
|
-
import "./capture-triggers-D7g3fOZj.mjs";
|
|
52
|
-
import "./activation-sGF9br3X.mjs";
|
|
53
|
-
import { L as BlockTypeRegistry, n as SchemaRegistry, t as SchemaError } from "./registry-DymfZkAN.mjs";
|
|
54
|
-
import { n as computeContentHash, r as hashString } from "./hash-A-o2ZX8O.mjs";
|
|
55
|
-
import "./zod-generator-VxCPVDpo.mjs";
|
|
56
|
-
import "./errors-DlJwot7q.mjs";
|
|
57
|
-
import "./canonical-DjF_z6GI.mjs";
|
|
58
|
-
import "./digest-DlBa7kJl.mjs";
|
|
59
|
-
import { a as resolveBlockTypes, i as normalizeBlocksData, n as expandCollectionBlockFields } from "./block-values-CgbMtSGU.mjs";
|
|
60
|
-
import { t as getCollectionInfo } from "./query-DuwyFr5Z.mjs";
|
|
61
|
-
import "./schema-Bss8qImF.mjs";
|
|
62
|
-
import "./relations-DrEs3Sc1.mjs";
|
|
63
|
-
import "./dashboard-DVxQ5XiI.mjs";
|
|
64
|
-
import "./config-BdQzFtmR.mjs";
|
|
65
|
-
import "./errors-BMaCpLeS.mjs";
|
|
66
|
-
import "./update-check-hW32-0pf.mjs";
|
|
67
|
-
import { a as handleMediaRegisterUpload, i as handleMediaList, n as handleMediaDelete, o as handleMediaReplaceMetadata, r as handleMediaGet, s as handleMediaUpdate, t as handleMediaCreate } from "./media-BL9MRrSG.mjs";
|
|
68
|
-
import "./media-folders-CNs_A_B-.mjs";
|
|
69
|
-
import "./content-repair-CjwbLy4m.mjs";
|
|
70
|
-
import "./settings-B3ZmPF_8.mjs";
|
|
71
|
-
import "./site-settings-uPkW0e6o.mjs";
|
|
72
|
-
import { i as handleMediaUsageRepair, n as handleMediaUsageProgress } from "./media-usage-ClWgrX0d.mjs";
|
|
73
|
-
import { t as handleMediaUsageActivationAdvance } from "./media-usage-activation-B8Fjtq0h.mjs";
|
|
74
|
-
import "./media-usage-work-LXgze5j9.mjs";
|
|
75
|
-
import "./schema-C036pqEw.mjs";
|
|
76
|
-
import "./block-types-C3gJEe7l.mjs";
|
|
77
|
-
import "./seo-BodxIpws.mjs";
|
|
6
|
+
import { t as after } from "./after-B3AvMfBQ.mjs";
|
|
7
|
+
import { t as OptionsRepository } from "./options-CMocxAku.mjs";
|
|
8
|
+
import { a as resolvePluginEncryptionKeys } from "./secrets-C4UrjPiG.mjs";
|
|
9
|
+
import { t as ContentRepository } from "./content-Dxztag5t.mjs";
|
|
10
|
+
import { _ as invalidateWidgetObjectCache, d as invalidateCollectionCache, f as invalidateCommentObjectCache, g as invalidateTaxonomyObjectCache, h as invalidateSchemaObjectCache, m as invalidateObjectCache, n as cachedQuery, o as contentNamespace, p as invalidateMenuObjectCache, s as contentNamespaces, t as CacheNamespace, u as invalidateBylineObjectCache } from "./object-cache-DeATK4vw.mjs";
|
|
11
|
+
import { d as RESERVED_FIELD_SLUGS, r as FIELD_TYPE_TO_COLUMN, u as RESERVED_COLLECTION_SLUGS } from "./types-BmBK2cqf.mjs";
|
|
12
|
+
import { n as slugify, t as decodeSlug } from "./slugify-sxuydlHd.mjs";
|
|
13
|
+
import { i as sanitizeHref, t as isSafeHref } from "./url-BVdd-tah.mjs";
|
|
14
|
+
import { a as InvalidCursorError, i as EmDashValidationError } from "./types-BBH-w_KS.mjs";
|
|
15
|
+
import { t as RevisionRepository } from "./revision-D7EedSdU.mjs";
|
|
16
|
+
import { t as MediaRepository } from "./media-DJaAAYI2.mjs";
|
|
17
|
+
import { t as UserRepository } from "./user-C4km6fox.mjs";
|
|
18
|
+
import { t as CommentRepository } from "./comment-BGeXmJ8F.mjs";
|
|
19
|
+
import { C as createBylineAccess, D as StorageSerializationError, E as PluginStorageRepository, S as createContentAccess, _ as MAX_PLUGIN_MEDIA_READ_BYTES, a as createHttpAccess, b as toPluginMediaItem, c as createRedirectAccess, g as DEFAULT_PLUGIN_MEDIA_READ_BYTES, i as createContentAccessWithWrite, l as createSchemaAccess, m as PluginRouteError, n as RedirectAccessError, p as createUnrestrictedHttpAccess, r as createCommentAccess, s as createMediaAccess, v as parsePluginMediaMetadataPatch, x as updatePluginMediaMetadata, y as readPluginMediaBytes } from "./context-C3OZjexd.mjs";
|
|
20
|
+
import { n as normalizeMediaValue } from "./normalize-qcU0SKGf.mjs";
|
|
21
|
+
import "./dist-kxThYgdL.mjs";
|
|
22
|
+
import { n as generatePlaceholder } from "./enrich-BReo_COC.mjs";
|
|
23
|
+
import { i as scheduledPolicyRejectionKey, r as isScheduledPolicyRejection, t as SCHEDULED_POLICY_REJECTION_PREFIX } from "./content-policy-Drm9sqdA.mjs";
|
|
24
|
+
import { t as SearchUnavailableError } from "./errors-BYdjOimY.mjs";
|
|
25
|
+
import { t as SEARCH_TOKENIZERS } from "./types-CpFfDrGH.mjs";
|
|
26
|
+
import { t as FTSManager } from "./fts-manager-B3iLXCGz.mjs";
|
|
27
|
+
import { d as getDb } from "./loader-CSEfTKzr.mjs";
|
|
28
|
+
import { a as getTaxonomyDefs, c as getTerm, d as invalidateTermCache, i as getTaxonomyDef, l as getTermsForEntries, n as getEntriesByTerm, o as getTaxonomyTerms, r as getEntryTerms, s as getTaxonomyTermsWithCacheHint, t as getAllTermsForEntries } from "./taxonomies-BMuFLd53.mjs";
|
|
29
|
+
import { R as BlockTypeRegistry, n as SchemaRegistry, t as SchemaError } from "./registry-CDzYrAFY.mjs";
|
|
30
|
+
import { n as computeContentHash, r as hashString } from "./hash-SY9Nq5FH.mjs";
|
|
31
|
+
import { n as videoBlockFields, r as videoNodeAttrs, t as isPortableTextVideoBlock } from "./video-My3h7vwE.mjs";
|
|
32
|
+
import { a as resolveBlockTypes, i as normalizeBlocksData, n as expandCollectionBlockFields } from "./block-values-DzZIh7WN.mjs";
|
|
33
|
+
import { t as getCollectionInfo } from "./query-C1K9PzUc.mjs";
|
|
34
|
+
import { A as handleContentGetIncludingTrashed, B as handleContentUpdate, C as handleContentCountScheduled, D as handleContentDiscardDraft, E as handleContentDelete, F as handleContentRestore, I as handleContentSchedule, L as handleContentTranslations, M as handleContentListTrashed, N as handleContentPermanentDelete, O as handleContentDuplicate, P as handleContentPublish, R as handleContentUnpublish, S as handleContentCompare, T as handleContentCreate, V as handleScheduledPolicyRejection, _ as handleRevisionRestore, a as isContentSaveRejection, d as resolveExclusiveHooks, f as definePlugin, g as handleRevisionList, h as handleRevisionGet, i as ContentSaveRejectedError, j as handleContentList, k as handleContentGet, l as createHookPipeline, n as SANDBOX_HOOK_RESULT_VERSION, p as definePluginRoute, r as inspectSandboxHookResult, s as HookPipeline, t as MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH, w as handleContentCountTrashed, x as handleContentAuthors, y as generateManifest, z as handleContentUnschedule } from "./hook-result-CO4E3zDv.mjs";
|
|
35
|
+
import { a as handleMediaRegisterUpload, i as handleMediaList, n as handleMediaDelete, o as handleMediaReplaceMetadata, r as handleMediaGet, s as handleMediaUpdate, t as handleMediaCreate } from "./media-Cid3xIHk.mjs";
|
|
36
|
+
import { i as handleMediaUsageRepair, n as handleMediaUsageProgress } from "./media-usage-SwtWPxy4.mjs";
|
|
37
|
+
import { t as handleMediaUsageActivationAdvance } from "./media-usage-activation-BTa1H4wE.mjs";
|
|
78
38
|
import { createPluginSecretRedactor } from "./plugins/secret-redactor.mjs";
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import "./
|
|
82
|
-
import "./
|
|
83
|
-
import "./
|
|
84
|
-
import "./
|
|
85
|
-
import {
|
|
86
|
-
import "./
|
|
87
|
-
import { a as
|
|
88
|
-
import {
|
|
89
|
-
import { t as EmDashStorageError } from "./types-FIiGQ3PE.mjs";
|
|
90
|
-
import "./artifact-fetch-CgvvpoWQ.mjs";
|
|
91
|
-
import "./ssrf-mcCKMH6B.mjs";
|
|
92
|
-
import "./authoritative-records-LPtrIGOY.mjs";
|
|
93
|
-
import "./parse-2W-E2f7w.mjs";
|
|
94
|
-
import "./redirects-BA_TvtuH.mjs";
|
|
95
|
-
import "./entry-lock-DDuWaAiP.mjs";
|
|
96
|
-
import "./media-qTTHVkls.mjs";
|
|
97
|
-
import "./comments-DVjWJm8X.mjs";
|
|
98
|
-
import "./byline-fields-B1qHvRps.mjs";
|
|
99
|
-
import "./menus-BI6oBXco.mjs";
|
|
100
|
-
import "./status-DSURZwKS.mjs";
|
|
101
|
-
import { t as applySeed } from "./apply-CLjfxvyH.mjs";
|
|
102
|
-
import { a as getTranslations, c as resolveEmDashPath, i as getEmDashReferences, l as createEditable, n as getEmDashCollection, r as getEmDashEntry, t as getEditMeta, u as createNoop } from "./query-eR_Nz70M.mjs";
|
|
103
|
-
import { C as parseWxr, _ as registerSource, c as parseWxrDate, d as clearSources, f as getAllSources, g as probeUrl, h as getUrlSources, l as wxrSource, m as getSource, p as getFileSources, s as wordpressRestSource, w as parseWxrString, x as importReusableBlocksAsSections } from "./import-B4UvHNJz.mjs";
|
|
39
|
+
import { n as createSettingsAccess, o as encryptPluginSetting, r as decodePluginSettingValue, s as isEncryptedPluginSetting, t as PluginSettingEncryptionError } from "./settings-y8Jx8b7g.mjs";
|
|
40
|
+
import { i as getSections, t as getSection } from "./sections-Bfa0oF8Q.mjs";
|
|
41
|
+
import { a as getSiteSettings, d as setSiteSettings, n as getPluginSettings, o as getSiteSettingsWithCacheHint, r as getSiteSetting, t as getPluginSetting } from "./settings-BTkGl-bX.mjs";
|
|
42
|
+
import { a as pluginManifestSchema } from "./manifest-schema-BRpk5V7x.mjs";
|
|
43
|
+
import { a as getSandboxRouteErrorEnvelope, i as getSandboxRouteErrorDetails, n as createSandboxRouteError, r as createSandboxRouteErrorEnvelope, t as SandboxUnavailableError } from "./types-Df0R58Wu.mjs";
|
|
44
|
+
import { a as normalizePluginCapabilities, i as normalizeCapability, n as isDeprecatedCapability, r as normalizeCapabilities, t as CAPABILITY_RENAMES } from "./types-Ba3bWb9D.mjs";
|
|
45
|
+
import { t as EmDashStorageError } from "./types-C0M6z2A4.mjs";
|
|
46
|
+
import { a as sanitizeGalleryImages, i as resolveImageMedia, t as applySeed } from "./apply-Culv7QJl.mjs";
|
|
47
|
+
import { a as getTranslations, c as resolveEmDashPath, i as getEmDashReferences, l as createEditable, n as getEmDashCollection, r as getEmDashEntry, t as getEditMeta, u as createNoop } from "./query-DdmHrvie.mjs";
|
|
48
|
+
import { i as parseWxrString, n as wxrSource, r as parseWxr, t as parseWxrDate } from "./wxr-DDPJOgkM.mjs";
|
|
104
49
|
import { pluginResponse } from "./plugin-types.mjs";
|
|
105
|
-
import "./json-schema-Cde7le0s.mjs";
|
|
106
50
|
import { adaptSandboxEntry } from "./plugins/adapt-sandbox-entry.mjs";
|
|
107
|
-
import "./
|
|
108
|
-
import "./ssrf-BBXcxG-f.mjs";
|
|
109
|
-
import "./credits-BRyjafiF.mjs";
|
|
110
|
-
import { t as CronAccessImpl } from "./cron-Bm5xa7tv.mjs";
|
|
51
|
+
import { r as setCronTasksEnabled, t as CronAccessImpl } from "./cron-CrjBjDuy.mjs";
|
|
111
52
|
import { PLUGIN_HTTP_MAX_REQUEST_BYTES, PLUGIN_HTTP_MAX_RESPONSE_BYTES, bufferPluginHttpRequest, pluginHttpRedirectAction, pluginHttpResponseFromWire, pluginHttpResponseToWire, readPluginHttpBytes, rewritePluginHttpRedirect } from "./plugins/http-wire.mjs";
|
|
112
|
-
import "./
|
|
113
|
-
import "./
|
|
114
|
-
import "./
|
|
115
|
-
import "./
|
|
116
|
-
import {
|
|
117
|
-
import { i as getPreviewUrl, n as isPreviewRequest, r as buildPreviewUrl, t as getPreviewToken } from "./preview-DFwL5APO.mjs";
|
|
118
|
-
import { t as getHreflangAlternates } from "./hreflang-BpUK9Lcu.mjs";
|
|
53
|
+
import { t as PluginRouteRegistry } from "./routes-QcHRiebw.mjs";
|
|
54
|
+
import { a as getSource, c as registerSource, i as getFileSources, l as wordpressRestSource, n as clearSources, o as getUrlSources, r as getAllSources, s as probeUrl } from "./registry-mZi_lxtT.mjs";
|
|
55
|
+
import { n as parseContentId, r as verifyPreviewToken, t as generatePreviewToken } from "./tokens-Cpm6FIKJ.mjs";
|
|
56
|
+
import { n as getPreviewUrl, t as buildPreviewUrl } from "./urls-Cq_hUk4P.mjs";
|
|
57
|
+
import { t as getHreflangAlternates } from "./hreflang-Bzvlo9Ci.mjs";
|
|
119
58
|
import { getContentSeo, getSeoMeta } from "./seo/index.mjs";
|
|
120
|
-
import "./comment-reaction-
|
|
121
|
-
import { i as getEntriesByByline, n as getByline, r as getBylineBySlug } from "./bylines-
|
|
122
|
-
import { i as getWidgetComponents, n as getWidgetAreaWithCacheHint, r as getWidgetAreas, t as getWidgetArea } from "./widgets-
|
|
123
|
-
import { n as validateSeed } from "./validate-
|
|
124
|
-
import "./
|
|
125
|
-
import "
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
|
|
129
|
-
|
|
59
|
+
import { t as CommentReactionRepository } from "./comment-reaction-ty-JEDYR.mjs";
|
|
60
|
+
import { i as getEntriesByByline, n as getByline, r as getBylineBySlug } from "./bylines-txlwgzIK.mjs";
|
|
61
|
+
import { i as getWidgetComponents, n as getWidgetAreaWithCacheHint, r as getWidgetAreas, t as getWidgetArea } from "./widgets-DAdni19y.mjs";
|
|
62
|
+
import { n as validateSeed } from "./validate-BNupiQtz.mjs";
|
|
63
|
+
import { a as getSuggestions, c as searchWithDb, i as getSearchStats, n as extractPlainText, o as search, r as extractSearchableFields, s as searchCollection } from "./search-B9RFgr0N.mjs";
|
|
64
|
+
import { sql } from "kysely";
|
|
65
|
+
import { ulid, ulid as ulid$1 } from "ulidx";
|
|
66
|
+
import { z } from "astro/zod";
|
|
67
|
+
import { htmlBlockFields } from "@emdash-cms/admin/html-block";
|
|
68
|
+
import { UnsafePortableTextTableError, portableTextTableToProseMirror, proseMirrorTableToPortableText } from "@emdash-cms/admin/portable-text-table";
|
|
69
|
+
import { Extension, Mark, Node } from "@tiptap/core";
|
|
70
|
+
import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
|
|
71
|
+
|
|
72
|
+
//#region src/fields/image.ts
|
|
73
|
+
const mediaSchema = z.object({
|
|
74
|
+
id: z.string(),
|
|
75
|
+
src: z.string().optional(),
|
|
76
|
+
alt: z.string().optional(),
|
|
77
|
+
caption: z.string().optional(),
|
|
78
|
+
width: z.number().optional(),
|
|
79
|
+
height: z.number().optional(),
|
|
80
|
+
filename: z.string().optional(),
|
|
81
|
+
mimeType: z.string().optional(),
|
|
82
|
+
blurhash: z.string().optional(),
|
|
83
|
+
dominantColor: z.string().optional(),
|
|
84
|
+
focalX: z.number().optional(),
|
|
85
|
+
focalY: z.number().optional(),
|
|
86
|
+
provider: z.string().optional(),
|
|
87
|
+
previewUrl: z.string().optional(),
|
|
88
|
+
meta: z.record(z.string(), z.unknown()).optional()
|
|
89
|
+
});
|
|
90
|
+
const imageSchema = mediaSchema.extend({ darkVariant: mediaSchema.optional() });
|
|
91
|
+
function image(options = {}) {
|
|
92
|
+
const validation = options.allowedTypes && options.allowedTypes.length > 0 ? { allowedMimeTypes: [...options.allowedTypes] } : void 0;
|
|
93
|
+
return {
|
|
94
|
+
type: "image",
|
|
95
|
+
columnType: "TEXT",
|
|
96
|
+
schema: options.required === false ? imageSchema.optional() : imageSchema,
|
|
97
|
+
options,
|
|
98
|
+
ui: { widget: "image" },
|
|
99
|
+
validation
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/fields/file.ts
|
|
105
|
+
function file(options = {}) {
|
|
106
|
+
const fileObjSchema = z.object({
|
|
107
|
+
id: z.string(),
|
|
108
|
+
url: z.string().optional(),
|
|
109
|
+
src: z.string().optional(),
|
|
110
|
+
filename: z.string().optional(),
|
|
111
|
+
mimeType: z.string().optional(),
|
|
112
|
+
size: z.number().optional(),
|
|
113
|
+
provider: z.string().optional(),
|
|
114
|
+
meta: z.record(z.string(), z.unknown()).optional()
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
type: "file",
|
|
118
|
+
columnType: "TEXT",
|
|
119
|
+
schema: options.required ? fileObjSchema : fileObjSchema.optional(),
|
|
120
|
+
options,
|
|
121
|
+
ui: {
|
|
122
|
+
widget: "file",
|
|
123
|
+
helpText: options.helpText,
|
|
124
|
+
maxSize: options.maxSize
|
|
125
|
+
},
|
|
126
|
+
validation: options.allowedTypes && options.allowedTypes.length > 0 ? { allowedMimeTypes: [...options.allowedTypes] } : void 0
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/fields/reference.ts
|
|
132
|
+
/**
|
|
133
|
+
* Reference field
|
|
134
|
+
* References another content item by ID
|
|
135
|
+
*/
|
|
136
|
+
function reference(collection, options) {
|
|
137
|
+
const schema = z.string();
|
|
138
|
+
return {
|
|
139
|
+
type: "reference",
|
|
140
|
+
columnType: "TEXT",
|
|
141
|
+
schema: options?.required === false ? schema.optional() : schema,
|
|
142
|
+
options: {
|
|
143
|
+
...options,
|
|
144
|
+
collection
|
|
145
|
+
},
|
|
146
|
+
ui: { widget: "reference" }
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/fields/portable-text.ts
|
|
152
|
+
/**
|
|
153
|
+
* Portable Text block schema
|
|
154
|
+
*/
|
|
155
|
+
const portableTextBlockSchema = z.object({
|
|
156
|
+
_type: z.string(),
|
|
157
|
+
_key: z.string()
|
|
158
|
+
}).loose();
|
|
159
|
+
/**
|
|
160
|
+
* Portable Text field
|
|
161
|
+
* Stores structured content in Portable Text format
|
|
162
|
+
*/
|
|
163
|
+
function portableText(options) {
|
|
164
|
+
const schema = z.array(portableTextBlockSchema);
|
|
165
|
+
return {
|
|
166
|
+
type: "portableText",
|
|
167
|
+
columnType: "JSON",
|
|
168
|
+
schema: options?.required === false ? schema.optional() : schema,
|
|
169
|
+
options,
|
|
170
|
+
ui: { widget: "portableText" }
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/content/converters/mark-safety.ts
|
|
176
|
+
const SUPPORTED_PORTABLE_TEXT_DECORATORS = new Set([
|
|
177
|
+
"strong",
|
|
178
|
+
"em",
|
|
179
|
+
"underline",
|
|
180
|
+
"strike-through",
|
|
181
|
+
"subscript",
|
|
182
|
+
"superscript",
|
|
183
|
+
"code"
|
|
184
|
+
]);
|
|
185
|
+
const SUPPORTED_PROSEMIRROR_MARKS = new Set([
|
|
186
|
+
"bold",
|
|
187
|
+
"strong",
|
|
188
|
+
"italic",
|
|
189
|
+
"em",
|
|
190
|
+
"underline",
|
|
191
|
+
"strike",
|
|
192
|
+
"strikethrough",
|
|
193
|
+
"subscript",
|
|
194
|
+
"superscript",
|
|
195
|
+
"code",
|
|
196
|
+
"link",
|
|
197
|
+
"emdashPortableTextSpan"
|
|
198
|
+
]);
|
|
199
|
+
function isRecord$1(value) {
|
|
200
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
201
|
+
}
|
|
202
|
+
function collectPortableTextMarks(value, inheritedMarkDefs, unsupported) {
|
|
203
|
+
if (Array.isArray(value)) {
|
|
204
|
+
for (const item of value) collectPortableTextMarks(item, inheritedMarkDefs, unsupported);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (!isRecord$1(value)) return;
|
|
208
|
+
let markDefs = inheritedMarkDefs;
|
|
209
|
+
if (Array.isArray(value.markDefs)) {
|
|
210
|
+
const localMarkDefs = new Map(inheritedMarkDefs);
|
|
211
|
+
for (const markDef of value.markDefs) if (isRecord$1(markDef) && typeof markDef._key === "string") localMarkDefs.set(markDef._key, markDef);
|
|
212
|
+
markDefs = localMarkDefs;
|
|
213
|
+
}
|
|
214
|
+
if (value._type === "span" && Array.isArray(value.marks)) for (const mark of value.marks) {
|
|
215
|
+
if (typeof mark !== "string" || SUPPORTED_PORTABLE_TEXT_DECORATORS.has(mark)) continue;
|
|
216
|
+
const markDef = markDefs.get(mark);
|
|
217
|
+
if (markDef?._type === "link") continue;
|
|
218
|
+
unsupported.add(typeof markDef?._type === "string" ? markDef._type : mark);
|
|
219
|
+
}
|
|
220
|
+
for (const [key, child] of Object.entries(value)) if (key !== "markDefs") collectPortableTextMarks(child, markDefs, unsupported);
|
|
221
|
+
}
|
|
222
|
+
function collectProseMirrorMarks(node, unsupported) {
|
|
223
|
+
for (const mark of node.marks ?? []) if (!SUPPORTED_PROSEMIRROR_MARKS.has(mark.type)) unsupported.add(mark.type);
|
|
224
|
+
for (const child of node.content ?? []) collectProseMirrorMarks(child, unsupported);
|
|
225
|
+
}
|
|
226
|
+
var UnsupportedPortableTextMarksError = class extends Error {
|
|
227
|
+
marks;
|
|
228
|
+
constructor(marks) {
|
|
229
|
+
const sortedMarks = [...new Set(marks)].toSorted();
|
|
230
|
+
super(`Unsupported Portable Text marks: ${sortedMarks.join(", ")}`);
|
|
231
|
+
this.name = "UnsupportedPortableTextMarksError";
|
|
232
|
+
this.marks = sortedMarks;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function findUnsupportedPortableTextMarks(blocks) {
|
|
236
|
+
const unsupported = /* @__PURE__ */ new Set();
|
|
237
|
+
for (const block of blocks) if (block._type === "block" || block._type === "table") collectPortableTextMarks(block, /* @__PURE__ */ new Map(), unsupported);
|
|
238
|
+
return [...unsupported].toSorted();
|
|
239
|
+
}
|
|
240
|
+
function assertPortableTextMarksSupported(blocks) {
|
|
241
|
+
const unsupported = findUnsupportedPortableTextMarks(blocks);
|
|
242
|
+
if (unsupported.length > 0) throw new UnsupportedPortableTextMarksError(unsupported);
|
|
243
|
+
}
|
|
244
|
+
function assertProseMirrorMarksSupported(document) {
|
|
245
|
+
const unsupported = /* @__PURE__ */ new Set();
|
|
246
|
+
for (const node of document.content) collectProseMirrorMarks(node, unsupported);
|
|
247
|
+
if (unsupported.size > 0) throw new UnsupportedPortableTextMarksError(unsupported);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/content/converters/numbered-list.ts
|
|
252
|
+
const MAX_ORDERED_LIST_START = 2147483647;
|
|
253
|
+
function normalizeListId(value) {
|
|
254
|
+
if (typeof value !== "string") return void 0;
|
|
255
|
+
const normalized = value.trim();
|
|
256
|
+
return normalized.length > 0 && normalized.length <= 128 ? normalized : void 0;
|
|
257
|
+
}
|
|
258
|
+
function normalizeListStart(value) {
|
|
259
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= MAX_ORDERED_LIST_START ? value : void 0;
|
|
260
|
+
}
|
|
261
|
+
function deriveLegacyListId(seed) {
|
|
262
|
+
const readable = `legacy:${seed}`;
|
|
263
|
+
if (readable.length <= 128) return readable;
|
|
264
|
+
let hash = 2166136261;
|
|
265
|
+
for (let i = 0; i < seed.length; i++) {
|
|
266
|
+
hash ^= seed.charCodeAt(i);
|
|
267
|
+
hash = Math.imul(hash, 16777619);
|
|
268
|
+
}
|
|
269
|
+
return `legacy:${seed.slice(0, 96)}:${(hash >>> 0).toString(36)}:${seed.length.toString(36)}`;
|
|
270
|
+
}
|
|
271
|
+
function readOrderedListMetadata(attrs, fallbackId) {
|
|
272
|
+
return {
|
|
273
|
+
listId: normalizeListId(attrs?.listId) ?? deriveLegacyListId(fallbackId),
|
|
274
|
+
listStart: normalizeListStart(attrs?.listStart) ?? normalizeListStart(attrs?.start) ?? 1
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function collectProseMirrorOrderedLists(doc) {
|
|
278
|
+
const lists = [];
|
|
279
|
+
const visit = (node, path, depth, context) => {
|
|
280
|
+
if (node.type === "orderedList") lists.push({
|
|
281
|
+
node,
|
|
282
|
+
path,
|
|
283
|
+
depth,
|
|
284
|
+
context
|
|
285
|
+
});
|
|
286
|
+
for (const [index, child] of (node.content ?? []).entries()) {
|
|
287
|
+
const childPath = `${path}:${index}`;
|
|
288
|
+
visit(child, childPath, depth + 1, child.type === "listItem" ? `listItem:${childPath}` : context);
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
for (const [index, node] of doc.content.entries()) visit(node, `root:${index}`, 0, "root");
|
|
292
|
+
return lists;
|
|
293
|
+
}
|
|
294
|
+
function cloneProseMirrorNode(node) {
|
|
295
|
+
return {
|
|
296
|
+
...node,
|
|
297
|
+
attrs: node.attrs ? { ...node.attrs } : void 0,
|
|
298
|
+
content: node.content?.map(cloneProseMirrorNode),
|
|
299
|
+
marks: node.marks?.map((mark) => ({
|
|
300
|
+
...mark,
|
|
301
|
+
attrs: mark.attrs ? { ...mark.attrs } : void 0
|
|
302
|
+
}))
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function createRepairId(sourceId, scope, attempt) {
|
|
306
|
+
const base = deriveLegacyListId(`repair:${sourceId}:${scope}`);
|
|
307
|
+
const suffix = `:${attempt.toString(36)}`;
|
|
308
|
+
return `${base.slice(0, 128 - suffix.length)}${suffix}`;
|
|
309
|
+
}
|
|
310
|
+
function normalizeProseMirrorOrderedListJson(doc) {
|
|
311
|
+
const normalized = {
|
|
312
|
+
...doc,
|
|
313
|
+
content: doc.content.map(cloneProseMirrorNode)
|
|
314
|
+
};
|
|
315
|
+
const canonicalBySourceScope = /* @__PURE__ */ new Map();
|
|
316
|
+
const assignedCanonicalIds = /* @__PURE__ */ new Set();
|
|
317
|
+
const lists = collectProseMirrorOrderedLists(normalized).map((list) => {
|
|
318
|
+
const sourceId = normalizeListId(list.node.attrs?.listId) ?? deriveLegacyListId(`pm-json:${list.path}:${list.depth}:${list.context}`);
|
|
319
|
+
const scope = JSON.stringify([list.depth, list.context]);
|
|
320
|
+
const sourceScope = JSON.stringify([sourceId, scope]);
|
|
321
|
+
let listId = canonicalBySourceScope.get(sourceScope);
|
|
322
|
+
if (!listId) {
|
|
323
|
+
if (!assignedCanonicalIds.has(sourceId)) listId = sourceId;
|
|
324
|
+
else {
|
|
325
|
+
let attempt = 0;
|
|
326
|
+
do
|
|
327
|
+
listId = createRepairId(sourceId, scope, attempt++);
|
|
328
|
+
while (assignedCanonicalIds.has(listId));
|
|
329
|
+
}
|
|
330
|
+
canonicalBySourceScope.set(sourceScope, listId);
|
|
331
|
+
assignedCanonicalIds.add(listId);
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
...list,
|
|
335
|
+
listId,
|
|
336
|
+
scopeKey: JSON.stringify([
|
|
337
|
+
listId,
|
|
338
|
+
list.depth,
|
|
339
|
+
list.context
|
|
340
|
+
])
|
|
341
|
+
};
|
|
342
|
+
});
|
|
343
|
+
const bases = /* @__PURE__ */ new Map();
|
|
344
|
+
for (const list of lists) {
|
|
345
|
+
const listStart = normalizeListStart(list.node.attrs?.listStart);
|
|
346
|
+
if (listStart !== void 0 && !bases.has(list.scopeKey)) bases.set(list.scopeKey, listStart);
|
|
347
|
+
}
|
|
348
|
+
for (const list of lists) if (!bases.has(list.scopeKey)) bases.set(list.scopeKey, normalizeListStart(list.node.attrs?.start) ?? 1);
|
|
349
|
+
const counts = /* @__PURE__ */ new Map();
|
|
350
|
+
for (const list of lists) {
|
|
351
|
+
const listStart = bases.get(list.scopeKey);
|
|
352
|
+
const count = counts.get(list.scopeKey) ?? 0;
|
|
353
|
+
const start = normalizeListStart(listStart + count) ?? 1;
|
|
354
|
+
const directItemCount = list.node.content?.filter((node) => node.type === "listItem").length ?? 0;
|
|
355
|
+
counts.set(list.scopeKey, count + directItemCount);
|
|
356
|
+
list.node.attrs = {
|
|
357
|
+
...list.node.attrs,
|
|
358
|
+
listId: list.listId,
|
|
359
|
+
listStart,
|
|
360
|
+
start
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
return normalized;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/content/converters/portable-text-identity.ts
|
|
368
|
+
const PORTABLE_TEXT_BLOCK_NODE = "emdashPortableTextBlock";
|
|
369
|
+
const PORTABLE_TEXT_BLOCK_ATTR = "emdashPortableTextBlock";
|
|
370
|
+
const PORTABLE_TEXT_KEY_ATTR = "emdashPortableTextKey";
|
|
371
|
+
const PORTABLE_TEXT_SPAN_MARK = "emdashPortableTextSpan";
|
|
372
|
+
function isRecord(value) {
|
|
373
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
374
|
+
}
|
|
375
|
+
function attrsWithPortableTextKey(attrs, key) {
|
|
376
|
+
return {
|
|
377
|
+
...attrs,
|
|
378
|
+
[PORTABLE_TEXT_KEY_ATTR]: key
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function portableTextKeyFromAttrs(attrs) {
|
|
382
|
+
const key = attrs?.[PORTABLE_TEXT_KEY_ATTR];
|
|
383
|
+
return typeof key === "string" && key ? key : void 0;
|
|
384
|
+
}
|
|
385
|
+
function portableTextSpanKeyFromMarks(marks) {
|
|
386
|
+
for (const mark of marks ?? []) {
|
|
387
|
+
if (!isRecord(mark) || mark.type !== PORTABLE_TEXT_SPAN_MARK || !isRecord(mark.attrs)) continue;
|
|
388
|
+
const key = mark.attrs.key;
|
|
389
|
+
if (typeof key === "string" && key) return key;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function portableTextMarkDefsFromMarks(marks) {
|
|
393
|
+
const identity = (marks ?? []).find((mark) => isRecord(mark) && mark.type === PORTABLE_TEXT_SPAN_MARK && isRecord(mark.attrs));
|
|
394
|
+
if (!isRecord(identity) || !isRecord(identity.attrs) || !Array.isArray(identity.attrs.markDefs)) return [];
|
|
395
|
+
return identity.attrs.markDefs.filter((markDef) => isRecord(markDef) && typeof markDef._type === "string" && typeof markDef._key === "string");
|
|
396
|
+
}
|
|
397
|
+
function portableTextBlockFromAttrs(attrs) {
|
|
398
|
+
const block = attrs?.[PORTABLE_TEXT_BLOCK_ATTR];
|
|
399
|
+
if (!isRecord(block) || typeof block._type !== "string" || typeof block._key !== "string") return;
|
|
400
|
+
return {
|
|
401
|
+
...block,
|
|
402
|
+
_type: block._type,
|
|
403
|
+
_key: block._key
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
const PortableTextIdentityExtension = Extension.create({
|
|
407
|
+
name: "emdashPortableTextIdentity",
|
|
408
|
+
addGlobalAttributes() {
|
|
409
|
+
const hiddenAttribute = {
|
|
410
|
+
default: null,
|
|
411
|
+
rendered: false
|
|
412
|
+
};
|
|
413
|
+
return [{
|
|
414
|
+
types: [
|
|
415
|
+
"paragraph",
|
|
416
|
+
"heading",
|
|
417
|
+
"blockquote",
|
|
418
|
+
"codeBlock",
|
|
419
|
+
"htmlBlock",
|
|
420
|
+
"iframeBlock",
|
|
421
|
+
"image",
|
|
422
|
+
"videoBlock",
|
|
423
|
+
"horizontalRule",
|
|
424
|
+
"gallery",
|
|
425
|
+
PORTABLE_TEXT_BLOCK_NODE
|
|
426
|
+
],
|
|
427
|
+
attributes: { [PORTABLE_TEXT_KEY_ATTR]: hiddenAttribute }
|
|
428
|
+
}];
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
const PortableTextSpanIdentity = Mark.create({
|
|
432
|
+
name: PORTABLE_TEXT_SPAN_MARK,
|
|
433
|
+
inclusive: false,
|
|
434
|
+
spanning: false,
|
|
435
|
+
addAttributes() {
|
|
436
|
+
return {
|
|
437
|
+
key: {
|
|
438
|
+
default: null,
|
|
439
|
+
rendered: false
|
|
440
|
+
},
|
|
441
|
+
markDefs: {
|
|
442
|
+
default: [],
|
|
443
|
+
rendered: false
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
},
|
|
447
|
+
parseHTML() {
|
|
448
|
+
return [];
|
|
449
|
+
},
|
|
450
|
+
renderHTML() {
|
|
451
|
+
return ["span", 0];
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
const PortableTextOpaqueBlock = Node.create({
|
|
455
|
+
name: PORTABLE_TEXT_BLOCK_NODE,
|
|
456
|
+
group: "block",
|
|
457
|
+
atom: true,
|
|
458
|
+
selectable: true,
|
|
459
|
+
draggable: true,
|
|
460
|
+
addAttributes() {
|
|
461
|
+
return { [PORTABLE_TEXT_BLOCK_ATTR]: {
|
|
462
|
+
default: null,
|
|
463
|
+
rendered: false
|
|
464
|
+
} };
|
|
465
|
+
},
|
|
466
|
+
parseHTML() {
|
|
467
|
+
return [{ tag: "div[data-emdash-portable-text-block]" }];
|
|
468
|
+
},
|
|
469
|
+
renderHTML({ node }) {
|
|
470
|
+
const blockType = portableTextBlockFromAttrs(node.attrs)?._type ?? "unknown";
|
|
471
|
+
return [
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
"data-emdash-portable-text-block": blockType,
|
|
475
|
+
contenteditable: "false"
|
|
476
|
+
},
|
|
477
|
+
`[Unknown block type: ${blockType}]`
|
|
478
|
+
];
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
const portableTextIdentityExtensions = [
|
|
482
|
+
PortableTextIdentityExtension,
|
|
483
|
+
PortableTextSpanIdentity,
|
|
484
|
+
PortableTextOpaqueBlock
|
|
485
|
+
];
|
|
486
|
+
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/content/converters/prosemirror-to-portable-text.ts
|
|
489
|
+
/**
|
|
490
|
+
* ProseMirror to Portable Text Converter
|
|
491
|
+
*
|
|
492
|
+
* Converts TipTap's ProseMirror JSON format to Portable Text for storage.
|
|
493
|
+
*/
|
|
494
|
+
/**
|
|
495
|
+
* Generate a unique key for Portable Text blocks
|
|
496
|
+
*/
|
|
497
|
+
function generateKey$1() {
|
|
498
|
+
return Math.random().toString(36).substring(2, 11);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Convert ProseMirror document to Portable Text
|
|
502
|
+
*/
|
|
503
|
+
function prosemirrorToPortableText(doc) {
|
|
504
|
+
if (!doc || doc.type !== "doc" || !doc.content) return [];
|
|
505
|
+
assertProseMirrorMarksSupported(doc);
|
|
506
|
+
const blocks = [];
|
|
507
|
+
const usedBlockKeys = /* @__PURE__ */ new Set();
|
|
508
|
+
for (const [i, node] of doc.content.entries()) {
|
|
509
|
+
if (i === doc.content.length - 1 && isUnkeyedEmptyParagraph(node)) continue;
|
|
510
|
+
const converted = convertNode(node, `root:${i}`);
|
|
511
|
+
for (const block of converted ? Array.isArray(converted) ? converted : [converted] : []) {
|
|
512
|
+
let key = block._key;
|
|
513
|
+
if (usedBlockKeys.has(key)) do
|
|
514
|
+
key = generateKey$1();
|
|
515
|
+
while (usedBlockKeys.has(key));
|
|
516
|
+
usedBlockKeys.add(key);
|
|
517
|
+
blocks.push(key === block._key ? block : {
|
|
518
|
+
...block,
|
|
519
|
+
_key: key
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return blocks;
|
|
524
|
+
}
|
|
525
|
+
function isUnkeyedEmptyParagraph(node) {
|
|
526
|
+
return node.type === "paragraph" && (node.content?.length ?? 0) === 0 && portableTextKeyFromAttrs(node.attrs) === void 0;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Convert a single ProseMirror node to Portable Text block(s)
|
|
530
|
+
*/
|
|
531
|
+
function convertNode(node, path) {
|
|
532
|
+
switch (node.type) {
|
|
533
|
+
case PORTABLE_TEXT_BLOCK_NODE: return portableTextBlockFromAttrs(node.attrs) ?? null;
|
|
534
|
+
case "paragraph": return convertParagraph(node);
|
|
535
|
+
case "heading": return convertHeading(node);
|
|
536
|
+
case "bulletList": return convertList$1(node, "bullet", path);
|
|
537
|
+
case "orderedList": return convertList$1(node, "number", path);
|
|
538
|
+
case "blockquote": return convertBlockquote(node);
|
|
539
|
+
case "codeBlock": return convertCodeBlock$1(node);
|
|
540
|
+
case "htmlBlock": return convertHtmlBlock(node);
|
|
541
|
+
case "iframeBlock": return convertIframeBlock(node);
|
|
542
|
+
case "image": return convertImage$1(node);
|
|
543
|
+
case "videoBlock": return convertVideo(node);
|
|
544
|
+
case "gallery": return convertGallery(node);
|
|
545
|
+
case "table": {
|
|
546
|
+
const result = proseMirrorTableToPortableText(node, {
|
|
547
|
+
path,
|
|
548
|
+
createKey: generateKey$1,
|
|
549
|
+
inlineToSpans: (content) => {
|
|
550
|
+
const { children, markDefs } = convertInlineContent(content, true);
|
|
551
|
+
return {
|
|
552
|
+
content: children,
|
|
553
|
+
markDefs
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
if (!result.ok) throw new UnsafePortableTextTableError(result.reason, result.raw, result.renderFallback);
|
|
558
|
+
return result.table;
|
|
559
|
+
}
|
|
560
|
+
case "horizontalRule": return {
|
|
561
|
+
_type: "break",
|
|
562
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
563
|
+
style: "lineBreak"
|
|
564
|
+
};
|
|
565
|
+
default: return {
|
|
566
|
+
_type: node.type,
|
|
567
|
+
_key: generateKey$1(),
|
|
568
|
+
...node.attrs,
|
|
569
|
+
_pmContent: node.content
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Convert paragraph to Portable Text block
|
|
575
|
+
*/
|
|
576
|
+
function convertParagraph(node) {
|
|
577
|
+
const { children, markDefs } = convertInlineContent(node.content || []);
|
|
578
|
+
if (children.length === 0) return null;
|
|
579
|
+
const ta = node.attrs?.textAlign;
|
|
580
|
+
const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
|
|
581
|
+
return {
|
|
582
|
+
_type: "block",
|
|
583
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
584
|
+
style: "normal",
|
|
585
|
+
children,
|
|
586
|
+
...markDefs.length > 0 ? { markDefs } : {},
|
|
587
|
+
...textAlign ? { textAlign } : {}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/** Map heading level number to Portable Text style */
|
|
591
|
+
function headingLevelToStyle(level) {
|
|
592
|
+
switch (level) {
|
|
593
|
+
case 1: return "h1";
|
|
594
|
+
case 2: return "h2";
|
|
595
|
+
case 3: return "h3";
|
|
596
|
+
case 4: return "h4";
|
|
597
|
+
case 5: return "h5";
|
|
598
|
+
case 6: return "h6";
|
|
599
|
+
default: return "h1";
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Convert heading to Portable Text block
|
|
604
|
+
*/
|
|
605
|
+
function convertHeading(node) {
|
|
606
|
+
const { children, markDefs } = convertInlineContent(node.content || []);
|
|
607
|
+
const style = headingLevelToStyle(typeof node.attrs?.level === "number" ? node.attrs.level : 1);
|
|
608
|
+
if (children.length === 0) return null;
|
|
609
|
+
const ta = node.attrs?.textAlign;
|
|
610
|
+
const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
|
|
611
|
+
return {
|
|
612
|
+
_type: "block",
|
|
613
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
614
|
+
style,
|
|
615
|
+
children,
|
|
616
|
+
markDefs: markDefs.length > 0 ? markDefs : void 0,
|
|
617
|
+
...textAlign ? { textAlign } : {}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Convert list to Portable Text blocks
|
|
622
|
+
*/
|
|
623
|
+
function convertList$1(node, listItem, path) {
|
|
624
|
+
const blocks = [];
|
|
625
|
+
const metadata = listItem === "number" ? readOrderedListMetadata(node.attrs, path) : void 0;
|
|
626
|
+
for (const [i, item] of (node.content ?? []).entries()) if (item.type === "listItem") {
|
|
627
|
+
const itemBlocks = convertListItem$1(item, listItem, 1, `${path}:${i}`, metadata);
|
|
628
|
+
blocks.push(...itemBlocks);
|
|
629
|
+
}
|
|
630
|
+
return blocks;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Convert list item to Portable Text blocks
|
|
634
|
+
*/
|
|
635
|
+
function convertListItem$1(item, listItem, level, path, metadata) {
|
|
636
|
+
const blocks = [];
|
|
637
|
+
for (const [i, child] of (item.content ?? []).entries()) if (child.type === "paragraph") {
|
|
638
|
+
const { children, markDefs } = convertInlineContent(child.content || []);
|
|
639
|
+
if (children.length > 0) blocks.push({
|
|
640
|
+
_type: "block",
|
|
641
|
+
_key: portableTextKeyFromAttrs(child.attrs) ?? generateKey$1(),
|
|
642
|
+
style: "normal",
|
|
643
|
+
listItem,
|
|
644
|
+
level,
|
|
645
|
+
...metadata,
|
|
646
|
+
children,
|
|
647
|
+
markDefs: markDefs.length > 0 ? markDefs : void 0
|
|
648
|
+
});
|
|
649
|
+
} else if (child.type === "bulletList") blocks.push(...convertListItemNested(child, "bullet", level + 1, `${path}:${i}`));
|
|
650
|
+
else if (child.type === "orderedList") blocks.push(...convertListItemNested(child, "number", level + 1, `${path}:${i}`));
|
|
651
|
+
return blocks;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Convert nested list
|
|
655
|
+
*/
|
|
656
|
+
function convertListItemNested(node, listItem, level, path) {
|
|
657
|
+
const blocks = [];
|
|
658
|
+
const metadata = listItem === "number" ? readOrderedListMetadata(node.attrs, path) : void 0;
|
|
659
|
+
for (const [i, item] of (node.content ?? []).entries()) if (item.type === "listItem") blocks.push(...convertListItem$1(item, listItem, level, `${path}:${i}`, metadata));
|
|
660
|
+
return blocks;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Convert blockquote to Portable Text blocks
|
|
664
|
+
*/
|
|
665
|
+
function convertBlockquote(node) {
|
|
666
|
+
const blocks = [];
|
|
667
|
+
for (const child of node.content || []) if (child.type === "paragraph") {
|
|
668
|
+
const { children, markDefs } = convertInlineContent(child.content || []);
|
|
669
|
+
if (children.length > 0) blocks.push({
|
|
670
|
+
_type: "block",
|
|
671
|
+
_key: portableTextKeyFromAttrs(child.attrs) ?? portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
672
|
+
style: "blockquote",
|
|
673
|
+
children,
|
|
674
|
+
markDefs: markDefs.length > 0 ? markDefs : void 0
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
return blocks.length === 1 ? blocks[0] : blocks.length > 0 ? blocks : null;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Convert code block to Portable Text
|
|
681
|
+
*/
|
|
682
|
+
function convertCodeBlock$1(node) {
|
|
683
|
+
const code = node.content?.map((n) => n.text || "").join("") || "";
|
|
684
|
+
const language = typeof node.attrs?.language === "string" ? node.attrs.language : void 0;
|
|
685
|
+
return {
|
|
686
|
+
_type: "code",
|
|
687
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
688
|
+
code,
|
|
689
|
+
language: language || void 0
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Convert HTML block to Portable Text
|
|
694
|
+
*/
|
|
695
|
+
function convertHtmlBlock(node) {
|
|
696
|
+
return {
|
|
697
|
+
_type: "htmlBlock",
|
|
698
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
699
|
+
...htmlBlockFields(node.attrs ?? {})
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Convert iframe block to Portable Text, writing optional fields only when set
|
|
704
|
+
*/
|
|
705
|
+
function convertIframeBlock(node) {
|
|
706
|
+
const { src, title, width, height, allow, allowFullscreen } = node.attrs ?? {};
|
|
707
|
+
const block = {
|
|
708
|
+
_type: "iframe",
|
|
709
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
710
|
+
src: typeof src === "string" ? src : ""
|
|
711
|
+
};
|
|
712
|
+
if (typeof title === "string" && title) block.title = title;
|
|
713
|
+
if (isFrameDimension$1(width)) block.width = width;
|
|
714
|
+
if (isFrameDimension$1(height)) block.height = height;
|
|
715
|
+
if (typeof allow === "string" && allow) block.allow = allow;
|
|
716
|
+
if (allowFullscreen === true) block.allowFullscreen = true;
|
|
717
|
+
return block;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Convert video block to Portable Text
|
|
721
|
+
*/
|
|
722
|
+
function convertVideo(node) {
|
|
723
|
+
return {
|
|
724
|
+
_type: "video",
|
|
725
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
726
|
+
...videoBlockFields(node.attrs ?? {})
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function isFrameDimension$1(value) {
|
|
730
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 1e4;
|
|
731
|
+
}
|
|
732
|
+
function imageDimension$1(value) {
|
|
733
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Convert image to Portable Text
|
|
737
|
+
*/
|
|
738
|
+
function convertImage$1(node) {
|
|
739
|
+
const attrs = node.attrs;
|
|
740
|
+
const provider = typeof attrs?.provider === "string" ? attrs.provider : void 0;
|
|
741
|
+
const mediaId = typeof attrs?.mediaId === "string" ? attrs.mediaId : void 0;
|
|
742
|
+
const src = typeof attrs?.src === "string" ? attrs.src : "";
|
|
743
|
+
const alt = typeof attrs?.alt === "string" ? attrs.alt : void 0;
|
|
744
|
+
const title = typeof attrs?.title === "string" ? attrs.title : void 0;
|
|
745
|
+
const caption = attrs && Object.hasOwn(attrs, "caption") ? typeof attrs.caption === "string" ? attrs.caption : void 0 : title;
|
|
746
|
+
const width = imageDimension$1(attrs?.width);
|
|
747
|
+
const height = imageDimension$1(attrs?.height);
|
|
748
|
+
const displayWidth = imageDimension$1(attrs?.displayWidth);
|
|
749
|
+
const displayHeight = imageDimension$1(attrs?.displayHeight);
|
|
750
|
+
const alignment = attrs?.alignment;
|
|
751
|
+
let link;
|
|
752
|
+
const rawLink = attrs?.link;
|
|
753
|
+
if (rawLink && typeof rawLink === "object") {
|
|
754
|
+
const linkObj = rawLink;
|
|
755
|
+
const href = typeof linkObj.href === "string" ? linkObj.href.trim() : "";
|
|
756
|
+
if (href) {
|
|
757
|
+
link = { href };
|
|
758
|
+
if (linkObj.blank === true) link.blank = true;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
_type: "image",
|
|
763
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
764
|
+
asset: {
|
|
765
|
+
_ref: mediaId || src || "",
|
|
766
|
+
url: src || "",
|
|
767
|
+
provider: provider && provider !== "local" ? provider : void 0
|
|
768
|
+
},
|
|
769
|
+
alt: alt || void 0,
|
|
770
|
+
caption: caption || (title ? "" : void 0),
|
|
771
|
+
title: title || void 0,
|
|
772
|
+
width: width || void 0,
|
|
773
|
+
height: height || void 0,
|
|
774
|
+
displayWidth: displayWidth || void 0,
|
|
775
|
+
displayHeight: displayHeight || void 0,
|
|
776
|
+
alignment: alignment === "left" || alignment === "center" || alignment === "right" || alignment === "wide" || alignment === "full" ? alignment : void 0,
|
|
777
|
+
link
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Convert gallery node to Portable Text
|
|
782
|
+
*/
|
|
783
|
+
function convertGallery(node) {
|
|
784
|
+
const columns = node.attrs?.columns;
|
|
785
|
+
return {
|
|
786
|
+
_type: "gallery",
|
|
787
|
+
_key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
|
|
788
|
+
images: sanitizeGalleryImages(node.attrs?.images, generateKey$1),
|
|
789
|
+
...typeof columns === "number" ? { columns } : {}
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Convert inline content (text nodes with marks) to Portable Text spans
|
|
794
|
+
*/
|
|
795
|
+
function convertInlineContent(nodes, preserveHardBreakBoundary = false) {
|
|
796
|
+
const children = [];
|
|
797
|
+
const markDefs = [];
|
|
798
|
+
const markDefMap = /* @__PURE__ */ new Map();
|
|
799
|
+
const usedSpanKeys = /* @__PURE__ */ new Set();
|
|
800
|
+
const claimSpanKey = (preferred) => {
|
|
801
|
+
if (preferred && !usedSpanKeys.has(preferred)) {
|
|
802
|
+
usedSpanKeys.add(preferred);
|
|
803
|
+
return preferred;
|
|
804
|
+
}
|
|
805
|
+
let key;
|
|
806
|
+
do
|
|
807
|
+
key = generateKey$1();
|
|
808
|
+
while (usedSpanKeys.has(key));
|
|
809
|
+
usedSpanKeys.add(key);
|
|
810
|
+
return key;
|
|
811
|
+
};
|
|
812
|
+
for (const node of nodes) if (node.type === "text" && node.text) {
|
|
813
|
+
const marks = [];
|
|
814
|
+
const originalMarkDefs = portableTextMarkDefsFromMarks(node.marks);
|
|
815
|
+
for (const mark of node.marks || []) {
|
|
816
|
+
const markType = convertMark(mark, markDefs, markDefMap, originalMarkDefs);
|
|
817
|
+
if (markType) marks.push(markType);
|
|
818
|
+
}
|
|
819
|
+
const preferredKey = portableTextSpanKeyFromMarks(node.marks) ?? portableTextKeyFromAttrs(node.attrs);
|
|
820
|
+
const normalizedMarks = marks.length > 0 ? marks : void 0;
|
|
821
|
+
const previous = children.at(-1);
|
|
822
|
+
if (preferredKey && previous?._key === preferredKey && JSON.stringify(previous.marks) === JSON.stringify(normalizedMarks)) {
|
|
823
|
+
previous.text += node.text;
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
children.push({
|
|
827
|
+
_type: "span",
|
|
828
|
+
_key: claimSpanKey(preferredKey),
|
|
829
|
+
text: node.text,
|
|
830
|
+
marks: normalizedMarks
|
|
831
|
+
});
|
|
832
|
+
} else if (node.type === "hardBreak") if (children.length > 0 && !preserveHardBreakBoundary) {
|
|
833
|
+
const lastChild = children.at(-1);
|
|
834
|
+
lastChild.text += "\n";
|
|
835
|
+
} else children.push({
|
|
836
|
+
_type: "span",
|
|
837
|
+
_key: claimSpanKey(portableTextSpanKeyFromMarks(node.marks) ?? portableTextKeyFromAttrs(node.attrs)),
|
|
838
|
+
text: "\n"
|
|
839
|
+
});
|
|
840
|
+
if (children.length === 0) children.push({
|
|
841
|
+
_type: "span",
|
|
842
|
+
_key: claimSpanKey(),
|
|
843
|
+
text: ""
|
|
844
|
+
});
|
|
845
|
+
return {
|
|
846
|
+
children,
|
|
847
|
+
markDefs
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Convert a ProseMirror mark to Portable Text mark
|
|
852
|
+
*/
|
|
853
|
+
function convertMark(mark, markDefs, markDefMap, originalMarkDefs) {
|
|
854
|
+
switch (mark.type) {
|
|
855
|
+
case "bold":
|
|
856
|
+
case "strong": return "strong";
|
|
857
|
+
case "italic":
|
|
858
|
+
case "em": return "em";
|
|
859
|
+
case "underline": return "underline";
|
|
860
|
+
case "strike":
|
|
861
|
+
case "strikethrough": return "strike-through";
|
|
862
|
+
case "subscript": return "subscript";
|
|
863
|
+
case "superscript": return "superscript";
|
|
864
|
+
case "code": return "code";
|
|
865
|
+
case PORTABLE_TEXT_SPAN_MARK: return null;
|
|
866
|
+
case "link": {
|
|
867
|
+
const href = (typeof mark.attrs?.href === "string" ? mark.attrs.href : "") || "";
|
|
868
|
+
const blank = mark.attrs?.target === "_blank";
|
|
869
|
+
const originalMarkDef = originalMarkDefs.find((markDef) => markDef._type === "link");
|
|
870
|
+
const mapKey = originalMarkDef ? `key:${originalMarkDef._key}` : `value:${JSON.stringify([href, blank])}`;
|
|
871
|
+
if (markDefMap.has(mapKey)) return markDefMap.get(mapKey);
|
|
872
|
+
const key = originalMarkDef?._key || generateKey$1();
|
|
873
|
+
markDefs.push({
|
|
874
|
+
...originalMarkDef,
|
|
875
|
+
_type: "link",
|
|
876
|
+
_key: key,
|
|
877
|
+
href,
|
|
878
|
+
...originalMarkDef ? blank || Object.hasOwn(originalMarkDef, "blank") ? { blank } : {} : { blank }
|
|
879
|
+
});
|
|
880
|
+
markDefMap.set(mapKey, key);
|
|
881
|
+
return key;
|
|
882
|
+
}
|
|
883
|
+
default: throw new UnsupportedPortableTextMarksError([mark.type]);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region src/content/converters/image-link.ts
|
|
889
|
+
function normalizeImageLink(raw) {
|
|
890
|
+
if (typeof raw === "string") {
|
|
891
|
+
const href = raw.trim();
|
|
892
|
+
return href ? { href } : null;
|
|
893
|
+
}
|
|
894
|
+
if (typeof raw !== "object" || raw === null) return null;
|
|
895
|
+
const { href, blank } = raw;
|
|
896
|
+
if (typeof href !== "string") return null;
|
|
897
|
+
const trimmed = href.trim();
|
|
898
|
+
if (!trimmed) return null;
|
|
899
|
+
return blank === true ? {
|
|
900
|
+
href: trimmed,
|
|
901
|
+
blank: true
|
|
902
|
+
} : { href: trimmed };
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
//#endregion
|
|
906
|
+
//#region src/content/converters/portable-text-to-prosemirror.ts
|
|
907
|
+
/**
|
|
908
|
+
* Portable Text to ProseMirror Converter
|
|
909
|
+
*
|
|
910
|
+
* Converts Portable Text to TipTap's ProseMirror JSON format for editing.
|
|
911
|
+
*/
|
|
912
|
+
function generateKey() {
|
|
913
|
+
return Math.random().toString(36).substring(2, 11);
|
|
914
|
+
}
|
|
915
|
+
/** Convert Portable Text to a ProseMirror document. */
|
|
916
|
+
function portableTextToProsemirror(blocks, options = {}) {
|
|
917
|
+
if (!blocks || blocks.length === 0) return {
|
|
918
|
+
type: "doc",
|
|
919
|
+
content: [{ type: "paragraph" }]
|
|
920
|
+
};
|
|
921
|
+
assertPortableTextMarksSupported(blocks);
|
|
922
|
+
const preserveIdentity = options.preserveIdentity === true;
|
|
923
|
+
const content = [];
|
|
924
|
+
let i = 0;
|
|
925
|
+
while (i < blocks.length) {
|
|
926
|
+
const block = blocks[i];
|
|
927
|
+
if (isTextBlock(block) && block.listItem) {
|
|
928
|
+
const listBlocks = [];
|
|
929
|
+
const listType = block.listItem;
|
|
930
|
+
const runStart = i;
|
|
931
|
+
const rootId = listType === "number" ? normalizeListId(block.listId) : void 0;
|
|
932
|
+
while (i < blocks.length) {
|
|
933
|
+
const current = blocks[i];
|
|
934
|
+
if (!isTextBlock(current) || !current.listItem) break;
|
|
935
|
+
const level = current.level || 1;
|
|
936
|
+
const currentId = current.listItem === "number" ? normalizeListId(current.listId) : void 0;
|
|
937
|
+
const sameRootIdentity = listType !== "number" || level > 1 || (rootId ? currentId === rootId : currentId === void 0);
|
|
938
|
+
if (level > 1 || current.listItem === listType && sameRootIdentity) {
|
|
939
|
+
listBlocks.push(current);
|
|
940
|
+
i++;
|
|
941
|
+
} else break;
|
|
942
|
+
}
|
|
943
|
+
content.push(convertList(listBlocks, listType, `root:${runStart}`, preserveIdentity));
|
|
944
|
+
} else if (isTextBlock(block) && block.style === "blockquote") {
|
|
945
|
+
const quoteBlocks = [];
|
|
946
|
+
while (i < blocks.length) {
|
|
947
|
+
const current = blocks[i];
|
|
948
|
+
if (!isTextBlock(current) || current.style !== "blockquote" || current.listItem !== void 0) break;
|
|
949
|
+
quoteBlocks.push(current);
|
|
950
|
+
i++;
|
|
951
|
+
}
|
|
952
|
+
content.push({
|
|
953
|
+
type: "blockquote",
|
|
954
|
+
content: quoteBlocks.map((quoteBlock) => {
|
|
955
|
+
const paragraph = convertSpans(quoteBlock.children, quoteBlock.markDefs || [], preserveIdentity);
|
|
956
|
+
return {
|
|
957
|
+
type: "paragraph",
|
|
958
|
+
attrs: identityAttrs(void 0, quoteBlock._key, preserveIdentity),
|
|
959
|
+
content: paragraph.length > 0 ? paragraph : void 0
|
|
960
|
+
};
|
|
961
|
+
})
|
|
962
|
+
});
|
|
963
|
+
} else {
|
|
964
|
+
const converted = convertBlock(block, `root:${i}`, preserveIdentity);
|
|
965
|
+
if (converted) content.push(converted);
|
|
966
|
+
i++;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
return normalizeProseMirrorOrderedListJson({
|
|
970
|
+
type: "doc",
|
|
971
|
+
content: content.length > 0 ? content : [{ type: "paragraph" }]
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
function identityAttrs(attrs, key, preserveIdentity) {
|
|
975
|
+
return preserveIdentity ? attrsWithPortableTextKey(attrs, key) : attrs;
|
|
976
|
+
}
|
|
977
|
+
function getListMetadata(item, fallbackSeed) {
|
|
978
|
+
const listId = normalizeListId(item.listId) ?? deriveLegacyListId(fallbackSeed);
|
|
979
|
+
const listStart = normalizeListStart(item.listStart);
|
|
980
|
+
return {
|
|
981
|
+
listId,
|
|
982
|
+
...listStart === void 0 ? {} : { listStart }
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function belongsToNestedGroup(item, minLevel, parentListType, anchorType, anchorId) {
|
|
986
|
+
if ((item.level || 2) > minLevel) return true;
|
|
987
|
+
if ((item.listItem || parentListType) !== anchorType) return false;
|
|
988
|
+
if (anchorType !== "number") return true;
|
|
989
|
+
const itemId = normalizeListId(item.listId);
|
|
990
|
+
return anchorId ? itemId === anchorId : itemId === void 0;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Type guard for text blocks
|
|
994
|
+
*/
|
|
995
|
+
function isTextBlock(block) {
|
|
996
|
+
return block._type === "block";
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Type guard for image blocks.
|
|
1000
|
+
* Checks both `_type` and that `asset` is a valid object — image blocks
|
|
1001
|
+
* without an `asset` wrapper (e.g. `{ _type: "image", url: "..." }`) are
|
|
1002
|
+
* malformed and should not be cast to `PortableTextImageBlock`.
|
|
1003
|
+
*/
|
|
1004
|
+
function isImageBlock(block) {
|
|
1005
|
+
return block._type === "image" && "asset" in block && typeof block.asset === "object" && block.asset !== null;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Type guard for gallery blocks that carry a usable `images` array.
|
|
1009
|
+
* Galleries without one are handled separately in `convertBlock`.
|
|
1010
|
+
*/
|
|
1011
|
+
function isGalleryBlock(block) {
|
|
1012
|
+
return block._type === "gallery" && "images" in block && Array.isArray(block.images);
|
|
1013
|
+
}
|
|
1014
|
+
const isString = (value) => typeof value === "string";
|
|
1015
|
+
const isFrameDimension = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 1e4;
|
|
1016
|
+
const IFRAME_BLOCK_FIELDS = new Map([
|
|
1017
|
+
["_type", () => true],
|
|
1018
|
+
["_key", () => true],
|
|
1019
|
+
["src", isString],
|
|
1020
|
+
["title", isString],
|
|
1021
|
+
["width", isFrameDimension],
|
|
1022
|
+
["height", isFrameDimension],
|
|
1023
|
+
["allow", isString],
|
|
1024
|
+
["allowFullscreen", (value) => typeof value === "boolean"]
|
|
1025
|
+
]);
|
|
1026
|
+
/**
|
|
1027
|
+
* An `iframe` block with other fields, or with values of other types, belongs
|
|
1028
|
+
* to a plugin and stays a generic block.
|
|
1029
|
+
*/
|
|
1030
|
+
function isIframeBlock(block) {
|
|
1031
|
+
return block._type === "iframe" && typeof block.src === "string" && Object.entries(block).every(([key, value]) => value === void 0 || (IFRAME_BLOCK_FIELDS.get(key)?.(value) ?? false));
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Type guard for code blocks
|
|
1035
|
+
*/
|
|
1036
|
+
function isCodeBlock(block) {
|
|
1037
|
+
return block._type === "code";
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Convert a single Portable Text block to ProseMirror node
|
|
1041
|
+
*/
|
|
1042
|
+
function convertBlock(block, path, preserveIdentity) {
|
|
1043
|
+
if (isTextBlock(block)) return convertTextBlock(block, preserveIdentity);
|
|
1044
|
+
if (isImageBlock(block)) return convertImage(block, preserveIdentity);
|
|
1045
|
+
if (block._type === "image") return convertMalformedImage(block, preserveIdentity);
|
|
1046
|
+
if (isGalleryBlock(block)) return {
|
|
1047
|
+
type: "gallery",
|
|
1048
|
+
attrs: identityAttrs({
|
|
1049
|
+
images: sanitizeGalleryImages(block.images),
|
|
1050
|
+
columns: typeof block.columns === "number" ? block.columns : void 0
|
|
1051
|
+
}, block._key, preserveIdentity)
|
|
1052
|
+
};
|
|
1053
|
+
if (isCodeBlock(block)) return convertCodeBlock(block, preserveIdentity);
|
|
1054
|
+
if (block._type === "htmlBlock") return {
|
|
1055
|
+
type: "htmlBlock",
|
|
1056
|
+
attrs: identityAttrs({ ...htmlBlockFields(block) }, block._key, preserveIdentity)
|
|
1057
|
+
};
|
|
1058
|
+
if (isIframeBlock(block)) {
|
|
1059
|
+
const { _type, _key, ...attrs } = block;
|
|
1060
|
+
return {
|
|
1061
|
+
type: "iframeBlock",
|
|
1062
|
+
attrs: identityAttrs(attrs, _key, preserveIdentity)
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
if (isPortableTextVideoBlock(block)) return {
|
|
1066
|
+
type: "videoBlock",
|
|
1067
|
+
attrs: identityAttrs(videoNodeAttrs(block), block._key, preserveIdentity)
|
|
1068
|
+
};
|
|
1069
|
+
if (block._type === "break") return {
|
|
1070
|
+
type: "horizontalRule",
|
|
1071
|
+
attrs: identityAttrs(void 0, block._key, preserveIdentity)
|
|
1072
|
+
};
|
|
1073
|
+
if (block._type === "gallery") {
|
|
1074
|
+
if (preserveIdentity) return {
|
|
1075
|
+
type: PORTABLE_TEXT_BLOCK_NODE,
|
|
1076
|
+
attrs: { [PORTABLE_TEXT_BLOCK_ATTR]: block }
|
|
1077
|
+
};
|
|
1078
|
+
return {
|
|
1079
|
+
type: "paragraph",
|
|
1080
|
+
content: [{
|
|
1081
|
+
type: "text",
|
|
1082
|
+
text: `[Unknown block type: ${block._type}]`,
|
|
1083
|
+
marks: [{ type: "code" }]
|
|
1084
|
+
}]
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
if (preserveIdentity) return {
|
|
1088
|
+
type: PORTABLE_TEXT_BLOCK_NODE,
|
|
1089
|
+
attrs: { [PORTABLE_TEXT_BLOCK_ATTR]: block }
|
|
1090
|
+
};
|
|
1091
|
+
if (block._type === "table") {
|
|
1092
|
+
const result = portableTextTableToProseMirror(block, {
|
|
1093
|
+
path,
|
|
1094
|
+
createKey: generateKey,
|
|
1095
|
+
spansToInline: (content, markDefs) => convertSpans(content, markDefs, preserveIdentity)
|
|
1096
|
+
});
|
|
1097
|
+
if (!result.ok) throw new UnsafePortableTextTableError(result.reason, result.raw, result.renderFallback);
|
|
1098
|
+
return result.node;
|
|
1099
|
+
}
|
|
1100
|
+
return {
|
|
1101
|
+
type: "paragraph",
|
|
1102
|
+
content: [{
|
|
1103
|
+
type: "text",
|
|
1104
|
+
text: `[Unknown block type: ${block._type}]`,
|
|
1105
|
+
marks: [{ type: "code" }]
|
|
1106
|
+
}]
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Convert text block to ProseMirror paragraph or heading
|
|
1111
|
+
*/
|
|
1112
|
+
function convertTextBlock(block, preserveIdentity) {
|
|
1113
|
+
const { style = "normal", children, markDefs = [] } = block;
|
|
1114
|
+
const content = convertSpans(children, markDefs, preserveIdentity);
|
|
1115
|
+
switch (style) {
|
|
1116
|
+
case "h1":
|
|
1117
|
+
case "h2":
|
|
1118
|
+
case "h3":
|
|
1119
|
+
case "h4":
|
|
1120
|
+
case "h5":
|
|
1121
|
+
case "h6": return {
|
|
1122
|
+
type: "heading",
|
|
1123
|
+
attrs: identityAttrs({
|
|
1124
|
+
level: parseInt(style.substring(1), 10),
|
|
1125
|
+
...block.textAlign ? { textAlign: block.textAlign } : {}
|
|
1126
|
+
}, block._key, preserveIdentity),
|
|
1127
|
+
content: content.length > 0 ? content : void 0
|
|
1128
|
+
};
|
|
1129
|
+
case "blockquote": return {
|
|
1130
|
+
type: "blockquote",
|
|
1131
|
+
attrs: identityAttrs(void 0, block._key, preserveIdentity),
|
|
1132
|
+
content: [{
|
|
1133
|
+
type: "paragraph",
|
|
1134
|
+
content: content.length > 0 ? content : void 0
|
|
1135
|
+
}]
|
|
1136
|
+
};
|
|
1137
|
+
default: return {
|
|
1138
|
+
type: "paragraph",
|
|
1139
|
+
attrs: identityAttrs(block.textAlign ? { textAlign: block.textAlign } : void 0, block._key, preserveIdentity),
|
|
1140
|
+
content: content.length > 0 ? content : void 0
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Convert list items to ProseMirror list
|
|
1146
|
+
*/
|
|
1147
|
+
function convertList(items, listType, context, preserveIdentity) {
|
|
1148
|
+
const rootItems = [];
|
|
1149
|
+
let i = 0;
|
|
1150
|
+
while (i < items.length) {
|
|
1151
|
+
const item = items[i];
|
|
1152
|
+
if ((item.level || 1) === 1) {
|
|
1153
|
+
const nestedItems = [];
|
|
1154
|
+
i++;
|
|
1155
|
+
while (i < items.length && (items[i].level || 1) > 1) {
|
|
1156
|
+
nestedItems.push(items[i]);
|
|
1157
|
+
i++;
|
|
1158
|
+
}
|
|
1159
|
+
rootItems.push(convertListItem(item, nestedItems, listType, `${context}:${rootItems.length}`, preserveIdentity));
|
|
1160
|
+
} else {
|
|
1161
|
+
rootItems.push(convertListItem(item, [], listType, `${context}:${rootItems.length}`, preserveIdentity));
|
|
1162
|
+
i++;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
const metadata = listType === "number" ? getListMetadata(items[0], `${context}:${items[0]._key}`) : void 0;
|
|
1166
|
+
return {
|
|
1167
|
+
type: listType === "bullet" ? "bulletList" : "orderedList",
|
|
1168
|
+
attrs: metadata ? {
|
|
1169
|
+
...metadata,
|
|
1170
|
+
start: metadata.listStart ?? 1
|
|
1171
|
+
} : void 0,
|
|
1172
|
+
content: rootItems
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Convert a single list item to ProseMirror
|
|
1177
|
+
*/
|
|
1178
|
+
function convertListItem(item, nestedItems, parentListType, context, preserveIdentity) {
|
|
1179
|
+
const content = [];
|
|
1180
|
+
const spans = convertSpans(item.children, item.markDefs || [], preserveIdentity);
|
|
1181
|
+
content.push({
|
|
1182
|
+
type: "paragraph",
|
|
1183
|
+
attrs: identityAttrs(void 0, item._key, preserveIdentity),
|
|
1184
|
+
content: spans.length > 0 ? spans : void 0
|
|
1185
|
+
});
|
|
1186
|
+
if (nestedItems.length > 0) {
|
|
1187
|
+
let minLevel = Infinity;
|
|
1188
|
+
for (const ni of nestedItems) {
|
|
1189
|
+
const level = ni.level || 2;
|
|
1190
|
+
if (level < minLevel) minLevel = level;
|
|
1191
|
+
}
|
|
1192
|
+
let j = 0;
|
|
1193
|
+
while (j < nestedItems.length) {
|
|
1194
|
+
const anchorType = nestedItems[j].listItem || parentListType;
|
|
1195
|
+
const anchorId = anchorType === "number" ? normalizeListId(nestedItems[j].listId) : void 0;
|
|
1196
|
+
const nestedGroup = [];
|
|
1197
|
+
do {
|
|
1198
|
+
nestedGroup.push(nestedItems[j]);
|
|
1199
|
+
j++;
|
|
1200
|
+
} while (j < nestedItems.length && belongsToNestedGroup(nestedItems[j], minLevel, parentListType, anchorType, anchorId));
|
|
1201
|
+
if (nestedGroup.length > 0) {
|
|
1202
|
+
const adjustedGroup = nestedGroup.map((ni) => ({
|
|
1203
|
+
...ni,
|
|
1204
|
+
level: (ni.level || 2) - 1
|
|
1205
|
+
}));
|
|
1206
|
+
content.push(convertList(adjustedGroup, anchorType, `${context}:nested:${j - nestedGroup.length}`, preserveIdentity));
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
return {
|
|
1211
|
+
type: "listItem",
|
|
1212
|
+
content
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Convert Portable Text spans to ProseMirror text nodes
|
|
1217
|
+
*/
|
|
1218
|
+
function convertSpans(spans, markDefs, preserveIdentity) {
|
|
1219
|
+
const nodes = [];
|
|
1220
|
+
const markDefsMap = new Map(markDefs.map((md) => [md._key, md]));
|
|
1221
|
+
for (const span of spans) {
|
|
1222
|
+
if (span._type !== "span") continue;
|
|
1223
|
+
const referencedMarkDefs = markDefs.filter((markDef) => span.marks?.includes(markDef._key));
|
|
1224
|
+
const parts = span.text.split("\n");
|
|
1225
|
+
for (let i = 0; i < parts.length; i++) {
|
|
1226
|
+
const text = parts[i];
|
|
1227
|
+
if (text.length > 0) {
|
|
1228
|
+
const marks = convertMarks(span.marks || [], markDefsMap);
|
|
1229
|
+
if (preserveIdentity) marks.push({
|
|
1230
|
+
type: PORTABLE_TEXT_SPAN_MARK,
|
|
1231
|
+
attrs: {
|
|
1232
|
+
key: span._key,
|
|
1233
|
+
markDefs: referencedMarkDefs
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
const node = {
|
|
1237
|
+
type: "text",
|
|
1238
|
+
text
|
|
1239
|
+
};
|
|
1240
|
+
if (marks.length > 0) node.marks = marks;
|
|
1241
|
+
nodes.push(node);
|
|
1242
|
+
}
|
|
1243
|
+
if (i < parts.length - 1) nodes.push(preserveIdentity ? {
|
|
1244
|
+
type: "hardBreak",
|
|
1245
|
+
marks: [{
|
|
1246
|
+
type: PORTABLE_TEXT_SPAN_MARK,
|
|
1247
|
+
attrs: {
|
|
1248
|
+
key: span._key,
|
|
1249
|
+
markDefs: referencedMarkDefs
|
|
1250
|
+
}
|
|
1251
|
+
}]
|
|
1252
|
+
} : { type: "hardBreak" });
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
return nodes;
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Convert Portable Text marks to ProseMirror marks
|
|
1259
|
+
*/
|
|
1260
|
+
function convertMarks(marks, markDefs) {
|
|
1261
|
+
const pmMarks = [];
|
|
1262
|
+
for (const mark of marks) switch (mark) {
|
|
1263
|
+
case "strong":
|
|
1264
|
+
pmMarks.push({ type: "bold" });
|
|
1265
|
+
break;
|
|
1266
|
+
case "em":
|
|
1267
|
+
pmMarks.push({ type: "italic" });
|
|
1268
|
+
break;
|
|
1269
|
+
case "underline":
|
|
1270
|
+
pmMarks.push({ type: "underline" });
|
|
1271
|
+
break;
|
|
1272
|
+
case "strike-through":
|
|
1273
|
+
pmMarks.push({ type: "strike" });
|
|
1274
|
+
break;
|
|
1275
|
+
case "subscript":
|
|
1276
|
+
pmMarks.push({ type: "subscript" });
|
|
1277
|
+
break;
|
|
1278
|
+
case "superscript":
|
|
1279
|
+
pmMarks.push({ type: "superscript" });
|
|
1280
|
+
break;
|
|
1281
|
+
case "code":
|
|
1282
|
+
pmMarks.push({ type: "code" });
|
|
1283
|
+
break;
|
|
1284
|
+
default: {
|
|
1285
|
+
const markDef = markDefs.get(mark);
|
|
1286
|
+
if (markDef?._type === "link") pmMarks.push({
|
|
1287
|
+
type: "link",
|
|
1288
|
+
attrs: {
|
|
1289
|
+
href: markDef.href,
|
|
1290
|
+
target: markDef.blank ? "_blank" : null
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
else throw new UnsupportedPortableTextMarksError([typeof markDef?._type === "string" ? markDef._type : mark]);
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
return pmMarks;
|
|
1298
|
+
}
|
|
1299
|
+
function imageAlignment(value) {
|
|
1300
|
+
return value === "left" || value === "center" || value === "right" || value === "wide" || value === "full" ? value : void 0;
|
|
1301
|
+
}
|
|
1302
|
+
function imageDimension(value) {
|
|
1303
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Convert image block to ProseMirror
|
|
1307
|
+
*/
|
|
1308
|
+
function convertImage(block, preserveIdentity) {
|
|
1309
|
+
const { asset, alt, width, height } = resolveImageMedia(block);
|
|
1310
|
+
return {
|
|
1311
|
+
type: "image",
|
|
1312
|
+
attrs: identityAttrs({
|
|
1313
|
+
src: asset.url || asset._ref,
|
|
1314
|
+
alt: alt || "",
|
|
1315
|
+
title: block.title || "",
|
|
1316
|
+
caption: Object.hasOwn(block, "caption") ? block.caption || "" : block.title || "",
|
|
1317
|
+
mediaId: asset._ref,
|
|
1318
|
+
provider: asset.provider,
|
|
1319
|
+
width: imageDimension(width),
|
|
1320
|
+
height: imageDimension(height),
|
|
1321
|
+
displayWidth: imageDimension(block.displayWidth),
|
|
1322
|
+
displayHeight: imageDimension(block.displayHeight),
|
|
1323
|
+
alignment: imageAlignment(block.alignment),
|
|
1324
|
+
link: normalizeImageLink(block.link)
|
|
1325
|
+
}, block._key, preserveIdentity)
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Convert a malformed image block (missing `asset` wrapper) to ProseMirror.
|
|
1330
|
+
* Handles blocks like `{ _type: "image", url: "...", alt: "..." }` that may
|
|
1331
|
+
* originate from migrations or third-party imports.
|
|
1332
|
+
*/
|
|
1333
|
+
function convertMalformedImage(block, preserveIdentity) {
|
|
1334
|
+
const url = "url" in block && typeof block.url === "string" ? block.url : "";
|
|
1335
|
+
const alt = "alt" in block && typeof block.alt === "string" ? block.alt : "";
|
|
1336
|
+
const title = "title" in block && typeof block.title === "string" ? block.title : "";
|
|
1337
|
+
const rawCaption = "caption" in block ? block.caption : void 0;
|
|
1338
|
+
return {
|
|
1339
|
+
type: "image",
|
|
1340
|
+
attrs: identityAttrs({
|
|
1341
|
+
src: url,
|
|
1342
|
+
alt,
|
|
1343
|
+
title,
|
|
1344
|
+
caption: Object.hasOwn(block, "caption") ? typeof rawCaption === "string" ? rawCaption : "" : title,
|
|
1345
|
+
mediaId: void 0,
|
|
1346
|
+
provider: void 0,
|
|
1347
|
+
width: imageDimension("width" in block ? block.width : void 0),
|
|
1348
|
+
height: imageDimension("height" in block ? block.height : void 0),
|
|
1349
|
+
displayWidth: imageDimension("displayWidth" in block ? block.displayWidth : void 0),
|
|
1350
|
+
displayHeight: imageDimension("displayHeight" in block ? block.displayHeight : void 0),
|
|
1351
|
+
alignment: imageAlignment("alignment" in block ? block.alignment : void 0)
|
|
1352
|
+
}, block._key, preserveIdentity)
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Convert code block to ProseMirror
|
|
1357
|
+
*/
|
|
1358
|
+
function convertCodeBlock(block, preserveIdentity) {
|
|
1359
|
+
return {
|
|
1360
|
+
type: "codeBlock",
|
|
1361
|
+
attrs: identityAttrs({ language: block.language || null }, block._key, preserveIdentity),
|
|
1362
|
+
content: block.code ? [{
|
|
1363
|
+
type: "text",
|
|
1364
|
+
text: block.code
|
|
1365
|
+
}] : void 0
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
//#endregion
|
|
1370
|
+
//#region src/plugins/manager.ts
|
|
1371
|
+
/** Options table key prefix for exclusive hook DB reads via PluginManager */
|
|
1372
|
+
const EXCLUSIVE_HOOK_KEY_PREFIX = "emdash:exclusive_hook:";
|
|
1373
|
+
/**
|
|
1374
|
+
* Plugin Manager v2
|
|
1375
|
+
*
|
|
1376
|
+
* Manages the full lifecycle of plugins and coordinates hooks/routes.
|
|
1377
|
+
*/
|
|
1378
|
+
var PluginManager = class {
|
|
1379
|
+
plugins = /* @__PURE__ */ new Map();
|
|
1380
|
+
hookPipeline = null;
|
|
1381
|
+
routeRegistry = null;
|
|
1382
|
+
factoryOptions;
|
|
1383
|
+
initialized = false;
|
|
1384
|
+
constructor(options) {
|
|
1385
|
+
this.options = options;
|
|
1386
|
+
this.factoryOptions = {
|
|
1387
|
+
db: options.db,
|
|
1388
|
+
storage: options.storage,
|
|
1389
|
+
getUploadUrl: options.getUploadUrl,
|
|
1390
|
+
trustedProxyHeaders: options.trustedProxyHeaders,
|
|
1391
|
+
imagePlaceholders: options.imagePlaceholders
|
|
1392
|
+
};
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Set the email pipeline used when creating plugin contexts.
|
|
1396
|
+
* Reinitializes routes/hooks if already initialized so ctx.email is available immediately.
|
|
1397
|
+
*/
|
|
1398
|
+
setEmailPipeline(pipeline) {
|
|
1399
|
+
this.factoryOptions.emailPipeline = pipeline;
|
|
1400
|
+
if (this.initialized) this.reinitialize();
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Register a plugin definition
|
|
1404
|
+
* This resolves the definition and adds it to the manager, but doesn't install it
|
|
1405
|
+
*/
|
|
1406
|
+
register(definition) {
|
|
1407
|
+
const resolved = definePlugin(definition);
|
|
1408
|
+
if (this.plugins.has(resolved.id)) throw new Error(`Plugin "${resolved.id}" is already registered`);
|
|
1409
|
+
this.plugins.set(resolved.id, {
|
|
1410
|
+
plugin: resolved,
|
|
1411
|
+
state: "registered"
|
|
1412
|
+
});
|
|
1413
|
+
this.initialized = false;
|
|
1414
|
+
return resolved;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Register multiple plugins
|
|
1418
|
+
*/
|
|
1419
|
+
registerAll(definitions) {
|
|
1420
|
+
for (const def of definitions) this.register(def);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Unregister a plugin
|
|
1424
|
+
* Plugin must be inactive or just registered
|
|
1425
|
+
*/
|
|
1426
|
+
unregister(pluginId) {
|
|
1427
|
+
const entry = this.plugins.get(pluginId);
|
|
1428
|
+
if (!entry) return false;
|
|
1429
|
+
if (entry.state === "active") throw new Error(`Cannot unregister active plugin "${pluginId}". Deactivate it first.`);
|
|
1430
|
+
this.plugins.delete(pluginId);
|
|
1431
|
+
this.initialized = false;
|
|
1432
|
+
return true;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Install a plugin (run install hooks, set up storage)
|
|
1436
|
+
*/
|
|
1437
|
+
async install(pluginId) {
|
|
1438
|
+
const entry = this.plugins.get(pluginId);
|
|
1439
|
+
if (!entry) throw new Error(`Plugin "${pluginId}" not found`);
|
|
1440
|
+
if (entry.state !== "registered") throw new Error(`Plugin "${pluginId}" is already installed (state: ${entry.state})`);
|
|
1441
|
+
this.ensureInitialized();
|
|
1442
|
+
const results = await this.hookPipeline.runPluginInstall(pluginId);
|
|
1443
|
+
const failed = results.find((r) => !r.success);
|
|
1444
|
+
if (failed) throw new Error(`Plugin install failed: ${failed.error?.message ?? "Unknown error"}`);
|
|
1445
|
+
entry.state = "installed";
|
|
1446
|
+
return results;
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* Activate a plugin (run activate hooks, enable hooks/routes)
|
|
1450
|
+
*/
|
|
1451
|
+
async activate(pluginId) {
|
|
1452
|
+
const entry = this.plugins.get(pluginId);
|
|
1453
|
+
if (!entry) throw new Error(`Plugin "${pluginId}" not found`);
|
|
1454
|
+
if (entry.state === "active") return [];
|
|
1455
|
+
if (entry.state === "registered") await this.install(pluginId);
|
|
1456
|
+
this.ensureInitialized();
|
|
1457
|
+
const results = await this.hookPipeline.runPluginActivate(pluginId);
|
|
1458
|
+
const failed = results.find((r) => !r.success);
|
|
1459
|
+
if (failed) throw new Error(`Plugin activation failed: ${failed.error?.message ?? "Unknown error"}`);
|
|
1460
|
+
entry.state = "active";
|
|
1461
|
+
await setCronTasksEnabled(this.options.db, pluginId, true);
|
|
1462
|
+
this.reinitialize();
|
|
1463
|
+
await this.resolveExclusiveHooks();
|
|
1464
|
+
return results;
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Deactivate a plugin (run deactivate hooks, disable hooks/routes)
|
|
1468
|
+
*/
|
|
1469
|
+
async deactivate(pluginId) {
|
|
1470
|
+
const entry = this.plugins.get(pluginId);
|
|
1471
|
+
if (!entry) throw new Error(`Plugin "${pluginId}" not found`);
|
|
1472
|
+
if (entry.state !== "active") return [];
|
|
1473
|
+
this.ensureInitialized();
|
|
1474
|
+
const results = await this.hookPipeline.runPluginDeactivate(pluginId);
|
|
1475
|
+
await setCronTasksEnabled(this.options.db, pluginId, false);
|
|
1476
|
+
entry.state = "inactive";
|
|
1477
|
+
this.reinitialize();
|
|
1478
|
+
await this.resolveExclusiveHooks();
|
|
1479
|
+
return results;
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Uninstall a plugin (run uninstall hooks, optionally delete data)
|
|
1483
|
+
*/
|
|
1484
|
+
async uninstall(pluginId, deleteData = false) {
|
|
1485
|
+
const entry = this.plugins.get(pluginId);
|
|
1486
|
+
if (!entry) throw new Error(`Plugin "${pluginId}" not found`);
|
|
1487
|
+
if (entry.state === "active") await this.deactivate(pluginId);
|
|
1488
|
+
this.ensureInitialized();
|
|
1489
|
+
const results = await this.hookPipeline.runPluginUninstall(pluginId, deleteData);
|
|
1490
|
+
await this.deleteCronTasks(pluginId);
|
|
1491
|
+
this.plugins.delete(pluginId);
|
|
1492
|
+
this.initialized = false;
|
|
1493
|
+
await this.resolveExclusiveHooks();
|
|
1494
|
+
return results;
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Run content:beforeSave hooks across all active plugins
|
|
1498
|
+
*/
|
|
1499
|
+
async runContentBeforeSave(content, collection, isNew, id, actor, details) {
|
|
1500
|
+
this.ensureInitialized();
|
|
1501
|
+
return this.hookPipeline.runContentBeforeSave(content, collection, isNew, id, actor, details);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Run content:afterSave hooks across all active plugins
|
|
1505
|
+
*/
|
|
1506
|
+
async runContentAfterSave(content, collection, isNew, actor, details) {
|
|
1507
|
+
this.ensureInitialized();
|
|
1508
|
+
return this.hookPipeline.runContentAfterSave(content, collection, isNew, actor, void 0, details);
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Run content:beforeDelete hooks across all active plugins
|
|
1512
|
+
*/
|
|
1513
|
+
async runContentBeforeDelete(id, collection) {
|
|
1514
|
+
this.ensureInitialized();
|
|
1515
|
+
return this.hookPipeline.runContentBeforeDelete(id, collection);
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Run content:afterDelete hooks across all active plugins
|
|
1519
|
+
*/
|
|
1520
|
+
async runContentAfterDelete(id, collection, permanent) {
|
|
1521
|
+
this.ensureInitialized();
|
|
1522
|
+
return this.hookPipeline.runContentAfterDelete(id, collection, permanent);
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Run content:afterPublish hooks across all active plugins
|
|
1526
|
+
*/
|
|
1527
|
+
async runContentAfterPublish(content, collection) {
|
|
1528
|
+
this.ensureInitialized();
|
|
1529
|
+
return this.hookPipeline.runContentAfterPublish(content, collection);
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Run content:afterUnpublish hooks across all active plugins
|
|
1533
|
+
*/
|
|
1534
|
+
async runContentAfterUnpublish(content, collection) {
|
|
1535
|
+
this.ensureInitialized();
|
|
1536
|
+
return this.hookPipeline.runContentAfterUnpublish(content, collection);
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Run content:afterRestore hooks across all active plugins
|
|
1540
|
+
*/
|
|
1541
|
+
async runContentAfterRestore(content, collection) {
|
|
1542
|
+
this.ensureInitialized();
|
|
1543
|
+
return this.hookPipeline.runContentAfterRestore(content, collection);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Run content:afterSchedule hooks across all active plugins
|
|
1547
|
+
*/
|
|
1548
|
+
async runContentAfterSchedule(content, collection) {
|
|
1549
|
+
this.ensureInitialized();
|
|
1550
|
+
return this.hookPipeline.runContentAfterSchedule(content, collection);
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Run content:afterUnschedule hooks across all active plugins
|
|
1554
|
+
*/
|
|
1555
|
+
async runContentAfterUnschedule(content, collection) {
|
|
1556
|
+
this.ensureInitialized();
|
|
1557
|
+
return this.hookPipeline.runContentAfterUnschedule(content, collection);
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* Run media:beforeUpload hooks across all active plugins
|
|
1561
|
+
*/
|
|
1562
|
+
async runMediaBeforeUpload(file) {
|
|
1563
|
+
this.ensureInitialized();
|
|
1564
|
+
return this.hookPipeline.runMediaBeforeUpload(file);
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Run media:afterUpload hooks across all active plugins
|
|
1568
|
+
*/
|
|
1569
|
+
async runMediaAfterUpload(media) {
|
|
1570
|
+
this.ensureInitialized();
|
|
1571
|
+
return this.hookPipeline.runMediaAfterUpload(media);
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Invoke the cron hook for a specific plugin (per-plugin dispatch).
|
|
1575
|
+
* Used as the InvokeCronHookFn callback for CronExecutor.
|
|
1576
|
+
*/
|
|
1577
|
+
async invokeCronHook(pluginId, event) {
|
|
1578
|
+
this.ensureInitialized();
|
|
1579
|
+
const result = await this.hookPipeline.invokeCronHook(pluginId, event);
|
|
1580
|
+
if (!result.success && result.error) throw result.error;
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Invoke a plugin route
|
|
1584
|
+
*/
|
|
1585
|
+
async invokeRoute(pluginId, routeName, options) {
|
|
1586
|
+
this.ensureInitialized();
|
|
1587
|
+
return this.routeRegistry.invoke(pluginId, routeName, options);
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Get all routes for a plugin
|
|
1591
|
+
*/
|
|
1592
|
+
getPluginRoutes(pluginId) {
|
|
1593
|
+
this.ensureInitialized();
|
|
1594
|
+
return this.routeRegistry.getRoutes(pluginId);
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Get a plugin by ID
|
|
1598
|
+
*/
|
|
1599
|
+
getPlugin(pluginId) {
|
|
1600
|
+
return this.plugins.get(pluginId)?.plugin;
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Get plugin state
|
|
1604
|
+
*/
|
|
1605
|
+
getPluginState(pluginId) {
|
|
1606
|
+
return this.plugins.get(pluginId)?.state;
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Get all registered plugins
|
|
1610
|
+
*/
|
|
1611
|
+
getAllPlugins() {
|
|
1612
|
+
return Array.from(this.plugins.values(), (entry) => ({
|
|
1613
|
+
plugin: entry.plugin,
|
|
1614
|
+
state: entry.state
|
|
1615
|
+
}));
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Get all active plugins
|
|
1619
|
+
*/
|
|
1620
|
+
getActivePlugins() {
|
|
1621
|
+
return [...this.plugins.values()].filter((entry) => entry.state === "active").map((entry) => entry.plugin);
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Check if a plugin exists
|
|
1625
|
+
*/
|
|
1626
|
+
hasPlugin(pluginId) {
|
|
1627
|
+
return this.plugins.has(pluginId);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Check if a plugin is active
|
|
1631
|
+
*/
|
|
1632
|
+
isActive(pluginId) {
|
|
1633
|
+
return this.plugins.get(pluginId)?.state === "active";
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Get all plugins that registered a handler for an exclusive hook.
|
|
1637
|
+
*/
|
|
1638
|
+
getExclusiveHookProviders(hookName) {
|
|
1639
|
+
this.ensureInitialized();
|
|
1640
|
+
return this.hookPipeline.getExclusiveHookProviders(hookName).map((p) => {
|
|
1641
|
+
const plugin = this.plugins.get(p.pluginId);
|
|
1642
|
+
return {
|
|
1643
|
+
pluginId: p.pluginId,
|
|
1644
|
+
pluginName: plugin?.plugin.id ?? p.pluginId
|
|
1645
|
+
};
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Read the selected provider for an exclusive hook from the options table.
|
|
1650
|
+
*/
|
|
1651
|
+
async getExclusiveHookSelection(hookName) {
|
|
1652
|
+
return new OptionsRepository(this.options.db).get(`${EXCLUSIVE_HOOK_KEY_PREFIX}${hookName}`);
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Set the selected provider for an exclusive hook in the options table.
|
|
1656
|
+
* Pass null to clear the selection.
|
|
1657
|
+
*/
|
|
1658
|
+
async setExclusiveHookSelection(hookName, pluginId) {
|
|
1659
|
+
const optionsRepo = new OptionsRepository(this.options.db);
|
|
1660
|
+
const key = `${EXCLUSIVE_HOOK_KEY_PREFIX}${hookName}`;
|
|
1661
|
+
if (pluginId === null) {
|
|
1662
|
+
await optionsRepo.delete(key);
|
|
1663
|
+
this.hookPipeline?.clearExclusiveSelection(hookName);
|
|
1664
|
+
return;
|
|
1665
|
+
}
|
|
1666
|
+
const entry = this.plugins.get(pluginId);
|
|
1667
|
+
if (!entry) throw new Error(`Plugin "${pluginId}" not found`);
|
|
1668
|
+
if (entry.state !== "active") throw new Error(`Plugin "${pluginId}" is not active`);
|
|
1669
|
+
await optionsRepo.set(key, pluginId);
|
|
1670
|
+
this.hookPipeline?.setExclusiveSelection(hookName, pluginId);
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Resolution algorithm for exclusive hooks.
|
|
1674
|
+
*
|
|
1675
|
+
* Delegates to the shared resolveExclusiveHooks() function.
|
|
1676
|
+
* See hooks.ts for the full algorithm description.
|
|
1677
|
+
*/
|
|
1678
|
+
async resolveExclusiveHooks(preferredHints) {
|
|
1679
|
+
this.ensureInitialized();
|
|
1680
|
+
const optionsRepo = new OptionsRepository(this.options.db);
|
|
1681
|
+
await resolveExclusiveHooks({
|
|
1682
|
+
pipeline: this.hookPipeline,
|
|
1683
|
+
isActive: (pluginId) => this.isActive(pluginId),
|
|
1684
|
+
getOption: (key) => optionsRepo.get(key),
|
|
1685
|
+
getOptions: (keys) => optionsRepo.getMany(keys),
|
|
1686
|
+
setOption: (key, value) => optionsRepo.set(key, value),
|
|
1687
|
+
deleteOption: async (key) => {
|
|
1688
|
+
await optionsRepo.delete(key);
|
|
1689
|
+
},
|
|
1690
|
+
preferredHints
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* Get all exclusive hooks with their providers and current selections.
|
|
1695
|
+
* Used by the admin API.
|
|
1696
|
+
*/
|
|
1697
|
+
async getExclusiveHooksInfo() {
|
|
1698
|
+
this.ensureInitialized();
|
|
1699
|
+
const exclusiveHookNames = this.hookPipeline.getRegisteredExclusiveHooks();
|
|
1700
|
+
const result = [];
|
|
1701
|
+
for (const hookName of exclusiveHookNames) {
|
|
1702
|
+
const providers = this.hookPipeline.getExclusiveHookProviders(hookName);
|
|
1703
|
+
const selection = await this.getExclusiveHookSelection(hookName);
|
|
1704
|
+
result.push({
|
|
1705
|
+
hookName,
|
|
1706
|
+
providers,
|
|
1707
|
+
selectedPluginId: selection
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
return result;
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Initialize or reinitialize the hook pipeline and route registry
|
|
1714
|
+
*/
|
|
1715
|
+
ensureInitialized() {
|
|
1716
|
+
if (this.initialized) return;
|
|
1717
|
+
const activePlugins = this.getActivePlugins();
|
|
1718
|
+
this.hookPipeline = new HookPipeline(activePlugins, this.factoryOptions);
|
|
1719
|
+
this.routeRegistry = new PluginRouteRegistry(this.factoryOptions);
|
|
1720
|
+
for (const plugin of activePlugins) this.routeRegistry.register(plugin);
|
|
1721
|
+
this.initialized = true;
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Force reinitialization (useful after plugin state changes)
|
|
1725
|
+
*/
|
|
1726
|
+
reinitialize() {
|
|
1727
|
+
this.initialized = false;
|
|
1728
|
+
this.ensureInitialized();
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Delete all cron tasks for a plugin.
|
|
1732
|
+
* Used during uninstall.
|
|
1733
|
+
*/
|
|
1734
|
+
async deleteCronTasks(pluginId) {
|
|
1735
|
+
try {
|
|
1736
|
+
await sql`
|
|
1737
|
+
DELETE FROM _emdash_cron_tasks
|
|
1738
|
+
WHERE plugin_id = ${pluginId}
|
|
1739
|
+
`.execute(this.options.db);
|
|
1740
|
+
} catch {}
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* Create a plugin manager
|
|
1745
|
+
*/
|
|
1746
|
+
function createPluginManager(options) {
|
|
1747
|
+
return new PluginManager(options);
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/plugins/scheduler/node.ts
|
|
1752
|
+
/** Minimum polling interval (ms) — prevents tight loops if next_run_at is in the past */
|
|
1753
|
+
const MIN_INTERVAL_MS = 1e3;
|
|
1754
|
+
/**
|
|
1755
|
+
* Maximum polling interval (ms). Each wake runs the maintenance pass — stale
|
|
1756
|
+
* lock recovery *and* the scheduled-publishing sweep + system cleanup. The cap
|
|
1757
|
+
* is the worst-case latency for scheduled content when no plugin cron task is
|
|
1758
|
+
* due sooner (`getNextDueTime()` only knows about cron tasks, not content
|
|
1759
|
+
* `scheduled_at`). Held at 60s so Node publish latency matches the Cloudflare
|
|
1760
|
+
* Cron Trigger cadence (`* * * * *`) rather than lagging up to five minutes.
|
|
1761
|
+
*/
|
|
1762
|
+
const MAX_INTERVAL_MS = 60 * 1e3;
|
|
1763
|
+
var NodeCronScheduler = class {
|
|
1764
|
+
timer = null;
|
|
1765
|
+
running = false;
|
|
1766
|
+
systemCleanup = null;
|
|
1767
|
+
constructor(executor) {
|
|
1768
|
+
this.executor = executor;
|
|
1769
|
+
}
|
|
1770
|
+
setSystemCleanup(fn) {
|
|
1771
|
+
this.systemCleanup = fn;
|
|
1772
|
+
}
|
|
1773
|
+
start() {
|
|
1774
|
+
this.running = true;
|
|
1775
|
+
this.arm();
|
|
1776
|
+
}
|
|
1777
|
+
stop() {
|
|
1778
|
+
this.running = false;
|
|
1779
|
+
if (this.timer) {
|
|
1780
|
+
clearTimeout(this.timer);
|
|
1781
|
+
this.timer = null;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
reschedule() {
|
|
1785
|
+
if (!this.running) return;
|
|
1786
|
+
if (this.timer) {
|
|
1787
|
+
clearTimeout(this.timer);
|
|
1788
|
+
this.timer = null;
|
|
1789
|
+
}
|
|
1790
|
+
this.arm();
|
|
1791
|
+
}
|
|
1792
|
+
arm() {
|
|
1793
|
+
if (!this.running) return;
|
|
1794
|
+
this.executor.getNextDueTime().then((nextDue) => {
|
|
1795
|
+
if (!this.running) return void 0;
|
|
1796
|
+
let delayMs;
|
|
1797
|
+
if (nextDue) {
|
|
1798
|
+
const dueAt = new Date(nextDue).getTime();
|
|
1799
|
+
delayMs = Math.max(dueAt - Date.now(), MIN_INTERVAL_MS);
|
|
1800
|
+
delayMs = Math.min(delayMs, MAX_INTERVAL_MS);
|
|
1801
|
+
} else delayMs = MAX_INTERVAL_MS;
|
|
1802
|
+
this.timer = setTimeout(() => {
|
|
1803
|
+
if (!this.running) return;
|
|
1804
|
+
this.executeTick();
|
|
1805
|
+
}, delayMs);
|
|
1806
|
+
if (this.timer && typeof this.timer === "object" && "unref" in this.timer) this.timer.unref();
|
|
1807
|
+
}).catch((error) => {
|
|
1808
|
+
console.error("[cron:node] Failed to get next due time:", error);
|
|
1809
|
+
if (this.running) {
|
|
1810
|
+
this.timer = setTimeout(() => this.arm(), MAX_INTERVAL_MS);
|
|
1811
|
+
if (this.timer && typeof this.timer === "object" && "unref" in this.timer) this.timer.unref();
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
executeTick() {
|
|
1816
|
+
if (!this.running) return;
|
|
1817
|
+
const tasks = [this.executor.tick(), this.executor.recoverStaleLocks()];
|
|
1818
|
+
if (this.systemCleanup) tasks.push(this.systemCleanup());
|
|
1819
|
+
Promise.allSettled(tasks).then((results) => {
|
|
1820
|
+
for (const r of results) if (r.status === "rejected") console.error("[cron:node] Tick task failed:", r.reason);
|
|
1821
|
+
}).finally(() => {
|
|
1822
|
+
if (this.running) this.arm();
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
|
|
1827
|
+
//#endregion
|
|
1828
|
+
//#region src/plugins/sandbox/noop.ts
|
|
1829
|
+
/**
|
|
1830
|
+
* Error thrown when attempting to use sandboxing on an unsupported platform.
|
|
1831
|
+
*/
|
|
1832
|
+
var SandboxNotAvailableError = class extends Error {
|
|
1833
|
+
constructor() {
|
|
1834
|
+
super("Plugin sandboxing is not available. Configure a sandbox runner: use @emdash-cms/cloudflare/sandbox on Cloudflare, or @emdash-cms/sandbox-workerd/sandbox on Node.js (requires workerd). Without sandboxing, use trusted plugins (from config) instead.");
|
|
1835
|
+
this.name = "SandboxNotAvailableError";
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
/**
|
|
1839
|
+
* No-op sandbox runner for platforms without isolation support.
|
|
1840
|
+
*
|
|
1841
|
+
* - `isAvailable()` returns false
|
|
1842
|
+
* - `load()` throws SandboxNotAvailableError
|
|
1843
|
+
* - `terminateAll()` is a no-op
|
|
1844
|
+
*
|
|
1845
|
+
* This is the default runner when no platform adapter is configured.
|
|
1846
|
+
*/
|
|
1847
|
+
var NoopSandboxRunner = class {
|
|
1848
|
+
/**
|
|
1849
|
+
* Always returns false - sandboxing is not available.
|
|
1850
|
+
*/
|
|
1851
|
+
isAvailable() {
|
|
1852
|
+
return false;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Always returns false - no sandbox runtime to be healthy.
|
|
1856
|
+
*/
|
|
1857
|
+
isHealthy() {
|
|
1858
|
+
return false;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Always throws - can't load sandboxed plugins without isolation.
|
|
1862
|
+
*/
|
|
1863
|
+
async load(_manifest, _code) {
|
|
1864
|
+
throw new SandboxNotAvailableError();
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* No-op - sandboxing not available, email callback is irrelevant.
|
|
1868
|
+
*/
|
|
1869
|
+
setEmailSend() {}
|
|
1870
|
+
/**
|
|
1871
|
+
* No-op - nothing to terminate.
|
|
1872
|
+
*/
|
|
1873
|
+
async terminateAll() {}
|
|
1874
|
+
};
|
|
1875
|
+
/**
|
|
1876
|
+
* Create a no-op sandbox runner.
|
|
1877
|
+
* This is used as the default when no platform adapter is configured.
|
|
1878
|
+
*/
|
|
1879
|
+
function createNoopSandboxRunner(_options) {
|
|
1880
|
+
return new NoopSandboxRunner();
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
//#endregion
|
|
1884
|
+
//#region src/import/sections.ts
|
|
1885
|
+
/**
|
|
1886
|
+
* Import reusable blocks (wp_block post type) from WXR as sections
|
|
1887
|
+
*
|
|
1888
|
+
* @param posts - All posts from WXR (will filter to wp_block)
|
|
1889
|
+
* @param db - Database connection
|
|
1890
|
+
* @returns Import result with counts
|
|
1891
|
+
*/
|
|
1892
|
+
async function importReusableBlocksAsSections(posts, db) {
|
|
1893
|
+
const result = {
|
|
1894
|
+
sectionsCreated: 0,
|
|
1895
|
+
sectionsSkipped: 0,
|
|
1896
|
+
errors: []
|
|
1897
|
+
};
|
|
1898
|
+
const reusableBlocks = posts.filter((post) => post.postType === "wp_block");
|
|
1899
|
+
if (reusableBlocks.length === 0) return result;
|
|
1900
|
+
for (const block of reusableBlocks) try {
|
|
1901
|
+
const slug = block.postName || slugify(block.title || `block-${block.id || Date.now()}`);
|
|
1902
|
+
if (await db.selectFrom("_emdash_sections").select("id").where("slug", "=", slug).executeTakeFirst()) {
|
|
1903
|
+
result.sectionsSkipped++;
|
|
1904
|
+
continue;
|
|
1905
|
+
}
|
|
1906
|
+
const content = block.content ? gutenbergToPortableText(block.content) : [];
|
|
1907
|
+
const id = ulid$1();
|
|
1908
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1909
|
+
await db.insertInto("_emdash_sections").values({
|
|
1910
|
+
id,
|
|
1911
|
+
slug,
|
|
1912
|
+
title: block.title || "Untitled Block",
|
|
1913
|
+
description: null,
|
|
1914
|
+
keywords: null,
|
|
1915
|
+
content: JSON.stringify(content),
|
|
1916
|
+
preview_media_id: null,
|
|
1917
|
+
source: "import",
|
|
1918
|
+
theme_id: null,
|
|
1919
|
+
created_at: now,
|
|
1920
|
+
updated_at: now
|
|
1921
|
+
}).execute();
|
|
1922
|
+
result.sectionsCreated++;
|
|
1923
|
+
} catch (error) {
|
|
1924
|
+
result.errors.push({
|
|
1925
|
+
title: block.title || "Untitled Block",
|
|
1926
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
return result;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
//#endregion
|
|
1933
|
+
//#region src/preview/helpers.ts
|
|
1934
|
+
/**
|
|
1935
|
+
* Preview helpers for Astro pages
|
|
1936
|
+
*/
|
|
1937
|
+
/**
|
|
1938
|
+
* Check if a request is a preview request
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* ```ts
|
|
1942
|
+
* const isPreview = isPreviewRequest(Astro.url);
|
|
1943
|
+
* ```
|
|
1944
|
+
*/
|
|
1945
|
+
function isPreviewRequest(url) {
|
|
1946
|
+
return url.searchParams.has("_preview");
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Get the preview token from a URL
|
|
1950
|
+
*
|
|
1951
|
+
* @example
|
|
1952
|
+
* ```ts
|
|
1953
|
+
* const token = getPreviewToken(Astro.url);
|
|
1954
|
+
* ```
|
|
1955
|
+
*/
|
|
1956
|
+
function getPreviewToken(url) {
|
|
1957
|
+
return url.searchParams.get("_preview");
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
//#endregion
|
|
1961
|
+
//#region src/comments/ranking.ts
|
|
1962
|
+
/**
|
|
1963
|
+
* Comment ranking utilities (Tier 1 of the best-in-class comments RFC).
|
|
1964
|
+
*
|
|
1965
|
+
* Wilson score lower-bound (95% confidence) — the same primitive Reddit uses
|
|
1966
|
+
* for its "Best" comment sort. Ranks by the statistical lower bound of the
|
|
1967
|
+
* positive-reaction proportion rather than the raw count, so a comment with a
|
|
1968
|
+
* couple of reactions can't outrank a heavily-reacted one until it earns
|
|
1969
|
+
* confidence, and a late-but-popular comment still rises (submission time is
|
|
1970
|
+
* irrelevant).
|
|
1971
|
+
*
|
|
1972
|
+
* Positive-only reactions (the recommended default) degrade gracefully: with
|
|
1973
|
+
* `down = 0` the score still increases monotonically with `up` while penalising
|
|
1974
|
+
* low-sample comments — wilson(1,0) ≈ 0.21, wilson(10,0) ≈ 0.73,
|
|
1975
|
+
* wilson(200,0) ≈ 0.98.
|
|
1976
|
+
*/
|
|
1977
|
+
/** z for a 95% two-sided confidence interval. */
|
|
1978
|
+
const DEFAULT_Z = 1.96;
|
|
1979
|
+
/** Reactions that count against a comment when both signals are in use. */
|
|
1980
|
+
const NEGATIVE_REACTIONS = new Set(["dislike", "down"]);
|
|
1981
|
+
/**
|
|
1982
|
+
* Wilson score lower bound of the positive proportion.
|
|
1983
|
+
*
|
|
1984
|
+
* @param up count of positive reactions
|
|
1985
|
+
* @param down count of negative reactions
|
|
1986
|
+
* @returns a score in [0, 1]; 0 when there are no reactions
|
|
1987
|
+
*/
|
|
1988
|
+
function wilsonLowerBound(up, down, z = DEFAULT_Z) {
|
|
1989
|
+
const n = up + down;
|
|
1990
|
+
if (n <= 0) return 0;
|
|
1991
|
+
const phat = up / n;
|
|
1992
|
+
const z2 = z * z;
|
|
1993
|
+
const denom = 1 + z2 / n;
|
|
1994
|
+
return (phat + z2 / (2 * n) - z * Math.sqrt((phat * (1 - phat) + z2 / (4 * n)) / n)) / denom;
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Reduce a per-reaction count map to a single rank score via the Wilson
|
|
1998
|
+
* lower bound. Any reaction not in {@link NEGATIVE_REACTIONS} is treated as
|
|
1999
|
+
* positive, so the positive-only default (just `like`) works without special
|
|
2000
|
+
* casing.
|
|
2001
|
+
*/
|
|
2002
|
+
function reactionScore(counts) {
|
|
2003
|
+
let up = 0;
|
|
2004
|
+
let down = 0;
|
|
2005
|
+
for (const [reaction, count] of Object.entries(counts)) if (NEGATIVE_REACTIONS.has(reaction)) down += count;
|
|
2006
|
+
else up += count;
|
|
2007
|
+
return wilsonLowerBound(up, down);
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
//#endregion
|
|
2011
|
+
//#region src/comments/query.ts
|
|
2012
|
+
/**
|
|
2013
|
+
* Get approved comments for a content item.
|
|
2014
|
+
*
|
|
2015
|
+
* @example
|
|
2016
|
+
* ```ts
|
|
2017
|
+
* import { getComments } from "emdash";
|
|
2018
|
+
*
|
|
2019
|
+
* const { items, total } = await getComments({
|
|
2020
|
+
* collection: "posts",
|
|
2021
|
+
* contentId: post.id,
|
|
2022
|
+
* threaded: true,
|
|
2023
|
+
* });
|
|
2024
|
+
* ```
|
|
2025
|
+
*/
|
|
2026
|
+
async function getComments(options) {
|
|
2027
|
+
const sort = options.sort ?? "oldest";
|
|
2028
|
+
const withReactions = options.reactions || sort === "best";
|
|
2029
|
+
const threaded = options.threaded ? "t" : "f";
|
|
2030
|
+
return cachedQuery({
|
|
2031
|
+
namespace: CacheNamespace.COMMENTS,
|
|
2032
|
+
key: `comments:${options.collection}:${options.contentId}:${threaded}:${withReactions ? "r" : "n"}:${sort}`,
|
|
2033
|
+
load: async () => {
|
|
2034
|
+
return getCommentsWithDb(await getDb(), options);
|
|
2035
|
+
}
|
|
2036
|
+
});
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* Get approved comments with an explicit db handle.
|
|
2040
|
+
*
|
|
2041
|
+
* @internal Use `getComments()` in templates. This variant is for routes
|
|
2042
|
+
* that already have a database handle.
|
|
2043
|
+
*/
|
|
2044
|
+
async function getCommentsWithDb(db, options) {
|
|
2045
|
+
const repo = new CommentRepository(db);
|
|
2046
|
+
const result = await repo.findByContent(options.collection, options.contentId, {
|
|
2047
|
+
status: "approved",
|
|
2048
|
+
limit: 500
|
|
2049
|
+
});
|
|
2050
|
+
const total = result.nextCursor === void 0 ? result.items.length : await repo.countByContent(options.collection, options.contentId, "approved");
|
|
2051
|
+
const items = options.threaded ? CommentRepository.assembleThreads(result.items).map((c) => CommentRepository.toPublicComment(c)) : result.items.map((c) => CommentRepository.toPublicComment(c));
|
|
2052
|
+
if (options.reactions || options.sort === "best") {
|
|
2053
|
+
await attachReactions(db, items);
|
|
2054
|
+
if (options.sort === "best") sortByBest(items);
|
|
2055
|
+
}
|
|
2056
|
+
return {
|
|
2057
|
+
items,
|
|
2058
|
+
total
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Attach aggregate reaction counts to a list of public comments (and their
|
|
2063
|
+
* replies), in a single batched query.
|
|
2064
|
+
*/
|
|
2065
|
+
async function attachReactions(db, items) {
|
|
2066
|
+
const ids = [];
|
|
2067
|
+
for (const comment of items) {
|
|
2068
|
+
ids.push(comment.id);
|
|
2069
|
+
if (comment.replies) for (const reply of comment.replies) ids.push(reply.id);
|
|
2070
|
+
}
|
|
2071
|
+
if (ids.length === 0) return;
|
|
2072
|
+
const counts = await new CommentReactionRepository(db).countsForComments(ids);
|
|
2073
|
+
const assign = (comment) => {
|
|
2074
|
+
const reactions = counts.get(comment.id);
|
|
2075
|
+
if (reactions) comment.reactions = reactions;
|
|
2076
|
+
};
|
|
2077
|
+
for (const comment of items) {
|
|
2078
|
+
assign(comment);
|
|
2079
|
+
comment.replies?.forEach(assign);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Sort top-level comments by Wilson-scored reactions (descending), tie-broken
|
|
2084
|
+
* by oldest-first to keep ordering stable.
|
|
2085
|
+
*/
|
|
2086
|
+
function sortByBest(items) {
|
|
2087
|
+
items.sort((a, b) => {
|
|
2088
|
+
const scoreDelta = reactionScore(b.reactions ?? {}) - reactionScore(a.reactions ?? {});
|
|
2089
|
+
if (scoreDelta !== 0) return scoreDelta;
|
|
2090
|
+
if (a.createdAt < b.createdAt) return -1;
|
|
2091
|
+
if (a.createdAt > b.createdAt) return 1;
|
|
2092
|
+
return 0;
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Get the count of approved comments for a content item.
|
|
2097
|
+
*
|
|
2098
|
+
* @example
|
|
2099
|
+
* ```ts
|
|
2100
|
+
* import { getCommentCount } from "emdash";
|
|
2101
|
+
*
|
|
2102
|
+
* const count = await getCommentCount("posts", post.id);
|
|
2103
|
+
* ```
|
|
2104
|
+
*/
|
|
2105
|
+
async function getCommentCount(collection, contentId) {
|
|
2106
|
+
return getCommentCountWithDb(await getDb(), collection, contentId);
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Get comment count with an explicit db handle.
|
|
2110
|
+
*
|
|
2111
|
+
* @internal Use `getCommentCount()` in templates.
|
|
2112
|
+
*/
|
|
2113
|
+
async function getCommentCountWithDb(db, collection, contentId) {
|
|
2114
|
+
return new CommentRepository(db).countByContent(collection, contentId, "approved");
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
//#endregion
|
|
2118
|
+
export { BlockTypeRegistry, CAPABILITY_RENAMES, CacheNamespace, CommentRepository, ContentRepository, ContentSaveRejectedError, CronAccessImpl, DEFAULT_PLUGIN_MEDIA_READ_BYTES, EmDashConfigurationError, EmDashDatabaseError, EmDashStorageError, EmDashValidationError, FIELD_TYPE_TO_COLUMN, FTSManager, HookPipeline, InvalidCursorError, MAX_PLUGIN_MEDIA_READ_BYTES, MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH, MIGRATION_NAMES, MediaRepository, NodeCronScheduler, NoopSandboxRunner, OptionsRepository, PLUGIN_HTTP_MAX_REQUEST_BYTES, PLUGIN_HTTP_MAX_RESPONSE_BYTES, PluginManager, PluginRouteError, PluginSettingEncryptionError, PluginStorageRepository, RESERVED_COLLECTION_SLUGS, RESERVED_FIELD_SLUGS, RedirectAccessError, RevisionRepository, SANDBOX_HOOK_RESULT_VERSION, SCHEDULED_POLICY_REJECTION_PREFIX, SEARCH_TOKENIZERS, SandboxNotAvailableError, SandboxUnavailableError, SchemaError, SchemaRegistry, SearchUnavailableError, StorageSerializationError, UserRepository, adaptSandboxEntry, after, applySeed, bufferPluginHttpRequest, buildPreviewUrl, cachedQuery, clearSources, computeContentHash, contentNamespace, contentNamespaces, createBylineAccess, createCommentAccess, createContentAccess, createContentAccessWithWrite, createEditable, createHookPipeline, createHttpAccess, createMediaAccess, createNoop, createNoopSandboxRunner, createPluginManager, createPluginSecretRedactor, createRedirectAccess, createSandboxRouteError, createSandboxRouteErrorEnvelope, createSchemaAccess, createSettingsAccess, createUnrestrictedHttpAccess, decodePluginSettingValue, decodeSlug, definePlugin, definePluginRoute, encryptPluginSetting, expandCollectionBlockFields, extractPlainText, extractSearchableFields, file, generateManifest, generatePlaceholder, generatePreviewToken, getAllSources, getAllTermsForEntries, getByline, getBylineBySlug, getCollectionInfo, getCommentCount, getComments, getContentSeo, getEditMeta, getEmDashCollection, getEmDashEntry, getEmDashReferences, getEntriesByByline, getEntriesByTerm, getEntryTerms, getExactMigrationStatus, getFallbackChain, getFileSources, getHreflangAlternates, getI18nConfig, getMenu, getMenuWithCacheHint, getMenus, getMigrationStatus, getPluginSetting, getPluginSettings, getPreviewToken, getPreviewUrl, getRequestContext, getSandboxRouteErrorDetails, getSandboxRouteErrorEnvelope, getSearchStats, getSection, getSections, getSeoMeta, getSiteSetting, getSiteSettings, getSiteSettingsWithCacheHint, getSource, getSuggestions, getTaxonomyDef, getTaxonomyDefs, getTaxonomyTerms, getTaxonomyTermsWithCacheHint, getTerm, getTermsForEntries, getTranslations, getUrlSources, getWidgetArea, getWidgetAreaWithCacheHint, getWidgetAreas, getWidgetComponents, handleContentAuthors, handleContentCompare, handleContentCountScheduled, handleContentCountTrashed, handleContentCreate, handleContentDelete, handleContentDiscardDraft, handleContentDuplicate, handleContentGet, handleContentGetIncludingTrashed, handleContentList, handleContentListTrashed, handleContentPermanentDelete, handleContentPublish, handleContentRestore, handleContentSchedule, handleContentTranslations, handleContentUnpublish, handleContentUnschedule, handleContentUpdate, handleMediaCreate, handleMediaDelete, handleMediaGet, handleMediaList, handleMediaRegisterUpload, handleMediaReplaceMetadata, handleMediaUpdate, handleMediaUsageActivationAdvance, handleMediaUsageProgress, handleMediaUsageRepair, handleRevisionGet, handleRevisionList, handleRevisionRestore, handleScheduledPolicyRejection, hashString, image, importReusableBlocksAsSections, inspectSandboxHookResult, invalidateBylineObjectCache, invalidateCollectionCache, invalidateCommentObjectCache, invalidateMenuObjectCache, invalidateObjectCache, invalidateSchemaObjectCache, invalidateTaxonomyObjectCache, invalidateTermCache, invalidateWidgetObjectCache, isContentSaveRejection, isDeprecatedCapability, isEncryptedPluginSetting, isI18nEnabled, isPreviewRequest, isSafeHref, isScheduledPolicyRejection, normalizeBlocksData, normalizeCapabilities, normalizeCapability, normalizeMediaValue, normalizePluginCapabilities, parseContentId, parsePluginMediaMetadataPatch, parseWxr, parseWxrDate, parseWxrString, pluginHttpRedirectAction, pluginHttpResponseFromWire, pluginHttpResponseToWire, pluginManifestSchema, pluginResponse, portableText, portableTextIdentityExtensions, portableTextToProsemirror, probeUrl, prosemirrorToPortableText, readPluginHttpBytes, readPluginMediaBytes, reference, registerSource, resolveBlockTypes, resolveContentCreateLocale, resolveEmDashPath, resolvePluginEncryptionKeys, rewritePluginHttpRedirect, runWithContext, sanitizeHref, scheduledPolicyRejectionKey, search, searchCollection, searchWithDb, setSiteSettings, slugify, toPluginMediaItem, ulid, updatePluginMediaMetadata, validateSeed, verifyPreviewToken, wordpressRestSource, wxrSource };
|
|
2119
|
+
//# sourceMappingURL=index.mjs.map
|