@flamingo-stack/openframe-frontend-core 0.0.468-snapshot.20260723140929 → 0.0.468
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-TOFOK7G5.cjs → chunk-2WZAR2MB.cjs} +37 -37
- package/dist/{chunk-TOFOK7G5.cjs.map → chunk-2WZAR2MB.cjs.map} +1 -1
- package/dist/{chunk-YXNWEVER.cjs → chunk-3I34MUEG.cjs} +62 -62
- package/dist/{chunk-YXNWEVER.cjs.map → chunk-3I34MUEG.cjs.map} +1 -1
- package/dist/{chunk-4W54HUP7.cjs → chunk-3PLQWO4H.cjs} +4896 -7014
- package/dist/chunk-3PLQWO4H.cjs.map +1 -0
- package/dist/{chunk-33FDAZDB.js → chunk-3TU6QURP.js} +2 -2
- package/dist/{chunk-2BJSRTKU.js → chunk-AEM7ADDG.js} +2 -2
- package/dist/{chunk-VUCYS36H.js → chunk-CLW2S55N.js} +10 -10
- package/dist/chunk-CLW2S55N.js.map +1 -0
- package/dist/{chunk-LRESZO4L.cjs → chunk-ELIY4AO2.cjs} +26 -26
- package/dist/{chunk-LRESZO4L.cjs.map → chunk-ELIY4AO2.cjs.map} +1 -1
- package/dist/{chunk-MMF6HJB7.js → chunk-EZESVVIM.js} +4 -4
- package/dist/{chunk-AW3LVWVV.js → chunk-HTSWLPMU.js} +2 -2
- package/dist/{chunk-MTLBBSLP.cjs → chunk-HVLMAT4T.cjs} +5 -5
- package/dist/{chunk-MTLBBSLP.cjs.map → chunk-HVLMAT4T.cjs.map} +1 -1
- package/dist/{chunk-RPAOSHBN.js → chunk-IUMPVRSH.js} +2 -2
- package/dist/{chunk-5HUTT3FD.cjs → chunk-J6CE6HZS.cjs} +11 -11
- package/dist/{chunk-5HUTT3FD.cjs.map → chunk-J6CE6HZS.cjs.map} +1 -1
- package/dist/{chunk-7I2QMUEZ.js → chunk-JW3UNHGW.js} +2 -2
- package/dist/{chunk-4UFRQT7Z.cjs → chunk-L3BWGFHT.cjs} +15 -15
- package/dist/{chunk-4UFRQT7Z.cjs.map → chunk-L3BWGFHT.cjs.map} +1 -1
- package/dist/{chunk-WHWDGCQV.cjs → chunk-MULVIGIN.cjs} +60 -60
- package/dist/chunk-MULVIGIN.cjs.map +1 -0
- package/dist/{chunk-AJSNF5YF.js → chunk-O2QOC5FA.js} +5 -6
- package/dist/chunk-O2QOC5FA.js.map +1 -0
- package/dist/{chunk-E6O6XATC.js → chunk-P5SLNM3C.js} +9699 -11817
- package/dist/chunk-P5SLNM3C.js.map +1 -0
- package/dist/{chunk-GYEZV4GK.js → chunk-QTGYQ2U7.js} +2 -2
- package/dist/{chunk-4QDFNDVW.js → chunk-QZJN5OHK.js} +4 -4
- package/dist/{chunk-U2KPMWO6.cjs → chunk-TISXEAGH.cjs} +7 -7
- package/dist/{chunk-U2KPMWO6.cjs.map → chunk-TISXEAGH.cjs.map} +1 -1
- package/dist/{chunk-V5YWOQBP.cjs → chunk-VHFH3BG6.cjs} +31 -31
- package/dist/{chunk-V5YWOQBP.cjs.map → chunk-VHFH3BG6.cjs.map} +1 -1
- package/dist/{chunk-OVIUQJ2H.cjs → chunk-VRJXY6TM.cjs} +27 -28
- package/dist/chunk-VRJXY6TM.cjs.map +1 -0
- package/dist/{chunk-DG7TX763.js → chunk-VYUEOKI6.js} +2 -2
- package/dist/{chunk-GLKULDQN.cjs → chunk-X77X3RKH.cjs} +9 -9
- package/dist/{chunk-GLKULDQN.cjs.map → chunk-X77X3RKH.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-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 +130 -172
- 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 +109 -358
- 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-4W54HUP7.cjs.map +0 -1
- package/dist/chunk-AJSNF5YF.js.map +0 -1
- package/dist/chunk-E6O6XATC.js.map +0 -1
- package/dist/chunk-OVIUQJ2H.cjs.map +0 -1
- package/dist/chunk-VUCYS36H.js.map +0 -1
- package/dist/chunk-WHWDGCQV.cjs.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-33FDAZDB.js.map → chunk-3TU6QURP.js.map} +0 -0
- /package/dist/{chunk-2BJSRTKU.js.map → chunk-AEM7ADDG.js.map} +0 -0
- /package/dist/{chunk-MMF6HJB7.js.map → chunk-EZESVVIM.js.map} +0 -0
- /package/dist/{chunk-AW3LVWVV.js.map → chunk-HTSWLPMU.js.map} +0 -0
- /package/dist/{chunk-RPAOSHBN.js.map → chunk-IUMPVRSH.js.map} +0 -0
- /package/dist/{chunk-7I2QMUEZ.js.map → chunk-JW3UNHGW.js.map} +0 -0
- /package/dist/{chunk-GYEZV4GK.js.map → chunk-QTGYQ2U7.js.map} +0 -0
- /package/dist/{chunk-4QDFNDVW.js.map → chunk-QZJN5OHK.js.map} +0 -0
- /package/dist/{chunk-DG7TX763.js.map → chunk-VYUEOKI6.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -195,10 +195,8 @@ import {
|
|
|
195
195
|
CveLink,
|
|
196
196
|
DEFAULT_CONTENT_SUFFIXES,
|
|
197
197
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
198
|
-
DEFAULT_DIALOG_SIDE,
|
|
199
198
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
200
199
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
201
|
-
DEFAULT_MAX_REDUCERS,
|
|
202
200
|
DEFAULT_OS_PLATFORM,
|
|
203
201
|
DEFAULT_THEME,
|
|
204
202
|
DEFAULT_VIDEO_BITES_TITLE,
|
|
@@ -289,7 +287,6 @@ import {
|
|
|
289
287
|
GitHubReleasesManager,
|
|
290
288
|
GuideModeBanner,
|
|
291
289
|
GuideWelcome,
|
|
292
|
-
HEADING_EMOJI_RE,
|
|
293
290
|
HEX_PATTERN,
|
|
294
291
|
Header,
|
|
295
292
|
HeaderButton,
|
|
@@ -336,14 +333,12 @@ import {
|
|
|
336
333
|
LogSeverityDot,
|
|
337
334
|
LoginForm,
|
|
338
335
|
LogsList,
|
|
339
|
-
MAX_PENDING_RETAIN_KEYS,
|
|
340
336
|
MESSAGE_ROLE,
|
|
341
337
|
MESSAGE_TYPE,
|
|
342
338
|
MOBILE_NAV_PANEL_ID,
|
|
343
339
|
MUX_IMAGE_ORIGIN,
|
|
344
340
|
MUX_STREAM_ORIGIN,
|
|
345
341
|
MarkdownEditor,
|
|
346
|
-
MarkdownEngine,
|
|
347
342
|
MarqueeWall,
|
|
348
343
|
MarqueeWallFades,
|
|
349
344
|
MediaGalleryManager,
|
|
@@ -365,7 +360,6 @@ import {
|
|
|
365
360
|
MenubarSubContent,
|
|
366
361
|
MenubarSubTrigger,
|
|
367
362
|
MenubarTrigger,
|
|
368
|
-
MermaidDiagram,
|
|
369
363
|
MessageSegmentAccumulator,
|
|
370
364
|
MingoAiButton,
|
|
371
365
|
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,
|
|
@@ -960,7 +931,6 @@ import {
|
|
|
960
931
|
useDynamicTheme,
|
|
961
932
|
useEmptyStateConfig,
|
|
962
933
|
useFiltersDropdown,
|
|
963
|
-
useHeadingIdMap,
|
|
964
934
|
useJetStreamDialogSubscription,
|
|
965
935
|
useLoading,
|
|
966
936
|
useMarqueeSync,
|
|
@@ -971,6 +941,7 @@ import {
|
|
|
971
941
|
useOptionalTimeTracker,
|
|
972
942
|
usePageActionsBottomPadding,
|
|
973
943
|
useProxiedImageUrl,
|
|
944
|
+
useRealtimeChunkProcessor,
|
|
974
945
|
useSSE,
|
|
975
946
|
useScriptedStream,
|
|
976
947
|
useScrollFade,
|
|
@@ -989,7 +960,7 @@ import {
|
|
|
989
960
|
validateEmailDomain,
|
|
990
961
|
validateEmailDomainList,
|
|
991
962
|
validatePhoneNumber
|
|
992
|
-
} from "./chunk-
|
|
963
|
+
} from "./chunk-P5SLNM3C.js";
|
|
993
964
|
import {
|
|
994
965
|
CommandApprovalToast,
|
|
995
966
|
DEFAULT_MIN_FILL_MS,
|
|
@@ -1539,10 +1510,8 @@ export {
|
|
|
1539
1510
|
CveLink,
|
|
1540
1511
|
DEFAULT_CONTENT_SUFFIXES,
|
|
1541
1512
|
DEFAULT_CUSTOM_STATUS_COLOR,
|
|
1542
|
-
DEFAULT_DIALOG_SIDE,
|
|
1543
1513
|
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
1544
1514
|
DEFAULT_FOLDER_INDEX_FILE,
|
|
1545
|
-
DEFAULT_MAX_REDUCERS,
|
|
1546
1515
|
DEFAULT_MIN_FILL_MS,
|
|
1547
1516
|
DEFAULT_OS_PLATFORM,
|
|
1548
1517
|
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,
|
|
@@ -1942,7 +1907,6 @@ export {
|
|
|
1942
1907
|
RoadmapCard,
|
|
1943
1908
|
RoadmapCardSkeleton,
|
|
1944
1909
|
RoadmapVoteButton,
|
|
1945
|
-
SAFE_HTML_TAGS,
|
|
1946
1910
|
SCROLL_ANCHOR,
|
|
1947
1911
|
SCROLL_ANCHOR_WIRE_KEY,
|
|
1948
1912
|
SECTION_HEADING_CLASS,
|
|
@@ -1958,7 +1922,6 @@ export {
|
|
|
1958
1922
|
SSOConfigurationIcon,
|
|
1959
1923
|
STICKY_HEADER_OFFSET_PX,
|
|
1960
1924
|
STRIP_CELL_MAX_WIDTH,
|
|
1961
|
-
SVG_TAGS,
|
|
1962
1925
|
SYNTHETIC_REALTIME_ID_PREFIXES,
|
|
1963
1926
|
ScriptArguments,
|
|
1964
1927
|
ScriptGenerationIcon,
|
|
@@ -2041,7 +2004,6 @@ export {
|
|
|
2041
2004
|
TAG_BADGE_CLASS,
|
|
2042
2005
|
TASK_TYPE_LABELS,
|
|
2043
2006
|
TASK_TYPE_TEXT_COLORS,
|
|
2044
|
-
TEXT_SIZE_PRESETS,
|
|
2045
2007
|
THEME_ATTRIBUTE,
|
|
2046
2008
|
THEME_STORAGE_KEY,
|
|
2047
2009
|
TICKET_STATUS_COLOR_PRESETS,
|
|
@@ -2164,18 +2126,14 @@ export {
|
|
|
2164
2126
|
buildDefaultHref,
|
|
2165
2127
|
buildDiscussAddendum,
|
|
2166
2128
|
buildDocumentTree,
|
|
2167
|
-
buildEffectiveTagSet,
|
|
2168
|
-
buildHeadingIdMap,
|
|
2169
2129
|
buildListUrl,
|
|
2170
2130
|
buildNatsWsUrl,
|
|
2171
2131
|
buildOgPlaceholderUrl,
|
|
2172
2132
|
buildProductReleaseCardProps,
|
|
2173
|
-
buildSanitizeSchema,
|
|
2174
2133
|
buildStreamFrames,
|
|
2175
2134
|
buildSuggestionUrl,
|
|
2176
2135
|
buttonVariants,
|
|
2177
2136
|
canonicalContentRefType,
|
|
2178
|
-
cardAwareUrlTransform,
|
|
2179
2137
|
changelogLabels,
|
|
2180
2138
|
embedAuthedFetch as chatAuthedFetch,
|
|
2181
2139
|
chatChipClass,
|
|
@@ -2189,24 +2147,16 @@ export {
|
|
|
2189
2147
|
cn,
|
|
2190
2148
|
coerceValue,
|
|
2191
2149
|
columnFromTicketStatus,
|
|
2192
|
-
completeStreamingTail,
|
|
2193
2150
|
computeHistoryPrepend,
|
|
2194
2151
|
computeIsNewTab,
|
|
2195
2152
|
configureAuthenticatedImage,
|
|
2196
2153
|
configureBatchImageFetch,
|
|
2197
2154
|
consumeAccessCode,
|
|
2198
|
-
createChatDialogStore,
|
|
2199
|
-
createChatStreamReducer,
|
|
2200
2155
|
createColumnHelper,
|
|
2201
|
-
createDeltaBatcher,
|
|
2202
|
-
createEmptyTurnMeta,
|
|
2203
|
-
createFenceTracker,
|
|
2204
|
-
createHeadingIdDeduper,
|
|
2205
2156
|
createMessageSegmentAccumulator,
|
|
2206
2157
|
createSearchParams,
|
|
2207
2158
|
createUTCTimestamp,
|
|
2208
2159
|
decideNewTab,
|
|
2209
|
-
decodeHistoricalMessageData,
|
|
2210
2160
|
deepClone,
|
|
2211
2161
|
defaultBuildProductReleaseCardProps,
|
|
2212
2162
|
defaultTableIdForDocumentType,
|
|
@@ -2221,7 +2171,6 @@ export {
|
|
|
2221
2171
|
embedAuthedFetch,
|
|
2222
2172
|
ensureBiteIds,
|
|
2223
2173
|
escapeMarkdownInline,
|
|
2224
|
-
escapeUnknownHtmlTags,
|
|
2225
2174
|
evaluateHumanitySignals,
|
|
2226
2175
|
executeNavigation,
|
|
2227
2176
|
executeNavigationImperative,
|
|
@@ -2233,11 +2182,10 @@ export {
|
|
|
2233
2182
|
extractHumanitySignals,
|
|
2234
2183
|
extractImageEdgeColorAsync,
|
|
2235
2184
|
extractIncompleteMessageState,
|
|
2236
|
-
extractIncompleteTailState,
|
|
2237
2185
|
extractItemId,
|
|
2238
2186
|
extractItems,
|
|
2239
2187
|
extractSections,
|
|
2240
|
-
|
|
2188
|
+
extractTextFromChunk,
|
|
2241
2189
|
extractVariablesFromQuery,
|
|
2242
2190
|
extractYouTubeId,
|
|
2243
2191
|
faqItemAnchor,
|
|
@@ -2385,14 +2333,16 @@ export {
|
|
|
2385
2333
|
introspector,
|
|
2386
2334
|
isAnnouncementDismissed,
|
|
2387
2335
|
isApprovalNotification,
|
|
2388
|
-
|
|
2336
|
+
isControlChunk,
|
|
2389
2337
|
isCrossOriginUrl,
|
|
2390
2338
|
isDismissedCookieValue,
|
|
2339
|
+
isErrorChunk,
|
|
2391
2340
|
isFigmaSlidesUrl,
|
|
2392
2341
|
isGenericDomain,
|
|
2393
2342
|
isGenericWebsiteDomain,
|
|
2394
2343
|
isHistoricalUserTurn,
|
|
2395
2344
|
isInputObjectType,
|
|
2345
|
+
isMetadataChunk,
|
|
2396
2346
|
isModifierClick,
|
|
2397
2347
|
isOSPlatform,
|
|
2398
2348
|
isQuickActionIconSpec,
|
|
@@ -2429,6 +2379,7 @@ export {
|
|
|
2429
2379
|
normalizeToolTypeWithFallback,
|
|
2430
2380
|
orderContentRefTypes,
|
|
2431
2381
|
osLabels,
|
|
2382
|
+
parseChunkToAction,
|
|
2432
2383
|
parseFaqHash,
|
|
2433
2384
|
parseScrollAnchor,
|
|
2434
2385
|
parseWireCommandOverride,
|
|
@@ -2443,12 +2394,10 @@ export {
|
|
|
2443
2394
|
platformSlogans,
|
|
2444
2395
|
processHistoricalMessages,
|
|
2445
2396
|
processHistoricalMessagesWithErrors,
|
|
2446
|
-
processShortcodes,
|
|
2447
2397
|
programItemToStripProfile,
|
|
2448
2398
|
progressColorByVariant,
|
|
2449
2399
|
ratioToCategory,
|
|
2450
2400
|
readLeadingDecisionFrame,
|
|
2451
|
-
rehypeStripUnsafe,
|
|
2452
2401
|
releaseStatusOptions,
|
|
2453
2402
|
releaseTypeOptions,
|
|
2454
2403
|
releaseTypeToBadgeColor,
|
|
@@ -2465,13 +2414,11 @@ export {
|
|
|
2465
2414
|
resolveSourceIcon,
|
|
2466
2415
|
resolveSourceRowCTA,
|
|
2467
2416
|
resolveStatusTagProps,
|
|
2468
|
-
resolveTextSizeConfig,
|
|
2469
2417
|
resolveTicketStatus,
|
|
2470
2418
|
rgbToHex,
|
|
2471
2419
|
safeHref,
|
|
2472
2420
|
sanitizeTitleForChat,
|
|
2473
2421
|
saveDataEnabled,
|
|
2474
|
-
scanHeadings,
|
|
2475
2422
|
scrollElementIntoView,
|
|
2476
2423
|
serializeJsonLd,
|
|
2477
2424
|
setEmbedProxyAuth as setChatProxyAuth,
|
|
@@ -2483,16 +2430,12 @@ export {
|
|
|
2483
2430
|
shouldProxyImage,
|
|
2484
2431
|
showCommandApprovalToast,
|
|
2485
2432
|
showToast,
|
|
2486
|
-
slugifyHeadingBase,
|
|
2487
|
-
slugifyHeadingText,
|
|
2488
2433
|
sortBitesByCreatedAtDesc,
|
|
2489
2434
|
sortTreeChildren,
|
|
2490
2435
|
splitCsvEnv,
|
|
2491
|
-
splitStreamingBlocks,
|
|
2492
2436
|
statusBadgeVariants,
|
|
2493
2437
|
stripChatAttachmentMarkdown,
|
|
2494
2438
|
stripFolderIndexFromPath,
|
|
2495
|
-
stripHeadingEmojis,
|
|
2496
2439
|
stripHtml,
|
|
2497
2440
|
stripInlineMarkdown,
|
|
2498
2441
|
stripSameOriginToPath,
|
|
@@ -2528,7 +2471,6 @@ export {
|
|
|
2528
2471
|
useChatAttachments,
|
|
2529
2472
|
useChatCardItem,
|
|
2530
2473
|
useChatIdentity,
|
|
2531
|
-
useChatStreamReducer,
|
|
2532
2474
|
useChunkCatchup,
|
|
2533
2475
|
useCloseOnNavigation,
|
|
2534
2476
|
useCollapsible,
|
|
@@ -2546,7 +2488,6 @@ export {
|
|
|
2546
2488
|
useFiltersDropdown,
|
|
2547
2489
|
useFocusTrap,
|
|
2548
2490
|
useHeaderHeight,
|
|
2549
|
-
useHeadingIdMap,
|
|
2550
2491
|
useHorizontalScrollbar,
|
|
2551
2492
|
useHumanitySignals,
|
|
2552
2493
|
useImageEdgeColor,
|
|
@@ -2575,6 +2516,7 @@ export {
|
|
|
2575
2516
|
usePreventScroll,
|
|
2576
2517
|
useProxiedImageUrl,
|
|
2577
2518
|
useQueryParams,
|
|
2519
|
+
useRealtimeChunkProcessor,
|
|
2578
2520
|
useResetOnPageHidden,
|
|
2579
2521
|
useSSE,
|
|
2580
2522
|
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;
|