@flamingo-stack/openframe-frontend-core 0.0.458-snapshot.20260720215024 → 0.0.458
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/{chunk-BLZZXZNM.cjs → chunk-5USSSRAL.cjs} +26 -26
- package/dist/{chunk-BLZZXZNM.cjs.map → chunk-5USSSRAL.cjs.map} +1 -1
- package/dist/{chunk-CGNDAJ7V.js → chunk-6B27O3ZB.js} +4 -4
- package/dist/{chunk-P5JQDFRM.cjs → chunk-7IRPMNRL.cjs} +60 -60
- package/dist/chunk-7IRPMNRL.cjs.map +1 -0
- package/dist/{chunk-4XDWNAZW.cjs → chunk-DQ3EHM6G.cjs} +9 -9
- package/dist/{chunk-4XDWNAZW.cjs.map → chunk-DQ3EHM6G.cjs.map} +1 -1
- package/dist/{chunk-7KSEINAE.cjs → chunk-FTXDIDNX.cjs} +15 -15
- package/dist/{chunk-7KSEINAE.cjs.map → chunk-FTXDIDNX.cjs.map} +1 -1
- package/dist/{chunk-4R6H2U77.js → chunk-H7ETLG65.js} +4 -4
- package/dist/{chunk-LAOO7XHO.js → chunk-HWTUVLYB.js} +2 -2
- package/dist/{chunk-F2NMWV44.js → chunk-IDKDOQZL.js} +2 -2
- package/dist/{chunk-BQ7PMWLM.cjs → chunk-KIIOBK7G.cjs} +27 -28
- package/dist/chunk-KIIOBK7G.cjs.map +1 -0
- package/dist/{chunk-QO2XD3FR.js → chunk-KQGFKG6Y.js} +2 -2
- package/dist/{chunk-3N3TMZ62.cjs → chunk-L676XVP4.cjs} +7 -7
- package/dist/{chunk-3N3TMZ62.cjs.map → chunk-L676XVP4.cjs.map} +1 -1
- package/dist/{chunk-F7F43U7Q.cjs → chunk-LDAOPWXZ.cjs} +11 -11
- package/dist/{chunk-F7F43U7Q.cjs.map → chunk-LDAOPWXZ.cjs.map} +1 -1
- package/dist/{chunk-ADD3FPDG.cjs → chunk-MKLP2SOZ.cjs} +4886 -7004
- package/dist/chunk-MKLP2SOZ.cjs.map +1 -0
- package/dist/{chunk-VXJH5TDN.js → chunk-QL7ODLJA.js} +10 -10
- package/dist/chunk-QL7ODLJA.js.map +1 -0
- package/dist/{chunk-OR5AMXYN.js → chunk-R5QYMUKN.js} +2 -2
- package/dist/{chunk-REWRUV3K.js → chunk-TNLFAJPA.js} +9673 -11791
- package/dist/chunk-TNLFAJPA.js.map +1 -0
- package/dist/{chunk-XF5ROTMQ.js → chunk-U2YDR5DT.js} +2 -2
- package/dist/{chunk-PXZ7YQ5V.cjs → chunk-VTQSB6QB.cjs} +5 -5
- package/dist/{chunk-PXZ7YQ5V.cjs.map → chunk-VTQSB6QB.cjs.map} +1 -1
- package/dist/{chunk-UI7CIUAR.js → chunk-WGJPTFRH.js} +2 -2
- package/dist/{chunk-WCE66C2Z.cjs → chunk-XUNJILJT.cjs} +62 -62
- package/dist/{chunk-WCE66C2Z.cjs.map → chunk-XUNJILJT.cjs.map} +1 -1
- package/dist/{chunk-APF5QBAU.js → chunk-YQBPIUZU.js} +2 -2
- package/dist/{chunk-TA7MFVUS.cjs → chunk-YV2YA3QH.cjs} +31 -31
- package/dist/{chunk-TA7MFVUS.cjs.map → chunk-YV2YA3QH.cjs.map} +1 -1
- package/dist/{chunk-QSGZE6AZ.cjs → chunk-ZDJ4ZUQ4.cjs} +37 -37
- package/dist/{chunk-QSGZE6AZ.cjs.map → chunk-ZDJ4ZUQ4.cjs.map} +1 -1
- package/dist/{chunk-LJKZIIK4.js → chunk-ZHQQRYMB.js} +5 -6
- package/dist/chunk-ZHQQRYMB.js.map +1 -0
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chart.d.ts +1 -1
- 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/hooks/index.d.ts +1 -0
- 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 +48 -15
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts +6 -0
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +47 -3
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -10
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +0 -1
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +13 -21
- package/dist/components/chat/types/api.types.d.ts +81 -1
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/chat/types/processing.types.d.ts +90 -2
- package/dist/components/chat/types/processing.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chunk-parser.d.ts +25 -0
- package/dist/components/chat/utils/chunk-parser.d.ts.map +1 -0
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts +6 -34
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +3 -2
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts +11 -59
- 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 +129 -171
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +21 -63
- 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 +2 -44
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +13 -55
- package/dist/components/ui/rich-markdown-renderer.d.ts +34 -0
- package/dist/components/ui/rich-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/simple-markdown-renderer.d.ts +73 -0
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -0
- package/dist/index.cjs +2 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -71
- package/dist/utils/index.cjs +40 -169
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +41 -162
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/markdown-section-extractor.d.ts.map +1 -1
- package/package.json +1 -7
- package/src/components/chat/__tests__/chat-message-list.test.tsx +5 -293
- package/src/components/chat/chat-message-enhanced.tsx +17 -111
- package/src/components/chat/chat-message-list.tsx +113 -367
- package/src/components/chat/embeddable-chat.tsx +0 -6
- 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/.use-realtime-chunk-processor.md +50 -0
- package/src/components/chat/hooks/index.ts +1 -0
- package/src/components/chat/hooks/use-chat.ts +0 -8
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +822 -243
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +479 -0
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +666 -318
- package/src/components/chat/index.ts +0 -5
- package/src/components/chat/thinking-display.tsx +1 -1
- package/src/components/chat/types/.api.types.md +3 -1
- package/src/components/chat/types/.processing.types.md +23 -6
- package/src/components/chat/types/api.types.ts +73 -6
- package/src/components/chat/types/processing.types.ts +52 -11
- package/src/components/chat/utils/.chunk-parser.md +51 -0
- package/src/components/chat/utils/.index.md +5 -0
- package/src/components/chat/utils/chunk-parser.ts +255 -0
- package/src/components/chat/utils/extract-incomplete-message-state.ts +5 -63
- package/src/components/chat/utils/index.ts +8 -5
- package/src/components/chat/utils/process-historical-messages.ts +383 -352
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +4 -22
- package/src/components/shared/legal-document/legal-document-page.tsx +1 -1
- package/src/components/shared/product-release/release-detail-page.tsx +4 -19
- package/src/components/ui/.simple-markdown-renderer.md +40 -0
- package/src/components/ui/index.ts +2 -1
- package/src/components/ui/release-changelog-section.tsx +1 -1
- package/src/components/ui/rich-markdown-renderer.tsx +1223 -0
- package/src/components/ui/simple-markdown-renderer.tsx +965 -0
- package/src/components/ui/ticket-info-section.tsx +1 -1
- package/src/utils/index.ts +0 -1
- package/src/utils/markdown-section-extractor.ts +56 -41
- package/dist/chat-protocol/decode.d.ts +0 -58
- package/dist/chat-protocol/decode.d.ts.map +0 -1
- package/dist/chat-protocol/encode.d.ts +0 -44
- package/dist/chat-protocol/encode.d.ts.map +0 -1
- package/dist/chat-protocol/env-flag.d.ts +0 -35
- package/dist/chat-protocol/env-flag.d.ts.map +0 -1
- package/dist/chat-protocol/events.d.ts +0 -192
- package/dist/chat-protocol/events.d.ts.map +0 -1
- package/dist/chat-protocol/frames.d.ts +0 -206
- package/dist/chat-protocol/frames.d.ts.map +0 -1
- package/dist/chat-protocol/index.cjs +0 -493
- package/dist/chat-protocol/index.cjs.map +0 -1
- package/dist/chat-protocol/index.d.ts +0 -18
- package/dist/chat-protocol/index.d.ts.map +0 -1
- package/dist/chat-protocol/index.js +0 -477
- package/dist/chat-protocol/index.js.map +0 -1
- package/dist/chat-protocol/ip-normalize.d.ts +0 -44
- package/dist/chat-protocol/ip-normalize.d.ts.map +0 -1
- package/dist/chat-protocol/nats-decoder.d.ts +0 -26
- package/dist/chat-protocol/nats-decoder.d.ts.map +0 -1
- package/dist/chunk-ADD3FPDG.cjs.map +0 -1
- package/dist/chunk-BQ7PMWLM.cjs.map +0 -1
- package/dist/chunk-LJKZIIK4.js.map +0 -1
- package/dist/chunk-P5JQDFRM.cjs.map +0 -1
- package/dist/chunk-REWRUV3K.js.map +0 -1
- package/dist/chunk-VXJH5TDN.js.map +0 -1
- package/dist/components/chat/stream/chat-dialog-store.d.ts +0 -184
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +0 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +0 -367
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +0 -1
- package/dist/components/chat/stream/delta-batcher.d.ts +0 -51
- package/dist/components/chat/stream/delta-batcher.d.ts.map +0 -1
- package/dist/components/chat/stream/index.d.ts +0 -17
- package/dist/components/chat/stream/index.d.ts.map +0 -1
- package/dist/components/chat/stream/message-mutations.d.ts +0 -77
- package/dist/components/chat/stream/message-mutations.d.ts.map +0 -1
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts +0 -22
- package/dist/components/chat/stream/use-chat-stream-reducer.d.ts.map +0 -1
- package/dist/components/ui/markdown/base-components.d.ts +0 -56
- package/dist/components/ui/markdown/base-components.d.ts.map +0 -1
- package/dist/components/ui/markdown/engine.d.ts +0 -99
- package/dist/components/ui/markdown/engine.d.ts.map +0 -1
- package/dist/components/ui/markdown/heading-ids.d.ts +0 -65
- package/dist/components/ui/markdown/heading-ids.d.ts.map +0 -1
- package/dist/components/ui/markdown/index.d.ts +0 -18
- package/dist/components/ui/markdown/index.d.ts.map +0 -1
- package/dist/components/ui/markdown/mermaid-diagram.d.ts +0 -79
- package/dist/components/ui/markdown/mermaid-diagram.d.ts.map +0 -1
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts +0 -14
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +0 -1
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts +0 -40
- package/dist/components/ui/markdown/rich/rich-markdown-renderer.d.ts.map +0 -1
- package/dist/components/ui/markdown/rich/shortcodes.d.ts +0 -8
- package/dist/components/ui/markdown/rich/shortcodes.d.ts.map +0 -1
- package/dist/components/ui/markdown/sanitize.d.ts +0 -153
- package/dist/components/ui/markdown/sanitize.d.ts.map +0 -1
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts +0 -23
- package/dist/components/ui/markdown/simple-markdown-renderer.d.ts.map +0 -1
- package/dist/components/ui/markdown/streaming.d.ts +0 -78
- package/dist/components/ui/markdown/streaming.d.ts.map +0 -1
- package/dist/components/ui/markdown/text-size.d.ts +0 -34
- package/dist/components/ui/markdown/text-size.d.ts.map +0 -1
- package/dist/utils/markdown-fences.d.ts +0 -42
- package/dist/utils/markdown-fences.d.ts.map +0 -1
- package/dist/utils/markdown-heading-id.d.ts +0 -85
- package/dist/utils/markdown-heading-id.d.ts.map +0 -1
- package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +0 -307
- package/src/chat-protocol/__tests__/chat-protocol.test.ts +0 -515
- package/src/chat-protocol/__tests__/env-flag.test.ts +0 -52
- package/src/chat-protocol/__tests__/ip-normalize.test.ts +0 -136
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +0 -228
- package/src/chat-protocol/decode.ts +0 -277
- package/src/chat-protocol/encode.ts +0 -71
- package/src/chat-protocol/env-flag.ts +0 -39
- package/src/chat-protocol/events.ts +0 -228
- package/src/chat-protocol/frames.ts +0 -238
- package/src/chat-protocol/index.ts +0 -21
- package/src/chat-protocol/ip-normalize.ts +0 -146
- package/src/chat-protocol/nats-decoder.ts +0 -252
- package/src/components/chat/__tests__/chat-message-streaming-memo.test.tsx +0 -207
- package/src/components/chat/__tests__/chat-pending-turn.test.tsx +0 -209
- package/src/components/chat/hooks/__tests__/__snapshots__/persisted-state-v1-golden.test.ts.snap +0 -297
- 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 +0 -272
- package/src/components/chat/hooks/__tests__/sse-stream-golden.test.ts +0 -318
- package/src/components/chat/stream/__tests__/__snapshots__/chat-stream-reducer-golden.test.ts.snap +0 -937
- package/src/components/chat/stream/__tests__/chat-dialog-store.test.ts +0 -756
- package/src/components/chat/stream/__tests__/chat-stream-reducer-golden.test.ts +0 -460
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +0 -894
- package/src/components/chat/stream/__tests__/delta-batcher.test.ts +0 -255
- package/src/components/chat/stream/__tests__/use-chat-stream-reducer.test.ts +0 -98
- package/src/components/chat/stream/chat-dialog-store.ts +0 -536
- package/src/components/chat/stream/chat-stream-reducer.ts +0 -1796
- package/src/components/chat/stream/delta-batcher.ts +0 -159
- package/src/components/chat/stream/index.ts +0 -55
- package/src/components/chat/stream/message-mutations.ts +0 -338
- package/src/components/chat/stream/use-chat-stream-reducer.ts +0 -126
- package/src/components/chat/utils/__tests__/__snapshots__/process-historical-messages-golden.test.ts.snap +0 -418
- package/src/components/chat/utils/__tests__/__snapshots__/segment-accumulator-golden.test.ts.snap +0 -599
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +0 -317
- package/src/components/chat/utils/__tests__/segment-accumulator-golden.test.ts +0 -270
- package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +0 -2420
- package/src/components/ui/__tests__/markdown-parity.test.tsx +0 -2528
- package/src/components/ui/markdown/__tests__/mermaid-security.test.ts +0 -115
- package/src/components/ui/markdown/__tests__/mermaid-stale-render.test.tsx +0 -95
- package/src/components/ui/markdown/__tests__/sanitize-invariant.test.ts +0 -309
- package/src/components/ui/markdown/__tests__/streaming.test.tsx +0 -388
- package/src/components/ui/markdown/base-components.tsx +0 -341
- package/src/components/ui/markdown/engine.tsx +0 -315
- package/src/components/ui/markdown/heading-ids.ts +0 -239
- package/src/components/ui/markdown/index.ts +0 -49
- package/src/components/ui/markdown/mermaid-diagram.tsx +0 -291
- package/src/components/ui/markdown/rich/embed-overrides.tsx +0 -199
- package/src/components/ui/markdown/rich/rich-markdown-renderer.tsx +0 -184
- package/src/components/ui/markdown/rich/shortcodes.ts +0 -170
- package/src/components/ui/markdown/sanitize.ts +0 -3499
- package/src/components/ui/markdown/simple-markdown-renderer.tsx +0 -28
- package/src/components/ui/markdown/streaming.ts +0 -362
- package/src/components/ui/markdown/text-size.ts +0 -106
- package/src/utils/markdown-fences.ts +0 -127
- package/src/utils/markdown-heading-id.ts +0 -348
- /package/dist/{chunk-CGNDAJ7V.js.map → chunk-6B27O3ZB.js.map} +0 -0
- /package/dist/{chunk-4R6H2U77.js.map → chunk-H7ETLG65.js.map} +0 -0
- /package/dist/{chunk-LAOO7XHO.js.map → chunk-HWTUVLYB.js.map} +0 -0
- /package/dist/{chunk-F2NMWV44.js.map → chunk-IDKDOQZL.js.map} +0 -0
- /package/dist/{chunk-QO2XD3FR.js.map → chunk-KQGFKG6Y.js.map} +0 -0
- /package/dist/{chunk-OR5AMXYN.js.map → chunk-R5QYMUKN.js.map} +0 -0
- /package/dist/{chunk-XF5ROTMQ.js.map → chunk-U2YDR5DT.js.map} +0 -0
- /package/dist/{chunk-UI7CIUAR.js.map → chunk-WGJPTFRH.js.map} +0 -0
- /package/dist/{chunk-APF5QBAU.js.map → chunk-YQBPIUZU.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -193,10 +193,8 @@ import {
|
|
|
193
193
|
CveLink,
|
|
194
194
|
DEFAULT_CONTENT_SUFFIXES,
|
|
195
195
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
196
|
-
DEFAULT_DIALOG_SIDE,
|
|
197
196
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
198
197
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
199
|
-
DEFAULT_MAX_REDUCERS,
|
|
200
198
|
DEFAULT_OS_PLATFORM,
|
|
201
199
|
DEFAULT_THEME,
|
|
202
200
|
DEFAULT_VIDEO_BITES_TITLE,
|
|
@@ -288,7 +286,6 @@ import {
|
|
|
288
286
|
GlobalOverlayScrollbars,
|
|
289
287
|
GuideModeBanner,
|
|
290
288
|
GuideWelcome,
|
|
291
|
-
HEADING_EMOJI_RE,
|
|
292
289
|
HEX_PATTERN,
|
|
293
290
|
Header,
|
|
294
291
|
HeaderButton,
|
|
@@ -335,14 +332,12 @@ import {
|
|
|
335
332
|
LogSeverityDot,
|
|
336
333
|
LoginForm,
|
|
337
334
|
LogsList,
|
|
338
|
-
MAX_PENDING_RETAIN_KEYS,
|
|
339
335
|
MESSAGE_ROLE,
|
|
340
336
|
MESSAGE_TYPE,
|
|
341
337
|
MOBILE_NAV_PANEL_ID,
|
|
342
338
|
MUX_IMAGE_ORIGIN,
|
|
343
339
|
MUX_STREAM_ORIGIN,
|
|
344
340
|
MarkdownEditor,
|
|
345
|
-
MarkdownEngine,
|
|
346
341
|
MarqueeWall,
|
|
347
342
|
MarqueeWallFades,
|
|
348
343
|
MediaGalleryManager,
|
|
@@ -364,7 +359,6 @@ import {
|
|
|
364
359
|
MenubarSubContent,
|
|
365
360
|
MenubarSubTrigger,
|
|
366
361
|
MenubarTrigger,
|
|
367
|
-
MermaidDiagram,
|
|
368
362
|
MessageSegmentAccumulator,
|
|
369
363
|
MingoAiButton,
|
|
370
364
|
MingoChatHistory,
|
|
@@ -489,7 +483,6 @@ import {
|
|
|
489
483
|
RoadmapCard,
|
|
490
484
|
RoadmapCardSkeleton,
|
|
491
485
|
RoadmapVoteButton,
|
|
492
|
-
SAFE_HTML_TAGS,
|
|
493
486
|
SCROLL_ANCHOR,
|
|
494
487
|
SCROLL_ANCHOR_WIRE_KEY,
|
|
495
488
|
SECTION_HEADING_CLASS,
|
|
@@ -502,7 +495,6 @@ import {
|
|
|
502
495
|
SOURCE_ICON_NAMES,
|
|
503
496
|
SOURCE_LABELS_BY_TABLE,
|
|
504
497
|
STRIP_CELL_MAX_WIDTH,
|
|
505
|
-
SVG_TAGS,
|
|
506
498
|
SYNTHETIC_REALTIME_ID_PREFIXES,
|
|
507
499
|
ScriptArguments,
|
|
508
500
|
ScriptInfoSection,
|
|
@@ -558,7 +550,6 @@ import {
|
|
|
558
550
|
TAG_BADGE_CLASS,
|
|
559
551
|
TASK_TYPE_LABELS,
|
|
560
552
|
TASK_TYPE_TEXT_COLORS,
|
|
561
|
-
TEXT_SIZE_PRESETS,
|
|
562
553
|
THEME_ATTRIBUTE,
|
|
563
554
|
THEME_STORAGE_KEY,
|
|
564
555
|
TICKET_STATUS_COLOR_PRESETS,
|
|
@@ -658,16 +649,12 @@ import {
|
|
|
658
649
|
buildDefaultHref,
|
|
659
650
|
buildDiscussAddendum,
|
|
660
651
|
buildDocumentTree,
|
|
661
|
-
buildEffectiveTagSet,
|
|
662
|
-
buildHeadingIdMap,
|
|
663
652
|
buildListUrl,
|
|
664
653
|
buildNatsWsUrl,
|
|
665
654
|
buildProductReleaseCardProps,
|
|
666
|
-
buildSanitizeSchema,
|
|
667
655
|
buildStreamFrames,
|
|
668
656
|
buildSuggestionUrl,
|
|
669
657
|
canonicalContentRefType,
|
|
670
|
-
cardAwareUrlTransform,
|
|
671
658
|
changelogLabels,
|
|
672
659
|
chatChipClass,
|
|
673
660
|
cleanEmailDomain,
|
|
@@ -675,20 +662,12 @@ import {
|
|
|
675
662
|
clearLegacyAnnouncementCache,
|
|
676
663
|
clickupTaskUrl,
|
|
677
664
|
columnFromTicketStatus,
|
|
678
|
-
completeStreamingTail,
|
|
679
665
|
computeHistoryPrepend,
|
|
680
666
|
computeIsNewTab,
|
|
681
|
-
createChatDialogStore,
|
|
682
|
-
createChatStreamReducer,
|
|
683
667
|
createColumnHelper,
|
|
684
|
-
createDeltaBatcher,
|
|
685
|
-
createEmptyTurnMeta,
|
|
686
|
-
createFenceTracker,
|
|
687
|
-
createHeadingIdDeduper,
|
|
688
668
|
createMessageSegmentAccumulator,
|
|
689
669
|
createUTCTimestamp,
|
|
690
670
|
decideNewTab,
|
|
691
|
-
decodeHistoricalMessageData,
|
|
692
671
|
deepClone,
|
|
693
672
|
defaultBuildProductReleaseCardProps,
|
|
694
673
|
defaultTableIdForDocumentType,
|
|
@@ -701,7 +680,6 @@ import {
|
|
|
701
680
|
dismissAnnouncement,
|
|
702
681
|
ensureBiteIds,
|
|
703
682
|
escapeMarkdownInline,
|
|
704
|
-
escapeUnknownHtmlTags,
|
|
705
683
|
executeNavigation,
|
|
706
684
|
executeNavigationImperative,
|
|
707
685
|
exportToCSV,
|
|
@@ -711,11 +689,10 @@ import {
|
|
|
711
689
|
extractErrorMessages,
|
|
712
690
|
extractImageEdgeColorAsync,
|
|
713
691
|
extractIncompleteMessageState,
|
|
714
|
-
extractIncompleteTailState,
|
|
715
692
|
extractItemId,
|
|
716
693
|
extractItems,
|
|
717
694
|
extractSections,
|
|
718
|
-
|
|
695
|
+
extractTextFromChunk,
|
|
719
696
|
extractYouTubeId,
|
|
720
697
|
faqItemAnchor,
|
|
721
698
|
faqSectionSlug,
|
|
@@ -840,13 +817,15 @@ import {
|
|
|
840
817
|
interleave,
|
|
841
818
|
isAnnouncementDismissed,
|
|
842
819
|
isApprovalNotification,
|
|
843
|
-
|
|
820
|
+
isControlChunk,
|
|
844
821
|
isCrossOriginUrl,
|
|
845
822
|
isDismissedCookieValue,
|
|
823
|
+
isErrorChunk,
|
|
846
824
|
isFigmaSlidesUrl,
|
|
847
825
|
isGenericDomain,
|
|
848
826
|
isGenericWebsiteDomain,
|
|
849
827
|
isHistoricalUserTurn,
|
|
828
|
+
isMetadataChunk,
|
|
850
829
|
isModifierClick,
|
|
851
830
|
isOSPlatform,
|
|
852
831
|
isQuickActionIconSpec,
|
|
@@ -878,6 +857,7 @@ import {
|
|
|
878
857
|
normalizeToolTypeWithFallback,
|
|
879
858
|
orderContentRefTypes,
|
|
880
859
|
osLabels,
|
|
860
|
+
parseChunkToAction,
|
|
881
861
|
parseFaqHash,
|
|
882
862
|
parseScrollAnchor,
|
|
883
863
|
parseWireCommandOverride,
|
|
@@ -885,11 +865,9 @@ import {
|
|
|
885
865
|
pickReadableTextColor,
|
|
886
866
|
processHistoricalMessages,
|
|
887
867
|
processHistoricalMessagesWithErrors,
|
|
888
|
-
processShortcodes,
|
|
889
868
|
programItemToStripProfile,
|
|
890
869
|
ratioToCategory,
|
|
891
870
|
readLeadingDecisionFrame,
|
|
892
|
-
rehypeStripUnsafe,
|
|
893
871
|
releaseStatusOptions,
|
|
894
872
|
releaseTypeOptions,
|
|
895
873
|
releaseTypeToBadgeColor,
|
|
@@ -905,25 +883,19 @@ import {
|
|
|
905
883
|
resolveSourceIcon,
|
|
906
884
|
resolveSourceRowCTA,
|
|
907
885
|
resolveStatusTagProps,
|
|
908
|
-
resolveTextSizeConfig,
|
|
909
886
|
resolveTicketStatus,
|
|
910
887
|
rgbToHex,
|
|
911
888
|
safeHref,
|
|
912
889
|
sanitizeTitleForChat,
|
|
913
890
|
saveDataEnabled,
|
|
914
|
-
scanHeadings,
|
|
915
891
|
serializeJsonLd,
|
|
916
892
|
shellLabels,
|
|
917
893
|
shouldProxyImage,
|
|
918
|
-
slugifyHeadingBase,
|
|
919
|
-
slugifyHeadingText,
|
|
920
894
|
sortBitesByCreatedAtDesc,
|
|
921
895
|
sortTreeChildren,
|
|
922
|
-
splitStreamingBlocks,
|
|
923
896
|
statusBadgeVariants,
|
|
924
897
|
stripChatAttachmentMarkdown,
|
|
925
898
|
stripFolderIndexFromPath,
|
|
926
|
-
stripHeadingEmojis,
|
|
927
899
|
stripHtml,
|
|
928
900
|
stripInlineMarkdown,
|
|
929
901
|
stripSameOriginToPath,
|
|
@@ -950,7 +922,6 @@ import {
|
|
|
950
922
|
useChatAttachments,
|
|
951
923
|
useChatCardItem,
|
|
952
924
|
useChatIdentity,
|
|
953
|
-
useChatStreamReducer,
|
|
954
925
|
useChunkCatchup,
|
|
955
926
|
useCloseOnNavigation,
|
|
956
927
|
useCollapsible,
|
|
@@ -961,7 +932,6 @@ import {
|
|
|
961
932
|
useEmptyStateConfig,
|
|
962
933
|
useFiltersDropdown,
|
|
963
934
|
useFinePointer,
|
|
964
|
-
useHeadingIdMap,
|
|
965
935
|
useJetStreamDialogSubscription,
|
|
966
936
|
useLoading,
|
|
967
937
|
useMarqueeSync,
|
|
@@ -972,6 +942,7 @@ import {
|
|
|
972
942
|
useOptionalTimeTracker,
|
|
973
943
|
usePageActionsBottomPadding,
|
|
974
944
|
useProxiedImageUrl,
|
|
945
|
+
useRealtimeChunkProcessor,
|
|
975
946
|
useSSE,
|
|
976
947
|
useScriptedStream,
|
|
977
948
|
useScrollFade,
|
|
@@ -990,7 +961,7 @@ import {
|
|
|
990
961
|
validateEmailDomain,
|
|
991
962
|
validateEmailDomainList,
|
|
992
963
|
validatePhoneNumber
|
|
993
|
-
} from "./chunk-
|
|
964
|
+
} from "./chunk-TNLFAJPA.js";
|
|
994
965
|
import {
|
|
995
966
|
CommandApprovalToast,
|
|
996
967
|
DEFAULT_MIN_FILL_MS,
|
|
@@ -1538,10 +1509,8 @@ export {
|
|
|
1538
1509
|
CveLink,
|
|
1539
1510
|
DEFAULT_CONTENT_SUFFIXES,
|
|
1540
1511
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
1541
|
-
DEFAULT_DIALOG_SIDE,
|
|
1542
1512
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
1543
1513
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
1544
|
-
DEFAULT_MAX_REDUCERS,
|
|
1545
1514
|
DEFAULT_MIN_FILL_MS,
|
|
1546
1515
|
DEFAULT_OS_PLATFORM,
|
|
1547
1516
|
DEFAULT_THEME,
|
|
@@ -1681,7 +1650,6 @@ export {
|
|
|
1681
1650
|
GridViewIcon,
|
|
1682
1651
|
GuideModeBanner,
|
|
1683
1652
|
GuideWelcome,
|
|
1684
|
-
HEADING_EMOJI_RE,
|
|
1685
1653
|
HEX_PATTERN,
|
|
1686
1654
|
HONEYPOT_FIELD,
|
|
1687
1655
|
HUB_HEADER_OFFSET_PX,
|
|
@@ -1751,7 +1719,6 @@ export {
|
|
|
1751
1719
|
CheckCircleIcon2 as LucideCheckCircleIcon,
|
|
1752
1720
|
XIcon2 as LucideXIcon,
|
|
1753
1721
|
LumaIcon,
|
|
1754
|
-
MAX_PENDING_RETAIN_KEYS,
|
|
1755
1722
|
MESSAGE_ROLE,
|
|
1756
1723
|
MESSAGE_TYPE,
|
|
1757
1724
|
MOBILE_NAV_PANEL_ID,
|
|
@@ -1760,7 +1727,6 @@ export {
|
|
|
1760
1727
|
MacOSIcon,
|
|
1761
1728
|
MarginCrisisIcon,
|
|
1762
1729
|
MarkdownEditor,
|
|
1763
|
-
MarkdownEngine,
|
|
1764
1730
|
MarqueeWall,
|
|
1765
1731
|
MarqueeWallFades,
|
|
1766
1732
|
MediaGalleryManager,
|
|
@@ -1782,7 +1748,6 @@ export {
|
|
|
1782
1748
|
MenubarSubContent,
|
|
1783
1749
|
MenubarSubTrigger,
|
|
1784
1750
|
MenubarTrigger,
|
|
1785
|
-
MermaidDiagram,
|
|
1786
1751
|
MessageCircleIcon,
|
|
1787
1752
|
MessageSegmentAccumulator,
|
|
1788
1753
|
MiamiCyberGangLogo,
|
|
@@ -1943,7 +1908,6 @@ export {
|
|
|
1943
1908
|
RoadmapCard,
|
|
1944
1909
|
RoadmapCardSkeleton,
|
|
1945
1910
|
RoadmapVoteButton,
|
|
1946
|
-
SAFE_HTML_TAGS,
|
|
1947
1911
|
SCROLL_ANCHOR,
|
|
1948
1912
|
SCROLL_ANCHOR_WIRE_KEY,
|
|
1949
1913
|
SECTION_HEADING_CLASS,
|
|
@@ -1959,7 +1923,6 @@ export {
|
|
|
1959
1923
|
SSOConfigurationIcon,
|
|
1960
1924
|
STICKY_HEADER_OFFSET_PX,
|
|
1961
1925
|
STRIP_CELL_MAX_WIDTH,
|
|
1962
|
-
SVG_TAGS,
|
|
1963
1926
|
SYNTHETIC_REALTIME_ID_PREFIXES,
|
|
1964
1927
|
ScriptArguments,
|
|
1965
1928
|
ScriptGenerationIcon,
|
|
@@ -2042,7 +2005,6 @@ export {
|
|
|
2042
2005
|
TAG_BADGE_CLASS,
|
|
2043
2006
|
TASK_TYPE_LABELS,
|
|
2044
2007
|
TASK_TYPE_TEXT_COLORS,
|
|
2045
|
-
TEXT_SIZE_PRESETS,
|
|
2046
2008
|
THEME_ATTRIBUTE,
|
|
2047
2009
|
THEME_STORAGE_KEY,
|
|
2048
2010
|
TICKET_STATUS_COLOR_PRESETS,
|
|
@@ -2165,18 +2127,14 @@ export {
|
|
|
2165
2127
|
buildDefaultHref,
|
|
2166
2128
|
buildDiscussAddendum,
|
|
2167
2129
|
buildDocumentTree,
|
|
2168
|
-
buildEffectiveTagSet,
|
|
2169
|
-
buildHeadingIdMap,
|
|
2170
2130
|
buildListUrl,
|
|
2171
2131
|
buildNatsWsUrl,
|
|
2172
2132
|
buildOgPlaceholderUrl,
|
|
2173
2133
|
buildProductReleaseCardProps,
|
|
2174
|
-
buildSanitizeSchema,
|
|
2175
2134
|
buildStreamFrames,
|
|
2176
2135
|
buildSuggestionUrl,
|
|
2177
2136
|
buttonVariants,
|
|
2178
2137
|
canonicalContentRefType,
|
|
2179
|
-
cardAwareUrlTransform,
|
|
2180
2138
|
changelogLabels,
|
|
2181
2139
|
embedAuthedFetch as chatAuthedFetch,
|
|
2182
2140
|
chatChipClass,
|
|
@@ -2190,24 +2148,16 @@ export {
|
|
|
2190
2148
|
cn,
|
|
2191
2149
|
coerceValue,
|
|
2192
2150
|
columnFromTicketStatus,
|
|
2193
|
-
completeStreamingTail,
|
|
2194
2151
|
computeHistoryPrepend,
|
|
2195
2152
|
computeIsNewTab,
|
|
2196
2153
|
configureAuthenticatedImage,
|
|
2197
2154
|
configureBatchImageFetch,
|
|
2198
2155
|
consumeAccessCode,
|
|
2199
|
-
createChatDialogStore,
|
|
2200
|
-
createChatStreamReducer,
|
|
2201
2156
|
createColumnHelper,
|
|
2202
|
-
createDeltaBatcher,
|
|
2203
|
-
createEmptyTurnMeta,
|
|
2204
|
-
createFenceTracker,
|
|
2205
|
-
createHeadingIdDeduper,
|
|
2206
2157
|
createMessageSegmentAccumulator,
|
|
2207
2158
|
createSearchParams,
|
|
2208
2159
|
createUTCTimestamp,
|
|
2209
2160
|
decideNewTab,
|
|
2210
|
-
decodeHistoricalMessageData,
|
|
2211
2161
|
deepClone,
|
|
2212
2162
|
defaultBuildProductReleaseCardProps,
|
|
2213
2163
|
defaultTableIdForDocumentType,
|
|
@@ -2222,7 +2172,6 @@ export {
|
|
|
2222
2172
|
embedAuthedFetch,
|
|
2223
2173
|
ensureBiteIds,
|
|
2224
2174
|
escapeMarkdownInline,
|
|
2225
|
-
escapeUnknownHtmlTags,
|
|
2226
2175
|
evaluateHumanitySignals,
|
|
2227
2176
|
executeNavigation,
|
|
2228
2177
|
executeNavigationImperative,
|
|
@@ -2234,11 +2183,10 @@ export {
|
|
|
2234
2183
|
extractHumanitySignals,
|
|
2235
2184
|
extractImageEdgeColorAsync,
|
|
2236
2185
|
extractIncompleteMessageState,
|
|
2237
|
-
extractIncompleteTailState,
|
|
2238
2186
|
extractItemId,
|
|
2239
2187
|
extractItems,
|
|
2240
2188
|
extractSections,
|
|
2241
|
-
|
|
2189
|
+
extractTextFromChunk,
|
|
2242
2190
|
extractVariablesFromQuery,
|
|
2243
2191
|
extractYouTubeId,
|
|
2244
2192
|
faqItemAnchor,
|
|
@@ -2386,14 +2334,16 @@ export {
|
|
|
2386
2334
|
introspector,
|
|
2387
2335
|
isAnnouncementDismissed,
|
|
2388
2336
|
isApprovalNotification,
|
|
2389
|
-
|
|
2337
|
+
isControlChunk,
|
|
2390
2338
|
isCrossOriginUrl,
|
|
2391
2339
|
isDismissedCookieValue,
|
|
2340
|
+
isErrorChunk,
|
|
2392
2341
|
isFigmaSlidesUrl,
|
|
2393
2342
|
isGenericDomain,
|
|
2394
2343
|
isGenericWebsiteDomain,
|
|
2395
2344
|
isHistoricalUserTurn,
|
|
2396
2345
|
isInputObjectType,
|
|
2346
|
+
isMetadataChunk,
|
|
2397
2347
|
isModifierClick,
|
|
2398
2348
|
isOSPlatform,
|
|
2399
2349
|
isQuickActionIconSpec,
|
|
@@ -2430,6 +2380,7 @@ export {
|
|
|
2430
2380
|
normalizeToolTypeWithFallback,
|
|
2431
2381
|
orderContentRefTypes,
|
|
2432
2382
|
osLabels,
|
|
2383
|
+
parseChunkToAction,
|
|
2433
2384
|
parseFaqHash,
|
|
2434
2385
|
parseScrollAnchor,
|
|
2435
2386
|
parseWireCommandOverride,
|
|
@@ -2444,12 +2395,10 @@ export {
|
|
|
2444
2395
|
platformSlogans,
|
|
2445
2396
|
processHistoricalMessages,
|
|
2446
2397
|
processHistoricalMessagesWithErrors,
|
|
2447
|
-
processShortcodes,
|
|
2448
2398
|
programItemToStripProfile,
|
|
2449
2399
|
progressColorByVariant,
|
|
2450
2400
|
ratioToCategory,
|
|
2451
2401
|
readLeadingDecisionFrame,
|
|
2452
|
-
rehypeStripUnsafe,
|
|
2453
2402
|
releaseStatusOptions,
|
|
2454
2403
|
releaseTypeOptions,
|
|
2455
2404
|
releaseTypeToBadgeColor,
|
|
@@ -2466,13 +2415,11 @@ export {
|
|
|
2466
2415
|
resolveSourceIcon,
|
|
2467
2416
|
resolveSourceRowCTA,
|
|
2468
2417
|
resolveStatusTagProps,
|
|
2469
|
-
resolveTextSizeConfig,
|
|
2470
2418
|
resolveTicketStatus,
|
|
2471
2419
|
rgbToHex,
|
|
2472
2420
|
safeHref,
|
|
2473
2421
|
sanitizeTitleForChat,
|
|
2474
2422
|
saveDataEnabled,
|
|
2475
|
-
scanHeadings,
|
|
2476
2423
|
scrollElementIntoView,
|
|
2477
2424
|
serializeJsonLd,
|
|
2478
2425
|
setEmbedProxyAuth as setChatProxyAuth,
|
|
@@ -2484,16 +2431,12 @@ export {
|
|
|
2484
2431
|
shouldProxyImage,
|
|
2485
2432
|
showCommandApprovalToast,
|
|
2486
2433
|
showToast,
|
|
2487
|
-
slugifyHeadingBase,
|
|
2488
|
-
slugifyHeadingText,
|
|
2489
2434
|
sortBitesByCreatedAtDesc,
|
|
2490
2435
|
sortTreeChildren,
|
|
2491
2436
|
splitCsvEnv,
|
|
2492
|
-
splitStreamingBlocks,
|
|
2493
2437
|
statusBadgeVariants,
|
|
2494
2438
|
stripChatAttachmentMarkdown,
|
|
2495
2439
|
stripFolderIndexFromPath,
|
|
2496
|
-
stripHeadingEmojis,
|
|
2497
2440
|
stripHtml,
|
|
2498
2441
|
stripInlineMarkdown,
|
|
2499
2442
|
stripSameOriginToPath,
|
|
@@ -2529,7 +2472,6 @@ export {
|
|
|
2529
2472
|
useChatAttachments,
|
|
2530
2473
|
useChatCardItem,
|
|
2531
2474
|
useChatIdentity,
|
|
2532
|
-
useChatStreamReducer,
|
|
2533
2475
|
useChunkCatchup,
|
|
2534
2476
|
useCloseOnNavigation,
|
|
2535
2477
|
useCollapsible,
|
|
@@ -2548,7 +2490,6 @@ export {
|
|
|
2548
2490
|
useFinePointer,
|
|
2549
2491
|
useFocusTrap,
|
|
2550
2492
|
useHeaderHeight,
|
|
2551
|
-
useHeadingIdMap,
|
|
2552
2493
|
useHorizontalScrollbar,
|
|
2553
2494
|
useHumanitySignals,
|
|
2554
2495
|
useImageEdgeColor,
|
|
@@ -2577,6 +2518,7 @@ export {
|
|
|
2577
2518
|
usePreventScroll,
|
|
2578
2519
|
useProxiedImageUrl,
|
|
2579
2520
|
useQueryParams,
|
|
2521
|
+
useRealtimeChunkProcessor,
|
|
2580
2522
|
useResetOnPageHidden,
|
|
2581
2523
|
useSSE,
|
|
2582
2524
|
useScriptedStream,
|
package/dist/utils/index.cjs
CHANGED
|
@@ -3957,151 +3957,6 @@ 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
|
-
|
|
4105
3960
|
// src/utils/markdown-to-plain.ts
|
|
4106
3961
|
function stripInlineMarkdown(s) {
|
|
4107
3962
|
return s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/`([^`]+)`/g, "$1");
|
|
@@ -4132,26 +3987,50 @@ var DEFAULT_OPTIONS = {
|
|
|
4132
3987
|
function extractSections(markdown, options = {}) {
|
|
4133
3988
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
4134
3989
|
const sections = [];
|
|
4135
|
-
const
|
|
4136
|
-
const
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
3990
|
+
const lines = markdown.split("\n");
|
|
3991
|
+
const idCounts = {};
|
|
3992
|
+
let inCodeBlock = false;
|
|
3993
|
+
let inYamlBlock = false;
|
|
3994
|
+
for (const line of lines) {
|
|
3995
|
+
if (opts.skipCodeAndYamlBlocks) {
|
|
3996
|
+
if (line.startsWith("```")) {
|
|
3997
|
+
inCodeBlock = !inCodeBlock;
|
|
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();
|
|
4143
4012
|
if (opts.stripFormattingMarkers) {
|
|
4144
4013
|
title = stripInlineMarkdown(title).trim();
|
|
4145
4014
|
}
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4015
|
+
let baseId = title;
|
|
4016
|
+
if (opts.removeEmojis) {
|
|
4017
|
+
baseId = baseId.replace(
|
|
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, "");
|
|
4149
4023
|
const cleanId = baseId || `section-${sections.length + 1}`;
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4024
|
+
let id = cleanId;
|
|
4025
|
+
if (opts.handleDuplicateIds) {
|
|
4026
|
+
if (idCounts[cleanId]) {
|
|
4027
|
+
idCounts[cleanId]++;
|
|
4028
|
+
id = `${cleanId}-${idCounts[cleanId]}`;
|
|
4029
|
+
} else {
|
|
4030
|
+
idCounts[cleanId] = 1;
|
|
4031
|
+
}
|
|
4032
|
+
}
|
|
4033
|
+
sections.push({ id, title, level });
|
|
4155
4034
|
}
|
|
4156
4035
|
return sections;
|
|
4157
4036
|
}
|
|
@@ -4228,7 +4107,6 @@ exports.DESIGN_PALETTE = DESIGN_PALETTE;
|
|
|
4228
4107
|
exports.DEV_SECTION_PARAM_KEYS = DEV_SECTION_PARAM_KEYS;
|
|
4229
4108
|
exports.ELAPSED_MS_FIELD = ELAPSED_MS_FIELD;
|
|
4230
4109
|
exports.GENERIC_EMAIL_DOMAINS = GENERIC_EMAIL_DOMAINS;
|
|
4231
|
-
exports.HEADING_EMOJI_RE = HEADING_EMOJI_RE;
|
|
4232
4110
|
exports.HEX_PATTERN = HEX_PATTERN;
|
|
4233
4111
|
exports.HONEYPOT_FIELD = HONEYPOT_FIELD;
|
|
4234
4112
|
exports.HUB_HEADER_OFFSET_PX = HUB_HEADER_OFFSET_PX;
|
|
@@ -4266,8 +4144,6 @@ exports.clearLegacyAnnouncementCache = clearLegacyAnnouncementCache;
|
|
|
4266
4144
|
exports.clickupTaskUrl = clickupTaskUrl;
|
|
4267
4145
|
exports.cn = cn;
|
|
4268
4146
|
exports.consumeAccessCode = consumeAccessCode;
|
|
4269
|
-
exports.createFenceTracker = createFenceTracker;
|
|
4270
|
-
exports.createHeadingIdDeduper = createHeadingIdDeduper;
|
|
4271
4147
|
exports.createUTCTimestamp = createUTCTimestamp;
|
|
4272
4148
|
exports.deepClone = deepClone;
|
|
4273
4149
|
exports.delay = delay;
|
|
@@ -4389,7 +4265,6 @@ exports.getTrendColors = getTrendColors;
|
|
|
4389
4265
|
exports.hasGenericEmailDomain = hasGenericEmailDomain;
|
|
4390
4266
|
exports.hexToRgb = hexToRgb2;
|
|
4391
4267
|
exports.isAnnouncementDismissed = isAnnouncementDismissed;
|
|
4392
|
-
exports.isBlankLine = isBlankLine;
|
|
4393
4268
|
exports.isCrossOriginUrl = isCrossOriginUrl;
|
|
4394
4269
|
exports.isDismissedCookieValue = isDismissedCookieValue;
|
|
4395
4270
|
exports.isFigmaSlidesUrl = isFigmaSlidesUrl;
|
|
@@ -4431,19 +4306,15 @@ exports.resolveContentFetchPath = resolveContentFetchPath;
|
|
|
4431
4306
|
exports.resolveReleaseCover = resolveReleaseCover;
|
|
4432
4307
|
exports.rgbToHex = rgbToHex;
|
|
4433
4308
|
exports.sanitizeTitleForChat = sanitizeTitleForChat;
|
|
4434
|
-
exports.scanHeadings = scanHeadings;
|
|
4435
4309
|
exports.scrollElementIntoView = scrollElementIntoView;
|
|
4436
4310
|
exports.serializeJsonLd = serializeJsonLd;
|
|
4437
4311
|
exports.setEmbedAuthAdapter = setEmbedAuthAdapter;
|
|
4438
4312
|
exports.setEmbedProxyAuth = setEmbedProxyAuth;
|
|
4439
4313
|
exports.shouldProxyImage = shouldProxyImage;
|
|
4440
|
-
exports.slugifyHeadingBase = slugifyHeadingBase;
|
|
4441
|
-
exports.slugifyHeadingText = slugifyHeadingText;
|
|
4442
4314
|
exports.sortTreeChildren = sortTreeChildren;
|
|
4443
4315
|
exports.splitCsvEnv = splitCsvEnv;
|
|
4444
4316
|
exports.stripChatAttachmentMarkdown = stripChatAttachmentMarkdown;
|
|
4445
4317
|
exports.stripFolderIndexFromPath = stripFolderIndexFromPath;
|
|
4446
|
-
exports.stripHeadingEmojis = stripHeadingEmojis;
|
|
4447
4318
|
exports.stripHtml = stripHtml;
|
|
4448
4319
|
exports.stripInlineMarkdown = stripInlineMarkdown;
|
|
4449
4320
|
exports.toDocSlug = toDocSlug;
|