@darajs/components 1.16.5 → 1.16.6-alpha.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.
Files changed (69) hide show
  1. package/dist/dara_components-1.16.6a2-py3-none-any.whl +0 -0
  2. package/dist/index.css +120 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/smart/code-editor.d.ts.map +1 -1
  8. package/dist/smart/code-editor.js +27 -2
  9. package/dist/smart/code-editor.js.map +1 -1
  10. package/dist/smart/index.d.ts +1 -0
  11. package/dist/smart/index.d.ts.map +1 -1
  12. package/dist/smart/index.js +1 -0
  13. package/dist/smart/index.js.map +1 -1
  14. package/dist/smart/ui-code-editor/code-editor.d.ts +118 -0
  15. package/dist/smart/ui-code-editor/code-editor.d.ts.map +1 -0
  16. package/dist/smart/ui-code-editor/code-editor.js +357 -0
  17. package/dist/smart/ui-code-editor/code-editor.js.map +1 -0
  18. package/dist/smart/ui-code-editor/codemirror-context.d.ts +18 -0
  19. package/dist/smart/ui-code-editor/codemirror-context.d.ts.map +1 -0
  20. package/dist/smart/ui-code-editor/codemirror-context.js +10 -0
  21. package/dist/smart/ui-code-editor/codemirror-context.js.map +1 -0
  22. package/dist/smart/ui-code-editor/extensions/argument-hints.d.ts +21 -0
  23. package/dist/smart/ui-code-editor/extensions/argument-hints.d.ts.map +1 -0
  24. package/dist/smart/ui-code-editor/extensions/argument-hints.js +250 -0
  25. package/dist/smart/ui-code-editor/extensions/argument-hints.js.map +1 -0
  26. package/dist/smart/ui-code-editor/extensions/code-folding.d.ts +3 -0
  27. package/dist/smart/ui-code-editor/extensions/code-folding.d.ts.map +1 -0
  28. package/dist/smart/ui-code-editor/extensions/code-folding.js +69 -0
  29. package/dist/smart/ui-code-editor/extensions/code-folding.js.map +1 -0
  30. package/dist/smart/ui-code-editor/extensions/json.d.ts +16 -0
  31. package/dist/smart/ui-code-editor/extensions/json.d.ts.map +1 -0
  32. package/dist/smart/ui-code-editor/extensions/json.js +29 -0
  33. package/dist/smart/ui-code-editor/extensions/json.js.map +1 -0
  34. package/dist/smart/ui-code-editor/extensions/lsp-utils.d.ts +39 -0
  35. package/dist/smart/ui-code-editor/extensions/lsp-utils.d.ts.map +1 -0
  36. package/dist/smart/ui-code-editor/extensions/lsp-utils.js +299 -0
  37. package/dist/smart/ui-code-editor/extensions/lsp-utils.js.map +1 -0
  38. package/dist/smart/ui-code-editor/extensions/markdown.d.ts +13 -0
  39. package/dist/smart/ui-code-editor/extensions/markdown.d.ts.map +1 -0
  40. package/dist/smart/ui-code-editor/extensions/markdown.js +19 -0
  41. package/dist/smart/ui-code-editor/extensions/markdown.js.map +1 -0
  42. package/dist/smart/ui-code-editor/extensions/python.d.ts +15 -0
  43. package/dist/smart/ui-code-editor/extensions/python.d.ts.map +1 -0
  44. package/dist/smart/ui-code-editor/extensions/python.js +21 -0
  45. package/dist/smart/ui-code-editor/extensions/python.js.map +1 -0
  46. package/dist/smart/ui-code-editor/extensions/shared.d.ts +48 -0
  47. package/dist/smart/ui-code-editor/extensions/shared.d.ts.map +1 -0
  48. package/dist/smart/ui-code-editor/extensions/shared.js +166 -0
  49. package/dist/smart/ui-code-editor/extensions/shared.js.map +1 -0
  50. package/dist/smart/ui-code-editor/extensions/sql.d.ts +14 -0
  51. package/dist/smart/ui-code-editor/extensions/sql.d.ts.map +1 -0
  52. package/dist/smart/ui-code-editor/extensions/sql.js +23 -0
  53. package/dist/smart/ui-code-editor/extensions/sql.js.map +1 -0
  54. package/dist/smart/ui-code-editor/index.d.ts +25 -0
  55. package/dist/smart/ui-code-editor/index.d.ts.map +1 -0
  56. package/dist/smart/ui-code-editor/index.js +25 -0
  57. package/dist/smart/ui-code-editor/index.js.map +1 -0
  58. package/dist/smart/ui-code-editor/types.d.ts +65 -0
  59. package/dist/smart/ui-code-editor/types.d.ts.map +1 -0
  60. package/dist/smart/ui-code-editor/types.js +5 -0
  61. package/dist/smart/ui-code-editor/types.js.map +1 -0
  62. package/dist/smart/ui-code-editor/utils.d.ts +16 -0
  63. package/dist/smart/ui-code-editor/utils.d.ts.map +1 -0
  64. package/dist/smart/ui-code-editor/utils.js +33 -0
  65. package/dist/smart/ui-code-editor/utils.js.map +1 -0
  66. package/dist/umd/dara.components.umd.js +35001 -31083
  67. package/dist/umd/style.css +750 -1
  68. package/package.json +28 -15
  69. package/dist/dara_components-1.16.5-py3-none-any.whl +0 -0
