@walkeros/explorer 2.1.5 → 3.0.0-next-1773236214827
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/__mocks__/@monaco-editor/react.d.ts +3 -0
- package/dist/__mocks__/@monaco-editor/react.d.ts.map +1 -0
- package/dist/__mocks__/@monaco-editor/react.js +4 -0
- package/dist/__mocks__/@monaco-editor/react.js.map +1 -0
- package/dist/components/atoms/box.d.ts +27 -0
- package/dist/components/atoms/box.d.ts.map +1 -0
- package/dist/components/atoms/box.js +86 -0
- package/dist/components/atoms/box.js.map +1 -0
- package/dist/components/atoms/box.stories.d.ts +34 -0
- package/dist/components/atoms/box.stories.d.ts.map +1 -0
- package/dist/components/atoms/box.stories.js +104 -0
- package/dist/components/atoms/box.stories.js.map +1 -0
- package/dist/components/atoms/button-group.d.ts +17 -0
- package/dist/components/atoms/button-group.d.ts.map +1 -0
- package/dist/components/atoms/button-group.js +12 -0
- package/dist/components/atoms/button-group.js.map +1 -0
- package/dist/components/atoms/button-group.stories.d.ts +18 -0
- package/dist/components/atoms/button-group.stories.d.ts.map +1 -0
- package/dist/components/atoms/button-group.stories.js +39 -0
- package/dist/components/atoms/button-group.stories.js.map +1 -0
- package/dist/components/atoms/button-link.d.ts +12 -0
- package/dist/components/atoms/button-link.d.ts.map +1 -0
- package/dist/components/atoms/button-link.js +10 -0
- package/dist/components/atoms/button-link.js.map +1 -0
- package/dist/components/atoms/button-link.stories.d.ts +11 -0
- package/dist/components/atoms/button-link.stories.d.ts.map +1 -0
- package/dist/components/atoms/button-link.stories.js +50 -0
- package/dist/components/atoms/button-link.stories.js.map +1 -0
- package/dist/components/atoms/button.d.ts +15 -0
- package/dist/components/atoms/button.d.ts.map +1 -0
- package/dist/components/atoms/button.js +11 -0
- package/dist/components/atoms/button.js.map +1 -0
- package/dist/components/atoms/button.stories.d.ts +14 -0
- package/dist/components/atoms/button.stories.d.ts.map +1 -0
- package/dist/components/atoms/button.stories.js +25 -0
- package/dist/components/atoms/button.stories.js.map +1 -0
- package/dist/components/atoms/code.d.ts +92 -0
- package/dist/components/atoms/code.d.ts.map +1 -0
- package/dist/components/atoms/code.js +405 -0
- package/dist/components/atoms/code.js.map +1 -0
- package/dist/components/atoms/code.stories.d.ts +46 -0
- package/dist/components/atoms/code.stories.d.ts.map +1 -0
- package/dist/components/atoms/code.stories.js +156 -0
- package/dist/components/atoms/code.stories.js.map +1 -0
- package/dist/components/atoms/footer.d.ts +21 -0
- package/dist/components/atoms/footer.d.ts.map +1 -0
- package/dist/components/atoms/footer.js +19 -0
- package/dist/components/atoms/footer.js.map +1 -0
- package/dist/components/atoms/footer.stories.d.ts +14 -0
- package/dist/components/atoms/footer.stories.d.ts.map +1 -0
- package/dist/components/atoms/footer.stories.js +29 -0
- package/dist/components/atoms/footer.stories.js.map +1 -0
- package/dist/components/atoms/grid.d.ts +65 -0
- package/dist/components/atoms/grid.d.ts.map +1 -0
- package/dist/components/atoms/grid.js +169 -0
- package/dist/components/atoms/grid.js.map +1 -0
- package/dist/components/atoms/grid.stories.d.ts +18 -0
- package/dist/components/atoms/grid.stories.d.ts.map +1 -0
- package/dist/components/atoms/grid.stories.js +60 -0
- package/dist/components/atoms/grid.stories.js.map +1 -0
- package/dist/components/atoms/header.d.ts +7 -0
- package/dist/components/atoms/header.d.ts.map +1 -0
- package/dist/components/atoms/header.js +5 -0
- package/dist/components/atoms/header.js.map +1 -0
- package/dist/components/atoms/header.stories.d.ts +15 -0
- package/dist/components/atoms/header.stories.d.ts.map +1 -0
- package/dist/components/atoms/header.stories.js +37 -0
- package/dist/components/atoms/header.stories.js.map +1 -0
- package/dist/components/atoms/icons/icon.stories.d.ts +18 -0
- package/dist/components/atoms/icons/icon.stories.d.ts.map +1 -0
- package/dist/components/atoms/icons/icon.stories.js +37 -0
- package/dist/components/atoms/icons/icon.stories.js.map +1 -0
- package/dist/components/atoms/icons/icons.d.ts +2 -0
- package/dist/components/atoms/icons/icons.d.ts.map +1 -0
- package/dist/components/atoms/icons/icons.js +7 -0
- package/dist/components/atoms/icons/icons.js.map +1 -0
- package/dist/components/atoms/icons/index.d.ts +3 -0
- package/dist/components/atoms/icons/index.d.ts.map +1 -0
- package/dist/components/atoms/icons/index.js +3 -0
- package/dist/components/atoms/icons/index.js.map +1 -0
- package/dist/components/atoms/mdx-code.d.ts +33 -0
- package/dist/components/atoms/mdx-code.d.ts.map +1 -0
- package/dist/components/atoms/mdx-code.js +69 -0
- package/dist/components/atoms/mdx-code.js.map +1 -0
- package/dist/components/atoms/preview-footer.d.ts +32 -0
- package/dist/components/atoms/preview-footer.d.ts.map +1 -0
- package/dist/components/atoms/preview-footer.js +31 -0
- package/dist/components/atoms/preview-footer.js.map +1 -0
- package/dist/components/atoms/spinner.d.ts +17 -0
- package/dist/components/atoms/spinner.d.ts.map +1 -0
- package/dist/components/atoms/spinner.js +14 -0
- package/dist/components/atoms/spinner.js.map +1 -0
- package/dist/components/atoms/spinner.stories.d.ts +7 -0
- package/dist/components/atoms/spinner.stories.d.ts.map +1 -0
- package/dist/components/atoms/spinner.stories.js +9 -0
- package/dist/components/atoms/spinner.stories.js.map +1 -0
- package/dist/components/atoms/toggle.d.ts +9 -0
- package/dist/components/atoms/toggle.d.ts.map +1 -0
- package/dist/components/atoms/toggle.js +6 -0
- package/dist/components/atoms/toggle.js.map +1 -0
- package/dist/components/demos/DestinationDemo.d.ts +48 -0
- package/dist/components/demos/DestinationDemo.d.ts.map +1 -0
- package/dist/components/demos/DestinationDemo.js +105 -0
- package/dist/components/demos/DestinationDemo.js.map +1 -0
- package/dist/components/demos/DestinationDemo.stories.d.ts +17 -0
- package/dist/components/demos/DestinationDemo.stories.d.ts.map +1 -0
- package/dist/components/demos/DestinationDemo.stories.js +53 -0
- package/dist/components/demos/DestinationDemo.stories.js.map +1 -0
- package/dist/components/demos/DestinationInitDemo.d.ts +34 -0
- package/dist/components/demos/DestinationInitDemo.d.ts.map +1 -0
- package/dist/components/demos/DestinationInitDemo.js +73 -0
- package/dist/components/demos/DestinationInitDemo.js.map +1 -0
- package/dist/components/demos/DestinationInitDemo.stories.d.ts +17 -0
- package/dist/components/demos/DestinationInitDemo.stories.d.ts.map +1 -0
- package/dist/components/demos/DestinationInitDemo.stories.js +39 -0
- package/dist/components/demos/DestinationInitDemo.stories.js.map +1 -0
- package/dist/components/demos/PromotionPlayground.d.ts +30 -0
- package/dist/components/demos/PromotionPlayground.d.ts.map +1 -0
- package/dist/components/demos/PromotionPlayground.js +366 -0
- package/dist/components/demos/PromotionPlayground.js.map +1 -0
- package/dist/components/demos/PromotionPlayground.stories.d.ts +27 -0
- package/dist/components/demos/PromotionPlayground.stories.d.ts.map +1 -0
- package/dist/components/demos/PromotionPlayground.stories.js +32 -0
- package/dist/components/demos/PromotionPlayground.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.d.ts +24 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.js +10 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.d.ts +7 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js +71 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/index.d.ts +3 -0
- package/dist/components/molecules/architecture-flow/index.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/index.js +2 -0
- package/dist/components/molecules/architecture-flow/index.js.map +1 -0
- package/dist/components/molecules/code-box.d.ts +75 -0
- package/dist/components/molecules/code-box.d.ts.map +1 -0
- package/dist/components/molecules/code-box.js +174 -0
- package/dist/components/molecules/code-box.js.map +1 -0
- package/dist/components/molecules/code-box.stories.d.ts +87 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -0
- package/dist/components/molecules/code-box.stories.js +300 -0
- package/dist/components/molecules/code-box.stories.js.map +1 -0
- package/dist/components/molecules/code-snippet.d.ts +58 -0
- package/dist/components/molecules/code-snippet.d.ts.map +1 -0
- package/dist/components/molecules/code-snippet.js +72 -0
- package/dist/components/molecules/code-snippet.js.map +1 -0
- package/dist/components/molecules/code-snippet.stories.d.ts +23 -0
- package/dist/components/molecules/code-snippet.stories.d.ts.map +1 -0
- package/dist/components/molecules/code-snippet.stories.js +87 -0
- package/dist/components/molecules/code-snippet.stories.js.map +1 -0
- package/dist/components/molecules/dropdown.d.ts +68 -0
- package/dist/components/molecules/dropdown.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.js +47 -0
- package/dist/components/molecules/dropdown.js.map +1 -0
- package/dist/components/molecules/dropdown.stories.d.ts +7 -0
- package/dist/components/molecules/dropdown.stories.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.stories.js +18 -0
- package/dist/components/molecules/dropdown.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.d.ts +74 -0
- package/dist/components/molecules/flow-map/FlowMap.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.js +1039 -0
- package/dist/components/molecules/flow-map/FlowMap.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts +47 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.js +355 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.d.ts +29 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.js +117 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/index.d.ts +3 -0
- package/dist/components/molecules/flow-map/index.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/index.js +2 -0
- package/dist/components/molecules/flow-map/index.js.map +1 -0
- package/dist/components/molecules/preview.d.ts +23 -0
- package/dist/components/molecules/preview.d.ts.map +1 -0
- package/dist/components/molecules/preview.js +232 -0
- package/dist/components/molecules/preview.js.map +1 -0
- package/dist/components/molecules/preview.stories.d.ts +23 -0
- package/dist/components/molecules/preview.stories.d.ts.map +1 -0
- package/dist/components/molecules/preview.stories.js +186 -0
- package/dist/components/molecules/preview.stories.js.map +1 -0
- package/dist/components/molecules/property-table.d.ts +7 -0
- package/dist/components/molecules/property-table.d.ts.map +1 -0
- package/dist/components/molecules/property-table.js +88 -0
- package/dist/components/molecules/property-table.js.map +1 -0
- package/dist/components/molecules/property-table.stories.d.ts +24 -0
- package/dist/components/molecules/property-table.stories.d.ts.map +1 -0
- package/dist/components/molecules/property-table.stories.js +86 -0
- package/dist/components/molecules/property-table.stories.js.map +1 -0
- package/dist/components/organisms/browser-box.d.ts +31 -0
- package/dist/components/organisms/browser-box.d.ts.map +1 -0
- package/dist/components/organisms/browser-box.js +80 -0
- package/dist/components/organisms/browser-box.js.map +1 -0
- package/dist/components/organisms/browser-box.stories.d.ts +26 -0
- package/dist/components/organisms/browser-box.stories.d.ts.map +1 -0
- package/dist/components/organisms/browser-box.stories.js +102 -0
- package/dist/components/organisms/browser-box.stories.js.map +1 -0
- package/dist/components/organisms/collector-box.d.ts +24 -0
- package/dist/components/organisms/collector-box.d.ts.map +1 -0
- package/dist/components/organisms/collector-box.js +56 -0
- package/dist/components/organisms/collector-box.js.map +1 -0
- package/dist/components/organisms/collector-box.stories.d.ts +22 -0
- package/dist/components/organisms/collector-box.stories.d.ts.map +1 -0
- package/dist/components/organisms/collector-box.stories.js +59 -0
- package/dist/components/organisms/collector-box.stories.js.map +1 -0
- package/dist/components/organisms/live-code.d.ts +22 -0
- package/dist/components/organisms/live-code.d.ts.map +1 -0
- package/dist/components/organisms/live-code.js +50 -0
- package/dist/components/organisms/live-code.js.map +1 -0
- package/dist/components/organisms/live-code.stories.d.ts +24 -0
- package/dist/components/organisms/live-code.stories.d.ts.map +1 -0
- package/dist/components/organisms/live-code.stories.js +55 -0
- package/dist/components/organisms/live-code.stories.js.map +1 -0
- package/dist/components/ui/button.d.ts +4 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +6 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/icon.d.ts +5 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/icon.js +5 -0
- package/dist/components/ui/icon.js.map +1 -0
- package/dist/contexts/GridHeightContext.d.ts +11 -0
- package/dist/contexts/GridHeightContext.d.ts.map +1 -0
- package/dist/contexts/GridHeightContext.js +14 -0
- package/dist/contexts/GridHeightContext.js.map +1 -0
- package/dist/helpers/capture.d.ts +83 -0
- package/dist/helpers/capture.d.ts.map +1 -0
- package/dist/helpers/capture.js +125 -0
- package/dist/helpers/capture.js.map +1 -0
- package/dist/helpers/destinations.d.ts +21 -0
- package/dist/helpers/destinations.d.ts.map +1 -0
- package/dist/helpers/destinations.js +46 -0
- package/dist/helpers/destinations.js.map +1 -0
- package/dist/hooks/useDropdown.d.ts +34 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useDropdown.js +66 -0
- package/dist/hooks/useDropdown.js.map +1 -0
- package/dist/hooks/useMonacoHeight.d.ts +31 -0
- package/dist/hooks/useMonacoHeight.d.ts.map +1 -0
- package/dist/hooks/useMonacoHeight.js +83 -0
- package/dist/hooks/useMonacoHeight.js.map +1 -0
- package/dist/hooks/useTreeState.d.ts +32 -0
- package/dist/hooks/useTreeState.d.ts.map +1 -0
- package/dist/hooks/useTreeState.js +94 -0
- package/dist/hooks/useTreeState.js.map +1 -0
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +69 -1336
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/providers/MDXProvider.d.ts +40 -0
- package/dist/providers/MDXProvider.d.ts.map +1 -0
- package/dist/providers/MDXProvider.js +57 -0
- package/dist/providers/MDXProvider.js.map +1 -0
- package/dist/themes/index.d.ts +23 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +29 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/lighthouse.d.ts +26 -0
- package/dist/themes/lighthouse.d.ts.map +1 -0
- package/dist/themes/lighthouse.js +230 -0
- package/dist/themes/lighthouse.js.map +1 -0
- package/dist/themes/palenight.d.ts +31 -0
- package/dist/themes/palenight.d.ts.map +1 -0
- package/dist/themes/palenight.js +236 -0
- package/dist/themes/palenight.js.map +1 -0
- package/dist/themes/types.d.ts +103 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +8 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/types/intellisense.d.ts +33 -0
- package/dist/types/intellisense.d.ts.map +1 -0
- package/dist/types/intellisense.js +2 -0
- package/dist/types/intellisense.js.map +1 -0
- package/dist/utils/code-normalizer.d.ts +11 -0
- package/dist/utils/code-normalizer.d.ts.map +1 -0
- package/dist/utils/code-normalizer.js +21 -0
- package/dist/utils/code-normalizer.js.map +1 -0
- package/dist/utils/contract-path-walker.d.ts +27 -0
- package/dist/utils/contract-path-walker.d.ts.map +1 -0
- package/dist/utils/contract-path-walker.js +145 -0
- package/dist/utils/contract-path-walker.js.map +1 -0
- package/dist/utils/format-code.d.ts +9 -0
- package/dist/utils/format-code.d.ts.map +1 -0
- package/dist/utils/format-code.js +77 -0
- package/dist/utils/format-code.js.map +1 -0
- package/dist/utils/mapping-context-detector.d.ts +17 -0
- package/dist/utils/mapping-context-detector.d.ts.map +1 -0
- package/dist/utils/mapping-context-detector.js +22 -0
- package/dist/utils/mapping-context-detector.js.map +1 -0
- package/dist/utils/monaco-context-types.d.ts +39 -0
- package/dist/utils/monaco-context-types.d.ts.map +1 -0
- package/dist/utils/monaco-context-types.js +426 -0
- package/dist/utils/monaco-context-types.js.map +1 -0
- package/dist/utils/monaco-decorators.d.ts +17 -0
- package/dist/utils/monaco-decorators.d.ts.map +1 -0
- package/dist/utils/monaco-decorators.js +81 -0
- package/dist/utils/monaco-decorators.js.map +1 -0
- package/dist/utils/monaco-formatters.d.ts +16 -0
- package/dist/utils/monaco-formatters.d.ts.map +1 -0
- package/dist/utils/monaco-formatters.js +139 -0
- package/dist/utils/monaco-formatters.js.map +1 -0
- package/dist/utils/monaco-intellisense-flow-extractor.d.ts +13 -0
- package/dist/utils/monaco-intellisense-flow-extractor.d.ts.map +1 -0
- package/dist/utils/monaco-intellisense-flow-extractor.js +168 -0
- package/dist/utils/monaco-intellisense-flow-extractor.js.map +1 -0
- package/dist/utils/monaco-json-path.d.ts +12 -0
- package/dist/utils/monaco-json-path.d.ts.map +1 -0
- package/dist/utils/monaco-json-path.js +68 -0
- package/dist/utils/monaco-json-path.js.map +1 -0
- package/dist/utils/monaco-json-schema.d.ts +45 -0
- package/dist/utils/monaco-json-schema.d.ts.map +1 -0
- package/dist/utils/monaco-json-schema.js +90 -0
- package/dist/utils/monaco-json-schema.js.map +1 -0
- package/dist/utils/monaco-schema-contract.d.ts +8 -0
- package/dist/utils/monaco-schema-contract.d.ts.map +1 -0
- package/dist/utils/monaco-schema-contract.js +73 -0
- package/dist/utils/monaco-schema-contract.js.map +1 -0
- package/dist/utils/monaco-schema-enrichment.d.ts +26 -0
- package/dist/utils/monaco-schema-enrichment.d.ts.map +1 -0
- package/dist/utils/monaco-schema-enrichment.js +31 -0
- package/dist/utils/monaco-schema-enrichment.js.map +1 -0
- package/dist/utils/monaco-schema-flow-config.d.ts +10 -0
- package/dist/utils/monaco-schema-flow-config.d.ts.map +1 -0
- package/dist/utils/monaco-schema-flow-config.js +201 -0
- package/dist/utils/monaco-schema-flow-config.js.map +1 -0
- package/dist/utils/monaco-schema-variables.d.ts +4 -0
- package/dist/utils/monaco-schema-variables.d.ts.map +1 -0
- package/dist/utils/monaco-schema-variables.js +26 -0
- package/dist/utils/monaco-schema-variables.js.map +1 -0
- package/dist/utils/monaco-types.d.ts +174 -0
- package/dist/utils/monaco-types.d.ts.map +1 -0
- package/dist/utils/monaco-types.js +378 -0
- package/dist/utils/monaco-types.js.map +1 -0
- package/dist/utils/monaco-walkeros-completions.d.ts +23 -0
- package/dist/utils/monaco-walkeros-completions.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-completions.js +258 -0
- package/dist/utils/monaco-walkeros-completions.js.map +1 -0
- package/dist/utils/monaco-walkeros-decorations.d.ts +29 -0
- package/dist/utils/monaco-walkeros-decorations.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-decorations.js +87 -0
- package/dist/utils/monaco-walkeros-decorations.js.map +1 -0
- package/dist/utils/monaco-walkeros-markers.d.ts +13 -0
- package/dist/utils/monaco-walkeros-markers.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-markers.js +69 -0
- package/dist/utils/monaco-walkeros-markers.js.map +1 -0
- package/dist/utils/monaco-walkeros-providers.d.ts +19 -0
- package/dist/utils/monaco-walkeros-providers.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-providers.js +284 -0
- package/dist/utils/monaco-walkeros-providers.js.map +1 -0
- package/dist/utils/path-analyzer.d.ts +88 -0
- package/dist/utils/path-analyzer.d.ts.map +1 -0
- package/dist/utils/path-analyzer.js +215 -0
- package/dist/utils/path-analyzer.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export interface UseDropdownReturn {
|
|
3
|
+
/** Whether dropdown is currently open */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Toggle dropdown open/closed */
|
|
6
|
+
toggle: () => void;
|
|
7
|
+
/** Open the dropdown */
|
|
8
|
+
open: () => void;
|
|
9
|
+
/** Close the dropdown */
|
|
10
|
+
close: () => void;
|
|
11
|
+
/** Ref to attach to the container element for click-outside detection */
|
|
12
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* useDropdown - Manages dropdown open/close state with click-outside and keyboard handling
|
|
16
|
+
*
|
|
17
|
+
* Provides:
|
|
18
|
+
* - Open/close state management
|
|
19
|
+
* - Click-outside detection to close
|
|
20
|
+
* - Escape key handling to close
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const { isOpen, toggle, close, containerRef } = useDropdown();
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <div ref={containerRef}>
|
|
27
|
+
* <Dropdown isOpen={isOpen} onToggle={toggle}>
|
|
28
|
+
* ...
|
|
29
|
+
* </Dropdown>
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDropdown(): UseDropdownReturn;
|
|
34
|
+
//# sourceMappingURL=useDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdown.d.ts","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wBAAwB;IACxB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,yBAAyB;IACzB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,yEAAyE;IACzE,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,IAAI,iBAAiB,CAsD/C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* useDropdown - Manages dropdown open/close state with click-outside and keyboard handling
|
|
4
|
+
*
|
|
5
|
+
* Provides:
|
|
6
|
+
* - Open/close state management
|
|
7
|
+
* - Click-outside detection to close
|
|
8
|
+
* - Escape key handling to close
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { isOpen, toggle, close, containerRef } = useDropdown();
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <div ref={containerRef}>
|
|
15
|
+
* <Dropdown isOpen={isOpen} onToggle={toggle}>
|
|
16
|
+
* ...
|
|
17
|
+
* </Dropdown>
|
|
18
|
+
* </div>
|
|
19
|
+
* );
|
|
20
|
+
*/
|
|
21
|
+
export function useDropdown() {
|
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
23
|
+
const containerRef = useRef(null);
|
|
24
|
+
const toggle = useCallback(() => {
|
|
25
|
+
setIsOpen((prev) => !prev);
|
|
26
|
+
}, []);
|
|
27
|
+
const open = useCallback(() => {
|
|
28
|
+
setIsOpen(true);
|
|
29
|
+
}, []);
|
|
30
|
+
const close = useCallback(() => {
|
|
31
|
+
setIsOpen(false);
|
|
32
|
+
}, []);
|
|
33
|
+
// Close on click outside
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!isOpen)
|
|
36
|
+
return;
|
|
37
|
+
function handleClickOutside(event) {
|
|
38
|
+
if (containerRef.current &&
|
|
39
|
+
!containerRef.current.contains(event.target)) {
|
|
40
|
+
setIsOpen(false);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
44
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
45
|
+
}, [isOpen]);
|
|
46
|
+
// Close on Escape key
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!isOpen)
|
|
49
|
+
return;
|
|
50
|
+
function handleEscape(event) {
|
|
51
|
+
if (event.key === 'Escape') {
|
|
52
|
+
setIsOpen(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
document.addEventListener('keydown', handleEscape);
|
|
56
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
57
|
+
}, [isOpen]);
|
|
58
|
+
return {
|
|
59
|
+
isOpen,
|
|
60
|
+
toggle,
|
|
61
|
+
open,
|
|
62
|
+
close,
|
|
63
|
+
containerRef,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=useDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdown.js","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAgBjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,yBAAyB;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,SAAS,kBAAkB,CAAC,KAAiB;YAC3C,IACE,YAAY,CAAC,OAAO;gBACpB,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EACpD,CAAC;gBACD,SAAS,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QAED,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;IAC7E,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,sBAAsB;IACtB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,SAAS,YAAY,CAAC,KAAoB;YACxC,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;gBAC3B,SAAS,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QAED,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO;QACL,MAAM;QACN,MAAM;QACN,IAAI;QACJ,KAAK;QACL,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { editor } from 'monaco-editor';
|
|
2
|
+
export interface UseMonacoHeightOptions {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
minHeight?: number;
|
|
5
|
+
maxHeight?: number;
|
|
6
|
+
defaultHeight?: number;
|
|
7
|
+
onHeightChange?: (height: number) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to automatically calculate Monaco Editor height based on content
|
|
11
|
+
*
|
|
12
|
+
* @param enabled - Whether to enable auto-height calculation
|
|
13
|
+
* @param minHeight - Minimum height in pixels (default: 100)
|
|
14
|
+
* @param maxHeight - Maximum height in pixels (default: 800)
|
|
15
|
+
* @param defaultHeight - Default height when not auto-sizing (default: 400)
|
|
16
|
+
*
|
|
17
|
+
* @returns [height, setEditor] - Current height and function to register editor instance
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const [height, setEditor] = useMonacoHeight({ enabled: autoHeight });
|
|
21
|
+
*
|
|
22
|
+
* <Editor
|
|
23
|
+
* height={height}
|
|
24
|
+
* onMount={(editor) => setEditor(editor)}
|
|
25
|
+
* />
|
|
26
|
+
*/
|
|
27
|
+
export declare function useMonacoHeight({ enabled, minHeight, maxHeight, defaultHeight, onHeightChange, }?: UseMonacoHeightOptions): [
|
|
28
|
+
number,
|
|
29
|
+
(editor: editor.IStandaloneCodeEditor | null) => void
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=useMonacoHeight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMonacoHeight.d.ts","sourceRoot":"","sources":["../../src/hooks/useMonacoHeight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAe,EACf,SAAe,EACf,SAAe,EACf,aAAmB,EACnB,cAAc,GACf,GAAE,sBAA2B,GAAG;IAC/B,MAAM;IACN,CAAC,MAAM,EAAE,MAAM,CAAC,qBAAqB,GAAG,IAAI,KAAK,IAAI;CACtD,CAkFA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState, useRef, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to automatically calculate Monaco Editor height based on content
|
|
4
|
+
*
|
|
5
|
+
* @param enabled - Whether to enable auto-height calculation
|
|
6
|
+
* @param minHeight - Minimum height in pixels (default: 100)
|
|
7
|
+
* @param maxHeight - Maximum height in pixels (default: 800)
|
|
8
|
+
* @param defaultHeight - Default height when not auto-sizing (default: 400)
|
|
9
|
+
*
|
|
10
|
+
* @returns [height, setEditor] - Current height and function to register editor instance
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const [height, setEditor] = useMonacoHeight({ enabled: autoHeight });
|
|
14
|
+
*
|
|
15
|
+
* <Editor
|
|
16
|
+
* height={height}
|
|
17
|
+
* onMount={(editor) => setEditor(editor)}
|
|
18
|
+
* />
|
|
19
|
+
*/
|
|
20
|
+
export function useMonacoHeight({ enabled = false, minHeight = 100, maxHeight = 800, defaultHeight = 400, onHeightChange, } = {}) {
|
|
21
|
+
const [height, setHeight] = useState(enabled ? minHeight : defaultHeight);
|
|
22
|
+
const editorRef = useRef(null);
|
|
23
|
+
const previousHeightRef = useRef(enabled ? minHeight : defaultHeight);
|
|
24
|
+
const updateTimeoutRef = useRef(null);
|
|
25
|
+
const updateHeight = useCallback(() => {
|
|
26
|
+
if (!enabled || !editorRef.current)
|
|
27
|
+
return;
|
|
28
|
+
try {
|
|
29
|
+
const monacoContentHeight = editorRef.current.getContentHeight();
|
|
30
|
+
const boundedMonacoHeight = Math.max(minHeight, Math.min(maxHeight, monacoContentHeight));
|
|
31
|
+
if (boundedMonacoHeight === previousHeightRef.current) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
previousHeightRef.current = boundedMonacoHeight;
|
|
35
|
+
setHeight(boundedMonacoHeight);
|
|
36
|
+
if (onHeightChange) {
|
|
37
|
+
const HEADER_HEIGHT = 36;
|
|
38
|
+
const BORDER = 2;
|
|
39
|
+
const totalBoxHeight = boundedMonacoHeight + HEADER_HEIGHT + BORDER;
|
|
40
|
+
onHeightChange(totalBoxHeight);
|
|
41
|
+
}
|
|
42
|
+
// Note: We don't call editor.layout() here because Monaco's
|
|
43
|
+
// automaticLayout option handles layout updates automatically.
|
|
44
|
+
// Calling layout() here would create a feedback loop with
|
|
45
|
+
// onDidContentSizeChange, causing height to grow indefinitely.
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// Silently fail - editor might not be fully initialized
|
|
49
|
+
}
|
|
50
|
+
}, [enabled, minHeight, maxHeight, onHeightChange]);
|
|
51
|
+
const setEditor = useCallback((editor) => {
|
|
52
|
+
// Clean up previous timeout if it exists
|
|
53
|
+
if (updateTimeoutRef.current) {
|
|
54
|
+
clearTimeout(updateTimeoutRef.current);
|
|
55
|
+
updateTimeoutRef.current = null;
|
|
56
|
+
}
|
|
57
|
+
editorRef.current = editor;
|
|
58
|
+
if (!enabled || !editor) {
|
|
59
|
+
setHeight(defaultHeight);
|
|
60
|
+
previousHeightRef.current = defaultHeight;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Trigger initial height calculation
|
|
64
|
+
setTimeout(() => updateHeight(), 50);
|
|
65
|
+
// Listen for content changes with debouncing
|
|
66
|
+
const disposable = editor.onDidContentSizeChange(() => {
|
|
67
|
+
// Clear any pending update
|
|
68
|
+
if (updateTimeoutRef.current) {
|
|
69
|
+
clearTimeout(updateTimeoutRef.current);
|
|
70
|
+
}
|
|
71
|
+
// Debounce updates to prevent rapid-fire recalculations
|
|
72
|
+
updateTimeoutRef.current = setTimeout(() => {
|
|
73
|
+
updateHeight();
|
|
74
|
+
updateTimeoutRef.current = null;
|
|
75
|
+
}, 150);
|
|
76
|
+
});
|
|
77
|
+
// Store disposable for cleanup
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
+
editor.__heightDisposable = disposable;
|
|
80
|
+
}, [enabled, defaultHeight, updateHeight]);
|
|
81
|
+
return [height, setEditor];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=useMonacoHeight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMonacoHeight.js","sourceRoot":"","sources":["../../src/hooks/useMonacoHeight.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree expand/collapse state management
|
|
3
|
+
*
|
|
4
|
+
* Manages which paths in a tree view are expanded or collapsed.
|
|
5
|
+
* This hook is UI-agnostic and can be used with any tree structure.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const treeState = useTreeState(['']); // Root expanded by default
|
|
9
|
+
*
|
|
10
|
+
* // Check if expanded
|
|
11
|
+
* if (treeState.isExpanded(['product', 'view'])) { ... }
|
|
12
|
+
*
|
|
13
|
+
* // Toggle expansion
|
|
14
|
+
* treeState.togglePath(['product', 'view']);
|
|
15
|
+
*
|
|
16
|
+
* // Expand specific path
|
|
17
|
+
* treeState.expandPath(['product', 'view', 'data']);
|
|
18
|
+
*
|
|
19
|
+
* // Collapse specific path
|
|
20
|
+
* treeState.collapsePath(['product']);
|
|
21
|
+
*/
|
|
22
|
+
export declare function useTreeState(initialExpanded?: string[][]): {
|
|
23
|
+
expandedPaths: Set<string>;
|
|
24
|
+
isExpanded: (path: string[]) => boolean;
|
|
25
|
+
togglePath: (path: string[]) => void;
|
|
26
|
+
expandPath: (path: string[]) => void;
|
|
27
|
+
collapsePath: (path: string[]) => void;
|
|
28
|
+
expandAll: (allPaths: string[][]) => void;
|
|
29
|
+
collapseAll: () => void;
|
|
30
|
+
};
|
|
31
|
+
export type TreeState = ReturnType<typeof useTreeState>;
|
|
32
|
+
//# sourceMappingURL=useTreeState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useTreeState.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,eAAe,GAAE,MAAM,EAAE,EAAS;;uBASpD,MAAM,EAAE,KAAG,OAAO;uBAUW,MAAM,EAAE;uBAgBR,MAAM,EAAE;yBAYN,MAAM,EAAE;0BAYP,MAAM,EAAE,EAAE;;EAoBpD;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tree expand/collapse state management
|
|
4
|
+
*
|
|
5
|
+
* Manages which paths in a tree view are expanded or collapsed.
|
|
6
|
+
* This hook is UI-agnostic and can be used with any tree structure.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const treeState = useTreeState(['']); // Root expanded by default
|
|
10
|
+
*
|
|
11
|
+
* // Check if expanded
|
|
12
|
+
* if (treeState.isExpanded(['product', 'view'])) { ... }
|
|
13
|
+
*
|
|
14
|
+
* // Toggle expansion
|
|
15
|
+
* treeState.togglePath(['product', 'view']);
|
|
16
|
+
*
|
|
17
|
+
* // Expand specific path
|
|
18
|
+
* treeState.expandPath(['product', 'view', 'data']);
|
|
19
|
+
*
|
|
20
|
+
* // Collapse specific path
|
|
21
|
+
* treeState.collapsePath(['product']);
|
|
22
|
+
*/
|
|
23
|
+
export function useTreeState(initialExpanded = [[]]) {
|
|
24
|
+
const [expandedPaths, setExpandedPaths] = useState(() => {
|
|
25
|
+
return new Set(initialExpanded.map((path) => path.join('.')));
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Check if a path is expanded
|
|
29
|
+
*/
|
|
30
|
+
const isExpanded = useCallback((path) => {
|
|
31
|
+
const pathKey = path.join('.');
|
|
32
|
+
return expandedPaths.has(pathKey);
|
|
33
|
+
}, [expandedPaths]);
|
|
34
|
+
/**
|
|
35
|
+
* Toggle path expansion
|
|
36
|
+
*/
|
|
37
|
+
const togglePath = useCallback((path) => {
|
|
38
|
+
const pathKey = path.join('.');
|
|
39
|
+
setExpandedPaths((prev) => {
|
|
40
|
+
const next = new Set(prev);
|
|
41
|
+
if (next.has(pathKey)) {
|
|
42
|
+
next.delete(pathKey);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
next.add(pathKey);
|
|
46
|
+
}
|
|
47
|
+
return next;
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
/**
|
|
51
|
+
* Expand specific path
|
|
52
|
+
*/
|
|
53
|
+
const expandPath = useCallback((path) => {
|
|
54
|
+
const pathKey = path.join('.');
|
|
55
|
+
setExpandedPaths((prev) => {
|
|
56
|
+
const next = new Set(prev);
|
|
57
|
+
next.add(pathKey);
|
|
58
|
+
return next;
|
|
59
|
+
});
|
|
60
|
+
}, []);
|
|
61
|
+
/**
|
|
62
|
+
* Collapse specific path
|
|
63
|
+
*/
|
|
64
|
+
const collapsePath = useCallback((path) => {
|
|
65
|
+
const pathKey = path.join('.');
|
|
66
|
+
setExpandedPaths((prev) => {
|
|
67
|
+
const next = new Set(prev);
|
|
68
|
+
next.delete(pathKey);
|
|
69
|
+
return next;
|
|
70
|
+
});
|
|
71
|
+
}, []);
|
|
72
|
+
/**
|
|
73
|
+
* Expand all paths
|
|
74
|
+
*/
|
|
75
|
+
const expandAll = useCallback((allPaths) => {
|
|
76
|
+
setExpandedPaths(new Set(allPaths.map((path) => path.join('.'))));
|
|
77
|
+
}, []);
|
|
78
|
+
/**
|
|
79
|
+
* Collapse all paths
|
|
80
|
+
*/
|
|
81
|
+
const collapseAll = useCallback(() => {
|
|
82
|
+
setExpandedPaths(new Set());
|
|
83
|
+
}, []);
|
|
84
|
+
return {
|
|
85
|
+
expandedPaths,
|
|
86
|
+
isExpanded,
|
|
87
|
+
togglePath,
|
|
88
|
+
expandPath,
|
|
89
|
+
collapsePath,
|
|
90
|
+
expandAll,
|
|
91
|
+
collapseAll,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=useTreeState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeState.js","sourceRoot":"","sources":["../../src/hooks/useTreeState.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -260,6 +260,8 @@ interface IntelliSenseContext {
|
|
|
260
260
|
entity: string;
|
|
261
261
|
actions: string[];
|
|
262
262
|
}>;
|
|
263
|
+
/** Raw contract object for $contract completions and mapping hints */
|
|
264
|
+
contractRaw?: Record<string, unknown>;
|
|
263
265
|
/** Available packages for autocomplete */
|
|
264
266
|
packages?: PackageInfo[];
|
|
265
267
|
/** Current platform context (web or server) */
|
|
@@ -1185,12 +1187,12 @@ declare function enrichSchema(baseSchema: Record<string, unknown>, enrichments:
|
|
|
1185
1187
|
|
|
1186
1188
|
type AnySchema$2 = Record<string, any>;
|
|
1187
1189
|
/**
|
|
1188
|
-
* Takes the base Flow.
|
|
1190
|
+
* Takes the base Flow.Config JSON Schema (from @walkeros/core z.toJSONSchema())
|
|
1189
1191
|
* and returns an enriched version with Monaco-specific extensions.
|
|
1190
1192
|
*
|
|
1191
1193
|
* The actual schema uses anyOf[0] at the top level.
|
|
1192
1194
|
*/
|
|
1193
|
-
declare function
|
|
1195
|
+
declare function enrichFlowConfigSchema(baseSchema: AnySchema$2): AnySchema$2;
|
|
1194
1196
|
|
|
1195
1197
|
type AnySchema$1 = Record<string, any>;
|
|
1196
1198
|
/**
|
|
@@ -1261,9 +1263,9 @@ interface ValidationIssue {
|
|
|
1261
1263
|
declare function validateWalkerOSReferences(text: string, context: Partial<IntelliSenseContext>): ValidationIssue[];
|
|
1262
1264
|
|
|
1263
1265
|
/**
|
|
1264
|
-
* Extract IntelliSense context from a Flow.
|
|
1266
|
+
* Extract IntelliSense context from a Flow.Config JSON string.
|
|
1265
1267
|
*
|
|
1266
|
-
* Parses the JSON, walks
|
|
1268
|
+
* Parses the JSON, walks config → settings → steps, and collects
|
|
1267
1269
|
* all discoverable variables, definitions, step names, packages,
|
|
1268
1270
|
* platform, and contract entities.
|
|
1269
1271
|
*
|
|
@@ -1333,4 +1335,4 @@ declare function createRawCapture(destinationEnv: unknown): {
|
|
|
1333
1335
|
}[];
|
|
1334
1336
|
};
|
|
1335
1337
|
|
|
1336
|
-
export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, type CodeProps, CodeSnippet, type CodeSnippetProps, CollectorBox, type CollectorBoxProps, DestinationDemo, type DestinationDemoProps, DestinationInitDemo as DestinationInit, DestinationInitDemo, type DestinationInitDemoProps, DestinationDemo as DestinationPush, Dropdown, DropdownDivider, type DropdownDividerProps, DropdownItem, type DropdownItemProps, type DropdownProps, type ExplorerTheme, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Footer, type FooterProps, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, MDXCode, MDXProvider, type MonacoSchemaExtension, type PackageInfo, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, Spinner, type SpinnerProps, type UseDropdownReturn, applyWalkerOSDecorations, captureDestinationPush, cn, createCaptureFn, createFbqDestination, createGtagDestination, createPlausibleDestination, createRawCapture, disposeWalkerOSProviders,
|
|
1338
|
+
export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, type CodeProps, CodeSnippet, type CodeSnippetProps, CollectorBox, type CollectorBoxProps, DestinationDemo, type DestinationDemoProps, DestinationInitDemo as DestinationInit, DestinationInitDemo, type DestinationInitDemoProps, DestinationDemo as DestinationPush, Dropdown, DropdownDivider, type DropdownDividerProps, DropdownItem, type DropdownItemProps, type DropdownProps, type ExplorerTheme, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Footer, type FooterProps, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, MDXCode, MDXProvider, type MonacoSchemaExtension, type PackageInfo, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, Spinner, type SpinnerProps, type UseDropdownReturn, applyWalkerOSDecorations, captureDestinationPush, cn, createCaptureFn, createFbqDestination, createGtagDestination, createPlausibleDestination, createRawCapture, disposeWalkerOSProviders, enrichFlowConfigSchema, enrichSchema, extractFlowIntelliSenseContext, findWalkerOSReferences, formatCapturedCalls, generateModelPath, getEnrichedContractSchema, getVariablesSchema, initializeMonacoTypes, lighthouseTheme, loadPackageTypes, loadTypeLibraryFromURL, palenightTheme, registerAllThemes, registerJsonSchema, registerLighthouseTheme, registerPalenightTheme, registerWalkerOSDecorationStyles, registerWalkerOSProviders, registerWalkerOSTypes, removeIntelliSenseContext, setIntelliSenseContext, unregisterJsonSchema, useDropdown, validateWalkerOSReferences };
|