spine-framework 0.3.124 → 0.3.126
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/.framework/cli/commands/agents.ts +35 -37
- package/.framework/cli/commands/auth.ts +35 -34
- package/.framework/cli/commands/create-app.ts +104 -40
- package/.framework/cli/commands/dev.ts +104 -69
- package/.framework/cli/commands/doctor.ts +179 -69
- package/.framework/cli/commands/generate.ts +83 -143
- package/.framework/cli/commands/init.ts +72 -34
- package/.framework/cli/commands/install-app.ts +260 -125
- package/.framework/cli/commands/items.ts +33 -44
- package/.framework/cli/commands/migrate.ts +122 -40
- package/.framework/cli/commands/migrations.ts +33 -40
- package/.framework/cli/commands/pipelines.ts +31 -39
- package/.framework/cli/commands/status.ts +47 -23
- package/.framework/cli/commands/system.ts +47 -37
- package/.framework/cli/commands/test.ts +112 -68
- package/.framework/cli/commands/validate-app.ts +215 -121
- package/.framework/cli/context.ts +112 -130
- package/.framework/cli/env-loader.ts +47 -18
- package/.framework/cli/index.ts +81 -42
- package/.framework/docs/runtime-types.md +1024 -0
- package/.framework/functions/_shared/agent-runner.ts +1296 -961
- package/.framework/functions/_shared/app-manifest.ts +82 -68
- package/.framework/functions/_shared/audit.ts +135 -83
- package/.framework/functions/_shared/{cil-state.ts → cil.ts} +158 -56
- package/.framework/functions/_shared/db.ts +80 -126
- package/.framework/functions/_shared/hash-api-key.ts +63 -0
- package/.framework/functions/_shared/index.ts +224 -335
- package/.framework/functions/_shared/kb.ts +319 -0
- package/.framework/functions/_shared/llm.ts +92 -0
- package/.framework/functions/_shared/logging.ts +288 -0
- package/.framework/functions/_shared/middleware.ts +329 -365
- package/.framework/functions/_shared/outcomes.ts +36 -0
- package/.framework/functions/_shared/permissions.ts +359 -643
- package/.framework/functions/_shared/pipeline-runner.ts +243 -316
- package/.framework/functions/_shared/principal.ts +376 -468
- package/.framework/functions/_shared/resolve-credentials.ts +102 -0
- package/.framework/functions/_shared/resolve-ids.ts +188 -16
- package/.framework/functions/_shared/retry-deliveries.ts +104 -0
- package/.framework/functions/_shared/schema-utils.ts +611 -373
- package/.framework/functions/_shared/testing.ts +207 -137
- package/.framework/functions/_shared/tracing.ts +276 -0
- package/.framework/functions/_shared/trigger-engine.ts +159 -211
- package/.framework/functions/_shared/webhook-registration.ts +95 -81
- package/.framework/functions/_shared/webhook-registry.ts +153 -75
- package/.framework/functions/account-nodes.ts +31 -53
- package/.framework/functions/adapters/generic-webhook-inbound.ts +56 -0
- package/.framework/functions/adapters/generic-webhook-outbound.ts +43 -0
- package/.framework/functions/adapters/openai-outbound.ts +40 -0
- package/.framework/functions/admin-data.ts +685 -537
- package/.framework/functions/admin-funnel.ts +31 -20
- package/.framework/functions/admin-install-funnel.ts +47 -28
- package/.framework/functions/admin-signals.ts +47 -29
- package/.framework/functions/ai-agents.ts +122 -147
- package/.framework/functions/ai-interactions.ts +180 -90
- package/.framework/functions/api-keys.ts +250 -192
- package/.framework/functions/apps.ts +203 -197
- package/.framework/functions/auth.ts +98 -91
- package/.framework/functions/cil-agent-ingest.ts +773 -0
- package/.framework/functions/cil-agent.ts +592 -0
- package/.framework/functions/cil-callmap.ts +1227 -0
- package/.framework/functions/cil-config.ts +583 -0
- package/.framework/functions/cil-context.ts +445 -0
- package/.framework/functions/cil-doc.ts +1752 -0
- package/.framework/functions/cil-embeddings.ts +1202 -0
- package/.framework/functions/cil-graph.ts +585 -0
- package/.framework/functions/cil-ingest.ts +2416 -0
- package/.framework/functions/cil-pipeline.ts +318 -0
- package/.framework/functions/cil-project.ts +499 -0
- package/.framework/functions/cil-validate.ts +469 -0
- package/.framework/functions/debug-auth.ts +73 -53
- package/.framework/functions/deliveries.ts +117 -0
- package/.framework/functions/embeddings.ts +528 -516
- package/.framework/functions/eval-harness.ts +158 -106
- package/.framework/functions/integration-outbound.ts +311 -0
- package/.framework/functions/integration-routes.ts +240 -466
- package/.framework/functions/integrations.ts +132 -140
- package/.framework/functions/invites.ts +401 -201
- package/.framework/functions/item-progress.ts +113 -53
- package/.framework/functions/kb.ts +28 -0
- package/.framework/functions/logs.ts +239 -222
- package/.framework/functions/observability.ts +308 -259
- package/.framework/functions/pipeline-executions.ts +179 -235
- package/.framework/functions/pipelines.ts +163 -205
- package/.framework/functions/prompt-configs.ts +109 -156
- package/.framework/functions/roles.ts +97 -147
- package/.framework/functions/system-cron.ts +132 -218
- package/.framework/functions/system.ts +112 -52
- package/.framework/functions/tests.ts +32 -28
- package/.framework/functions/timers.ts +162 -210
- package/.framework/functions/triggers.ts +282 -346
- package/.framework/functions/types.ts +283 -400
- package/.framework/migrations/001_core_schema.sql +630 -0
- package/.framework/migrations/002_core_rls_and_functions.sql +532 -0
- package/.framework/migrations/{003_system_data.sql → 003_core_system_data.sql} +26 -153
- package/.framework/migrations/004_core_rpc_and_broker.sql +421 -0
- package/.framework/migrations/005_core_observability.sql +598 -0
- package/.framework/migrations/006_security_hardening_rls.sql +97 -0
- package/.framework/migrations/007_kb_article_list.sql +237 -0
- package/.framework/migrations/008_items_target.sql +8 -0
- package/.framework/migrations/009_roles_slug_unique.sql +11 -0
- package/.framework/public/spine.config.json +91 -0
- package/.framework/scripts/app-install-cli.ts +112 -98
- package/.framework/src/App.tsx +67 -20
- package/.framework/src/apps/admin/index.tsx +97 -27
- package/.framework/src/components/AppWrapper.tsx +50 -11
- package/.framework/src/components/CustomAppLoader.tsx +131 -22
- package/.framework/src/components/admin/AdminListPage.tsx +75 -8
- package/.framework/src/components/admin/AdminSidebar.tsx +148 -36
- package/.framework/src/components/admin/AdminStatsCard.tsx +48 -29
- package/.framework/src/components/admin/PageInstructions.tsx +49 -0
- package/.framework/src/components/admin/SortableTableHeader.tsx +49 -2
- package/.framework/src/components/app-shell/GenericAppShell.tsx +69 -11
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +55 -10
- package/.framework/src/components/app-shell/GenericListPage.tsx +76 -9
- package/.framework/src/components/app-sidebar.tsx +50 -3
- package/.framework/src/components/auth/ProtectedRoute.tsx +53 -45
- package/.framework/src/components/kb/KBArticleEditor.tsx +409 -0
- package/.framework/src/components/kb/KBArticleList.tsx +557 -0
- package/.framework/src/components/layout/AppShell.tsx +54 -16
- package/.framework/src/components/layout/Header.tsx +50 -38
- package/.framework/src/components/layout/Layout.tsx +48 -32
- package/.framework/src/components/layout/Sidebar.tsx +167 -16
- package/.framework/src/components/runtime/DataDetailHeader.tsx +33 -1
- package/.framework/src/components/runtime/DataDetailPage.tsx +289 -4
- package/.framework/src/components/runtime/DataFilters.tsx +78 -1
- package/.framework/src/components/runtime/DataHeader.tsx +32 -29
- package/.framework/src/components/runtime/DataListPage.tsx +161 -2
- package/.framework/src/components/runtime/DataStats.tsx +48 -1
- package/.framework/src/components/runtime/DataTable.tsx +153 -1
- package/.framework/src/components/runtime/SchemaDetailForm.tsx +77 -46
- package/.framework/src/components/runtime/index.ts +16 -9
- package/.framework/src/components/search-form.tsx +33 -1
- package/.framework/src/components/shared/AgentView.tsx +48 -51
- package/.framework/src/components/shared/FieldRenderer.tsx +84 -67
- package/.framework/src/components/shared/InviteManager.tsx +113 -52
- package/.framework/src/components/shared/MemberList.tsx +182 -0
- package/.framework/src/components/shared/SchemaFields.tsx +96 -78
- package/.framework/src/components/ui/DataTable.tsx +86 -56
- package/.framework/src/components/ui/Form.tsx +188 -109
- package/.framework/src/components/ui/ItemCard.tsx +86 -58
- package/.framework/src/components/ui/ItemListView.tsx +88 -61
- package/.framework/src/components/ui/LoadingSpinner.tsx +52 -27
- package/.framework/src/components/ui/Modal.tsx +81 -4
- package/.framework/src/components/ui/RichTextEditor.tsx +101 -9
- package/.framework/src/components/ui/accordion.tsx +97 -5
- package/.framework/src/components/ui/alert-dialog.tsx +225 -13
- package/.framework/src/components/ui/alert.tsx +113 -6
- package/.framework/src/components/ui/aspect-ratio.tsx +49 -2
- package/.framework/src/components/ui/avatar.tsx +129 -7
- package/.framework/src/components/ui/badge.tsx +65 -3
- package/.framework/src/components/ui/breadcrumb.tsx +145 -8
- package/.framework/src/components/ui/button-group.tsx +81 -4
- package/.framework/src/components/ui/button.tsx +49 -2
- package/.framework/src/components/ui/calendar.tsx +65 -3
- package/.framework/src/components/ui/card.tsx +145 -8
- package/.framework/src/components/ui/carousel.tsx +129 -7
- package/.framework/src/components/ui/chart.tsx +161 -10
- package/.framework/src/components/ui/checkbox.tsx +49 -2
- package/.framework/src/components/ui/collapsible.tsx +81 -5
- package/.framework/src/components/ui/combobox.tsx +305 -20
- package/.framework/src/components/ui/command.tsx +177 -11
- package/.framework/src/components/ui/context-menu.tsx +273 -17
- package/.framework/src/components/ui/dialog.tsx +209 -27
- package/.framework/src/components/ui/direction.tsx +64 -4
- package/.framework/src/components/ui/drawer.tsx +193 -12
- package/.framework/src/components/ui/dropdown-menu.tsx +273 -18
- package/.framework/src/components/ui/empty.tsx +145 -9
- package/.framework/src/components/ui/field.tsx +209 -14
- package/.framework/src/components/ui/hover-card.tsx +81 -4
- package/.framework/src/components/ui/input-group.tsx +162 -10
- package/.framework/src/components/ui/input-otp.tsx +98 -5
- package/.framework/src/components/ui/input.tsx +49 -2
- package/.framework/src/components/ui/item.tsx +225 -13
- package/.framework/src/components/ui/kbd.tsx +65 -3
- package/.framework/src/components/ui/label.tsx +49 -2
- package/.framework/src/components/ui/menubar.tsx +289 -17
- package/.framework/src/components/ui/native-select.tsx +97 -5
- package/.framework/src/components/ui/navigation-menu.tsx +177 -10
- package/.framework/src/components/ui/pagination.tsx +161 -9
- package/.framework/src/components/ui/popover.tsx +145 -8
- package/.framework/src/components/ui/progress.tsx +49 -2
- package/.framework/src/components/ui/radio-group.tsx +65 -3
- package/.framework/src/components/ui/resizable.tsx +82 -4
- package/.framework/src/components/ui/scroll-area.tsx +65 -3
- package/.framework/src/components/ui/select.tsx +193 -11
- package/.framework/src/components/ui/separator.tsx +49 -2
- package/.framework/src/components/ui/sheet.tsx +193 -11
- package/.framework/src/components/ui/sidebar.tsx +481 -38
- package/.framework/src/components/ui/skeleton.tsx +49 -2
- package/.framework/src/components/ui/slider.tsx +49 -2
- package/.framework/src/components/ui/sonner.tsx +49 -2
- package/.framework/src/components/ui/spinner.tsx +49 -2
- package/.framework/src/components/ui/switch.tsx +49 -2
- package/.framework/src/components/ui/table-primitives.tsx +160 -33
- package/.framework/src/components/ui/table.tsx +161 -9
- package/.framework/src/components/ui/tabs.tsx +113 -6
- package/.framework/src/components/ui/textarea.tsx +49 -2
- package/.framework/src/components/ui/toggle-group.tsx +81 -4
- package/.framework/src/components/ui/toggle.tsx +65 -3
- package/.framework/src/components/ui/tooltip.tsx +97 -5
- package/.framework/src/contexts/AppContext.tsx +129 -45
- package/.framework/src/contexts/AuthContext.tsx +187 -144
- package/.framework/src/hooks/use-mobile.ts +48 -2
- package/.framework/src/hooks/useApi.ts +208 -159
- package/.framework/src/hooks/useAppPath.ts +32 -23
- package/.framework/src/hooks/useApps.ts +51 -20
- package/.framework/src/hooks/useEntityList.ts +32 -78
- package/.framework/src/hooks/useEntityRecord.ts +35 -96
- package/.framework/src/hooks/useForm.ts +32 -92
- package/.framework/src/hooks/useListSchema.ts +49 -78
- package/.framework/src/hooks/useSchemaRecord.ts +114 -105
- package/.framework/src/lib/api.ts +195 -116
- package/.framework/src/lib/supabase.ts +98 -64
- package/.framework/src/lib/utils.ts +287 -151
- package/.framework/src/main.tsx +49 -3
- package/.framework/src/pages/DashboardPage.tsx +52 -29
- package/.framework/src/pages/NotFoundPage.tsx +32 -10
- package/.framework/src/pages/SetupPage.tsx +32 -12
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +119 -10
- package/.framework/src/pages/admin/AIAgentsPage.tsx +48 -19
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +187 -17
- package/.framework/src/pages/admin/APIKeysPage.tsx +98 -22
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +113 -26
- package/.framework/src/pages/admin/AppDetailPage.tsx +125 -8
- package/.framework/src/pages/admin/AppsPage.tsx +49 -2
- package/.framework/src/pages/admin/DeliveriesPage.tsx +196 -0
- package/.framework/src/pages/admin/DesignedPage.tsx +32 -18
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +215 -484
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +116 -319
- package/.framework/src/pages/admin/ExtendedShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IncrementalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IntegratedDashboard.tsx +32 -16
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +183 -26
- package/.framework/src/pages/admin/IntegrationsPage.tsx +48 -19
- package/.framework/src/pages/admin/InvitesPage.tsx +48 -14
- package/.framework/src/pages/admin/LogsPage.tsx +422 -75
- package/.framework/src/pages/admin/MinimalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +113 -24
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +206 -34
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +50 -17
- package/.framework/src/pages/admin/PipelinesPage.tsx +160 -21
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +378 -88
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +125 -16
- package/.framework/src/pages/admin/ProperlyDesignedPage.tsx +49 -10
- package/.framework/src/pages/admin/RoleDetailPage.tsx +130 -10
- package/.framework/src/pages/admin/RolesPage.tsx +171 -18
- package/.framework/src/pages/admin/SelectTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ShadcnTestPage.tsx +49 -11
- package/.framework/src/pages/admin/SimpleDashboard.tsx +49 -10
- package/.framework/src/pages/admin/TestRunDetailPage.tsx +49 -4
- package/.framework/src/pages/admin/TestingDashboard.tsx +98 -28
- package/.framework/src/pages/admin/TimerDetailPage.tsx +143 -33
- package/.framework/src/pages/admin/TimersPage.tsx +48 -20
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +118 -30
- package/.framework/src/pages/admin/TriggersPage.tsx +64 -19
- package/.framework/src/pages/admin/TypeDetailPage.tsx +138 -15
- package/.framework/src/pages/admin/TypesPage.tsx +48 -20
- package/.framework/src/pages/admin/cil/CILAgentPage.tsx +465 -0
- package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +787 -0
- package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +699 -0
- package/.framework/src/pages/admin/cil/CILFileListPage.tsx +647 -0
- package/.framework/src/pages/admin/cil/CILGraphPage.tsx +616 -0
- package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +1402 -0
- package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +614 -0
- package/.framework/src/pages/admin/cil/CILSearchPage.tsx +571 -0
- package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +731 -0
- package/.framework/src/pages/admin/kb/KBAdminPage.tsx +64 -0
- package/.framework/src/pages/auth/AuthConfirmPage.tsx +52 -51
- package/.framework/src/pages/auth/ForgotPasswordPage.tsx +31 -22
- package/.framework/src/pages/auth/LoginPage.tsx +50 -23
- package/.framework/src/pages/auth/PendingApprovalPage.tsx +31 -15
- package/.framework/src/pages/auth/RegisterPage.tsx +281 -317
- package/.framework/src/pages/spine-framework/APIPage.tsx +33 -0
- package/.framework/src/pages/spine-framework/CLIPage.tsx +33 -0
- package/.framework/src/types/auth.ts +128 -71
- package/.framework/src/types/types.ts +373 -157
- package/custom/.devin/skills/spine-workbench-discovery/SKILL.md +39 -0
- package/custom/.devin/skills/spine-workbench-idea/SKILL.md +36 -0
- package/custom/.devin/skills/spine-workbench-implement/SKILL.md +46 -0
- package/custom/.devin/skills/spine-workbench-initiative/SKILL.md +28 -0
- package/custom/.devin/skills/spine-workbench-plan/SKILL.md +38 -0
- package/docs/README.md +9 -130
- package/netlify.toml +5 -2
- package/package.json +13 -25
- package/scripts/kb-ingest-docs.ts +203 -0
- package/spine.config.json +65 -4
- package/.framework/migrations/001_schema.sql +0 -425
- package/.framework/migrations/002_rls_and_functions.sql +0 -763
- package/.framework/migrations/004_enhancements.sql +0 -43
- package/.framework/migrations/005_auth_user_trigger.sql +0 -105
- package/.framework/migrations/006_fix_current_actor_id.sql +0 -21
- package/.framework/migrations/016_invites.sql +0 -27
- package/.framework/migrations/017_fix_get_account_apps.sql +0 -78
- package/.framework/migrations/018_apps_required_roles.sql +0 -17
- package/.framework/migrations/019_triggers_unique_constraint.sql +0 -13
- package/.framework/migrations/020_get_account_apps_role_filter.sql +0 -117
- package/.framework/migrations/021_app_domains.sql +0 -112
- package/.framework/migrations/022_route_prefix_domain_unique.sql +0 -21
- package/.framework/migrations/023_match_embeddings_rpc.sql +0 -78
- package/.framework/migrations/024_messages_account_id.sql +0 -9
- package/.framework/migrations/025_retype_threads_messages.sql +0 -240
- package/.framework/migrations/026_fix_rls_policies.sql +0 -47
- package/.framework/migrations/027_embedding_lifecycle.sql +0 -176
- package/.framework/migrations/028_fix_message_data_permissions.sql +0 -49
- package/.framework/migrations/029_tighten_support_triage_prompt.sql +0 -41
- package/.framework/migrations/030_messages_updated_by.sql +0 -6
- package/.framework/migrations/031_seed_upsert_constraints.sql +0 -35
- package/docs/APPS.md +0 -232
- package/docs/ARCHITECTURE.md +0 -246
- package/docs/INSTALL.md +0 -155
- package/docs/design-schema-spec.md +0 -1837
- package/docs/dev-guides/01-create-an-app.md +0 -183
- package/docs/dev-guides/02-create-a-function.md +0 -178
- package/docs/dev-guides/03-create-a-component.md +0 -178
- package/docs/dev-guides/04-webhook-handlers.md +0 -129
- package/docs/dev-guides/05-testing.md +0 -168
- package/docs/dev-guides/README.md +0 -40
- package/docs/npm-packages-plan.md +0 -288
- package/docs/spine-core--api-reference.md +0 -822
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module src/components/ui/ItemListView
|
|
3
|
-
* @audience installer
|
|
4
|
-
* @layer frontend-component
|
|
5
|
-
* @stability stable
|
|
6
|
-
*
|
|
7
|
-
* Switchable item view widget and page shell.
|
|
8
|
-
*
|
|
9
|
-
* **`ItemListView`** — renders items in either a compact `ItemGrid` or a
|
|
10
|
-
* full `DataTable` view, toggled by icon buttons. Derives unique type
|
|
11
|
-
* filter options from the items array and builds a fixed table column
|
|
12
|
-
* set. The primary display field is resolved from the first `text` or
|
|
13
|
-
* `textarea` field in the item type's `design_schema`.
|
|
14
|
-
*
|
|
15
|
-
* **`ItemListPage`** — wraps `ItemListView` with a page-level title and
|
|
16
|
-
* description header. Use as a standalone page component.
|
|
17
|
-
*
|
|
18
|
-
* @seeAlso src/components/ui/ItemCard.tsx
|
|
19
|
-
* @seeAlso src/components/ui/DataTable.tsx
|
|
20
|
-
* @seeAlso src/types/types.ts (Item, ItemType)
|
|
21
|
-
*/
|
|
22
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// CIL[BEGIN chunk_id="ItemListView_moduleheader_1783907801" type="module_header" identity="imports" parent="none"]
|
|
13
|
+
// CIL[DOC-MACRO purpose="Import React and item list dependencies"]
|
|
14
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide all external dependencies for item list view components"]
|
|
15
|
+
// CIL[DOC-CONTEXT module="ItemListView" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"\\\"]"]
|
|
16
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React, useState, item types, UI components" errors="none" side_effects="none"]
|
|
17
|
+
// CIL[DOC-MICRO logic_summary="Imports React hooks, item types, DataTable, ItemCard, UI components" notable_decisions="[]"]
|
|
18
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
19
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
20
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
21
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/pages/admin/RolesPage.tsx, .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/components/ui/dialog.tsx, \."]
|
|
22
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
23
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
24
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
25
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
26
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
23
27
|
import React, { useState } from 'react'
|
|
24
28
|
import { Item, ItemType } from '../../types/types'
|
|
25
29
|
import { DataTable } from './DataTable'
|
|
@@ -28,20 +32,21 @@ import { Badge } from './badge'
|
|
|
28
32
|
import { Button } from './button'
|
|
29
33
|
import { Squares2X2Icon, List, Plus } from 'lucide-react';
|
|
30
34
|
import { formatDateTime } from '../../lib/utils'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
// CIL[END chunk_id="ItemListView_moduleheader_1783907801"]
|
|
36
|
+
// CIL[BEGIN chunk_id="ItemListView_itemlistviewprops_1783907801" type="interface" identity="ItemListViewProps" parent="none"]
|
|
37
|
+
// CIL[DOC-MACRO purpose="Define props for item list view component"]
|
|
38
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify all props needed for ItemListView component configuration"]
|
|
39
|
+
// CIL[DOC-CONTEXT module="ItemListView" layer="frontend-component" related_files="[\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/principal.ts\",\".framework/functions/_shared/schema-utils.ts\",\"\\\"]"]
|
|
40
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="ItemListViewProps interface" errors="none" side_effects="none"]
|
|
41
|
+
// CIL[DOC-MICRO logic_summary="Props for items array, loading state, actions, and display options" notable_decisions="[]"]
|
|
42
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
43
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
44
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/components/ui/dialog.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/principal.ts, .framework/functions/_shared/schema-utils.ts, \."]
|
|
45
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
46
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
47
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
48
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
49
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
45
50
|
interface ItemListViewProps {
|
|
46
51
|
items: (Item & { item_type: ItemType })[]
|
|
47
52
|
loading?: boolean
|
|
@@ -55,14 +60,21 @@ interface ItemListViewProps {
|
|
|
55
60
|
showCreateButton?: boolean
|
|
56
61
|
createButtonText?: string
|
|
57
62
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
// CIL[END chunk_id="ItemListView_itemlistviewprops_1783907801"]
|
|
64
|
+
// CIL[BEGIN chunk_id="ItemListView_itemlistview_1783907801" type="function" identity="ItemListView" parent="none"]
|
|
65
|
+
// CIL[DOC-MACRO purpose="Render switchable grid/table item view with mode toggle"]
|
|
66
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Handle view mode switching and item display rendering"]
|
|
67
|
+
// CIL[DOC-CONTEXT module="ItemListView" layer="frontend-component" related_files="[\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
68
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="View mode toggle + ItemGrid or DataTable" errors="none" side_effects="Calls action callbacks"]
|
|
69
|
+
// CIL[DOC-MICRO logic_summary="Manages view mode state, builds table columns, renders appropriate view" notable_decisions="[]"]
|
|
70
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
71
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
72
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/cortex/functions/custom_cil-embeddings.ts, .framework/src/pages/admin/TypeDetailPage.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/schema-utils.ts, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
73
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
74
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
75
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
76
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
77
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
66
78
|
export function ItemListView({
|
|
67
79
|
items,
|
|
68
80
|
loading = false,
|
|
@@ -78,7 +90,7 @@ export function ItemListView({
|
|
|
78
90
|
}: ItemListViewProps) {
|
|
79
91
|
const [viewMode, setViewMode] = useState<'grid' | 'table'>('grid')
|
|
80
92
|
|
|
81
|
-
|
|
93
|
+
|
|
82
94
|
const typesMap = new Map<string, ItemType>()
|
|
83
95
|
items.forEach(item => {
|
|
84
96
|
typesMap.set(item.item_type.id, item.item_type)
|
|
@@ -88,7 +100,7 @@ export function ItemListView({
|
|
|
88
100
|
label: type.name
|
|
89
101
|
}))
|
|
90
102
|
|
|
91
|
-
|
|
103
|
+
|
|
92
104
|
const tableColumns = [
|
|
93
105
|
{
|
|
94
106
|
key: 'data' as const,
|
|
@@ -235,14 +247,21 @@ export function ItemListView({
|
|
|
235
247
|
</div>
|
|
236
248
|
)
|
|
237
249
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
// CIL[END chunk_id="ItemListView_itemlistview_1783907801"]
|
|
251
|
+
// CIL[BEGIN chunk_id="ItemListView_itemlistpageprops_1783907801" type="interface" identity="ItemListPageProps" parent="none"]
|
|
252
|
+
// CIL[DOC-MACRO purpose="Define props for item list page component"]
|
|
253
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify all props needed for ItemListPage component configuration"]
|
|
254
|
+
// CIL[DOC-CONTEXT module="ItemListView" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/pages/admin/IntegrationsPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"\\\"]"]
|
|
255
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="ItemListPageProps interface" errors="none" side_effects="none"]
|
|
256
|
+
// CIL[DOC-MICRO logic_summary="Extends ItemListViewProps with page-level title and description" notable_decisions="[]"]
|
|
257
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
258
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
259
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/src/pages/admin/TypeDetailPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/pages/admin/IntegrationsPage.tsx, .framework/src/components/ui/dialog.tsx, \."]
|
|
260
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
261
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
262
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
263
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
264
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
246
265
|
interface ItemListPageProps {
|
|
247
266
|
items: (Item & { item_type: ItemType })[]
|
|
248
267
|
loading?: boolean
|
|
@@ -258,14 +277,21 @@ interface ItemListPageProps {
|
|
|
258
277
|
title?: string
|
|
259
278
|
description?: string
|
|
260
279
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
280
|
+
// CIL[END chunk_id="ItemListView_itemlistpageprops_1783907801"]
|
|
281
|
+
// CIL[BEGIN chunk_id="ItemListView_itemlistpage_1783907801" type="function" identity="ItemListPage" parent="none"]
|
|
282
|
+
// CIL[DOC-MACRO purpose="Render full item list page with header and switchable view"]
|
|
283
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide page-level wrapper with title and ItemListView"]
|
|
284
|
+
// CIL[DOC-CONTEXT module="ItemListView" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
285
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Page with header + ItemListView" errors="none" side_effects="none"]
|
|
286
|
+
// CIL[DOC-MICRO logic_summary="Renders page header with title/description, wraps ItemListView component" notable_decisions="[]"]
|
|
287
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
288
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
289
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
290
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
291
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
292
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
293
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
294
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
269
295
|
export function ItemListPage({
|
|
270
296
|
items,
|
|
271
297
|
loading = false,
|
|
@@ -306,3 +332,4 @@ export function ItemListPage({
|
|
|
306
332
|
</div>
|
|
307
333
|
)
|
|
308
334
|
}
|
|
335
|
+
// CIL[END chunk_id="ItemListView_itemlistpage_1783907801"]
|
|
@@ -1,38 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module src/components/ui/LoadingSpinner
|
|
3
|
-
* @audience installer
|
|
4
|
-
* @layer frontend-component
|
|
5
|
-
* @stability stable
|
|
6
|
-
*
|
|
7
|
-
* Animated CSS spinner used to indicate loading state inline or as a
|
|
8
|
-
* centred overlay. Uses `border-t-blue-600` as the active segment colour
|
|
9
|
-
* and `border-slate-200` for the track.
|
|
10
|
-
*
|
|
11
|
-
* @seeAlso src/lib/utils.ts (cn)
|
|
12
|
-
*/
|
|
13
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// CIL[BEGIN chunk_id="LoadingSpinner_moduleheader_1783907801" type="module_header" identity="imports" parent="none"]
|
|
9
|
+
// CIL[DOC-MACRO purpose="Import React and spinner dependencies"]
|
|
10
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide all external dependencies for loading spinner component"]
|
|
11
|
+
// CIL[DOC-CONTEXT module="LoadingSpinner" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"\\\"]"]
|
|
12
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React, Loader2 icon, cn utility" errors="none" side_effects="none"]
|
|
13
|
+
// CIL[DOC-MICRO logic_summary="Imports React, lucide-react Loader2 icon, and utility function" notable_decisions="[]"]
|
|
14
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
15
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
16
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
17
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/pages/admin/RolesPage.tsx, .framework/src/components/ui/dialog.tsx, \."]
|
|
18
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
19
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
20
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
21
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
22
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
14
23
|
import React from 'react'
|
|
15
24
|
import { Loader2 } from 'lucide-react'
|
|
16
25
|
import { cn } from '../../lib/utils'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
// CIL[END chunk_id="LoadingSpinner_moduleheader_1783907801"]
|
|
27
|
+
// CIL[BEGIN chunk_id="LoadingSpinner_loadingspinnerprops_1783907801" type="interface" identity="LoadingSpinnerProps" parent="none"]
|
|
28
|
+
// CIL[DOC-MACRO purpose="Define props for loading spinner component"]
|
|
29
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify all props needed for LoadingSpinner component configuration"]
|
|
30
|
+
// CIL[DOC-CONTEXT module="LoadingSpinner" layer="frontend-component" related_files="[\".framework/src/components/ui/dialog.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/principal.ts\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/pages/admin/IntegrationsPage.tsx\",\"\\\"]"]
|
|
31
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="LoadingSpinnerProps interface" errors="none" side_effects="none"]
|
|
32
|
+
// CIL[DOC-MICRO logic_summary="Props for optional className and size (sm/md/lg)" notable_decisions="[]"]
|
|
33
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
34
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
35
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/principal.ts, .framework/functions/_shared/schema-utils.ts, .framework/src/pages/admin/IntegrationsPage.tsx, \."]
|
|
36
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
37
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
38
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
39
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
40
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
24
41
|
interface LoadingSpinnerProps {
|
|
25
42
|
className?: string
|
|
26
43
|
size?: 'sm' | 'md' | 'lg'
|
|
27
44
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
// CIL[END chunk_id="LoadingSpinner_loadingspinnerprops_1783907801"]
|
|
46
|
+
// CIL[BEGIN chunk_id="LoadingSpinner_loadingspinner_1783907801" type="function" identity="LoadingSpinner" parent="none"]
|
|
47
|
+
// CIL[DOC-MACRO purpose="Render animated loading spinner with configurable size"]
|
|
48
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Display spinning loader icon with size and styling options"]
|
|
49
|
+
// CIL[DOC-CONTEXT module="LoadingSpinner" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/pages/admin/RolesPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"\\\"]"]
|
|
50
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Animated Loader2 component" errors="none" side_effects="none"]
|
|
51
|
+
// CIL[DOC-MICRO logic_summary="Maps size prop to Tailwind classes, applies animation and custom classes" notable_decisions="[]"]
|
|
52
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
53
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
54
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 1. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/schema-utils.ts, .framework/src/pages/admin/RolesPage.tsx, .framework/src/components/ui/dialog.tsx, \."]
|
|
55
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 1. Total affected: 1."]
|
|
56
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
57
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
58
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
59
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
36
60
|
export function LoadingSpinner({ className, size = 'md' }: LoadingSpinnerProps) {
|
|
37
61
|
const sizeClasses = {
|
|
38
62
|
sm: 'h-4 w-4',
|
|
@@ -50,3 +74,4 @@ export function LoadingSpinner({ className, size = 'md' }: LoadingSpinnerProps)
|
|
|
50
74
|
/>
|
|
51
75
|
)
|
|
52
76
|
}
|
|
77
|
+
// CIL[END chunk_id="LoadingSpinner_loadingspinner_1783907801"]
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// CIL[BEGIN chunk_id="Modal_moduleheader_1783907801" type="module_header" identity="imports" parent="none"]
|
|
7
|
+
// CIL[DOC-MACRO purpose="Import React and dialog dependencies"]
|
|
8
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide all external dependencies for modal components"]
|
|
9
|
+
// CIL[DOC-CONTEXT module="Modal" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/components/ui/dialog.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\".framework/functions/_shared/principal.ts\",\"\\\"]"]
|
|
10
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React, cn, Dialog components" errors="none" side_effects="none"]
|
|
11
|
+
// CIL[DOC-MICRO logic_summary="Imports React, utility function, and shadcn dialog primitives" notable_decisions="[]"]
|
|
12
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
13
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
14
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
15
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/components/ui/dialog.tsx, .framework/src/pages/admin/RolesPage.tsx, .framework/functions/_shared/principal.ts, \."]
|
|
16
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
17
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
18
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
19
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
20
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
1
21
|
import React from 'react'
|
|
2
22
|
import { cn } from '../../lib/utils'
|
|
3
23
|
import {
|
|
@@ -7,7 +27,21 @@ import {
|
|
|
7
27
|
DialogTitle,
|
|
8
28
|
DialogDescription,
|
|
9
29
|
} from './dialog'
|
|
10
|
-
|
|
30
|
+
// CIL[END chunk_id="Modal_moduleheader_1783907801"]
|
|
31
|
+
// CIL[BEGIN chunk_id="Modal_modalprops_1783907801" type="interface" identity="ModalProps" parent="none"]
|
|
32
|
+
// CIL[DOC-MACRO purpose="Define main modal component props interface"]
|
|
33
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify all props needed for Modal component configuration"]
|
|
34
|
+
// CIL[DOC-CONTEXT module="Modal" layer="frontend-component" related_files="[\".framework/src/components/ui/dialog.tsx\",\".framework/src/components/ui/table-primitives.tsx\",\".framework/functions/_shared/schema-utils.ts\",\"custom/apps/portal/pages/ContentPage.tsx\",\"\\\"]"]
|
|
35
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="ModalProps interface" errors="none" side_effects="none"]
|
|
36
|
+
// CIL[DOC-MICRO logic_summary="Props for open state, close handler, content, and sizing" notable_decisions="[]"]
|
|
37
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
38
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
39
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, .framework/src/components/ui/table-primitives.tsx, .framework/functions/_shared/schema-utils.ts, custom/apps/portal/pages/ContentPage.tsx, \."]
|
|
40
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
41
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
42
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
43
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
44
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
11
45
|
interface ModalProps {
|
|
12
46
|
isOpen: boolean
|
|
13
47
|
onClose: () => void
|
|
@@ -16,7 +50,21 @@ interface ModalProps {
|
|
|
16
50
|
children: React.ReactNode
|
|
17
51
|
size?: 'sm' | 'md' | 'lg' | 'xl'
|
|
18
52
|
}
|
|
19
|
-
|
|
53
|
+
// CIL[END chunk_id="Modal_modalprops_1783907801"]
|
|
54
|
+
// CIL[BEGIN chunk_id="Modal_modal_1783907801" type="function" identity="Modal" parent="none"]
|
|
55
|
+
// CIL[DOC-MACRO purpose="Render modal dialog with configurable size and content"]
|
|
56
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Handle modal open/close state and content rendering"]
|
|
57
|
+
// CIL[DOC-CONTEXT module="Modal" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/components/ui/table-primitives.tsx\",\".framework/functions/_shared/principal.ts\",\"\\\"]"]
|
|
58
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Dialog wrapper" errors="none" side_effects="Calls onClose when dialog closed"]
|
|
59
|
+
// CIL[DOC-MICRO logic_summary="Maps size prop to Tailwind max-width classes, conditionally renders header" notable_decisions="[]"]
|
|
60
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
61
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
62
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/src/components/ui/dialog.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/components/ui/table-primitives.tsx, .framework/functions/_shared/principal.ts, \."]
|
|
63
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
64
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
65
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
66
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
67
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
20
68
|
export function Modal({
|
|
21
69
|
isOpen,
|
|
22
70
|
onClose,
|
|
@@ -46,12 +94,40 @@ export function Modal({
|
|
|
46
94
|
</Dialog>
|
|
47
95
|
)
|
|
48
96
|
}
|
|
49
|
-
|
|
97
|
+
// CIL[END chunk_id="Modal_modal_1783907801"]
|
|
98
|
+
// CIL[BEGIN chunk_id="Modal_modalfooterprops_1783907801" type="interface" identity="ModalFooterProps" parent="none"]
|
|
99
|
+
// CIL[DOC-MACRO purpose="Define props for modal footer container"]
|
|
100
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify props for modal footer content and styling"]
|
|
101
|
+
// CIL[DOC-CONTEXT module="Modal" layer="frontend-component" related_files="[\".framework/functions/_shared/principal.ts\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/pages/admin/IntegrationsPage.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\"\\\"]"]
|
|
102
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="ModalFooterProps interface" errors="none" side_effects="none"]
|
|
103
|
+
// CIL[DOC-MICRO logic_summary="Props for children content and optional styling classes" notable_decisions="[]"]
|
|
104
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
105
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
106
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: .framework/functions/_shared/principal.ts, .framework/functions/_shared/schema-utils.ts, .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/pages/admin/IntegrationsPage.tsx, custom/apps/portal/pages/ContentPage.tsx, \."]
|
|
107
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
108
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
109
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
110
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
111
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
50
112
|
interface ModalFooterProps {
|
|
51
113
|
children: React.ReactNode
|
|
52
114
|
className?: string
|
|
53
115
|
}
|
|
54
|
-
|
|
116
|
+
// CIL[END chunk_id="Modal_modalfooterprops_1783907801"]
|
|
117
|
+
// CIL[BEGIN chunk_id="Modal_modalfooter_1783907801" type="function" identity="ModalFooter" parent="none"]
|
|
118
|
+
// CIL[DOC-MACRO purpose="Render modal footer with action buttons"]
|
|
119
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide styled container for modal action buttons"]
|
|
120
|
+
// CIL[DOC-CONTEXT module="Modal" layer="frontend-component" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/components/ui/table-primitives.tsx\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/components/ui/dialog.tsx\"]"]
|
|
121
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Footer div container" errors="none" side_effects="none"]
|
|
122
|
+
// CIL[DOC-MICRO logic_summary="Uses Tailwind classes for flex layout, border, and spacing" notable_decisions="[]"]
|
|
123
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
124
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
125
|
+
// CIL[DOC-VECTOR type="context" content="Layer: frontend-component. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/src/components/ui/table-primitives.tsx, .framework/functions/_shared/schema-utils.ts, .framework/src/components/ui/dialog.tsx."]
|
|
126
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
127
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
128
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
129
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
130
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
55
131
|
export function ModalFooter({ children, className }: ModalFooterProps) {
|
|
56
132
|
return (
|
|
57
133
|
<div className={cn('flex justify-end gap-3 border-t px-6 py-4 mt-6', className)}>
|
|
@@ -59,3 +135,4 @@ export function ModalFooter({ children, className }: ModalFooterProps) {
|
|
|
59
135
|
</div>
|
|
60
136
|
)
|
|
61
137
|
}
|
|
138
|
+
// CIL[END chunk_id="Modal_modalfooter_1783907801"]
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// CIL[BEGIN chunk_id="richtexteditor_module_header_1783883196" type="module_header" identity="module_header" parent="none"]
|
|
7
|
+
// CIL[DOC-MACRO purpose="Import TipTap editor, extensions, syntax highlighting, and UI dependencies"]
|
|
8
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Provide external dependencies for rich text editor system"]
|
|
9
|
+
// CIL[DOC-CONTEXT module="richtexteditor" layer="ui" related_files="[\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/components/ui/dialog.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
10
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="TipTap, extensions, lowlight, icons, utils" errors="none" side_effects="none"]
|
|
11
|
+
// CIL[DOC-MICRO logic_summary="Imports TipTap editor core, extensions, syntax highlighting libraries, icons, and utilities" notable_decisions="[]"]
|
|
12
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
13
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
14
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
15
|
+
// CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: custom/apps/cortex/pages/operations/OperationsDashboard.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/src/components/ui/dialog.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
16
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
17
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
18
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
19
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
20
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
21
|
+
import DOMPurify from 'dompurify'
|
|
22
|
+
import { marked } from 'marked'
|
|
1
23
|
import { useEditor, EditorContent } from '@tiptap/react'
|
|
2
24
|
import StarterKit from '@tiptap/starter-kit'
|
|
3
25
|
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
|
@@ -8,7 +30,7 @@ import javascript from 'highlight.js/lib/languages/javascript'
|
|
|
8
30
|
import json from 'highlight.js/lib/languages/json'
|
|
9
31
|
import bash from 'highlight.js/lib/languages/bash'
|
|
10
32
|
import sql from 'highlight.js/lib/languages/sql'
|
|
11
|
-
import { useEffect } from 'react'
|
|
33
|
+
import { useEffect, useMemo } from 'react'
|
|
12
34
|
import {
|
|
13
35
|
Bold,
|
|
14
36
|
Italic,
|
|
@@ -21,7 +43,21 @@ import {
|
|
|
21
43
|
Minus,
|
|
22
44
|
} from 'lucide-react'
|
|
23
45
|
import { cn } from '@core/lib/utils'
|
|
24
|
-
|
|
46
|
+
// CIL[END chunk_id="richtexteditor_module_header_1783883196"]
|
|
47
|
+
// CIL[BEGIN chunk_id="richtexteditor_lowlight_1783883196" type="setup" identity="lowlight" parent="none"]
|
|
48
|
+
// CIL[DOC-MACRO purpose="Configure syntax highlighting for code blocks"]
|
|
49
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Set up lowlight with multiple programming languages"]
|
|
50
|
+
// CIL[DOC-CONTEXT module="richtexteditor" layer="ui" related_files="[\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/functions/_shared/principal.ts\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/functions/_shared/schema-utils.ts\",\"custom/apps/portal/pages/ContentPage.tsx\",\"\\\"]"]
|
|
51
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="lowlight instance" errors="none" side_effects="global config"]
|
|
52
|
+
// CIL[DOC-MICRO logic_summary="Creates lowlight instance and registers TypeScript, JavaScript, JSON, Bash, SQL languages" notable_decisions="[]"]
|
|
53
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
54
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
55
|
+
// CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: .framework/src/pages/admin/TypeDetailPage.tsx, .framework/functions/_shared/principal.ts, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/functions/_shared/schema-utils.ts, custom/apps/portal/pages/ContentPage.tsx, \."]
|
|
56
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
57
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
58
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
59
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
60
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
25
61
|
const lowlight = createLowlight()
|
|
26
62
|
lowlight.register('typescript', typescript)
|
|
27
63
|
lowlight.register('javascript', javascript)
|
|
@@ -29,6 +65,28 @@ lowlight.register('json', json)
|
|
|
29
65
|
lowlight.register('bash', bash)
|
|
30
66
|
lowlight.register('sql', sql)
|
|
31
67
|
|
|
68
|
+
function toHtml(raw: string | undefined): string {
|
|
69
|
+
const source = (raw ?? '').trim()
|
|
70
|
+
if (!source) return ''
|
|
71
|
+
const likelyHtml = /<\/?(?:h[1-6]|p|div|ul|ol|li|pre|code|br|span|strong|em|a|table|tr|td|th|thead|tbody|blockquote)\b/i.test(source)
|
|
72
|
+
return likelyHtml ? source : (marked.parse(source, { async: false }) as string)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// CIL[END chunk_id="richtexteditor_lowlight_1783883196"]
|
|
76
|
+
// CIL[BEGIN chunk_id="richtexteditor_richtexteditorprops_1783883196" type="interface" identity="RichTextEditorProps" parent="none"]
|
|
77
|
+
// CIL[DOC-MACRO purpose="Define props interface for RichTextEditor component"]
|
|
78
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Specify component configuration and behavior options"]
|
|
79
|
+
// CIL[DOC-CONTEXT module="richtexteditor" layer="ui" related_files="[\".framework/functions/_shared/schema-utils.ts\",\".framework/src/components/ui/dialog.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/principal.ts\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"\\\"]"]
|
|
80
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="RichTextEditorProps interface" errors="none" side_effects="type definition"]
|
|
81
|
+
// CIL[DOC-MICRO logic_summary="Defines value, onChange, placeholder, readonly, className, minHeight props" notable_decisions="[]"]
|
|
82
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
83
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
84
|
+
// CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: .framework/functions/_shared/schema-utils.ts, .framework/src/components/ui/dialog.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/principal.ts, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, \."]
|
|
85
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
86
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
87
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
88
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
89
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
32
90
|
interface RichTextEditorProps {
|
|
33
91
|
value: string
|
|
34
92
|
onChange?: (html: string) => void
|
|
@@ -37,7 +95,21 @@ interface RichTextEditorProps {
|
|
|
37
95
|
className?: string
|
|
38
96
|
minHeight?: string
|
|
39
97
|
}
|
|
40
|
-
|
|
98
|
+
// CIL[END chunk_id="richtexteditor_richtexteditorprops_1783883196"]
|
|
99
|
+
// CIL[BEGIN chunk_id="richtexteditor_toolbarbutton_1783883196" type="function" identity="ToolbarButton" parent="none"]
|
|
100
|
+
// CIL[DOC-MACRO purpose="Toolbar button component with active state styling"]
|
|
101
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render styled toolbar button with active/inactive states"]
|
|
102
|
+
// CIL[DOC-CONTEXT module="richtexteditor" layer="ui" related_files="[\".framework/src/components/ui/dialog.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\".framework/functions/_shared/schema-utils.ts\",\"\\\"]"]
|
|
103
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="JSX button element" errors="none" side_effects="renders DOM"]
|
|
104
|
+
// CIL[DOC-MICRO logic_summary="Creates button with active styling, hover effects, and click handling" notable_decisions="[]"]
|
|
105
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
106
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
107
|
+
// CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, .framework/src/pages/admin/RolesPage.tsx, custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/functions/custom_cil-embeddings.ts, .framework/functions/_shared/schema-utils.ts, \."]
|
|
108
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
109
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
110
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
111
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
112
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
41
113
|
function ToolbarButton({
|
|
42
114
|
onClick,
|
|
43
115
|
active,
|
|
@@ -65,7 +137,21 @@ function ToolbarButton({
|
|
|
65
137
|
</button>
|
|
66
138
|
)
|
|
67
139
|
}
|
|
68
|
-
|
|
140
|
+
// CIL[END chunk_id="richtexteditor_toolbarbutton_1783883196"]
|
|
141
|
+
// CIL[BEGIN chunk_id="richtexteditor_richtexteditor_1783883196" type="function" identity="RichTextEditor" parent="none"]
|
|
142
|
+
// CIL[DOC-MACRO purpose="Main rich text editor with toolbar and content editing"]
|
|
143
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render complete rich text editor with formatting toolbar and content area"]
|
|
144
|
+
// CIL[DOC-CONTEXT module="richtexteditor" layer="ui" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/functions/_shared/schema-utils.ts\",\".framework/src/pages/admin/RolesPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/components/ui/dialog.tsx\"]"]
|
|
145
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="JSX editor component" errors="none" side_effects="renders DOM"]
|
|
146
|
+
// CIL[DOC-MICRO logic_summary="Creates TipTap editor with toolbar, readonly mode, content styling, and synchronization" notable_decisions="[]"]
|
|
147
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
148
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
149
|
+
// CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/functions/_shared/schema-utils.ts, .framework/src/pages/admin/RolesPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/components/ui/dialog.tsx."]
|
|
150
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
151
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
152
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
153
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
154
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
69
155
|
export function RichTextEditor({
|
|
70
156
|
value,
|
|
71
157
|
onChange,
|
|
@@ -74,6 +160,8 @@ export function RichTextEditor({
|
|
|
74
160
|
className,
|
|
75
161
|
minHeight = '300px',
|
|
76
162
|
}: RichTextEditorProps) {
|
|
163
|
+
const htmlValue = useMemo(() => DOMPurify.sanitize(toHtml(value)), [value])
|
|
164
|
+
|
|
77
165
|
const editor = useEditor({
|
|
78
166
|
extensions: [
|
|
79
167
|
StarterKit.configure({
|
|
@@ -82,7 +170,7 @@ export function RichTextEditor({
|
|
|
82
170
|
CodeBlockLowlight.configure({ lowlight }),
|
|
83
171
|
Placeholder.configure({ placeholder }),
|
|
84
172
|
],
|
|
85
|
-
content:
|
|
173
|
+
content: htmlValue,
|
|
86
174
|
editable: !readonly,
|
|
87
175
|
onUpdate: ({ editor }) => {
|
|
88
176
|
onChange?.(editor.getHTML())
|
|
@@ -92,10 +180,10 @@ export function RichTextEditor({
|
|
|
92
180
|
useEffect(() => {
|
|
93
181
|
if (!editor) return
|
|
94
182
|
const current = editor.getHTML()
|
|
95
|
-
if (current !==
|
|
96
|
-
editor.commands.setContent(
|
|
183
|
+
if (current !== htmlValue) {
|
|
184
|
+
editor.commands.setContent(htmlValue, false)
|
|
97
185
|
}
|
|
98
|
-
}, [
|
|
186
|
+
}, [htmlValue, editor])
|
|
99
187
|
|
|
100
188
|
useEffect(() => {
|
|
101
189
|
if (editor) editor.setEditable(!readonly)
|
|
@@ -110,7 +198,10 @@ export function RichTextEditor({
|
|
|
110
198
|
'prose-code:bg-muted prose-code:px-1 prose-code:rounded prose-code:text-xs prose-code:font-mono',
|
|
111
199
|
className
|
|
112
200
|
)}
|
|
113
|
-
|
|
201
|
+
// Sanitize before injecting: `value` may be rich-text HTML or legacy
|
|
202
|
+
// markdown stored in records, and must never execute scripts/handlers
|
|
203
|
+
// for readers (stored-XSS defense).
|
|
204
|
+
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(htmlValue) }}
|
|
114
205
|
/>
|
|
115
206
|
)
|
|
116
207
|
}
|
|
@@ -208,3 +299,4 @@ export function RichTextEditor({
|
|
|
208
299
|
</div>
|
|
209
300
|
)
|
|
210
301
|
}
|
|
302
|
+
// CIL[END chunk_id="richtexteditor_richtexteditor_1783883196"]
|