@oliasoft-open-source/react-ui-library 9.0.3 → 9.1.0-beta-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.
Files changed (23) hide show
  1. package/dist/components/icon/named-icon.d.ts.map +1 -1
  2. package/dist/components/rich-text-input/mention/create-mention-extension.d.ts +38 -0
  3. package/dist/components/rich-text-input/mention/create-mention-extension.d.ts.map +1 -0
  4. package/dist/components/rich-text-input/mention/mention-suggestions.d.ts +13 -0
  5. package/dist/components/rich-text-input/mention/mention-suggestions.d.ts.map +1 -0
  6. package/dist/components/rich-text-input/mention/mention.interface.d.ts +11 -0
  7. package/dist/components/rich-text-input/mention/mention.interface.d.ts.map +1 -0
  8. package/dist/components/rich-text-input/rich-text-input.d.ts +12 -2
  9. package/dist/components/rich-text-input/rich-text-input.d.ts.map +1 -1
  10. package/dist/components/rich-text-input/rich-text-input.stories.d.ts +1 -0
  11. package/dist/components/rich-text-input/rich-text-input.stories.d.ts.map +1 -1
  12. package/dist/components/rich-text-input/rich-text-toolbar/enum.d.ts +2 -1
  13. package/dist/components/rich-text-input/rich-text-toolbar/enum.d.ts.map +1 -1
  14. package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.d.ts +2 -1
  15. package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.d.ts.map +1 -1
  16. package/dist/components/select/custom-select/hooks/use-custom-select-logic.d.ts +1 -1
  17. package/dist/global.css +1 -1
  18. package/dist/helpers/floating-layer/hooks/use-floating-layer.d.ts +2 -1
  19. package/dist/helpers/floating-layer/hooks/use-floating-layer.d.ts.map +1 -1
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +2481 -2323
  23. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"named-icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/named-icon.tsx"],"names":[],"mappings":"AAqHA,eAAO,MAAM,SAAS,UAsJrB,CAAC;AAEF,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,SAAS,GAAI,UAAU,cAAc,mDA2QjD,CAAC"}
