decocms 2.310.1 → 2.310.3
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/client/assets/{AlertCircle-BUuG9jUS.js → AlertCircle-B72APkrz.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-B2WgGuUG.js → ArrowNarrowLeft-Dz0P9WNF.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BRxJDyw2.js → ArrowUpRight-CCQZEQ7k.js} +1 -1
- package/dist/client/assets/{Check-DNFNSXQB.js → Check-CUpq9BBu.js} +1 -1
- package/dist/client/assets/{CheckCircle-fDjMIV_J.js → CheckCircle-DTCxFilU.js} +1 -1
- package/dist/client/assets/{ChevronDown-plDbvt9_.js → ChevronDown-D5WF5tyi.js} +1 -1
- package/dist/client/assets/{ChevronRight-C6IGuK_L.js → ChevronRight-DwbV0YDZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-BQpSShtW.js → ChevronUp-CDMPc0ql.js} +1 -1
- package/dist/client/assets/{Container-cby1lpQK.js → Container-BioZd28q.js} +1 -1
- package/dist/client/assets/{DotsVertical-CrL41KCh.js → DotsVertical-D8wcDPCU.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DDjHJHtD.js → LinkExternal01-CKpEz_fF.js} +1 -1
- package/dist/client/assets/{Lock01-CMc8wMJA.js → Lock01-CHfwR6Qi.js} +1 -1
- package/dist/client/assets/{Palette-BsSq52os.js → Palette-brLBiHpP.js} +1 -1
- package/dist/client/assets/{Play-B93BJPTD.js → Play-DRCdZRLW.js} +1 -1
- package/dist/client/assets/{Plus-CsU0klMp.js → Plus-DNkjVBwq.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-GcJ7_jjW.js → RefreshCcw01-CdP9yH0w.js} +1 -1
- package/dist/client/assets/{SearchMd-CLV2ZHE1.js → SearchMd-JqX1mLMq.js} +1 -1
- package/dist/client/assets/{Settings02-CMQBJ6AU.js → Settings02-D1Jfvo1d.js} +1 -1
- package/dist/client/assets/{Shield01-Bb8uicnU.js → Shield01-D5fQpAyA.js} +1 -1
- package/dist/client/assets/{Star01-DOzaFb6_.js → Star01-Y834gtsL.js} +1 -1
- package/dist/client/assets/{Sun-Bp560G7u.js → Sun-BgOSswUu.js} +1 -1
- package/dist/client/assets/{Tool01-B1WXLPyp.js → Tool01-CXQZ3p7Z.js} +1 -1
- package/dist/client/assets/{Trash01-WbvRG8Rr.js → Trash01-B8-uqWxa.js} +1 -1
- package/dist/client/assets/{User01-Dqi_S_yw.js → User01-Cxb6YtJq.js} +1 -1
- package/dist/client/assets/{Users03-CmMFskSR.js → Users03-CXkopkPu.js} +1 -1
- package/dist/client/assets/{X-26aOhFK-.js → X-CdXDgTcN.js} +1 -1
- package/dist/client/assets/{XCircle-DuIm7Kpp.js → XCircle-CjR4LC4r.js} +1 -1
- package/dist/client/assets/{XClose-Bet7IpXN.js → XClose-zqTFiPq2.js} +1 -1
- package/dist/client/assets/{Zap-DHkXBm_R.js → Zap--FKeiDFf.js} +1 -1
- package/dist/client/assets/{ZapSquare-B0Ev1OMS.js → ZapSquare-CliIuzcs.js} +1 -1
- package/dist/client/assets/{accordion-D1MMgTV5.js → accordion-BBKL1fM-.js} +1 -1
- package/dist/client/assets/{agent-icon-BhSIvnHs.js → agent-icon-CaG-DX2m.js} +1 -1
- package/dist/client/assets/{agents-list-DfRZsmWN.js → agents-list-BUqQO9y3.js} +1 -1
- package/dist/client/assets/ai-providers-BvV5AI1b.js +1 -0
- package/dist/client/assets/{alert-dialog-Booud0bQ.js → alert-dialog-B-P8jHly.js} +1 -1
- package/dist/client/assets/{auth-catchall-CfLpBYfo.js → auth-catchall-CyIMPFaS.js} +1 -1
- package/dist/client/assets/{automation-list-row-3UbFqf20.js → automation-list-row-Qk3UXtKg.js} +1 -1
- package/dist/client/assets/{automations-Bpw-Bphr.js → automations-CkkIdwK3.js} +1 -1
- package/dist/client/assets/{avatar-Dr_hgnh5.js → avatar-CYyuZ3vB.js} +1 -1
- package/dist/client/assets/{badge-Dc_jqHv8.js → badge-C-R5WeFR.js} +1 -1
- package/dist/client/assets/{brand-context-DDkAkGby.js → brand-context-BqPn2XVA.js} +1 -1
- package/dist/client/assets/{card-I8QwhHay.js → card-BWjsP1pO.js} +1 -1
- package/dist/client/assets/{chat-context-DANvJNxJ.js → chat-context-D7DJNKEQ.js} +1 -1
- package/dist/client/assets/{checkbox-YDqzyyON.js → checkbox-DRyB8BVf.js} +1 -1
- package/dist/client/assets/{collection-detail-CEcX9P1L.js → collection-detail-BiG3-7wS.js} +1 -1
- package/dist/client/assets/{collection-display-button-CEbXTT1D.js → collection-display-button-D0yyhe94.js} +1 -1
- package/dist/client/assets/{collection-search-ZtrOS_FO.js → collection-search-BtC9EgTH.js} +1 -1
- package/dist/client/assets/{collection-search-54YVIzGK.js → collection-search-CVa4reVh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CykRk2i4.js → collection-table-wrapper-C2Zi2ikn.js} +1 -1
- package/dist/client/assets/{collection-tabs-BJYdyh2U.js → collection-tabs-8bicuWoG.js} +1 -1
- package/dist/client/assets/{collections-B4Ew0_5W.js → collections-ZqRHYd6U.js} +1 -1
- package/dist/client/assets/{command-BUdSnxPX.js → command-BUJHwA-d.js} +1 -1
- package/dist/client/assets/{connection-card-CPkO4XVy.js → connection-card-CiNzXirJ.js} +1 -1
- package/dist/client/assets/{connection-detail-7MO-vamz.js → connection-detail-DQFCqOq5.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DTw0Qq7p.js → connection-form-helpers-BFnOvbFy.js} +1 -1
- package/dist/client/assets/{connections-Cae6WzSq.js → connections-BzqA2cUL.js} +1 -1
- package/dist/client/assets/{constants-8vN_wpoM.js → constants-BmLTAQzq.js} +1 -1
- package/dist/client/assets/{constants-C0Z_UV1B.js → constants-Df56C9B1.js} +1 -1
- package/dist/client/assets/{dialog-ChC8b-fd.js → dialog-HqMwvS0c.js} +1 -1
- package/dist/client/assets/{domain-settings-wSm6QNFe.js → domain-settings-8zUtZk7o.js} +1 -1
- package/dist/client/assets/{drawer-C1rmyAh5.js → drawer-hkToOxOG.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BYnm4L0S.js → dropdown-menu-CD1YJIi0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-C8rDQhFA.js → dynamic-plugin-layout--sGvQXk2.js} +1 -1
- package/dist/client/assets/{empty-state-B5SEGNSf.js → empty-state-B29HN9Vl.js} +1 -1
- package/dist/client/assets/{empty-state-CS1xioMM.js → empty-state-CElAqeAn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CnZlsGuF.js → extract-connection-data-DYXiFLZH.js} +1 -1
- package/dist/client/assets/{features-B16s5Y96.js → features-Dvru3uGD.js} +1 -1
- package/dist/client/assets/{form-DgLK3RL7.js → form-CKajJk24.js} +1 -1
- package/dist/client/assets/{general-f6TAIn-G.js → general-D8u2dVV2.js} +1 -1
- package/dist/client/assets/{index-fsAFWsFR.js → index--52kuhAD.js} +1 -1
- package/dist/client/assets/{index-DsyVbeAM.js → index-BPbckF-i.js} +3 -3
- package/dist/client/assets/{index-CbahmBQ1.js → index-BPgW_PVH.js} +1 -1
- package/dist/client/assets/index-BTded5vd.js +1 -0
- package/dist/client/assets/{index-CgQIf70g.js → index-Boo37gVZ.js} +1 -1
- package/dist/client/assets/{index-CGzddOPN.js → index-CHpjwsZ-.js} +1 -1
- package/dist/client/assets/{index-TdWHe30j.js → index-CMbhqARA.js} +1 -1
- package/dist/client/assets/{index-BtR3GFsv.js → index-CO402MfB.js} +1 -1
- package/dist/client/assets/{index-C5EaiV0u.js → index-CgQG3OxM.js} +1 -1
- package/dist/client/assets/{index-DlX-BDoo.js → index-ClxNnAsp.js} +1 -1
- package/dist/client/assets/{index-CVMf-cdp.js → index-CnR4TnGO.js} +1 -1
- package/dist/client/assets/{index-D3id_i25.js → index-D7rGFiVq.js} +1 -1
- package/dist/client/assets/{index-BrFuw-qb.js → index-D9-ppQFz.js} +1 -1
- package/dist/client/assets/{index-ofAY-Kzj.js → index-DVk4aJ0j.js} +1 -1
- package/dist/client/assets/{index-DCa8vMMj.js → index-Y4klGMPr.js} +1 -1
- package/dist/client/assets/{index--hcGoWBP.js → index-k8njt3_A.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-Bw_LLK9Y.js → infiniteQueryObserver-IG8f9wWg.js} +1 -1
- package/dist/client/assets/{input-Di5VhXrx.js → input-DrFzs1Yw.js} +1 -1
- package/dist/client/assets/{integration-icon-BFclX5Vo.js → integration-icon-DUMCOZJc.js} +1 -1
- package/dist/client/assets/{label--CSWWgsb.js → label-0J4Z8Ji8.js} +1 -1
- package/dist/client/assets/{layout-DGzZ7eIZ.js → layout-zbF9c9kI.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-BRNt7FNZ.js → lean-canvas-recruit-modal-D2QgFiqW.js} +1 -1
- package/dist/client/assets/{login-CWxs7FH8.js → login-m1plet6k.js} +1 -1
- package/dist/client/assets/{members-D-RcZScv.js → members-DsVQeYYP.js} +1 -1
- package/dist/client/assets/{monaco-editor-BRZw2Ss_.js → monaco-editor-Br1M5lwR.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BELQHcMp.js → monitoring-stats-row-BtBHpMXc.js} +1 -1
- package/dist/client/assets/{oauth-callback-D1mU79r6.js → oauth-callback-D6DOFeyW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BI3N0zYC.js → oauth-callback-ai-provider-wUhwntlH.js} +1 -1
- package/dist/client/assets/{onboarding-Corplh-J.js → onboarding-dml5YruP.js} +1 -1
- package/dist/client/assets/{org-layout-Dw015CRn.js → org-layout-QSP-N9k0.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BhY_p3Sb.js → org-plugin-layout-ZONr0rlX.js} +1 -1
- package/dist/client/assets/{pair-BkQ-4R0Y.js → pair-mf97TAS_.js} +2 -2
- package/dist/client/assets/{plugin-empty-state-Daxzikof.js → plugin-empty-state-CFxEUNdF.js} +1 -1
- package/dist/client/assets/{plugin-header-DxSn3bJb.js → plugin-header-HXnwUdYS.js} +1 -1
- package/dist/client/assets/{plugin-layout-CLDR8aeJ.js → plugin-layout-ZwMLw5wK.js} +1 -1
- package/dist/client/assets/{popover-BxTvqO7l.js → popover-DUMNq33j.js} +1 -1
- package/dist/client/assets/{profile-CiaA4yp_.js → profile-CyqjRQfg.js} +1 -1
- package/dist/client/assets/{project-app-view-C9qLbJFL.js → project-app-view-Di4yF5Oz.js} +1 -1
- package/dist/client/assets/registry-DgOCTdY8.js +2 -0
- package/dist/client/assets/{registry-layout-DUo-P35f.js → registry-layout-B2U_9fgO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BnqlPeG9.js → required-auth-layout-PH0-_blQ.js} +1 -1
- package/dist/client/assets/{reset-password-DHzLCFSu.js → reset-password-5ioWEbN5.js} +1 -1
- package/dist/client/assets/{roles-qTMcTl_m.js → roles-4ojRgHgc.js} +1 -1
- package/dist/client/assets/{scroll-area-VgUNFi6v.js → scroll-area-D_tsHfC-.js} +1 -1
- package/dist/client/assets/{search-input-Fm6Uugnb.js → search-input-Boj5tfQn.js} +1 -1
- package/dist/client/assets/{select-4BiO-1He.js → select-B3lWwv9y.js} +1 -1
- package/dist/client/assets/{select-model-DbFtB1R4.js → select-model-C-fLwr4k.js} +1 -1
- package/dist/client/assets/{settings-layout-B4AxAY74.js → settings-layout-U-ZhWkRq.js} +1 -1
- package/dist/client/assets/{settings-section-BqQHUry6.js → settings-section-qufbNRCL.js} +1 -1
- package/dist/client/assets/{shell-layout-CcLP72E6.js → shell-layout-G8D-0WXl.js} +1 -1
- package/dist/client/assets/{skeleton-D_v3jh_x.js → skeleton-BfKJMKYc.js} +1 -1
- package/dist/client/assets/{sso-BgjWtdcn.js → sso-BdojNoX2.js} +1 -1
- package/dist/client/assets/{store-IULAwEa2.js → store-DGVb_5C1.js} +1 -1
- package/dist/client/assets/store-registry-KlW3QwUJ.js +2 -0
- package/dist/client/assets/{switch-Uh77-H9s.js → switch-YLfAn92x.js} +1 -1
- package/dist/client/assets/{table-BCa0VyBS.js → table-wHPRdxYv.js} +1 -1
- package/dist/client/assets/{tabs-CJMCPubd.js → tabs-8aX3BTo-.js} +1 -1
- package/dist/client/assets/{task-status-QVkFLAWD.js → task-status-CY3ltf_M.js} +1 -1
- package/dist/client/assets/{textarea-IkB1PXd2.js → textarea-BJZt5-vN.js} +1 -1
- package/dist/client/assets/{toggle-group-CxTeQVbK.js → toggle-group-C_B32Tm8.js} +1 -1
- package/dist/client/assets/{tools-list-PZv7L79s.js → tools-list-bxPeEc0p.js} +1 -1
- package/dist/client/assets/{tooltip-DwEKoS3m.js → tooltip-B26xbtws.js} +1 -1
- package/dist/client/assets/{types-DBa5NWuL.js → types-DfgXo_cD.js} +1 -1
- package/dist/client/assets/{use-ai-providers-hUoQ1QKn.js → use-ai-providers-CnyJW7s-.js} +1 -1
- package/dist/client/assets/{use-collections-CbyJ6t6i.js → use-collections-D66SnH5Q.js} +1 -1
- package/dist/client/assets/{use-connection-BZIS5d-M.js → use-connection-9VrA1Bg7.js} +1 -1
- package/dist/client/assets/{use-copy-BhwMe7lW.js → use-copy-DpxSUjqd.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Qup6KxHA.js → use-create-virtual-mcp-DBfs4FWm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-De7heoii.js → use-debounced-autosave-Ja8PcJv_.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BSFPv0OJ.js → use-decopilot-events-DjAxcjIH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CVL2tyXf.js → use-delete-connection-7Blp6D0s.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B1XpJhs7.js → use-infinite-scroll-IwyU_OvC.js} +1 -1
- package/dist/client/assets/{use-list-state-NYzHNEE3.js → use-list-state-Dk2QFrYd.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DEJYwjVI.js → use-mcp-tools-C7yIpDHe.js} +1 -1
- package/dist/client/assets/{use-members-CE8F-6Pl.js → use-members-Bg4ZFsu9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BQCBqC6w.js → use-navigate-to-agent-BehsrrsA.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DWMaaDOW.js → use-org-auth-client-mkgKwCAh.js} +1 -1
- package/dist/client/assets/{use-org-sso-DG73ueOt.js → use-org-sso-Xv4QV2bL.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C_InafKr.js → use-organization-roles-BmH8DM7C.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DU3tZPVG.js → use-organization-settings-Coi7Ggqq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BB_6SUlA.js → use-registry-connections-_83vUYHS.js} +1 -1
- package/dist/client/assets/{use-status-sounds--S4wlp-c.js → use-status-sounds-DLYnzZvv.js} +1 -1
- package/dist/client/assets/{use-tasks-BXrbnymy.js → use-tasks-CUt44N_R.js} +1 -1
- package/dist/client/assets/{use-view-mode-30iczyXm.js → use-view-mode-CZXZPLm6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DqC7TCRl.js → use-virtual-mcp-BlYQqAfZ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BJ1I2JSf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BpfkmtaB.js +1 -0
- package/dist/client/assets/{user-CU2SK3qY.js → user-BFqIXUgg.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-ChONnJPm.js → view-mode-toggle-BC7A6oBR.js} +1 -1
- package/dist/client/assets/{workflow-C2A8waKp.js → workflow-B3ajRQIi.js} +1 -1
- package/dist/client/assets/workflow-detail-l83JU-Mp.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +4 -4
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/{slice-ansi → is-fullwidth-code-point}/license +0 -1
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-C2Z8tM8W.js +0 -1
- package/dist/client/assets/index-Cf1ZbDa8.js +0 -1
- package/dist/client/assets/registry-Ijr9ccjx.js +0 -2
- package/dist/client/assets/store-registry-BRPkAkWY.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Cy6k7dIo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DvQj0VfO.js +0 -1
- package/dist/client/assets/workflow-detail-DtfIhsSe.js +0 -1
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
- package/dist/server/node_modules/slice-ansi/index.js +0 -260
- package/dist/server/node_modules/slice-ansi/package.json +0 -59
- package/dist/server/node_modules/slice-ansi/readme.md +0 -54
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
- /package/dist/server/node_modules/{get-east-asian-width → ansi-styles}/license +0 -0
- /package/dist/server/node_modules/{mimic-fn → escape-string-regexp}/license +0 -0
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import tokenizeAnsi from './tokenize-ansi.js';
|
|
2
|
-
|
|
3
|
-
function applySgrFragments(activeStyles, fragments) {
|
|
4
|
-
for (const fragment of fragments) {
|
|
5
|
-
switch (fragment.type) {
|
|
6
|
-
case 'reset': {
|
|
7
|
-
activeStyles.clear();
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
case 'end': {
|
|
12
|
-
activeStyles.delete(fragment.endCode);
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
case 'start': {
|
|
17
|
-
activeStyles.delete(fragment.endCode);
|
|
18
|
-
activeStyles.set(fragment.endCode, fragment.code);
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
default: {
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return activeStyles;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function undoAnsiCodes(activeStyles) {
|
|
32
|
-
return [...activeStyles.keys()].reverse().join('');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function closeHyperlink(hyperlinkToken) {
|
|
36
|
-
return `${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function shouldIncludeSgrAfterEnd(token, activeStyles) {
|
|
40
|
-
let hasStartFragment = false;
|
|
41
|
-
let hasClosingEffect = false;
|
|
42
|
-
|
|
43
|
-
for (const fragment of token.fragments) {
|
|
44
|
-
if (fragment.type === 'start') {
|
|
45
|
-
hasStartFragment = true;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (fragment.type === 'reset' && activeStyles.size > 0) {
|
|
50
|
-
hasClosingEffect = true;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (fragment.type === 'end' && activeStyles.has(fragment.endCode)) {
|
|
55
|
-
hasClosingEffect = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return hasClosingEffect && !hasStartFragment;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function applySgrToken({token, isPastEnd, activeStyles, returnValue, include, activeHyperlink, position}) {
|
|
63
|
-
if (isPastEnd && !shouldIncludeSgrAfterEnd(token, activeStyles)) {
|
|
64
|
-
return {
|
|
65
|
-
activeStyles,
|
|
66
|
-
activeHyperlink,
|
|
67
|
-
position,
|
|
68
|
-
returnValue,
|
|
69
|
-
include,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
activeStyles = applySgrFragments(activeStyles, token.fragments);
|
|
74
|
-
if (include) {
|
|
75
|
-
returnValue += token.code;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
activeStyles,
|
|
80
|
-
activeHyperlink,
|
|
81
|
-
position,
|
|
82
|
-
returnValue,
|
|
83
|
-
include,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function applyHyperlinkToken({token, isPastEnd, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
88
|
-
if (
|
|
89
|
-
isPastEnd
|
|
90
|
-
&& (
|
|
91
|
-
token.action !== 'close'
|
|
92
|
-
|| !activeHyperlink
|
|
93
|
-
)
|
|
94
|
-
) {
|
|
95
|
-
return {
|
|
96
|
-
activeStyles,
|
|
97
|
-
activeHyperlink,
|
|
98
|
-
position,
|
|
99
|
-
returnValue,
|
|
100
|
-
include,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (token.action === 'open') {
|
|
105
|
-
activeHyperlink = token;
|
|
106
|
-
} else if (token.action === 'close') {
|
|
107
|
-
activeHyperlink = undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (include) {
|
|
111
|
-
returnValue += token.code;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
activeStyles,
|
|
116
|
-
activeHyperlink,
|
|
117
|
-
position,
|
|
118
|
-
returnValue,
|
|
119
|
-
include,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function applyControlToken({token, isPastEnd, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
124
|
-
if (!isPastEnd && include) {
|
|
125
|
-
returnValue += token.code;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
activeStyles,
|
|
130
|
-
activeHyperlink,
|
|
131
|
-
position,
|
|
132
|
-
returnValue,
|
|
133
|
-
include,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function applyCharacterToken({token, start, activeStyles, activeHyperlink, position, returnValue, include}) {
|
|
138
|
-
if (
|
|
139
|
-
!include
|
|
140
|
-
&& position >= start
|
|
141
|
-
&& !token.isGraphemeContinuation
|
|
142
|
-
) {
|
|
143
|
-
include = true;
|
|
144
|
-
returnValue = [...activeStyles.values()].join('');
|
|
145
|
-
if (activeHyperlink) {
|
|
146
|
-
returnValue += activeHyperlink.code;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (include) {
|
|
151
|
-
returnValue += token.value;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
position += token.visibleWidth;
|
|
155
|
-
return {
|
|
156
|
-
activeStyles,
|
|
157
|
-
activeHyperlink,
|
|
158
|
-
position,
|
|
159
|
-
returnValue,
|
|
160
|
-
include,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const tokenHandlers = {
|
|
165
|
-
sgr: applySgrToken,
|
|
166
|
-
hyperlink: applyHyperlinkToken,
|
|
167
|
-
control: applyControlToken,
|
|
168
|
-
character: applyCharacterToken,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
function applyToken(parameters) {
|
|
172
|
-
const tokenHandler = tokenHandlers[parameters.token.type];
|
|
173
|
-
if (!tokenHandler) {
|
|
174
|
-
const {
|
|
175
|
-
activeStyles,
|
|
176
|
-
activeHyperlink,
|
|
177
|
-
position,
|
|
178
|
-
returnValue,
|
|
179
|
-
include,
|
|
180
|
-
} = parameters;
|
|
181
|
-
|
|
182
|
-
return {
|
|
183
|
-
activeStyles,
|
|
184
|
-
activeHyperlink,
|
|
185
|
-
position,
|
|
186
|
-
returnValue,
|
|
187
|
-
include,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return tokenHandler(parameters);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function createHasContinuationAheadMap(tokens) {
|
|
195
|
-
const hasContinuationAhead = Array.from({length: tokens.length}, () => false);
|
|
196
|
-
let nextCharacterIsContinuation = false;
|
|
197
|
-
|
|
198
|
-
for (let tokenIndex = tokens.length - 1; tokenIndex >= 0; tokenIndex--) {
|
|
199
|
-
const token = tokens[tokenIndex];
|
|
200
|
-
hasContinuationAhead[tokenIndex] = nextCharacterIsContinuation;
|
|
201
|
-
if (token.type === 'character') {
|
|
202
|
-
nextCharacterIsContinuation = Boolean(token.isGraphemeContinuation);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return hasContinuationAhead;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export default function sliceAnsi(string, start, end) {
|
|
210
|
-
const tokens = tokenizeAnsi(string, {endCharacter: end});
|
|
211
|
-
const hasContinuationAhead = createHasContinuationAheadMap(tokens);
|
|
212
|
-
let activeStyles = new Map();
|
|
213
|
-
let activeHyperlink;
|
|
214
|
-
let position = 0;
|
|
215
|
-
let returnValue = '';
|
|
216
|
-
let include = false;
|
|
217
|
-
|
|
218
|
-
for (const [tokenIndex, token] of tokens.entries()) {
|
|
219
|
-
let isPastEnd = end !== undefined && position >= end;
|
|
220
|
-
if (
|
|
221
|
-
isPastEnd
|
|
222
|
-
&& token.type !== 'character'
|
|
223
|
-
&& hasContinuationAhead[tokenIndex]
|
|
224
|
-
) {
|
|
225
|
-
isPastEnd = false;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
isPastEnd
|
|
230
|
-
&& token.type === 'character'
|
|
231
|
-
&& !token.isGraphemeContinuation
|
|
232
|
-
) {
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
({activeStyles, activeHyperlink, position, returnValue, include} = applyToken({
|
|
237
|
-
token,
|
|
238
|
-
isPastEnd,
|
|
239
|
-
start,
|
|
240
|
-
activeStyles,
|
|
241
|
-
activeHyperlink,
|
|
242
|
-
position,
|
|
243
|
-
returnValue,
|
|
244
|
-
include,
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (!include) {
|
|
249
|
-
return '';
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (activeHyperlink) {
|
|
253
|
-
returnValue += closeHyperlink(activeHyperlink);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Disable active codes at the end
|
|
257
|
-
returnValue += undoAnsiCodes(activeStyles);
|
|
258
|
-
|
|
259
|
-
return returnValue;
|
|
260
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slice-ansi",
|
|
3
|
-
"version": "8.0.0",
|
|
4
|
-
"description": "Slice a string with ANSI escape codes",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "chalk/slice-ansi",
|
|
7
|
-
"funding": "https://github.com/chalk/slice-ansi?sponsor=1",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"exports": {
|
|
10
|
-
"types": "./index.d.ts",
|
|
11
|
-
"default": "./index.js"
|
|
12
|
-
},
|
|
13
|
-
"sideEffects": false,
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=20"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "xo && ava && tsc --lib esnext index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"index.js",
|
|
22
|
-
"tokenize-ansi.js",
|
|
23
|
-
"index.d.ts"
|
|
24
|
-
],
|
|
25
|
-
"keywords": [
|
|
26
|
-
"slice",
|
|
27
|
-
"string",
|
|
28
|
-
"ansi",
|
|
29
|
-
"styles",
|
|
30
|
-
"color",
|
|
31
|
-
"colour",
|
|
32
|
-
"colors",
|
|
33
|
-
"terminal",
|
|
34
|
-
"console",
|
|
35
|
-
"cli",
|
|
36
|
-
"tty",
|
|
37
|
-
"escape",
|
|
38
|
-
"formatting",
|
|
39
|
-
"rgb",
|
|
40
|
-
"256",
|
|
41
|
-
"shell",
|
|
42
|
-
"xterm",
|
|
43
|
-
"log",
|
|
44
|
-
"logging",
|
|
45
|
-
"command-line",
|
|
46
|
-
"text"
|
|
47
|
-
],
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"ansi-styles": "^6.2.3",
|
|
50
|
-
"is-fullwidth-code-point": "^5.1.0"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"ava": "^6.4.1",
|
|
54
|
-
"chalk": "^5.6.2",
|
|
55
|
-
"random-item": "^4.0.1",
|
|
56
|
-
"strip-ansi": "^7.1.2",
|
|
57
|
-
"xo": "^1.2.3"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# slice-ansi [](https://github.com/xojs/xo)
|
|
2
|
-
|
|
3
|
-
> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install slice-ansi
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import chalk from 'chalk';
|
|
15
|
-
import sliceAnsi from 'slice-ansi';
|
|
16
|
-
|
|
17
|
-
const string = 'The quick brown ' + chalk.red('fox jumped over ') +
|
|
18
|
-
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
|
19
|
-
|
|
20
|
-
console.log(sliceAnsi(string, 20, 30));
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
### sliceAnsi(string, startSlice, endSlice?)
|
|
26
|
-
|
|
27
|
-
#### string
|
|
28
|
-
|
|
29
|
-
Type: `string`
|
|
30
|
-
|
|
31
|
-
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
|
32
|
-
|
|
33
|
-
#### startSlice
|
|
34
|
-
|
|
35
|
-
Type: `number`
|
|
36
|
-
|
|
37
|
-
Zero-based visible-column index at which to start the slice. Grapheme clusters (for example, emoji sequences and combining marks) are kept intact.
|
|
38
|
-
|
|
39
|
-
#### endSlice
|
|
40
|
-
|
|
41
|
-
Type: `number`
|
|
42
|
-
|
|
43
|
-
Zero-based visible-column index at which to end the slice.
|
|
44
|
-
|
|
45
|
-
## Related
|
|
46
|
-
|
|
47
|
-
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
|
48
|
-
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
|
|
49
|
-
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
|
50
|
-
|
|
51
|
-
## Maintainers
|
|
52
|
-
|
|
53
|
-
- [Sindre Sorhus](https://github.com/sindresorhus)
|
|
54
|
-
- [Josh Junon](https://github.com/qix-)
|