@shapesos/clay 0.8.2 → 0.10.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.
- package/README.md +46 -1
- package/dist/blocks.cjs +650 -0
- package/dist/blocks.cjs.map +1 -0
- package/dist/blocks.d.cts +29 -0
- package/dist/blocks.d.ts +29 -0
- package/dist/blocks.js +21 -0
- package/dist/blocks.js.map +1 -0
- package/dist/button.cjs +98 -71
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +10 -1
- package/dist/button.d.ts +10 -1
- package/dist/button.js +3 -1
- package/dist/chat.cjs +89 -47
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.d.cts +7 -3
- package/dist/chat.d.ts +7 -3
- package/dist/chat.js +3 -2
- package/dist/chunk-EDICS62G.js +177 -0
- package/dist/chunk-EDICS62G.js.map +1 -0
- package/dist/chunk-OKPNST44.js +1 -0
- package/dist/chunk-OKPNST44.js.map +1 -0
- package/dist/chunk-R3BGPOAM.js +230 -0
- package/dist/chunk-R3BGPOAM.js.map +1 -0
- package/dist/{chunk-TDMJUF4A.js → chunk-WPQQVKWY.js} +4 -4
- package/dist/{chunk-A77BGJH4.js → chunk-WS4IPADR.js} +34 -201
- package/dist/chunk-WS4IPADR.js.map +1 -0
- package/dist/index.cjs +228 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +30 -13
- package/dist/text-area.js +2 -2
- package/dist/types-Q9aqd9nq.d.cts +34 -0
- package/dist/types-Q9aqd9nq.d.ts +34 -0
- package/package.json +6 -1
- package/dist/chunk-A77BGJH4.js.map +0 -1
- package/dist/chunk-FFABDVB3.js +0 -149
- package/dist/chunk-FFABDVB3.js.map +0 -1
- /package/dist/{chunk-TDMJUF4A.js.map → chunk-WPQQVKWY.js.map} +0 -0
package/dist/chat.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
4
|
+
import { a as BlockRecord } from './types-Q9aqd9nq.js';
|
|
3
5
|
|
|
4
6
|
/** The sender of a chat message. */
|
|
5
7
|
type MessageRole = "user" | "assistant";
|
|
@@ -9,8 +11,10 @@ interface ChatMessage$1 {
|
|
|
9
11
|
id: string;
|
|
10
12
|
/** Who sent this message — the end-user or the AI assistant. */
|
|
11
13
|
role: MessageRole;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
+
/** Ordered content blocks. Render order is array order; new block types extend the discriminated union additively. */
|
|
15
|
+
blocks: BlockRecord[];
|
|
16
|
+
/** Plain-text representation of the blocks, supplied by the server. Used for clipboard copy and accessibility — clay does not derive it. */
|
|
17
|
+
fallbackText: string;
|
|
14
18
|
/** Feedback state: `true` = helpful, `false` = not helpful, `null`/`undefined` = no feedback given. */
|
|
15
19
|
isHelpful?: boolean | null;
|
|
16
20
|
}
|
|
@@ -31,7 +35,7 @@ interface ChatContextValue {
|
|
|
31
35
|
/** Called when the user clicks the "thumbs down" button. Receives the message ID and the new feedback value (`false` = selected, `null` = deselected). */
|
|
32
36
|
onThumbDownClick?: (messageId: string, isHelpful: boolean | null) => void;
|
|
33
37
|
/** Component rendered below each table (e.g. an export button). Receives the message ID and the zero-based table index as props. */
|
|
34
|
-
TableActions?:
|
|
38
|
+
TableActions?: ComponentType<{
|
|
35
39
|
messageId: string;
|
|
36
40
|
tableIndex: number;
|
|
37
41
|
}>;
|
package/dist/chat.js
CHANGED
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
MESSAGE_ROLE,
|
|
5
5
|
useChatContext,
|
|
6
6
|
useCopyToClipboard
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WS4IPADR.js";
|
|
8
|
+
import "./chunk-NMKKU2UG.js";
|
|
9
|
+
import "./chunk-R3BGPOAM.js";
|
|
8
10
|
import "./chunk-MLCRDVQ2.js";
|
|
9
11
|
import "./chunk-SV24ONND.js";
|
|
10
12
|
import "./chunk-OLJIJYB5.js";
|
|
11
13
|
import "./chunk-JF3P66JF.js";
|
|
12
|
-
import "./chunk-NMKKU2UG.js";
|
|
13
14
|
import "./chunk-5WRI5ZAA.js";
|
|
14
15
|
export {
|
|
15
16
|
ChatContext,
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {
|
|
2
|
+
typographyMixin,
|
|
3
|
+
typographyTypes
|
|
4
|
+
} from "./chunk-SV24ONND.js";
|
|
5
|
+
import {
|
|
6
|
+
Icon
|
|
7
|
+
} from "./chunk-OLJIJYB5.js";
|
|
8
|
+
import {
|
|
9
|
+
colors
|
|
10
|
+
} from "./chunk-JF3P66JF.js";
|
|
11
|
+
|
|
12
|
+
// src/components/button/button.tsx
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
|
|
15
|
+
// src/components/button/button-styles.ts
|
|
16
|
+
import styled, { css } from "styled-components";
|
|
17
|
+
|
|
18
|
+
// src/components/button/constants.ts
|
|
19
|
+
var BUTTON_VARIANT = {
|
|
20
|
+
SOLID: "solid",
|
|
21
|
+
OUTLINE: "outline",
|
|
22
|
+
GHOST: "ghost"
|
|
23
|
+
};
|
|
24
|
+
var BUTTON_SIZE = {
|
|
25
|
+
XS: "xs",
|
|
26
|
+
S: "s",
|
|
27
|
+
M: "m"
|
|
28
|
+
};
|
|
29
|
+
var BUTTON_INTENT = {
|
|
30
|
+
PRIMARY: "primary",
|
|
31
|
+
ERROR: "error"
|
|
32
|
+
};
|
|
33
|
+
var ICON_POSITION = {
|
|
34
|
+
LEADING: "leading",
|
|
35
|
+
TRAILING: "trailing"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// src/components/button/button-styles.ts
|
|
39
|
+
var intentColors = {
|
|
40
|
+
[BUTTON_INTENT.PRIMARY]: {
|
|
41
|
+
base: colors["brown-100"],
|
|
42
|
+
hover: colors["brown-90"],
|
|
43
|
+
disabledBg: colors["brown-20"],
|
|
44
|
+
disabledText: colors["brown-50"],
|
|
45
|
+
subtleHover: colors["brown-20"],
|
|
46
|
+
border: colors["brown-40"],
|
|
47
|
+
disabledBorder: colors["brown-20"]
|
|
48
|
+
},
|
|
49
|
+
[BUTTON_INTENT.ERROR]: {
|
|
50
|
+
base: colors["red-500"],
|
|
51
|
+
hover: colors["red-600"],
|
|
52
|
+
disabledBg: colors["red-100"],
|
|
53
|
+
disabledText: colors["red-200"],
|
|
54
|
+
subtleHover: colors["red-50"],
|
|
55
|
+
border: colors["red-200"],
|
|
56
|
+
disabledBorder: colors["red-100"]
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var sizeValues = {
|
|
60
|
+
[BUTTON_SIZE.XS]: { padding: "6px 10px", borderRadius: "8px", gap: "4px" },
|
|
61
|
+
[BUTTON_SIZE.S]: { padding: "8px 12px", borderRadius: "10px", gap: "6px" },
|
|
62
|
+
[BUTTON_SIZE.M]: { padding: "10px 14px", borderRadius: "10px", gap: "6px" }
|
|
63
|
+
};
|
|
64
|
+
function sizeMixin({ $size }) {
|
|
65
|
+
const s = sizeValues[$size];
|
|
66
|
+
return css`
|
|
67
|
+
padding: ${s.padding};
|
|
68
|
+
border-radius: ${s.borderRadius};
|
|
69
|
+
gap: ${s.gap};
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
var variantColorMap = {
|
|
73
|
+
[BUTTON_VARIANT.SOLID]: (c) => ({
|
|
74
|
+
background: c.base,
|
|
75
|
+
color: colors.white,
|
|
76
|
+
border: "none",
|
|
77
|
+
hoverBg: c.hover,
|
|
78
|
+
disabledBg: c.disabledBg,
|
|
79
|
+
disabledColor: c.disabledText
|
|
80
|
+
}),
|
|
81
|
+
[BUTTON_VARIANT.OUTLINE]: (c) => ({
|
|
82
|
+
background: colors.white,
|
|
83
|
+
color: c.base,
|
|
84
|
+
border: `1px solid ${c.border}`,
|
|
85
|
+
hoverBg: c.subtleHover,
|
|
86
|
+
disabledColor: c.disabledText,
|
|
87
|
+
disabledBorder: c.disabledBorder
|
|
88
|
+
}),
|
|
89
|
+
[BUTTON_VARIANT.GHOST]: (c) => ({
|
|
90
|
+
background: "transparent",
|
|
91
|
+
color: c.base,
|
|
92
|
+
border: "none",
|
|
93
|
+
hoverBg: c.subtleHover,
|
|
94
|
+
disabledColor: c.disabledText
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
function variantMixin({
|
|
98
|
+
$variant,
|
|
99
|
+
$intent
|
|
100
|
+
}) {
|
|
101
|
+
const v = variantColorMap[$variant](intentColors[$intent]);
|
|
102
|
+
return css`
|
|
103
|
+
background: ${v.background};
|
|
104
|
+
color: ${v.color};
|
|
105
|
+
border: ${v.border};
|
|
106
|
+
|
|
107
|
+
&:hover:not(:disabled) {
|
|
108
|
+
background: ${v.hoverBg};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:disabled {
|
|
112
|
+
color: ${v.disabledColor};
|
|
113
|
+
${v.disabledBg ? `background: ${v.disabledBg};` : ""}
|
|
114
|
+
${v.disabledBorder ? `border-color: ${v.disabledBorder};` : ""}
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
var StyledButton = styled.button`
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};
|
|
124
|
+
transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
|
|
125
|
+
|
|
126
|
+
&:disabled {
|
|
127
|
+
cursor: not-allowed;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
${sizeMixin}
|
|
131
|
+
${variantMixin}
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
// src/components/button/button.tsx
|
|
135
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
136
|
+
var Button = forwardRef(function Button2({
|
|
137
|
+
children,
|
|
138
|
+
variant = BUTTON_VARIANT.SOLID,
|
|
139
|
+
intent = BUTTON_INTENT.PRIMARY,
|
|
140
|
+
size = BUTTON_SIZE.M,
|
|
141
|
+
icon,
|
|
142
|
+
iconPosition = ICON_POSITION.LEADING,
|
|
143
|
+
disabled = false,
|
|
144
|
+
onClick,
|
|
145
|
+
className,
|
|
146
|
+
"aria-label": ariaLabel
|
|
147
|
+
}, ref) {
|
|
148
|
+
const iconElement = icon ? /* @__PURE__ */ jsx(Icon, { icon, size: 16 }) : null;
|
|
149
|
+
return /* @__PURE__ */ jsxs(
|
|
150
|
+
StyledButton,
|
|
151
|
+
{
|
|
152
|
+
ref,
|
|
153
|
+
type: "button",
|
|
154
|
+
$variant: variant,
|
|
155
|
+
$intent: intent,
|
|
156
|
+
$size: size,
|
|
157
|
+
disabled,
|
|
158
|
+
onClick: disabled ? void 0 : onClick,
|
|
159
|
+
className,
|
|
160
|
+
"aria-label": ariaLabel,
|
|
161
|
+
children: [
|
|
162
|
+
iconPosition === ICON_POSITION.LEADING && iconElement,
|
|
163
|
+
/* @__PURE__ */ jsx("span", { children }),
|
|
164
|
+
iconPosition === ICON_POSITION.TRAILING && iconElement
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export {
|
|
171
|
+
BUTTON_VARIANT,
|
|
172
|
+
BUTTON_SIZE,
|
|
173
|
+
BUTTON_INTENT,
|
|
174
|
+
ICON_POSITION,
|
|
175
|
+
Button
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=chunk-EDICS62G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/button/button.tsx","../src/components/button/button-styles.ts","../src/components/button/constants.ts"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../icon/icon\";\nimport { StyledButton } from \"./button-styles\";\nimport { BUTTON_INTENT, BUTTON_SIZE, BUTTON_VARIANT, ICON_POSITION } from \"./constants\";\nimport type { ButtonProps } from \"./types\";\n\n/** A versatile button component with multiple variants and sizes. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n variant = BUTTON_VARIANT.SOLID,\n intent = BUTTON_INTENT.PRIMARY,\n size = BUTTON_SIZE.M,\n icon,\n iconPosition = ICON_POSITION.LEADING,\n disabled = false,\n onClick,\n className,\n \"aria-label\": ariaLabel,\n },\n ref\n) {\n const iconElement = icon ? <Icon icon={icon} size={16} /> : null;\n\n return (\n <StyledButton\n ref={ref}\n type=\"button\"\n $variant={variant}\n $intent={intent}\n $size={size}\n disabled={disabled}\n onClick={disabled ? undefined : onClick}\n className={className}\n aria-label={ariaLabel}\n >\n {iconPosition === ICON_POSITION.LEADING && iconElement}\n <span>{children}</span>\n {iconPosition === ICON_POSITION.TRAILING && iconElement}\n </StyledButton>\n );\n});\n","import styled, { css } from \"styled-components\";\nimport { colors } from \"../../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../../tokens/typography\";\nimport { BUTTON_INTENT, BUTTON_SIZE, BUTTON_VARIANT } from \"./constants\";\nimport type { ButtonIntent, ButtonSize, ButtonVariant } from \"./types\";\n\ninterface IntentColors {\n /** Primary fill / text color. */\n base: string;\n /** Hover fill for solid variant. */\n hover: string;\n /** Muted fill for disabled solid variant. */\n disabledBg: string;\n /** Muted text for disabled state. */\n disabledText: string;\n /** Subtle hover background for outline/ghost variants. */\n subtleHover: string;\n /** Border color for outline variant. */\n border: string;\n /** Muted border for disabled outline variant. */\n disabledBorder: string;\n}\n\nconst intentColors: Record<ButtonIntent, IntentColors> = {\n [BUTTON_INTENT.PRIMARY]: {\n base: colors[\"brown-100\"],\n hover: colors[\"brown-90\"],\n disabledBg: colors[\"brown-20\"],\n disabledText: colors[\"brown-50\"],\n subtleHover: colors[\"brown-20\"],\n border: colors[\"brown-40\"],\n disabledBorder: colors[\"brown-20\"],\n },\n [BUTTON_INTENT.ERROR]: {\n base: colors[\"red-500\"],\n hover: colors[\"red-600\"],\n disabledBg: colors[\"red-100\"],\n disabledText: colors[\"red-200\"],\n subtleHover: colors[\"red-50\"],\n border: colors[\"red-200\"],\n disabledBorder: colors[\"red-100\"],\n },\n};\n\ninterface SizeValues {\n padding: string;\n borderRadius: string;\n gap: string;\n}\n\nconst sizeValues: Record<ButtonSize, SizeValues> = {\n [BUTTON_SIZE.XS]: { padding: \"6px 10px\", borderRadius: \"8px\", gap: \"4px\" },\n [BUTTON_SIZE.S]: { padding: \"8px 12px\", borderRadius: \"10px\", gap: \"6px\" },\n [BUTTON_SIZE.M]: { padding: \"10px 14px\", borderRadius: \"10px\", gap: \"6px\" },\n};\n\nfunction sizeMixin({ $size }: { $size: ButtonSize }): ReturnType<typeof css> {\n const s = sizeValues[$size];\n return css`\n padding: ${s.padding};\n border-radius: ${s.borderRadius};\n gap: ${s.gap};\n `;\n}\n\ninterface VariantColorMap {\n background: string;\n color: string;\n border: string;\n hoverBg: string;\n disabledBg?: string;\n disabledColor: string;\n disabledBorder?: string;\n}\n\nconst variantColorMap: Record<ButtonVariant, (c: IntentColors) => VariantColorMap> = {\n [BUTTON_VARIANT.SOLID]: (c) => ({\n background: c.base,\n color: colors.white,\n border: \"none\",\n hoverBg: c.hover,\n disabledBg: c.disabledBg,\n disabledColor: c.disabledText,\n }),\n [BUTTON_VARIANT.OUTLINE]: (c) => ({\n background: colors.white,\n color: c.base,\n border: `1px solid ${c.border}`,\n hoverBg: c.subtleHover,\n disabledColor: c.disabledText,\n disabledBorder: c.disabledBorder,\n }),\n [BUTTON_VARIANT.GHOST]: (c) => ({\n background: \"transparent\",\n color: c.base,\n border: \"none\",\n hoverBg: c.subtleHover,\n disabledColor: c.disabledText,\n }),\n};\n\nfunction variantMixin({\n $variant,\n $intent,\n}: {\n $variant: ButtonVariant;\n $intent: ButtonIntent;\n}): ReturnType<typeof css> {\n const v = variantColorMap[$variant](intentColors[$intent]);\n\n return css`\n background: ${v.background};\n color: ${v.color};\n border: ${v.border};\n\n &:hover:not(:disabled) {\n background: ${v.hoverBg};\n }\n\n &:disabled {\n color: ${v.disabledColor};\n ${v.disabledBg ? `background: ${v.disabledBg};` : \"\"}\n ${v.disabledBorder ? `border-color: ${v.disabledBorder};` : \"\"}\n }\n `;\n}\n\n/** Styled button element with variant, intent, and size transient props. */\nexport const StyledButton = styled.button<{\n $variant: ButtonVariant;\n $intent: ButtonIntent;\n $size: ButtonSize;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ${sizeMixin}\n ${variantMixin}\n`;\n","/** Available visual style variants for the Button component. */\nexport const BUTTON_VARIANT = {\n SOLID: \"solid\",\n OUTLINE: \"outline\",\n GHOST: \"ghost\",\n} as const;\n\n/** Available size presets for the Button component. */\nexport const BUTTON_SIZE = {\n XS: \"xs\",\n S: \"s\",\n M: \"m\",\n} as const;\n\n/** Available semantic intents for the Button component. */\nexport const BUTTON_INTENT = {\n PRIMARY: \"primary\",\n ERROR: \"error\",\n} as const;\n\n/** Available icon positions relative to the label text. */\nexport const ICON_POSITION = {\n LEADING: \"leading\",\n TRAILING: \"trailing\",\n} as const;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,kBAAkB;;;ACA3B,OAAO,UAAU,WAAW;;;ACCrB,IAAM,iBAAiB;AAAA,EAC5B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACT;AAGO,IAAM,cAAc;AAAA,EACzB,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,GAAG;AACL;AAGO,IAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AACT;AAGO,IAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,UAAU;AACZ;;;ADDA,IAAM,eAAmD;AAAA,EACvD,CAAC,cAAc,OAAO,GAAG;AAAA,IACvB,MAA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;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,OAAO;AAAA,MACP;AAAA,MACA,SAAS,WAAW,SAAY;AAAA,MAChC;AAAA,MACA,cAAY;AAAA,MAEX;AAAA,yBAAiB,cAAc,WAAW;AAAA,QAC3C,oBAAC,UAAM,UAAS;AAAA,QACf,iBAAiB,cAAc,YAAY;AAAA;AAAA;AAAA,EAC9C;AAEJ,CAAC;","names":["Button"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-OKPNST44.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
typographyMixin,
|
|
3
|
+
typographyTypes
|
|
4
|
+
} from "./chunk-SV24ONND.js";
|
|
5
|
+
import {
|
|
6
|
+
colors
|
|
7
|
+
} from "./chunk-JF3P66JF.js";
|
|
8
|
+
|
|
9
|
+
// src/components/blocks/block-context/block-context.tsx
|
|
10
|
+
import { createContext, useContext } from "react";
|
|
11
|
+
var BlockContext = createContext(null);
|
|
12
|
+
function useBlockContext() {
|
|
13
|
+
return useContext(BlockContext) ?? {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/components/blocks/types.ts
|
|
17
|
+
var blockTypes = {
|
|
18
|
+
TEXT: "TEXT"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// src/components/blocks/text-block/text-block.tsx
|
|
22
|
+
import ReactMarkdown from "react-markdown";
|
|
23
|
+
import remarkBreaks from "remark-breaks";
|
|
24
|
+
import remarkGfm from "remark-gfm";
|
|
25
|
+
|
|
26
|
+
// src/components/blocks/scrollable-table/scrollable-table-styles.ts
|
|
27
|
+
import styled from "styled-components";
|
|
28
|
+
var TableContainer = styled.div`
|
|
29
|
+
position: relative;
|
|
30
|
+
margin-block: 8px 16px;
|
|
31
|
+
`;
|
|
32
|
+
var TableScroll = styled.div`
|
|
33
|
+
width: 100%;
|
|
34
|
+
overflow-x: auto;
|
|
35
|
+
overflow-y: hidden;
|
|
36
|
+
`;
|
|
37
|
+
var TableActionsWrapper = styled.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: flex-start;
|
|
40
|
+
margin-block: 8px 0;
|
|
41
|
+
`;
|
|
42
|
+
var TableActionsDivider = styled.div`
|
|
43
|
+
height: 1px;
|
|
44
|
+
background: ${colors["brown-40"]};
|
|
45
|
+
margin-block: 8px 0;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
// src/components/blocks/scrollable-table/scrollable-table.tsx
|
|
49
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
50
|
+
function ScrollableTable({ node: _node, counter, ...props }) {
|
|
51
|
+
const currentIndex = counter ? counter.value : 0;
|
|
52
|
+
if (counter) {
|
|
53
|
+
counter.value += 1;
|
|
54
|
+
}
|
|
55
|
+
const { TableActions } = useBlockContext();
|
|
56
|
+
return /* @__PURE__ */ jsxs(TableContainer, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(TableScroll, { children: /* @__PURE__ */ jsx("table", { ...props }) }),
|
|
58
|
+
TableActions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(TableActionsWrapper, { children: /* @__PURE__ */ jsx(TableActions, { tableIndex: currentIndex }) }),
|
|
60
|
+
/* @__PURE__ */ jsx(TableActionsDivider, {})
|
|
61
|
+
] })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/components/blocks/text-block/sanitize.ts
|
|
66
|
+
function sanitize(text) {
|
|
67
|
+
return text.split("\n").filter((line) => {
|
|
68
|
+
const t = line.trim();
|
|
69
|
+
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
70
|
+
}).join("\n");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/components/blocks/text-block/text-block-styles.ts
|
|
74
|
+
import styled2 from "styled-components";
|
|
75
|
+
var TextBlockWrapper = styled2.div`
|
|
76
|
+
${typographyMixin(typographyTypes.GEIST_BODY_S_REGULAR)};
|
|
77
|
+
color: ${colors["brown-100"]};
|
|
78
|
+
word-break: break-word;
|
|
79
|
+
|
|
80
|
+
& h1 {
|
|
81
|
+
${typographyMixin(typographyTypes.GEIST_HEADING_S_BOLD)};
|
|
82
|
+
margin-block: 20px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
& h2 {
|
|
86
|
+
${typographyMixin(typographyTypes.GEIST_BODY_L_SEMI_BOLD)};
|
|
87
|
+
margin-block: 12px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
& h3,
|
|
91
|
+
& h4,
|
|
92
|
+
& h5,
|
|
93
|
+
& h6 {
|
|
94
|
+
${typographyMixin(typographyTypes.GEIST_BODY_M_SEMI_BOLD)};
|
|
95
|
+
margin-block: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
& strong {
|
|
99
|
+
${typographyMixin(typographyTypes.GEIST_BODY_S_SEMI_BOLD)};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
& p {
|
|
103
|
+
margin-block: 0px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
& p + p {
|
|
107
|
+
margin-block: 8px 0px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
& ul,
|
|
111
|
+
& ol {
|
|
112
|
+
margin-block: 16px;
|
|
113
|
+
padding-left: 20px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
& li + li {
|
|
117
|
+
margin-block: 4px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
& ol {
|
|
121
|
+
list-style-type: decimal;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
& ol ol {
|
|
125
|
+
list-style-type: lower-alpha;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
& ol ol ol {
|
|
129
|
+
list-style-type: lower-roman;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
& a {
|
|
133
|
+
color: inherit;
|
|
134
|
+
text-decoration-line: underline;
|
|
135
|
+
text-decoration-style: dotted;
|
|
136
|
+
text-decoration-thickness: auto;
|
|
137
|
+
text-underline-offset: auto;
|
|
138
|
+
text-underline-position: from-font;
|
|
139
|
+
transition: color 75ms ease-in-out;
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
color: ${colors["blue-600"]};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
& hr {
|
|
147
|
+
border: none;
|
|
148
|
+
border-top: 1px solid ${colors["brown-40"]};
|
|
149
|
+
margin-block: 20px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
& table {
|
|
153
|
+
margin: 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
border-collapse: collapse;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
& th,
|
|
159
|
+
& td {
|
|
160
|
+
border: none;
|
|
161
|
+
border-bottom: 1px solid ${colors["brown-40"]};
|
|
162
|
+
text-align: left;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
& th {
|
|
166
|
+
${typographyMixin(typographyTypes.GEIST_LABEL_CAPTION_MEDIUM)};
|
|
167
|
+
padding: 8px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
& td {
|
|
171
|
+
${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};
|
|
172
|
+
padding: 16px 8px;
|
|
173
|
+
min-width: 150px;
|
|
174
|
+
width: 1%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
& td strong {
|
|
178
|
+
font-weight: inherit;
|
|
179
|
+
font-size: inherit;
|
|
180
|
+
line-height: inherit;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
& blockquote {
|
|
184
|
+
margin-block: 4px;
|
|
185
|
+
margin-inline: 0px;
|
|
186
|
+
padding-left: 16px;
|
|
187
|
+
border-left: 4px solid ${colors["brown-40"]};
|
|
188
|
+
color: ${colors["brown-80"]};
|
|
189
|
+
}
|
|
190
|
+
`;
|
|
191
|
+
|
|
192
|
+
// src/components/blocks/text-block/text-block.tsx
|
|
193
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
194
|
+
function TextBlock({ block }) {
|
|
195
|
+
const counter = { value: 0 };
|
|
196
|
+
const markdownComponents = {
|
|
197
|
+
table: ((tableProps) => /* @__PURE__ */ jsx2(ScrollableTable, { ...tableProps, counter }))
|
|
198
|
+
};
|
|
199
|
+
return /* @__PURE__ */ jsx2(TextBlockWrapper, { children: /* @__PURE__ */ jsx2(ReactMarkdown, { remarkPlugins: [remarkGfm, remarkBreaks], components: markdownComponents, children: sanitize(block.payload.text) }) });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/components/blocks/block-services/text-block-service.ts
|
|
203
|
+
var TextBlockService = {
|
|
204
|
+
type: blockTypes.TEXT,
|
|
205
|
+
Component: TextBlock
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/components/blocks/block-services/index.ts
|
|
209
|
+
var BlockServices = {
|
|
210
|
+
[TextBlockService.type]: TextBlockService
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/components/blocks/block/block.tsx
|
|
214
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
215
|
+
function Block({ block }) {
|
|
216
|
+
const service = BlockServices[block.type];
|
|
217
|
+
if (!service) return null;
|
|
218
|
+
const { Component } = service;
|
|
219
|
+
return /* @__PURE__ */ jsx3(Component, { block });
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
BlockContext,
|
|
224
|
+
useBlockContext,
|
|
225
|
+
blockTypes,
|
|
226
|
+
TextBlockService,
|
|
227
|
+
BlockServices,
|
|
228
|
+
Block
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=chunk-R3BGPOAM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/blocks/block-context/block-context.tsx","../src/components/blocks/types.ts","../src/components/blocks/text-block/text-block.tsx","../src/components/blocks/scrollable-table/scrollable-table-styles.ts","../src/components/blocks/scrollable-table/scrollable-table.tsx","../src/components/blocks/text-block/sanitize.ts","../src/components/blocks/text-block/text-block-styles.ts","../src/components/blocks/block-services/text-block-service.ts","../src/components/blocks/block-services/index.ts","../src/components/blocks/block/block.tsx"],"sourcesContent":["import { createContext, useContext, type ComponentType } from \"react\";\n\n/** Renderer-level concerns provided to descendants of any `Block`-rendering tree. */\nexport interface BlockContextValue {\n /** Optional component rendered next to each table in a TEXT block. Receives the zero-based table index. */\n TableActions?: ComponentType<{ tableIndex: number }>;\n}\n\nexport const BlockContext = createContext<BlockContextValue | null>(null);\n\n/** Returns the ambient block-rendering context. Returns an empty object outside a `<BlockContext.Provider>`. */\nexport function useBlockContext(): BlockContextValue {\n return useContext(BlockContext) ?? {};\n}\n","import type { ComponentType } from \"react\";\n\n/** Block-type discriminator constants. Mirrors the wire shape from io-server / shapes-agent. */\nexport const blockTypes = {\n TEXT: \"TEXT\",\n} as const;\n\n/** Discriminator for content blocks. */\nexport type BlockType = (typeof blockTypes)[keyof typeof blockTypes];\n\n/** Plain-text content block — rendered as Markdown. */\nexport interface TextBlockRecord {\n /** Block-type discriminator. */\n type: typeof blockTypes.TEXT;\n /** Type-specific data; kept as `payload` to match the wire shape 1:1. */\n payload: {\n /** The Markdown source for this text segment. */\n text: string;\n };\n}\n\n/** Discriminated union of all supported content blocks. Additive — new types extend this union. */\nexport type BlockRecord = TextBlockRecord;\n\n/** Props every concrete block component receives from the dispatcher. */\nexport interface BlockComponentProps<TBlock extends BlockRecord = BlockRecord> {\n /** The block to render. */\n block: TBlock;\n}\n\n/** Per-block-type service — registry entry that pairs a discriminator with its concrete renderer. */\nexport interface BlockService<TBlock extends BlockRecord = BlockRecord> {\n /** Discriminator value this service handles. */\n type: BlockType;\n /** React component that renders a block of this type. */\n Component: ComponentType<BlockComponentProps<TBlock>>;\n}\n","import type { ReactNode } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkBreaks from \"remark-breaks\";\nimport remarkGfm from \"remark-gfm\";\n\nimport { ScrollableTable, type TableCounter } from \"../scrollable-table/scrollable-table\";\nimport type { BlockComponentProps, TextBlockRecord } from \"../types\";\nimport { sanitize } from \"./sanitize\";\nimport { TextBlockWrapper } from \"./text-block-styles\";\n\n/** Renders a TEXT block as Markdown with GFM (tables, strikethrough) and line breaks. */\nexport function TextBlock({ block }: BlockComponentProps<TextBlockRecord>): ReactNode {\n const counter: TableCounter = { value: 0 };\n\n const markdownComponents = {\n table: ((tableProps: { node?: unknown; children?: ReactNode }) => (\n <ScrollableTable {...tableProps} counter={counter} />\n )) as React.ComponentType<unknown>,\n };\n\n return (\n <TextBlockWrapper>\n <ReactMarkdown remarkPlugins={[remarkGfm, remarkBreaks]} components={markdownComponents}>\n {sanitize(block.payload.text)}\n </ReactMarkdown>\n </TextBlockWrapper>\n );\n}\n","import styled from \"styled-components\";\n\nimport { colors } from \"@/tokens/colors\";\n\nexport const TableContainer = styled.div`\n position: relative;\n margin-block: 8px 16px;\n`;\n\nexport const TableScroll = styled.div`\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n`;\n\nexport const TableActionsWrapper = styled.div`\n display: flex;\n justify-content: flex-start;\n margin-block: 8px 0;\n`;\n\nexport const TableActionsDivider = styled.div`\n height: 1px;\n background: ${colors[\"brown-40\"]};\n margin-block: 8px 0;\n`;\n","import { type ReactNode } from \"react\";\n\nimport { useBlockContext } from \"../block-context/block-context\";\nimport { TableActionsWrapper, TableActionsDivider, TableContainer, TableScroll } from \"./scrollable-table-styles\";\n\n/** Mutable counter used to assign sequential table indices during a single render pass. */\nexport interface TableCounter {\n /** The current value; incremented each time a table component is rendered. */\n value: number;\n}\n\n/** Props for the ScrollableTable component. */\ninterface ScrollableTableProps {\n /** Unused node prop from react-markdown. */\n node?: unknown;\n /** Table children elements. */\n children?: ReactNode;\n /** Mutable counter for tracking table indices. */\n counter?: TableCounter;\n}\n\n/** Renders a table inside a horizontally scrollable wrapper with optional actions below. */\nexport function ScrollableTable({ node: _node, counter, ...props }: ScrollableTableProps): ReactNode {\n const currentIndex = counter ? counter.value : 0;\n if (counter) {\n // eslint-disable-next-line react-hooks/immutability -- Counter is an intentionally mutable shared object for sequential table indexing\n counter.value += 1;\n }\n\n const { TableActions } = useBlockContext();\n\n return (\n <TableContainer>\n <TableScroll>\n <table {...props} />\n </TableScroll>\n {TableActions && (\n <>\n <TableActionsWrapper>\n <TableActions tableIndex={currentIndex} />\n </TableActionsWrapper>\n <TableActionsDivider />\n </>\n )}\n </TableContainer>\n );\n}\n","// Strips io-server's `<!-- table-title: ... -->` HTML-comment metadata before rendering.\n// The marker is emitted by the server's CSV-export pipeline so the export button can label\n// the file; it has no place in the visual output. If the server-side format changes\n// (prefix, spacing, closing-tag style), this filter silently stops matching and the\n// raw HTML comment leaks into rendered Markdown — keep this contract aligned with io-server.\nexport function sanitize(text: string): string {\n return text\n .split(\"\\n\")\n .filter((line) => {\n const t = line.trim();\n return !(t.startsWith(\"<!-- table-title:\") && t.endsWith(\"-->\"));\n })\n .join(\"\\n\");\n}\n","import styled from \"styled-components\";\n\nimport { colors } from \"@/tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"@/tokens/typography\";\n\nexport const TextBlockWrapper = styled.div`\n ${typographyMixin(typographyTypes.GEIST_BODY_S_REGULAR)};\n color: ${colors[\"brown-100\"]};\n word-break: break-word;\n\n & h1 {\n ${typographyMixin(typographyTypes.GEIST_HEADING_S_BOLD)};\n margin-block: 20px;\n }\n\n & h2 {\n ${typographyMixin(typographyTypes.GEIST_BODY_L_SEMI_BOLD)};\n margin-block: 12px;\n }\n\n & h3,\n & h4,\n & h5,\n & h6 {\n ${typographyMixin(typographyTypes.GEIST_BODY_M_SEMI_BOLD)};\n margin-block: 8px;\n }\n\n & strong {\n ${typographyMixin(typographyTypes.GEIST_BODY_S_SEMI_BOLD)};\n }\n\n & p {\n margin-block: 0px;\n }\n\n & p + p {\n margin-block: 8px 0px;\n }\n\n & ul,\n & ol {\n margin-block: 16px;\n padding-left: 20px;\n }\n\n & li + li {\n margin-block: 4px;\n }\n\n & ol {\n list-style-type: decimal;\n }\n\n & ol ol {\n list-style-type: lower-alpha;\n }\n\n & ol ol ol {\n list-style-type: lower-roman;\n }\n\n & a {\n color: inherit;\n text-decoration-line: underline;\n text-decoration-style: dotted;\n text-decoration-thickness: auto;\n text-underline-offset: auto;\n text-underline-position: from-font;\n transition: color 75ms ease-in-out;\n\n &:hover {\n color: ${colors[\"blue-600\"]};\n }\n }\n\n & hr {\n border: none;\n border-top: 1px solid ${colors[\"brown-40\"]};\n margin-block: 20px;\n }\n\n & table {\n margin: 0;\n width: 100%;\n border-collapse: collapse;\n }\n\n & th,\n & td {\n border: none;\n border-bottom: 1px solid ${colors[\"brown-40\"]};\n text-align: left;\n }\n\n & th {\n ${typographyMixin(typographyTypes.GEIST_LABEL_CAPTION_MEDIUM)};\n padding: 8px;\n }\n\n & td {\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n padding: 16px 8px;\n min-width: 150px;\n width: 1%;\n }\n\n & td strong {\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n }\n\n & blockquote {\n margin-block: 4px;\n margin-inline: 0px;\n padding-left: 16px;\n border-left: 4px solid ${colors[\"brown-40\"]};\n color: ${colors[\"brown-80\"]};\n }\n`;\n","import { TextBlock } from \"../text-block/text-block\";\nimport { blockTypes } from \"../types\";\nimport type { BlockService, TextBlockRecord } from \"../types\";\n\nexport const TextBlockService: BlockService<TextBlockRecord> = {\n type: blockTypes.TEXT,\n Component: TextBlock,\n};\n","import type { BlockService, BlockType } from \"../types\";\nimport { TextBlockService } from \"./text-block-service\";\n\nexport const BlockServices: Record<BlockType, BlockService> = {\n [TextBlockService.type]: TextBlockService,\n};\n","import type { ReactNode } from \"react\";\n\nimport { BlockServices } from \"../block-services\";\nimport type { BlockRecord } from \"../types\";\n\n/** Props for the Block dispatcher. */\ninterface BlockProps {\n /** The block to render. Dispatched to the registered concrete component for its `type`. */\n block: BlockRecord;\n}\n\n/** Dispatches a single block to its registered concrete component. Unknown types render as a no-op. */\nexport function Block({ block }: BlockProps): ReactNode {\n const service = BlockServices[block.type];\n if (!service) return null;\n const { Component } = service;\n return <Component block={block} />;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,eAAe,kBAAsC;AAQvD,IAAM,eAAe,cAAwC,IAAI;AAGjE,SAAS,kBAAqC;AACnD,SAAO,WAAW,YAAY,KAAK,CAAC;AACtC;;;ACVO,IAAM,aAAa;AAAA,EACxB,MAAM;AACR;;;ACJA,OAAO,mBAAmB;AAC1B,OAAO,kBAAkB;AACzB,OAAO,eAAe;;;ACHtB,OAAO,YAAY;AAIZ,IAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAK9B,IAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA;AAM3B,IAAM,sBAAsB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMnC,IAAM,sBAAsB,OAAO;AAAA;AAAA,gBAE1B,OAAO,UAAU,CAAC;AAAA;AAAA;;;ACW1B,SAGA,UAHA,KAGA,YAHA;AAZD,SAAS,gBAAgB,EAAE,MAAM,OAAO,SAAS,GAAG,MAAM,GAAoC;AACnG,QAAM,eAAe,UAAU,QAAQ,QAAQ;AAC/C,MAAI,SAAS;AAEX,YAAQ,SAAS;AAAA,EACnB;AAEA,QAAM,EAAE,aAAa,IAAI,gBAAgB;AAEzC,SACE,qBAAC,kBACC;AAAA,wBAAC,eACC,8BAAC,WAAO,GAAG,OAAO,GACpB;AAAA,IACC,gBACC,iCACE;AAAA,0BAAC,uBACC,8BAAC,gBAAa,YAAY,cAAc,GAC1C;AAAA,MACA,oBAAC,uBAAoB;AAAA,OACvB;AAAA,KAEJ;AAEJ;;;ACzCO,SAAS,SAAS,MAAsB;AAC7C,SAAO,KACJ,MAAM,IAAI,EACV,OAA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A;AAAA,6BAgB9B,OAAO,UAAU,CAAC;AAAA,aAClC,OAAO,UAAU,CAAC;AAAA;AAAA;;;AJtGzB,gBAAAC,YAAA;AALC,SAAS,UAAU,EAAE,MAAM,GAAoD;AACpF,QAAM,UAAwB,EAAE,OAAO,EAAE;AAEzC,QAAM,qBAAqB;AAAA,IACzB,QAAQ,CAAC,eACP,gBAAAA,KAAC,mBAAiB,GAAG,YAAY,SAAkB;AAAA,EAEvD;AAEA,SACE,gBAAAA,KAAC,oBACC,0BAAAA,KAAC,iBAAc,eAAe,CAAC,WAAW,YAAY,GAAG,YAAY,oBAClE,mBAAS,MAAM,QAAQ,IAAI,GAC9B,GACF;AAEJ;;;AKvBO,IAAM,mBAAkD;AAAA,EAC7D,MAAM,WAAW;AAAA,EACjB,WAAW;AACb;;;ACJO,IAAM,gBAAiD;AAAA,EAC5D,CAAC,iBAAiB,IAAI,GAAG;AAC3B;;;ACWS,gBAAAC,YAAA;AAJF,SAAS,MAAM,EAAE,MAAM,GAA0B;AACtD,QAAM,UAAU,cAAc,MAAM,IAAI;AACxC,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,EAAE,UAAU,IAAI;AACtB,SAAO,gBAAAA,KAAC,aAAU,OAAc;AAClC;","names":["styled","styled","jsx","jsx"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mergeRefs
|
|
3
|
+
} from "./chunk-KNYB3RL7.js";
|
|
1
4
|
import {
|
|
2
5
|
typographyMixin,
|
|
3
6
|
typographyTypes
|
|
@@ -5,9 +8,6 @@ import {
|
|
|
5
8
|
import {
|
|
6
9
|
colors
|
|
7
10
|
} from "./chunk-JF3P66JF.js";
|
|
8
|
-
import {
|
|
9
|
-
mergeRefs
|
|
10
|
-
} from "./chunk-KNYB3RL7.js";
|
|
11
11
|
|
|
12
12
|
// src/components/text-area/text-area.tsx
|
|
13
13
|
import { forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
@@ -73,4 +73,4 @@ var TextArea = forwardRef(function TextArea2({ value, onChange, placeholder, max
|
|
|
73
73
|
export {
|
|
74
74
|
TextArea
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-WPQQVKWY.js.map
|