1
+ {"version":3,"file":"named-icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/named-icon.tsx"],"names":[],"mappings":"AAsHA,eAAO,MAAM,SAAS,UAuJrB,CAAC;AAEF,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,SAAS,GAAI,UAAU,cAAc,mDA6QjD,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { MentionOptions } from '@tiptap/extension-mention';
2
+ import { Editor } from '@tiptap/react';
3
+ import { IMentionItem, IMentionsConfig } from './mention.interface';
4
+ type TMentionResolver = () => IMentionsConfig | undefined;
5
+ type TMentionSuggestionRender = NonNullable<NonNullable<MentionOptions<IMentionItem>['suggestion']>['render']>;
6
+ export type TMentionSuggestionProps = Parameters<NonNullable<ReturnType<TMentionSuggestionRender>['onStart']>>[0];
7
+ /**
8
+ * Read a mention out of the start of a markdown source string.
9
+ * @param src The markdown source to read from
10
+ * @returns The mention's raw text, id and label, or undefined when `src` does not start with a mention
11
+ */
12
+ export declare const matchMentionMarkdown: (src: string) => {
13
+ raw: string;
14
+ id: string;
15
+ label: string;
16
+ } | undefined;
17
+ /**
18
+ * Collect the ids of every mention node currently in the document, in document order and without duplicates.
19
+ * @param editor The editor to read, or null before it is created
20
+ * @returns The mentioned ids
21
+ */
22
+ export declare const getMentionedIds: (editor: Editor | null) => string[];
23
+ /**
24
+ * Serialise a mention to the markdown link the tokenizer below reads back.
25
+ * @param label The mention's display label
26
+ * @param id The mentioned entity's id
27
+ * @returns The markdown for the mention
28
+ */
29
+ export declare const renderMentionMarkdown: (label: string, id: string) => string;
30
+ /**
31
+ * Build the mention node extension, wiring the suggestion popup to the consumer's item resolver.
32
+ * @param mentions Resolves the consumer's latest mention configuration
33
+ * @param render The suggestion popup renderer
34
+ * @returns The configured Mention extension
35
+ */
36
+ export declare const createMentionExtension: (mentions: TMentionResolver, render: TMentionSuggestionRender) => import('@tiptap/core').Node<MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>;
37
+ export {};
38
+ //# sourceMappingURL=create-mention-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mention-extension.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/mention/create-mention-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMpE,KAAK,gBAAgB,GAAG,MAAM,eAAe,GAAG,SAAS,CAAC;AAI1D,KAAK,wBAAwB,GAAG,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE/G,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAQlH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM;;;;aAU/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,MAAM,EAc7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,IAAI,MAAM,WACK,CAAC;AAErE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,gBAAgB,EAAE,QAAQ,wBAAwB,gHA+B/F,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { IMentionItem } from './mention.interface';
2
+ export interface IMentionSuggestionsHandle {
3
+ onKeyDown: (event: KeyboardEvent) => boolean;
4
+ }
5
+ export interface IMentionSuggestionsProps {
6
+ editable: HTMLElement | null;
7
+ getRect: (() => DOMRect | null) | null;
8
+ items: IMentionItem[];
9
+ onDismiss: () => void;
10
+ onSelect: (item: IMentionItem) => void;
11
+ }
12
+ export declare const MentionSuggestions: import('react').ForwardRefExoticComponent<IMentionSuggestionsProps & import('react').RefAttributes<IMentionSuggestionsHandle>>;
13
+ //# sourceMappingURL=mention-suggestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mention-suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/mention/mention-suggestions.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;CAC9C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACvC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,kBAAkB,gIAqH9B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface IMentionItem {
2
+ id: string;
3
+ label: string;
4
+ }
5
+ export interface IMentionsConfig {
6
+ getItems: (query: string, context: {
7
+ mentionedIds: string[];
8
+ }) => IMentionItem[] | Promise<IMentionItem[]>;
9
+ showMentionButton?: boolean;
10
+ }
11
+ //# sourceMappingURL=mention.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mention.interface.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/mention/mention.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC3G,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1,10 +1,20 @@
1
1
  import { ReactNode } from 'react';
2
+ import { Editor } from '@tiptap/react';
3
+ import { IMentionsConfig } from './mention/mention.interface';
4
+ export interface IRichTextInputHandle {
5
+ clearContent: () => void;
6
+ editor: Editor | null;
7
+ getMentionedIds: () => string[];
8
+ }
2
9
  export interface IRichTextInputProps {
3
10
  disabled?: boolean;
4
- onChange?: (markdown: string) => void;
11
+ mentions?: IMentionsConfig;
12
+ onChange?: (markdown: string, meta: {
13
+ mentionedIds: string[];
14
+ }) => void;
5
15
  placeholder?: string;
6
16
  value?: string;
7
17
  toolbarComponent?: ReactNode;
8
18
  }
9
- export declare const RichTextInput: import('react').NamedExoticComponent<IRichTextInputProps & import('react').RefAttributes<any>>;
19
+ export declare const RichTextInput: import('react').NamedExoticComponent<IRichTextInputProps & import('react').RefAttributes<IRichTextInputHandle>>;
10
20
  //# sourceMappingURL=rich-text-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-input.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-input/rich-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUhG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,gGAmDzB,CAAC"}
1
+ {"version":3,"file":"rich-text-input.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-input/rich-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAA4B,MAAM,EAAE,MAAM,eAAe,CAAC;AAUjE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAmB9D,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,iHAsGzB,CAAC"}
@@ -7,5 +7,6 @@ export declare const Filled: import('storybook/internal/csf').AnnotatedStoryFn<i
7
7
  export declare const Placeholder: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-vite').ReactRenderer, IRichTextInputProps>;
8
8
  export declare const Disabled: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-vite').ReactRenderer, IRichTextInputProps>;
