@walkeros/explorer 3.0.1 → 3.0.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/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.ts +69 -1338
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -1
- package/dist/index.js.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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format code using Prettier
|
|
3
|
+
*
|
|
4
|
+
* @param code - The code to format
|
|
5
|
+
* @param language - The language (javascript, typescript, json, html, css)
|
|
6
|
+
* @returns Formatted code, or original code if formatting fails
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatCode(code: string, language: string): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=format-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-code.d.ts","sourceRoot":"","sources":["../../src/utils/format-code.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAsEjB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as prettier from 'prettier/standalone';
|
|
2
|
+
import prettierBabel from 'prettier/plugins/babel';
|
|
3
|
+
import prettierEstree from 'prettier/plugins/estree';
|
|
4
|
+
import prettierTypescript from 'prettier/plugins/typescript';
|
|
5
|
+
import prettierHtml from 'prettier/plugins/html';
|
|
6
|
+
/**
|
|
7
|
+
* Format code using Prettier
|
|
8
|
+
*
|
|
9
|
+
* @param code - The code to format
|
|
10
|
+
* @param language - The language (javascript, typescript, json, html, css)
|
|
11
|
+
* @returns Formatted code, or original code if formatting fails
|
|
12
|
+
*/
|
|
13
|
+
export async function formatCode(code, language) {
|
|
14
|
+
try {
|
|
15
|
+
let formatted;
|
|
16
|
+
switch (language) {
|
|
17
|
+
case 'javascript':
|
|
18
|
+
case 'js': {
|
|
19
|
+
// Wrap bare objects in parens so Prettier can parse them
|
|
20
|
+
// Skip one-liners — they're intentionally compact
|
|
21
|
+
const isBareObject = code.trimStart().startsWith('{') && code.includes('\n');
|
|
22
|
+
const input = isBareObject ? `(${code})` : code;
|
|
23
|
+
formatted = await prettier.format(input, {
|
|
24
|
+
parser: 'babel',
|
|
25
|
+
plugins: [prettierBabel, prettierEstree],
|
|
26
|
+
semi: true,
|
|
27
|
+
singleQuote: true,
|
|
28
|
+
trailingComma: 'all',
|
|
29
|
+
});
|
|
30
|
+
if (isBareObject) {
|
|
31
|
+
// Unwrap: remove leading "(" and trailing ");\n"
|
|
32
|
+
formatted = formatted.replace(/^\(/, '').replace(/\);?\s*$/, '');
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case 'typescript':
|
|
37
|
+
case 'ts':
|
|
38
|
+
case 'tsx':
|
|
39
|
+
formatted = await prettier.format(code, {
|
|
40
|
+
parser: 'typescript',
|
|
41
|
+
plugins: [prettierTypescript, prettierEstree],
|
|
42
|
+
semi: true,
|
|
43
|
+
singleQuote: true,
|
|
44
|
+
trailingComma: 'all',
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
case 'json':
|
|
48
|
+
// Use native JSON for simplicity
|
|
49
|
+
const parsed = JSON.parse(code);
|
|
50
|
+
formatted = JSON.stringify(parsed, null, 2);
|
|
51
|
+
break;
|
|
52
|
+
case 'html':
|
|
53
|
+
formatted = await prettier.format(code, {
|
|
54
|
+
parser: 'html',
|
|
55
|
+
plugins: [prettierHtml],
|
|
56
|
+
htmlWhitespaceSensitivity: 'css',
|
|
57
|
+
});
|
|
58
|
+
break;
|
|
59
|
+
case 'css':
|
|
60
|
+
case 'scss':
|
|
61
|
+
formatted = await prettier.format(code, {
|
|
62
|
+
parser: 'css',
|
|
63
|
+
plugins: [prettierHtml],
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
// Unsupported language, return original
|
|
68
|
+
return code;
|
|
69
|
+
}
|
|
70
|
+
// Trim trailing whitespace/newlines
|
|
71
|
+
return formatted.trim();
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return code;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=format-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-code.js","sourceRoot":"","sources":["../../src/utils/format-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,OAAO,kBAAkB,MAAM,6BAA6B,CAAC;AAC7D,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,IAAY,EACZ,QAAgB;IAEhB,IAAI,CAAC;QACH,IAAI,SAAiB,CAAC;QAEtB,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,YAAY,CAAC;YAClB,KAAK,IAAI,CAAC,CAAC,CAAC;gBACV,yDAAyD;gBACzD,kDAAkD;gBAClD,MAAM,YAAY,GAChB,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC1D,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;gBAChD,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE;oBACvC,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;oBACxC,IAAI,EAAE,IAAI;oBACV,WAAW,EAAE,IAAI;oBACjB,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC;gBACH,IAAI,YAAY,EAAE,CAAC;oBACjB,iDAAiD;oBACjD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBACnE,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,YAAY,CAAC;YAClB,KAAK,IAAI,CAAC;YACV,KAAK,KAAK;gBACR,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;oBACtC,MAAM,EAAE,YAAY;oBACpB,OAAO,EAAE,CAAC,kBAAkB,EAAE,cAAc,CAAC;oBAC7C,IAAI,EAAE,IAAI;oBACV,WAAW,EAAE,IAAI;oBACjB,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC;gBACH,MAAM;YAER,KAAK,MAAM;gBACT,iCAAiC;gBACjC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC5C,MAAM;YAER,KAAK,MAAM;gBACT,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;oBACtC,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,yBAAyB,EAAE,KAAK;iBACjC,CAAC,CAAC;gBACH,MAAM;YAER,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;oBACtC,MAAM,EAAE,KAAK;oBACb,OAAO,EAAE,CAAC,YAAY,CAAC;iBACxB,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,wCAAwC;gBACxC,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,oCAAoC;QACpC,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface MappingContext {
|
|
2
|
+
entity: string;
|
|
3
|
+
action: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Detect the entity/action context from a JSON path that includes "mapping".
|
|
7
|
+
*
|
|
8
|
+
* The mapping structure in flow.json is:
|
|
9
|
+
* flows.<name>.destinations.<name>.mapping.<entity>.<action>.<...>
|
|
10
|
+
*
|
|
11
|
+
* After the "mapping" key, the next two segments are entity and action.
|
|
12
|
+
*
|
|
13
|
+
* @param pathSegments - JSON path segments from root to cursor position
|
|
14
|
+
* @returns Entity and action if inside a mapping rule, null otherwise
|
|
15
|
+
*/
|
|
16
|
+
export declare function detectMappingContext(pathSegments: string[]): MappingContext | null;
|
|
17
|
+
//# sourceMappingURL=mapping-context-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping-context-detector.d.ts","sourceRoot":"","sources":["../../src/utils/mapping-context-detector.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EAAE,GACrB,cAAc,GAAG,IAAI,CAUvB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect the entity/action context from a JSON path that includes "mapping".
|
|
3
|
+
*
|
|
4
|
+
* The mapping structure in flow.json is:
|
|
5
|
+
* flows.<name>.destinations.<name>.mapping.<entity>.<action>.<...>
|
|
6
|
+
*
|
|
7
|
+
* After the "mapping" key, the next two segments are entity and action.
|
|
8
|
+
*
|
|
9
|
+
* @param pathSegments - JSON path segments from root to cursor position
|
|
10
|
+
* @returns Entity and action if inside a mapping rule, null otherwise
|
|
11
|
+
*/
|
|
12
|
+
export function detectMappingContext(pathSegments) {
|
|
13
|
+
const mappingIndex = pathSegments.indexOf('mapping');
|
|
14
|
+
if (mappingIndex === -1)
|
|
15
|
+
return null;
|
|
16
|
+
const entity = pathSegments[mappingIndex + 1];
|
|
17
|
+
const action = pathSegments[mappingIndex + 2];
|
|
18
|
+
if (!entity || !action)
|
|
19
|
+
return null;
|
|
20
|
+
return { entity, action };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=mapping-context-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping-context-detector.js","sourceRoot":"","sources":["../../src/utils/mapping-context-detector.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,YAAsB;IAEtB,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,IAAI,YAAY,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAErC,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco Editor Context Type Templates
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted global namespace declarations for function contexts.
|
|
5
|
+
* These provide full TypeScript IntelliSense in Monaco Editor without
|
|
6
|
+
* requiring import statements.
|
|
7
|
+
*
|
|
8
|
+
* Extracted from @walkeros/core types and simplified for editor use.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Type template for 'fn' context (transformation functions)
|
|
12
|
+
*
|
|
13
|
+
* Provides types for:
|
|
14
|
+
* - value: WalkerOS.DeepPartialEvent | unknown
|
|
15
|
+
* - mapping: Mapping.Value
|
|
16
|
+
* - options: Mapping.Options
|
|
17
|
+
*/
|
|
18
|
+
export declare const FN_CONTEXT_TYPES = "\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Version\n interface Version extends Properties {\n source: string;\n tagging: number;\n }\n\n // Source\n type SourceType = 'web' | 'server' | 'app' | 'other' | string;\n\n interface Source extends Properties {\n type: SourceType;\n id: string;\n previous_id: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested: Entities;\n context: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n group: string;\n count: number;\n version: Version;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n\n type Map = {\n [key: string]: Value;\n };\n\n interface Options {\n consent?: WalkerOS.Consent;\n collector?: Collector.Instance;\n props?: unknown;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n mapping?: Value,\n collector?: Collector.Instance\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n mapping: Value,\n options: Options\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (value?: unknown) => WalkerOS.PromiseOrValue<boolean>;\n}\n\n// Collector Types (minimal for fn context)\ndeclare namespace Collector {\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: any;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n globals: WalkerOS.Properties;\n group: string;\n queue: any[];\n round: number;\n session: any;\n timing: number;\n user: WalkerOS.User;\n version: string;\n [key: string]: any;\n }\n}\n\n// Parameter declarations for fn context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const mapping: Mapping.Value;\ndeclare const options: Mapping.Options;\n";
|
|
19
|
+
/**
|
|
20
|
+
* Type template for 'condition' context (conditional functions)
|
|
21
|
+
*
|
|
22
|
+
* Provides types for:
|
|
23
|
+
* - value: WalkerOS.DeepPartialEvent | unknown
|
|
24
|
+
* - mapping: Mapping.Value
|
|
25
|
+
* - collector: Collector.Instance | undefined
|
|
26
|
+
*/
|
|
27
|
+
export declare const CONDITION_CONTEXT_TYPES = "\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Version\n interface Version extends Properties {\n source: string;\n tagging: number;\n }\n\n // Source\n type SourceType = 'web' | 'server' | 'app' | 'other' | string;\n\n interface Source extends Properties {\n type: SourceType;\n id: string;\n previous_id: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested: Entities;\n context: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n group: string;\n count: number;\n version: Version;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n\n type Map = {\n [key: string]: Value;\n };\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n mapping?: Value,\n collector?: Collector.Instance\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n mapping: Value,\n options: any\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (value?: unknown) => WalkerOS.PromiseOrValue<boolean>;\n}\n\n// Collector Types (full interface for condition context)\ndeclare namespace Collector {\n interface SessionData extends WalkerOS.Properties {\n isStart: boolean;\n storage: boolean;\n id?: string;\n start?: number;\n marketing?: true;\n updated?: number;\n isNew?: boolean;\n device?: string;\n count?: number;\n runs?: number;\n }\n\n interface Config {\n run?: boolean;\n tagging: number;\n globalsStatic: WalkerOS.Properties;\n sessionStatic: Partial<SessionData>;\n verbose: boolean;\n onError?: any;\n onLog?: any;\n }\n\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: Config;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n sources: any;\n destinations: any;\n globals: WalkerOS.Properties;\n group: string;\n hooks: any;\n on: any;\n queue: any[];\n round: number;\n session: undefined | SessionData;\n timing: number;\n user: WalkerOS.User;\n version: string;\n }\n}\n\n// Parameter declarations for condition context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const mapping: Mapping.Value;\ndeclare const collector: Collector.Instance | undefined;\n";
|
|
28
|
+
/**
|
|
29
|
+
* Type template for 'validate' context (validation functions)
|
|
30
|
+
*
|
|
31
|
+
* Provides types for:
|
|
32
|
+
* - value: unknown
|
|
33
|
+
*/
|
|
34
|
+
export declare const VALIDATE_CONTEXT_TYPES = "\n// Parameter declaration for validate context\ndeclare const value: unknown;\n";
|
|
35
|
+
/**
|
|
36
|
+
* Get the type template for a specific function context
|
|
37
|
+
*/
|
|
38
|
+
export declare function getContextTypes(contextType: 'fn' | 'condition' | 'validate'): string;
|
|
39
|
+
//# sourceMappingURL=monaco-context-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco-context-types.d.ts","sourceRoot":"","sources":["../../src/utils/monaco-context-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,0xHAiL5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,wtIAoMnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,qFAGlC,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,IAAI,GAAG,WAAW,GAAG,UAAU,GAC3C,MAAM,CAWR"}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco Editor Context Type Templates
|
|
3
|
+
*
|
|
4
|
+
* Hand-crafted global namespace declarations for function contexts.
|
|
5
|
+
* These provide full TypeScript IntelliSense in Monaco Editor without
|
|
6
|
+
* requiring import statements.
|
|
7
|
+
*
|
|
8
|
+
* Extracted from @walkeros/core types and simplified for editor use.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Type template for 'fn' context (transformation functions)
|
|
12
|
+
*
|
|
13
|
+
* Provides types for:
|
|
14
|
+
* - value: WalkerOS.DeepPartialEvent | unknown
|
|
15
|
+
* - mapping: Mapping.Value
|
|
16
|
+
* - options: Mapping.Options
|
|
17
|
+
*/
|
|
18
|
+
export const FN_CONTEXT_TYPES = `
|
|
19
|
+
// WalkerOS Core Types
|
|
20
|
+
declare namespace WalkerOS {
|
|
21
|
+
// Utility types
|
|
22
|
+
type DeepPartial<T> = {
|
|
23
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
27
|
+
|
|
28
|
+
// Property types
|
|
29
|
+
type PropertyType = boolean | string | number | {
|
|
30
|
+
[key: string]: Property;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type Property = PropertyType | Array<PropertyType>;
|
|
34
|
+
|
|
35
|
+
interface Properties {
|
|
36
|
+
[key: string]: Property | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface OrderedProperties {
|
|
40
|
+
[key: string]: [Property, number] | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Consent
|
|
44
|
+
interface Consent {
|
|
45
|
+
[name: string]: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// User
|
|
49
|
+
interface User extends Properties {
|
|
50
|
+
id?: string;
|
|
51
|
+
device?: string;
|
|
52
|
+
session?: string;
|
|
53
|
+
hash?: string;
|
|
54
|
+
address?: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
phone?: string;
|
|
57
|
+
userAgent?: string;
|
|
58
|
+
browser?: string;
|
|
59
|
+
browserVersion?: string;
|
|
60
|
+
deviceType?: string;
|
|
61
|
+
language?: string;
|
|
62
|
+
country?: string;
|
|
63
|
+
region?: string;
|
|
64
|
+
city?: string;
|
|
65
|
+
zip?: string;
|
|
66
|
+
timezone?: string;
|
|
67
|
+
os?: string;
|
|
68
|
+
osVersion?: string;
|
|
69
|
+
screenSize?: string;
|
|
70
|
+
ip?: string;
|
|
71
|
+
internal?: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Version
|
|
75
|
+
interface Version extends Properties {
|
|
76
|
+
source: string;
|
|
77
|
+
tagging: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Source
|
|
81
|
+
type SourceType = 'web' | 'server' | 'app' | 'other' | string;
|
|
82
|
+
|
|
83
|
+
interface Source extends Properties {
|
|
84
|
+
type: SourceType;
|
|
85
|
+
id: string;
|
|
86
|
+
previous_id: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Entity
|
|
90
|
+
type Entities = Array<Entity>;
|
|
91
|
+
|
|
92
|
+
interface Entity {
|
|
93
|
+
entity: string;
|
|
94
|
+
data: Properties;
|
|
95
|
+
nested: Entities;
|
|
96
|
+
context: OrderedProperties;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Event
|
|
100
|
+
interface Event {
|
|
101
|
+
name: string;
|
|
102
|
+
data: Properties;
|
|
103
|
+
context: OrderedProperties;
|
|
104
|
+
globals: Properties;
|
|
105
|
+
custom: Properties;
|
|
106
|
+
user: User;
|
|
107
|
+
nested: Entities;
|
|
108
|
+
consent: Consent;
|
|
109
|
+
id: string;
|
|
110
|
+
trigger: string;
|
|
111
|
+
entity: string;
|
|
112
|
+
action: string;
|
|
113
|
+
timestamp: number;
|
|
114
|
+
timing: number;
|
|
115
|
+
group: string;
|
|
116
|
+
count: number;
|
|
117
|
+
version: Version;
|
|
118
|
+
source: Source;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
type DeepPartialEvent = DeepPartial<Event>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Mapping Types
|
|
125
|
+
declare namespace Mapping {
|
|
126
|
+
type ValueType = string | ValueConfig;
|
|
127
|
+
type Value = ValueType | Array<ValueType>;
|
|
128
|
+
type Values = Array<Value>;
|
|
129
|
+
|
|
130
|
+
interface ValueConfig {
|
|
131
|
+
condition?: Condition;
|
|
132
|
+
consent?: WalkerOS.Consent;
|
|
133
|
+
fn?: Fn;
|
|
134
|
+
key?: string;
|
|
135
|
+
loop?: Loop;
|
|
136
|
+
map?: Map;
|
|
137
|
+
set?: Value[];
|
|
138
|
+
validate?: Validate;
|
|
139
|
+
value?: WalkerOS.PropertyType;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type Loop = [Value, Value];
|
|
143
|
+
|
|
144
|
+
type Map = {
|
|
145
|
+
[key: string]: Value;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
interface Options {
|
|
149
|
+
consent?: WalkerOS.Consent;
|
|
150
|
+
collector?: Collector.Instance;
|
|
151
|
+
props?: unknown;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
type Condition = (
|
|
155
|
+
value: WalkerOS.DeepPartialEvent | unknown,
|
|
156
|
+
mapping?: Value,
|
|
157
|
+
collector?: Collector.Instance
|
|
158
|
+
) => WalkerOS.PromiseOrValue<boolean>;
|
|
159
|
+
|
|
160
|
+
type Fn = (
|
|
161
|
+
value: WalkerOS.DeepPartialEvent | unknown,
|
|
162
|
+
mapping: Value,
|
|
163
|
+
options: Options
|
|
164
|
+
) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;
|
|
165
|
+
|
|
166
|
+
type Validate = (value?: unknown) => WalkerOS.PromiseOrValue<boolean>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Collector Types (minimal for fn context)
|
|
170
|
+
declare namespace Collector {
|
|
171
|
+
interface Instance {
|
|
172
|
+
push: any;
|
|
173
|
+
command: any;
|
|
174
|
+
allowed: boolean;
|
|
175
|
+
config: any;
|
|
176
|
+
consent: WalkerOS.Consent;
|
|
177
|
+
count: number;
|
|
178
|
+
custom: WalkerOS.Properties;
|
|
179
|
+
globals: WalkerOS.Properties;
|
|
180
|
+
group: string;
|
|
181
|
+
queue: any[];
|
|
182
|
+
round: number;
|
|
183
|
+
session: any;
|
|
184
|
+
timing: number;
|
|
185
|
+
user: WalkerOS.User;
|
|
186
|
+
version: string;
|
|
187
|
+
[key: string]: any;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Parameter declarations for fn context
|
|
192
|
+
declare const value: WalkerOS.DeepPartialEvent | unknown;
|
|
193
|
+
declare const mapping: Mapping.Value;
|
|
194
|
+
declare const options: Mapping.Options;
|
|
195
|
+
`;
|
|
196
|
+
/**
|
|
197
|
+
* Type template for 'condition' context (conditional functions)
|
|
198
|
+
*
|
|
199
|
+
* Provides types for:
|
|
200
|
+
* - value: WalkerOS.DeepPartialEvent | unknown
|
|
201
|
+
* - mapping: Mapping.Value
|
|
202
|
+
* - collector: Collector.Instance | undefined
|
|
203
|
+
*/
|
|
204
|
+
export const CONDITION_CONTEXT_TYPES = `
|
|
205
|
+
// WalkerOS Core Types
|
|
206
|
+
declare namespace WalkerOS {
|
|
207
|
+
// Utility types
|
|
208
|
+
type DeepPartial<T> = {
|
|
209
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
213
|
+
|
|
214
|
+
// Property types
|
|
215
|
+
type PropertyType = boolean | string | number | {
|
|
216
|
+
[key: string]: Property;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
type Property = PropertyType | Array<PropertyType>;
|
|
220
|
+
|
|
221
|
+
interface Properties {
|
|
222
|
+
[key: string]: Property | undefined;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
interface OrderedProperties {
|
|
226
|
+
[key: string]: [Property, number] | undefined;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Consent
|
|
230
|
+
interface Consent {
|
|
231
|
+
[name: string]: boolean;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// User
|
|
235
|
+
interface User extends Properties {
|
|
236
|
+
id?: string;
|
|
237
|
+
device?: string;
|
|
238
|
+
session?: string;
|
|
239
|
+
hash?: string;
|
|
240
|
+
address?: string;
|
|
241
|
+
email?: string;
|
|
242
|
+
phone?: string;
|
|
243
|
+
userAgent?: string;
|
|
244
|
+
browser?: string;
|
|
245
|
+
browserVersion?: string;
|
|
246
|
+
deviceType?: string;
|
|
247
|
+
language?: string;
|
|
248
|
+
country?: string;
|
|
249
|
+
region?: string;
|
|
250
|
+
city?: string;
|
|
251
|
+
zip?: string;
|
|
252
|
+
timezone?: string;
|
|
253
|
+
os?: string;
|
|
254
|
+
osVersion?: string;
|
|
255
|
+
screenSize?: string;
|
|
256
|
+
ip?: string;
|
|
257
|
+
internal?: boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Version
|
|
261
|
+
interface Version extends Properties {
|
|
262
|
+
source: string;
|
|
263
|
+
tagging: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Source
|
|
267
|
+
type SourceType = 'web' | 'server' | 'app' | 'other' | string;
|
|
268
|
+
|
|
269
|
+
interface Source extends Properties {
|
|
270
|
+
type: SourceType;
|
|
271
|
+
id: string;
|
|
272
|
+
previous_id: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Entity
|
|
276
|
+
type Entities = Array<Entity>;
|
|
277
|
+
|
|
278
|
+
interface Entity {
|
|
279
|
+
entity: string;
|
|
280
|
+
data: Properties;
|
|
281
|
+
nested: Entities;
|
|
282
|
+
context: OrderedProperties;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Event
|
|
286
|
+
interface Event {
|
|
287
|
+
name: string;
|
|
288
|
+
data: Properties;
|
|
289
|
+
context: OrderedProperties;
|
|
290
|
+
globals: Properties;
|
|
291
|
+
custom: Properties;
|
|
292
|
+
user: User;
|
|
293
|
+
nested: Entities;
|
|
294
|
+
consent: Consent;
|
|
295
|
+
id: string;
|
|
296
|
+
trigger: string;
|
|
297
|
+
entity: string;
|
|
298
|
+
action: string;
|
|
299
|
+
timestamp: number;
|
|
300
|
+
timing: number;
|
|
301
|
+
group: string;
|
|
302
|
+
count: number;
|
|
303
|
+
version: Version;
|
|
304
|
+
source: Source;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
type DeepPartialEvent = DeepPartial<Event>;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Mapping Types
|
|
311
|
+
declare namespace Mapping {
|
|
312
|
+
type ValueType = string | ValueConfig;
|
|
313
|
+
type Value = ValueType | Array<ValueType>;
|
|
314
|
+
|
|
315
|
+
interface ValueConfig {
|
|
316
|
+
condition?: Condition;
|
|
317
|
+
consent?: WalkerOS.Consent;
|
|
318
|
+
fn?: Fn;
|
|
319
|
+
key?: string;
|
|
320
|
+
loop?: Loop;
|
|
321
|
+
map?: Map;
|
|
322
|
+
set?: Value[];
|
|
323
|
+
validate?: Validate;
|
|
324
|
+
value?: WalkerOS.PropertyType;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
type Loop = [Value, Value];
|
|
328
|
+
|
|
329
|
+
type Map = {
|
|
330
|
+
[key: string]: Value;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
type Condition = (
|
|
334
|
+
value: WalkerOS.DeepPartialEvent | unknown,
|
|
335
|
+
mapping?: Value,
|
|
336
|
+
collector?: Collector.Instance
|
|
337
|
+
) => WalkerOS.PromiseOrValue<boolean>;
|
|
338
|
+
|
|
339
|
+
type Fn = (
|
|
340
|
+
value: WalkerOS.DeepPartialEvent | unknown,
|
|
341
|
+
mapping: Value,
|
|
342
|
+
options: any
|
|
343
|
+
) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;
|
|
344
|
+
|
|
345
|
+
type Validate = (value?: unknown) => WalkerOS.PromiseOrValue<boolean>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Collector Types (full interface for condition context)
|
|
349
|
+
declare namespace Collector {
|
|
350
|
+
interface SessionData extends WalkerOS.Properties {
|
|
351
|
+
isStart: boolean;
|
|
352
|
+
storage: boolean;
|
|
353
|
+
id?: string;
|
|
354
|
+
start?: number;
|
|
355
|
+
marketing?: true;
|
|
356
|
+
updated?: number;
|
|
357
|
+
isNew?: boolean;
|
|
358
|
+
device?: string;
|
|
359
|
+
count?: number;
|
|
360
|
+
runs?: number;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface Config {
|
|
364
|
+
run?: boolean;
|
|
365
|
+
tagging: number;
|
|
366
|
+
globalsStatic: WalkerOS.Properties;
|
|
367
|
+
sessionStatic: Partial<SessionData>;
|
|
368
|
+
verbose: boolean;
|
|
369
|
+
onError?: any;
|
|
370
|
+
onLog?: any;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface Instance {
|
|
374
|
+
push: any;
|
|
375
|
+
command: any;
|
|
376
|
+
allowed: boolean;
|
|
377
|
+
config: Config;
|
|
378
|
+
consent: WalkerOS.Consent;
|
|
379
|
+
count: number;
|
|
380
|
+
custom: WalkerOS.Properties;
|
|
381
|
+
sources: any;
|
|
382
|
+
destinations: any;
|
|
383
|
+
globals: WalkerOS.Properties;
|
|
384
|
+
group: string;
|
|
385
|
+
hooks: any;
|
|
386
|
+
on: any;
|
|
387
|
+
queue: any[];
|
|
388
|
+
round: number;
|
|
389
|
+
session: undefined | SessionData;
|
|
390
|
+
timing: number;
|
|
391
|
+
user: WalkerOS.User;
|
|
392
|
+
version: string;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Parameter declarations for condition context
|
|
397
|
+
declare const value: WalkerOS.DeepPartialEvent | unknown;
|
|
398
|
+
declare const mapping: Mapping.Value;
|
|
399
|
+
declare const collector: Collector.Instance | undefined;
|
|
400
|
+
`;
|
|
401
|
+
/**
|
|
402
|
+
* Type template for 'validate' context (validation functions)
|
|
403
|
+
*
|
|
404
|
+
* Provides types for:
|
|
405
|
+
* - value: unknown
|
|
406
|
+
*/
|
|
407
|
+
export const VALIDATE_CONTEXT_TYPES = `
|
|
408
|
+
// Parameter declaration for validate context
|
|
409
|
+
declare const value: unknown;
|
|
410
|
+
`;
|
|
411
|
+
/**
|
|
412
|
+
* Get the type template for a specific function context
|
|
413
|
+
*/
|
|
414
|
+
export function getContextTypes(contextType) {
|
|
415
|
+
switch (contextType) {
|
|
416
|
+
case 'fn':
|
|
417
|
+
return FN_CONTEXT_TYPES;
|
|
418
|
+
case 'condition':
|
|
419
|
+
return CONDITION_CONTEXT_TYPES;
|
|
420
|
+
case 'validate':
|
|
421
|
+
return VALIDATE_CONTEXT_TYPES;
|
|
422
|
+
default:
|
|
423
|
+
return '';
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
//# sourceMappingURL=monaco-context-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco-context-types.js","sourceRoot":"","sources":["../../src/utils/monaco-context-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiL/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoMtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;CAGrC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,WAA4C;IAE5C,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,IAAI;YACP,OAAO,gBAAgB,CAAC;QAC1B,KAAK,WAAW;YACd,OAAO,uBAAuB,CAAC;QACjC,KAAK,UAAU;YACb,OAAO,sBAAsB,CAAC;QAChC;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { editor } from 'monaco-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Apply decorations to highlight walkerOS data attributes in Monaco editor
|
|
4
|
+
*
|
|
5
|
+
* This function scans the editor content for data-elb* attributes and
|
|
6
|
+
* applies color highlighting to match the website's Prism.js styling.
|
|
7
|
+
*
|
|
8
|
+
* @param editor - Monaco editor instance
|
|
9
|
+
* @param monaco - Monaco module
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyDataElbDecorations(monacoEditor: editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor')): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Register CSS styles for data-elb attribute decorations
|
|
14
|
+
* Call this once during app initialization
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerDataElbStyles(): void;
|
|
17
|
+
//# sourceMappingURL=monaco-decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monaco-decorators.d.ts","sourceRoot":"","sources":["../../src/utils/monaco-decorators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAe5C;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,CAAC,qBAAqB,EAC1C,MAAM,EAAE,cAAc,eAAe,CAAC,GACrC,MAAM,IAAI,CAsDZ;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,SAcpC"}
|