@shipfox/react-ui 0.32.2 → 0.33.1
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/components/alert/index.d.ts +1 -1
- package/dist/components/avatar/avatar-group.d.ts +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/icon-badge.d.ts +1 -1
- package/dist/components/badge/index.d.ts +4 -4
- package/dist/components/button/button-link.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/icon-button.d.ts +1 -1
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button-group/index.d.ts +1 -1
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/checkbox/checkbox-label.d.ts +1 -1
- package/dist/components/checkbox/checkbox-links.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +3 -3
- package/dist/components/code-block/code-block-footer.js +7 -2
- package/dist/components/code-block/index.d.ts +3 -3
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/command/command.d.ts +1 -1
- package/dist/components/command/index.d.ts +1 -1
- package/dist/components/confetti/index.d.ts +1 -1
- package/dist/components/count-up/index.d.ts +1 -1
- package/dist/components/dashboard/components/charts/bar-chart.d.ts +1 -1
- package/dist/components/dashboard/components/charts/index.d.ts +5 -5
- package/dist/components/dashboard/components/charts/line-chart.d.ts +1 -1
- package/dist/components/dashboard/components/charts/utils.d.ts +2 -2
- package/dist/components/dashboard/components/dashboard-alert.d.ts +1 -1
- package/dist/components/dashboard/components/mobile-sidebar.d.ts +1 -1
- package/dist/components/dashboard/components/sidebar.d.ts +1 -1
- package/dist/components/dashboard/components/topbar-button.d.ts +1 -1
- package/dist/components/dashboard/context/dashboard-context.d.ts +2 -2
- package/dist/components/dashboard/context/index.d.ts +4 -4
- package/dist/components/dashboard/context/types.d.ts +1 -1
- package/dist/components/dashboard/context/utils.d.ts +1 -1
- package/dist/components/dashboard/index.d.ts +18 -18
- package/dist/components/dashboard/pages/index.d.ts +2 -2
- package/dist/components/dashboard/table/index.d.ts +2 -2
- package/dist/components/dashboard/toolbar/filter-button.d.ts +1 -1
- package/dist/components/dashboard/toolbar/index.d.ts +9 -9
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-time-range-picker/index.d.ts +1 -1
- package/dist/components/dot-grid/index.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu/index.d.ts +1 -1
- package/dist/components/dynamic-item/dynamic-item.d.ts +1 -1
- package/dist/components/dynamic-item/index.d.ts +1 -1
- package/dist/components/empty-state/empty-state.d.ts +1 -1
- package/dist/components/empty-state/index.d.ts +1 -1
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/icon/custom/index.d.ts +14 -14
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/index.d.ts +47 -47
- package/dist/components/inline-tips/index.d.ts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/interval-selector/hooks/index.d.ts +3 -3
- package/dist/components/interval-selector/hooks/use-interval-selector-input.d.ts +1 -1
- package/dist/components/interval-selector/hooks/use-interval-selector-navigation.d.ts +1 -1
- package/dist/components/interval-selector/hooks/use-interval-selector.d.ts +2 -2
- package/dist/components/interval-selector/index.d.ts +2 -2
- package/dist/components/interval-selector/interval-selector-calendar.d.ts +1 -1
- package/dist/components/interval-selector/interval-selector-input.d.ts +1 -1
- package/dist/components/interval-selector/interval-selector-suggestions.d.ts +1 -1
- package/dist/components/interval-selector/interval-selector.d.ts +1 -1
- package/dist/components/interval-selector/utils/format.d.ts +1 -1
- package/dist/components/interval-selector/utils/index.d.ts +2 -2
- package/dist/components/item/index.d.ts +1 -1
- package/dist/components/kbd/index.d.ts +1 -1
- package/dist/components/label/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/moving-border/index.d.ts +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/scroll-area/index.d.ts +1 -1
- package/dist/components/search/index.d.ts +6 -6
- package/dist/components/search/search-inline.d.ts +1 -1
- package/dist/components/search/search-modal.d.ts +1 -1
- package/dist/components/search/search-trigger.d.ts +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/shiny-text/index.d.ts +1 -1
- package/dist/components/shipql-editor/index.d.ts +2 -2
- package/dist/components/shipql-editor/lexical/on-blur-plugin.d.ts +2 -1
- package/dist/components/shipql-editor/lexical/on-blur-plugin.js +8 -4
- package/dist/components/shipql-editor/lexical/shipql-leaf-node.d.ts +5 -2
- package/dist/components/shipql-editor/lexical/shipql-leaf-node.js +18 -8
- package/dist/components/shipql-editor/lexical/shipql-plugin.d.ts +3 -2
- package/dist/components/shipql-editor/lexical/shipql-plugin.js +188 -34
- package/dist/components/shipql-editor/shipql-editor-inner.d.ts +2 -2
- package/dist/components/shipql-editor/shipql-editor-inner.js +52 -7
- package/dist/components/shipql-editor/shipql-editor.d.ts +4 -3
- package/dist/components/shipql-editor/suggestions/generate-suggestions.d.ts +9 -3
- package/dist/components/shipql-editor/suggestions/generate-suggestions.js +94 -20
- package/dist/components/shipql-editor/suggestions/shipql-range-facet-panel.d.ts +1 -1
- package/dist/components/shipql-editor/suggestions/shipql-range-facet-panel.js +2 -2
- package/dist/components/shipql-editor/suggestions/shipql-suggestion-item.d.ts +2 -2
- package/dist/components/shipql-editor/suggestions/shipql-suggestion-item.js +74 -10
- package/dist/components/shipql-editor/suggestions/shipql-suggestions-dropdown.d.ts +4 -3
- package/dist/components/shipql-editor/suggestions/shipql-suggestions-dropdown.js +56 -11
- package/dist/components/shipql-editor/suggestions/shipql-suggestions-plugin.d.ts +2 -2
- package/dist/components/shipql-editor/suggestions/shipql-suggestions-plugin.js +7 -5
- package/dist/components/shipql-editor/suggestions/types.d.ts +25 -3
- package/dist/components/skeleton/index.d.ts +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/table/index.d.ts +4 -4
- package/dist/components/table/table.stories.columns.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/theme/index.d.ts +1 -1
- package/dist/components/theme/theme-provider.d.ts +1 -1
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/typography/index.d.ts +3 -3
- package/dist/hooks/index.d.ts +6 -6
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/styles.css +2 -1
- package/dist/utils/format/index.d.ts +5 -5
- package/dist/utils/index.d.ts +6 -6
- package/package.json +10 -10
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
export * from './alert';
|
|
2
|
-
export * from './avatar';
|
|
3
|
-
export * from './badge';
|
|
4
|
-
export * from './button';
|
|
5
|
-
export * from './button-group';
|
|
6
|
-
export * from './calendar';
|
|
7
|
-
export * from './card';
|
|
8
|
-
export * from './checkbox';
|
|
9
|
-
export * from './code-block';
|
|
10
|
-
export * from './combobox';
|
|
11
|
-
export * from './command';
|
|
12
|
-
export * from './confetti';
|
|
13
|
-
export * from './count-up';
|
|
14
|
-
export * from './dashboard';
|
|
15
|
-
export * from './date-picker';
|
|
16
|
-
export * from './date-time-range-picker';
|
|
17
|
-
export * from './dot-grid';
|
|
18
|
-
export * from './dropdown-menu';
|
|
19
|
-
export * from './dynamic-item';
|
|
20
|
-
export * from './empty-state';
|
|
21
|
-
export * from './form';
|
|
22
|
-
export * from './icon';
|
|
23
|
-
export * from './inline-tips';
|
|
24
|
-
export * from './input';
|
|
25
|
-
export * from './interval-selector';
|
|
26
|
-
export * from './item';
|
|
27
|
-
export * from './kbd';
|
|
28
|
-
export * from './label';
|
|
29
|
-
export * from './modal';
|
|
30
|
-
export * from './moving-border';
|
|
31
|
-
export * from './popover';
|
|
32
|
-
export * from './scroll-area';
|
|
33
|
-
export * from './search';
|
|
34
|
-
export * from './select';
|
|
35
|
-
export * from './sheet';
|
|
36
|
-
export * from './shiny-text';
|
|
37
|
-
export * from './shipql-editor';
|
|
38
|
-
export * from './skeleton';
|
|
39
|
-
export * from './slider';
|
|
40
|
-
export * from './switch';
|
|
41
|
-
export * from './table';
|
|
42
|
-
export * from './tabs';
|
|
43
|
-
export * from './textarea';
|
|
44
|
-
export * from './theme';
|
|
45
|
-
export * from './toast';
|
|
46
|
-
export * from './tooltip';
|
|
47
|
-
export * from './typography';
|
|
1
|
+
export * from './alert/index.js';
|
|
2
|
+
export * from './avatar/index.js';
|
|
3
|
+
export * from './badge/index.js';
|
|
4
|
+
export * from './button/index.js';
|
|
5
|
+
export * from './button-group/index.js';
|
|
6
|
+
export * from './calendar/index.js';
|
|
7
|
+
export * from './card/index.js';
|
|
8
|
+
export * from './checkbox/index.js';
|
|
9
|
+
export * from './code-block/index.js';
|
|
10
|
+
export * from './combobox/index.js';
|
|
11
|
+
export * from './command/index.js';
|
|
12
|
+
export * from './confetti/index.js';
|
|
13
|
+
export * from './count-up/index.js';
|
|
14
|
+
export * from './dashboard/index.js';
|
|
15
|
+
export * from './date-picker/index.js';
|
|
16
|
+
export * from './date-time-range-picker/index.js';
|
|
17
|
+
export * from './dot-grid/index.js';
|
|
18
|
+
export * from './dropdown-menu/index.js';
|
|
19
|
+
export * from './dynamic-item/index.js';
|
|
20
|
+
export * from './empty-state/index.js';
|
|
21
|
+
export * from './form/index.js';
|
|
22
|
+
export * from './icon/index.js';
|
|
23
|
+
export * from './inline-tips/index.js';
|
|
24
|
+
export * from './input/index.js';
|
|
25
|
+
export * from './interval-selector/index.js';
|
|
26
|
+
export * from './item/index.js';
|
|
27
|
+
export * from './kbd/index.js';
|
|
28
|
+
export * from './label/index.js';
|
|
29
|
+
export * from './modal/index.js';
|
|
30
|
+
export * from './moving-border/index.js';
|
|
31
|
+
export * from './popover/index.js';
|
|
32
|
+
export * from './scroll-area/index.js';
|
|
33
|
+
export * from './search/index.js';
|
|
34
|
+
export * from './select/index.js';
|
|
35
|
+
export * from './sheet/index.js';
|
|
36
|
+
export * from './shiny-text/index.js';
|
|
37
|
+
export * from './shipql-editor/index.js';
|
|
38
|
+
export * from './skeleton/index.js';
|
|
39
|
+
export * from './slider/index.js';
|
|
40
|
+
export * from './switch/index.js';
|
|
41
|
+
export * from './table/index.js';
|
|
42
|
+
export * from './tabs/index.js';
|
|
43
|
+
export * from './textarea/index.js';
|
|
44
|
+
export * from './theme/index.js';
|
|
45
|
+
export * from './toast/index.js';
|
|
46
|
+
export * from './tooltip/index.js';
|
|
47
|
+
export * from './typography/index.js';
|
|
48
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './inline-tips';
|
|
1
|
+
export * from './inline-tips.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './input';
|
|
1
|
+
export * from './input.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './use-interval-selector';
|
|
2
|
-
export * from './use-interval-selector-input';
|
|
3
|
-
export * from './use-interval-selector-navigation';
|
|
1
|
+
export * from './use-interval-selector.js';
|
|
2
|
+
export * from './use-interval-selector-input.js';
|
|
3
|
+
export * from './use-interval-selector-navigation.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntervalSelection } from '../types';
|
|
1
|
+
import type { IntervalSelection } from '../types.js';
|
|
2
2
|
export interface UseNewIntervalSelectorInputProps {
|
|
3
3
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
4
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from '../types';
|
|
1
|
+
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from '../types.js';
|
|
2
2
|
interface UseIntervalSelectorNavigationProps {
|
|
3
3
|
relativeSuggestions: RelativeSuggestion[];
|
|
4
4
|
intervalSuggestions: IntervalSuggestion[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DismissableLayerProps } from '@radix-ui/react-dismissable-layer';
|
|
2
|
-
import type { IntervalSelectorProps } from '../interval-selector';
|
|
3
|
-
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from '../types';
|
|
2
|
+
import type { IntervalSelectorProps } from '../interval-selector.js';
|
|
3
|
+
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from '../types.js';
|
|
4
4
|
export interface UseIntervalSelectorProps extends Pick<IntervalSelectorProps, 'onSelectionChange'> {
|
|
5
5
|
relativeSuggestions: RelativeSuggestion[];
|
|
6
6
|
intervalSuggestions: IntervalSuggestion[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './interval-selector';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export * from './interval-selector.js';
|
|
2
|
+
export * from './types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type UseNewIntervalSelectorInputProps } from './hooks/use-interval-selector-input';
|
|
1
|
+
import { type UseNewIntervalSelectorInputProps } from './hooks/use-interval-selector-input.js';
|
|
2
2
|
type IntervalSelectorInputProps = {
|
|
3
3
|
className?: string;
|
|
4
4
|
inputClassName?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from './types';
|
|
1
|
+
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from './types.js';
|
|
2
2
|
interface IntervalSelectorSuggestionsProps {
|
|
3
3
|
relativeSuggestions: RelativeSuggestion[];
|
|
4
4
|
intervalSuggestions: IntervalSuggestion[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from './types';
|
|
1
|
+
import type { IntervalSelection, IntervalSuggestion, RelativeSuggestion } from './types.js';
|
|
2
2
|
export interface IntervalSelectorProps {
|
|
3
3
|
selection: IntervalSelection;
|
|
4
4
|
onSelectionChange: (selection: IntervalSelection) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './format';
|
|
1
|
+
export * from './constants.js';
|
|
2
|
+
export * from './format.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './item';
|
|
1
|
+
export * from './item.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './kbd';
|
|
1
|
+
export * from './kbd.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './label';
|
|
1
|
+
export * from './label.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './modal';
|
|
1
|
+
export * from './modal.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './moving-border';
|
|
1
|
+
export * from './moving-border.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './popover';
|
|
1
|
+
export * from './popover.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './scroll-area';
|
|
1
|
+
export * from './scroll-area.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Search, type SearchProps } from './search';
|
|
2
|
-
export { useSearchContext } from './search-context';
|
|
3
|
-
export { SearchInline, type SearchInlineProps } from './search-inline';
|
|
4
|
-
export { SearchContent, type SearchContentProps, SearchEmpty, type SearchEmptyProps, SearchFooter, type SearchFooterProps, SearchGroup, type SearchGroupProps, SearchInput, type SearchInputProps, SearchItem, type SearchItemProps, SearchList, type SearchListProps, SearchSeparator, type SearchSeparatorProps, } from './search-modal';
|
|
5
|
-
export { SearchTrigger, type SearchTriggerProps } from './search-trigger';
|
|
6
|
-
export { searchDefaultTransition, searchInputVariants, searchTriggerVariants, } from './search-variants';
|
|
1
|
+
export { Search, type SearchProps } from './search.js';
|
|
2
|
+
export { useSearchContext } from './search-context.js';
|
|
3
|
+
export { SearchInline, type SearchInlineProps } from './search-inline.js';
|
|
4
|
+
export { SearchContent, type SearchContentProps, SearchEmpty, type SearchEmptyProps, SearchFooter, type SearchFooterProps, SearchGroup, type SearchGroupProps, SearchInput, type SearchInputProps, SearchItem, type SearchItemProps, SearchList, type SearchListProps, SearchSeparator, type SearchSeparatorProps, } from './search-modal.js';
|
|
5
|
+
export { SearchTrigger, type SearchTriggerProps } from './search-trigger.js';
|
|
6
|
+
export { searchDefaultTransition, searchInputVariants, searchTriggerVariants, } from './search-variants.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
import { searchInputVariants } from './search-variants';
|
|
3
|
+
import { searchInputVariants } from './search-variants.js';
|
|
4
4
|
export type SearchInlineProps = Omit<ComponentProps<'input'>, 'size'> & VariantProps<typeof searchInputVariants> & {
|
|
5
5
|
showClearButton?: boolean;
|
|
6
6
|
onClear?: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
2
|
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
-
import { type ModalContentProps } from '../modal/modal';
|
|
3
|
+
import { type ModalContentProps } from '../modal/modal.js';
|
|
4
4
|
export type SearchContentProps = {
|
|
5
5
|
breakpoint?: string;
|
|
6
6
|
} & Omit<ModalContentProps, 'open' | 'onOpenChange'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
import { searchTriggerVariants } from './search-variants';
|
|
3
|
+
import { searchTriggerVariants } from './search-variants.js';
|
|
4
4
|
export type SearchTriggerProps = ComponentProps<'button'> & VariantProps<typeof searchTriggerVariants> & {
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
shortcut?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './select';
|
|
1
|
+
export * from './select.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import type { ComponentProps } from 'react';
|
|
4
|
-
import { type IconName } from '../icon';
|
|
4
|
+
import { type IconName } from '../icon/index.js';
|
|
5
5
|
declare function Select({ ...props }: ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function SelectGroup({ ...props }: ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './sheet';
|
|
1
|
+
export * from './sheet.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './shiny-text';
|
|
1
|
+
export * from './shiny-text.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { LeafAstNode } from './lexical/shipql-leaf-node';
|
|
2
|
-
export { type FacetDef, type FormatLeafDisplay, type LeafChangePayload, type RangeFacetConfig, ShipQLEditor, type ShipQLEditorProps, } from './shipql-editor';
|
|
1
|
+
export type { LeafAstNode } from './lexical/shipql-leaf-node.js';
|
|
2
|
+
export { type FacetDef, type FacetMetadata, type FormatLeafDisplay, type LeafChangePayload, type RangeFacetConfig, ShipQLEditor, type ShipQLEditorProps, } from './shipql-editor.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AstNode } from '@shipfox/shipql-parser';
|
|
2
2
|
interface OnBlurPluginProps {
|
|
3
3
|
onChange?: (ast: AstNode) => void;
|
|
4
|
+
allowFreeText?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function OnBlurPlugin({ onChange }: OnBlurPluginProps): null;
|
|
6
|
+
export declare function OnBlurPlugin({ onChange, allowFreeText }: OnBlurPluginProps): null;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=on-blur-plugin.d.ts.map
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
2
|
-
import { parse } from '@shipfox/shipql-parser';
|
|
2
|
+
import { hasTextNodes, parse } from '@shipfox/shipql-parser';
|
|
3
3
|
import { $getRoot, BLUR_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
|
-
export function OnBlurPlugin({ onChange }) {
|
|
5
|
+
export function OnBlurPlugin({ onChange, allowFreeText = true }) {
|
|
6
6
|
const [editor] = useLexicalComposerContext();
|
|
7
|
-
// Keep latest callback accessible without re-registering the command.
|
|
8
7
|
const onChangeRef = useRef(onChange);
|
|
9
8
|
onChangeRef.current = onChange;
|
|
9
|
+
const allowFreeTextRef = useRef(allowFreeText);
|
|
10
|
+
allowFreeTextRef.current = allowFreeText;
|
|
10
11
|
useEffect(()=>{
|
|
11
12
|
return editor.registerCommand(BLUR_COMMAND, ()=>{
|
|
12
13
|
const text = editor.getEditorState().read(()=>$getRoot().getTextContent());
|
|
13
14
|
try {
|
|
14
15
|
const ast = parse(text);
|
|
15
|
-
if (ast)
|
|
16
|
+
if (ast) {
|
|
17
|
+
if (!allowFreeTextRef.current && hasTextNodes(ast)) return false;
|
|
18
|
+
onChangeRef.current?.(ast);
|
|
19
|
+
}
|
|
16
20
|
} catch {
|
|
17
21
|
// Invalid query — do not call onChange.
|
|
18
22
|
}
|
|
@@ -11,20 +11,23 @@ type SerializedShipQLLeafNode = SerializedTextNode & {
|
|
|
11
11
|
export declare class ShipQLLeafNode extends TextNode {
|
|
12
12
|
__shipqlNode: LeafAstNode;
|
|
13
13
|
__displayText: string | null;
|
|
14
|
-
|
|
14
|
+
__freeTextError: boolean;
|
|
15
|
+
constructor(text: string, shipqlNode: LeafAstNode, key?: NodeKey, displayText?: string, freeTextError?: boolean);
|
|
15
16
|
static getType(): string;
|
|
16
17
|
static clone(node: ShipQLLeafNode): ShipQLLeafNode;
|
|
17
18
|
static importJSON(serialized: SerializedShipQLLeafNode): ShipQLLeafNode;
|
|
18
19
|
exportJSON(): SerializedShipQLLeafNode;
|
|
19
20
|
createDOM(config: EditorConfig): HTMLElement;
|
|
20
21
|
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
|
|
22
|
+
_isLeafValid(): boolean;
|
|
21
23
|
isSimpleText(): boolean;
|
|
22
24
|
canInsertTextAfter(): boolean;
|
|
23
25
|
canInsertTextBefore(): boolean;
|
|
24
26
|
getShipQLNode(): LeafAstNode;
|
|
25
27
|
}
|
|
26
28
|
export declare function $isShipQLLeafNode(node: unknown): node is ShipQLLeafNode;
|
|
27
|
-
export declare function $createShipQLLeafNode(text: string, shipqlNode: LeafAstNode, displayText?: string): ShipQLLeafNode;
|
|
29
|
+
export declare function $createShipQLLeafNode(text: string, shipqlNode: LeafAstNode, displayText?: string, freeTextError?: boolean): ShipQLLeafNode;
|
|
30
|
+
export declare function $setLeafFreeTextError(node: ShipQLLeafNode, value: boolean): void;
|
|
28
31
|
/** Returns true if the AST node qualifies as a visual leaf chip in the editor. */
|
|
29
32
|
export declare function isAstLeafNode(ast: AstNode): ast is LeafAstNode;
|
|
30
33
|
export declare function leafSource(node: LeafAstNode): string;
|
|
@@ -30,16 +30,17 @@ function isValidLeafText(text) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
export class ShipQLLeafNode extends TextNode {
|
|
33
|
-
constructor(text, shipqlNode, key, displayText){
|
|
33
|
+
constructor(text, shipqlNode, key, displayText, freeTextError = false){
|
|
34
34
|
super(text, key);
|
|
35
35
|
this.__shipqlNode = shipqlNode;
|
|
36
36
|
this.__displayText = displayText ?? null;
|
|
37
|
+
this.__freeTextError = freeTextError;
|
|
37
38
|
}
|
|
38
39
|
static getType() {
|
|
39
40
|
return 'shipql-leaf';
|
|
40
41
|
}
|
|
41
42
|
static clone(node) {
|
|
42
|
-
return new ShipQLLeafNode(node.__text, node.__shipqlNode, node.__key, node.__displayText ?? undefined);
|
|
43
|
+
return new ShipQLLeafNode(node.__text, node.__shipqlNode, node.__key, node.__displayText ?? undefined, node.__freeTextError);
|
|
43
44
|
}
|
|
44
45
|
static importJSON(serialized) {
|
|
45
46
|
const text = serialized.text;
|
|
@@ -80,7 +81,7 @@ export class ShipQLLeafNode extends TextNode {
|
|
|
80
81
|
if (this.__displayText) {
|
|
81
82
|
element.textContent = this.__displayText;
|
|
82
83
|
}
|
|
83
|
-
const valid =
|
|
84
|
+
const valid = this._isLeafValid();
|
|
84
85
|
for (const cls of LEAF_BASE_CLASSES.split(' '))element.classList.add(cls);
|
|
85
86
|
for (const cls of (valid ? LEAF_NORMAL_CLASSES : LEAF_ERROR_CLASSES).split(' '))element.classList.add(cls);
|
|
86
87
|
element.setAttribute('data-shipql-leaf', 'true');
|
|
@@ -89,9 +90,9 @@ export class ShipQLLeafNode extends TextNode {
|
|
|
89
90
|
}
|
|
90
91
|
updateDOM(prevNode, dom, config) {
|
|
91
92
|
const result = super.updateDOM(prevNode, dom, config);
|
|
92
|
-
if (prevNode.__text !== this.__text) {
|
|
93
|
-
const prevValid =
|
|
94
|
-
const nextValid =
|
|
93
|
+
if (prevNode.__text !== this.__text || prevNode.__freeTextError !== this.__freeTextError) {
|
|
94
|
+
const prevValid = prevNode._isLeafValid();
|
|
95
|
+
const nextValid = this._isLeafValid();
|
|
95
96
|
if (prevValid !== nextValid) {
|
|
96
97
|
for (const cls of (prevValid ? LEAF_NORMAL_CLASSES : LEAF_ERROR_CLASSES).split(' '))dom.classList.remove(cls);
|
|
97
98
|
for (const cls of (nextValid ? LEAF_NORMAL_CLASSES : LEAF_ERROR_CLASSES).split(' '))dom.classList.add(cls);
|
|
@@ -99,6 +100,11 @@ export class ShipQLLeafNode extends TextNode {
|
|
|
99
100
|
}
|
|
100
101
|
return result;
|
|
101
102
|
}
|
|
103
|
+
_isLeafValid() {
|
|
104
|
+
if (!isValidLeafText(this.__text)) return false;
|
|
105
|
+
if (this.__freeTextError) return false;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
102
108
|
isSimpleText() {
|
|
103
109
|
return false;
|
|
104
110
|
}
|
|
@@ -115,8 +121,12 @@ export class ShipQLLeafNode extends TextNode {
|
|
|
115
121
|
export function $isShipQLLeafNode(node) {
|
|
116
122
|
return node instanceof ShipQLLeafNode;
|
|
117
123
|
}
|
|
118
|
-
export function $createShipQLLeafNode(text, shipqlNode, displayText) {
|
|
119
|
-
return new ShipQLLeafNode(text, shipqlNode, undefined, displayText);
|
|
124
|
+
export function $createShipQLLeafNode(text, shipqlNode, displayText, freeTextError = false) {
|
|
125
|
+
return new ShipQLLeafNode(text, shipqlNode, undefined, displayText, freeTextError);
|
|
126
|
+
}
|
|
127
|
+
export function $setLeafFreeTextError(node, value) {
|
|
128
|
+
const writable = node.getWritable();
|
|
129
|
+
writable.__freeTextError = value;
|
|
120
130
|
}
|
|
121
131
|
/** Returns true if the AST node qualifies as a visual leaf chip in the editor. */ export function isAstLeafNode(ast) {
|
|
122
132
|
return isSimpleLeaf(ast) || isNotLeaf(ast) || isGroupedCompound(ast);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type LeafAstNode } from './shipql-leaf-node';
|
|
1
|
+
import { type LeafAstNode } from './shipql-leaf-node.js';
|
|
2
2
|
/** Payload: the Lexical node key of the leaf to remove. */
|
|
3
3
|
export declare const REMOVE_LEAF_COMMAND: import("lexical").LexicalCommand<string>;
|
|
4
4
|
interface ShipQLPluginProps {
|
|
5
5
|
onLeafFocus?: (node: LeafAstNode | null) => void;
|
|
6
6
|
formatLeafDisplay?: (source: string, node: LeafAstNode) => string;
|
|
7
|
+
allowFreeText?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function ShipQLPlugin({ onLeafFocus, formatLeafDisplay }: ShipQLPluginProps): null;
|
|
9
|
+
export declare function ShipQLPlugin({ onLeafFocus, formatLeafDisplay, allowFreeText, }: ShipQLPluginProps): null;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=shipql-plugin.d.ts.map
|