atom.io 0.28.1 → 0.29.0

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 (68) hide show
  1. package/dist/{chunk-6WL4RQMQ.js → chunk-XPYU2HY2.js} +22 -57
  2. package/eslint-plugin/dist/index.js +0 -1
  3. package/eslint-plugin/src/walk.ts +0 -1
  4. package/internal/dist/index.d.ts +4 -4
  5. package/internal/dist/index.js +1 -1
  6. package/internal/src/atom/dispose-atom.ts +0 -11
  7. package/internal/src/ingest-updates/ingest-creation-disposal.ts +16 -25
  8. package/internal/src/operation.ts +7 -7
  9. package/internal/src/selector/create-writable-selector.ts +1 -1
  10. package/internal/src/selector/dispose-selector.ts +0 -13
  11. package/internal/src/set-state/become.ts +1 -3
  12. package/internal/src/set-state/evict-downstream.ts +2 -2
  13. package/internal/src/set-state/set-atom.ts +1 -1
  14. package/internal/src/set-state/set-into-store.ts +1 -1
  15. package/internal/src/set-state/stow-update.ts +2 -2
  16. package/internal/src/store/store.ts +1 -1
  17. package/introspection/dist/index.d.ts +15 -6
  18. package/introspection/dist/index.js +620 -1
  19. package/introspection/src/attach-atom-index.ts +5 -6
  20. package/introspection/src/attach-introspection-states.ts +5 -6
  21. package/introspection/src/attach-selector-index.ts +6 -7
  22. package/introspection/src/attach-timeline-family.ts +3 -4
  23. package/introspection/src/attach-timeline-index.ts +4 -8
  24. package/introspection/src/attach-transaction-index.ts +4 -8
  25. package/introspection/src/attach-transaction-logs.ts +4 -8
  26. package/introspection/src/attach-type-selectors.ts +13 -6
  27. package/introspection/src/differ.ts +1 -1
  28. package/introspection/src/index.ts +1 -0
  29. package/introspection/src/refinery.ts +9 -7
  30. package/introspection/src/sprawl.ts +42 -0
  31. package/json/dist/index.d.ts +12 -1
  32. package/json/dist/index.js +111 -2
  33. package/json/src/index.ts +29 -0
  34. package/package.json +12 -12
  35. package/react-devtools/dist/index.d.ts +159 -2
  36. package/react-devtools/dist/index.js +260 -663
  37. package/react-devtools/src/AtomIODevtools.tsx +24 -13
  38. package/react-devtools/src/StateEditor.tsx +5 -47
  39. package/react-devtools/src/StateIndex.tsx +15 -9
  40. package/react-devtools/src/TimelineIndex.tsx +9 -6
  41. package/react-devtools/src/TransactionIndex.tsx +9 -11
  42. package/react-devtools/src/elastic-input/ElasticInput.tsx +86 -0
  43. package/react-devtools/src/elastic-input/NumberInput.tsx +199 -0
  44. package/react-devtools/src/elastic-input/TextInput.tsx +47 -0
  45. package/react-devtools/src/elastic-input/index.ts +3 -0
  46. package/react-devtools/src/error-boundary/DefaultFallback.tsx +49 -0
  47. package/react-devtools/src/error-boundary/ReactErrorBoundary.tsx +56 -0
  48. package/react-devtools/src/error-boundary/index.ts +2 -0
  49. package/react-devtools/src/index.ts +3 -0
  50. package/react-devtools/src/json-editor/assets/Untitled-1.ai +1436 -2
  51. package/react-devtools/src/json-editor/assets/data-vis.ai +1548 -1
  52. package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +1451 -3
  53. package/react-devtools/src/json-editor/default-components.tsx +101 -0
  54. package/react-devtools/src/json-editor/developer-interface.tsx +81 -0
  55. package/react-devtools/src/json-editor/editors-by-type/array-editor.tsx +38 -0
  56. package/react-devtools/src/json-editor/editors-by-type/non-json.tsx +23 -0
  57. package/react-devtools/src/json-editor/editors-by-type/object-editor.tsx +128 -0
  58. package/react-devtools/src/json-editor/editors-by-type/primitive-editors.tsx +73 -0
  59. package/react-devtools/src/json-editor/editors-by-type/utilities/array-elements.ts +16 -0
  60. package/react-devtools/src/json-editor/editors-by-type/utilities/cast-json.ts +57 -0
  61. package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +156 -0
  62. package/react-devtools/src/json-editor/editors-by-type/utilities/object-properties.ts +106 -0
  63. package/react-devtools/src/json-editor/index.ts +32 -0
  64. package/react-devtools/src/json-editor/json-editor-internal.tsx +128 -0
  65. package/react-devtools/src/json-editor/todo.md +7 -0
  66. package/react-devtools/src/store.ts +70 -46
  67. package/dist/chunk-D52JNVER.js +0 -721
  68. package/dist/chunk-YQ46F5O2.js +0 -95