9
9
  export declare const HandlingStateExternallyWithRef: () => import("react/jsx-runtime").JSX.Element;
10
+ export declare const WithMentions: () => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const WithToolbarComponent: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react-vite').ReactRenderer, IRichTextInputProps>;
11
12
  //# sourceMappingURL=rich-text-input.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-input/rich-text-input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAiB,MAAM,mBAAmB,CAAC;wBAQlE,IAAI;AAJT,wBAIU;AAcV,eAAO,MAAM,OAAO,uHAAoB,CAAC;AAEzC,eAAO,MAAM,MAAM,uHAAoB,CAAC;AAMxC,eAAO,MAAM,WAAW,uHAAoB,CAAC;AAK7C,eAAO,MAAM,QAAQ,uHAAoB,CAAC;AAK1C,eAAO,MAAM,8BAA8B,+CAmB1C,CAAC;AA4BF,eAAO,MAAM,oBAAoB,uHAAoB,CAAC"}
1
+ {"version":3,"file":"rich-text-input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text-input/rich-text-input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAwB,mBAAmB,EAAiB,MAAM,mBAAmB,CAAC;wBASxF,IAAI;AAJT,wBAIU;AAcV,eAAO,MAAM,OAAO,uHAAoB,CAAC;AAEzC,eAAO,MAAM,MAAM,uHAAoB,CAAC;AAMxC,eAAO,MAAM,WAAW,uHAAoB,CAAC;AAK7C,eAAO,MAAM,QAAQ,uHAAoB,CAAC;AAK1C,eAAO,MAAM,8BAA8B,+CAmB1C,CAAC;AAsBF,eAAO,MAAM,YAAY,+CA0CxB,CAAC;AA4BF,eAAO,MAAM,oBAAoB,uHAAoB,CAAC"}
@@ -3,6 +3,7 @@ export declare enum RichTextIcon {
3
3
  ITALIC = "italic",
4
4
  CODE = "code",
5
5
  UL = "ul",
6
- OL = "ol"
6
+ OL = "ol",
7
+ MENTION = "at"
7
8
  }
8
9
  //# sourceMappingURL=enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/rich-text-toolbar/enum.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,EAAE,OAAO;IACT,EAAE,OAAO;CACV"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/rich-text-toolbar/enum.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,EAAE,OAAO;IACT,EAAE,OAAO;IACT,OAAO,OAAO;CACf"}
@@ -3,7 +3,8 @@ import { Editor } from '@tiptap/react';
3
3
  export interface IRichTextToolbarProps {
4
4
  editor: Editor | null;
5
5
  disabled?: boolean;
6
+ showMentionButton?: boolean;
6
7
  toolbarComponent?: ReactNode;
7
8
  }
8
- export declare const RichTextToolbar: ({ editor, disabled, toolbarComponent }: IRichTextToolbarProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const RichTextToolbar: ({ editor, disabled, showMentionButton, toolbarComponent, }: IRichTextToolbarProps) => import("react/jsx-runtime").JSX.Element;
9
10
  //# sourceMappingURL=rich-text-toolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,eAAe,GAAI,wCAAuD,qBAAqB,4CAiD3G,CAAC"}
1
+ {"version":3,"file":"rich-text-toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,eAAe,GAAI,4DAK7B,qBAAqB,4CAyDvB,CAAC"}
@@ -27,7 +27,7 @@ export declare const useCustomSelectLogic: ({ state, dispatch, options, setTrigg
27
27
  onKeyEvent: (key: string | ICustomSelectDirection, evt: KeyboardEvent<HTMLElement>) => void;
28
28
  clearAllIsFocused: boolean;
29
29
  triggerProps: React.HTMLAttributes<HTMLElement> & {
30
- ref: (node: Element | null) => void;
30
+ ref: (node: Element | import('@floating-ui/react').VirtualElement | null) => void;
31
31
  };
32
32
  onClickTrigger: () => void;
33
33
  onChangeSearch: (value: any) => void;