hazo_ihelp 2.6.0 → 2.7.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 +1 -1
- package/db_setup_postgres.sql +2 -0
- package/db_setup_sqlite.sql +2 -0
- package/dist/api/create_ihelp_handler.d.ts.map +1 -1
- package/dist/api/create_ihelp_handler.js +28 -2
- package/dist/api/create_ihelp_handler.js.map +1 -1
- package/dist/components/editor/editor_context_keys_section.d.ts.map +1 -1
- package/dist/components/editor/editor_context_keys_section.js +9 -6
- package/dist/components/editor/editor_context_keys_section.js.map +1 -1
- package/dist/components/editor/editor_form.d.ts.map +1 -1
- package/dist/components/editor/editor_form.js +5 -2
- package/dist/components/editor/editor_form.js.map +1 -1
- package/dist/components/editor/editor_import_export.d.ts.map +1 -1
- package/dist/components/editor/editor_import_export.js +12 -6
- package/dist/components/editor/editor_import_export.js.map +1 -1
- package/dist/components/editor/editor_tags_section.d.ts.map +1 -1
- package/dist/components/editor/editor_tags_section.js +5 -2
- package/dist/components/editor/editor_tags_section.js.map +1 -1
- package/dist/components/editor/editor_topic_list.d.ts.map +1 -1
- package/dist/components/editor/editor_topic_list.js +4 -1
- package/dist/components/editor/editor_topic_list.js.map +1 -1
- package/dist/components/editor/editor_topic_list_item.d.ts.map +1 -1
- package/dist/components/editor/editor_topic_list_item.js +4 -1
- package/dist/components/editor/editor_topic_list_item.js.map +1 -1
- package/dist/components/hover_help_icon.d.ts +18 -1
- package/dist/components/hover_help_icon.d.ts.map +1 -1
- package/dist/components/hover_help_icon.js +22 -3
- package/dist/components/hover_help_icon.js.map +1 -1
- package/dist/components/ihelp_detail_panel.d.ts.map +1 -1
- package/dist/components/ihelp_detail_panel.js +5 -2
- package/dist/components/ihelp_detail_panel.js.map +1 -1
- package/dist/components/ihelp_editor.d.ts.map +1 -1
- package/dist/components/ihelp_editor.js +9 -3
- package/dist/components/ihelp_editor.js.map +1 -1
- package/dist/components/ihelp_field_help.d.ts +5 -1
- package/dist/components/ihelp_field_help.d.ts.map +1 -1
- package/dist/components/ihelp_field_help.js +5 -2
- package/dist/components/ihelp_field_help.js.map +1 -1
- package/dist/components/ihelp_icon.d.ts.map +1 -1
- package/dist/components/ihelp_icon.js +4 -1
- package/dist/components/ihelp_icon.js.map +1 -1
- package/dist/components/ihelp_page_sidebar.d.ts +21 -0
- package/dist/components/ihelp_page_sidebar.d.ts.map +1 -0
- package/dist/components/ihelp_page_sidebar.js +24 -0
- package/dist/components/ihelp_page_sidebar.js.map +1 -0
- package/dist/components/ihelp_rich_editor.d.ts.map +1 -1
- package/dist/components/ihelp_rich_editor.js +4 -1
- package/dist/components/ihelp_rich_editor.js.map +1 -1
- package/dist/components/ihelp_search_dialog.d.ts.map +1 -1
- package/dist/components/ihelp_search_dialog.js +21 -15
- package/dist/components/ihelp_search_dialog.js.map +1 -1
- package/dist/components/ihelp_topic_cards.d.ts +14 -0
- package/dist/components/ihelp_topic_cards.d.ts.map +1 -0
- package/dist/components/ihelp_topic_cards.js +22 -0
- package/dist/components/ihelp_topic_cards.js.map +1 -0
- package/dist/components/ihelp_topic_list.d.ts +14 -0
- package/dist/components/ihelp_topic_list.d.ts.map +1 -0
- package/dist/components/ihelp_topic_list.js +12 -0
- package/dist/components/ihelp_topic_list.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/topic_hover_icon.d.ts.map +1 -1
- package/dist/components/topic_hover_icon.js +5 -2
- package/dist/components/topic_hover_icon.js.map +1 -1
- package/dist/index.client.d.ts +3 -0
- package/dist/index.client.d.ts.map +1 -1
- package/dist/index.client.js.map +1 -1
- package/dist/index.runtime.d.ts +3 -0
- package/dist/index.runtime.d.ts.map +1 -1
- package/dist/index.runtime.js +3 -0
- package/dist/index.runtime.js.map +1 -1
- package/dist/locales/en.json +105 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +26 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor_topic_list.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"editor_topic_list.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAUvD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,WAAW,GACZ,EAAE,oBAAoB,qBA8JtB"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useMemo, useCallback, useRef, useEffect } from 'react';
|
|
4
4
|
import { Plus, Search, MoreVertical, Trash2 } from 'lucide-react';
|
|
5
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
5
6
|
import { Button } from '../ui/button.js';
|
|
6
7
|
import { Input } from '../ui/input.js';
|
|
7
8
|
import { TopicListItem } from './editor_topic_list_item.js';
|
|
8
9
|
import { ImportExportButtons } from './editor_import_export.js';
|
|
10
|
+
import en from '../../locales/en.json' with { type: 'json' };
|
|
11
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
9
12
|
export function EditorTopicList({ topics, loading, error, selected_id, onSelect, onNew, onExport, onImport, onDeleteSelected, onDeleteAll, }) {
|
|
10
13
|
const [filter, set_filter] = useState('');
|
|
11
14
|
const [menu_open, set_menu_open] = useState(false);
|
|
@@ -51,7 +54,7 @@ export function EditorTopicList({ topics, loading, error, selected_id, onSelect,
|
|
|
51
54
|
return depth;
|
|
52
55
|
}, [topics]);
|
|
53
56
|
const topic_count = topics.length;
|
|
54
|
-
return (_jsxs("div", { className: "flex w-[320px] min-w-[260px] max-w-[380px] flex-col border-r bg-muted/20", children: [_jsxs("div", { className: "flex items-center gap-2 border-b px-3 py-3", children: [_jsxs("div", { className: "relative flex-1", children: [_jsx(Search, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), _jsx(Input, { placeholder:
|
|
57
|
+
return (_jsxs("div", { className: "flex w-[320px] min-w-[260px] max-w-[380px] flex-col border-r bg-muted/20", children: [_jsxs("div", { className: "flex items-center gap-2 border-b px-3 py-3", children: [_jsxs("div", { className: "relative flex-1", children: [_jsx(Search, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), _jsx(Input, { placeholder: t('editor_topic_list.filter_placeholder'), value: filter, onChange: (e) => set_filter(e.target.value), className: "h-9 pl-8 text-sm" })] }), _jsxs(Button, { size: "sm", onClick: onNew, title: t('editor_topic_list.new_topic_title'), className: "h-9 shrink-0", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), t('editor_topic_list.new_button')] }), _jsxs("div", { className: "relative", ref: menu_ref, children: [_jsx(Button, { size: "sm", variant: "ghost", className: "h-9 w-9 shrink-0 p-0", onClick: () => set_menu_open((v) => !v), title: t('editor_topic_list.more_actions_title'), children: _jsx(MoreVertical, { className: "h-4 w-4" }) }), menu_open && (_jsxs("div", { className: "absolute right-0 top-full z-20 mt-1 w-48 rounded-md border bg-background p-1 shadow-lg", children: [_jsx(ImportExportButtons, { onExport: () => { onExport(); set_menu_open(false); }, onImport: () => { onImport(); set_menu_open(false); } }), _jsx("div", { className: "my-1 border-t" }), _jsxs("button", { type: "button", onClick: () => { onDeleteSelected(); set_menu_open(false); }, disabled: !selected_id, className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-destructive/10 text-destructive disabled:opacity-40 disabled:pointer-events-none", children: [_jsx(Trash2, { className: "h-3.5 w-3.5" }), t('editor_topic_list.delete_selected')] }), _jsxs("button", { type: "button", onClick: () => { onDeleteAll(); set_menu_open(false); }, disabled: topics.length === 0, className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-destructive/10 text-destructive disabled:opacity-40 disabled:pointer-events-none", children: [_jsx(Trash2, { className: "h-3.5 w-3.5" }), t('editor_topic_list.delete_all')] })] }))] })] }), _jsx("div", { className: "flex items-center justify-between border-b px-3 py-1.5", children: _jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: t('editor_topic_list.topic_count', { count: topic_count, plural: topic_count !== 1 ? 's' : '' }) }) }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [loading && (_jsx("p", { className: "p-4 text-center text-sm text-muted-foreground", children: t('editor_topic_list.loading') })), error && (_jsx("p", { className: "p-4 text-center text-sm text-destructive", children: error })), !loading && !error && Object.keys(grouped_topics).length === 0 && (_jsx("p", { className: "p-4 text-center text-sm text-muted-foreground", children: filter ? t('editor_topic_list.no_matching') : t('editor_topic_list.no_topics') })), Object.entries(grouped_topics)
|
|
55
58
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
56
59
|
.map(([category, cat_topics]) => (_jsxs("div", { children: [_jsx("div", { className: "sticky top-0 z-10 bg-muted/40 backdrop-blur-sm px-3 py-1.5", children: _jsx("p", { className: "text-[11px] font-bold uppercase tracking-widest text-muted-foreground", children: category }) }), _jsx("div", { className: "px-1 pb-1", children: cat_topics.map((topic) => (_jsx(TopicListItem, { topic: topic, depth: get_depth(topic), selected: topic.id === selected_id, onSelect: onSelect }, topic.id))) })] }, category)))] })] }));
|
|
57
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor_topic_list.js","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"editor_topic_list.js","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE7D,MAAM,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAe3C,MAAM,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,GAC7E,CACL,EAEA,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;yBAC5B,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;yBACtC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAC/B,0BACE,cAAK,SAAS,EAAC,4DAA4D,YACzE,YAAG,SAAS,EAAC,uEAAuE,YACjF,QAAQ,GACP,GACA,EACN,cAAK,SAAS,EAAC,WAAW,YACvB,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB,KAAC,aAAa,IAEZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,EACvB,QAAQ,EAAE,KAAK,CAAC,EAAE,KAAK,WAAW,EAClC,QAAQ,EAAE,QAAQ,IAJb,KAAK,CAAC,EAAE,CAKb,CACH,CAAC,GACE,KAhBE,QAAQ,CAiBZ,CACP,CAAC,IACA,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor_topic_list_item.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list_item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"editor_topic_list_item.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list_item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMvD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,kBAAkB,qBAuBrF"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { CheckCircle } from 'lucide-react';
|
|
4
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
4
5
|
import { cn } from 'hazo_ui';
|
|
6
|
+
import en from '../../locales/en.json' with { type: 'json' };
|
|
7
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
5
8
|
export function TopicListItem({ topic, depth, selected, onSelect }) {
|
|
6
9
|
return (_jsxs("button", { type: "button", onClick: () => onSelect(topic.id), className: cn('group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-left text-sm transition-all duration-150', selected
|
|
7
10
|
? 'bg-accent text-accent-foreground border-l-2 border-primary pl-[10px]'
|
|
8
|
-
: 'border-l-2 border-transparent hover:bg-muted/60'), style: { paddingLeft: `${(selected ? 10 : 12) + depth * 16}px` }, children: [topic.is_published ? (_jsx(CheckCircle, { className: "h-3.5 w-3.5 shrink-0 text-emerald-500" })) : (_jsx("span", { className: "inline-flex h-3.5 shrink-0 items-center rounded bg-muted px-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground", children:
|
|
11
|
+
: 'border-l-2 border-transparent hover:bg-muted/60'), style: { paddingLeft: `${(selected ? 10 : 12) + depth * 16}px` }, children: [topic.is_published ? (_jsx(CheckCircle, { className: "h-3.5 w-3.5 shrink-0 text-emerald-500" })) : (_jsx("span", { className: "inline-flex h-3.5 shrink-0 items-center rounded bg-muted px-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground", children: t('editor_topic_list_item.draft_badge') })), _jsx("span", { className: "truncate", children: topic.title })] }));
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=editor_topic_list_item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor_topic_list_item.js","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list_item.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"editor_topic_list_item.js","sourceRoot":"","sources":["../../../src/components/editor/editor_topic_list_item.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE7D,MAAM,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAS3C,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAsB;IACpF,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EACjC,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,QAAQ;YACN,CAAC,CAAC,sEAAsE;YACxE,CAAC,CAAC,iDAAiD,CACtD,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,EAAE,IAAI,EAAE,aAE/D,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACpB,KAAC,WAAW,IAAC,SAAS,EAAC,uCAAuC,GAAG,CAClE,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,mIAAmI,YAChJ,CAAC,CAAC,oCAAoC,CAAC,GACnC,CACR,EACD,eAAM,SAAS,EAAC,UAAU,YAAE,KAAK,CAAC,KAAK,GAAQ,IACxC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -27,6 +27,23 @@ export interface HoverHelpIconProps {
|
|
|
27
27
|
on_more?: () => void;
|
|
28
28
|
/** Label for the optional "More" link. Default "More". */
|
|
29
29
|
more_label?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Forwarded to Radix `HoverCard.Portal`'s own `container` prop — mounts
|
|
32
|
+
* the popover's DOM subtree under this element instead of the default
|
|
33
|
+
* `document.body`. Useful when a host wants the popover physically
|
|
34
|
+
* contained inside e.g. a modal it renders (keyboard focus scoping,
|
|
35
|
+
* `inert`/aria-hidden siblings, etc.).
|
|
36
|
+
*
|
|
37
|
+
* Not required to fix stacking-order issues: `HoverCard.Content` already
|
|
38
|
+
* renders with Radix's `strategy: "fixed"` Popper positioning, which
|
|
39
|
+
* escapes an ancestor's `overflow: hidden` on its own (fixed-position
|
|
40
|
+
* boxes are only trapped by an ancestor that establishes a new containing
|
|
41
|
+
* block via `transform`/`filter`/`perspective`/`will-change`) — and the
|
|
42
|
+
* `z-[200]` below already clears every host this package has been asked
|
|
43
|
+
* to render inside. Reach for `container` only when you specifically need
|
|
44
|
+
* DOM containment, not just visibility above a host dialog.
|
|
45
|
+
*/
|
|
46
|
+
container?: HTMLElement | null;
|
|
30
47
|
}
|
|
31
48
|
/**
|
|
32
49
|
* Standalone "?" icon that opens a Radix HoverCard with a titled help body.
|
|
@@ -44,5 +61,5 @@ export interface HoverHelpIconProps {
|
|
|
44
61
|
* For topic-store-backed help (full rich content, search, editor), keep
|
|
45
62
|
* using `IhelpIcon` which delegates to the provider's `open_search`.
|
|
46
63
|
*/
|
|
47
|
-
export declare function HoverHelpIcon({ title, body, aria_label, size, side, className, content_className, on_more, more_label, }: HoverHelpIconProps): React.JSX.Element;
|
|
64
|
+
export declare function HoverHelpIcon({ title, body, aria_label, size, side, className, content_className, on_more, more_label, container, }: HoverHelpIconProps): React.JSX.Element;
|
|
48
65
|
//# sourceMappingURL=hover_help_icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover_help_icon.d.ts","sourceRoot":"","sources":["../../src/components/hover_help_icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"hover_help_icon.d.ts","sourceRoot":"","sources":["../../src/components/hover_help_icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASxD,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,UAAU,EACV,IAAS,EACT,IAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,SAAS,GACV,EAAE,kBAAkB,qBAkFpB"}
|
|
@@ -4,6 +4,9 @@ import { useState } from "react";
|
|
|
4
4
|
import * as HoverCard from "@radix-ui/react-hover-card";
|
|
5
5
|
import { HelpCircle, ArrowRight } from "lucide-react";
|
|
6
6
|
import { cn } from 'hazo_ui';
|
|
7
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
8
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
9
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
7
10
|
/**
|
|
8
11
|
* Standalone "?" icon that opens a Radix HoverCard with a titled help body.
|
|
9
12
|
*
|
|
@@ -20,13 +23,29 @@ import { cn } from 'hazo_ui';
|
|
|
20
23
|
* For topic-store-backed help (full rich content, search, editor), keep
|
|
21
24
|
* using `IhelpIcon` which delegates to the provider's `open_search`.
|
|
22
25
|
*/
|
|
23
|
-
export function HoverHelpIcon({ title, body, aria_label, size = 14, side = "top", className, content_className, on_more, more_label
|
|
26
|
+
export function HoverHelpIcon({ title, body, aria_label, size = 14, side = "top", className, content_className, on_more, more_label, container, }) {
|
|
27
|
+
const resolved_more_label = more_label ?? t('hover_help_icon.more_label');
|
|
24
28
|
// HoverCard ignores touch events by design (Radix decision: hover semantics
|
|
25
29
|
// are pointer-only). Pair it with a click toggle so taps still open it.
|
|
26
30
|
const [tap_open, set_tap_open] = useState(false);
|
|
27
|
-
return (_jsxs(HoverCard.Root, { openDelay: 120, closeDelay: 120, open: tap_open || undefined, onOpenChange: set_tap_open, children: [_jsx(HoverCard.Trigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": aria_label, onClick: () => set_tap_open((v) => !v), className: cn("inline-flex items-center justify-center rounded-full text-blue-600", "hover:bg-blue-100 hover:text-blue-800 transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1", className), style: { width: size + 8, height: size + 8 }, children: _jsx(HelpCircle, { size: size, "aria-hidden": true }) }) }), _jsx(HoverCard.Portal, { children: _jsxs(HoverCard.Content, { side: side, sideOffset: 8, align: "center", className: cn(
|
|
31
|
+
return (_jsxs(HoverCard.Root, { openDelay: 120, closeDelay: 120, open: tap_open || undefined, onOpenChange: set_tap_open, children: [_jsx(HoverCard.Trigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": aria_label, onClick: () => set_tap_open((v) => !v), className: cn("inline-flex items-center justify-center rounded-full text-blue-600", "hover:bg-blue-100 hover:text-blue-800 transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1", className), style: { width: size + 8, height: size + 8 }, children: _jsx(HelpCircle, { size: size, "aria-hidden": true }) }) }), _jsx(HoverCard.Portal, { container: container, children: _jsxs(HoverCard.Content, { side: side, sideOffset: 8, align: "center", className: cn(
|
|
32
|
+
// `z-[200]`, not Radix/Tailwind's usual `z-50` default: this
|
|
33
|
+
// component is meant to render on top of whatever dialog hosts
|
|
34
|
+
// it, and a host app's own dialog stack can easily run past 50
|
|
35
|
+
// (this package's own `test-app` aside, the retirement-planner
|
|
36
|
+
// consumer's documented ladder alone reaches 140 for a dialog
|
|
37
|
+
// opened from inside another dialog — see that repo's
|
|
38
|
+
// `design/DECISIONS.md` "z-index ladder" entry). `200` clears
|
|
39
|
+
// every rung any known consumer's own dialogs currently use,
|
|
40
|
+
// while staying below the kind of app-reserved "are you sure"
|
|
41
|
+
// confirm-prompt ceiling `hazo_ui`'s own confirm dialog gets
|
|
42
|
+
// bumped to in that same consumer (400) — a help popover should
|
|
43
|
+
// never outrank a destructive-action confirm. Override via
|
|
44
|
+
// `content_className` (tailwind-merge'd on top, so a caller's
|
|
45
|
+
// own `z-*` wins) if a specific host needs something different.
|
|
46
|
+
"z-[200] max-w-sm rounded-lg border border-black/5 bg-white p-4 shadow-lg", "text-xs leading-relaxed text-slate-700", content_className), children: [_jsx("p", { className: "mb-2 text-sm font-semibold text-slate-900", children: title }), typeof body === "string" ? (_jsx("div", { className: "whitespace-pre-line", children: body })) : (body), on_more && (_jsxs("button", { type: "button", onClick: () => {
|
|
28
47
|
set_tap_open(false);
|
|
29
48
|
on_more();
|
|
30
|
-
}, className: cn("mt-3 inline-flex items-center gap-1 text-xs font-semibold text-blue-600", "hover:text-blue-800 hover:underline", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1 rounded"), children: [
|
|
49
|
+
}, className: cn("mt-3 inline-flex items-center gap-1 text-xs font-semibold text-blue-600", "hover:text-blue-800 hover:underline", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1 rounded"), children: [resolved_more_label, _jsx(ArrowRight, { size: 12, "aria-hidden": true })] })), _jsx(HoverCard.Arrow, { className: "fill-white" })] }) })] }));
|
|
31
50
|
}
|
|
32
51
|
//# sourceMappingURL=hover_help_icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover_help_icon.js","sourceRoot":"","sources":["../../src/components/hover_help_icon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hover_help_icon.js","sourceRoot":"","sources":["../../src/components/hover_help_icon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;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+DAA+D;oBAC/D,+DAA+D;oBAC/D,+DAA+D;oBAC/D,8DAA8D;oBAC9D,sDAAsD;oBACtD,8DAA8D;oBAC9D,6DAA6D;oBAC7D,8DAA8D;oBAC9D,6DAA6D;oBAC7D,gEAAgE;oBAChE,2DAA2D;oBAC3D,8DAA8D;oBAC9D,gEAAgE;oBAChE,0EAA0E,EAC1E,wCAAwC,EACxC,iBAAiB,CAClB,aAED,YAAG,SAAS,EAAC,2CAA2C,YAAE,KAAK,GAAK,EACnE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC1B,cAAK,SAAS,EAAC,qBAAqB,YAAE,IAAI,GAAO,CAClD,CAAC,CAAC,CAAC,CACF,IAAI,CACL,EACA,OAAO,IAAI,CACV,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;gCACZ,YAAY,CAAC,KAAK,CAAC,CAAC;gCACpB,OAAO,EAAE,CAAC;4BACZ,CAAC,EACD,SAAS,EAAE,EAAE,CACX,yEAAyE,EACzE,qCAAqC,EACrC,iHAAiH,CAClH,aAEA,mBAAmB,EACpB,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,wBAAgB,IAC7B,CACV,EACD,KAAC,SAAS,CAAC,KAAK,IAAC,SAAS,EAAC,YAAY,GAAG,IACxB,GACH,IACJ,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_detail_panel.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_detail_panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_detail_panel.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_detail_panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAoCxF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,MAAM,GACP,EAAE,qBAAqB,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B,qBAiFA"}
|
|
@@ -3,6 +3,9 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { cn } from 'hazo_ui';
|
|
5
5
|
import { Badge } from './ui/badge.js';
|
|
6
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
7
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
8
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
6
9
|
/**
|
|
7
10
|
* Resolve image src attributes in HTML content.
|
|
8
11
|
*
|
|
@@ -34,8 +37,8 @@ function resolveImageUrls(html, asset_base_url, topic_scope_id) {
|
|
|
34
37
|
* - Child topic links
|
|
35
38
|
*/
|
|
36
39
|
export function IhelpDetailPanel({ topic, onNavigate, className, asset_base_url, provider_scope_id, labels, }) {
|
|
37
|
-
const more_info_prefix = labels?.more_info_prefix ?? '
|
|
38
|
-
const related_topics_label = labels?.related_topics ?? '
|
|
40
|
+
const more_info_prefix = labels?.more_info_prefix ?? t('search_dialog.more_info_prefix');
|
|
41
|
+
const related_topics_label = labels?.related_topics ?? t('search_dialog.related_topics');
|
|
39
42
|
const resolved_content = useMemo(() => {
|
|
40
43
|
if (!topic.content)
|
|
41
44
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_detail_panel.js","sourceRoot":"","sources":["../../src/components/ihelp_detail_panel.tsx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AAG,CAAC,KAAK,IADA,GAAG,CAAC,KAAK,CAEb,CACT,CAAC,GACE,CACP,EAED,aAAI,SAAS,EAAC,0BAA0B,GAAG,EAG1C,gBAAgB,IAAI,CACnB,cACE,SAAS,EAAE,EAAE,CACX,eAAe,EACf,2BAA2B,EAC3B,0CAA0C,EAC1C,yDAAyD,EACzD,uDAAuD,EACvD,0FAA0F,EAC1F,qEAAqE,EACrE,mIAAmI,EACnI,sCAAsC,EACtC,6BAA6B,EAC7B,6BAA6B,EAC7B,+GAA+G,EAC/G,2KAA2K,EAC3K,qJAAqJ,CACtJ,EACD,uBAAuB,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,GACrD,CACH,EAEA,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAC9C,eAAK,SAAS,EAAC,wCAAwC,aACrD,YAAG,SAAS,EAAC,mHAAmH,YAAE,oBAAoB,GAAK,EAC3J,cAAK,SAAS,EAAC,uBAAuB,YACnC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAiB,EAAE,EAAE,CAAC,CACzC,iBAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EACrC,SAAS,EAAC,yFAAyF,YAElG,KAAK,CAAC,KAAK,IALP,KAAK,CAAC,EAAE,CAMN,CACV,CAAC,GACE,IACF,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_editor.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_editor.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,gBAAgB,EAAgE,MAAM,mBAAmB,CAAC;AAuDxH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,gBAAgB,qBA2OzG"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useMemo, useCallback } from 'react';
|
|
4
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
4
5
|
import { use_ihelp_editor } from '../hooks/use_ihelp_editor.js';
|
|
5
6
|
import { use_ihelp_config } from '../hooks/use_ihelp_config.js';
|
|
6
7
|
import { cn } from 'hazo_ui';
|
|
7
8
|
import { EditorTopicList } from './editor/editor_topic_list.js';
|
|
8
9
|
import { EditorForm } from './editor/editor_form.js';
|
|
9
10
|
import { ImportDialog, use_export_topics } from './editor/editor_import_export.js';
|
|
11
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
12
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
10
13
|
// ---------------------------------------------------------------------------
|
|
11
14
|
// Helpers
|
|
12
15
|
// ---------------------------------------------------------------------------
|
|
13
16
|
const EMPTY_FORM = {
|
|
14
17
|
title: '',
|
|
18
|
+
slug: null,
|
|
15
19
|
category: '',
|
|
16
20
|
parent_id: null,
|
|
17
21
|
description: '',
|
|
@@ -24,6 +28,7 @@ const EMPTY_FORM = {
|
|
|
24
28
|
function topic_to_form(t) {
|
|
25
29
|
return {
|
|
26
30
|
title: t.title,
|
|
31
|
+
slug: t.slug,
|
|
27
32
|
category: t.category,
|
|
28
33
|
parent_id: t.parent_id,
|
|
29
34
|
description: t.description ?? '',
|
|
@@ -102,6 +107,7 @@ export function IhelpEditor({ scope_id, className, api_url, upload_url, config_a
|
|
|
102
107
|
...form,
|
|
103
108
|
tags: form_tags,
|
|
104
109
|
context_keys: form_context_keys,
|
|
110
|
+
slug: form.slug || null,
|
|
105
111
|
description: form.description || null,
|
|
106
112
|
content: form.content || null,
|
|
107
113
|
icon: form.icon || null,
|
|
@@ -125,7 +131,7 @@ export function IhelpEditor({ scope_id, className, api_url, upload_url, config_a
|
|
|
125
131
|
const handle_delete = useCallback(async () => {
|
|
126
132
|
if (!selected_id)
|
|
127
133
|
return;
|
|
128
|
-
const confirmed = window.confirm('
|
|
134
|
+
const confirmed = window.confirm(t('ihelp_editor.confirm_delete_topic'));
|
|
129
135
|
if (!confirmed)
|
|
130
136
|
return;
|
|
131
137
|
set_saving(true);
|
|
@@ -148,7 +154,7 @@ export function IhelpEditor({ scope_id, className, api_url, upload_url, config_a
|
|
|
148
154
|
const handle_delete_all = useCallback(async () => {
|
|
149
155
|
if (topics.length === 0)
|
|
150
156
|
return;
|
|
151
|
-
const confirmed = window.confirm(
|
|
157
|
+
const confirmed = window.confirm(t('ihelp_editor.confirm_delete_all', { count: topics.length }));
|
|
152
158
|
if (!confirmed)
|
|
153
159
|
return;
|
|
154
160
|
set_saving(true);
|
|
@@ -189,6 +195,6 @@ export function IhelpEditor({ scope_id, className, api_url, upload_url, config_a
|
|
|
189
195
|
}, []);
|
|
190
196
|
// -- render ---------------------------------------------------------------
|
|
191
197
|
const show_form = is_new || selected_id !== null;
|
|
192
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn('flex h-full min-h-[500px] rounded-lg border bg-background', className), children: [_jsx(EditorTopicList, { topics: topics, loading: loading, error: error, selected_id: selected_id, onSelect: handle_select, onNew: handle_new, onExport: handle_export, onImport: () => set_import_open(true), onDeleteSelected: handle_delete, onDeleteAll: handle_delete_all }), _jsx("div", { className: "flex flex-1 flex-col", children: !show_form ? (_jsx("div", { className: "flex flex-1 items-center justify-center", children: _jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
198
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn('flex h-full min-h-[500px] rounded-lg border bg-background', className), children: [_jsx(EditorTopicList, { topics: topics, loading: loading, error: error, selected_id: selected_id, onSelect: handle_select, onNew: handle_new, onExport: handle_export, onImport: () => set_import_open(true), onDeleteSelected: handle_delete, onDeleteAll: handle_delete_all }), _jsx("div", { className: "flex flex-1 flex-col", children: !show_form ? (_jsx("div", { className: "flex flex-1 items-center justify-center", children: _jsx("p", { className: "text-sm text-muted-foreground", children: t('ihelp_editor.empty_state') }) })) : (_jsx(EditorForm, { form: form, form_tags: form_tags, form_context_keys: form_context_keys, is_new: is_new, saving: saving, save_error: save_error, selected_id: selected_id, topics: topics, categories: categories, onUpdateField: update_field, onAddTag: add_tag, onRemoveTag: remove_tag, onAddContextKey: add_context_key, onRemoveContextKey: remove_context_key, available_context_keys: available_context_keys, available_context_keys_loading: ctx_keys_loading, onManageContextKeys: handle_manage_context_keys, onSave: handle_save, onDelete: handle_delete, upload_url: upload_url, scope_id: scope_id })) })] }), _jsx(ImportDialog, { open: import_open, onOpenChange: set_import_open, create_topic: create_topic, refetch: refetch })] }));
|
|
193
199
|
}
|
|
194
200
|
//# sourceMappingURL=ihelp_editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_editor.js","sourceRoot":"","sources":["../../src/components/ihelp_editor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_editor.js","sourceRoot":"","sources":["../../src/components/ihelp_editor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B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,EAAE,OAAO,GAChB,IACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,10 @@ export interface IhelpFieldHelpProps {
|
|
|
10
10
|
side?: "top" | "right" | "bottom" | "left";
|
|
11
11
|
/** Extra className for the trigger button. */
|
|
12
12
|
className?: string;
|
|
13
|
+
/** Extra className for the hover card popover itself. Merged via `cn`/`tailwind-merge`, so e.g. a `z-*` utility here wins over the built-in default. */
|
|
14
|
+
content_className?: string;
|
|
15
|
+
/** Forwarded to `HoverHelpIcon`'s own `container` — see that prop's doc for when you'd reach for it (DOM containment) vs. the default `z-[200]` (visibility above a host dialog). */
|
|
16
|
+
container?: HTMLElement | null;
|
|
13
17
|
/**
|
|
14
18
|
* When set, the hover card shows a "More" link that opens the
|
|
15
19
|
* `IhelpProvider` search dialog scoped to this context key — escalating
|
|
@@ -45,5 +49,5 @@ export interface IhelpFieldHelpProps {
|
|
|
45
49
|
* more_context_key="broker.sponsorship"
|
|
46
50
|
* />
|
|
47
51
|
*/
|
|
48
|
-
export declare function IhelpFieldHelp({ title, body, size, side, className, more_context_key, more_label, }: IhelpFieldHelpProps): React.JSX.Element;
|
|
52
|
+
export declare function IhelpFieldHelp({ title, body, size, side, className, content_className, container, more_context_key, more_label, }: IhelpFieldHelpProps): React.JSX.Element;
|
|
49
53
|
//# sourceMappingURL=ihelp_field_help.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_field_help.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_field_help.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ9C,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wJAAwJ;IACxJ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qLAAqL;IACrL,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,IAAS,EACT,IAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACX,EAAE,mBAAmB,qBAqBrB"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { HoverHelpIcon } from "./hover_help_icon.js";
|
|
4
4
|
import { useIhelpContextOptional } from "./ihelp_provider.js";
|
|
5
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
6
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
7
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
5
8
|
/**
|
|
6
9
|
* Inline help icon for form field labels.
|
|
7
10
|
*
|
|
@@ -25,11 +28,11 @@ import { useIhelpContextOptional } from "./ihelp_provider.js";
|
|
|
25
28
|
* more_context_key="broker.sponsorship"
|
|
26
29
|
* />
|
|
27
30
|
*/
|
|
28
|
-
export function IhelpFieldHelp({ title, body, size = 13, side = "top", className, more_context_key, more_label, }) {
|
|
31
|
+
export function IhelpFieldHelp({ title, body, size = 13, side = "top", className, content_className, container, more_context_key, more_label, }) {
|
|
29
32
|
const ctx = useIhelpContextOptional();
|
|
30
33
|
const on_more = more_context_key && ctx
|
|
31
34
|
? () => ctx.open_search(more_context_key)
|
|
32
35
|
: undefined;
|
|
33
|
-
return (_jsx(HoverHelpIcon, { title: title, body: body, aria_label:
|
|
36
|
+
return (_jsx(HoverHelpIcon, { title: title, body: body, aria_label: t('field_help.aria_help_for', { title }), size: size, side: side, className: className, content_className: content_className, container: container, on_more: on_more, more_label: more_label }));
|
|
34
37
|
}
|
|
35
38
|
//# sourceMappingURL=ihelp_field_help.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_field_help.js","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_field_help.js","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AA8B3C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACU;IACpB,MAAM,GAAG,GAAG,uBAAuB,EAAE,CAAC;IACtC,MAAM,OAAO,GACX,gBAAgB,IAAI,GAAG;QACrB,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,gBAAgB,CAAC;QACzC,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,CAAC,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_icon.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_icon.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,cAAc,qBAmB9E"}
|
|
@@ -3,12 +3,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Info } from 'lucide-react';
|
|
4
4
|
import { cn } from 'hazo_ui';
|
|
5
5
|
import { useIhelpContext } from './ihelp_provider.js';
|
|
6
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
7
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
8
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
6
9
|
/**
|
|
7
10
|
* Small blue "i" icon that opens the help search dialog scoped to the
|
|
8
11
|
* given context_key.
|
|
9
12
|
*/
|
|
10
13
|
export function IhelpIcon({ context_key, size = 16, className }) {
|
|
11
14
|
const { open_search } = useIhelpContext();
|
|
12
|
-
return (_jsx("button", { type: "button", "aria-label":
|
|
15
|
+
return (_jsx("button", { type: "button", "aria-label": t('ihelp_icon.aria_open_help'), onClick: () => open_search(context_key), className: cn('inline-flex items-center justify-center rounded-full', 'text-blue-600 hover:text-blue-800 hover:bg-blue-100', 'transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1', className), style: { width: size + 8, height: size + 8 }, children: _jsx(Info, { size: size }) }));
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=ihelp_icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ihelp_icon.js","sourceRoot":"","sources":["../../src/components/ihelp_icon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_icon.js","sourceRoot":"","sources":["../../src/components/ihelp_icon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAkB;IAC7E,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IAE1C,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,gBACD,CAAC,CAAC,2BAA2B,CAAC,EAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EACvC,SAAS,EAAE,EAAE,CACX,sDAAsD,EACtD,qDAAqD,EACrD,2HAA2H,EAC3H,SAAS,CACV,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,YAE5C,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,GACb,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface IhelpPageCategory {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IhelpPageSidebarProps {
|
|
9
|
+
categories: IhelpPageCategory[];
|
|
10
|
+
active_category?: string;
|
|
11
|
+
base_path?: string;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
link_component?: React.ComponentType<{
|
|
15
|
+
href: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare function IhelpPageSidebar({ categories, active_category, base_path, footer, className, link_component, }: IhelpPageSidebarProps): React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=ihelp_page_sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ihelp_page_sidebar.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_page_sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CACvG;AAWD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,eAAe,EACf,SAA6B,EAC7B,MAAM,EACN,SAAS,EACT,cAAc,GACf,EAAE,qBAAqB,qBAmCvB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from 'hazo_ui';
|
|
4
|
+
import * as LucideIcons from 'lucide-react';
|
|
5
|
+
function resolve_icon(name) {
|
|
6
|
+
if (!name)
|
|
7
|
+
return null;
|
|
8
|
+
const pascal = name
|
|
9
|
+
.split(/[-_]/)
|
|
10
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
11
|
+
.join('');
|
|
12
|
+
return LucideIcons[pascal] ?? null;
|
|
13
|
+
}
|
|
14
|
+
export function IhelpPageSidebar({ categories, active_category, base_path = '/dashboard/help', footer, className, link_component, }) {
|
|
15
|
+
const LinkEl = link_component ?? 'a';
|
|
16
|
+
return (_jsxs("nav", { className: cn('flex flex-col gap-1', className), children: [categories.map((cat) => {
|
|
17
|
+
const Icon = resolve_icon(cat.icon);
|
|
18
|
+
const active = cat.key === active_category;
|
|
19
|
+
return (_jsxs(LinkEl, { href: `${base_path}/${cat.key}`, className: cn('flex items-center gap-2.5 rounded-md px-3 py-2 text-sm transition-colors', active
|
|
20
|
+
? 'bg-accent/10 font-medium text-foreground'
|
|
21
|
+
: 'text-muted-foreground hover:bg-muted hover:text-foreground'), children: [Icon && _jsx(Icon, { className: "h-4 w-4 shrink-0" }), _jsx("span", { className: "flex-1 truncate", children: cat.label }), cat.count !== undefined && (_jsx("span", { className: "text-xs text-muted-foreground/60", children: cat.count }))] }, cat.key));
|
|
22
|
+
}), footer && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-2 border-t" }), footer] }))] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ihelp_page_sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ihelp_page_sidebar.js","sourceRoot":"","sources":["../../src/components/ihelp_page_sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAkB5C,SAAS,YAAY,CAAC,IAAa;IACjC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,MAAM,GAAG,IAAI;SAChB,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK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.ts","sourceRoot":"","sources":["../../src/components/ihelp_rich_editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ihelp_rich_editor.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_rich_editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,UAAU,oBAAoB;IAC5B,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAyMD,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,GACT,EAAE,oBAAoB,qBAwItB"}
|
|
@@ -8,6 +8,9 @@ import { ResizableImage } from './resizable_image.js';
|
|
|
8
8
|
import { Bold, Italic, List, ListOrdered, Heading1, Heading2, Link as LinkIcon, Undo, Redo, ImageIcon, Upload, Link2, } from 'lucide-react';
|
|
9
9
|
import { Button } from './ui/button.js';
|
|
10
10
|
import { cn } from 'hazo_ui';
|
|
11
|
+
import { createPackageT } from 'hazo_core/i18n';
|
|
12
|
+
import en from '../locales/en.json' with { type: 'json' };
|
|
13
|
+
const t = createPackageT('hazo_ihelp', en);
|
|
11
14
|
function Toolbar({ editor, upload_url, uploading, upload_error, onUploadImage }) {
|
|
12
15
|
if (!editor)
|
|
13
16
|
return null;
|
|
@@ -61,7 +64,7 @@ function Toolbar({ editor, upload_url, uploading, upload_error, onUploadImage })
|
|
|
61
64
|
editor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();
|
|
62
65
|
}
|
|
63
66
|
};
|
|
64
|
-
return (_jsxs("div", { className: "flex flex-wrap items-center gap-0.5 border-b px-1 py-1", children: [btn(() => editor.chain().focus().toggleBold().run(), _jsx(Bold, { className: "h-4 w-4" }), editor.isActive('bold'), 'Bold'), btn(() => editor.chain().focus().toggleItalic().run(), _jsx(Italic, { className: "h-4 w-4" }), editor.isActive('italic'), 'Italic'), btn(() => editor.chain().focus().toggleHeading({ level: 1 }).run(), _jsx(Heading1, { className: "h-4 w-4" }), editor.isActive('heading', { level: 1 }), 'Heading 1'), btn(() => editor.chain().focus().toggleHeading({ level: 2 }).run(), _jsx(Heading2, { className: "h-4 w-4" }), editor.isActive('heading', { level: 2 }), 'Heading 2'), btn(() => editor.chain().focus().toggleBulletList().run(), _jsx(List, { className: "h-4 w-4" }), editor.isActive('bulletList'), 'Bullet List'), btn(() => editor.chain().focus().toggleOrderedList().run(), _jsx(ListOrdered, { className: "h-4 w-4" }), editor.isActive('orderedList'), 'Ordered List'), btn(prompt_link, _jsx(LinkIcon, { className: "h-4 w-4" }), editor.isActive('link'), 'Link'), upload_url && (_jsxs("div", { className: "relative", children: [btn(() => setShowImagePopover(!showImagePopover), _jsx(ImageIcon, { className: "h-4 w-4" }), false, 'Insert Image'), showImagePopover && (_jsxs("div", { "data-image-popover": true, className: "absolute top-full left-0 z-50 mt-1 w-64 rounded-md border bg-popover p-3 shadow-md", children: [_jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleFileSelect }), _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-accent", onClick: () => fileInputRef.current?.click(), children: [_jsx(Upload, { className: "h-4 w-4" }), uploading ? 'Uploading...' : 'Upload from computer'] }), _jsx("div", { className: "my-2 border-t" }), _jsxs("div", { className: "flex gap-1", children: [_jsx("input", { type: "text", placeholder: "Paste image URL...", value: imageUrl, onChange: (e) => setImageUrl(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleUrlSubmit(), className: "flex-1 rounded border px-2 py-1 text-sm" }), _jsx("button", { type: "button", className: "rounded bg-primary px-2 py-1 text-xs text-primary-foreground", onClick: handleUrlSubmit, children: _jsx(Link2, { className: "h-3 w-3" }) })] }), upload_error && (_jsx("p", { className: "mt-1 text-xs text-destructive", children: upload_error }))] }))] })), _jsx("div", { className: "mx-1 h-5 w-px bg-border" }), btn(() => editor.chain().focus().undo().run(), _jsx(Undo, { className: "h-4 w-4" }), false, '
|
|
67
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-0.5 border-b px-1 py-1", children: [btn(() => editor.chain().focus().toggleBold().run(), _jsx(Bold, { className: "h-4 w-4" }), editor.isActive('bold'), 'Bold'), btn(() => editor.chain().focus().toggleItalic().run(), _jsx(Italic, { className: "h-4 w-4" }), editor.isActive('italic'), 'Italic'), btn(() => editor.chain().focus().toggleHeading({ level: 1 }).run(), _jsx(Heading1, { className: "h-4 w-4" }), editor.isActive('heading', { level: 1 }), 'Heading 1'), btn(() => editor.chain().focus().toggleHeading({ level: 2 }).run(), _jsx(Heading2, { className: "h-4 w-4" }), editor.isActive('heading', { level: 2 }), 'Heading 2'), btn(() => editor.chain().focus().toggleBulletList().run(), _jsx(List, { className: "h-4 w-4" }), editor.isActive('bulletList'), 'Bullet List'), btn(() => editor.chain().focus().toggleOrderedList().run(), _jsx(ListOrdered, { className: "h-4 w-4" }), editor.isActive('orderedList'), 'Ordered List'), btn(prompt_link, _jsx(LinkIcon, { className: "h-4 w-4" }), editor.isActive('link'), 'Link'), upload_url && (_jsxs("div", { className: "relative", children: [btn(() => setShowImagePopover(!showImagePopover), _jsx(ImageIcon, { className: "h-4 w-4" }), false, 'Insert Image'), showImagePopover && (_jsxs("div", { "data-image-popover": true, className: "absolute top-full left-0 z-50 mt-1 w-64 rounded-md border bg-popover p-3 shadow-md", children: [_jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleFileSelect }), _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-accent", onClick: () => fileInputRef.current?.click(), children: [_jsx(Upload, { className: "h-4 w-4" }), uploading ? 'Uploading...' : 'Upload from computer'] }), _jsx("div", { className: "my-2 border-t" }), _jsxs("div", { className: "flex gap-1", children: [_jsx("input", { type: "text", placeholder: "Paste image URL...", value: imageUrl, onChange: (e) => setImageUrl(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleUrlSubmit(), className: "flex-1 rounded border px-2 py-1 text-sm" }), _jsx("button", { type: "button", className: "rounded bg-primary px-2 py-1 text-xs text-primary-foreground", onClick: handleUrlSubmit, children: _jsx(Link2, { className: "h-3 w-3" }) })] }), upload_error && (_jsx("p", { className: "mt-1 text-xs text-destructive", children: upload_error }))] }))] })), _jsx("div", { className: "mx-1 h-5 w-px bg-border" }), btn(() => editor.chain().focus().undo().run(), _jsx(Undo, { className: "h-4 w-4" }), false, t('rich_editor.undo')), btn(() => editor.chain().focus().redo().run(), _jsx(Redo, { className: "h-4 w-4" }), false, t('rich_editor.redo'))] }));
|
|
65
68
|
}
|
|
66
69
|
// ---------------------------------------------------------------------------
|
|
67
70
|
// Rich Editor
|