@@ -1,3 +1,160 @@
1
- declare const AtomIODevtools: () => JSX.Element;
1
+ import { DetailedHTMLProps, InputHTMLAttributes, ForwardRefExoticComponent, FC, ErrorInfo, ReactNode, Component, CSSProperties, ReactElement } from 'react';
2
+ import { JsonTypes, Json } from 'atom.io/json';
2
3
 
3
- export { AtomIODevtools };
4
+ declare const AtomIODevtools: React.FC;
5
+
6
+ type ElasticInputProps = DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
7
+ widthPadding?: number;
8
+ };
9
+ declare const ElasticInput: ForwardRefExoticComponent<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
10
+ widthPadding?: number;
11
+ }>;
12
+
13
+ declare function clampInto(min: number, max: number): (value: number) => number;
14
+ declare const VALID_NON_NUMBERS: readonly ["", "-", ".", "-."];
15
+ type ValidNonNumber = (typeof VALID_NON_NUMBERS)[number];
16
+ declare const isValidNonNumber: (input: string) => input is ValidNonNumber;
17
+ declare const VALID_NON_NUMBER_INTERPRETATIONS: Readonly<Record<ValidNonNumber, number | null>>;
18
+ type DecimalInProgress = `${number | ``}.${number}`;
19
+ declare const isDecimalInProgress: (input: string) => input is DecimalInProgress;
20
+ type NumberConstraints = {
21
+ max: number;
22
+ min: number;
23
+ decimalPlaces: number;
24
+ nullable: boolean;
25
+ };
26
+ declare const DEFAULT_NUMBER_CONSTRAINTS: NumberConstraints;
27
+ type NumberInputProps = Partial<NumberConstraints> & {
28
+ autoSize?: boolean;
29
+ disabled?: boolean;
30
+ id?: string;
31
+ label?: string;
32
+ name?: string;
33
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
34
+ onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
35
+ placeholder?: string;
36
+ set?: ((newValue: number | null) => void) | undefined;
37
+ testid?: string;
38
+ value?: number | null;
39
+ };
40
+ declare const NumberInput: FC<NumberInputProps>;
41
+
42
+ type TextInputProps = {
43
+ value: string;
44
+ set?: ((value: string) => void) | undefined;
45
+ label?: string;
46
+ placeholder?: string;
47
+ autoSize?: boolean;
48
+ readOnly?: boolean;
49
+ testid?: string;
50
+ };
51
+ declare const TextInput: FC<TextInputProps>;
52
+
53
+ type FallbackProps = {
54
+ error?: Error | string | undefined;
55
+ errorInfo?: ErrorInfo | undefined;
56
+ };
57
+ declare const DefaultFallback: FC<FallbackProps>;
58
+
59
+ type ErrorBoundaryState = {
60
+ error?: Error | string;
61
+ errorInfo?: ErrorInfo;
62
+ };
63
+ type ErrorBoundaryProps = {
64
+ children: ReactNode;
65
+ onError?: ((error: Error | string, errorInfo: ErrorInfo) => void) | undefined;
66
+ Fallback?: FC<FallbackProps> | undefined;
67
+ useResetErrorState?: () => () => void;
68
+ useErrorState?: () => [
69
+ ErrorBoundaryState,
70
+ (newState: ErrorBoundaryState | ((currState: ErrorBoundaryState) => ErrorBoundaryState)) => void
71
+ ];
72
+ };
73
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
74
+ constructor(props: ErrorBoundaryProps);
75
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
76
+ render(): ReactNode;
77
+ }
78
+
79
+ type Dict<T> = Record<string, T>;
80
+ type WrapperComponent<T extends Dict<unknown> = Dict<unknown>> = FC<T & {
81
+ children: ReactNode;
82
+ testid?: string | undefined;
83
+ }>;
84
+ type WC<T extends Dict<unknown> = Dict<unknown>> = WrapperComponent<T>;
85
+ type JsonEditorComponents = {
86
+ ErrorBoundary: WC;
87
+ Button: WC<{
88
+ onClick?: () => void;
89
+ disabled?: boolean;
90
+ }>;
91
+ DeleteIcon: FC;
92
+ EditorWrapper: WC<{
93
+ style?: CSSProperties | undefined;
94
+ className?: string | undefined;
95
+ testid?: string | undefined;
96
+ }>;
97
+ ArrayWrapper: WC;
98
+ ObjectWrapper: WC;
99
+ StringWrapper: WC;
100
+ NumberWrapper: WC;
101
+ BooleanWrapper: WC;
102
+ Null: FC<{
103
+ testid?: string | undefined;
104
+ }>;
105
+ MissingPropertyWrapper: WC;
106
+ KeyWrapper: WC;
107
+ };
108
+ declare const DEFAULT_JSON_EDITOR_COMPONENTS: JsonEditorComponents;
109
+
110
+ type JsonEditorProps_INTERNAL<T> = {
111
+ data: T;
112
+ set: SetterOrUpdater<T>;
113
+ name?: string | undefined;
114
+ rename?: ((newKey: string) => void) | undefined;
115
+ remove?: (() => void) | undefined;
116
+ recast?: (newType: keyof JsonTypes) => void;
117
+ path?: ReadonlyArray<number | string>;
118
+ isReadonly?: (path: ReadonlyArray<number | string>) => boolean;
119
+ isHidden?: (path: ReadonlyArray<number | string>) => boolean;
120
+ className?: string | undefined;
121
+ style?: CSSProperties | undefined;
122
+ Header?: FC<{
123
+ data: T;
124
+ }> | undefined;
125
+ Components: JsonEditorComponents;
126
+ testid?: string | undefined;
127
+ };
128
+
129
+ type JsonEditorProps<T> = {
130
+ data: T;
131
+ set: (valOrUpdater: T | ((currVal: T) => T)) => void;
132
+ name?: string | undefined;
133
+ rename?: ((newKey: string) => void) | undefined;
134
+ remove?: () => void;
135
+ path?: ReadonlyArray<number | string>;
136
+ isReadonly?: (path: ReadonlyArray<number | string>) => boolean;
137
+ isHidden?: (path: ReadonlyArray<number | string>) => boolean;
138
+ className?: string;
139
+ style?: CSSProperties;
140
+ Header?: FC<{
141
+ data: T;
142
+ }>;
143
+ Components?: Partial<JsonEditorComponents>;
144
+ testid?: string;
145
+ };
146
+ declare const JsonEditor: <T>({ data, set, name, rename, remove, isReadonly, isHidden, className, Header, style, Components: CustomComponents, testid, }: JsonEditorProps<T>) => ReactElement;
147
+
148
+ declare const castToJson: (input: unknown) => {
149
+ array: Json.Tree.Array;
150
+ boolean: boolean;
151
+ number: number;
152
+ object: Json.Tree.Object;
153
+ string: string;
154
+ null: null;
155
+ };
156
+
157
+ type SetterOrUpdater<T> = <New extends T>(next: New | ((old: T) => New)) => void;
158
+ declare const SubEditors: Record<keyof JsonTypes, FC<JsonEditorProps_INTERNAL<any>>>;
159
+
160
+ export { AtomIODevtools, DEFAULT_JSON_EDITOR_COMPONENTS, DEFAULT_NUMBER_CONSTRAINTS, type DecimalInProgress, DefaultFallback, type Dict, ElasticInput, type ElasticInputProps, ErrorBoundary, type ErrorBoundaryProps, type ErrorBoundaryState, type FallbackProps, JsonEditor, type JsonEditorComponents, type JsonEditorProps, type NumberConstraints, NumberInput, type SetterOrUpdater, SubEditors, TextInput, type TextInputProps, VALID_NON_NUMBERS, VALID_NON_NUMBER_INTERPRETATIONS, type ValidNonNumber, type WC, type WrapperComponent, castToJson, clampInto, isDecimalInProgress, isValidNonNumber };