@omnitron-dev/prism 0.3.0 → 0.3.2
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/README.md +216 -2
- package/THIRD-PARTY-NOTICES.txt +26 -0
- package/dist/accessibility/index.js +2 -0
- package/dist/accessibility/index.js.map +1 -1
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/blocks/auth-block/guards.d.ts +3 -2
- package/dist/blocks/auth-block/guards.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/dashboard-block.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/types.d.ts +4 -2
- package/dist/blocks/dashboard-block/types.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts +2 -2
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/data-grid-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/types.d.ts +3 -0
- package/dist/blocks/data-grid-block/types.d.ts.map +1 -1
- package/dist/blocks/index.js +80 -253
- package/dist/blocks/index.js.map +1 -1
- package/dist/chunk-2AB7VGPW.js +447 -0
- package/dist/chunk-2AB7VGPW.js.map +1 -0
- package/dist/{chunk-WFD54GQQ.js → chunk-2E67PQ4T.js} +14 -573
- package/dist/chunk-2E67PQ4T.js.map +1 -0
- package/dist/chunk-2KG2NI73.js +84 -0
- package/dist/chunk-2KG2NI73.js.map +1 -0
- package/dist/chunk-2UYRW6X3.js +44 -0
- package/dist/chunk-2UYRW6X3.js.map +1 -0
- package/dist/chunk-36C5H56C.js +208 -0
- package/dist/chunk-36C5H56C.js.map +1 -0
- package/dist/chunk-36FOXX25.js +73 -0
- package/dist/chunk-36FOXX25.js.map +1 -0
- package/dist/chunk-3VSM7NZG.js +562 -0
- package/dist/chunk-3VSM7NZG.js.map +1 -0
- package/dist/chunk-4B2LTPK2.js +826 -0
- package/dist/chunk-4B2LTPK2.js.map +1 -0
- package/dist/chunk-4HUGZJKU.js +108 -0
- package/dist/chunk-4HUGZJKU.js.map +1 -0
- package/dist/chunk-4Q5L7LDG.js +74 -0
- package/dist/chunk-4Q5L7LDG.js.map +1 -0
- package/dist/{chunk-BRDWQVRT.js → chunk-4R7EZ7GQ.js} +3 -2
- package/dist/chunk-4R7EZ7GQ.js.map +1 -0
- package/dist/chunk-6IANOSMD.js +185 -0
- package/dist/chunk-6IANOSMD.js.map +1 -0
- package/dist/chunk-7ATBURW2.js +206 -0
- package/dist/chunk-7ATBURW2.js.map +1 -0
- package/dist/{chunk-6AHI4GSV.js → chunk-AATAOOSF.js} +4 -3
- package/dist/chunk-AATAOOSF.js.map +1 -0
- package/dist/chunk-AKLRKCYH.js +128 -0
- package/dist/chunk-AKLRKCYH.js.map +1 -0
- package/dist/chunk-CT46KJOR.js +133 -0
- package/dist/chunk-CT46KJOR.js.map +1 -0
- package/dist/{chunk-YQW43BDH.js → chunk-D4GFAJAZ.js} +1168 -6354
- package/dist/chunk-D4GFAJAZ.js.map +1 -0
- package/dist/chunk-D5J3KW6Q.js +106 -0
- package/dist/chunk-D5J3KW6Q.js.map +1 -0
- package/dist/chunk-DEPJRTVT.js +3 -0
- package/dist/{chunk-FU52GL2E.js.map → chunk-DEPJRTVT.js.map} +1 -1
- package/dist/{chunk-S6SEGBX6.js → chunk-DHTYHUYI.js} +85 -107
- package/dist/chunk-DHTYHUYI.js.map +1 -0
- package/dist/chunk-E7WM2RXA.js +249 -0
- package/dist/chunk-E7WM2RXA.js.map +1 -0
- package/dist/chunk-F6RZ7LW6.js +1271 -0
- package/dist/chunk-F6RZ7LW6.js.map +1 -0
- package/dist/chunk-FOGY3HA4.js +217 -0
- package/dist/chunk-FOGY3HA4.js.map +1 -0
- package/dist/chunk-G2GANYMW.js +139 -0
- package/dist/chunk-G2GANYMW.js.map +1 -0
- package/dist/chunk-I6DILPFE.js +293 -0
- package/dist/chunk-I6DILPFE.js.map +1 -0
- package/dist/chunk-IRYU3NTG.js +573 -0
- package/dist/chunk-IRYU3NTG.js.map +1 -0
- package/dist/chunk-JTIUGPW5.js +284 -0
- package/dist/chunk-JTIUGPW5.js.map +1 -0
- package/dist/{chunk-GUFHFEPZ.js → chunk-JZBSPDED.js} +2 -2
- package/dist/{chunk-GUFHFEPZ.js.map → chunk-JZBSPDED.js.map} +1 -1
- package/dist/chunk-KPY7TA4D.js +191 -0
- package/dist/chunk-KPY7TA4D.js.map +1 -0
- package/dist/{chunk-OBJ244BO.js → chunk-LFWKGNCX.js} +50 -656
- package/dist/chunk-LFWKGNCX.js.map +1 -0
- package/dist/chunk-LH4ZZZYB.js +37 -0
- package/dist/chunk-LH4ZZZYB.js.map +1 -0
- package/dist/chunk-NFJ7CPG3.js +13 -0
- package/dist/chunk-NFJ7CPG3.js.map +1 -0
- package/dist/chunk-NFPOIHD4.js +3 -0
- package/dist/{chunk-AYYFMTMI.js.map → chunk-NFPOIHD4.js.map} +1 -1
- package/dist/{chunk-XIXSSI3B.js → chunk-NJM5AVBM.js} +3 -2
- package/dist/chunk-NJM5AVBM.js.map +1 -0
- package/dist/{chunk-Z5OSPAOC.js → chunk-NSNM53WI.js} +196 -175
- package/dist/chunk-NSNM53WI.js.map +1 -0
- package/dist/chunk-NTREGTG7.js +31 -0
- package/dist/chunk-NTREGTG7.js.map +1 -0
- package/dist/{chunk-ADG4HZEP.js → chunk-OKJA6SJM.js} +4 -4
- package/dist/chunk-OKJA6SJM.js.map +1 -0
- package/dist/chunk-Q6JDNFSG.js +303 -0
- package/dist/chunk-Q6JDNFSG.js.map +1 -0
- package/dist/chunk-RPOGINR5.js +115 -0
- package/dist/chunk-RPOGINR5.js.map +1 -0
- package/dist/{chunk-ZTATTUH7.js → chunk-RSWVYIXK.js} +282 -683
- package/dist/chunk-RSWVYIXK.js.map +1 -0
- package/dist/chunk-SSEHL5VP.js +110 -0
- package/dist/chunk-SSEHL5VP.js.map +1 -0
- package/dist/chunk-TEIGUOWN.js +523 -0
- package/dist/chunk-TEIGUOWN.js.map +1 -0
- package/dist/{chunk-AYYFMTMI.js → chunk-TJ7DHXUX.js} +2 -2
- package/dist/chunk-TJ7DHXUX.js.map +1 -0
- package/dist/chunk-TZHWYT34.js +590 -0
- package/dist/chunk-TZHWYT34.js.map +1 -0
- package/dist/chunk-TZWHELY4.js +45 -0
- package/dist/chunk-TZWHELY4.js.map +1 -0
- package/dist/{chunk-BZOL7GMU.js → chunk-UEINJFLS.js} +7 -7
- package/dist/chunk-UEINJFLS.js.map +1 -0
- package/dist/chunk-URFQX3I6.js +129 -0
- package/dist/chunk-URFQX3I6.js.map +1 -0
- package/dist/chunk-VG6FOMOH.js +187 -0
- package/dist/chunk-VG6FOMOH.js.map +1 -0
- package/dist/chunk-VQVVHMPG.js +106 -0
- package/dist/chunk-VQVVHMPG.js.map +1 -0
- package/dist/{chunk-DRFNMZLG.js → chunk-VUKOT432.js} +3 -2
- package/dist/chunk-VUKOT432.js.map +1 -0
- package/dist/chunk-WD4N72DL.js +315 -0
- package/dist/chunk-WD4N72DL.js.map +1 -0
- package/dist/chunk-XBYMG4QK.js +119 -0
- package/dist/chunk-XBYMG4QK.js.map +1 -0
- package/dist/chunk-YHM6GIHV.js +3 -0
- package/dist/chunk-YHM6GIHV.js.map +1 -0
- package/dist/{chunk-SNZK5X6F.js → chunk-Z2AN43YU.js} +4 -2
- package/dist/chunk-Z2AN43YU.js.map +1 -0
- package/dist/chunk-ZNWHMQRM.js +171 -0
- package/dist/chunk-ZNWHMQRM.js.map +1 -0
- package/dist/{chunk-YSIG2XYH.js → chunk-ZRJYQN6Y.js} +2 -2
- package/dist/{chunk-YSIG2XYH.js.map → chunk-ZRJYQN6Y.js.map} +1 -1
- package/dist/{chunk-AD4W7HYC.js → chunk-ZYI3MHLE.js} +3 -2
- package/dist/chunk-ZYI3MHLE.js.map +1 -0
- package/dist/cli/index.js +66 -423
- package/dist/cli/index.js.map +1 -1
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/admin-filters/admin-data-table.d.ts +7 -1
- package/dist/components/admin-filters/admin-data-table.d.ts.map +1 -1
- package/dist/components/admin-filters/filter-toolbar.d.ts.map +1 -1
- package/dist/components/admin-filters/index.js +8 -0
- package/dist/components/admin-filters/index.js.map +1 -0
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +5 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/animate/index.js +5 -0
- package/dist/components/animate/index.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/index.js +4 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.css +52 -0
- package/dist/components/chart/index.css.map +1 -0
- package/dist/components/chart/index.js +5 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/chart/types.d.ts +3 -1
- package/dist/components/chart/types.d.ts.map +1 -1
- package/dist/components/chart/use-chart.d.ts.map +1 -1
- package/dist/components/command-palette/command-palette.d.ts +3 -1
- package/dist/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/components/command-palette/index.js +4 -0
- package/dist/components/command-palette/index.js.map +1 -0
- package/dist/components/confirm-dialog/index.js +4 -0
- package/dist/components/confirm-dialog/index.js.map +1 -0
- package/dist/components/date-input/date-input.d.ts +28 -0
- package/dist/components/date-input/date-input.d.ts.map +1 -0
- package/dist/components/date-input/index.d.ts +3 -0
- package/dist/components/date-input/index.d.ts.map +1 -0
- package/dist/components/date-input/value.d.ts +9 -0
- package/dist/components/date-input/value.d.ts.map +1 -0
- package/dist/components/doc-layout/doc-sidebar.d.ts +4 -1
- package/dist/components/doc-layout/doc-sidebar.d.ts.map +1 -1
- package/dist/components/doc-layout/index.js +7 -0
- package/dist/components/doc-layout/index.js.map +1 -0
- package/dist/components/editor/editor.d.ts.map +1 -1
- package/dist/components/editor/icons/index.d.ts +32 -40
- package/dist/components/editor/icons/index.d.ts.map +1 -1
- package/dist/components/editor/index.js +4 -1
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/emoji-picker/index.js +2 -1
- package/dist/components/emoji-picker/index.js.map +1 -1
- package/dist/components/empty-content/empty-content.d.ts.map +1 -1
- package/dist/components/empty-content/index.js +4 -0
- package/dist/components/empty-content/index.js.map +1 -0
- package/dist/components/error-boundary/error-boundary.d.ts.map +1 -1
- package/dist/components/error-boundary/index.js +6 -0
- package/dist/components/error-boundary/index.js.map +1 -0
- package/dist/components/index.css +17 -10
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +47 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/knowledge-graph/edge-labels.d.ts +14 -0
- package/dist/components/knowledge-graph/edge-labels.d.ts.map +1 -0
- package/dist/components/knowledge-graph/graph.d.ts +56 -0
- package/dist/components/knowledge-graph/graph.d.ts.map +1 -0
- package/dist/components/knowledge-graph/index.css +176 -0
- package/dist/components/knowledge-graph/index.css.map +1 -0
- package/dist/components/knowledge-graph/index.d.ts +3 -0
- package/dist/components/knowledge-graph/index.d.ts.map +1 -0
- package/dist/components/knowledge-graph/index.js +797 -0
- package/dist/components/knowledge-graph/index.js.map +1 -0
- package/dist/components/knowledge-graph/label-layout.d.ts +28 -0
- package/dist/components/knowledge-graph/label-layout.d.ts.map +1 -0
- package/dist/components/knowledge-graph/label-store.d.ts +15 -0
- package/dist/components/knowledge-graph/label-store.d.ts.map +1 -0
- package/dist/components/knowledge-graph/model.d.ts +92 -0
- package/dist/components/knowledge-graph/model.d.ts.map +1 -0
- package/dist/components/label/index.js +5 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/label/label.d.ts.map +1 -1
- package/dist/components/lightbox/lightbox.d.ts.map +1 -1
- package/dist/components/loading-screen/index.js +4 -0
- package/dist/components/loading-screen/index.js.map +1 -0
- package/dist/components/map/Map.d.ts +19 -43
- package/dist/components/map/Map.d.ts.map +1 -1
- package/dist/components/map/MapCoverageLayer.d.ts +1 -1
- package/dist/components/map/MapCoverageLayer.d.ts.map +1 -1
- package/dist/components/map/MapMarker.d.ts +1 -1
- package/dist/components/map/MapMarker.d.ts.map +1 -1
- package/dist/components/map/MapPlaceSearch.d.ts +33 -0
- package/dist/components/map/MapPlaceSearch.d.ts.map +1 -0
- package/dist/components/map/MapPointPicker.d.ts +21 -12
- package/dist/components/map/MapPointPicker.d.ts.map +1 -1
- package/dist/components/map/coordinates.d.ts +10 -0
- package/dist/components/map/coordinates.d.ts.map +1 -0
- package/dist/components/map/index.css +4 -0
- package/dist/components/map/index.css.map +1 -0
- package/dist/components/map/index.d.ts +7 -2
- package/dist/components/map/index.d.ts.map +1 -1
- package/dist/components/map/index.js +4 -0
- package/dist/components/map/index.js.map +1 -0
- package/dist/components/nav-card/nav-card.d.ts.map +1 -1
- package/dist/components/navigation-progress/index.js +4 -0
- package/dist/components/navigation-progress/index.js.map +1 -0
- package/dist/components/page-content/index.js +4 -0
- package/dist/components/page-content/index.js.map +1 -0
- package/dist/components/popover/index.js +4 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/rail/rail.d.ts.map +1 -1
- package/dist/components/research/diagram-image.d.ts +11 -0
- package/dist/components/research/diagram-image.d.ts.map +1 -0
- package/dist/components/research/diagram.d.ts +8 -0
- package/dist/components/research/diagram.d.ts.map +1 -0
- package/dist/components/research/document.d.ts +33 -0
- package/dist/components/research/document.d.ts.map +1 -0
- package/dist/components/research/frontmatter.d.ts +15 -0
- package/dist/components/research/frontmatter.d.ts.map +1 -0
- package/dist/components/research/index.css +51 -0
- package/dist/components/research/index.css.map +1 -0
- package/dist/components/research/index.d.ts +3 -0
- package/dist/components/research/index.d.ts.map +1 -0
- package/dist/components/research/index.js +8 -0
- package/dist/components/research/index.js.map +1 -0
- package/dist/components/research/parse.d.ts +29 -0
- package/dist/components/research/parse.d.ts.map +1 -0
- package/dist/components/research-editor/block-commands.d.ts +20 -0
- package/dist/components/research-editor/block-commands.d.ts.map +1 -0
- package/dist/components/research-editor/block-controls.d.ts +13 -0
- package/dist/components/research-editor/block-controls.d.ts.map +1 -0
- package/dist/components/research-editor/editor.d.ts +75 -0
- package/dist/components/research-editor/editor.d.ts.map +1 -0
- package/dist/components/research-editor/extensions.d.ts +14 -0
- package/dist/components/research-editor/extensions.d.ts.map +1 -0
- package/dist/components/research-editor/index.css +332 -0
- package/dist/components/research-editor/index.css.map +1 -0
- package/dist/components/research-editor/index.d.ts +5 -0
- package/dist/components/research-editor/index.d.ts.map +1 -0
- package/dist/components/research-editor/index.js +1593 -0
- package/dist/components/research-editor/index.js.map +1 -0
- package/dist/components/research-editor/math-input.d.ts +32 -0
- package/dist/components/research-editor/math-input.d.ts.map +1 -0
- package/dist/components/research-editor/math-markup.d.ts +4 -0
- package/dist/components/research-editor/math-markup.d.ts.map +1 -0
- package/dist/components/research-editor/math-navigation.d.ts +6 -0
- package/dist/components/research-editor/math-navigation.d.ts.map +1 -0
- package/dist/components/research-editor/math-node.d.ts +11 -0
- package/dist/components/research-editor/math-node.d.ts.map +1 -0
- package/dist/components/research-editor/source.d.ts +19 -0
- package/dist/components/research-editor/source.d.ts.map +1 -0
- package/dist/components/scroll-to-top/index.js +4 -0
- package/dist/components/scroll-to-top/index.js.map +1 -0
- package/dist/components/scrollbar/scrollbar.d.ts +4 -2
- package/dist/components/scrollbar/scrollbar.d.ts.map +1 -1
- package/dist/components/search-input/index.js +7 -0
- package/dist/components/search-input/index.js.map +1 -0
- package/dist/components/search-input/search-input.d.ts +3 -11
- package/dist/components/search-input/search-input.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/snackbar/index.js +6 -0
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/components/stepper/index.js +4 -0
- package/dist/components/stepper/index.js.map +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +5 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table-viewport.d.ts +13 -0
- package/dist/components/table/table-viewport.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +12 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tiptap-renderer/tiptap-renderer.d.ts +4 -3
- package/dist/components/tiptap-renderer/tiptap-renderer.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +12 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/provider.d.ts +7 -2
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/forms/index.js +2 -0
- package/dist/forms/index.js.map +1 -1
- package/dist/forms/schema-provider.d.ts +3 -3
- package/dist/forms/schema-utils.d.ts +3 -3
- package/dist/hooks/index.js +14 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-config-from-query.d.ts +2 -0
- package/dist/hooks/use-config-from-query.d.ts.map +1 -1
- package/dist/hooks/use-image-dimensions.d.ts.map +1 -1
- package/dist/hooks/use-keyboard-shortcut.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-window-size.d.ts.map +1 -1
- package/dist/icons/context.d.ts +17 -0
- package/dist/icons/context.d.ts.map +1 -0
- package/dist/icons/controls.d.ts +51 -0
- package/dist/icons/controls.d.ts.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/theme.d.ts +4 -0
- package/dist/icons/theme.d.ts.map +1 -0
- package/dist/index.css +17 -10
- package/dist/index.css.map +1 -1
- package/dist/index.js +57 -20
- package/dist/index.js.map +1 -1
- package/dist/internal/research-parser.js +3 -0
- package/dist/internal/research-parser.js.map +1 -0
- package/dist/layouts/core/header-section.d.ts +1 -0
- package/dist/layouts/core/header-section.d.ts.map +1 -1
- package/dist/layouts/dashboard/labels.d.ts +12 -0
- package/dist/layouts/dashboard/labels.d.ts.map +1 -0
- package/dist/layouts/dashboard/layout.d.ts +9 -1
- package/dist/layouts/dashboard/layout.d.ts.map +1 -1
- package/dist/layouts/dashboard/sidenav.d.ts +7 -3
- package/dist/layouts/dashboard/sidenav.d.ts.map +1 -1
- package/dist/layouts/index.d.ts +5 -0
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +9 -3
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/panel-layout.d.ts +35 -0
- package/dist/layouts/panel-layout.d.ts.map +1 -0
- package/dist/layouts/sidebar-toggle.d.ts +11 -0
- package/dist/layouts/sidebar-toggle.d.ts.map +1 -0
- package/dist/netron/index.js +2 -1
- package/dist/netron/index.js.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/state/create-store.d.ts.map +1 -1
- package/dist/state/index.js +3 -2
- package/dist/state/index.js.map +1 -1
- package/dist/state/settings-version.d.ts.map +1 -1
- package/dist/state/stores/auth.d.ts +4 -16
- package/dist/state/stores/auth.d.ts.map +1 -1
- package/dist/state/stores/ui.d.ts +7 -105
- package/dist/state/stores/ui.d.ts.map +1 -1
- package/dist/theme/components/Button.d.ts.map +1 -1
- package/dist/theme/components/Chip.d.ts.map +1 -1
- package/dist/theme/components/Dialog.d.ts.map +1 -1
- package/dist/theme/components/FormControls.d.ts +3 -12
- package/dist/theme/components/FormControls.d.ts.map +1 -1
- package/dist/theme/components/TextField.d.ts.map +1 -1
- package/dist/theme/components/index.d.ts.map +1 -1
- package/dist/theme/components/theme-utils.d.ts +2 -2
- package/dist/theme/components/theme-utils.d.ts.map +1 -1
- package/dist/theme/create-theme.d.ts +5 -17
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/index.js +8 -2
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/mixins.d.ts +3 -1
- package/dist/theme/mixins.d.ts.map +1 -1
- package/dist/theme/palette/overrides.d.ts +24 -0
- package/dist/theme/palette/overrides.d.ts.map +1 -0
- package/dist/theme/semantic-surface.d.ts +8 -0
- package/dist/theme/semantic-surface.d.ts.map +1 -0
- package/dist/types/index.js +2 -2
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +149 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/utils/async-lock.d.ts.map +1 -1
- package/package.json +200 -47
- package/dist/chunk-6AHI4GSV.js.map +0 -1
- package/dist/chunk-AD4W7HYC.js.map +0 -1
- package/dist/chunk-ADG4HZEP.js.map +0 -1
- package/dist/chunk-BRDWQVRT.js.map +0 -1
- package/dist/chunk-BZOL7GMU.js.map +0 -1
- package/dist/chunk-DRFNMZLG.js.map +0 -1
- package/dist/chunk-FU52GL2E.js +0 -3
- package/dist/chunk-OBJ244BO.js.map +0 -1
- package/dist/chunk-S6SEGBX6.js.map +0 -1
- package/dist/chunk-SNZK5X6F.js.map +0 -1
- package/dist/chunk-WFD54GQQ.js.map +0 -1
- package/dist/chunk-XIXSSI3B.js.map +0 -1
- package/dist/chunk-YQW43BDH.js.map +0 -1
- package/dist/chunk-Z5OSPAOC.js.map +0 -1
- package/dist/chunk-ZTATTUH7.js.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import * as
|
|
2
|
+
import * as fs5 from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import * as readline from 'readline';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
-
var __esm = (fn, res) => function __init() {
|
|
10
|
-
|
|
9
|
+
var __esm = (fn, res, err) => function __init() {
|
|
10
|
+
if (err) throw err[0];
|
|
11
|
+
try {
|
|
12
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw err = [e], e;
|
|
15
|
+
}
|
|
11
16
|
};
|
|
12
17
|
var __export = (target, all) => {
|
|
13
18
|
for (var name in all)
|
|
@@ -84,7 +89,7 @@ function findConfigFile(startDir = process.cwd()) {
|
|
|
84
89
|
const root = path.parse(currentDir).root;
|
|
85
90
|
while (currentDir !== root) {
|
|
86
91
|
const configPath = path.join(currentDir, CONFIG_FILE_NAME);
|
|
87
|
-
if (
|
|
92
|
+
if (fs5.existsSync(configPath)) {
|
|
88
93
|
return configPath;
|
|
89
94
|
}
|
|
90
95
|
currentDir = path.dirname(currentDir);
|
|
@@ -97,7 +102,7 @@ async function loadConfig(cwd = process.cwd()) {
|
|
|
97
102
|
return null;
|
|
98
103
|
}
|
|
99
104
|
try {
|
|
100
|
-
const content = await
|
|
105
|
+
const content = await fs5.promises.readFile(configPath, "utf-8");
|
|
101
106
|
const config = JSON.parse(content);
|
|
102
107
|
return {
|
|
103
108
|
...DEFAULT_CONFIG,
|
|
@@ -112,7 +117,7 @@ async function loadConfig(cwd = process.cwd()) {
|
|
|
112
117
|
}
|
|
113
118
|
async function saveConfig(config, outputPath = path.join(process.cwd(), CONFIG_FILE_NAME)) {
|
|
114
119
|
const content = JSON.stringify(config, null, 2);
|
|
115
|
-
await
|
|
120
|
+
await fs5.promises.writeFile(outputPath, content, "utf-8");
|
|
116
121
|
}
|
|
117
122
|
function resolveAlias(alias, config) {
|
|
118
123
|
if (alias.startsWith("@/")) {
|
|
@@ -140,372 +145,10 @@ var init_config = __esm({
|
|
|
140
145
|
}
|
|
141
146
|
});
|
|
142
147
|
|
|
143
|
-
// src/registry/manager.ts
|
|
144
|
-
var RegistryManager;
|
|
145
|
-
var init_manager = __esm({
|
|
146
|
-
"src/registry/manager.ts"() {
|
|
147
|
-
RegistryManager = class {
|
|
148
|
-
options;
|
|
149
|
-
registries = /* @__PURE__ */ new Map();
|
|
150
|
-
cache = /* @__PURE__ */ new Map();
|
|
151
|
-
loaders = /* @__PURE__ */ new Map();
|
|
152
|
-
constructor(options = {}) {
|
|
153
|
-
this.options = {
|
|
154
|
-
baseDir: options.baseDir ?? (typeof process !== "undefined" && process.cwd ? process.cwd() : "/"),
|
|
155
|
-
defaultRegistry: options.defaultRegistry ?? "prism",
|
|
156
|
-
config: options.config ?? { default: "prism", registries: {} },
|
|
157
|
-
cacheTtl: options.cacheTtl ?? 5 * 60 * 1e3
|
|
158
|
-
// 5 minutes
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
// ===========================================================================
|
|
162
|
-
// REGISTRY LOADING
|
|
163
|
-
// ===========================================================================
|
|
164
|
-
/**
|
|
165
|
-
* Register a custom loader for a registry.
|
|
166
|
-
*/
|
|
167
|
-
registerLoader(name, loader) {
|
|
168
|
-
this.loaders.set(name, loader);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Load a registry by name.
|
|
172
|
-
*/
|
|
173
|
-
async loadRegistry(name) {
|
|
174
|
-
const cached = this.cache.get(name);
|
|
175
|
-
if (cached && Date.now() - cached.timestamp < this.options.cacheTtl) {
|
|
176
|
-
return cached.data;
|
|
177
|
-
}
|
|
178
|
-
const existing = this.registries.get(name);
|
|
179
|
-
if (existing && !cached) {
|
|
180
|
-
return existing;
|
|
181
|
-
}
|
|
182
|
-
const customLoader = this.loaders.get(name);
|
|
183
|
-
if (customLoader) {
|
|
184
|
-
const registry3 = await customLoader();
|
|
185
|
-
this.cacheRegistry(name, registry3);
|
|
186
|
-
return registry3;
|
|
187
|
-
}
|
|
188
|
-
const config = this.options.config.registries[name];
|
|
189
|
-
if (!config) {
|
|
190
|
-
throw new Error(`Registry "${name}" not found in configuration`);
|
|
191
|
-
}
|
|
192
|
-
const registry2 = typeof config === "string" ? await this.loadFromPath(config) : await this.loadFromRemote(config);
|
|
193
|
-
if (registry2.extends) {
|
|
194
|
-
const baseRegistry = await this.loadRegistry(registry2.extends);
|
|
195
|
-
const merged = this.mergeRegistries(baseRegistry, registry2);
|
|
196
|
-
this.cacheRegistry(name, merged);
|
|
197
|
-
return merged;
|
|
198
|
-
}
|
|
199
|
-
this.cacheRegistry(name, registry2);
|
|
200
|
-
return registry2;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Load registry from local file path.
|
|
204
|
-
* Uses dynamic import for ESM compatibility across environments.
|
|
205
|
-
*
|
|
206
|
-
* @param path - Relative or absolute path to registry JSON
|
|
207
|
-
* @returns Loaded registry schema
|
|
208
|
-
*/
|
|
209
|
-
async loadFromPath(path9) {
|
|
210
|
-
const fullPath = path9.startsWith("/") ? path9 : `${this.options.baseDir}/${path9}`;
|
|
211
|
-
if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) {
|
|
212
|
-
const fs9 = await import('fs/promises');
|
|
213
|
-
const content = await fs9.readFile(fullPath, "utf-8");
|
|
214
|
-
return JSON.parse(content);
|
|
215
|
-
}
|
|
216
|
-
if (path9.startsWith("http://") || path9.startsWith("https://")) {
|
|
217
|
-
const response = await fetch(path9);
|
|
218
|
-
if (!response.ok) {
|
|
219
|
-
throw new Error(`Failed to load registry from ${path9}: ${response.statusText}`);
|
|
220
|
-
}
|
|
221
|
-
return response.json();
|
|
222
|
-
}
|
|
223
|
-
throw new Error(
|
|
224
|
-
`Cannot load local file "${fullPath}" in browser environment. Register a custom loader with manager.registerLoader() or use a remote URL.`
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Load registry from remote URL.
|
|
229
|
-
*/
|
|
230
|
-
async loadFromRemote(config) {
|
|
231
|
-
const response = await fetch(config.url, {
|
|
232
|
-
headers: config.headers
|
|
233
|
-
});
|
|
234
|
-
if (!response.ok) {
|
|
235
|
-
throw new Error(`Failed to load registry from ${config.url}: ${response.statusText}`);
|
|
236
|
-
}
|
|
237
|
-
return response.json();
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Cache a loaded registry.
|
|
241
|
-
*/
|
|
242
|
-
cacheRegistry(name, registry2) {
|
|
243
|
-
this.registries.set(name, registry2);
|
|
244
|
-
this.cache.set(name, {
|
|
245
|
-
data: registry2,
|
|
246
|
-
timestamp: Date.now()
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Merge two registries (base + extension).
|
|
251
|
-
*/
|
|
252
|
-
mergeRegistries(base, extension) {
|
|
253
|
-
return {
|
|
254
|
-
...base,
|
|
255
|
-
...extension,
|
|
256
|
-
components: { ...base.components, ...extension.components },
|
|
257
|
-
blocks: { ...base.blocks, ...extension.blocks },
|
|
258
|
-
themes: { ...base.themes, ...extension.themes }
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Clear registry cache.
|
|
263
|
-
*/
|
|
264
|
-
clearCache(name) {
|
|
265
|
-
if (name) {
|
|
266
|
-
this.cache.delete(name);
|
|
267
|
-
} else {
|
|
268
|
-
this.cache.clear();
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
// ===========================================================================
|
|
272
|
-
// COMPONENT OPERATIONS
|
|
273
|
-
// ===========================================================================
|
|
274
|
-
/**
|
|
275
|
-
* Get a component definition by name.
|
|
276
|
-
*/
|
|
277
|
-
async getComponent(name, registryName) {
|
|
278
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
279
|
-
return registry2.components[name] ?? null;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Get all components from a registry.
|
|
283
|
-
*/
|
|
284
|
-
async getComponents(registryName) {
|
|
285
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
286
|
-
return registry2.components;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Search for components.
|
|
290
|
-
*/
|
|
291
|
-
async searchComponents(options, registryName) {
|
|
292
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
293
|
-
let results = Object.values(registry2.components);
|
|
294
|
-
if (options.category) {
|
|
295
|
-
results = results.filter((c) => c.category === options.category);
|
|
296
|
-
}
|
|
297
|
-
if (options.query) {
|
|
298
|
-
const query = options.query.toLowerCase();
|
|
299
|
-
results = results.filter(
|
|
300
|
-
(c) => c.name.toLowerCase().includes(query) || c.displayName?.toLowerCase().includes(query) || c.description?.toLowerCase().includes(query)
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
if (options.limit && options.limit > 0) {
|
|
304
|
-
results = results.slice(0, options.limit);
|
|
305
|
-
}
|
|
306
|
-
return results;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Get component categories.
|
|
310
|
-
*/
|
|
311
|
-
async getComponentCategories(registryName) {
|
|
312
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
313
|
-
const categories = /* @__PURE__ */ new Set();
|
|
314
|
-
for (const component of Object.values(registry2.components)) {
|
|
315
|
-
categories.add(component.category);
|
|
316
|
-
}
|
|
317
|
-
return Array.from(categories).sort();
|
|
318
|
-
}
|
|
319
|
-
// ===========================================================================
|
|
320
|
-
// BLOCK OPERATIONS
|
|
321
|
-
// ===========================================================================
|
|
322
|
-
/**
|
|
323
|
-
* Get a block definition by name.
|
|
324
|
-
*/
|
|
325
|
-
async getBlock(name, registryName) {
|
|
326
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
327
|
-
return registry2.blocks[name] ?? null;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Get all blocks from a registry.
|
|
331
|
-
*/
|
|
332
|
-
async getBlocks(registryName) {
|
|
333
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
334
|
-
return registry2.blocks;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Search for blocks.
|
|
338
|
-
*/
|
|
339
|
-
async searchBlocks(options, registryName) {
|
|
340
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
341
|
-
let results = Object.values(registry2.blocks);
|
|
342
|
-
if (options.category) {
|
|
343
|
-
results = results.filter((b) => b.category === options.category);
|
|
344
|
-
}
|
|
345
|
-
if (options.query) {
|
|
346
|
-
const query = options.query.toLowerCase();
|
|
347
|
-
results = results.filter(
|
|
348
|
-
(b) => b.name.toLowerCase().includes(query) || b.displayName?.toLowerCase().includes(query) || b.description?.toLowerCase().includes(query)
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
if (options.limit && options.limit > 0) {
|
|
352
|
-
results = results.slice(0, options.limit);
|
|
353
|
-
}
|
|
354
|
-
return results;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Get block categories.
|
|
358
|
-
*/
|
|
359
|
-
async getBlockCategories(registryName) {
|
|
360
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
361
|
-
const categories = /* @__PURE__ */ new Set();
|
|
362
|
-
for (const block of Object.values(registry2.blocks)) {
|
|
363
|
-
categories.add(block.category);
|
|
364
|
-
}
|
|
365
|
-
return Array.from(categories).sort();
|
|
366
|
-
}
|
|
367
|
-
// ===========================================================================
|
|
368
|
-
// DEPENDENCY RESOLUTION
|
|
369
|
-
// ===========================================================================
|
|
370
|
-
/**
|
|
371
|
-
* Resolve all dependencies for a component.
|
|
372
|
-
*/
|
|
373
|
-
async resolveComponentDependencies(name, registryName) {
|
|
374
|
-
const registry2 = registryName ?? this.options.defaultRegistry;
|
|
375
|
-
const component = await this.getComponent(name, registry2);
|
|
376
|
-
if (!component) {
|
|
377
|
-
throw new Error(`Component "${name}" not found in registry "${registry2}"`);
|
|
378
|
-
}
|
|
379
|
-
const dependencies = [];
|
|
380
|
-
for (const depName of component.dependencies.components) {
|
|
381
|
-
const resolved = await this.resolveComponentDependencies(depName, registry2);
|
|
382
|
-
dependencies.push(resolved);
|
|
383
|
-
}
|
|
384
|
-
return {
|
|
385
|
-
definition: component,
|
|
386
|
-
registry: registry2,
|
|
387
|
-
dependencies
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Resolve all dependencies for a block.
|
|
392
|
-
*/
|
|
393
|
-
async resolveBlockDependencies(name, registryName) {
|
|
394
|
-
const registry2 = registryName ?? this.options.defaultRegistry;
|
|
395
|
-
const block = await this.getBlock(name, registry2);
|
|
396
|
-
if (!block) {
|
|
397
|
-
throw new Error(`Block "${name}" not found in registry "${registry2}"`);
|
|
398
|
-
}
|
|
399
|
-
const dependencies = [];
|
|
400
|
-
for (const compName of block.dependencies.components) {
|
|
401
|
-
const resolved = await this.resolveComponentDependencies(compName, registry2);
|
|
402
|
-
dependencies.push(resolved);
|
|
403
|
-
}
|
|
404
|
-
for (const blockName of block.dependencies.blocks) {
|
|
405
|
-
const resolved = await this.resolveBlockDependencies(blockName, registry2);
|
|
406
|
-
dependencies.push(resolved);
|
|
407
|
-
}
|
|
408
|
-
return {
|
|
409
|
-
definition: block,
|
|
410
|
-
registry: registry2,
|
|
411
|
-
dependencies
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Get flat list of all npm dependencies for resolved items.
|
|
416
|
-
*/
|
|
417
|
-
getNpmDependencies(resolved) {
|
|
418
|
-
const deps = /* @__PURE__ */ new Set();
|
|
419
|
-
function collectDeps(item) {
|
|
420
|
-
const definition = item.definition;
|
|
421
|
-
if ("dependencies" in definition) {
|
|
422
|
-
for (const dep of definition.dependencies.npm) {
|
|
423
|
-
deps.add(dep);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
for (const child of item.dependencies) {
|
|
427
|
-
collectDeps(child);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
collectDeps(resolved);
|
|
431
|
-
return Array.from(deps).sort();
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Get flat list of all file paths for resolved items.
|
|
435
|
-
*/
|
|
436
|
-
getFilePaths(resolved) {
|
|
437
|
-
const paths = /* @__PURE__ */ new Set();
|
|
438
|
-
function collectPaths(item) {
|
|
439
|
-
const definition = item.definition;
|
|
440
|
-
for (const file of definition.files) {
|
|
441
|
-
paths.add(file.path);
|
|
442
|
-
}
|
|
443
|
-
for (const child of item.dependencies) {
|
|
444
|
-
collectPaths(child);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
collectPaths(resolved);
|
|
448
|
-
return Array.from(paths).sort();
|
|
449
|
-
}
|
|
450
|
-
// ===========================================================================
|
|
451
|
-
// VERSION CHECKING
|
|
452
|
-
// ===========================================================================
|
|
453
|
-
/**
|
|
454
|
-
* Check if a component version is compatible.
|
|
455
|
-
*/
|
|
456
|
-
async checkComponentVersion(name, requiredVersion, registryName) {
|
|
457
|
-
const component = await this.getComponent(name, registryName);
|
|
458
|
-
if (!component) return false;
|
|
459
|
-
return this.isVersionCompatible(component.version, requiredVersion);
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Check semver version compatibility.
|
|
463
|
-
* Simple implementation - considers major.minor compatibility.
|
|
464
|
-
*/
|
|
465
|
-
isVersionCompatible(actual, required) {
|
|
466
|
-
const [actualMajor, actualMinor] = actual.split(".").map(Number);
|
|
467
|
-
const [requiredMajor, requiredMinor] = required.split(".").map(Number);
|
|
468
|
-
if (actualMajor !== requiredMajor) return false;
|
|
469
|
-
return actualMinor >= requiredMinor;
|
|
470
|
-
}
|
|
471
|
-
// ===========================================================================
|
|
472
|
-
// REGISTRY INFO
|
|
473
|
-
// ===========================================================================
|
|
474
|
-
/**
|
|
475
|
-
* Get registry metadata.
|
|
476
|
-
*/
|
|
477
|
-
async getRegistryInfo(registryName) {
|
|
478
|
-
const registry2 = await this.loadRegistry(registryName ?? this.options.defaultRegistry);
|
|
479
|
-
return {
|
|
480
|
-
name: registry2.name,
|
|
481
|
-
version: registry2.version,
|
|
482
|
-
description: registry2.description,
|
|
483
|
-
componentCount: Object.keys(registry2.components).length,
|
|
484
|
-
blockCount: Object.keys(registry2.blocks).length,
|
|
485
|
-
themeCount: Object.keys(registry2.themes).length
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Get list of loaded registries.
|
|
490
|
-
*/
|
|
491
|
-
getLoadedRegistries() {
|
|
492
|
-
return Array.from(this.registries.keys());
|
|
493
|
-
}
|
|
494
|
-
};
|
|
495
|
-
new RegistryManager();
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
var init_installer = __esm({
|
|
499
|
-
"src/registry/installer.ts"() {
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
|
|
503
148
|
// src/registry/index.ts
|
|
504
149
|
var defaultRegistrySchema;
|
|
505
150
|
var init_registry = __esm({
|
|
506
151
|
"src/registry/index.ts"() {
|
|
507
|
-
init_manager();
|
|
508
|
-
init_installer();
|
|
509
152
|
defaultRegistrySchema = {
|
|
510
153
|
$schema: "https://prism.omnitron.dev/registry/v1/schema.json",
|
|
511
154
|
name: "prism",
|
|
@@ -1200,15 +843,15 @@ async function runAdd(items, options) {
|
|
|
1200
843
|
console.log("");
|
|
1201
844
|
}
|
|
1202
845
|
function detectPackageManager(cwd) {
|
|
1203
|
-
if (
|
|
1204
|
-
if (
|
|
846
|
+
if (fs5.existsSync(path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
847
|
+
if (fs5.existsSync(path.join(cwd, "yarn.lock"))) return "yarn";
|
|
1205
848
|
return "npm";
|
|
1206
849
|
}
|
|
1207
850
|
async function addItem(item, config, options) {
|
|
1208
851
|
const isBlock = item.startsWith("block:");
|
|
1209
852
|
const itemName = isBlock ? item.slice(6) : item;
|
|
1210
|
-
const
|
|
1211
|
-
const definition =
|
|
853
|
+
const registry = isBlock ? defaultRegistrySchema.blocks : defaultRegistrySchema.components;
|
|
854
|
+
const definition = registry[itemName];
|
|
1212
855
|
if (!definition) {
|
|
1213
856
|
return {
|
|
1214
857
|
name: item,
|
|
@@ -1217,18 +860,18 @@ async function addItem(item, config, options) {
|
|
|
1217
860
|
};
|
|
1218
861
|
}
|
|
1219
862
|
const outputPath = options.path ? path.join(config.rootDir, options.path, itemName) : isBlock ? getBlockPath(itemName, config) : getComponentPath(itemName, config);
|
|
1220
|
-
if (
|
|
863
|
+
if (fs5.existsSync(outputPath) && !options.overwrite) {
|
|
1221
864
|
return {
|
|
1222
865
|
name: item,
|
|
1223
866
|
success: false,
|
|
1224
867
|
error: `Already exists at ${path.relative(config.rootDir, outputPath)}. Use --overwrite to replace.`
|
|
1225
868
|
};
|
|
1226
869
|
}
|
|
1227
|
-
await
|
|
870
|
+
await fs5.promises.mkdir(outputPath, { recursive: true });
|
|
1228
871
|
for (const file of definition.files) {
|
|
1229
872
|
const filePath = path.join(outputPath, file.path);
|
|
1230
873
|
const content = generateFileContent(itemName, file.path, file.type, definition, isBlock);
|
|
1231
|
-
await
|
|
874
|
+
await fs5.promises.writeFile(filePath, content, "utf-8");
|
|
1232
875
|
}
|
|
1233
876
|
log.success(`Added ${itemName} \u2192 ${path.relative(config.rootDir, outputPath)}/`);
|
|
1234
877
|
await updateLockfile(config.rootDir, itemName, definition.version, isBlock);
|
|
@@ -1245,9 +888,9 @@ async function updateLockfile(rootDir, name, version, isBlock) {
|
|
|
1245
888
|
components: {},
|
|
1246
889
|
blocks: {}
|
|
1247
890
|
};
|
|
1248
|
-
if (
|
|
891
|
+
if (fs5.existsSync(lockfilePath)) {
|
|
1249
892
|
try {
|
|
1250
|
-
lockfile = JSON.parse(await
|
|
893
|
+
lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
1251
894
|
} catch {
|
|
1252
895
|
}
|
|
1253
896
|
}
|
|
@@ -1261,7 +904,7 @@ async function updateLockfile(rootDir, name, version, isBlock) {
|
|
|
1261
904
|
} else {
|
|
1262
905
|
lockfile.components[name] = entry;
|
|
1263
906
|
}
|
|
1264
|
-
await
|
|
907
|
+
await fs5.promises.writeFile(lockfilePath, JSON.stringify(lockfile, null, 2) + "\n", "utf-8");
|
|
1265
908
|
}
|
|
1266
909
|
function toPascalCase(name) {
|
|
1267
910
|
return name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
@@ -1869,11 +1512,11 @@ async function prompt(question, defaultValue) {
|
|
|
1869
1512
|
input: process.stdin,
|
|
1870
1513
|
output: process.stdout
|
|
1871
1514
|
});
|
|
1872
|
-
return new Promise((
|
|
1515
|
+
return new Promise((resolve2) => {
|
|
1873
1516
|
const displayQuestion = defaultValue ? `${question} (${defaultValue}): ` : `${question}: `;
|
|
1874
1517
|
rl.question(displayQuestion, (answer) => {
|
|
1875
1518
|
rl.close();
|
|
1876
|
-
|
|
1519
|
+
resolve2(answer.trim() || defaultValue || "");
|
|
1877
1520
|
});
|
|
1878
1521
|
});
|
|
1879
1522
|
}
|
|
@@ -1919,8 +1562,8 @@ async function runInit(options) {
|
|
|
1919
1562
|
path.join(cwd, DEFAULT_UTILS_DIR)
|
|
1920
1563
|
];
|
|
1921
1564
|
for (const dir of dirs) {
|
|
1922
|
-
if (!
|
|
1923
|
-
await
|
|
1565
|
+
if (!fs5.existsSync(dir)) {
|
|
1566
|
+
await fs5.promises.mkdir(dir, { recursive: true });
|
|
1924
1567
|
log.success(`Created ${path.relative(cwd, dir)}/`);
|
|
1925
1568
|
}
|
|
1926
1569
|
}
|
|
@@ -1946,7 +1589,7 @@ async function interactiveInit(cwd) {
|
|
|
1946
1589
|
const utilsAlias = await prompt("Where should utils be installed?", "@/utils");
|
|
1947
1590
|
const tailwindConfigPath = path.join(cwd, "tailwind.config.js");
|
|
1948
1591
|
const tailwindTsConfigPath = path.join(cwd, "tailwind.config.ts");
|
|
1949
|
-
const hasTailwind =
|
|
1592
|
+
const hasTailwind = fs5.existsSync(tailwindConfigPath) || fs5.existsSync(tailwindTsConfigPath);
|
|
1950
1593
|
let tailwindConfig;
|
|
1951
1594
|
if (hasTailwind) {
|
|
1952
1595
|
const useTailwind = await confirm("Tailwind CSS detected. Configure CSS variables?", true);
|
|
@@ -1954,7 +1597,7 @@ async function interactiveInit(cwd) {
|
|
|
1954
1597
|
const cssFile = await prompt("Where is your global CSS file?", "src/index.css");
|
|
1955
1598
|
const baseColor = await prompt("What base color would you like?", "slate");
|
|
1956
1599
|
tailwindConfig = {
|
|
1957
|
-
config:
|
|
1600
|
+
config: fs5.existsSync(tailwindTsConfigPath) ? "tailwind.config.ts" : "tailwind.config.js",
|
|
1958
1601
|
css: cssFile,
|
|
1959
1602
|
baseColor,
|
|
1960
1603
|
cssVariables: true
|
|
@@ -2118,8 +1761,8 @@ async function runDiff(items, options) {
|
|
|
2118
1761
|
async function findInstalledItems(config, filterItems) {
|
|
2119
1762
|
const items = [];
|
|
2120
1763
|
const componentsDir = getComponentPath("", config);
|
|
2121
|
-
if (
|
|
2122
|
-
const entries = await
|
|
1764
|
+
if (fs5.existsSync(componentsDir)) {
|
|
1765
|
+
const entries = await fs5.promises.readdir(componentsDir, { withFileTypes: true });
|
|
2123
1766
|
for (const entry of entries) {
|
|
2124
1767
|
if (entry.isDirectory()) {
|
|
2125
1768
|
const name = entry.name;
|
|
@@ -2134,8 +1777,8 @@ async function findInstalledItems(config, filterItems) {
|
|
|
2134
1777
|
}
|
|
2135
1778
|
}
|
|
2136
1779
|
const blocksDir = getBlockPath("", config);
|
|
2137
|
-
if (
|
|
2138
|
-
const entries = await
|
|
1780
|
+
if (fs5.existsSync(blocksDir)) {
|
|
1781
|
+
const entries = await fs5.promises.readdir(blocksDir, { withFileTypes: true });
|
|
2139
1782
|
for (const entry of entries) {
|
|
2140
1783
|
if (entry.isDirectory()) {
|
|
2141
1784
|
const name = entry.name;
|
|
@@ -2152,16 +1795,16 @@ async function findInstalledItems(config, filterItems) {
|
|
|
2152
1795
|
return items;
|
|
2153
1796
|
}
|
|
2154
1797
|
async function checkItemStatus(item, config) {
|
|
2155
|
-
const
|
|
2156
|
-
const definition =
|
|
1798
|
+
const registry = item.type === "block" ? defaultRegistrySchema.blocks : defaultRegistrySchema.components;
|
|
1799
|
+
const definition = registry[item.name];
|
|
2157
1800
|
if (!definition) {
|
|
2158
1801
|
return "unknown";
|
|
2159
1802
|
}
|
|
2160
1803
|
const lockfilePath = path.join(config.rootDir, "prism.lock.json");
|
|
2161
1804
|
let installedVersion;
|
|
2162
|
-
if (
|
|
1805
|
+
if (fs5.existsSync(lockfilePath)) {
|
|
2163
1806
|
try {
|
|
2164
|
-
const lockfile = JSON.parse(await
|
|
1807
|
+
const lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
2165
1808
|
const installed = item.type === "block" ? lockfile.blocks?.[item.name] : lockfile.components?.[item.name];
|
|
2166
1809
|
installedVersion = installed?.version;
|
|
2167
1810
|
} catch {
|
|
@@ -2179,11 +1822,11 @@ async function checkItemStatus(item, config) {
|
|
|
2179
1822
|
async function checkForLocalModifications(item, definition, _config) {
|
|
2180
1823
|
for (const file of definition.files) {
|
|
2181
1824
|
const filePath = path.join(item.path, file.path);
|
|
2182
|
-
if (!
|
|
1825
|
+
if (!fs5.existsSync(filePath)) {
|
|
2183
1826
|
return true;
|
|
2184
1827
|
}
|
|
2185
1828
|
}
|
|
2186
|
-
const localFiles = await
|
|
1829
|
+
const localFiles = await fs5.promises.readdir(item.path);
|
|
2187
1830
|
const expectedFiles = new Set(definition.files.map((f) => f.path));
|
|
2188
1831
|
for (const localFile of localFiles) {
|
|
2189
1832
|
if (localFile.startsWith(".") || localFile === "node_modules") {
|
|
@@ -2263,8 +1906,8 @@ async function runUpdate(items, options) {
|
|
|
2263
1906
|
async function findInstalledItems2(config, filterItems, all) {
|
|
2264
1907
|
const items = [];
|
|
2265
1908
|
const componentsDir = getComponentPath("", config);
|
|
2266
|
-
if (
|
|
2267
|
-
const entries = await
|
|
1909
|
+
if (fs5.existsSync(componentsDir)) {
|
|
1910
|
+
const entries = await fs5.promises.readdir(componentsDir, { withFileTypes: true });
|
|
2268
1911
|
for (const entry of entries) {
|
|
2269
1912
|
if (entry.isDirectory()) {
|
|
2270
1913
|
const name = entry.name;
|
|
@@ -2279,8 +1922,8 @@ async function findInstalledItems2(config, filterItems, all) {
|
|
|
2279
1922
|
}
|
|
2280
1923
|
}
|
|
2281
1924
|
const blocksDir = getBlockPath("", config);
|
|
2282
|
-
if (
|
|
2283
|
-
const entries = await
|
|
1925
|
+
if (fs5.existsSync(blocksDir)) {
|
|
1926
|
+
const entries = await fs5.promises.readdir(blocksDir, { withFileTypes: true });
|
|
2284
1927
|
for (const entry of entries) {
|
|
2285
1928
|
if (entry.isDirectory()) {
|
|
2286
1929
|
const name = entry.name;
|
|
@@ -2297,15 +1940,15 @@ async function findInstalledItems2(config, filterItems, all) {
|
|
|
2297
1940
|
return items;
|
|
2298
1941
|
}
|
|
2299
1942
|
async function checkForUpdate(item, config) {
|
|
2300
|
-
const
|
|
2301
|
-
const definition =
|
|
1943
|
+
const registry = item.type === "block" ? defaultRegistrySchema.blocks : defaultRegistrySchema.components;
|
|
1944
|
+
const definition = registry[item.name];
|
|
2302
1945
|
if (!definition) {
|
|
2303
1946
|
return false;
|
|
2304
1947
|
}
|
|
2305
1948
|
const lockfilePath = path.join(config.rootDir, "prism.lock.json");
|
|
2306
|
-
if (
|
|
1949
|
+
if (fs5.existsSync(lockfilePath)) {
|
|
2307
1950
|
try {
|
|
2308
|
-
const lockfile = JSON.parse(await
|
|
1951
|
+
const lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
2309
1952
|
const installed = item.type === "block" ? lockfile.blocks?.[item.name] : lockfile.components?.[item.name];
|
|
2310
1953
|
if (installed?.version && installed.version !== definition.version) {
|
|
2311
1954
|
return true;
|
|
@@ -2316,19 +1959,19 @@ async function checkForUpdate(item, config) {
|
|
|
2316
1959
|
return false;
|
|
2317
1960
|
}
|
|
2318
1961
|
async function updateItem(item, config, options) {
|
|
2319
|
-
const
|
|
2320
|
-
const definition =
|
|
1962
|
+
const registry = item.type === "block" ? defaultRegistrySchema.blocks : defaultRegistrySchema.components;
|
|
1963
|
+
const definition = registry[item.name];
|
|
2321
1964
|
if (!definition) {
|
|
2322
1965
|
throw new Error("Item not found in registry");
|
|
2323
1966
|
}
|
|
2324
1967
|
if (!options.overwrite) {
|
|
2325
1968
|
const backupDir = path.join(item.path, ".prism-backup");
|
|
2326
|
-
await
|
|
1969
|
+
await fs5.promises.mkdir(backupDir, { recursive: true });
|
|
2327
1970
|
for (const file of definition.files) {
|
|
2328
1971
|
const filePath = path.join(item.path, file.path);
|
|
2329
|
-
if (
|
|
1972
|
+
if (fs5.existsSync(filePath)) {
|
|
2330
1973
|
const backupPath = path.join(backupDir, file.path);
|
|
2331
|
-
await
|
|
1974
|
+
await fs5.promises.copyFile(filePath, backupPath);
|
|
2332
1975
|
}
|
|
2333
1976
|
}
|
|
2334
1977
|
log.muted(` Backed up ${definition.files.length} file(s) to .prism-backup/`);
|
|
@@ -2343,7 +1986,7 @@ async function updateItem(item, config, options) {
|
|
|
2343
1986
|
definition,
|
|
2344
1987
|
item.type === "block"
|
|
2345
1988
|
);
|
|
2346
|
-
await
|
|
1989
|
+
await fs5.promises.writeFile(filePath, content, "utf-8");
|
|
2347
1990
|
}
|
|
2348
1991
|
log.muted(` Updated ${definition.files.length} file(s) in ${path.relative(config.rootDir, item.path)}/`);
|
|
2349
1992
|
const lockfilePath = path.join(config.rootDir, "prism.lock.json");
|
|
@@ -2352,9 +1995,9 @@ async function updateItem(item, config, options) {
|
|
|
2352
1995
|
components: {},
|
|
2353
1996
|
blocks: {}
|
|
2354
1997
|
};
|
|
2355
|
-
if (
|
|
1998
|
+
if (fs5.existsSync(lockfilePath)) {
|
|
2356
1999
|
try {
|
|
2357
|
-
lockfile = JSON.parse(await
|
|
2000
|
+
lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
2358
2001
|
} catch {
|
|
2359
2002
|
}
|
|
2360
2003
|
}
|
|
@@ -2368,7 +2011,7 @@ async function updateItem(item, config, options) {
|
|
|
2368
2011
|
} else {
|
|
2369
2012
|
lockfile.components[item.name] = entry;
|
|
2370
2013
|
}
|
|
2371
|
-
await
|
|
2014
|
+
await fs5.promises.writeFile(lockfilePath, JSON.stringify(lockfile, null, 2), "utf-8");
|
|
2372
2015
|
}
|
|
2373
2016
|
|
|
2374
2017
|
// src/cli/commands/remove.ts
|
|
@@ -2426,7 +2069,7 @@ async function removeItem(item, config, options) {
|
|
|
2426
2069
|
const isBlock = item.startsWith("block:");
|
|
2427
2070
|
const name = isBlock ? item.replace("block:", "") : item;
|
|
2428
2071
|
const itemPath = isBlock ? getBlockPath(name, config) : getComponentPath(name, config);
|
|
2429
|
-
if (!
|
|
2072
|
+
if (!fs5.existsSync(itemPath)) {
|
|
2430
2073
|
return {
|
|
2431
2074
|
name: item,
|
|
2432
2075
|
success: false,
|
|
@@ -2434,7 +2077,7 @@ async function removeItem(item, config, options) {
|
|
|
2434
2077
|
};
|
|
2435
2078
|
}
|
|
2436
2079
|
try {
|
|
2437
|
-
await
|
|
2080
|
+
await fs5.promises.rm(itemPath, { recursive: true, force: true });
|
|
2438
2081
|
log.success(`Removed ${name} from ${path.relative(config.rootDir, itemPath)}/`);
|
|
2439
2082
|
await updateLockfile2(config.rootDir, name, isBlock);
|
|
2440
2083
|
return { name: item, success: true };
|
|
@@ -2448,17 +2091,17 @@ async function removeItem(item, config, options) {
|
|
|
2448
2091
|
}
|
|
2449
2092
|
async function updateLockfile2(rootDir, name, isBlock) {
|
|
2450
2093
|
const lockfilePath = path.join(rootDir, "prism.lock.json");
|
|
2451
|
-
if (!
|
|
2094
|
+
if (!fs5.existsSync(lockfilePath)) {
|
|
2452
2095
|
return;
|
|
2453
2096
|
}
|
|
2454
2097
|
try {
|
|
2455
|
-
const lockfile = JSON.parse(await
|
|
2098
|
+
const lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
2456
2099
|
if (isBlock) {
|
|
2457
2100
|
delete lockfile.blocks[name];
|
|
2458
2101
|
} else {
|
|
2459
2102
|
delete lockfile.components[name];
|
|
2460
2103
|
}
|
|
2461
|
-
await
|
|
2104
|
+
await fs5.promises.writeFile(lockfilePath, JSON.stringify(lockfile, null, 2) + "\n", "utf-8");
|
|
2462
2105
|
log.muted(` Updated prism.lock.json`);
|
|
2463
2106
|
} catch {
|
|
2464
2107
|
log.warning(" Could not update lockfile");
|
|
@@ -2524,7 +2167,7 @@ async function checkConfigFile(cwd) {
|
|
|
2524
2167
|
async function checkPackageJson(cwd) {
|
|
2525
2168
|
const results = [];
|
|
2526
2169
|
const pkgPath = path.join(cwd, "package.json");
|
|
2527
|
-
if (!
|
|
2170
|
+
if (!fs5.existsSync(pkgPath)) {
|
|
2528
2171
|
results.push({
|
|
2529
2172
|
name: "package.json",
|
|
2530
2173
|
status: "fail",
|
|
@@ -2533,7 +2176,7 @@ async function checkPackageJson(cwd) {
|
|
|
2533
2176
|
return results;
|
|
2534
2177
|
}
|
|
2535
2178
|
try {
|
|
2536
|
-
const pkg2 = JSON.parse(await
|
|
2179
|
+
const pkg2 = JSON.parse(await fs5.promises.readFile(pkgPath, "utf-8"));
|
|
2537
2180
|
const allDeps = { ...pkg2.dependencies, ...pkg2.devDependencies, ...pkg2.peerDependencies };
|
|
2538
2181
|
const requiredPeers = ["react", "react-dom", "@mui/material"];
|
|
2539
2182
|
for (const dep of requiredPeers) {
|
|
@@ -2586,7 +2229,7 @@ function checkDirectories(config) {
|
|
|
2586
2229
|
};
|
|
2587
2230
|
for (const [name, alias] of Object.entries(dirs)) {
|
|
2588
2231
|
const resolved = resolveAlias(alias, config);
|
|
2589
|
-
if (
|
|
2232
|
+
if (fs5.existsSync(resolved)) {
|
|
2590
2233
|
results.push({
|
|
2591
2234
|
name: `${name} directory`,
|
|
2592
2235
|
status: "pass",
|
|
@@ -2604,7 +2247,7 @@ function checkDirectories(config) {
|
|
|
2604
2247
|
}
|
|
2605
2248
|
async function checkTsConfig(cwd) {
|
|
2606
2249
|
const tsConfigPath = path.join(cwd, "tsconfig.json");
|
|
2607
|
-
if (!
|
|
2250
|
+
if (!fs5.existsSync(tsConfigPath)) {
|
|
2608
2251
|
return {
|
|
2609
2252
|
name: "TypeScript",
|
|
2610
2253
|
status: "warn",
|
|
@@ -2612,7 +2255,7 @@ async function checkTsConfig(cwd) {
|
|
|
2612
2255
|
};
|
|
2613
2256
|
}
|
|
2614
2257
|
try {
|
|
2615
|
-
const content = await
|
|
2258
|
+
const content = await fs5.promises.readFile(tsConfigPath, "utf-8");
|
|
2616
2259
|
const stripped = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
2617
2260
|
const tsConfig = JSON.parse(stripped);
|
|
2618
2261
|
const paths = tsConfig.compilerOptions?.paths || tsConfig.compilerOptions?.baseUrl;
|
|
@@ -2638,7 +2281,7 @@ async function checkTsConfig(cwd) {
|
|
|
2638
2281
|
}
|
|
2639
2282
|
async function checkLockfile(cwd) {
|
|
2640
2283
|
const lockfilePath = path.join(cwd, "prism.lock.json");
|
|
2641
|
-
if (!
|
|
2284
|
+
if (!fs5.existsSync(lockfilePath)) {
|
|
2642
2285
|
return {
|
|
2643
2286
|
name: "Lockfile",
|
|
2644
2287
|
status: "pass",
|
|
@@ -2646,7 +2289,7 @@ async function checkLockfile(cwd) {
|
|
|
2646
2289
|
};
|
|
2647
2290
|
}
|
|
2648
2291
|
try {
|
|
2649
|
-
const lockfile = JSON.parse(await
|
|
2292
|
+
const lockfile = JSON.parse(await fs5.promises.readFile(lockfilePath, "utf-8"));
|
|
2650
2293
|
const componentCount = Object.keys(lockfile.components || {}).length;
|
|
2651
2294
|
const blockCount = Object.keys(lockfile.blocks || {}).length;
|
|
2652
2295
|
return {
|