@@ -0,0 +1,23 @@
1
+ import { closeBrackets } from '@codemirror/autocomplete';
2
+ import { StandardSQL, sql } from '@codemirror/lang-sql';
3
+ import { bracketMatching } from '@codemirror/language';
4
+ import { lineNumbers } from '@codemirror/view';
5
+ /**
6
+ * Get the extensions for SQL
7
+ * Currently includes:
8
+ * - lineNumbers
9
+ * - sql
10
+ * - StandardSQL
11
+ * - bracketMatching
12
+ * - closeBrackets
13
+ *
14
+ * @returns - an array of extensions for SQL
15
+ */
16
+ export const getSQLExtensions = () => [
17
+ lineNumbers(),
18
+ sql(),
19
+ StandardSQL,
20
+ bracketMatching(),
21
+ closeBrackets(),
22
+ ];
23
+ //# sourceMappingURL=sql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql.js","sourceRoot":"","sources":["../../../../js/smart/ui-code-editor/extensions/sql.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAgB,EAAE,CAAC;IAC/C,WAAW,EAAE;IACb,GAAG,EAAE;IACL,WAAW;IACX,eAAe,EAAE;IACjB,aAAa,EAAE;CAClB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export { default as CodeEditor } from './code-editor';
18
+ export { argumentHints, closeArgumentsHintsTooltip } from './extensions/argument-hints';
19
+ export { getDefaultExtensions, goToDefinitionExtension } from './extensions/shared';
20
+ export { getJSONExtensions } from './extensions/json';
21
+ export { getMarkdownExtensions } from './extensions/markdown';
22
+ export { getPythonExtensions } from './extensions/python';
23
+ export { getSQLExtensions } from './extensions/sql';
24
+ export * from './types';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export { default as CodeEditor } from './code-editor';
18
+ export { argumentHints, closeArgumentsHintsTooltip } from './extensions/argument-hints';
19
+ export { getDefaultExtensions, goToDefinitionExtension } from './extensions/shared';
20
+ export { getJSONExtensions } from './extensions/json';
21
+ export { getMarkdownExtensions } from './extensions/markdown';
22
+ export { getPythonExtensions } from './extensions/python';
23
+ export { getSQLExtensions } from './extensions/sql';
24
+ export * from './types';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { ContextType } from 'react';
2
+ import type { CompletionItem, MarkupContent, Position, SignatureHelp } from 'vscode-languageserver-types';
3
+ import { WebSocketCtx } from '@darajs/core';
4
+ export type ErrorResponse = {
5
+ error_code: number;
6
+ error_message: string;
7
+ };
8
+ export declare function isErrorResponse(obj: any): obj is ErrorResponse;
9
+ export declare const LSP_MESSAGE_KIND = "lsp_message";
10
+ type LspPayload = {
11
+ method: 'textDocument/definition';
12
+ params: {
13
+ line: number;
14
+ character: number;
15
+ };
16
+ } | {
17
+ method: 'textDocument/completion';
18
+ params: {
19
+ line: number;
20
+ character: number;
21
+ };
22
+ } | {
23
+ method: 'textDocument/hover';
24
+ params: {
25
+ line: number;
26
+ character: number;
27
+ };
28
+ } | {
29
+ method: 'textDocument/signatureHelp';
30
+ params: {
31
+ line: number;
32
+ character: number;
33
+ };
34
+ };
35
+ export type LspMessage = {
36
+ id: string;
37
+ uri: string;
38
+ } & LspPayload;
39
+ export interface LSPDefinition {
40
+ range: {
41
+ end: Position;
42
+ start: Position;
43
+ };
44
+ uri: string;
45
+ }
46
+ export type LspDefinitionResponse = {
47
+ id: string;
48
+ definitions: LSPDefinition[];
49
+ };
50
+ export type LspCompletionResponse = {
51
+ id: string;
52
+ items: CompletionItem[];
53
+ };
54
+ export type LspHoverResponse = {
55
+ id: string;
56
+ contents: MarkupContent | null;
57
+ source?: string;
58
+ };
59
+ export type LspSignatureHelpResponse = {
60
+ id: string;
61
+ signature: SignatureHelp;
62
+ };
63
+ export type WsClient = Exclude<ContextType<typeof WebSocketCtx>['client'], undefined>;
64
+ export {};
65
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA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AE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export function isErrorResponse(obj) {
2
+ return obj && obj.error_code && obj.error_message;
3
+ }
4
+ export const LSP_MESSAGE_KIND = 'lsp_message';
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/types.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,eAAe,CAAC,GAAQ;IACpC,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { ViewUpdate } from '@codemirror/view';
2
+ /**
3
+ * Annotation to mark an update as external
4
+ */
5
+ export declare const EXTERNAL_UPDATE: import("@codemirror/state").AnnotationType<boolean>;
6
+ /**
7
+ * Check whether a given update is external
8
+ *
9
+ * @param update update object
10
+ */
11
+ export declare function isExternalUpdate(update: ViewUpdate): boolean;
12
+ /**
13
+ * Whether a markdown response is empty
14
+ */
15
+ export declare function isEmptyMarkdown(response: string | null | undefined): boolean;
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,eAAe,qDAA+B,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAG5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAkB5E"}
@@ -0,0 +1,33 @@
1
+ import { Annotation } from '@codemirror/state';
2
+ /**
3
+ * Annotation to mark an update as external
4
+ */
5
+ export const EXTERNAL_UPDATE = Annotation.define();
6
+ /**
7
+ * Check whether a given update is external
8
+ *
9
+ * @param update update object
10
+ */
11
+ export function isExternalUpdate(update) {
12
+ // is external if any associated transaction was annotated as external
13
+ return update.transactions.some((tr) => tr.annotation(EXTERNAL_UPDATE));
14
+ }
15
+ /**
16
+ * Whether a markdown response is empty
17
+ */
18
+ export function isEmptyMarkdown(response) {
19
+ if (!response) {
20
+ return true;
21
+ }
22
+ const trimmed = response.trim();
23
+ if (trimmed.length === 0) {
24
+ return true;
25
+ }
26
+ // response could be an empty markdown code block
27
+ if (trimmed.startsWith('```') && trimmed.endsWith('```')) {
28
+ const content = trimmed.split('\n').join('').slice(3, -3).trim();
29
+ return content.length === 0;
30
+ }
31
+ return false;
32
+ }
33
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../js/smart/ui-code-editor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,EAAW,CAAC;AAE5D;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IAC/C,sEAAsE;IACtE,OAAO,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAmC;IAC/D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEhC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,iDAAiD;IACjD,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACvD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACjE,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}