@tensor_1/react 2.17.0 → 2.19.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 (60) hide show
  1. package/README.md +131 -1
  2. package/dist/components/Comments.d.ts +18 -2
  3. package/dist/components/Comments.js +37 -12
  4. package/dist/components/EditorIcons.d.ts +39 -0
  5. package/dist/components/EditorIcons.js +51 -0
  6. package/dist/components/EmojiGlyph.d.ts +10 -0
  7. package/dist/components/EmojiGlyph.js +18 -0
  8. package/dist/components/EmojiPicker.d.ts +60 -0
  9. package/dist/components/EmojiPicker.js +277 -0
  10. package/dist/components/Markdown.d.ts +36 -0
  11. package/dist/components/Markdown.js +104 -0
  12. package/dist/components/ReactionBar.d.ts +57 -0
  13. package/dist/components/ReactionBar.js +81 -0
  14. package/dist/components/RelationshipGraph.d.ts +81 -3
  15. package/dist/components/RelationshipGraph.js +102 -59
  16. package/dist/components/RelationshipGraphLayered.d.ts +8 -0
  17. package/dist/components/RelationshipGraphLayered.js +420 -0
  18. package/dist/components/RelationshipGraphList.d.ts +16 -0
  19. package/dist/components/RelationshipGraphList.js +33 -0
  20. package/dist/components/RichTextEditor.d.ts +128 -0
  21. package/dist/components/RichTextEditor.js +954 -0
  22. package/dist/components/SaveStatus.d.ts +32 -0
  23. package/dist/components/SaveStatus.js +21 -0
  24. package/dist/components/Tabs.d.ts +10 -3
  25. package/dist/components/Tabs.js +5 -3
  26. package/dist/emoji-image-WQLh8ZQP.d.cts +128 -0
  27. package/dist/emoji-image.d.ts +25 -0
  28. package/dist/emoji-image.js +80 -0
  29. package/dist/emoji-model.d.ts +66 -0
  30. package/dist/emoji-model.js +108 -0
  31. package/dist/emoji.cjs +871 -0
  32. package/dist/emoji.d.cts +57 -0
  33. package/dist/emoji.d.ts +6 -0
  34. package/dist/emoji.js +18 -0
  35. package/dist/index.cjs +1503 -540
  36. package/dist/index.d.cts +245 -65
  37. package/dist/index.d.ts +3 -2
  38. package/dist/index.js +11 -2
  39. package/dist/markdown-model.d.ts +75 -0
  40. package/dist/markdown-model.js +438 -0
  41. package/dist/markdown.cjs +585 -0
  42. package/dist/markdown.d.cts +115 -0
  43. package/dist/markdown.d.ts +4 -0
  44. package/dist/markdown.js +9 -0
  45. package/dist/overlay-position-CEGSz6Z2.d.cts +59 -0
  46. package/dist/relationship-graph-model.d.ts +112 -1
  47. package/dist/relationship-graph-model.js +420 -1
  48. package/dist/rich-text/emoji-items.d.ts +14 -0
  49. package/dist/rich-text/emoji-items.js +7 -0
  50. package/dist/rich-text/pipeline.d.ts +91 -0
  51. package/dist/rich-text/pipeline.js +379 -0
  52. package/dist/rich-text/round-trip.d.ts +24 -0
  53. package/dist/rich-text/round-trip.js +11 -0
  54. package/dist/rich-text.cjs +2578 -0
  55. package/dist/rich-text.d.cts +148 -0
  56. package/dist/rich-text.d.ts +8 -0
  57. package/dist/rich-text.js +10 -0
  58. package/dist/url-policy.d.ts +9 -0
  59. package/dist/url-policy.js +11 -0
  60. package/package.json +82 -1
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { RelationshipGraphNode, RelationshipGraphEdge } from '../relationship-graph-model.js';
3
+ import { RelationshipGraphLabels } from './RelationshipGraph.js';
4
+
5
+ /** The list every RelationshipGraph mode pairs with its picture (internal). */
6
+ declare function EquivalentRelationshipList({ nodes, edges, selectedId, labels, onSelect, onExpandNeighbors, onOpenDetails, }: {
7
+ nodes: RelationshipGraphNode[];
8
+ edges: RelationshipGraphEdge[];
9
+ selectedId: string | undefined;
10
+ labels: RelationshipGraphLabels;
11
+ onSelect: (id: string) => void;
12
+ onExpandNeighbors: ((node: RelationshipGraphNode) => void) | undefined;
13
+ onOpenDetails: ((node: RelationshipGraphNode) => void) | undefined;
14
+ }): react.JSX.Element;
15
+
16
+ export { EquivalentRelationshipList };
@@ -0,0 +1,33 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { relationshipNeighbors } from "../relationship-graph-model.js";
3
+ function EquivalentRelationshipList({
4
+ nodes,
5
+ edges,
6
+ selectedId,
7
+ labels,
8
+ onSelect,
9
+ onExpandNeighbors,
10
+ onOpenDetails
11
+ }) {
12
+ const labelById = new Map(nodes.map((node) => [node.id, node.label]));
13
+ return /* @__PURE__ */ jsxs("div", { className: "uix-relationship-graph__list", role: "region", "aria-label": labels.list, children: [
14
+ /* @__PURE__ */ jsx("h3", { children: labels.listHeading }),
15
+ /* @__PURE__ */ jsx("ul", { children: nodes.map((node) => {
16
+ const neighbors = relationshipNeighbors(node.id, edges).map((id) => labelById.get(id) ?? id);
17
+ return /* @__PURE__ */ jsxs("li", { "data-selected": selectedId === node.id || void 0, children: [
18
+ /* @__PURE__ */ jsxs("button", { type: "button", onClick: () => onSelect(node.id), "aria-pressed": selectedId === node.id, children: [
19
+ /* @__PURE__ */ jsx("strong", { children: node.label }),
20
+ node.type && /* @__PURE__ */ jsx("span", { children: node.type }),
21
+ /* @__PURE__ */ jsx("span", { children: neighbors.length ? labels.connectedTo(neighbors.join(", ")) : labels.noConnections })
22
+ ] }),
23
+ /* @__PURE__ */ jsxs("span", { className: "uix-relationship-graph__list-actions", children: [
24
+ onExpandNeighbors && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onExpandNeighbors(node), children: labels.expandNeighbors }),
25
+ onOpenDetails && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onOpenDetails(node), children: labels.openDetails })
26
+ ] })
27
+ ] }, node.id);
28
+ }) })
29
+ ] });
30
+ }
31
+ export {
32
+ EquivalentRelationshipList
33
+ };
@@ -0,0 +1,128 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { EmojiItem } from '@tiptap/extension-emoji';
4
+ import { EmojiLocale } from '../emoji-model.js';
5
+ import { EmojiPickerLabels } from './EmojiPicker.js';
6
+ import '../overlay-position.js';
7
+
8
+ type RichTextFeatures = 'full' | 'comment' | 'template';
9
+ type RichTextHeadingLevel = 1 | 2 | 3;
10
+ /** Every visible and accessible string of the editor. Placeholders are filled by the editor. */
11
+ interface RichTextLabels {
12
+ toolbar: string;
13
+ heading1: string;
14
+ heading2: string;
15
+ heading3: string;
16
+ bold: string;
17
+ italic: string;
18
+ strike: string;
19
+ code: string;
20
+ bulletList: string;
21
+ orderedList: string;
22
+ taskList: string;
23
+ blockquote: string;
24
+ codeBlock: string;
25
+ horizontalRule: string;
26
+ link: string;
27
+ /** Label of the link address field. */
28
+ linkUrl: string;
29
+ linkApply: string;
30
+ linkRemove: string;
31
+ /** Shown when the link address is refused by `isSafeUrl`. */
32
+ linkInvalid: string;
33
+ table: string;
34
+ tableAddRow: string;
35
+ tableAddColumn: string;
36
+ tableDeleteRow: string;
37
+ tableDeleteColumn: string;
38
+ tableDelete: string;
39
+ image: string;
40
+ imageUploading: string;
41
+ imageFailed: string;
42
+ emoji: string;
43
+ /** Accessible name of the `:shortcode` suggestion list. */
44
+ emojiSuggestions: string;
45
+ undo: string;
46
+ redo: string;
47
+ /** Toggle to markdown source. */
48
+ sourceMode: string;
49
+ /** Toggle back to formatted editing. */
50
+ richMode: string;
51
+ /** Character counter. Placeholders: `{count}`, `{max}`. */
52
+ characterCount: string;
53
+ }
54
+ declare const DEFAULT_RICH_TEXT_LABELS: RichTextLabels;
55
+ interface RichTextEditorProps {
56
+ /** Markdown. */
57
+ value: string;
58
+ /**
59
+ * Fired only for user edits — never on mount or when `value` changes from outside.
60
+ * Pass the emitted markdown back as `value` in the same update (as React state does):
61
+ * a different `value` is treated as an outside change and replaces the content.
62
+ */
63
+ onChange: (markdown: string) => void;
64
+ /** Toolbar preset. Default `'full'`. */
65
+ features?: RichTextFeatures;
66
+ /** Heading levels the toolbar and input rules offer. Default `[1, 2, 3]`. */
67
+ headingLevels?: ReadonlyArray<RichTextHeadingLevel>;
68
+ /** Enables the image button (preset `full`), and image paste/drop. */
69
+ onUploadImage?: (file: File) => Promise<{
70
+ src: string;
71
+ alt: string;
72
+ }>;
73
+ /** Link policy. Default: http(s), mailto and same-app paths. */
74
+ isSafeUrl?: (url: string) => boolean;
75
+ /** Image policy: the URL to display, or `null` to show the image as a link chip. */
76
+ resolveImageSrc?: (src: string) => string | null;
77
+ /** Ctrl/Cmd+Enter. */
78
+ onSubmitShortcut?: () => void;
79
+ /** Emoji button and `:shortcode` suggestions. Default `true`. */
80
+ emoji?: boolean;
81
+ /**
82
+ * Same-origin folder of fallback emoji PNGs for devices without a colour emoji font
83
+ * (e.g. `/static/emoji`). Emoji the device cannot draw show as
84
+ * `<img src="{base}/{codepoints}.png">`; see `emojiImageFileName`. Values with a scheme or
85
+ * `//` are ignored. Unset = native emoji only; UIx ships no image set.
86
+ */
87
+ emojiImageBaseUrl?: string;
88
+ /** Shows a character counter (markdown characters); over the limit sets `aria-invalid`. */
89
+ maxLength?: number;
90
+ placeholder?: string;
91
+ disabled?: boolean;
92
+ readOnly?: boolean;
93
+ labels?: Partial<RichTextLabels>;
94
+ /** Labels of the emoji picker opened from the toolbar. */
95
+ emojiPickerLabels?: Partial<EmojiPickerLabels>;
96
+ /** Language of emoji names in the picker. Default `'en'`. */
97
+ emojiLocale?: EmojiLocale;
98
+ id?: string;
99
+ /** Renders a hidden input with the markdown, for native form posts. */
100
+ name?: string;
101
+ 'aria-label'?: string;
102
+ 'aria-labelledby'?: string;
103
+ 'aria-describedby'?: string;
104
+ 'aria-invalid'?: boolean;
105
+ 'aria-required'?: boolean;
106
+ /** `'composer'` renders inside Composer with the toolbar in ComposerBar. Default `'field'`. */
107
+ variant?: 'field' | 'composer';
108
+ /** Composer actions (visibility, send), placed at the end of the bar. */
109
+ toolbarEnd?: ReactNode;
110
+ /** Minimum visible lines. Default 4 (field) / 3 (composer). */
111
+ minRows?: number;
112
+ className?: string;
113
+ onBlur?: () => void;
114
+ }
115
+ /** `:query` → up to eight emoji whose shortcodes or tags start with the query. */
116
+ declare function suggestEmoji(query: string, limit?: number): EmojiItem[];
117
+ /** The loading/error stand-in: a plain Textarea with the same value and ARIA, and the composer bar. */
118
+ declare function RichTextEditorFallback(props: RichTextEditorProps): react.JSX.Element;
119
+ /**
120
+ * Markdown rich-text editor on Tiptap v3 (RTE-01). Markdown in, markdown out:
121
+ * untouched blocks keep their exact source bytes, `onChange` fires only for user
122
+ * edits, emoji are stored as Unicode, raw HTML is never interpreted, and links and
123
+ * images pass the consumer's policy. The toolbar is one tab stop (arrow keys move
124
+ * within it) and scrolls horizontally on narrow screens.
125
+ */
126
+ declare function RichTextEditor(props: RichTextEditorProps): react.JSX.Element;
127
+
128
+ export { DEFAULT_RICH_TEXT_LABELS, RichTextEditor, RichTextEditorFallback, type RichTextEditorProps, type RichTextFeatures, type RichTextHeadingLevel, type RichTextLabels, suggestEmoji };