dineway 0.1.44 → 0.1.46
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/{activity-events-CpcTzKpF.mjs → activity-events-CNk3clTT.mjs} +1 -1
- package/dist/{allowed-origins-3RuuoFjC.mjs → allowed-origins-DhipQNLb.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -10
- package/dist/api/route-utils.mjs +13 -13
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +4 -4
- package/dist/{api-x5yKhnAw.mjs → api-Bmfii2mH.mjs} +101 -56
- package/dist/{api-tokens-BFg7tiOQ.mjs → api-tokens-DtvdtIkm.mjs} +1 -1
- package/dist/{apply-TIoQ00aH.mjs → apply-BpRBCqUt.mjs} +76 -31
- package/dist/astro/index.d.mts +10 -11
- package/dist/astro/index.mjs +23 -3
- package/dist/astro/middleware/auth.d.mts +9 -10
- package/dist/astro/middleware/auth.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +13 -7
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +120 -82
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +17 -17
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +7 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +17 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +9 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +38 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +31 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +7 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +24 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +27 -27
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +57 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs +30 -26
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +11 -11
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +23 -23
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +23 -23
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +27 -27
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +27 -27
- package/dist/astro/routes/api/admin/context/diff.mjs +26 -26
- package/dist/astro/routes/api/admin/context/index.mjs +27 -27
- package/dist/astro/routes/api/admin/context/stale.mjs +26 -26
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +23 -23
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +26 -26
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +26 -26
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +24 -24
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +48 -44
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +48 -44
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/updates.mjs +42 -38
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +26 -26
- package/dist/astro/routes/api/admin/review-requests/index.mjs +9 -9
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +42 -38
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/index.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -8
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +20 -11
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -8
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -9
- package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/request.mjs +8 -8
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +20 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +12 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +7 -7
- package/dist/astro/routes/api/import/wordpress/execute.mjs +29 -28
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +31 -31
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +5 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +16 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +30 -30
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +31 -30
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +75 -50
- package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -8
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +10 -10
- package/dist/astro/routes/api/media.mjs +14 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/items.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/translations.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_.mjs +27 -27
- package/dist/astro/routes/api/menus/index.mjs +27 -27
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +10 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +28 -28
- package/dist/astro/routes/api/redirects/index.mjs +28 -28
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/index.mjs +43 -39
- package/dist/astro/routes/api/schema/index.mjs +7 -7
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +42 -38
- package/dist/astro/routes/api/schema/orphans/index.mjs +42 -38
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +27 -27
- package/dist/astro/routes/api/sections/index.mjs +27 -27
- package/dist/astro/routes/api/settings/email.mjs +3 -3
- package/dist/astro/routes/api/settings.mjs +27 -27
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +9 -9
- package/dist/astro/routes/api/setup/dev-bypass.mjs +24 -23
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +25 -24
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/index.mjs +30 -29
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +26 -26
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +27 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +27 -27
- package/dist/astro/routes/api/widget-areas/_name_.mjs +25 -25
- package/dist/astro/routes/api/widget-areas/index.mjs +27 -27
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +7 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +59 -15
- package/dist/astro/routes/sitemap.xml.mjs +8 -8
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +3 -3
- package/dist/astro/types.d.mts +16 -14
- package/dist/{audit-NgiRzqP9.mjs → audit-DuRbTm8L.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-1FHtkDP6.mjs → auth-control-guard-Dr14I98m.mjs} +1 -1
- package/dist/{authorize-BbIhZi3a.mjs → authorize-BLO0m7fW.mjs} +1 -1
- package/dist/{briefing-Jsxs587i.mjs → briefing-BFEWeJtR.mjs} +6 -6
- package/dist/{briefing-DD82WaEy.mjs → briefing-C4fJSVYW.mjs} +1 -1
- package/dist/byline-CXQcMsBu.mjs +628 -0
- package/dist/{bylines-DaXfz8wy.d.mts → byline-fields-CaF_xfpj.d.mts} +159 -28
- package/dist/{import-Br7aP9yh.mjs → byline-fields-D7TJ_oHF.mjs} +57 -3
- package/dist/byline-fields-Dc7L6Yry.mjs +113 -0
- package/dist/byline-registry-CL8BxPPp.mjs +287 -0
- package/dist/bylines-BgriNlW7.mjs +165 -0
- package/dist/bylines-D2vqm1aZ.mjs +163 -0
- package/dist/{cache-DQyZ-QaB.mjs → cache-GRK71jOU.mjs} +2 -2
- package/dist/{chunks-D8KL0nCY.mjs → chunks-DgEw12Bc.mjs} +1 -1
- package/dist/cli/index.mjs +958 -89
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +2 -1
- package/dist/client/index.mjs +5 -2
- package/dist/{comment-BmJXz3lc.mjs → comment-ogMaF1gk.mjs} +1 -1
- package/dist/{comments-yTbeIYc2.mjs → comments-CTSOKrZq.mjs} +1 -1
- package/dist/{connection-BCNICDWN.mjs → connection-CiJWiWya.mjs} +44 -13
- package/dist/{content-DvpMad_N.mjs → content-BfyjOiMi.mjs} +24 -4
- package/dist/content-index-names-Bbu1FY1r.mjs +26 -0
- package/dist/{context-cudavuns.mjs → context-DRhmPCiE.mjs} +2 -2
- package/dist/{context-Ufrm1lOv.mjs → context-ZMHhwzkG.mjs} +8 -8
- package/dist/{context-route-helpers--PJWR-5R.mjs → context-route-helpers-YLWx2N1j.mjs} +1 -1
- package/dist/{dashboard-BC9bgPOH.mjs → dashboard-D0gWuzNp.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.mjs +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/{device-flow-CTS91g4A.mjs → device-flow-BL5ZRlc1.mjs} +4 -4
- package/dist/{dialect-helpers-TkdbkFad.mjs → dialect-helpers-fk43GbDb.mjs} +13 -3
- package/dist/{fts-manager-DnfOsF4s.mjs → fts-manager-EHY2Kes9.mjs} +2 -2
- package/dist/{hitl-requests-Us2A4Vj5.mjs → hitl-requests-B4Hkt0TO.mjs} +2 -2
- package/dist/{hitl-route-helpers-DcPySbZ3.mjs → hitl-route-helpers-CHjdfQ0s.mjs} +4 -4
- package/dist/{import-DSXK3aQF.mjs → import-CvHY6sf5.mjs} +3 -3
- package/dist/{index-BwOO3vu2.d.mts → index-DJVaYiUV.d.mts} +2 -2
- package/dist/index.d.mts +16 -17
- package/dist/index.mjs +69 -65
- package/dist/{jsonld-CLbYsYYH.d.mts → jsonld-AcPnCEGD.d.mts} +2 -2
- package/dist/{load-BCCcmoW9.mjs → load-BdbvtoDb.mjs} +1 -1
- package/dist/{loader-p2imNN98.mjs → loader-Y0QvC_QO.mjs} +167 -61
- package/dist/media/index.d.mts +1 -2
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -12
- package/dist/media/local-runtime.mjs +2 -2
- package/dist/{media-Cg4zc9fq.mjs → media-DhBwiCYR.mjs} +6 -1
- package/dist/{media-allowlist-D8gsm8_t.mjs → media-allowlist-BsXkT9RK.mjs} +1 -1
- package/dist/{menus-DOaL6NaF.mjs → menus-BzGQpw9d.mjs} +2 -2
- package/dist/{menus-DzG3-9tQ.mjs → menus-fqqzXyHd.mjs} +5 -5
- package/dist/{oauth-authorization-DyOFXQWq.mjs → oauth-authorization-Dk3_LOfj.mjs} +4 -4
- package/dist/{oauth-clients-BMs_bmoz.mjs → oauth-clients-CzeMGyUU.mjs} +2 -2
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-D7Tu6ku4.mjs → parse-CneSgl7-.mjs} +1 -1
- package/dist/{types-cn-fvYQ1.d.mts → placeholder-CXfoCtCd.d.mts} +38 -1
- package/dist/plugin-utils.d.mts +22 -10
- package/dist/plugin-utils.mjs +8 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-DCDVDF4B.mjs → plugins-BQ5Joz6v.mjs} +36 -6
- package/dist/{preview-BhgxNRWI.mjs → preview-D5rvDhRt.mjs} +7 -7
- package/dist/{provider-loader-B19YyyBp.d.mts → provider-loader-B5PMjpN7.d.mts} +1 -1
- package/dist/{query-BnRpB09I.mjs → query-BJuUydtD.mjs} +3 -3
- package/dist/{query-DHvNhBhi.mjs → query-CSx0EdSW.mjs} +30 -18
- package/dist/{rate-limit-BWP_kKiZ.mjs → rate-limit-i0G3IAOX.mjs} +2 -2
- package/dist/{redirect-BaVvo2te.mjs → redirect-BqFMj67n.mjs} +20 -6
- package/dist/{redirects-Ba-lJA5j.mjs → redirects-CJwHl_YG.mjs} +3 -3
- package/dist/{redirects-x5ol_Qj9.mjs → redirects-q_cToaHv.mjs} +29 -8
- package/dist/{registry-i__XP2WV.mjs → registry-Cq3QRBW2.mjs} +14 -5
- package/dist/{request-cache-BpwuE2ix.mjs → request-cache-w5cj5itT.mjs} +9 -1
- package/dist/{request-meta-DUGfAeXy.mjs → request-meta-DAb6xaP9.mjs} +1 -1
- package/dist/resolve-DTuDyYKs.mjs +100 -0
- package/dist/{review-requests-DuIxM4YM.mjs → review-requests-GYqjl2jO.mjs} +1 -1
- package/dist/{review-requests-CTUU_RJm.mjs → review-requests-tPw8_pAO.mjs} +1 -1
- package/dist/{runner-FhUNNaqA.d.mts → runner-Cnz4dl0f.d.mts} +1 -1
- package/dist/{runner-DF2DgD_B.mjs → runner-DTfG5v0G.mjs} +574 -196
- package/dist/{runtime-C4ZgKk6r.d.mts → runtime-Cd-kjPfN.d.mts} +1156 -274
- package/dist/runtime.d.mts +10 -11
- package/dist/runtime.mjs +4 -4
- package/dist/schema-DmHMWnSA.mjs +8 -0
- package/dist/{search-Cl9preJT.mjs → search-BAiFLz81.mjs} +3 -3
- package/dist/{sections-Zx-2q9IH.mjs → sections-DsuIrFDC.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +18 -17
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -0
- package/dist/{seo-CJBiMDkj.mjs → seo-5lJOtB5J.mjs} +4 -2
- package/dist/{seo-BPb_reaG.mjs → seo-uMFBaR8G.mjs} +1 -1
- package/dist/{service-wPGgmbUa.mjs → service-CifrxCru.mjs} +2 -2
- package/dist/{settings-nr15a8uv.mjs → settings-BYGdocdj.mjs} +2 -2
- package/dist/{settings-DORe02PC.mjs → settings-DNRQuX3d.mjs} +3 -3
- package/dist/{site-activity-KFZprBZM.mjs → site-activity-6x1JccoR.mjs} +1 -1
- package/dist/{site-context-DuBQk6Mp.mjs → site-context-sN12ehZF.mjs} +13 -13
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-DGaw_-aU.mjs → taxonomies-CQFmkP5u.mjs} +3 -3
- package/dist/{taxonomies-BVBKoXRf.mjs → taxonomies-faQVeMgj.mjs} +7 -32
- package/dist/{taxonomy-BvXRL85P.mjs → taxonomy-BnH-6VsX.mjs} +2 -2
- package/dist/{types-DvwHUku7.d.mts → types-B7_vSiPD.d.mts} +16 -0
- package/dist/{types-D1DjBFA9.mjs → types-Ck7-WoUD.mjs} +1 -1
- package/dist/{types-t7_nCCA9.d.mts → types-DEAQG87T.d.mts} +2 -56
- package/dist/{types-C-CMfzSl.d.mts → types-DYKtk8f1.d.mts} +31 -0
- package/dist/{types-C3Em8xpG.mjs → types-DbZhHtqS.mjs} +23 -1
- package/dist/{types-BIM7jwxr.d.mts → types-UGmU5sWx.d.mts} +1 -1
- package/dist/types-nP9vGUFq.d.mts +56 -0
- package/dist/ui/server-runtime.d.mts +13 -7
- package/dist/ui/server-runtime.mjs +18 -17
- package/dist/{user-2aI21yV1.mjs → user-CqZwN21P.mjs} +1 -1
- package/dist/{validate-CvQ6cvHH.d.mts → validate-BJuG-ISL.d.mts} +21 -3
- package/dist/{validate-JE-WfUQ5.mjs → validate-CK4a1sIF.mjs} +22 -2
- package/dist/version-Cg6ur4zS.mjs +6 -0
- package/dist/{widgets-Cj6ULpED.mjs → widgets-CdDvF4fV.mjs} +2 -2
- package/dist/{wordpress-slugs-hqItqJrQ.mjs → wordpress-slugs-B6Gw9q3Q.mjs} +1 -1
- package/dist/{zod-generator-C4BgFBZV.mjs → zod-generator-D1ROBNuC.mjs} +2 -2
- package/package.json +7 -8
- package/src/components/InlinePortableTextEditor.tsx +66 -0
- package/src/components/code-block-languages.ts +76 -0
- package/src/components/inline-code-block.tsx +241 -0
- package/dist/byline-DpNNSjET.mjs +0 -219
- package/dist/bylines-75_STR73.mjs +0 -114
- package/dist/chunk-ClPoSABd.mjs +0 -21
- package/dist/db-errors-DHJCB_gY.mjs +0 -23
- package/dist/index-Ct0pjZwW.d.mts +0 -835
- package/dist/placeholder-BZpCpid_.d.mts +0 -40
- package/dist/schema-U-SeFWwn.mjs +0 -8
- package/dist/version-PioVgJAl.mjs +0 -6
- /package/dist/{adapters-kZjS7plb.d.mts → adapters-OQCImOL7.d.mts} +0 -0
- /package/dist/{api-tokens-L0o9Bd7v.mjs → api-tokens-CYUoFGo7.mjs} +0 -0
- /package/dist/{challenge-store-cJam-E5R.mjs → challenge-store-CRSz-Xim.mjs} +0 -0
- /package/dist/{components-BJfa-F6n.mjs → components--pg6zBvu.mjs} +0 -0
- /package/dist/{config-XW5tMrH8.mjs → config-CVssduLe.mjs} +0 -0
- /package/dist/{context-types-BrSQNye5.mjs → context-types-DQh_XKkn.mjs} +0 -0
- /package/dist/{cron-D7FDsRu-.mjs → cron-DxCAU_Sn.mjs} +0 -0
- /package/dist/{default-5A3XVR7L.mjs → default-BHauvIdG.mjs} +0 -0
- /package/dist/{email-console-Bs1qKx59.mjs → email-console-BOVqIYpB.mjs} +0 -0
- /package/dist/{error-DLkgOP5m.mjs → error-DCSuUAZW.mjs} +0 -0
- /package/dist/{escape-r8_GbEU2.mjs → escape-BDgouFFY.mjs} +0 -0
- /package/dist/{experimental-workflows-BbZbIEZp.mjs → experimental-workflows-Dh4DUoD_.mjs} +0 -0
- /package/dist/{hash-DFFrkivP.mjs → hash-BPmX6P8I.mjs} +0 -0
- /package/dist/{manifest-schema-C6fzQoWn.mjs → manifest-schema-qh2P7RDX.mjs} +0 -0
- /package/dist/{mime-DYP4V5Ks.mjs → mime-8pAB8-77.mjs} +0 -0
- /package/dist/{mode-Bd55iLcP.mjs → mode-CpyEz8pe.mjs} +0 -0
- /package/dist/{normalize-BY_EJnd9.mjs → normalize-O-hi3a27.mjs} +0 -0
- /package/dist/{oauth-state-store-BRSUEkmx.mjs → oauth-state-store-qncPB_IU.mjs} +0 -0
- /package/dist/{oauth-user-lookup-DdcI8ZVL.mjs → oauth-user-lookup-BFjWF8wK.mjs} +0 -0
- /package/dist/{parser-egIGEco-.mjs → parser-DxfsARXL.mjs} +0 -0
- /package/dist/{passkey-config-AX4sjpQ4.mjs → passkey-config-DzHQK90v.mjs} +0 -0
- /package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +0 -0
- /package/dist/{placeholder-b0Ufu0La.mjs → placeholder-BDo81Is5.mjs} +0 -0
- /package/dist/{provider-loader-BdRV01gr.mjs → provider-loader-DzUxejk7.mjs} +0 -0
- /package/dist/{public-url-BL2r8dmQ.mjs → public-url-DLUM5OOv.mjs} +0 -0
- /package/dist/{redirect-Ce_6Yb6z.mjs → redirect-BjIBtDWY.mjs} +0 -0
- /package/dist/{secrets-DfeNNoLa.mjs → secrets-CN6FCpcB.mjs} +0 -0
- /package/dist/{seo-contributions-C0LXoWw3.mjs → seo-contributions-CqVvReEj.mjs} +0 -0
- /package/dist/{setup-complete-C2ztsNhJ.mjs → setup-complete-BytMc6HO.mjs} +0 -0
- /package/dist/{setup-nonce-BTKq7uBi.mjs → setup-nonce-pyGfc9hV.mjs} +0 -0
- /package/dist/{sidecar-client-lrf7ErYJ.mjs → sidecar-client-mJxwayYN.mjs} +0 -0
- /package/dist/{site-url-C18yBhtv.mjs → site-url-C-cu8Ff2.mjs} +0 -0
- /package/dist/{ssrf-KAIQS48_.mjs → ssrf-DiKqWd3N.mjs} +0 -0
- /package/dist/{tokens-CsP8Se8S.mjs → tokens-CjSgb0AC.mjs} +0 -0
- /package/dist/{transport-nNEGdHkI.d.mts → transport-DidKKxvW.d.mts} +0 -0
- /package/dist/{transport-B7kO-4ee.mjs → transport-LSdZVXHF.mjs} +0 -0
- /package/dist/{trusted-proxy-Bbm6PLR6.mjs → trusted-proxy-BgIIcbsN.mjs} +0 -0
- /package/dist/{types-CNNQ8l0v.mjs → types-Cg276-3z.mjs} +0 -0
- /package/dist/{types-BYjPylrZ.d.mts → types-DZpT-PnG.d.mts} +0 -0
- /package/dist/{types-BgE6gMFI.d.mts → types-Dryvv7LH.d.mts} +0 -0
- /package/dist/{types-BBETcziA.d.mts → types-GaCtZ1k9.d.mts} +0 -0
- /package/dist/{url-BzhfYtRn.mjs → url-w7Mp5qAD.mjs} +0 -0
- /package/dist/{utils-FEbQMgB5.mjs → utils-wv-zvC-Y.mjs} +0 -0
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { C as getWidgetArea, Er as getCollectionInfo, Mn as getDinewayCollection, Pn as getEditMeta, Xn as sanitizeHref, Y as getMenu, ct as getComments, ft as getSiteSettings, hi as PublicComment, j as Widget, z as getTaxonomyTerms } from "../runtime-Cd-kjPfN.mjs";
|
|
2
|
+
import "../types-DYKtk8f1.mjs";
|
|
3
|
+
import { A as PageMetadataContribution, q as PublicPageContext } from "../types-UGmU5sWx.mjs";
|
|
4
|
+
import "../types-Dryvv7LH.mjs";
|
|
5
|
+
import { _ as MediaValue, c as EmbedResult, l as ImageEmbed, s as EmbedOptions } from "../placeholder-CXfoCtCd.mjs";
|
|
6
|
+
import "../runner-Cnz4dl0f.mjs";
|
|
7
|
+
import "../index-DJVaYiUV.mjs";
|
|
8
|
+
import { t as MediaReference } from "../types-nP9vGUFq.mjs";
|
|
9
|
+
import "../byline-fields-CaF_xfpj.mjs";
|
|
10
|
+
import "../types-GaCtZ1k9.mjs";
|
|
11
|
+
import "../validate-BJuG-ISL.mjs";
|
|
12
|
+
import { a as generateSiteSeoContributions, d as resolvePageMetadata, i as generateBaseSeoContributions, o as renderFragments, u as renderPageMetadata } from "../jsonld-AcPnCEGD.mjs";
|
|
7
13
|
import { getPageRuntime } from "../page/index.mjs";
|
|
8
|
-
import { t as getMediaProvider } from "../provider-loader-
|
|
14
|
+
import { t as getMediaProvider } from "../provider-loader-B5PMjpN7.mjs";
|
|
9
15
|
|
|
10
16
|
//#region src/utils/sanitize.d.ts
|
|
11
17
|
/**
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import "../dialect-helpers-
|
|
1
|
+
import "../dialect-helpers-fk43GbDb.mjs";
|
|
2
2
|
import "../base64-C1Q9yr0B.mjs";
|
|
3
|
-
import "../types-
|
|
4
|
-
import "../media-
|
|
5
|
-
import "../comment-
|
|
3
|
+
import "../types-Ck7-WoUD.mjs";
|
|
4
|
+
import "../media-DhBwiCYR.mjs";
|
|
5
|
+
import "../comment-ogMaF1gk.mjs";
|
|
6
6
|
import "../options-BF11H_FD.mjs";
|
|
7
|
-
import "../request-cache-
|
|
8
|
-
import "../fts-manager-
|
|
9
|
-
import "../registry-
|
|
10
|
-
import "../loader-
|
|
11
|
-
import { i as getSiteSettings, s as buildRenderMediaUrl } from "../settings-
|
|
12
|
-
import { t as getCollectionInfo } from "../query-
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
7
|
+
import "../request-cache-w5cj5itT.mjs";
|
|
8
|
+
import "../fts-manager-EHY2Kes9.mjs";
|
|
9
|
+
import "../registry-Cq3QRBW2.mjs";
|
|
10
|
+
import "../loader-Y0QvC_QO.mjs";
|
|
11
|
+
import { i as getSiteSettings, s as buildRenderMediaUrl } from "../settings-DNRQuX3d.mjs";
|
|
12
|
+
import { t as getCollectionInfo } from "../query-BJuUydtD.mjs";
|
|
13
|
+
import "../resolve-DTuDyYKs.mjs";
|
|
14
|
+
import { a as getTaxonomyTerms } from "../taxonomies-faQVeMgj.mjs";
|
|
15
|
+
import { n as sanitizeHref } from "../url-w7Mp5qAD.mjs";
|
|
16
|
+
import { r as getEditMeta, t as getDinewayCollection } from "../query-CSx0EdSW.mjs";
|
|
17
|
+
import { i as getComments, t as getMenu } from "../menus-fqqzXyHd.mjs";
|
|
18
|
+
import { t as getWidgetArea } from "../widgets-CdDvF4fV.mjs";
|
|
19
|
+
import { t as getMediaProvider } from "../provider-loader-DzUxejk7.mjs";
|
|
20
|
+
import { c as escapeHtmlAttr, l as renderPageMetadata, n as generateSiteSeoContributions, o as renderFragments, t as generateBaseSeoContributions, u as resolvePageMetadata } from "../seo-contributions-CqVvReEj.mjs";
|
|
20
21
|
import { getPageRuntime } from "../page/index.mjs";
|
|
21
22
|
import sanitizeHtml from "sanitize-html";
|
|
22
23
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { d as Storage } from "./types-
|
|
1
|
+
import { d as FieldType } from "./types-DEAQG87T.mjs";
|
|
2
|
+
import { t as Database } from "./types-DYKtk8f1.mjs";
|
|
3
|
+
import { d as Storage } from "./types-DZpT-PnG.mjs";
|
|
4
|
+
import { i as SiteSettings } from "./types-nP9vGUFq.mjs";
|
|
4
5
|
import { Kysely } from "kysely";
|
|
5
6
|
|
|
6
7
|
//#region src/seed/types.d.ts
|
|
@@ -189,6 +190,23 @@ interface SeedByline {
|
|
|
189
190
|
bio?: string;
|
|
190
191
|
websiteUrl?: string;
|
|
191
192
|
isGuest?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Avatar for the byline, seeded as an already-stored media item. Nothing is
|
|
195
|
+
* downloaded: the caller supplies the storage key of an existing file.
|
|
196
|
+
*/
|
|
197
|
+
avatar?: SeedBylineAvatar;
|
|
198
|
+
}
|
|
199
|
+
interface SeedBylineAvatar {
|
|
200
|
+
/** Storage key of an avatar file that already exists in configured storage. */
|
|
201
|
+
storageKey: string;
|
|
202
|
+
/** Alt text for the avatar image. */
|
|
203
|
+
alt?: string;
|
|
204
|
+
/** Filename for the media record. Defaults to the storage key basename. */
|
|
205
|
+
filename?: string;
|
|
206
|
+
/** MIME type for the media record. Defaults to image/jpeg. */
|
|
207
|
+
mimeType?: string;
|
|
208
|
+
width?: number;
|
|
209
|
+
height?: number;
|
|
192
210
|
}
|
|
193
211
|
/**
|
|
194
212
|
* Content entry in seed
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as __exportAll } from "./runner-DTfG5v0G.mjs";
|
|
2
|
+
import { n as FIELD_TYPES } from "./types-DbZhHtqS.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/seed/validate.ts
|
|
5
5
|
/**
|
|
@@ -226,6 +226,26 @@ function validateSeed(data) {
|
|
|
226
226
|
bylineSlugs.add(byline.slug);
|
|
227
227
|
}
|
|
228
228
|
if (!byline.displayName) errors.push(`${prefix}: displayName is required`);
|
|
229
|
+
if (byline.avatar !== void 0) {
|
|
230
|
+
const avatar = byline.avatar;
|
|
231
|
+
if (!isRecord(avatar)) errors.push(`${prefix}.avatar: must be an object`);
|
|
232
|
+
else {
|
|
233
|
+
if (typeof avatar.storageKey !== "string" || avatar.storageKey.length === 0 || avatar.storageKey !== avatar.storageKey.trim()) errors.push(`${prefix}.avatar.storageKey: must be a non-empty string with no leading or trailing whitespace`);
|
|
234
|
+
for (const key of [
|
|
235
|
+
"alt",
|
|
236
|
+
"filename",
|
|
237
|
+
"mimeType"
|
|
238
|
+
]) if (avatar[key] !== void 0 && typeof avatar[key] !== "string") errors.push(`${prefix}.avatar.${key}: must be a string`);
|
|
239
|
+
for (const key of ["filename", "mimeType"]) {
|
|
240
|
+
const value = avatar[key];
|
|
241
|
+
if (typeof value === "string" && (value.length === 0 || value !== value.trim())) errors.push(`${prefix}.avatar.${key}: must not be empty or whitespace-padded`);
|
|
242
|
+
}
|
|
243
|
+
for (const key of ["width", "height"]) {
|
|
244
|
+
const value = avatar[key];
|
|
245
|
+
if (value !== void 0 && (typeof value !== "number" || !Number.isFinite(value) || value < 0)) errors.push(`${prefix}.avatar.${key}: must be a non-negative number`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
229
249
|
}
|
|
230
250
|
}
|
|
231
251
|
if (seed.content) if (typeof seed.content !== "object" || Array.isArray(seed.content)) errors.push("content must be an object (collection -> entries)");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as getDb } from "./loader-
|
|
2
|
-
import { t as getWidgetComponents$1 } from "./components
|
|
1
|
+
import { r as getDb } from "./loader-Y0QvC_QO.mjs";
|
|
2
|
+
import { t as getWidgetComponents$1 } from "./components--pg6zBvu.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/index.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as hashString } from "./hash-
|
|
1
|
+
import { a as __exportAll } from "./runner-DTfG5v0G.mjs";
|
|
2
|
+
import { n as hashString } from "./hash-BPmX6P8I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/schema/zod-generator.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dineway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "Agentic Website builder for restaurants — structured content meets AI via the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -319,11 +319,12 @@
|
|
|
319
319
|
}
|
|
320
320
|
},
|
|
321
321
|
"dependencies": {
|
|
322
|
-
"@cloudflare/kumo": "^
|
|
322
|
+
"@cloudflare/kumo": "^2.3.0",
|
|
323
323
|
"@floating-ui/react": "^0.27.16",
|
|
324
324
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
325
325
|
"@portabletext/toolkit": "^5.0.1",
|
|
326
326
|
"@tiptap/core": "^3.20.0",
|
|
327
|
+
"@tiptap/extension-code-block": "^3.20.0",
|
|
327
328
|
"@tiptap/extension-focus": "^3.20.0",
|
|
328
329
|
"@tiptap/extension-image": "^3.20.0",
|
|
329
330
|
"@tiptap/extension-link": "^3.20.0",
|
|
@@ -354,9 +355,9 @@
|
|
|
354
355
|
"ulidx": "^2.4.1",
|
|
355
356
|
"upng-js": "^2.1.0",
|
|
356
357
|
"zod": "^4.4.1",
|
|
357
|
-
"@dineway-ai/admin": "^0.1.
|
|
358
|
-
"@dineway-ai/auth": "^0.1.
|
|
359
|
-
"@dineway-ai/gutenberg-to-portable-text": "^0.1.
|
|
358
|
+
"@dineway-ai/admin": "^0.1.16",
|
|
359
|
+
"@dineway-ai/auth": "^0.1.16",
|
|
360
|
+
"@dineway-ai/gutenberg-to-portable-text": "^0.1.14"
|
|
360
361
|
},
|
|
361
362
|
"optionalDependencies": {
|
|
362
363
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
@@ -373,8 +374,6 @@
|
|
|
373
374
|
"devDependencies": {
|
|
374
375
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
375
376
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
376
|
-
"@rivet-dev/agent-os-common": "^0.0.260331072558",
|
|
377
|
-
"@rivet-dev/agent-os-core": "^0.1.1",
|
|
378
377
|
"@types/better-sqlite3": "^7.6.12",
|
|
379
378
|
"@types/pg": "^8.16.0",
|
|
380
379
|
"@types/react": "19.2.14",
|
|
@@ -387,7 +386,7 @@
|
|
|
387
386
|
"vite": "^6.0.0",
|
|
388
387
|
"vitest": "^4.0.18",
|
|
389
388
|
"zod-openapi": "^5.4.6",
|
|
390
|
-
"@dineway-ai/blocks": "^0.1.
|
|
389
|
+
"@dineway-ai/blocks": "^0.1.14"
|
|
391
390
|
},
|
|
392
391
|
"keywords": [
|
|
393
392
|
"astro",
|
|
@@ -26,6 +26,8 @@ import { computeThumbnailSize } from "dineway/ui/client-runtime";
|
|
|
26
26
|
import * as React from "react";
|
|
27
27
|
import { createPortal } from "react-dom";
|
|
28
28
|
|
|
29
|
+
import { InlineCodeBlockExtension } from "./inline-code-block.js";
|
|
30
|
+
|
|
29
31
|
// ── Portable Text types ────────────────────────────────────────────
|
|
30
32
|
|
|
31
33
|
interface PTSpan {
|
|
@@ -181,6 +183,14 @@ function convertPMNode(node: PMNode): PTBlock | PTBlock[] | null {
|
|
|
181
183
|
language: attrStrOpt(node.attrs, "language"),
|
|
182
184
|
};
|
|
183
185
|
}
|
|
186
|
+
case "htmlBlock": {
|
|
187
|
+
const rawHtml = node.attrs?.html;
|
|
188
|
+
return {
|
|
189
|
+
_type: "htmlBlock",
|
|
190
|
+
_key: k(),
|
|
191
|
+
html: typeof rawHtml === "string" ? rawHtml : "",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
184
194
|
case "image": {
|
|
185
195
|
const provider = attrStrOpt(node.attrs, "provider");
|
|
186
196
|
return {
|
|
@@ -386,6 +396,13 @@ function convertPTBlock(block: PTBlock): JSONContent | null {
|
|
|
386
396
|
if (block._type === "break") {
|
|
387
397
|
return { type: "horizontalRule" };
|
|
388
398
|
}
|
|
399
|
+
if (block._type === "htmlBlock") {
|
|
400
|
+
const htmlBlock = block as PTBlock & { html?: string };
|
|
401
|
+
return {
|
|
402
|
+
type: "htmlBlock",
|
|
403
|
+
attrs: { html: htmlBlock.html || "" },
|
|
404
|
+
};
|
|
405
|
+
}
|
|
389
406
|
if (block._type === "image") {
|
|
390
407
|
const ib = block as PTBlock & {
|
|
391
408
|
asset?: { _ref?: string; url?: string; provider?: string };
|
|
@@ -513,6 +530,37 @@ function convertPTMarks(marks: string[], markDefs: Map<string, PTMarkDef>): Mark
|
|
|
513
530
|
return pm;
|
|
514
531
|
}
|
|
515
532
|
|
|
533
|
+
const htmlBlockExtension = Node.create({
|
|
534
|
+
name: "htmlBlock",
|
|
535
|
+
group: "block",
|
|
536
|
+
atom: true,
|
|
537
|
+
selectable: true,
|
|
538
|
+
draggable: true,
|
|
539
|
+
|
|
540
|
+
addAttributes() {
|
|
541
|
+
const noDom = { rendered: false, parseHTML: () => null };
|
|
542
|
+
return {
|
|
543
|
+
html: { default: "", ...noDom },
|
|
544
|
+
};
|
|
545
|
+
},
|
|
546
|
+
|
|
547
|
+
parseHTML() {
|
|
548
|
+
return [{ tag: 'div[data-dineway-html-block="true"]' }];
|
|
549
|
+
},
|
|
550
|
+
|
|
551
|
+
renderHTML({ HTMLAttributes }) {
|
|
552
|
+
return [
|
|
553
|
+
"div",
|
|
554
|
+
mergeAttributes(HTMLAttributes, {
|
|
555
|
+
"data-dineway-html-block": "true",
|
|
556
|
+
class: "dineway-plugin-block-placeholder",
|
|
557
|
+
contenteditable: "false",
|
|
558
|
+
}),
|
|
559
|
+
"HTML block (edit in admin)",
|
|
560
|
+
];
|
|
561
|
+
},
|
|
562
|
+
});
|
|
563
|
+
|
|
516
564
|
const pluginBlockExtension = Node.create({
|
|
517
565
|
name: "pluginBlock",
|
|
518
566
|
group: "block",
|
|
@@ -766,6 +814,21 @@ const slashCommands: SlashCommandItem[] = [
|
|
|
766
814
|
editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
|
|
767
815
|
},
|
|
768
816
|
},
|
|
817
|
+
{
|
|
818
|
+
id: "htmlBlock",
|
|
819
|
+
title: "HTML",
|
|
820
|
+
description: "Insert raw HTML",
|
|
821
|
+
icon: "< >",
|
|
822
|
+
aliases: ["html", "raw", "markup"],
|
|
823
|
+
command: ({ editor, range }) => {
|
|
824
|
+
editor
|
|
825
|
+
.chain()
|
|
826
|
+
.focus()
|
|
827
|
+
.deleteRange(range)
|
|
828
|
+
.insertContent({ type: "htmlBlock", attrs: { html: "" } })
|
|
829
|
+
.run();
|
|
830
|
+
},
|
|
831
|
+
},
|
|
769
832
|
{
|
|
770
833
|
id: "divider",
|
|
771
834
|
title: "Divider",
|
|
@@ -1746,7 +1809,9 @@ export function InlinePortableTextEditor({
|
|
|
1746
1809
|
StarterKit.configure({
|
|
1747
1810
|
heading: { levels: [1, 2, 3] },
|
|
1748
1811
|
dropcursor: { color: "#3b82f6", width: 2 },
|
|
1812
|
+
codeBlock: false,
|
|
1749
1813
|
}),
|
|
1814
|
+
InlineCodeBlockExtension,
|
|
1750
1815
|
Image.extend({
|
|
1751
1816
|
addAttributes() {
|
|
1752
1817
|
return {
|
|
@@ -1778,6 +1843,7 @@ export function InlinePortableTextEditor({
|
|
|
1778
1843
|
mode: "all",
|
|
1779
1844
|
}),
|
|
1780
1845
|
Typography,
|
|
1846
|
+
htmlBlockExtension,
|
|
1781
1847
|
pluginBlockExtension,
|
|
1782
1848
|
slashCommandsExtension,
|
|
1783
1849
|
],
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export interface CodeBlockLanguage {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
aliases?: string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CODE_BLOCK_LANGUAGES: readonly CodeBlockLanguage[] = [
|
|
8
|
+
{ id: "plaintext", label: "Plain text", aliases: ["text", "plain", "txt"] },
|
|
9
|
+
{ id: "astro", label: "Astro" },
|
|
10
|
+
{ id: "bash", label: "Bash", aliases: ["sh", "shell", "zsh"] },
|
|
11
|
+
{ id: "c", label: "C" },
|
|
12
|
+
{ id: "cpp", label: "C++", aliases: ["c++"] },
|
|
13
|
+
{ id: "csharp", label: "C#", aliases: ["cs", "c#"] },
|
|
14
|
+
{ id: "css", label: "CSS" },
|
|
15
|
+
{ id: "diff", label: "Diff", aliases: ["patch"] },
|
|
16
|
+
{ id: "dockerfile", label: "Dockerfile", aliases: ["docker"] },
|
|
17
|
+
{ id: "go", label: "Go", aliases: ["golang"] },
|
|
18
|
+
{ id: "graphql", label: "GraphQL", aliases: ["gql"] },
|
|
19
|
+
{ id: "html", label: "HTML" },
|
|
20
|
+
{ id: "java", label: "Java" },
|
|
21
|
+
{ id: "javascript", label: "JavaScript", aliases: ["js"] },
|
|
22
|
+
{ id: "json", label: "JSON" },
|
|
23
|
+
{ id: "jsx", label: "JSX" },
|
|
24
|
+
{ id: "kotlin", label: "Kotlin", aliases: ["kt"] },
|
|
25
|
+
{ id: "markdown", label: "Markdown", aliases: ["md"] },
|
|
26
|
+
{ id: "mdx", label: "MDX" },
|
|
27
|
+
{ id: "php", label: "PHP" },
|
|
28
|
+
{ id: "python", label: "Python", aliases: ["py"] },
|
|
29
|
+
{ id: "ruby", label: "Ruby", aliases: ["rb"] },
|
|
30
|
+
{ id: "rust", label: "Rust", aliases: ["rs"] },
|
|
31
|
+
{ id: "scss", label: "SCSS", aliases: ["sass"] },
|
|
32
|
+
{ id: "sql", label: "SQL" },
|
|
33
|
+
{ id: "svelte", label: "Svelte" },
|
|
34
|
+
{ id: "swift", label: "Swift" },
|
|
35
|
+
{ id: "toml", label: "TOML" },
|
|
36
|
+
{ id: "tsx", label: "TSX" },
|
|
37
|
+
{ id: "typescript", label: "TypeScript", aliases: ["ts"] },
|
|
38
|
+
{ id: "vue", label: "Vue" },
|
|
39
|
+
{ id: "xml", label: "XML" },
|
|
40
|
+
{ id: "yaml", label: "YAML", aliases: ["yml"] },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export function findCodeBlockLanguage(value: string | null | undefined): CodeBlockLanguage | null {
|
|
44
|
+
if (!value) return null;
|
|
45
|
+
const needle = value.trim().toLowerCase();
|
|
46
|
+
if (!needle) return null;
|
|
47
|
+
for (const language of CODE_BLOCK_LANGUAGES) {
|
|
48
|
+
if (language.id === needle) return language;
|
|
49
|
+
if (language.aliases?.includes(needle)) return language;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const DISALLOWED_LANGUAGE_CHARS = /[^a-z0-9_-]+/g;
|
|
55
|
+
const EDGE_HYPHENS = /^-+|-+$/g;
|
|
56
|
+
|
|
57
|
+
export function normalizeCodeBlockLanguage(value: string | null | undefined): string | undefined {
|
|
58
|
+
if (!value) return undefined;
|
|
59
|
+
const trimmed = value.trim();
|
|
60
|
+
if (!trimmed) return undefined;
|
|
61
|
+
|
|
62
|
+
const knownLanguage = findCodeBlockLanguage(trimmed);
|
|
63
|
+
if (knownLanguage) return knownLanguage.id;
|
|
64
|
+
|
|
65
|
+
const sanitized = trimmed
|
|
66
|
+
.toLowerCase()
|
|
67
|
+
.replace(DISALLOWED_LANGUAGE_CHARS, "-")
|
|
68
|
+
.replace(EDGE_HYPHENS, "");
|
|
69
|
+
return sanitized || undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function formatCodeBlockLanguageLabel(value: string | null | undefined): string {
|
|
73
|
+
if (!value) return "Plain text";
|
|
74
|
+
const knownLanguage = findCodeBlockLanguage(value);
|
|
75
|
+
return knownLanguage?.label ?? value;
|
|
76
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import CodeBlock from "@tiptap/extension-code-block";
|
|
2
|
+
import type { NodeViewProps } from "@tiptap/react";
|
|
3
|
+
import { NodeViewContent, NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
CODE_BLOCK_LANGUAGES,
|
|
8
|
+
formatCodeBlockLanguageLabel,
|
|
9
|
+
normalizeCodeBlockLanguage,
|
|
10
|
+
} from "./code-block-languages.js";
|
|
11
|
+
|
|
12
|
+
function LanguageOptions({ id }: { id: string }) {
|
|
13
|
+
return (
|
|
14
|
+
<datalist id={id}>
|
|
15
|
+
{CODE_BLOCK_LANGUAGES.map((language) => (
|
|
16
|
+
<option key={language.id} value={language.id} label={language.label} />
|
|
17
|
+
))}
|
|
18
|
+
</datalist>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const iconButtonStyle: React.CSSProperties = {
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
background: "transparent",
|
|
25
|
+
border: "none",
|
|
26
|
+
borderRadius: "0.25rem",
|
|
27
|
+
color: "inherit",
|
|
28
|
+
cursor: "pointer",
|
|
29
|
+
display: "inline-flex",
|
|
30
|
+
height: "1.75rem",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
padding: 0,
|
|
33
|
+
width: "1.75rem",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function CheckIcon() {
|
|
37
|
+
return (
|
|
38
|
+
<svg
|
|
39
|
+
width="14"
|
|
40
|
+
height="14"
|
|
41
|
+
viewBox="0 0 24 24"
|
|
42
|
+
fill="none"
|
|
43
|
+
stroke="currentColor"
|
|
44
|
+
strokeWidth="2.5"
|
|
45
|
+
strokeLinecap="round"
|
|
46
|
+
strokeLinejoin="round"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
>
|
|
49
|
+
<polyline points="20 6 9 17 4 12" />
|
|
50
|
+
</svg>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function XIcon() {
|
|
55
|
+
return (
|
|
56
|
+
<svg
|
|
57
|
+
width="14"
|
|
58
|
+
height="14"
|
|
59
|
+
viewBox="0 0 24 24"
|
|
60
|
+
fill="none"
|
|
61
|
+
stroke="currentColor"
|
|
62
|
+
strokeWidth="2.5"
|
|
63
|
+
strokeLinecap="round"
|
|
64
|
+
strokeLinejoin="round"
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
>
|
|
67
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
68
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
69
|
+
</svg>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function InlineCodeBlockNodeView({ node, selected, updateAttributes }: NodeViewProps) {
|
|
74
|
+
const [isEditing, setIsEditing] = React.useState(false);
|
|
75
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
76
|
+
const storedLanguage = typeof node.attrs.language === "string" ? node.attrs.language : "";
|
|
77
|
+
const [draft, setDraft] = React.useState(storedLanguage);
|
|
78
|
+
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
79
|
+
const popoverRef = React.useRef<HTMLDivElement>(null);
|
|
80
|
+
const datalistId = React.useId();
|
|
81
|
+
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
if (!isEditing) {
|
|
84
|
+
setDraft(storedLanguage);
|
|
85
|
+
}
|
|
86
|
+
}, [isEditing, storedLanguage]);
|
|
87
|
+
|
|
88
|
+
const openPicker = React.useCallback(() => {
|
|
89
|
+
setDraft(storedLanguage);
|
|
90
|
+
setIsEditing(true);
|
|
91
|
+
window.setTimeout(() => inputRef.current?.focus(), 0);
|
|
92
|
+
}, [storedLanguage]);
|
|
93
|
+
|
|
94
|
+
const closePicker = React.useCallback(() => {
|
|
95
|
+
setDraft(storedLanguage);
|
|
96
|
+
setIsEditing(false);
|
|
97
|
+
}, [storedLanguage]);
|
|
98
|
+
|
|
99
|
+
const commit = React.useCallback(() => {
|
|
100
|
+
const nextLanguage = normalizeCodeBlockLanguage(draft);
|
|
101
|
+
updateAttributes({ language: nextLanguage ?? null });
|
|
102
|
+
setIsEditing(false);
|
|
103
|
+
}, [draft, updateAttributes]);
|
|
104
|
+
|
|
105
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
106
|
+
if (event.key === "Enter") {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
commit();
|
|
109
|
+
} else if (event.key === "Escape") {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
closePicker();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
React.useEffect(() => {
|
|
116
|
+
if (!isEditing) return undefined;
|
|
117
|
+
const onMouseDown = (event: MouseEvent) => {
|
|
118
|
+
const target = event.target instanceof Node ? event.target : null;
|
|
119
|
+
if (popoverRef.current && target && !popoverRef.current.contains(target)) {
|
|
120
|
+
closePicker();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
document.addEventListener("mousedown", onMouseDown);
|
|
124
|
+
return () => document.removeEventListener("mousedown", onMouseDown);
|
|
125
|
+
}, [closePicker, isEditing]);
|
|
126
|
+
|
|
127
|
+
const chipVisible = isHovered || selected || isEditing || Boolean(storedLanguage);
|
|
128
|
+
const label = formatCodeBlockLanguageLabel(storedLanguage);
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<NodeViewWrapper
|
|
132
|
+
className="dineway-inline-code-block"
|
|
133
|
+
data-language={storedLanguage || undefined}
|
|
134
|
+
style={{ margin: "1rem 0", position: "relative" }}
|
|
135
|
+
onMouseEnter={() => setIsHovered(true)}
|
|
136
|
+
onMouseLeave={() => setIsHovered(false)}
|
|
137
|
+
>
|
|
138
|
+
<LanguageOptions id={datalistId} />
|
|
139
|
+
<pre>
|
|
140
|
+
<NodeViewContent<"code"> as="code" />
|
|
141
|
+
</pre>
|
|
142
|
+
<div
|
|
143
|
+
contentEditable={false}
|
|
144
|
+
aria-hidden={chipVisible ? undefined : true}
|
|
145
|
+
style={{
|
|
146
|
+
insetInlineEnd: "0.5rem",
|
|
147
|
+
opacity: chipVisible ? 1 : 0,
|
|
148
|
+
pointerEvents: chipVisible ? "auto" : "none",
|
|
149
|
+
position: "absolute",
|
|
150
|
+
top: "0.5rem",
|
|
151
|
+
transition: "opacity 0.15s",
|
|
152
|
+
userSelect: "none",
|
|
153
|
+
zIndex: 1,
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
{isEditing ? (
|
|
157
|
+
<div
|
|
158
|
+
ref={popoverRef}
|
|
159
|
+
style={{
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
background: "var(--dineway-inline-bg, #fff)",
|
|
162
|
+
border: "1px solid rgba(0, 0, 0, 0.12)",
|
|
163
|
+
borderRadius: "0.375rem",
|
|
164
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.12)",
|
|
165
|
+
display: "flex",
|
|
166
|
+
gap: "0.25rem",
|
|
167
|
+
padding: "0.25rem",
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
<input
|
|
171
|
+
ref={inputRef}
|
|
172
|
+
type="text"
|
|
173
|
+
list={datalistId}
|
|
174
|
+
value={draft}
|
|
175
|
+
onChange={(event) => setDraft(event.target.value)}
|
|
176
|
+
onKeyDown={handleKeyDown}
|
|
177
|
+
placeholder="Language"
|
|
178
|
+
aria-label="Language"
|
|
179
|
+
style={{
|
|
180
|
+
background: "transparent",
|
|
181
|
+
border: "1px solid rgba(0, 0, 0, 0.16)",
|
|
182
|
+
borderRadius: "0.25rem",
|
|
183
|
+
color: "inherit",
|
|
184
|
+
fontSize: "0.75rem",
|
|
185
|
+
height: "1.75rem",
|
|
186
|
+
padding: "0 0.5rem",
|
|
187
|
+
width: "10rem",
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
<button
|
|
191
|
+
type="button"
|
|
192
|
+
style={iconButtonStyle}
|
|
193
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
194
|
+
onClick={commit}
|
|
195
|
+
title="Apply language"
|
|
196
|
+
aria-label="Apply language"
|
|
197
|
+
>
|
|
198
|
+
<CheckIcon />
|
|
199
|
+
</button>
|
|
200
|
+
<button
|
|
201
|
+
type="button"
|
|
202
|
+
style={iconButtonStyle}
|
|
203
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
204
|
+
onClick={closePicker}
|
|
205
|
+
title="Cancel"
|
|
206
|
+
aria-label="Cancel"
|
|
207
|
+
>
|
|
208
|
+
<XIcon />
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
) : (
|
|
212
|
+
<button
|
|
213
|
+
type="button"
|
|
214
|
+
tabIndex={chipVisible ? 0 : -1}
|
|
215
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
216
|
+
onClick={openPicker}
|
|
217
|
+
title="Set language"
|
|
218
|
+
aria-label={`Set language (current: ${label})`}
|
|
219
|
+
style={{
|
|
220
|
+
background: "rgba(255, 255, 255, 0.9)",
|
|
221
|
+
border: "1px solid rgba(0, 0, 0, 0.12)",
|
|
222
|
+
borderRadius: "0.375rem",
|
|
223
|
+
color: "rgba(0, 0, 0, 0.65)",
|
|
224
|
+
cursor: "pointer",
|
|
225
|
+
fontSize: "0.75rem",
|
|
226
|
+
padding: "0.125rem 0.5rem",
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
{storedLanguage ? label : "Set language"}
|
|
230
|
+
</button>
|
|
231
|
+
)}
|
|
232
|
+
</div>
|
|
233
|
+
</NodeViewWrapper>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export const InlineCodeBlockExtension = CodeBlock.extend({
|
|
238
|
+
addNodeView() {
|
|
239
|
+
return ReactNodeViewRenderer(InlineCodeBlockNodeView);
|
|
240
|
+
},
|
|
241
|
+
});
|