@powerhousedao/builder-tools 6.0.0-dev.8 → 6.0.0-dev.81
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/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/connect-utils/helpers.d.ts +1 -1
- package/dist/connect-utils/helpers.d.ts.map +1 -1
- package/dist/connect-utils/index.d.ts +0 -1
- package/dist/connect-utils/index.d.ts.map +1 -1
- package/dist/connect-utils/types.d.ts +0 -1
- package/dist/connect-utils/types.d.ts.map +1 -1
- package/dist/connect-utils/vite-config.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +111925 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -114
- package/dist/browser.d.ts +0 -2
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js +0 -2
- package/dist/browser.js.map +0 -1
- package/dist/connect-build/build.d.ts +0 -6
- package/dist/connect-build/build.d.ts.map +0 -1
- package/dist/connect-build/build.js +0 -54
- package/dist/connect-build/build.js.map +0 -1
- package/dist/connect-build/constants.d.ts +0 -11
- package/dist/connect-build/constants.d.ts.map +0 -1
- package/dist/connect-build/constants.js +0 -11
- package/dist/connect-build/constants.js.map +0 -1
- package/dist/connect-build/helpers.d.ts +0 -37
- package/dist/connect-build/helpers.d.ts.map +0 -1
- package/dist/connect-build/helpers.js +0 -111
- package/dist/connect-build/helpers.js.map +0 -1
- package/dist/connect-build/index.d.ts +0 -5
- package/dist/connect-build/index.d.ts.map +0 -1
- package/dist/connect-build/index.js +0 -4
- package/dist/connect-build/index.js.map +0 -1
- package/dist/connect-build/preview.d.ts +0 -3
- package/dist/connect-build/preview.d.ts.map +0 -1
- package/dist/connect-build/preview.js +0 -19
- package/dist/connect-build/preview.js.map +0 -1
- package/dist/connect-build/types.d.ts +0 -27
- package/dist/connect-build/types.d.ts.map +0 -1
- package/dist/connect-build/types.js +0 -2
- package/dist/connect-build/types.js.map +0 -1
- package/dist/connect-studio/index.d.ts +0 -3
- package/dist/connect-studio/index.d.ts.map +0 -1
- package/dist/connect-studio/index.js +0 -2
- package/dist/connect-studio/index.js.map +0 -1
- package/dist/connect-studio/server.d.ts +0 -3
- package/dist/connect-studio/server.d.ts.map +0 -1
- package/dist/connect-studio/server.js +0 -234
- package/dist/connect-studio/server.js.map +0 -1
- package/dist/connect-studio/studio.d.ts +0 -3
- package/dist/connect-studio/studio.d.ts.map +0 -1
- package/dist/connect-studio/studio.js +0 -66
- package/dist/connect-studio/studio.js.map +0 -1
- package/dist/connect-studio/types.d.ts +0 -28
- package/dist/connect-studio/types.d.ts.map +0 -1
- package/dist/connect-studio/types.js +0 -2
- package/dist/connect-studio/types.js.map +0 -1
- package/dist/connect-utils/build.js +0 -21
- package/dist/connect-utils/build.js.map +0 -1
- package/dist/connect-utils/constants.js +0 -5
- package/dist/connect-utils/constants.js.map +0 -1
- package/dist/connect-utils/env-config.d.ts +0 -844
- package/dist/connect-utils/env-config.d.ts.map +0 -1
- package/dist/connect-utils/env-config.js +0 -518
- package/dist/connect-utils/env-config.js.map +0 -1
- package/dist/connect-utils/helpers.js +0 -265
- package/dist/connect-utils/helpers.js.map +0 -1
- package/dist/connect-utils/index.js +0 -16
- package/dist/connect-utils/index.js.map +0 -1
- package/dist/connect-utils/preview.js +0 -33
- package/dist/connect-utils/preview.js.map +0 -1
- package/dist/connect-utils/studio.js +0 -30
- package/dist/connect-utils/studio.js.map +0 -1
- package/dist/connect-utils/types.js +0 -2
- package/dist/connect-utils/types.js.map +0 -1
- package/dist/connect-utils/vite-config.js +0 -267
- package/dist/connect-utils/vite-config.js.map +0 -1
- package/dist/connect-utils/vite-plugins/base.js +0 -130
- package/dist/connect-utils/vite-plugins/base.js.map +0 -1
- package/dist/connect-utils/vite-plugins/document-models-hmr.js +0 -62
- package/dist/connect-utils/vite-plugins/document-models-hmr.js.map +0 -1
- package/dist/connect-utils/vite-plugins/editors-hmr.js +0 -61
- package/dist/connect-utils/vite-plugins/editors-hmr.js.map +0 -1
- package/dist/connect-utils/vite-plugins/external-packages.js +0 -127
- package/dist/connect-utils/vite-plugins/external-packages.js.map +0 -1
- package/dist/connect-utils/vite-plugins/importmap.js +0 -243
- package/dist/connect-utils/vite-plugins/importmap.js.map +0 -1
- package/dist/connect-utils/vite-plugins/ph-external-packages.js +0 -88
- package/dist/connect-utils/vite-plugins/ph-external-packages.js.map +0 -1
- package/dist/connect-utils/vite-plugins/studio.js +0 -33
- package/dist/connect-utils/vite-plugins/studio.js.map +0 -1
- package/dist/document-model-editor/components/button.d.ts +0 -2
- package/dist/document-model-editor/components/button.d.ts.map +0 -1
- package/dist/document-model-editor/components/button.js +0 -8
- package/dist/document-model-editor/components/button.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/constants.d.ts +0 -3
- package/dist/document-model-editor/components/code-editors/constants.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/constants.js +0 -38
- package/dist/document-model-editor/components/code-editors/constants.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/factories.d.ts +0 -4
- package/dist/document-model-editor/components/code-editors/factories.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/factories.js +0 -47
- package/dist/document-model-editor/components/code-editors/factories.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/graphql-editor.d.ts +0 -10
- package/dist/document-model-editor/components/code-editors/graphql-editor.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/graphql-editor.js +0 -73
- package/dist/document-model-editor/components/code-editors/graphql-editor.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/hooks.d.ts +0 -23
- package/dist/document-model-editor/components/code-editors/hooks.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/hooks.js +0 -59
- package/dist/document-model-editor/components/code-editors/hooks.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/json-editor.d.ts +0 -8
- package/dist/document-model-editor/components/code-editors/json-editor.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/json-editor.js +0 -47
- package/dist/document-model-editor/components/code-editors/json-editor.js.map +0 -1
- package/dist/document-model-editor/components/code-editors/linting.d.ts +0 -6
- package/dist/document-model-editor/components/code-editors/linting.d.ts.map +0 -1
- package/dist/document-model-editor/components/code-editors/linting.js +0 -59
- package/dist/document-model-editor/components/code-editors/linting.js.map +0 -1
- package/dist/document-model-editor/components/divider.d.ts +0 -8
- package/dist/document-model-editor/components/divider.d.ts.map +0 -1
- package/dist/document-model-editor/components/divider.js +0 -22
- package/dist/document-model-editor/components/divider.js.map +0 -1
- package/dist/document-model-editor/components/errors.d.ts +0 -6
- package/dist/document-model-editor/components/errors.d.ts.map +0 -1
- package/dist/document-model-editor/components/errors.js +0 -5
- package/dist/document-model-editor/components/errors.js.map +0 -1
- package/dist/document-model-editor/components/form.d.ts +0 -12
- package/dist/document-model-editor/components/form.d.ts.map +0 -1
- package/dist/document-model-editor/components/form.js +0 -43
- package/dist/document-model-editor/components/form.js.map +0 -1
- package/dist/document-model-editor/components/input.d.ts +0 -6
- package/dist/document-model-editor/components/input.d.ts.map +0 -1
- package/dist/document-model-editor/components/input.js +0 -9
- package/dist/document-model-editor/components/input.js.map +0 -1
- package/dist/document-model-editor/components/label.d.ts +0 -6
- package/dist/document-model-editor/components/label.d.ts.map +0 -1
- package/dist/document-model-editor/components/label.js +0 -10
- package/dist/document-model-editor/components/label.js.map +0 -1
- package/dist/document-model-editor/components/model-metadata-form.d.ts +0 -31
- package/dist/document-model-editor/components/model-metadata-form.d.ts.map +0 -1
- package/dist/document-model-editor/components/model-metadata-form.js +0 -70
- package/dist/document-model-editor/components/model-metadata-form.js.map +0 -1
- package/dist/document-model-editor/components/module-form.d.ts +0 -10
- package/dist/document-model-editor/components/module-form.d.ts.map +0 -1
- package/dist/document-model-editor/components/module-form.js +0 -22
- package/dist/document-model-editor/components/module-form.js.map +0 -1
- package/dist/document-model-editor/components/module.d.ts +0 -22
- package/dist/document-model-editor/components/module.d.ts.map +0 -1
- package/dist/document-model-editor/components/module.js +0 -10
- package/dist/document-model-editor/components/module.js.map +0 -1
- package/dist/document-model-editor/components/modules.d.ts +0 -20
- package/dist/document-model-editor/components/modules.d.ts.map +0 -1
- package/dist/document-model-editor/components/modules.js +0 -17
- package/dist/document-model-editor/components/modules.js.map +0 -1
- package/dist/document-model-editor/components/operation-description-form.d.ts +0 -9
- package/dist/document-model-editor/components/operation-description-form.d.ts.map +0 -1
- package/dist/document-model-editor/components/operation-description-form.js +0 -13
- package/dist/document-model-editor/components/operation-description-form.js.map +0 -1
- package/dist/document-model-editor/components/operation-error-form.d.ts +0 -13
- package/dist/document-model-editor/components/operation-error-form.d.ts.map +0 -1
- package/dist/document-model-editor/components/operation-error-form.js +0 -40
- package/dist/document-model-editor/components/operation-error-form.js.map +0 -1
- package/dist/document-model-editor/components/operation-errors.d.ts +0 -10
- package/dist/document-model-editor/components/operation-errors.d.ts.map +0 -1
- package/dist/document-model-editor/components/operation-errors.js +0 -17
- package/dist/document-model-editor/components/operation-errors.js.map +0 -1
- package/dist/document-model-editor/components/operation-form.d.ts +0 -13
- package/dist/document-model-editor/components/operation-form.d.ts.map +0 -1
- package/dist/document-model-editor/components/operation-form.js +0 -37
- package/dist/document-model-editor/components/operation-form.js.map +0 -1
- package/dist/document-model-editor/components/operation.d.ts +0 -23
- package/dist/document-model-editor/components/operation.d.ts.map +0 -1
- package/dist/document-model-editor/components/operation.js +0 -25
- package/dist/document-model-editor/components/operation.js.map +0 -1
- package/dist/document-model-editor/components/operations.d.ts +0 -18
- package/dist/document-model-editor/components/operations.d.ts.map +0 -1
- package/dist/document-model-editor/components/operations.js +0 -20
- package/dist/document-model-editor/components/operations.js.map +0 -1
- package/dist/document-model-editor/components/state-error.d.ts +0 -5
- package/dist/document-model-editor/components/state-error.d.ts.map +0 -1
- package/dist/document-model-editor/components/state-error.js +0 -21
- package/dist/document-model-editor/components/state-error.js.map +0 -1
- package/dist/document-model-editor/components/state-schemas.d.ts +0 -15
- package/dist/document-model-editor/components/state-schemas.d.ts.map +0 -1
- package/dist/document-model-editor/components/state-schemas.js +0 -81
- package/dist/document-model-editor/components/state-schemas.js.map +0 -1
- package/dist/document-model-editor/components/tabs.d.ts +0 -8
- package/dist/document-model-editor/components/tabs.d.ts.map +0 -1
- package/dist/document-model-editor/components/tabs.js +0 -13
- package/dist/document-model-editor/components/tabs.js.map +0 -1
- package/dist/document-model-editor/components/text-area.d.ts +0 -9
- package/dist/document-model-editor/components/text-area.d.ts.map +0 -1
- package/dist/document-model-editor/components/text-area.js +0 -27
- package/dist/document-model-editor/components/text-area.js.map +0 -1
- package/dist/document-model-editor/components/text-field.d.ts +0 -21
- package/dist/document-model-editor/components/text-field.d.ts.map +0 -1
- package/dist/document-model-editor/components/text-field.js +0 -80
- package/dist/document-model-editor/components/text-field.js.map +0 -1
- package/dist/document-model-editor/config.d.ts +0 -3
- package/dist/document-model-editor/config.d.ts.map +0 -1
- package/dist/document-model-editor/config.js +0 -4
- package/dist/document-model-editor/config.js.map +0 -1
- package/dist/document-model-editor/constants/documents.d.ts +0 -13
- package/dist/document-model-editor/constants/documents.d.ts.map +0 -1
- package/dist/document-model-editor/constants/documents.js +0 -18
- package/dist/document-model-editor/constants/documents.js.map +0 -1
- package/dist/document-model-editor/constants/graphql-kinds.d.ts +0 -9
- package/dist/document-model-editor/constants/graphql-kinds.d.ts.map +0 -1
- package/dist/document-model-editor/constants/graphql-kinds.js +0 -13
- package/dist/document-model-editor/constants/graphql-kinds.js.map +0 -1
- package/dist/document-model-editor/context/form-context.d.ts +0 -11
- package/dist/document-model-editor/context/form-context.d.ts.map +0 -1
- package/dist/document-model-editor/context/form-context.js +0 -4
- package/dist/document-model-editor/context/form-context.js.map +0 -1
- package/dist/document-model-editor/context/schema-context.d.ts +0 -18
- package/dist/document-model-editor/context/schema-context.d.ts.map +0 -1
- package/dist/document-model-editor/context/schema-context.js +0 -129
- package/dist/document-model-editor/context/schema-context.js.map +0 -1
- package/dist/document-model-editor/document-model-editor.stories.d.ts +0 -8
- package/dist/document-model-editor/document-model-editor.stories.d.ts.map +0 -1
- package/dist/document-model-editor/document-model-editor.stories.js +0 -267
- package/dist/document-model-editor/document-model-editor.stories.js.map +0 -1
- package/dist/document-model-editor/editor.d.ts +0 -2
- package/dist/document-model-editor/editor.d.ts.map +0 -1
- package/dist/document-model-editor/editor.js +0 -217
- package/dist/document-model-editor/editor.js.map +0 -1
- package/dist/document-model-editor/hooks/index.d.ts +0 -3
- package/dist/document-model-editor/hooks/index.d.ts.map +0 -1
- package/dist/document-model-editor/hooks/index.js +0 -3
- package/dist/document-model-editor/hooks/index.js.map +0 -1
- package/dist/document-model-editor/hooks/useDocumentModelDocument.d.ts +0 -5
- package/dist/document-model-editor/hooks/useDocumentModelDocument.d.ts.map +0 -1
- package/dist/document-model-editor/hooks/useDocumentModelDocument.js +0 -8
- package/dist/document-model-editor/hooks/useDocumentModelDocument.js.map +0 -1
- package/dist/document-model-editor/hooks/useFormField.d.ts +0 -13
- package/dist/document-model-editor/hooks/useFormField.d.ts.map +0 -1
- package/dist/document-model-editor/hooks/useFormField.js +0 -22
- package/dist/document-model-editor/hooks/useFormField.js.map +0 -1
- package/dist/document-model-editor/index.d.ts +0 -2
- package/dist/document-model-editor/index.d.ts.map +0 -1
- package/dist/document-model-editor/index.js +0 -2
- package/dist/document-model-editor/index.js.map +0 -1
- package/dist/document-model-editor/module.d.ts +0 -3
- package/dist/document-model-editor/module.d.ts.map +0 -1
- package/dist/document-model-editor/module.js +0 -10
- package/dist/document-model-editor/module.js.map +0 -1
- package/dist/document-model-editor/schemas/inputs.d.ts +0 -25
- package/dist/document-model-editor/schemas/inputs.d.ts.map +0 -1
- package/dist/document-model-editor/schemas/inputs.js +0 -71
- package/dist/document-model-editor/schemas/inputs.js.map +0 -1
- package/dist/document-model-editor/schemas/utils.d.ts +0 -3
- package/dist/document-model-editor/schemas/utils.d.ts.map +0 -1
- package/dist/document-model-editor/schemas/utils.js +0 -3
- package/dist/document-model-editor/schemas/utils.js.map +0 -1
- package/dist/document-model-editor/types/documents.d.ts +0 -26
- package/dist/document-model-editor/types/documents.d.ts.map +0 -1
- package/dist/document-model-editor/types/documents.js +0 -2
- package/dist/document-model-editor/types/documents.js.map +0 -1
- package/dist/document-model-editor/types.d.ts +0 -2
- package/dist/document-model-editor/types.d.ts.map +0 -1
- package/dist/document-model-editor/types.js +0 -2
- package/dist/document-model-editor/types.js.map +0 -1
- package/dist/document-model-editor/utils/helpers.d.ts +0 -112
- package/dist/document-model-editor/utils/helpers.d.ts.map +0 -1
- package/dist/document-model-editor/utils/helpers.js +0 -920
- package/dist/document-model-editor/utils/helpers.js.map +0 -1
- package/dist/document-model-editor/utils/linting.d.ts +0 -7
- package/dist/document-model-editor/utils/linting.d.ts.map +0 -1
- package/dist/document-model-editor/utils/linting.js +0 -49
- package/dist/document-model-editor/utils/linting.js.map +0 -1
- package/dist/document-model-editor/utils/style.d.ts +0 -3
- package/dist/document-model-editor/utils/style.d.ts.map +0 -1
- package/dist/document-model-editor/utils/style.js +0 -6
- package/dist/document-model-editor/utils/style.js.map +0 -1
- package/dist/editor-utils/components/documentEditor.d.ts +0 -7
- package/dist/editor-utils/components/documentEditor.d.ts.map +0 -1
- package/dist/editor-utils/components/documentEditor.js +0 -6
- package/dist/editor-utils/components/documentEditor.js.map +0 -1
- package/dist/editor-utils/components/editorToolbar.d.ts +0 -11
- package/dist/editor-utils/components/editorToolbar.d.ts.map +0 -1
- package/dist/editor-utils/components/editorToolbar.js +0 -6
- package/dist/editor-utils/components/editorToolbar.js.map +0 -1
- package/dist/editor-utils/components/editorWorksheet.d.ts +0 -7
- package/dist/editor-utils/components/editorWorksheet.d.ts.map +0 -1
- package/dist/editor-utils/components/editorWorksheet.js +0 -5
- package/dist/editor-utils/components/editorWorksheet.js.map +0 -1
- package/dist/editor-utils/components/index.d.ts +0 -9
- package/dist/editor-utils/components/index.d.ts.map +0 -1
- package/dist/editor-utils/components/index.js +0 -10
- package/dist/editor-utils/components/index.js.map +0 -1
- package/dist/editor-utils/components/styles.d.ts +0 -40
- package/dist/editor-utils/components/styles.d.ts.map +0 -1
- package/dist/editor-utils/components/styles.js +0 -79
- package/dist/editor-utils/components/styles.js.map +0 -1
- package/dist/editor-utils/components/stylesVariant.d.ts +0 -40
- package/dist/editor-utils/components/stylesVariant.d.ts.map +0 -1
- package/dist/editor-utils/components/stylesVariant.js +0 -89
- package/dist/editor-utils/components/stylesVariant.js.map +0 -1
- package/dist/editor-utils/components/textInput.d.ts +0 -20
- package/dist/editor-utils/components/textInput.d.ts.map +0 -1
- package/dist/editor-utils/components/textInput.js +0 -84
- package/dist/editor-utils/components/textInput.js.map +0 -1
- package/dist/editor-utils/components/textInputVariant.d.ts +0 -21
- package/dist/editor-utils/components/textInputVariant.d.ts.map +0 -1
- package/dist/editor-utils/components/textInputVariant.js +0 -93
- package/dist/editor-utils/components/textInputVariant.js.map +0 -1
- package/dist/editor-utils/components/toolbarButton.d.ts +0 -7
- package/dist/editor-utils/components/toolbarButton.d.ts.map +0 -1
- package/dist/editor-utils/components/toolbarButton.js +0 -9
- package/dist/editor-utils/components/toolbarButton.js.map +0 -1
- package/dist/editor-utils/hooks/index.d.ts +0 -2
- package/dist/editor-utils/hooks/index.d.ts.map +0 -1
- package/dist/editor-utils/hooks/index.js +0 -2
- package/dist/editor-utils/hooks/index.js.map +0 -1
- package/dist/editor-utils/hooks/useEnsInfo.d.ts +0 -15
- package/dist/editor-utils/hooks/useEnsInfo.d.ts.map +0 -1
- package/dist/editor-utils/hooks/useEnsInfo.js +0 -64
- package/dist/editor-utils/hooks/useEnsInfo.js.map +0 -1
- package/dist/editor-utils/index.d.ts +0 -5
- package/dist/editor-utils/index.d.ts.map +0 -1
- package/dist/editor-utils/index.js +0 -5
- package/dist/editor-utils/index.js.map +0 -1
- package/dist/editor-utils/reducer.d.ts +0 -3
- package/dist/editor-utils/reducer.d.ts.map +0 -1
- package/dist/editor-utils/reducer.js +0 -25
- package/dist/editor-utils/reducer.js.map +0 -1
- package/dist/editor-utils/storybook.d.ts +0 -32
- package/dist/editor-utils/storybook.d.ts.map +0 -1
- package/dist/editor-utils/storybook.js +0 -104
- package/dist/editor-utils/storybook.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/style.css +0 -890
- package/dist/test/helpers.test.d.ts +0 -2
- package/dist/test/helpers.test.d.ts.map +0 -1
- package/dist/test/helpers.test.js +0 -805
- package/dist/test/helpers.test.js.map +0 -1
- package/dist/test/index.d.ts +0 -2
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/index.js +0 -2
- package/dist/test/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importmap.js","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/importmap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAW5C,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CACvC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CACvC,CAAC;AAEF;;;;;;;;GAQG;AACH,KAAK,UAAU,iBAAiB,CAC9B,UAAkB,EAClB,UAAkB,EAClB,OAAe;IAEf,MAAM,eAAe,GAAG,IAAI,GAAG,EAA4C,CAAC;IAE5E,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,cAAc;QAC7B,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,GAA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returns a js module that exports those packages for use in Connect.
|
|
5
|
-
*/
|
|
6
|
-
function makeImportScriptFromPackages(packages, localPackage) {
|
|
7
|
-
const packageImports = packages.map((pkg) => ({
|
|
8
|
-
name: pkg,
|
|
9
|
-
js: pkg,
|
|
10
|
-
css: pkg + "/style.css",
|
|
11
|
-
}));
|
|
12
|
-
if (localPackage) {
|
|
13
|
-
packageImports.push({
|
|
14
|
-
name: localPackage,
|
|
15
|
-
js: join(localPackage, "/index.ts"),
|
|
16
|
-
css: join(localPackage, "/style.css"),
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return `
|
|
20
|
-
export async function loadExternalPackages() {
|
|
21
|
-
const modules = [];
|
|
22
|
-
${packageImports
|
|
23
|
-
.map((pkg, index) => `try {
|
|
24
|
-
const module = await import('${pkg.js}');
|
|
25
|
-
await import('${pkg.css}');
|
|
26
|
-
modules.push({
|
|
27
|
-
id: 'module${index}',
|
|
28
|
-
...module,
|
|
29
|
-
upgradeManifests: module.upgradeManifests || [],
|
|
30
|
-
});
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error("Error loading package: '${pkg.name}'", error);
|
|
33
|
-
}`)
|
|
34
|
-
.join("\n")}
|
|
35
|
-
return modules;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
export function phExternalPackagesPlugin(phPackages, localPackage) {
|
|
40
|
-
const virtualModuleId = "virtual:ph:external-packages";
|
|
41
|
-
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
42
|
-
function isSameModule(moduleA, moduleB) {
|
|
43
|
-
return (moduleA === moduleB ||
|
|
44
|
-
moduleA.id === moduleB.id ||
|
|
45
|
-
moduleA.url === moduleB.url ||
|
|
46
|
-
(moduleA.file && moduleA.file === moduleB.file));
|
|
47
|
-
}
|
|
48
|
-
function isImported(module, rootModule) {
|
|
49
|
-
if (isSameModule(module, rootModule))
|
|
50
|
-
return true;
|
|
51
|
-
const importers = module.importers
|
|
52
|
-
.values()
|
|
53
|
-
.filter((m) => m.file && !m.file.endsWith(".html") && !m.file.endsWith(".css"));
|
|
54
|
-
if (importers.some((m) => isImported(m, rootModule)))
|
|
55
|
-
return true;
|
|
56
|
-
if (importers.some((m) => isImported(m, rootModule)))
|
|
57
|
-
return true;
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
const plugin = {
|
|
61
|
-
name: "ph-external-packages",
|
|
62
|
-
enforce: "pre",
|
|
63
|
-
resolveId(id) {
|
|
64
|
-
if (id === virtualModuleId) {
|
|
65
|
-
return resolvedVirtualModuleId;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
load(id) {
|
|
69
|
-
if (id === resolvedVirtualModuleId) {
|
|
70
|
-
return makeImportScriptFromPackages(phPackages, localPackage);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
handleHotUpdate(ctx) {
|
|
74
|
-
// Skip HMR for modules that are only imported by style.css
|
|
75
|
-
return ctx.modules.filter((mod) => {
|
|
76
|
-
if (mod.importers.size === 1) {
|
|
77
|
-
const importer = mod.importers.values().next().value;
|
|
78
|
-
if (importer?.url === "/style.css") {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
return plugin;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=ph-external-packages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ph-external-packages.js","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/ph-external-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;;GAGG;AACH,SAAS,4BAA4B,CACnC,QAAkB,EAClB,YAAqB;IAErB,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,EAAE,GAAG;QACT,EAA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AChB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { externalIds, viteIgnoreStaticImport } from "./base.js";
|
|
4
|
-
export function viteConnectDevStudioPlugin(enabled = false, connectPath, env) {
|
|
5
|
-
return [
|
|
6
|
-
enabled && viteIgnoreStaticImport(["react", "react-dom", ...externalIds]),
|
|
7
|
-
{
|
|
8
|
-
name: "vite-plugin-connect-dev-studio",
|
|
9
|
-
enforce: "pre",
|
|
10
|
-
config(config) {
|
|
11
|
-
if (!config.build) {
|
|
12
|
-
config.build = {};
|
|
13
|
-
}
|
|
14
|
-
if (!config.build.rollupOptions) {
|
|
15
|
-
config.build.rollupOptions = {};
|
|
16
|
-
}
|
|
17
|
-
if (!Array.isArray(config.build.rollupOptions.external)) {
|
|
18
|
-
config.build.rollupOptions.external = [];
|
|
19
|
-
}
|
|
20
|
-
if (enabled) {
|
|
21
|
-
config.build.rollupOptions.external.push(...externalIds);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
closeBundle() {
|
|
25
|
-
if (!enabled) {
|
|
26
|
-
// Copy the .env file to the dist folder
|
|
27
|
-
fs.copyFileSync(join(connectPath, "../.env"), join(connectPath, ".env"));
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=studio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"studio.js","sourceRoot":"","sources":["../../../connect-utils/vite-plugins/studio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEhE,MAAM,UAAU,0BAA0B,CACxC,OAAO,GAAG,KAAK,EACf,WAAmB,EACnB,GAA4B;IAE5B,OAAO;QACL,OAAO,IAAI,sBAAsB,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC;QACzE;YACE,IAAI,EAAE,gCAAgC;YACtC,OAAO,EAAE,KAAK;YACd,MAAM,CAAC,MAAM;gBACX,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;oBAClB,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;gBACpB,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;oBAChC,MAAM,CAAC,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC;gBAClC,CAAC;gBACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACxD,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,GAAG,EAAE,CAAC;gBAC3C,CAAC;gBAED,IAAI,OAAO,EAAE,CAAC;oBACZ,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;gBAC3D,CAAC;YACH,CAAC;YACD,WAAW;gBACT,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,wCAAwC;oBACxC,EAAE,CAAC,YAAY,CACb,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,EAC5B,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAC1B,CAAC;gBACJ,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
2
|
-
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../document-model-editor/components/button.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,0NAYjB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { cn } from "../utils/style.js";
|
|
4
|
-
export const Button = forwardRef((props, ref) => {
|
|
5
|
-
const { className, ...rest } = props;
|
|
6
|
-
return (_jsx("button", { ref: ref, ...rest, className: cn("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", className) }));
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../document-model-editor/components/button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAIvC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACxE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACrC,OAAO,CACL,iBACE,GAAG,EAAE,GAAG,KACJ,IAAI,EACR,SAAS,EAAE,EAAE,CACX,sSAAsS,EACtS,SAAS,CACV,GACD,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/constants.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,UAAU,yCAStB,CAAC;AAEF,eAAO,MAAM,oBAAoB,yCAmBhC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap, } from "@codemirror/autocomplete";
|
|
2
|
-
import { defaultKeymap, history, historyKeymap, indentWithTab, } from "@codemirror/commands";
|
|
3
|
-
import { bracketMatching, defaultHighlightStyle, foldGutter, foldKeymap, indentOnInput, syntaxHighlighting, } from "@codemirror/language";
|
|
4
|
-
import { lintKeymap } from "@codemirror/lint";
|
|
5
|
-
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
|
6
|
-
import { EditorState } from "@codemirror/state";
|
|
7
|
-
import { crosshairCursor, drawSelection, dropCursor, EditorView, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, lineNumbers, rectangularSelection, } from "@codemirror/view";
|
|
8
|
-
export const baseKeymap = [
|
|
9
|
-
...closeBracketsKeymap,
|
|
10
|
-
...defaultKeymap,
|
|
11
|
-
...searchKeymap,
|
|
12
|
-
...historyKeymap,
|
|
13
|
-
...foldKeymap,
|
|
14
|
-
...completionKeymap,
|
|
15
|
-
...lintKeymap,
|
|
16
|
-
indentWithTab,
|
|
17
|
-
];
|
|
18
|
-
export const baseEditorExtensions = [
|
|
19
|
-
lineNumbers(),
|
|
20
|
-
highlightActiveLineGutter(),
|
|
21
|
-
highlightSpecialChars(),
|
|
22
|
-
history(),
|
|
23
|
-
foldGutter(),
|
|
24
|
-
drawSelection(),
|
|
25
|
-
dropCursor(),
|
|
26
|
-
EditorState.allowMultipleSelections.of(true),
|
|
27
|
-
indentOnInput(),
|
|
28
|
-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
|
29
|
-
bracketMatching(),
|
|
30
|
-
closeBrackets(),
|
|
31
|
-
autocompletion(),
|
|
32
|
-
rectangularSelection(),
|
|
33
|
-
crosshairCursor(),
|
|
34
|
-
highlightActiveLine(),
|
|
35
|
-
highlightSelectionMatches(),
|
|
36
|
-
EditorView.lineWrapping,
|
|
37
|
-
];
|
|
38
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,OAAO,EACP,aAAa,EACb,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,mBAAmB;IACtB,GAAG,aAAa;IAChB,GAAG,YAAY;IACf,GAAG,aAAa;IAChB,GAAG,UAAU;IACb,GAAG,gBAAgB;IACnB,GAAG,UAAU;IACb,aAAa;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE;IACb,yBAAyB,EAAE;IAC3B,qBAAqB,EAAE;IACvB,OAAO,EAAE;IACT,UAAU,EAAE;IACZ,aAAa,EAAE;IACf,UAAU,EAAE;IACZ,WAAW,CAAC,uBAAuB,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5C,aAAa,EAAE;IACf,kBAAkB,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7D,eAAe,EAAE;IACjB,aAAa,EAAE;IACf,cAAc,EAAE;IAChB,oBAAoB,EAAE;IACtB,eAAe,EAAE;IACjB,mBAAmB,EAAE;IACrB,yBAAyB,EAAE;IAC3B,UAAU,CAAC,YAAY;CACxB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function makeUpdateHandler(readonly: boolean | undefined, timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>, updateDocumentInModel?: (newDoc: string) => void): import("@codemirror/state").Extension;
|
|
2
|
-
export declare function makeFocusHandler(readonly: boolean | undefined, timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>, updateDocumentInModel?: (newDoc: string) => void): import("@codemirror/state").Extension;
|
|
3
|
-
export declare function makePasteHandler(readonly: boolean | undefined, timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>, updateDocumentInModel?: (newDoc: string) => void): import("@codemirror/state").Extension;
|
|
4
|
-
//# sourceMappingURL=factories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/factories.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,EACzD,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,yCAoBjD;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,EACzD,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,yCAWjD;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,EACzD,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,yCAcjD"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { forceLinting } from "@codemirror/lint";
|
|
2
|
-
import { Transaction } from "@codemirror/state";
|
|
3
|
-
import { EditorView } from "@codemirror/view";
|
|
4
|
-
import { updateTimeout } from "../../constants/documents.js";
|
|
5
|
-
export function makeUpdateHandler(readonly, timeoutRef, updateDocumentInModel) {
|
|
6
|
-
return EditorView.updateListener.of((update) => {
|
|
7
|
-
if (!!readonly || !update.docChanged)
|
|
8
|
-
return;
|
|
9
|
-
if (update.transactions.some((tr) => tr.annotation(Transaction.userEvent) === "external"))
|
|
10
|
-
return;
|
|
11
|
-
const newDoc = update.state.doc.toString();
|
|
12
|
-
if (timeoutRef.current) {
|
|
13
|
-
clearTimeout(timeoutRef.current);
|
|
14
|
-
}
|
|
15
|
-
timeoutRef.current = setTimeout(() => {
|
|
16
|
-
updateDocumentInModel?.(newDoc);
|
|
17
|
-
}, updateTimeout);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export function makeFocusHandler(readonly, timeoutRef, updateDocumentInModel) {
|
|
21
|
-
return EditorView.focusChangeEffect.of((state, focusing) => {
|
|
22
|
-
if (!!readonly || focusing)
|
|
23
|
-
return null;
|
|
24
|
-
if (timeoutRef.current) {
|
|
25
|
-
clearTimeout(timeoutRef.current);
|
|
26
|
-
}
|
|
27
|
-
const newDoc = state.doc.toString();
|
|
28
|
-
updateDocumentInModel?.(newDoc);
|
|
29
|
-
return null;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export function makePasteHandler(readonly, timeoutRef, updateDocumentInModel) {
|
|
33
|
-
return EditorView.domEventHandlers({
|
|
34
|
-
paste: (event, view) => {
|
|
35
|
-
if (readonly)
|
|
36
|
-
return false;
|
|
37
|
-
const newDoc = view.state.doc.toString();
|
|
38
|
-
if (timeoutRef.current) {
|
|
39
|
-
clearTimeout(timeoutRef.current);
|
|
40
|
-
}
|
|
41
|
-
updateDocumentInModel?.(newDoc);
|
|
42
|
-
forceLinting(view);
|
|
43
|
-
return false;
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=factories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factories.js","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,UAAU,iBAAiB,CAC/B,QAA6B,EAC7B,UAAyD,EACzD,qBAAgD;IAEhD,OAAO,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAkB,EAAE,EAAE;QACzD,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU;YAAE,OAAO;QAC7C,IACE,MAAM,CAAC,YAAY,CAAC,IAAI,CACtB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,UAAU,CAC5D;YAED,OAAO;QAET,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAE3C,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QACD,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAA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
|
|
5
|
-
updateDocumentInModel?: (newDoc: string) => void;
|
|
6
|
-
customLinter?: (doc: string) => Diagnostic[];
|
|
7
|
-
};
|
|
8
|
-
declare const GraphqlEditor: import("react").NamedExoticComponent<Props>;
|
|
9
|
-
export default GraphqlEditor;
|
|
10
|
-
//# sourceMappingURL=graphql-editor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-editor.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/graphql-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuBnD,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,EAAE,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAM,aAAa,6CAoFjB,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forceLinting } from "@codemirror/lint";
|
|
3
|
-
import { Compartment, EditorState } from "@codemirror/state";
|
|
4
|
-
import { EditorView, keymap } from "@codemirror/view";
|
|
5
|
-
import { graphql } from "cm6-graphql";
|
|
6
|
-
import { buildSchema } from "graphql";
|
|
7
|
-
import { memo, useEffect, useRef } from "react";
|
|
8
|
-
import { ayuLight } from "thememirror";
|
|
9
|
-
import { useSchemaContext } from "../../context/schema-context.js";
|
|
10
|
-
import { baseEditorExtensions, baseKeymap } from "./constants.js";
|
|
11
|
-
import { makeFocusHandler, makePasteHandler, makeUpdateHandler, } from "./factories.js";
|
|
12
|
-
import { useDocumentSync, useEditorCleanup, useEditorRefs, useHandlerReconfiguration, } from "./hooks.js";
|
|
13
|
-
import { makeLinter } from "./linting.js";
|
|
14
|
-
const GraphqlEditor = memo(function GraphqlEditor(props) {
|
|
15
|
-
const { doc, readonly = false, updateDocumentInModel, customLinter } = props;
|
|
16
|
-
const { editorRef, viewRef, updateListenerCompartment, focusHandlerCompartment, pasteHandlerCompartment, timeoutRef, } = useEditorRefs();
|
|
17
|
-
// GraphQL-specific refs
|
|
18
|
-
const graphqlCompartment = useRef(new Compartment());
|
|
19
|
-
const linterCompartment = useRef(new Compartment());
|
|
20
|
-
const { sharedSchema } = useSchemaContext();
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (!viewRef.current) {
|
|
23
|
-
const schema = buildSchema(sharedSchema);
|
|
24
|
-
viewRef.current = new EditorView({
|
|
25
|
-
state: EditorState.create({
|
|
26
|
-
doc,
|
|
27
|
-
extensions: [
|
|
28
|
-
...baseEditorExtensions,
|
|
29
|
-
keymap.of(baseKeymap),
|
|
30
|
-
ayuLight,
|
|
31
|
-
graphqlCompartment.current.of(graphql(schema)),
|
|
32
|
-
linterCompartment.current.of(makeLinter(schema, customLinter)),
|
|
33
|
-
updateListenerCompartment.current.of(makeUpdateHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
34
|
-
focusHandlerCompartment.current.of(makeFocusHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
35
|
-
pasteHandlerCompartment.current.of(makePasteHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
36
|
-
EditorState.readOnly.of(readonly),
|
|
37
|
-
],
|
|
38
|
-
}),
|
|
39
|
-
parent: editorRef.current,
|
|
40
|
-
});
|
|
41
|
-
forceLinting(viewRef.current);
|
|
42
|
-
}
|
|
43
|
-
}, []);
|
|
44
|
-
useEditorCleanup(viewRef);
|
|
45
|
-
/* GraphQL-specific: Reconfigures the editor when the schema changes */
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
const view = viewRef.current;
|
|
48
|
-
if (!view)
|
|
49
|
-
return;
|
|
50
|
-
try {
|
|
51
|
-
const newSchema = buildSchema(sharedSchema);
|
|
52
|
-
view.dispatch({
|
|
53
|
-
effects: [
|
|
54
|
-
graphqlCompartment.current.reconfigure(graphql(newSchema)),
|
|
55
|
-
linterCompartment.current.reconfigure(makeLinter(newSchema, customLinter)),
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
forceLinting(view);
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
console.debug("in schema update", error);
|
|
62
|
-
}
|
|
63
|
-
}, [sharedSchema, customLinter]);
|
|
64
|
-
useHandlerReconfiguration(viewRef.current, readonly, timeoutRef, updateDocumentInModel, {
|
|
65
|
-
updateListener: updateListenerCompartment.current,
|
|
66
|
-
focusHandler: focusHandlerCompartment.current,
|
|
67
|
-
pasteHandler: pasteHandlerCompartment.current,
|
|
68
|
-
});
|
|
69
|
-
useDocumentSync(viewRef.current, doc);
|
|
70
|
-
return _jsx("div", { ref: editorRef });
|
|
71
|
-
});
|
|
72
|
-
export default GraphqlEditor;
|
|
73
|
-
//# sourceMappingURL=graphql-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-editor.js","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/graphql-editor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;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AC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IAEjC,yBAAyB,CACvB,OAAO,CAAC,OAAO,EACf,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB;QACE,cAAc,EAAE,yBAAyB,CAAC,OAAO;QACjD,YAAY,EAAE,uBAAuB,CAAC,OAAO;QAC7C,YAAY,EAAE,uBAAuB,CAAC,OAAO;KAC9C,CACF,CAAC;IAEF,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEtC,OAAO,cAAK,GAAG,EAAE,SAAS,GAAI,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Compartment } from "@codemirror/state";
|
|
2
|
-
import type { EditorView } from "@codemirror/view";
|
|
3
|
-
export type EditorConfig = {
|
|
4
|
-
doc: string;
|
|
5
|
-
readonly?: boolean;
|
|
6
|
-
updateDocumentInModel?: (newDoc: string) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare function useEditorRefs(): {
|
|
9
|
-
editorRef: import("react").RefObject<HTMLDivElement | null>;
|
|
10
|
-
viewRef: import("react").RefObject<EditorView | null>;
|
|
11
|
-
updateListenerCompartment: import("react").RefObject<Compartment>;
|
|
12
|
-
focusHandlerCompartment: import("react").RefObject<Compartment>;
|
|
13
|
-
pasteHandlerCompartment: import("react").RefObject<Compartment>;
|
|
14
|
-
timeoutRef: import("react").RefObject<NodeJS.Timeout | null>;
|
|
15
|
-
};
|
|
16
|
-
export declare function useEditorCleanup(viewRef: React.MutableRefObject<EditorView | null>): void;
|
|
17
|
-
export declare function useHandlerReconfiguration(view: EditorView | null, readonly: boolean | undefined, timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>, updateDocumentInModel: ((newDoc: string) => void) | undefined, compartments: {
|
|
18
|
-
updateListener: Compartment;
|
|
19
|
-
focusHandler: Compartment;
|
|
20
|
-
pasteHandler: Compartment;
|
|
21
|
-
}): void;
|
|
22
|
-
export declare function useDocumentSync(view: EditorView | null, doc: string): void;
|
|
23
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQnD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,wBAAgB,aAAa;;;;;;;EAgB5B;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,IAAI,CAAC,QAUnD;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,EACzD,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,EAC7D,YAAY,EAAE;IACZ,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,WAAW,CAAC;CAC3B,QAmBF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,QAYnE"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { forceLinting } from "@codemirror/lint";
|
|
2
|
-
import { Compartment, Transaction } from "@codemirror/state";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
import { makeFocusHandler, makePasteHandler, makeUpdateHandler, } from "./factories.js";
|
|
5
|
-
export function useEditorRefs() {
|
|
6
|
-
const editorRef = useRef(null);
|
|
7
|
-
const viewRef = useRef(null);
|
|
8
|
-
const updateListenerCompartment = useRef(new Compartment());
|
|
9
|
-
const focusHandlerCompartment = useRef(new Compartment());
|
|
10
|
-
const pasteHandlerCompartment = useRef(new Compartment());
|
|
11
|
-
const timeoutRef = useRef(null);
|
|
12
|
-
return {
|
|
13
|
-
editorRef,
|
|
14
|
-
viewRef,
|
|
15
|
-
updateListenerCompartment,
|
|
16
|
-
focusHandlerCompartment,
|
|
17
|
-
pasteHandlerCompartment,
|
|
18
|
-
timeoutRef,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function useEditorCleanup(viewRef) {
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
return () => {
|
|
24
|
-
if (viewRef.current) {
|
|
25
|
-
viewRef.current.destroy();
|
|
26
|
-
viewRef.current = null;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}, []);
|
|
30
|
-
}
|
|
31
|
-
export function useHandlerReconfiguration(view, readonly, timeoutRef, updateDocumentInModel, compartments) {
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (!view)
|
|
34
|
-
return;
|
|
35
|
-
view.dispatch({
|
|
36
|
-
effects: [
|
|
37
|
-
compartments.updateListener.reconfigure(makeUpdateHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
38
|
-
compartments.focusHandler.reconfigure(makeFocusHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
39
|
-
compartments.pasteHandler.reconfigure(makePasteHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
40
|
-
],
|
|
41
|
-
});
|
|
42
|
-
forceLinting(view);
|
|
43
|
-
}, [readonly, updateDocumentInModel]);
|
|
44
|
-
}
|
|
45
|
-
export function useDocumentSync(view, doc) {
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (!view)
|
|
48
|
-
return;
|
|
49
|
-
const currentDoc = view.state.doc.toString();
|
|
50
|
-
if (currentDoc !== doc) {
|
|
51
|
-
view.dispatch({
|
|
52
|
-
changes: { from: 0, to: currentDoc.length, insert: doc },
|
|
53
|
-
annotations: [Transaction.userEvent.of("external")],
|
|
54
|
-
});
|
|
55
|
-
forceLinting(view);
|
|
56
|
-
}
|
|
57
|
-
}, [doc]);
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,UAAU,aAAa;IAC3B,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAChD,MAAM,yBAAyB,GAAG,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;IAC5D,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;IAC1D,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IAEvD,OAAO;QACL,SAAS;QACT,OAAO;QACP,yBAAyB;QACzB,uBAAuB;QACvB,uBAAuB;QACvB,UAAU;KACX,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAkD;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AE,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE;gBACxD,WAAW,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;aACpD,CAAC,CAAC;YACH,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-editor.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/json-editor.tsx"],"names":[],"mappings":"AAmBA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,QAAA,MAAM,UAAU,6CA0Dd,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { json, jsonLanguage, jsonParseLinter } from "@codemirror/lang-json";
|
|
3
|
-
import { forceLinting, linter } from "@codemirror/lint";
|
|
4
|
-
import { EditorState } from "@codemirror/state";
|
|
5
|
-
import { EditorView, keymap } from "@codemirror/view";
|
|
6
|
-
import { memo, useEffect } from "react";
|
|
7
|
-
import { ayuLight } from "thememirror";
|
|
8
|
-
import { baseEditorExtensions, baseKeymap } from "./constants.js";
|
|
9
|
-
import { makeFocusHandler, makePasteHandler, makeUpdateHandler, } from "./factories.js";
|
|
10
|
-
import { useDocumentSync, useEditorCleanup, useEditorRefs, useHandlerReconfiguration, } from "./hooks.js";
|
|
11
|
-
const JSONEditor = memo(function JSONEditor(props) {
|
|
12
|
-
const { doc, readonly = false, updateDocumentInModel } = props;
|
|
13
|
-
const { editorRef, viewRef, updateListenerCompartment, focusHandlerCompartment, pasteHandlerCompartment, timeoutRef, } = useEditorRefs();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!viewRef.current) {
|
|
16
|
-
viewRef.current = new EditorView({
|
|
17
|
-
state: EditorState.create({
|
|
18
|
-
doc,
|
|
19
|
-
extensions: [
|
|
20
|
-
...baseEditorExtensions,
|
|
21
|
-
keymap.of(baseKeymap),
|
|
22
|
-
ayuLight,
|
|
23
|
-
jsonLanguage,
|
|
24
|
-
json(),
|
|
25
|
-
linter(jsonParseLinter()),
|
|
26
|
-
updateListenerCompartment.current.of(makeUpdateHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
27
|
-
focusHandlerCompartment.current.of(makeFocusHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
28
|
-
pasteHandlerCompartment.current.of(makePasteHandler(readonly, timeoutRef, updateDocumentInModel)),
|
|
29
|
-
EditorState.readOnly.of(readonly),
|
|
30
|
-
],
|
|
31
|
-
}),
|
|
32
|
-
parent: editorRef.current,
|
|
33
|
-
});
|
|
34
|
-
forceLinting(viewRef.current);
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
useEditorCleanup(viewRef);
|
|
38
|
-
useHandlerReconfiguration(viewRef.current, readonly, timeoutRef, updateDocumentInModel, {
|
|
39
|
-
updateListener: updateListenerCompartment.current,
|
|
40
|
-
focusHandler: focusHandlerCompartment.current,
|
|
41
|
-
pasteHandler: pasteHandlerCompartment.current,
|
|
42
|
-
});
|
|
43
|
-
useDocumentSync(viewRef.current, doc);
|
|
44
|
-
return _jsx("div", { ref: editorRef });
|
|
45
|
-
});
|
|
46
|
-
export default JSONEditor;
|
|
47
|
-
//# sourceMappingURL=json-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-editor.js","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/json-editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB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B,CAAC,CAC/D;wBACD,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAChC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAC9D;wBACD,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAChC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAC9D;wBACD,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC;qBAClC;iBACF,CAAC;gBACF,MAAM,EAAE,SAAS,CAAC,OAAQ;aAC3B,CAAC,CAAC;YACH,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE1B,yBAAyB,CACvB,OAAO,CAAC,OAAO,EACf,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB;QACE,cAAc,EAAE,yBAAyB,CAAC,OAAO;QACjD,YAAY,EAAE,uBAAuB,CAAC,OAAO;QAC7C,YAAY,EAAE,uBAAuB,CAAC,OAAO;KAC9C,CACF,CAAC;IAEF,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEtC,OAAO,cAAK,GAAG,EAAE,SAAS,GAAI,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Diagnostic } from "@codemirror/lint";
|
|
2
|
-
import type { GraphQLSchema } from "graphql";
|
|
3
|
-
import { GraphQLError } from "graphql";
|
|
4
|
-
export declare function convertGraphQLErrorToDiagnostic(error: GraphQLError): Diagnostic;
|
|
5
|
-
export declare function makeLinter(schema: GraphQLSchema, customLinter?: (doc: string) => Diagnostic[]): import("@codemirror/state").Extension;
|
|
6
|
-
//# sourceMappingURL=linting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linting.d.ts","sourceRoot":"","sources":["../../../../document-model-editor/components/code-editors/linting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAgB,MAAM,SAAS,CAAC;AAOrD,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,YAAY,GAClB,UAAU,CAOZ;AASD,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,EAAE,yCAmD7C"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { linter } from "@codemirror/lint";
|
|
2
|
-
import { filterSchema } from "@graphql-tools/utils";
|
|
3
|
-
import { GraphQLError, locatedError } from "graphql";
|
|
4
|
-
import { validateSDL } from "graphql/validation/validate.js";
|
|
5
|
-
import { safeParseSdl } from "../../context/schema-context.js";
|
|
6
|
-
/* Converts a GraphQLError to a Diagnostic
|
|
7
|
-
GraphQLError uses a zero-indexed line and column, but the editor uses a one-indexed line and column
|
|
8
|
-
*/
|
|
9
|
-
export function convertGraphQLErrorToDiagnostic(error) {
|
|
10
|
-
return {
|
|
11
|
-
from: error.locations?.[0] ? (error.positions?.[0] ?? 0) : 0,
|
|
12
|
-
to: error.locations?.[0] ? (error.positions?.[0] ?? 0) + 1 : 1,
|
|
13
|
-
severity: "error",
|
|
14
|
-
message: error.message,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/* Creates a linter that checks the document for errors
|
|
18
|
-
This works in combination with the built-in linting provided by the graphql extension
|
|
19
|
-
We need to recreate this linter when the schema changes or if a custom linter is provided
|
|
20
|
-
It first checks the document for linting errors
|
|
21
|
-
Then it checks if the document is a valid document string
|
|
22
|
-
Then it checks if the document is valid against the schema
|
|
23
|
-
*/
|
|
24
|
-
export function makeLinter(schema, customLinter) {
|
|
25
|
-
return linter((view) => {
|
|
26
|
-
const doc = view.state.doc.toString();
|
|
27
|
-
let diagnostics = [];
|
|
28
|
-
if (customLinter) {
|
|
29
|
-
diagnostics = diagnostics.concat(customLinter(doc));
|
|
30
|
-
}
|
|
31
|
-
const newDocNode = safeParseSdl(doc);
|
|
32
|
-
if (newDocNode) {
|
|
33
|
-
try {
|
|
34
|
-
const currentTypeNames = new Set(newDocNode.definitions
|
|
35
|
-
.filter((def) => "name" in def && def.name)
|
|
36
|
-
.map((def) => def.name.value));
|
|
37
|
-
// we need to filter out the existing types in the document from the schema to prevent duplicate type errors in the validation
|
|
38
|
-
const filteredSchema = filterSchema({
|
|
39
|
-
schema,
|
|
40
|
-
typeFilter: (typeName) => !currentTypeNames.has(typeName),
|
|
41
|
-
});
|
|
42
|
-
const errors = validateSDL(newDocNode, filteredSchema)
|
|
43
|
-
.map((error) => locatedError(error, newDocNode))
|
|
44
|
-
.filter((error, index, self) => index ===
|
|
45
|
-
self.findIndex((e) => e.message === error.message &&
|
|
46
|
-
e.locations?.[0]?.line === error.locations?.[0]?.line &&
|
|
47
|
-
e.locations?.[0]?.column === error.locations?.[0]?.column));
|
|
48
|
-
diagnostics = diagnostics.concat(errors.map(convertGraphQLErrorToDiagnostic));
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
if (error instanceof GraphQLError) {
|
|
52
|
-
diagnostics.push(convertGraphQLErrorToDiagnostic(error));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return diagnostics;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=linting.js.map
|