@flamingo-stack/openframe-frontend-core 0.0.467 → 0.0.468-snapshot.20260723140929
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/chat-protocol/decode.d.ts +58 -0
- package/dist/chat-protocol/decode.d.ts.map +1 -0
- package/dist/chat-protocol/encode.d.ts +44 -0
- package/dist/chat-protocol/encode.d.ts.map +1 -0
- package/dist/chat-protocol/env-flag.d.ts +35 -0
- package/dist/chat-protocol/env-flag.d.ts.map +1 -0
- package/dist/chat-protocol/events.d.ts +192 -0
- package/dist/chat-protocol/events.d.ts.map +1 -0
- package/dist/chat-protocol/frames.d.ts +206 -0
- package/dist/chat-protocol/frames.d.ts.map +1 -0
- package/dist/chat-protocol/index.cjs +493 -0
- package/dist/chat-protocol/index.cjs.map +1 -0
- package/dist/chat-protocol/index.d.ts +18 -0
- package/dist/chat-protocol/index.d.ts.map +1 -0
- package/dist/chat-protocol/index.js +477 -0
- package/dist/chat-protocol/index.js.map +1 -0
- package/dist/chat-protocol/ip-normalize.d.ts +44 -0
- package/dist/chat-protocol/ip-normalize.d.ts.map +1 -0
- package/dist/chat-protocol/nats-decoder.d.ts +26 -0
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -0
- package/dist/{chunk-BIDOIPIT.js → chunk-2BJSRTKU.js} +2 -2
- package/dist/{chunk-4DFPQKKJ.js → chunk-33FDAZDB.js} +2 -2
- package/dist/{chunk-LOWJWKM5.js → chunk-4QDFNDVW.js} +4 -4
- package/dist/{chunk-72NEN4G4.cjs → chunk-4UFRQT7Z.cjs} +15 -15
- package/dist/{chunk-72NEN4G4.cjs.map → chunk-4UFRQT7Z.cjs.map} +1 -1
- package/dist/{chunk-WWC75D3J.cjs → chunk-4W54HUP7.cjs} +6853 -4609
- package/dist/chunk-4W54HUP7.cjs.map +1 -0
- package/dist/{chunk-6DZ5QOUM.cjs → chunk-5HUTT3FD.cjs} +11 -11
- package/dist/{chunk-6DZ5QOUM.cjs.map → chunk-5HUTT3FD.cjs.map} +1 -1
- package/dist/{chunk-GXXLJHQX.js → chunk-7I2QMUEZ.js} +2 -2
- package/dist/{chunk-QJ7NIL6A.js → chunk-AJSNF5YF.js} +6 -5
- package/dist/chunk-AJSNF5YF.js.map +1 -0
- package/dist/{chunk-NYOQNYSI.js → chunk-AW3LVWVV.js} +2 -2
- package/dist/{chunk-25YYEVSE.js → chunk-DG7TX763.js} +2 -2
- package/dist/{chunk-CZFPPNYV.js → chunk-E6O6XATC.js} +11899 -9655
- package/dist/chunk-E6O6XATC.js.map +1 -0
- package/dist/{chunk-ZYPHZ3R3.cjs → chunk-GLKULDQN.cjs} +9 -9
- package/dist/{chunk-ZYPHZ3R3.cjs.map → chunk-GLKULDQN.cjs.map} +1 -1
- package/dist/{chunk-TZSPLSDU.js → chunk-GYEZV4GK.js} +2 -2
- package/dist/{chunk-G5D7NRH5.cjs → chunk-LRESZO4L.cjs} +26 -26
- package/dist/{chunk-G5D7NRH5.cjs.map → chunk-LRESZO4L.cjs.map} +1 -1
- package/dist/{chunk-ABU37QSG.js → chunk-MMF6HJB7.js} +4 -4
- package/dist/{chunk-O7LQYYUA.cjs → chunk-MTLBBSLP.cjs} +5 -5
- package/dist/{chunk-O7LQYYUA.cjs.map → chunk-MTLBBSLP.cjs.map} +1 -1
- package/dist/{chunk-UWW4PQQS.cjs → chunk-OVIUQJ2H.cjs} +28 -27
- package/dist/chunk-OVIUQJ2H.cjs.map +1 -0
- package/dist/{chunk-3L44PPMF.js → chunk-RPAOSHBN.js} +2 -2
- package/dist/{chunk-VERK32MO.cjs → chunk-TOFOK7G5.cjs} +37 -37
- package/dist/{chunk-VERK32MO.cjs.map → chunk-TOFOK7G5.cjs.map} +1 -1
- package/dist/{chunk-QITN43HN.cjs → chunk-U2KPMWO6.cjs} +7 -7
- package/dist/{chunk-QITN43HN.cjs.map → chunk-U2KPMWO6.cjs.map} +1 -1
- package/dist/{chunk-YGW7T57C.cjs → chunk-V5YWOQBP.cjs} +31 -31
- package/dist/{chunk-YGW7T57C.cjs.map → chunk-V5YWOQBP.cjs.map} +1 -1
- package/dist/{chunk-ILZ66CS6.js → chunk-VUCYS36H.js} +10 -10
- package/dist/chunk-VUCYS36H.js.map +1 -0
- package/dist/{chunk-SGDXS7VT.cjs → chunk-WHWDGCQV.cjs} +60 -60
- package/dist/chunk-WHWDGCQV.cjs.map +1 -0
- package/dist/{chunk-G2H4AKL3.cjs → chunk-YXNWEVER.cjs} +62 -62
- package/dist/{chunk-G2H4AKL3.cjs.map → chunk-YXNWEVER.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/chat-composer.d.ts +8 -1
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts +37 -0
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -0
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts +14 -6
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +0 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +15 -48
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +3 -47
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +12 -2
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +2 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +23 -13
- package/dist/components/chat/stream/chat-dialog-store.d.ts +184 -0
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +367 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -0
- package/dist/components/chat/stream/delta-batcher.d.ts +51 -0
- package/dist/components/chat/stream/delta-batcher.d.ts.map +1 -0
- package/dist/components/chat/stream/index.d.ts +17 -0
- package/dist/components/chat/stream/index.d.ts.map +1 -0
- package/dist/components/chat/stream/message-mutations.d.ts +77 -0
- package/dist/components/chat/stream/message-mutations.d.ts.map +1 -0
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts +22 -0
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts.map +1 -0
- package/dist/components/chat/types/api.types.d.ts +1 -81
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/chat/types/processing.types.d.ts +2 -90
- package/dist/components/chat/types/processing.types.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts +34 -6
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +2 -3
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts +59 -11
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +174 -130
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +65 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +46 -2
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -2
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +57 -13
- package/dist/components/ui/markdown/base-components.d.ts +56 -0
- package/dist/components/ui/markdown/base-components.d.ts.map +1 -0
- package/dist/components/ui/markdown/engine.d.ts +99 -0
- package/dist/components/ui/markdown/engine.d.ts.map +1 -0
- package/dist/components/ui/markdown/heading-ids.d.ts +65 -0
- package/dist/components/ui/markdown/heading-ids.d.ts.map +1 -0
- package/dist/components/ui/markdown/index.d.ts +18 -0
- package/dist/components/ui/markdown/index.d.ts.map +1 -0
- package/dist/components/ui/markdown/mermaid-diagram.d.ts +79 -0
- package/dist/components/ui/markdown/mermaid-diagram.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts +14 -0
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts +40 -0
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/markdown/rich/shortcodes.d.ts +8 -0
- package/dist/components/ui/markdown/rich/shortcodes.d.ts.map +1 -0
- package/dist/components/ui/markdown/sanitize.d.ts +153 -0
- package/dist/components/ui/markdown/sanitize.d.ts.map +1 -0
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts +23 -0
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/markdown/streaming.d.ts +78 -0
- package/dist/components/ui/markdown/streaming.d.ts.map +1 -0
- package/dist/components/ui/markdown/text-size.d.ts +34 -0
- package/dist/components/ui/markdown/text-size.d.ts.map +1 -0
- package/dist/index.cjs +62 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +73 -13
- package/dist/utils/index.cjs +169 -40
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +162 -41
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/markdown-fences.d.ts +42 -0
- package/dist/utils/markdown-fences.d.ts.map +1 -0
- package/dist/utils/markdown-heading-id.d.ts +85 -0
- package/dist/utils/markdown-heading-id.d.ts.map +1 -0
- package/dist/utils/markdown-section-extractor.d.ts.map +1 -1
- package/package.json +7 -1
- package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +307 -0
- package/src/chat-protocol/__tests__/chat-protocol.test.ts +515 -0
- package/src/chat-protocol/__tests__/env-flag.test.ts +52 -0
- package/src/chat-protocol/__tests__/ip-normalize.test.ts +136 -0
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +228 -0
- package/src/chat-protocol/decode.ts +277 -0
- package/src/chat-protocol/encode.ts +71 -0
- package/src/chat-protocol/env-flag.ts +39 -0
- package/src/chat-protocol/events.ts +228 -0
- package/src/chat-protocol/frames.ts +238 -0
- package/src/chat-protocol/index.ts +21 -0
- package/src/chat-protocol/ip-normalize.ts +146 -0
- package/src/chat-protocol/nats-decoder.ts +252 -0
- package/src/components/chat/__tests__/chat-message-list.test.tsx +293 -5
- package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +207 -0
- package/src/components/chat/__tests__/chat-pending-turn.test.tsx +209 -0
- package/src/components/chat/chat-composer.tsx +32 -5
- package/src/components/chat/chat-context-memory-bar.tsx +159 -0
- package/src/components/chat/chat-message-enhanced.tsx +111 -17
- package/src/components/chat/chat-message-list.tsx +358 -109
- package/src/components/chat/embeddable-chat.tsx +23 -15
- package/src/components/chat/hooks/.index.md +1 -1
- package/src/components/chat/hooks/.use-nats-chat-adapter.md +1 -1
- package/src/components/chat/hooks/__tests__/__snapshots__/persisted-state-v1-golden.test.ts.snap +297 -0
- package/src/components/chat/hooks/__tests__/__snapshots__/sse-stream-golden.test.ts.snap +0 -0
- package/src/components/chat/hooks/__tests__/persisted-state-v1-golden.test.ts +272 -0
- package/src/components/chat/hooks/__tests__/sse-stream-golden.test.ts +318 -0
- package/src/components/chat/hooks/index.ts +0 -1
- package/src/components/chat/hooks/use-chat.ts +8 -0
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +243 -822
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +318 -666
- package/src/components/chat/index.ts +6 -0
- package/src/components/chat/stream/__tests__/__snapshots__/chat-stream-reducer-golden.test.ts.snap +937 -0
- package/src/components/chat/stream/__tests__/chat-dialog-store.test.ts +756 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer-golden.test.ts +460 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +894 -0
- package/src/components/chat/stream/__tests__/delta-batcher.test.ts +255 -0
- package/src/components/chat/stream/__tests__/use-chat-stream-reducer.test.ts +98 -0
- package/src/components/chat/stream/chat-dialog-store.ts +536 -0
- package/src/components/chat/stream/chat-stream-reducer.ts +1796 -0
- package/src/components/chat/stream/delta-batcher.ts +159 -0
- package/src/components/chat/stream/index.ts +55 -0
- package/src/components/chat/stream/message-mutations.ts +338 -0
- package/src/components/chat/stream/use-chat-stream-reducer.ts +126 -0
- package/src/components/chat/thinking-display.tsx +1 -1
- package/src/components/chat/types/.api.types.md +1 -3
- package/src/components/chat/types/.processing.types.md +6 -23
- package/src/components/chat/types/api.types.ts +6 -73
- package/src/components/chat/types/processing.types.ts +11 -52
- package/src/components/chat/utils/.index.md +0 -5
- package/src/components/chat/utils/__tests__/__snapshots__/process-historical-messages-golden.test.ts.snap +418 -0
- package/src/components/chat/utils/__tests__/__snapshots__/segment-accumulator-golden.test.ts.snap +599 -0
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +317 -0
- package/src/components/chat/utils/__tests__/segment-accumulator-golden.test.ts +270 -0
- package/src/components/chat/utils/extract-incomplete-message-state.ts +63 -5
- package/src/components/chat/utils/index.ts +5 -8
- package/src/components/chat/utils/process-historical-messages.ts +352 -383
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +22 -4
- package/src/components/shared/legal-document/legal-document-page.tsx +1 -1
- package/src/components/shared/product-release/release-detail-page.tsx +19 -4
- package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +2420 -0
- package/src/components/ui/__tests__/markdown-parity.test.tsx +2528 -0
- package/src/components/ui/index.ts +1 -2
- package/src/components/ui/markdown/__tests__/mermaid-security.test.ts +115 -0
- package/src/components/ui/markdown/__tests__/mermaid-stale-render.test.tsx +95 -0
- package/src/components/ui/markdown/__tests__/sanitize-invariant.test.ts +309 -0
- package/src/components/ui/markdown/__tests__/streaming.test.tsx +388 -0
- package/src/components/ui/markdown/base-components.tsx +341 -0
- package/src/components/ui/markdown/engine.tsx +315 -0
- package/src/components/ui/markdown/heading-ids.ts +239 -0
- package/src/components/ui/markdown/index.ts +49 -0
- package/src/components/ui/markdown/mermaid-diagram.tsx +291 -0
- package/src/components/ui/markdown/rich/embed-overrides.tsx +199 -0
- package/src/components/ui/markdown/rich/rich-markdown-renderer.tsx +184 -0
- package/src/components/ui/markdown/rich/shortcodes.ts +170 -0
- package/src/components/ui/markdown/sanitize.ts +3499 -0
- package/src/components/ui/markdown/simple-markdown-renderer.tsx +28 -0
- package/src/components/ui/markdown/streaming.ts +362 -0
- package/src/components/ui/markdown/text-size.ts +106 -0
- package/src/components/ui/release-changelog-section.tsx +1 -1
- package/src/components/ui/tab-selector.tsx +8 -8
- package/src/components/ui/ticket-info-section.tsx +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/markdown-fences.ts +127 -0
- package/src/utils/markdown-heading-id.ts +348 -0
- package/src/utils/markdown-section-extractor.ts +41 -56
- package/dist/chunk-CZFPPNYV.js.map +0 -1
- package/dist/chunk-ILZ66CS6.js.map +0 -1
- package/dist/chunk-QJ7NIL6A.js.map +0 -1
- package/dist/chunk-SGDXS7VT.cjs.map +0 -1
- package/dist/chunk-UWW4PQQS.cjs.map +0 -1
- package/dist/chunk-WWC75D3J.cjs.map +0 -1
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts +0 -6
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +0 -1
- package/dist/components/chat/utils/chunk-parser.d.ts +0 -25
- package/dist/components/chat/utils/chunk-parser.d.ts.map +0 -1
- package/dist/components/ui/rich-markdown-renderer.d.ts +0 -34
- package/dist/components/ui/rich-markdown-renderer.d.ts.map +0 -1
- package/dist/components/ui/simple-markdown-renderer.d.ts +0 -73
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +0 -1
- package/src/components/chat/hooks/.use-realtime-chunk-processor.md +0 -50
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +0 -479
- package/src/components/chat/utils/.chunk-parser.md +0 -51
- package/src/components/chat/utils/chunk-parser.ts +0 -255
- package/src/components/ui/.simple-markdown-renderer.md +0 -40
- package/src/components/ui/rich-markdown-renderer.tsx +0 -1223
- package/src/components/ui/simple-markdown-renderer.tsx +0 -965
- /package/dist/{chunk-BIDOIPIT.js.map → chunk-2BJSRTKU.js.map} +0 -0
- /package/dist/{chunk-4DFPQKKJ.js.map → chunk-33FDAZDB.js.map} +0 -0
- /package/dist/{chunk-LOWJWKM5.js.map → chunk-4QDFNDVW.js.map} +0 -0
- /package/dist/{chunk-GXXLJHQX.js.map → chunk-7I2QMUEZ.js.map} +0 -0
- /package/dist/{chunk-NYOQNYSI.js.map → chunk-AW3LVWVV.js.map} +0 -0
- /package/dist/{chunk-25YYEVSE.js.map → chunk-DG7TX763.js.map} +0 -0
- /package/dist/{chunk-TZSPLSDU.js.map → chunk-GYEZV4GK.js.map} +0 -0
- /package/dist/{chunk-ABU37QSG.js.map → chunk-MMF6HJB7.js.map} +0 -0
- /package/dist/{chunk-3L44PPMF.js.map → chunk-RPAOSHBN.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -143,6 +143,7 @@ import {
|
|
|
143
143
|
ChatContainer,
|
|
144
144
|
ChatContent,
|
|
145
145
|
ChatContextChipStrip,
|
|
146
|
+
ChatContextMemoryBar,
|
|
146
147
|
ChatContextPicker,
|
|
147
148
|
ChatDialogModals,
|
|
148
149
|
ChatFooter,
|
|
@@ -194,8 +195,10 @@ import {
|
|
|
194
195
|
CveLink,
|
|
195
196
|
DEFAULT_CONTENT_SUFFIXES,
|
|
196
197
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
198
|
+
DEFAULT_DIALOG_SIDE,
|
|
197
199
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
198
200
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
201
|
+
DEFAULT_MAX_REDUCERS,
|
|
199
202
|
DEFAULT_OS_PLATFORM,
|
|
200
203
|
DEFAULT_THEME,
|
|
201
204
|
DEFAULT_VIDEO_BITES_TITLE,
|
|
@@ -286,6 +289,7 @@ import {
|
|
|
286
289
|
GitHubReleasesManager,
|
|
287
290
|
GuideModeBanner,
|
|
288
291
|
GuideWelcome,
|
|
292
|
+
HEADING_EMOJI_RE,
|
|
289
293
|
HEX_PATTERN,
|
|
290
294
|
Header,
|
|
291
295
|
HeaderButton,
|
|
@@ -332,12 +336,14 @@ import {
|
|
|
332
336
|
LogSeverityDot,
|
|
333
337
|
LoginForm,
|
|
334
338
|
LogsList,
|
|
339
|
+
MAX_PENDING_RETAIN_KEYS,
|
|
335
340
|
MESSAGE_ROLE,
|
|
336
341
|
MESSAGE_TYPE,
|
|
337
342
|
MOBILE_NAV_PANEL_ID,
|
|
338
343
|
MUX_IMAGE_ORIGIN,
|
|
339
344
|
MUX_STREAM_ORIGIN,
|
|
340
345
|
MarkdownEditor,
|
|
346
|
+
MarkdownEngine,
|
|
341
347
|
MarqueeWall,
|
|
342
348
|
MarqueeWallFades,
|
|
343
349
|
MediaGalleryManager,
|
|
@@ -359,6 +365,7 @@ import {
|
|
|
359
365
|
MenubarSubContent,
|
|
360
366
|
MenubarSubTrigger,
|
|
361
367
|
MenubarTrigger,
|
|
368
|
+
MermaidDiagram,
|
|
362
369
|
MessageSegmentAccumulator,
|
|
363
370
|
MingoAiButton,
|
|
364
371
|
MingoChatHistory,
|
|
@@ -482,6 +489,7 @@ import {
|
|
|
482
489
|
RoadmapCard,
|
|
483
490
|
RoadmapCardSkeleton,
|
|
484
491
|
RoadmapVoteButton,
|
|
492
|
+
SAFE_HTML_TAGS,
|
|
485
493
|
SCROLL_ANCHOR,
|
|
486
494
|
SCROLL_ANCHOR_WIRE_KEY,
|
|
487
495
|
SECTION_HEADING_CLASS,
|
|
@@ -494,6 +502,7 @@ import {
|
|
|
494
502
|
SOURCE_ICON_NAMES,
|
|
495
503
|
SOURCE_LABELS_BY_TABLE,
|
|
496
504
|
STRIP_CELL_MAX_WIDTH,
|
|
505
|
+
SVG_TAGS,
|
|
497
506
|
SYNTHETIC_REALTIME_ID_PREFIXES,
|
|
498
507
|
ScriptArguments,
|
|
499
508
|
ScriptInfoSection,
|
|
@@ -549,6 +558,7 @@ import {
|
|
|
549
558
|
TAG_BADGE_CLASS,
|
|
550
559
|
TASK_TYPE_LABELS,
|
|
551
560
|
TASK_TYPE_TEXT_COLORS,
|
|
561
|
+
TEXT_SIZE_PRESETS,
|
|
552
562
|
THEME_ATTRIBUTE,
|
|
553
563
|
THEME_STORAGE_KEY,
|
|
554
564
|
TICKET_STATUS_COLOR_PRESETS,
|
|
@@ -648,12 +658,16 @@ import {
|
|
|
648
658
|
buildDefaultHref,
|
|
649
659
|
buildDiscussAddendum,
|
|
650
660
|
buildDocumentTree,
|
|
661
|
+
buildEffectiveTagSet,
|
|
662
|
+
buildHeadingIdMap,
|
|
651
663
|
buildListUrl,
|
|
652
664
|
buildNatsWsUrl,
|
|
653
665
|
buildProductReleaseCardProps,
|
|
666
|
+
buildSanitizeSchema,
|
|
654
667
|
buildStreamFrames,
|
|
655
668
|
buildSuggestionUrl,
|
|
656
669
|
canonicalContentRefType,
|
|
670
|
+
cardAwareUrlTransform,
|
|
657
671
|
changelogLabels,
|
|
658
672
|
chatChipClass,
|
|
659
673
|
cleanEmailDomain,
|
|
@@ -661,12 +675,20 @@ import {
|
|
|
661
675
|
clearLegacyAnnouncementCache,
|
|
662
676
|
clickupTaskUrl,
|
|
663
677
|
columnFromTicketStatus,
|
|
678
|
+
completeStreamingTail,
|
|
664
679
|
computeHistoryPrepend,
|
|
665
680
|
computeIsNewTab,
|
|
681
|
+
createChatDialogStore,
|
|
682
|
+
createChatStreamReducer,
|
|
666
683
|
createColumnHelper,
|
|
684
|
+
createDeltaBatcher,
|
|
685
|
+
createEmptyTurnMeta,
|
|
686
|
+
createFenceTracker,
|
|
687
|
+
createHeadingIdDeduper,
|
|
667
688
|
createMessageSegmentAccumulator,
|
|
668
689
|
createUTCTimestamp,
|
|
669
690
|
decideNewTab,
|
|
691
|
+
decodeHistoricalMessageData,
|
|
670
692
|
deepClone,
|
|
671
693
|
defaultBuildProductReleaseCardProps,
|
|
672
694
|
defaultTableIdForDocumentType,
|
|
@@ -679,6 +701,7 @@ import {
|
|
|
679
701
|
dismissAnnouncement,
|
|
680
702
|
ensureBiteIds,
|
|
681
703
|
escapeMarkdownInline,
|
|
704
|
+
escapeUnknownHtmlTags,
|
|
682
705
|
executeNavigation,
|
|
683
706
|
executeNavigationImperative,
|
|
684
707
|
exportToCSV,
|
|
@@ -688,10 +711,11 @@ import {
|
|
|
688
711
|
extractErrorMessages,
|
|
689
712
|
extractImageEdgeColorAsync,
|
|
690
713
|
extractIncompleteMessageState,
|
|
714
|
+
extractIncompleteTailState,
|
|
691
715
|
extractItemId,
|
|
692
716
|
extractItems,
|
|
693
717
|
extractSections,
|
|
694
|
-
|
|
718
|
+
extractText,
|
|
695
719
|
extractYouTubeId,
|
|
696
720
|
faqItemAnchor,
|
|
697
721
|
faqSectionSlug,
|
|
@@ -816,15 +840,13 @@ import {
|
|
|
816
840
|
interleave,
|
|
817
841
|
isAnnouncementDismissed,
|
|
818
842
|
isApprovalNotification,
|
|
819
|
-
|
|
843
|
+
isBlankLine,
|
|
820
844
|
isCrossOriginUrl,
|
|
821
845
|
isDismissedCookieValue,
|
|
822
|
-
isErrorChunk,
|
|
823
846
|
isFigmaSlidesUrl,
|
|
824
847
|
isGenericDomain,
|
|
825
848
|
isGenericWebsiteDomain,
|
|
826
849
|
isHistoricalUserTurn,
|
|
827
|
-
isMetadataChunk,
|
|
828
850
|
isModifierClick,
|
|
829
851
|
isOSPlatform,
|
|
830
852
|
isQuickActionIconSpec,
|
|
@@ -856,7 +878,6 @@ import {
|
|
|
856
878
|
normalizeToolTypeWithFallback,
|
|
857
879
|
orderContentRefTypes,
|
|
858
880
|
osLabels,
|
|
859
|
-
parseChunkToAction,
|
|
860
881
|
parseFaqHash,
|
|
861
882
|
parseScrollAnchor,
|
|
862
883
|
parseWireCommandOverride,
|
|
@@ -864,9 +885,11 @@ import {
|
|
|
864
885
|
pickReadableTextColor,
|
|
865
886
|
processHistoricalMessages,
|
|
866
887
|
processHistoricalMessagesWithErrors,
|
|
888
|
+
processShortcodes,
|
|
867
889
|
programItemToStripProfile,
|
|
868
890
|
ratioToCategory,
|
|
869
891
|
readLeadingDecisionFrame,
|
|
892
|
+
rehypeStripUnsafe,
|
|
870
893
|
releaseStatusOptions,
|
|
871
894
|
releaseTypeOptions,
|
|
872
895
|
releaseTypeToBadgeColor,
|
|
@@ -882,19 +905,25 @@ import {
|
|
|
882
905
|
resolveSourceIcon,
|
|
883
906
|
resolveSourceRowCTA,
|
|
884
907
|
resolveStatusTagProps,
|
|
908
|
+
resolveTextSizeConfig,
|
|
885
909
|
resolveTicketStatus,
|
|
886
910
|
rgbToHex,
|
|
887
911
|
safeHref,
|
|
888
912
|
sanitizeTitleForChat,
|
|
889
913
|
saveDataEnabled,
|
|
914
|
+
scanHeadings,
|
|
890
915
|
serializeJsonLd,
|
|
891
916
|
shellLabels,
|
|
892
917
|
shouldProxyImage,
|
|
918
|
+
slugifyHeadingBase,
|
|
919
|
+
slugifyHeadingText,
|
|
893
920
|
sortBitesByCreatedAtDesc,
|
|
894
921
|
sortTreeChildren,
|
|
922
|
+
splitStreamingBlocks,
|
|
895
923
|
statusBadgeVariants,
|
|
896
924
|
stripChatAttachmentMarkdown,
|
|
897
925
|
stripFolderIndexFromPath,
|
|
926
|
+
stripHeadingEmojis,
|
|
898
927
|
stripHtml,
|
|
899
928
|
stripInlineMarkdown,
|
|
900
929
|
stripSameOriginToPath,
|
|
@@ -921,6 +950,7 @@ import {
|
|
|
921
950
|
useChatAttachments,
|
|
922
951
|
useChatCardItem,
|
|
923
952
|
useChatIdentity,
|
|
953
|
+
useChatStreamReducer,
|
|
924
954
|
useChunkCatchup,
|
|
925
955
|
useCloseOnNavigation,
|
|
926
956
|
useCollapsible,
|
|
@@ -930,6 +960,7 @@ import {
|
|
|
930
960
|
useDynamicTheme,
|
|
931
961
|
useEmptyStateConfig,
|
|
932
962
|
useFiltersDropdown,
|
|
963
|
+
useHeadingIdMap,
|
|
933
964
|
useJetStreamDialogSubscription,
|
|
934
965
|
useLoading,
|
|
935
966
|
useMarqueeSync,
|
|
@@ -940,7 +971,6 @@ import {
|
|
|
940
971
|
useOptionalTimeTracker,
|
|
941
972
|
usePageActionsBottomPadding,
|
|
942
973
|
useProxiedImageUrl,
|
|
943
|
-
useRealtimeChunkProcessor,
|
|
944
974
|
useSSE,
|
|
945
975
|
useScriptedStream,
|
|
946
976
|
useScrollFade,
|
|
@@ -959,7 +989,7 @@ import {
|
|
|
959
989
|
validateEmailDomain,
|
|
960
990
|
validateEmailDomainList,
|
|
961
991
|
validatePhoneNumber
|
|
962
|
-
} from "./chunk-
|
|
992
|
+
} from "./chunk-E6O6XATC.js";
|
|
963
993
|
import {
|
|
964
994
|
CommandApprovalToast,
|
|
965
995
|
DEFAULT_MIN_FILL_MS,
|
|
@@ -1439,6 +1469,7 @@ export {
|
|
|
1439
1469
|
ChatContainer,
|
|
1440
1470
|
ChatContent,
|
|
1441
1471
|
ChatContextChipStrip,
|
|
1472
|
+
ChatContextMemoryBar,
|
|
1442
1473
|
ChatContextPicker,
|
|
1443
1474
|
ChatDialogModals,
|
|
1444
1475
|
ChatFooter,
|
|
@@ -1508,8 +1539,10 @@ export {
|
|
|
1508
1539
|
CveLink,
|
|
1509
1540
|
DEFAULT_CONTENT_SUFFIXES,
|
|
1510
1541
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
1542
|
+
DEFAULT_DIALOG_SIDE,
|
|
1511
1543
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
1512
1544
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
1545
|
+
DEFAULT_MAX_REDUCERS,
|
|
1513
1546
|
DEFAULT_MIN_FILL_MS,
|
|
1514
1547
|
DEFAULT_OS_PLATFORM,
|
|
1515
1548
|
DEFAULT_THEME,
|
|
@@ -1648,6 +1681,7 @@ export {
|
|
|
1648
1681
|
GridViewIcon,
|
|
1649
1682
|
GuideModeBanner,
|
|
1650
1683
|
GuideWelcome,
|
|
1684
|
+
HEADING_EMOJI_RE,
|
|
1651
1685
|
HEX_PATTERN,
|
|
1652
1686
|
HONEYPOT_FIELD,
|
|
1653
1687
|
HUB_HEADER_OFFSET_PX,
|
|
@@ -1717,6 +1751,7 @@ export {
|
|
|
1717
1751
|
CheckCircleIcon2 as LucideCheckCircleIcon,
|
|
1718
1752
|
XIcon2 as LucideXIcon,
|
|
1719
1753
|
LumaIcon,
|
|
1754
|
+
MAX_PENDING_RETAIN_KEYS,
|
|
1720
1755
|
MESSAGE_ROLE,
|
|
1721
1756
|
MESSAGE_TYPE,
|
|
1722
1757
|
MOBILE_NAV_PANEL_ID,
|
|
@@ -1725,6 +1760,7 @@ export {
|
|
|
1725
1760
|
MacOSIcon,
|
|
1726
1761
|
MarginCrisisIcon,
|
|
1727
1762
|
MarkdownEditor,
|
|
1763
|
+
MarkdownEngine,
|
|
1728
1764
|
MarqueeWall,
|
|
1729
1765
|
MarqueeWallFades,
|
|
1730
1766
|
MediaGalleryManager,
|
|
@@ -1746,6 +1782,7 @@ export {
|
|
|
1746
1782
|
MenubarSubContent,
|
|
1747
1783
|
MenubarSubTrigger,
|
|
1748
1784
|
MenubarTrigger,
|
|
1785
|
+
MermaidDiagram,
|
|
1749
1786
|
MessageCircleIcon,
|
|
1750
1787
|
MessageSegmentAccumulator,
|
|
1751
1788
|
MiamiCyberGangLogo,
|
|
@@ -1905,6 +1942,7 @@ export {
|
|
|
1905
1942
|
RoadmapCard,
|
|
1906
1943
|
RoadmapCardSkeleton,
|
|
1907
1944
|
RoadmapVoteButton,
|
|
1945
|
+
SAFE_HTML_TAGS,
|
|
1908
1946
|
SCROLL_ANCHOR,
|
|
1909
1947
|
SCROLL_ANCHOR_WIRE_KEY,
|
|
1910
1948
|
SECTION_HEADING_CLASS,
|
|
@@ -1920,6 +1958,7 @@ export {
|
|
|
1920
1958
|
SSOConfigurationIcon,
|
|
1921
1959
|
STICKY_HEADER_OFFSET_PX,
|
|
1922
1960
|
STRIP_CELL_MAX_WIDTH,
|
|
1961
|
+
SVG_TAGS,
|
|
1923
1962
|
SYNTHETIC_REALTIME_ID_PREFIXES,
|
|
1924
1963
|
ScriptArguments,
|
|
1925
1964
|
ScriptGenerationIcon,
|
|
@@ -2002,6 +2041,7 @@ export {
|
|
|
2002
2041
|
TAG_BADGE_CLASS,
|
|
2003
2042
|
TASK_TYPE_LABELS,
|
|
2004
2043
|
TASK_TYPE_TEXT_COLORS,
|
|
2044
|
+
TEXT_SIZE_PRESETS,
|
|
2005
2045
|
THEME_ATTRIBUTE,
|
|
2006
2046
|
THEME_STORAGE_KEY,
|
|
2007
2047
|
TICKET_STATUS_COLOR_PRESETS,
|
|
@@ -2124,14 +2164,18 @@ export {
|
|
|
2124
2164
|
buildDefaultHref,
|
|
2125
2165
|
buildDiscussAddendum,
|
|
2126
2166
|
buildDocumentTree,
|
|
2167
|
+
buildEffectiveTagSet,
|
|
2168
|
+
buildHeadingIdMap,
|
|
2127
2169
|
buildListUrl,
|
|
2128
2170
|
buildNatsWsUrl,
|
|
2129
2171
|
buildOgPlaceholderUrl,
|
|
2130
2172
|
buildProductReleaseCardProps,
|
|
2173
|
+
buildSanitizeSchema,
|
|
2131
2174
|
buildStreamFrames,
|
|
2132
2175
|
buildSuggestionUrl,
|
|
2133
2176
|
buttonVariants,
|
|
2134
2177
|
canonicalContentRefType,
|
|
2178
|
+
cardAwareUrlTransform,
|
|
2135
2179
|
changelogLabels,
|
|
2136
2180
|
embedAuthedFetch as chatAuthedFetch,
|
|
2137
2181
|
chatChipClass,
|
|
@@ -2145,16 +2189,24 @@ export {
|
|
|
2145
2189
|
cn,
|
|
2146
2190
|
coerceValue,
|
|
2147
2191
|
columnFromTicketStatus,
|
|
2192
|
+
completeStreamingTail,
|
|
2148
2193
|
computeHistoryPrepend,
|
|
2149
2194
|
computeIsNewTab,
|
|
2150
2195
|
configureAuthenticatedImage,
|
|
2151
2196
|
configureBatchImageFetch,
|
|
2152
2197
|
consumeAccessCode,
|
|
2198
|
+
createChatDialogStore,
|
|
2199
|
+
createChatStreamReducer,
|
|
2153
2200
|
createColumnHelper,
|
|
2201
|
+
createDeltaBatcher,
|
|
2202
|
+
createEmptyTurnMeta,
|
|
2203
|
+
createFenceTracker,
|
|
2204
|
+
createHeadingIdDeduper,
|
|
2154
2205
|
createMessageSegmentAccumulator,
|
|
2155
2206
|
createSearchParams,
|
|
2156
2207
|
createUTCTimestamp,
|
|
2157
2208
|
decideNewTab,
|
|
2209
|
+
decodeHistoricalMessageData,
|
|
2158
2210
|
deepClone,
|
|
2159
2211
|
defaultBuildProductReleaseCardProps,
|
|
2160
2212
|
defaultTableIdForDocumentType,
|
|
@@ -2169,6 +2221,7 @@ export {
|
|
|
2169
2221
|
embedAuthedFetch,
|
|
2170
2222
|
ensureBiteIds,
|
|
2171
2223
|
escapeMarkdownInline,
|
|
2224
|
+
escapeUnknownHtmlTags,
|
|
2172
2225
|
evaluateHumanitySignals,
|
|
2173
2226
|
executeNavigation,
|
|
2174
2227
|
executeNavigationImperative,
|
|
@@ -2180,10 +2233,11 @@ export {
|
|
|
2180
2233
|
extractHumanitySignals,
|
|
2181
2234
|
extractImageEdgeColorAsync,
|
|
2182
2235
|
extractIncompleteMessageState,
|
|
2236
|
+
extractIncompleteTailState,
|
|
2183
2237
|
extractItemId,
|
|
2184
2238
|
extractItems,
|
|
2185
2239
|
extractSections,
|
|
2186
|
-
|
|
2240
|
+
extractText,
|
|
2187
2241
|
extractVariablesFromQuery,
|
|
2188
2242
|
extractYouTubeId,
|
|
2189
2243
|
faqItemAnchor,
|
|
@@ -2331,16 +2385,14 @@ export {
|
|
|
2331
2385
|
introspector,
|
|
2332
2386
|
isAnnouncementDismissed,
|
|
2333
2387
|
isApprovalNotification,
|
|
2334
|
-
|
|
2388
|
+
isBlankLine,
|
|
2335
2389
|
isCrossOriginUrl,
|
|
2336
2390
|
isDismissedCookieValue,
|
|
2337
|
-
isErrorChunk,
|
|
2338
2391
|
isFigmaSlidesUrl,
|
|
2339
2392
|
isGenericDomain,
|
|
2340
2393
|
isGenericWebsiteDomain,
|
|
2341
2394
|
isHistoricalUserTurn,
|
|
2342
2395
|
isInputObjectType,
|
|
2343
|
-
isMetadataChunk,
|
|
2344
2396
|
isModifierClick,
|
|
2345
2397
|
isOSPlatform,
|
|
2346
2398
|
isQuickActionIconSpec,
|
|
@@ -2377,7 +2429,6 @@ export {
|
|
|
2377
2429
|
normalizeToolTypeWithFallback,
|
|
2378
2430
|
orderContentRefTypes,
|
|
2379
2431
|
osLabels,
|
|
2380
|
-
parseChunkToAction,
|
|
2381
2432
|
parseFaqHash,
|
|
2382
2433
|
parseScrollAnchor,
|
|
2383
2434
|
parseWireCommandOverride,
|
|
@@ -2392,10 +2443,12 @@ export {
|
|
|
2392
2443
|
platformSlogans,
|
|
2393
2444
|
processHistoricalMessages,
|
|
2394
2445
|
processHistoricalMessagesWithErrors,
|
|
2446
|
+
processShortcodes,
|
|
2395
2447
|
programItemToStripProfile,
|
|
2396
2448
|
progressColorByVariant,
|
|
2397
2449
|
ratioToCategory,
|
|
2398
2450
|
readLeadingDecisionFrame,
|
|
2451
|
+
rehypeStripUnsafe,
|
|
2399
2452
|
releaseStatusOptions,
|
|
2400
2453
|
releaseTypeOptions,
|
|
2401
2454
|
releaseTypeToBadgeColor,
|
|
@@ -2412,11 +2465,13 @@ export {
|
|
|
2412
2465
|
resolveSourceIcon,
|
|
2413
2466
|
resolveSourceRowCTA,
|
|
2414
2467
|
resolveStatusTagProps,
|
|
2468
|
+
resolveTextSizeConfig,
|
|
2415
2469
|
resolveTicketStatus,
|
|
2416
2470
|
rgbToHex,
|
|
2417
2471
|
safeHref,
|
|
2418
2472
|
sanitizeTitleForChat,
|
|
2419
2473
|
saveDataEnabled,
|
|
2474
|
+
scanHeadings,
|
|
2420
2475
|
scrollElementIntoView,
|
|
2421
2476
|
serializeJsonLd,
|
|
2422
2477
|
setEmbedProxyAuth as setChatProxyAuth,
|
|
@@ -2428,12 +2483,16 @@ export {
|
|
|
2428
2483
|
shouldProxyImage,
|
|
2429
2484
|
showCommandApprovalToast,
|
|
2430
2485
|
showToast,
|
|
2486
|
+
slugifyHeadingBase,
|
|
2487
|
+
slugifyHeadingText,
|
|
2431
2488
|
sortBitesByCreatedAtDesc,
|
|
2432
2489
|
sortTreeChildren,
|
|
2433
2490
|
splitCsvEnv,
|
|
2491
|
+
splitStreamingBlocks,
|
|
2434
2492
|
statusBadgeVariants,
|
|
2435
2493
|
stripChatAttachmentMarkdown,
|
|
2436
2494
|
stripFolderIndexFromPath,
|
|
2495
|
+
stripHeadingEmojis,
|
|
2437
2496
|
stripHtml,
|
|
2438
2497
|
stripInlineMarkdown,
|
|
2439
2498
|
stripSameOriginToPath,
|
|
@@ -2469,6 +2528,7 @@ export {
|
|
|
2469
2528
|
useChatAttachments,
|
|
2470
2529
|
useChatCardItem,
|
|
2471
2530
|
useChatIdentity,
|
|
2531
|
+
useChatStreamReducer,
|
|
2472
2532
|
useChunkCatchup,
|
|
2473
2533
|
useCloseOnNavigation,
|
|
2474
2534
|
useCollapsible,
|
|
@@ -2486,6 +2546,7 @@ export {
|
|
|
2486
2546
|
useFiltersDropdown,
|
|
2487
2547
|
useFocusTrap,
|
|
2488
2548
|
useHeaderHeight,
|
|
2549
|
+
useHeadingIdMap,
|
|
2489
2550
|
useHorizontalScrollbar,
|
|
2490
2551
|
useHumanitySignals,
|
|
2491
2552
|
useImageEdgeColor,
|
|
@@ -2514,7 +2575,6 @@ export {
|
|
|
2514
2575
|
usePreventScroll,
|
|
2515
2576
|
useProxiedImageUrl,
|
|
2516
2577
|
useQueryParams,
|
|
2517
|
-
useRealtimeChunkProcessor,
|
|
2518
2578
|
useResetOnPageHidden,
|
|
2519
2579
|
useSSE,
|
|
2520
2580
|
useScriptedStream,
|
package/dist/utils/index.cjs
CHANGED
|
@@ -3957,6 +3957,151 @@ function buildDocumentTree(docs, mapFn, getParentPath, getPath) {
|
|
|
3957
3957
|
return sortTreeChildren(rootNodes);
|
|
3958
3958
|
}
|
|
3959
3959
|
|
|
3960
|
+
// src/utils/markdown-fences.ts
|
|
3961
|
+
var FENCE_RE = /^ {0,3}(`{3,}|~{3,})([^\n]*?)\r?$/;
|
|
3962
|
+
var BLANK_LINE_RE = /^[ \t\r]*$/;
|
|
3963
|
+
function isBlankLine(line) {
|
|
3964
|
+
return BLANK_LINE_RE.test(line);
|
|
3965
|
+
}
|
|
3966
|
+
function createFenceTracker() {
|
|
3967
|
+
let fenceChar = null;
|
|
3968
|
+
let fenceLength = 0;
|
|
3969
|
+
return {
|
|
3970
|
+
push(line) {
|
|
3971
|
+
const fence = FENCE_RE.exec(line);
|
|
3972
|
+
if (fence) {
|
|
3973
|
+
const run = fence[1];
|
|
3974
|
+
if (fenceChar === null) {
|
|
3975
|
+
fenceChar = run[0];
|
|
3976
|
+
fenceLength = run.length;
|
|
3977
|
+
return "open";
|
|
3978
|
+
}
|
|
3979
|
+
if (run[0] === fenceChar && run.length >= fenceLength && isBlankLine(fence[2])) {
|
|
3980
|
+
fenceChar = null;
|
|
3981
|
+
fenceLength = 0;
|
|
3982
|
+
return "close";
|
|
3983
|
+
}
|
|
3984
|
+
return "inside";
|
|
3985
|
+
}
|
|
3986
|
+
return fenceChar === null ? "text" : "inside";
|
|
3987
|
+
},
|
|
3988
|
+
openChar: () => fenceChar,
|
|
3989
|
+
openLength: () => fenceLength
|
|
3990
|
+
};
|
|
3991
|
+
}
|
|
3992
|
+
|
|
3993
|
+
// src/utils/markdown-heading-id.ts
|
|
3994
|
+
var HEADING_EMOJI_RE = /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu;
|
|
3995
|
+
function stripHeadingEmojis(text) {
|
|
3996
|
+
return text.replace(HEADING_EMOJI_RE, "").trim();
|
|
3997
|
+
}
|
|
3998
|
+
function slugifyHeadingBase(text) {
|
|
3999
|
+
return text.trim().toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
|
|
4000
|
+
}
|
|
4001
|
+
function slugifyHeadingText(text) {
|
|
4002
|
+
return slugifyHeadingBase(stripHeadingEmojis(text));
|
|
4003
|
+
}
|
|
4004
|
+
var ATX_HEADING_RE = /^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*\r?$/;
|
|
4005
|
+
var ATX_EMPTY_RE = /^ {0,3}(#{1,6})[ \t]*#*[ \t]*\r?$/;
|
|
4006
|
+
var RAW_HEADING_RE = /<h([1-6])\b[^>]*>([\s\S]*?)(?:<\/h\1>|$)/gi;
|
|
4007
|
+
var CONTAINER_PREFIX_RE = /^ {0,3}(?:(?:>[ \t]?)+|(?:[-+*]|\d{1,9}[.)])[ \t]+)+/;
|
|
4008
|
+
var SETEXT_UNDERLINE_RE = /^ {0,3}(=+|-+)[ \t]*\r?$/;
|
|
4009
|
+
var THEMATIC_BREAK_RE = /^ {0,3}(\*|_){3,}[ \t]*\r?$/;
|
|
4010
|
+
var HTML_BLOCK_TAGS = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
4011
|
+
var HTML_BLOCK_OPENER_RE = new RegExp(
|
|
4012
|
+
`^ {0,3}(?:<(?:script|pre|style|textarea)(?:[\\s>]|$)|<!--|<\\?|<![a-zA-Z]|<!\\[CDATA\\[|</?(?:${HTML_BLOCK_TAGS})(?:[\\s/>]|$)|<[a-zA-Z][a-zA-Z0-9-]*(?:\\s[^>]*)?/?>[ \\t]*\\r?$|</[a-zA-Z][a-zA-Z0-9-]*[ \\t]*>[ \\t]*\\r?$)`,
|
|
4013
|
+
"i"
|
|
4014
|
+
);
|
|
4015
|
+
function scanHeadings(content, options = {}) {
|
|
4016
|
+
const { skipFrontmatter = true, includeRawHtml = true, skipFences = true } = options;
|
|
4017
|
+
const out = [];
|
|
4018
|
+
const lines = content.split("\n");
|
|
4019
|
+
const fences = skipFences ? createFenceTracker() : null;
|
|
4020
|
+
let start = 0;
|
|
4021
|
+
if (skipFrontmatter && lines[0]?.trim() === "---") {
|
|
4022
|
+
for (let i = 1; i < lines.length; i++) {
|
|
4023
|
+
if (lines[i].trim() === "---" || lines[i].trim() === "...") {
|
|
4024
|
+
start = i + 1;
|
|
4025
|
+
break;
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
let setextRun = null;
|
|
4030
|
+
for (let i = start; i < lines.length; i++) {
|
|
4031
|
+
const line = lines[i];
|
|
4032
|
+
if (fences) {
|
|
4033
|
+
const role = fences.push(line);
|
|
4034
|
+
if (role !== "text") {
|
|
4035
|
+
setextRun = null;
|
|
4036
|
+
continue;
|
|
4037
|
+
}
|
|
4038
|
+
}
|
|
4039
|
+
const prefix = CONTAINER_PREFIX_RE.exec(line)?.[0] ?? "";
|
|
4040
|
+
const body = prefix ? line.slice(prefix.length) : line;
|
|
4041
|
+
const setext = SETEXT_UNDERLINE_RE.exec(body);
|
|
4042
|
+
if (setext) {
|
|
4043
|
+
if (setextRun && !setextRun.disqualified && setextRun.prefix === prefix) {
|
|
4044
|
+
out.push({
|
|
4045
|
+
line: setextRun.line,
|
|
4046
|
+
level: setext[1][0] === "=" ? 1 : 2,
|
|
4047
|
+
text: setextRun.lines.join("\n")
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
setextRun = null;
|
|
4051
|
+
continue;
|
|
4052
|
+
}
|
|
4053
|
+
const atx = ATX_HEADING_RE.exec(body) ?? ATX_EMPTY_RE.exec(body);
|
|
4054
|
+
if (atx) {
|
|
4055
|
+
out.push({ line: i + 1, level: atx[1].length, text: (atx[2] ?? "").trim() });
|
|
4056
|
+
setextRun = null;
|
|
4057
|
+
continue;
|
|
4058
|
+
}
|
|
4059
|
+
if (includeRawHtml && line.indexOf("<") !== -1) {
|
|
4060
|
+
RAW_HEADING_RE.lastIndex = 0;
|
|
4061
|
+
let raw;
|
|
4062
|
+
let matched = false;
|
|
4063
|
+
while ((raw = RAW_HEADING_RE.exec(line)) !== null) {
|
|
4064
|
+
matched = true;
|
|
4065
|
+
out.push({
|
|
4066
|
+
line: i + 1,
|
|
4067
|
+
level: Number(raw[1]),
|
|
4068
|
+
text: raw[2].replace(/<[^>]*>/g, "").trim()
|
|
4069
|
+
});
|
|
4070
|
+
}
|
|
4071
|
+
if (matched) {
|
|
4072
|
+
setextRun = null;
|
|
4073
|
+
continue;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
if (isBlankLine(body) || THEMATIC_BREAK_RE.test(body)) {
|
|
4077
|
+
setextRun = null;
|
|
4078
|
+
continue;
|
|
4079
|
+
}
|
|
4080
|
+
if (setextRun && setextRun.prefix === prefix) {
|
|
4081
|
+
setextRun.lines.push(body.trim());
|
|
4082
|
+
} else {
|
|
4083
|
+
setextRun = {
|
|
4084
|
+
line: i + 1,
|
|
4085
|
+
prefix,
|
|
4086
|
+
lines: [body.trim()],
|
|
4087
|
+
disqualified: HTML_BLOCK_OPENER_RE.test(body)
|
|
4088
|
+
};
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
return out;
|
|
4092
|
+
}
|
|
4093
|
+
function createHeadingIdDeduper() {
|
|
4094
|
+
const counts = {};
|
|
4095
|
+
return (cleanId) => {
|
|
4096
|
+
if (counts[cleanId]) {
|
|
4097
|
+
counts[cleanId]++;
|
|
4098
|
+
return `${cleanId}-${counts[cleanId]}`;
|
|
4099
|
+
}
|
|
4100
|
+
counts[cleanId] = 1;
|
|
4101
|
+
return cleanId;
|
|
4102
|
+
};
|
|
4103
|
+
}
|
|
4104
|
+
|
|
3960
4105
|
// src/utils/markdown-to-plain.ts
|
|
3961
4106
|
function stripInlineMarkdown(s) {
|
|
3962
4107
|
return s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/`([^`]+)`/g, "$1");
|
|
@@ -3987,50 +4132,26 @@ var DEFAULT_OPTIONS = {
|
|
|
3987
4132
|
function extractSections(markdown, options = {}) {
|
|
3988
4133
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
3989
4134
|
const sections = [];
|
|
3990
|
-
const
|
|
3991
|
-
const
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
continue;
|
|
3999
|
-
}
|
|
4000
|
-
if (line === "---") {
|
|
4001
|
-
inYamlBlock = !inYamlBlock;
|
|
4002
|
-
continue;
|
|
4003
|
-
}
|
|
4004
|
-
if (inCodeBlock || inYamlBlock) continue;
|
|
4005
|
-
}
|
|
4006
|
-
const pattern = new RegExp(`^(#{1,${opts.maxLevel}})\\s+(.+)`);
|
|
4007
|
-
const match = line.match(pattern);
|
|
4008
|
-
if (!match) continue;
|
|
4009
|
-
const level = match[1].length;
|
|
4010
|
-
if (level > opts.maxLevel) continue;
|
|
4011
|
-
let title = match[2].trim();
|
|
4135
|
+
const dedupe = createHeadingIdDeduper();
|
|
4136
|
+
const scanned = scanHeadings(markdown, {
|
|
4137
|
+
skipFrontmatter: opts.skipCodeAndYamlBlocks,
|
|
4138
|
+
skipFences: opts.skipCodeAndYamlBlocks
|
|
4139
|
+
});
|
|
4140
|
+
for (const heading of scanned) {
|
|
4141
|
+
if (heading.level > opts.maxLevel) continue;
|
|
4142
|
+
let title = heading.text;
|
|
4012
4143
|
if (opts.stripFormattingMarkers) {
|
|
4013
4144
|
title = stripInlineMarkdown(title).trim();
|
|
4014
4145
|
}
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu,
|
|
4019
|
-
""
|
|
4020
|
-
).trim();
|
|
4021
|
-
}
|
|
4022
|
-
baseId = baseId.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
|
|
4146
|
+
const baseId = slugifyHeadingBase(
|
|
4147
|
+
opts.removeEmojis ? stripHeadingEmojis(title) : title
|
|
4148
|
+
);
|
|
4023
4149
|
const cleanId = baseId || `section-${sections.length + 1}`;
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
} else {
|
|
4030
|
-
idCounts[cleanId] = 1;
|
|
4031
|
-
}
|
|
4032
|
-
}
|
|
4033
|
-
sections.push({ id, title, level });
|
|
4150
|
+
sections.push({
|
|
4151
|
+
id: opts.handleDuplicateIds ? dedupe(cleanId) : cleanId,
|
|
4152
|
+
title,
|
|
4153
|
+
level: heading.level
|
|
4154
|
+
});
|
|
4034
4155
|
}
|
|
4035
4156
|
return sections;
|
|
4036
4157
|
}
|
|
@@ -4107,6 +4228,7 @@ exports.DESIGN_PALETTE = DESIGN_PALETTE;
|
|
|
4107
4228
|
exports.DEV_SECTION_PARAM_KEYS = DEV_SECTION_PARAM_KEYS;
|
|
4108
4229
|
exports.ELAPSED_MS_FIELD = ELAPSED_MS_FIELD;
|
|
4109
4230
|
exports.GENERIC_EMAIL_DOMAINS = GENERIC_EMAIL_DOMAINS;
|
|
4231
|
+
exports.HEADING_EMOJI_RE = HEADING_EMOJI_RE;
|
|
4110
4232
|
exports.HEX_PATTERN = HEX_PATTERN;
|
|
4111
4233
|
exports.HONEYPOT_FIELD = HONEYPOT_FIELD;
|
|
4112
4234
|
exports.HUB_HEADER_OFFSET_PX = HUB_HEADER_OFFSET_PX;
|
|
@@ -4144,6 +4266,8 @@ exports.clearLegacyAnnouncementCache = clearLegacyAnnouncementCache;
|
|
|
4144
4266
|
exports.clickupTaskUrl = clickupTaskUrl;
|
|
4145
4267
|
exports.cn = cn;
|
|
4146
4268
|
exports.consumeAccessCode = consumeAccessCode;
|
|
4269
|
+
exports.createFenceTracker = createFenceTracker;
|
|
4270
|
+
exports.createHeadingIdDeduper = createHeadingIdDeduper;
|
|
4147
4271
|
exports.createUTCTimestamp = createUTCTimestamp;
|
|
4148
4272
|
exports.deepClone = deepClone;
|
|
4149
4273
|
exports.delay = delay;
|
|
@@ -4265,6 +4389,7 @@ exports.getTrendColors = getTrendColors;
|
|
|
4265
4389
|
exports.hasGenericEmailDomain = hasGenericEmailDomain;
|
|
4266
4390
|
exports.hexToRgb = hexToRgb2;
|
|
4267
4391
|
exports.isAnnouncementDismissed = isAnnouncementDismissed;
|
|
4392
|
+
exports.isBlankLine = isBlankLine;
|
|
4268
4393
|
exports.isCrossOriginUrl = isCrossOriginUrl;
|
|
4269
4394
|
exports.isDismissedCookieValue = isDismissedCookieValue;
|
|
4270
4395
|
exports.isFigmaSlidesUrl = isFigmaSlidesUrl;
|
|
@@ -4306,15 +4431,19 @@ exports.resolveContentFetchPath = resolveContentFetchPath;
|
|
|
4306
4431
|
exports.resolveReleaseCover = resolveReleaseCover;
|
|
4307
4432
|
exports.rgbToHex = rgbToHex;
|
|
4308
4433
|
exports.sanitizeTitleForChat = sanitizeTitleForChat;
|
|
4434
|
+
exports.scanHeadings = scanHeadings;
|
|
4309
4435
|
exports.scrollElementIntoView = scrollElementIntoView;
|
|
4310
4436
|
exports.serializeJsonLd = serializeJsonLd;
|
|
4311
4437
|
exports.setEmbedAuthAdapter = setEmbedAuthAdapter;
|
|
4312
4438
|
exports.setEmbedProxyAuth = setEmbedProxyAuth;
|
|
4313
4439
|
exports.shouldProxyImage = shouldProxyImage;
|
|
4440
|
+
exports.slugifyHeadingBase = slugifyHeadingBase;
|
|
4441
|
+
exports.slugifyHeadingText = slugifyHeadingText;
|
|
4314
4442
|
exports.sortTreeChildren = sortTreeChildren;
|
|
4315
4443
|
exports.splitCsvEnv = splitCsvEnv;
|
|
4316
4444
|
exports.stripChatAttachmentMarkdown = stripChatAttachmentMarkdown;
|
|
4317
4445
|
exports.stripFolderIndexFromPath = stripFolderIndexFromPath;
|
|
4446
|
+
exports.stripHeadingEmojis = stripHeadingEmojis;
|
|
4318
4447
|
exports.stripHtml = stripHtml;
|
|
4319
4448
|
exports.stripInlineMarkdown = stripInlineMarkdown;
|
|
4320
4449
|
exports.toDocSlug = toDocSlug;
|