@aiquants/daily-report 0.20.0 → 0.21.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 +229 -8
- package/dist/client.d.mts +201 -739
- package/dist/client.d.ts +201 -739
- package/dist/client.js +5 -6
- package/dist/client.mjs +5 -6
- package/dist/index.d.mts +5 -197
- package/dist/index.d.ts +5 -197
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/dist/logger-D3krZrNK.d.mts +0 -14
- package/dist/logger-D3krZrNK.d.ts +0 -14
- package/dist/server.d.mts +114 -744
- package/dist/server.d.ts +114 -744
- package/dist/server.js +1 -2
- package/dist/server.mjs +1 -2
- package/dist/{sse-schema-ChSFm-4q.d.mts → sse-schema-DCxpdETM.d.mts} +1106 -1090
- package/dist/{sse-schema-BdUGThiz.d.ts → sse-schema-DoQw8_om.d.ts} +1106 -1090
- package/dist/types-CqgYQgbH.d.mts +0 -34
- package/dist/types-CqgYQgbH.d.ts +0 -34
- package/package.json +9 -10
- package/dist/client.js.map +0 -1
- package/dist/client.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/src/client/components/business-day-thumb-overlay.tsx +0 -19
- package/src/client/components/daily-report-attachment-indicator.spec.tsx +0 -51
- package/src/client/components/daily-report-attachment-indicator.tsx +0 -45
- package/src/client/components/daily-report-attachment-list.spec.tsx +0 -94
- package/src/client/components/daily-report-attachment-list.tsx +0 -112
- package/src/client/components/daily-report-comment-item.tsx +0 -89
- package/src/client/components/daily-report-comment-section.tsx +0 -166
- package/src/client/components/daily-report-detail-list.tsx +0 -842
- package/src/client/components/daily-report-edit-form.tsx +0 -87
- package/src/client/components/daily-report-ids-stream-status.spec.tsx +0 -93
- package/src/client/components/daily-report-ids-stream-status.tsx +0 -67
- package/src/client/components/daily-report-list.tsx +0 -1232
- package/src/client/components/daily-report-page.spec.tsx +0 -119
- package/src/client/components/daily-report-page.tsx +0 -140
- package/src/client/components/daily-report-resize-panels.spec.tsx +0 -307
- package/src/client/components/daily-report-resolved-content.tsx +0 -207
- package/src/client/components/daily-report-scroll-restoration.spec.tsx +0 -422
- package/src/client/components/report-views.spec.tsx +0 -375
- package/src/client/components/unread-indicator.tsx +0 -13
- package/src/client/config-context.tsx +0 -184
- package/src/client/contexts/daily-report-action-context.spec.tsx +0 -433
- package/src/client/contexts/daily-report-action-context.tsx +0 -1147
- package/src/client/contexts/daily-report-error-context.spec.tsx +0 -66
- package/src/client/contexts/daily-report-error-context.tsx +0 -98
- package/src/client/hooks/use-animated-number.spec.ts +0 -103
- package/src/client/hooks/use-animated-number.ts +0 -69
- package/src/client/hooks/use-daily-report-comments.ts +0 -73
- package/src/client/hooks/use-daily-report-sse-connection.ts +0 -86
- package/src/client/hooks/use-daily-report.spec.ts +0 -546
- package/src/client/hooks/use-daily-report.ts +0 -549
- package/src/client/hooks/use-dynamic-viewport-height.ts +0 -127
- package/src/client/hooks/use-responsive-layout.spec.ts +0 -74
- package/src/client/hooks/use-responsive-layout.ts +0 -63
- package/src/client/route-helpers.spec.ts +0 -100
- package/src/client/route-helpers.ts +0 -61
- package/src/client/streaming/daily-report-ids-stream-client.spec.ts +0 -910
- package/src/client/streaming/daily-report-ids-stream-client.ts +0 -730
- package/src/client/streaming/daily-report-ids-stream-session.spec.ts +0 -401
- package/src/client/streaming/daily-report-ids-stream-session.ts +0 -319
- package/src/client/ui/button.tsx +0 -42
- package/src/client/ui/cn.ts +0 -14
- package/src/client/ui/input.tsx +0 -21
- package/src/client/ui/label.tsx +0 -16
- package/src/client/ui/switch.tsx +0 -19
- package/src/client/ui/tabs.tsx +0 -40
- package/src/client/ui/textarea.tsx +0 -19
- package/src/client/utils/constants.spec.ts +0 -96
- package/src/client/utils/constants.ts +0 -84
- package/src/client.ts +0 -28
- package/src/index.ts +0 -11
- package/src/lucide-icons.d.ts +0 -6
- package/src/server/authz.spec.ts +0 -57
- package/src/server/authz.ts +0 -99
- package/src/server/cache.spec.ts +0 -556
- package/src/server/cache.ts +0 -303
- package/src/server/etag.ts +0 -18
- package/src/server/external-source.ts +0 -60
- package/src/server/handlers.action.spec.ts +0 -44
- package/src/server/handlers.attachment.spec.ts +0 -470
- package/src/server/handlers.ids-stream.spec.ts +0 -618
- package/src/server/handlers.ts +0 -1638
- package/src/server/handlers.unauthorized-cookie.spec.ts +0 -187
- package/src/server/handlers.visibility.spec.ts +0 -774
- package/src/server/ports.ts +0 -222
- package/src/server/response.ts +0 -37
- package/src/server/schema.spec.ts +0 -30
- package/src/server/schema.ts +0 -344
- package/src/server/service.spec.ts +0 -1130
- package/src/server/service.ts +0 -2045
- package/src/server/sse-reader.spec.ts +0 -302
- package/src/server/sse-reader.ts +0 -267
- package/src/server/test-helpers/handlers-config.ts +0 -321
- package/src/server/transaction-retry.spec.ts +0 -63
- package/src/server/visibility.spec.ts +0 -403
- package/src/server/visibility.ts +0 -373
- package/src/server.spec.ts +0 -160
- package/src/server.ts +0 -131
- package/src/shared/business-date.spec.ts +0 -82
- package/src/shared/business-date.ts +0 -104
- package/src/shared/comment-adapter.spec.ts +0 -38
- package/src/shared/comment-adapter.ts +0 -80
- package/src/shared/ids-stream.spec.ts +0 -154
- package/src/shared/ids-stream.ts +0 -279
- package/src/shared/logger.ts +0 -47
- package/src/shared/sse-schema.spec.ts +0 -50
- package/src/shared/sse-schema.ts +0 -198
- package/src/shared/text-utils.spec.ts +0 -42
- package/src/shared/text-utils.ts +0 -65
- package/src/shared/types.ts +0 -109
- package/src/styles/standalone.entry.css +0 -51
package/src/shared/text-utils.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared text helpers for daily report view components.
|
|
3
|
-
* 日報ビューコンポーネント向けの共通テキストヘルパー。
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Normalizes nullable text by trimming whitespace and applying fallback.
|
|
8
|
-
* null 許容の文字列をトリムしつつフォールバック値を適用する関数。
|
|
9
|
-
*/
|
|
10
|
-
export const fallbackText = (value: string | null | undefined): string => {
|
|
11
|
-
if (!value) {
|
|
12
|
-
return "-"
|
|
13
|
-
}
|
|
14
|
-
const trimmed = value.trim()
|
|
15
|
-
return trimmed === "" ? "-" : trimmed
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Formats a date string to ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss).
|
|
20
|
-
* 日付文字列を ISO 8601 形式 (YYYY-MM-DD または YYYY-MM-DDTHH:mm:ss) に整形する関数。
|
|
21
|
-
*/
|
|
22
|
-
export const formatToIsoDate = (value: unknown): string => {
|
|
23
|
-
if (!value) {
|
|
24
|
-
return "-"
|
|
25
|
-
}
|
|
26
|
-
if (typeof value !== "string") {
|
|
27
|
-
// If value is not a string (e.g. Date object), try to convert it to string or handle it
|
|
28
|
-
if (value instanceof Date) {
|
|
29
|
-
return formatToIsoDate(value.toISOString())
|
|
30
|
-
}
|
|
31
|
-
return String(value)
|
|
32
|
-
}
|
|
33
|
-
const trimmed = value.trim()
|
|
34
|
-
if (trimmed === "") {
|
|
35
|
-
return "-"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 日付のみ (YYYY-MM-DD / YYYY/MM/DD) は Date を経由せず整形する。
|
|
39
|
-
// `new Date("2026-08-08")` は UTC 深夜と解釈され、ローカル getter で負オフセット圏
|
|
40
|
-
// (米国など) では前日へずれるため。
|
|
41
|
-
const dateOnly = trimmed.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/)
|
|
42
|
-
if (dateOnly) {
|
|
43
|
-
return `${dateOnly[1]}-${dateOnly[2]}-${dateOnly[3]}`
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const date = new Date(trimmed)
|
|
47
|
-
if (Number.isNaN(date.getTime())) {
|
|
48
|
-
return trimmed
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const year = date.getFullYear()
|
|
52
|
-
const month = String(date.getMonth() + 1).padStart(2, "0")
|
|
53
|
-
const day = String(date.getDate()).padStart(2, "0")
|
|
54
|
-
|
|
55
|
-
const hasTime = trimmed.includes(":") || trimmed.includes("T")
|
|
56
|
-
|
|
57
|
-
if (hasTime) {
|
|
58
|
-
const hours = String(date.getHours()).padStart(2, "0")
|
|
59
|
-
const minutes = String(date.getMinutes()).padStart(2, "0")
|
|
60
|
-
const seconds = String(date.getSeconds()).padStart(2, "0")
|
|
61
|
-
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return `${year}-${month}-${day}`
|
|
65
|
-
}
|
package/src/shared/types.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core data types shared by the daily-report client and server layers.
|
|
3
|
-
* 日報機能の client / server 層で共有するコアデータ型定義。
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/** 日報一覧の 1 アイテム (詳細は遅延読み込み)。 */
|
|
7
|
-
export type DailyReportItem = {
|
|
8
|
-
reportHubId: number
|
|
9
|
-
businessDate: string | null
|
|
10
|
-
sourceType?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** 面談者情報。 */
|
|
14
|
-
export type DailyReportInterviewer = {
|
|
15
|
-
name?: string | null
|
|
16
|
-
affiliation?: string | null
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** レガシー形式 (JSON 埋め込み) のコメント。 */
|
|
20
|
-
export type DailyReportExternalComment = {
|
|
21
|
-
name?: string | null
|
|
22
|
-
text?: string | null
|
|
23
|
-
color?: string | null
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** ラベル定義。 */
|
|
27
|
-
export type DailyReportLabelDef = {
|
|
28
|
-
id: number
|
|
29
|
-
name?: string | null
|
|
30
|
-
color?: string | null
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Verification state of an attachment's backing object.
|
|
35
|
-
* 添付ファイルの実体の検証状態。
|
|
36
|
-
*
|
|
37
|
-
* 三値にする理由: 存在確認そのものが失敗した場合 (権限・通信障害) を偽の真偽で埋めないため。
|
|
38
|
-
* `unknown` は「まだ検証していない / 検証できなかった」であり、`absent` (消失を確認した) とは異なる。
|
|
39
|
-
*/
|
|
40
|
-
export type DailyReportAttachmentState = "present" | "absent" | "unknown"
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* One attachment as exposed to the client.
|
|
44
|
-
* クライアントへ公開する添付ファイル 1 件。
|
|
45
|
-
*
|
|
46
|
-
* `id` は難読化トークンであり内部数値 ID ではない。ストレージパス (`filePath`) は
|
|
47
|
-
* サーバー内部にとどまり、この型には現れない。
|
|
48
|
-
* `fileSize` / `createdAt` が null になり得るのは、サイズや作成日時を報告しない取込元があるため。
|
|
49
|
-
*/
|
|
50
|
-
export type DailyReportAttachmentSummary = {
|
|
51
|
-
id: string
|
|
52
|
-
fileName: string
|
|
53
|
-
fileType: string | null
|
|
54
|
-
fileSize: number | null
|
|
55
|
-
createdAt: string | null
|
|
56
|
-
state: DailyReportAttachmentState
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** リレーショナルコメント 1 件。`userId` は難読化済み文字列。 */
|
|
60
|
-
export type DailyReportPostedComment = {
|
|
61
|
-
id: number
|
|
62
|
-
userId?: string | null
|
|
63
|
-
userName?: string | null
|
|
64
|
-
content?: string | null
|
|
65
|
-
createdAt?: string | null
|
|
66
|
-
isMine: boolean
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** 日報詳細 (一覧アイテムの遅延解決結果)。`userId` は難読化済み文字列。 */
|
|
70
|
-
export type DailyReportDetail = {
|
|
71
|
-
reportHubId: number
|
|
72
|
-
date?: string | null
|
|
73
|
-
createdAt?: string | null
|
|
74
|
-
author?: string | null
|
|
75
|
-
userId?: string | null
|
|
76
|
-
sourceType?: string | null
|
|
77
|
-
employeeName?: string | null
|
|
78
|
-
updatedBy?: string | null
|
|
79
|
-
updatedAt?: string | null
|
|
80
|
-
category?: string | null
|
|
81
|
-
creationCategory?: string | null
|
|
82
|
-
visitTimeFrom?: string | null
|
|
83
|
-
visitTimeTo?: string | null
|
|
84
|
-
customerName?: string | null
|
|
85
|
-
interviewers: DailyReportInterviewer[]
|
|
86
|
-
subject?: string | null
|
|
87
|
-
content?: string | null
|
|
88
|
-
externalComments: DailyReportExternalComment[]
|
|
89
|
-
isRead: boolean
|
|
90
|
-
isStarred: boolean
|
|
91
|
-
labels: DailyReportLabelDef[]
|
|
92
|
-
postedComments: DailyReportPostedComment[]
|
|
93
|
-
/**
|
|
94
|
-
* 添付ファイル一覧。必須にしているのは詰め忘れをコンパイル時に落とすため。
|
|
95
|
-
* 任意にすると `?? []` で黙って空配列になり、SSE 経由でクライアントの既存一覧を空で上書きする。
|
|
96
|
-
*/
|
|
97
|
-
attachments: DailyReportAttachmentSummary[]
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Minimal display-user shape consumed by the client layer.
|
|
102
|
-
* client 層が表示に使う最小ユーザー形状 (Google プロフィール等と構造互換)。
|
|
103
|
-
*/
|
|
104
|
-
export type DailyReportUser = {
|
|
105
|
-
id: string
|
|
106
|
-
displayName?: string
|
|
107
|
-
name?: { familyName?: string; givenName?: string }
|
|
108
|
-
emails?: { value: string }[]
|
|
109
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*! @aiquants/daily-report standalone CSS — 非 Tailwind ホスト専用。ホストの Tailwind ビルドと混在させないこと */
|
|
2
|
-
@layer theme, base, components, utilities;
|
|
3
|
-
@import "tailwindcss/theme.css" layer(theme);
|
|
4
|
-
/* source(none): 自動ソース検出を無効化し、src 外のクラス混入を防ぐ */
|
|
5
|
-
@import "tailwindcss/utilities.css" layer(utilities) source(none);
|
|
6
|
-
/*
|
|
7
|
-
* virtualscroll の CSS は同梱しない: ホスト側で import 済みの新しいコピーを、
|
|
8
|
-
* ここに焼き込んだ古いコピーが後勝ちで上書きする事故 (stale-copy-wins) を防ぐため。
|
|
9
|
-
* ホストアプリは @aiquants/virtualscroll/styles/virtualscroll.css を自前で import すること。
|
|
10
|
-
*/
|
|
11
|
-
@source "../**/*.{ts,tsx}";
|
|
12
|
-
|
|
13
|
-
/* JSX は .dark クラス切替の dark: バリアントを使うため、ホストアプリと同じ定義が必要 */
|
|
14
|
-
@plugin "tailwindcss-animate";
|
|
15
|
-
@custom-variant dark (&:where(.dark, .dark *));
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
* ホストアプリ (quants-react-router) の @theme と同じトークン定義を複製する。
|
|
19
|
-
* bg-background / text-muted-foreground などのセマンティックトークンは
|
|
20
|
-
* Tailwind 既定テーマに存在しないため、定義しないとユーティリティ自体が生成されない。
|
|
21
|
-
* 値はホストの CSS 変数 (--background 等) を参照し、実行時にホスト側で解決される。
|
|
22
|
-
*/
|
|
23
|
-
@theme {
|
|
24
|
-
--color-border: hsl(var(--border));
|
|
25
|
-
--color-input: hsl(var(--input));
|
|
26
|
-
--color-ring: hsl(var(--ring));
|
|
27
|
-
--color-background: hsl(var(--background));
|
|
28
|
-
--color-foreground: hsl(var(--foreground));
|
|
29
|
-
--color-primary: hsl(var(--primary));
|
|
30
|
-
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
31
|
-
--color-secondary: hsl(var(--secondary));
|
|
32
|
-
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
33
|
-
--color-destructive: hsl(var(--destructive));
|
|
34
|
-
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
35
|
-
--color-muted: hsl(var(--muted));
|
|
36
|
-
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
37
|
-
--color-accent: hsl(var(--accent));
|
|
38
|
-
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
39
|
-
--color-popover: hsl(var(--popover));
|
|
40
|
-
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
41
|
-
--color-card: hsl(var(--card));
|
|
42
|
-
--color-card-foreground: hsl(var(--card-foreground));
|
|
43
|
-
--breakpoint-sm: 640px;
|
|
44
|
-
--breakpoint-md: 768px;
|
|
45
|
-
--breakpoint-lg: 1024px;
|
|
46
|
-
--breakpoint-xl: 1280px;
|
|
47
|
-
--breakpoint-2xl: 1536px;
|
|
48
|
-
--radius-lg: var(--radius, 0.5rem);
|
|
49
|
-
--radius-md: calc(var(--radius, 0.5rem) - 2px);
|
|
50
|
-
--radius-sm: calc(var(--radius, 0.5rem) - 4px);
|
|
51
|
-
}
|