Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(property): finish migration to new property package (#3529)

Seamus64352ed1fa4e
diff --git a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts b/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
index a5e69d00ba..3c2c92b83d 100644
--- a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
+++ b/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
@@ -5,10 +5,7 @@ import {
type Query,
} from '@app/component/next-soup/filters/filter-store';
import type { ListView } from '@app/constants/list-views';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import { subWeeks } from 'date-fns';
type SoupFiltersPreset = {
diff --git a/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts b/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
index b983fb61f0..94d8f0cce4 100644
--- a/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
+++ b/js/app/packages/app/component/next-soup/actions/use-block-entity-commands.ts
@@ -2,11 +2,6 @@ import { useGlobalNotificationSource } from '@app/component/GlobalAppState';
import { useAllProperties } from '@app/component/property-edit-modal/hooks/useAllProperties';
import { openPropertyEditor } from '@app/component/property-edit-modal/state/propertyEditor';
import { useBlockId } from '@core/block';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
-import type {
- Property,
- PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
import { useQuickAccess } from '@core/context/quickAccess';
import { useUserId } from '@core/context/user';
import { HotkeyTags } from '@core/hotkey/constants';
@@ -14,6 +9,8 @@ import { createHotkeyGroup, registerHotkey } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
import { blockHotkeyScopeSignal } from '@core/signal/blockElement';
import { type EntityData, isTaskEntity } from '@entity';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
+import type { Property, PropertyDefinitionDomain } from '@property/types';
import { createEffect, onCleanup } from 'solid-js';
import {
makeCopyAction,
diff --git a/js/app/packages/app/component/next-soup/actions/use-entity-action-hotkeys.ts b/js/app/packages/app/component/next-soup/actions/use-entity-action-hotkeys.ts
index 9731e9f175..2a0e80aa1f 100644
--- a/js/app/packages/app/component/next-soup/actions/use-entity-action-hotkeys.ts
+++ b/js/app/packages/app/component/next-soup/actions/use-entity-action-hotkeys.ts
@@ -6,16 +6,13 @@ import { useAllProperties } from '@app/component/property-edit-modal/hooks/useAl
import { openPropertyEditor } from '@app/component/property-edit-modal/state/propertyEditor';
import type { SplitHandle } from '@app/component/split-layout/layoutManager';
import { isListViewID } from '@app/constants/list-views';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
-import type {
- Property,
- PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
import { useUserId } from '@core/context/user';
import { HotkeyTags } from '@core/hotkey/constants';
import { createHotkeyGroup, registerHotkey } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
import { type EntityData, isTaskEntity } from '@entity';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
+import type { Property, PropertyDefinitionDomain } from '@property/types';
import { onCleanup } from 'solid-js';
import type { SoupState } from '../create-soup-state';
import {
diff --git a/js/app/packages/app/component/next-soup/filters/configs/task.ts b/js/app/packages/app/component/next-soup/filters/configs/task.ts
index 8c276fa8de..e7086ff9eb 100644
--- a/js/app/packages/app/component/next-soup/filters/configs/task.ts
+++ b/js/app/packages/app/component/next-soup/filters/configs/task.ts
@@ -1,12 +1,9 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
import {
getTaskAssigneeIds,
isTaskEntity,
type TaskEntityWithProperties,
} from '@entity';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import {
hasNoPriority,
isCanceled,
diff --git a/js/app/packages/app/component/next-soup/filters/predicates.ts b/js/app/packages/app/component/next-soup/filters/predicates.ts
index 4721bb8fdc..2ffc0bf0cf 100644
--- a/js/app/packages/app/component/next-soup/filters/predicates.ts
+++ b/js/app/packages/app/component/next-soup/filters/predicates.ts
@@ -1,4 +1,3 @@
-import { PROPERTY_OPTION_IDS } from '@core/component/Properties/constants';
import type { Entity } from '@core/types';
import {
type EntityData,
@@ -10,6 +9,7 @@ import {
} from '@entity';
import { getTaskPriorityOptionId } from '@entity/utils/task-properties';
import { compositeEntity, type NotificationSource } from '@notifications';
+import { PROPERTY_OPTION_IDS } from '@property/constants';
// Channel messages don't have their own notifications — they share the parent
// channel's. Resolve to the channel entity for notification lookups.
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
index a25267f47c..229e09e432 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
@@ -9,11 +9,6 @@ import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
import type { ListView } from '@app/constants/list-views';
import { isListViewID } from '@app/constants/list-views';
import { EntityIcon } from '@core/component/EntityIcon';
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
import { UserIcon } from '@core/component/UserIcon';
import { useUserId } from '@core/context/user';
import { registerHotkey } from '@core/hotkey/hotkeys';
@@ -22,6 +17,8 @@ import CaretRightIcon from '@phosphor/caret-right.svg';
import CheckIcon from '@phosphor/check.svg';
import CircleDashedIcon from '@phosphor/circle-dashed.svg';
import SlidersHorizontalIcon from '@phosphor-icons/core/regular/sliders-horizontal.svg?component-solid';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import { useContacts } from '@queries/contacts/contacts';
import { cn, Dropdown, Tooltip } from '@ui';
import {
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
index 96f76a4283..de2984d99e 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
@@ -13,9 +13,9 @@ import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-contex
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
import type { ListView } from '@app/constants/list-views';
import { isListViewID } from '@app/constants/list-views';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
import { useUserContext, useUserId } from '@core/context/user';
import { deepEqual } from '@core/util/compareUtils';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import { useContacts } from '@queries/contacts/contacts';
import { type Accessor, batch, createMemo, createSignal } from 'solid-js';
import type { ActiveFilter } from './active-filter-chips';
diff --git a/js/app/packages/app/component/next-soup/soup-view/group-options.ts b/js/app/packages/app/component/next-soup/soup-view/group-options.ts
index 4fd8d91fa6..3eadd6a445 100644
--- a/js/app/packages/app/component/next-soup/soup-view/group-options.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/group-options.ts
@@ -1,4 +1,4 @@
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
export type GroupOptionId =
| 'none'
diff --git a/js/app/packages/app/component/next-soup/soup-view/sort-options.tsx b/js/app/packages/app/component/next-soup/soup-view/sort-options.tsx
index 56c21d90dc..8b2cf20ab4 100644
--- a/js/app/packages/app/component/next-soup/soup-view/sort-options.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/sort-options.tsx
@@ -2,7 +2,6 @@ import type {
SortConfig,
SoupEntity,
} from '@app/component/next-soup/create-soup-state';
-import { PROPERTY_OPTION_IDS } from '@core/component/Properties/constants';
import { compareDateDesc } from '@core/util/date';
import type {
EntityData,
@@ -18,6 +17,7 @@ import ClockIcon from '@phosphor/clock.svg';
import EyeIcon from '@phosphor/eye.svg';
import FlagIcon from '@phosphor/flag.svg';
import ListChecksIcon from '@phosphor/list-checks.svg';
+import { PROPERTY_OPTION_IDS } from '@property/constants';
import type { JSX } from 'solid-js';
export type SystemSortOption =
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 328c094ff6..a4889cd9a2 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -68,8 +68,6 @@ import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { EmailPermissionsBanner } from '@core/component/EmailPermissionsBanner';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { LoadingBlock } from '@core/component/LoadingBlock';
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
import { Resize } from '@core/component/Resize';
import { UserIcon } from '@core/component/UserIcon';
import { ENABLE_UNIFIED_LIST_AI_INPUT } from '@core/constant/featureFlags';
@@ -97,6 +95,8 @@ import CaretDownIcon from '@phosphor/caret-down.svg';
import ChevronRightIcon from '@phosphor/caret-right.svg';
import CheckIcon from '@phosphor/check.svg';
import Spinner from '@phosphor/spinner.svg';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import { useQueryClient } from '@queries/client';
import { emailKeys } from '@queries/email/keys';
import { useEmailLinksQuery } from '@queries/email/link';
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx
index 1f92a79696..da47f6fd27 100644
--- a/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx
@@ -1,9 +1,9 @@
import { useMaybeBlockId } from '@core/block';
-import { usePropertiesContext } from '@core/component/Properties/context/PropertiesContext';
-import { getEntityValues, hasValue } from '@core/component/Properties/utils';
import CircleDashedEmpty from '@phosphor/circle-dashed.svg';
import { Property } from '@property';
+import { usePropertiesContext } from '@property/context/PropertiesContext';
import type { Property as PropertyT } from '@property/types';
+import { getEntityValues, hasValue } from '@property/utils';
import { type Component, Match, Show, Switch } from 'solid-js';
import './list-property-value.css';
import { Layer } from '@ui';
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx
index f62691a28e..0ee2fb473a 100644
--- a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx
@@ -1,12 +1,3 @@
-import { Modals } from '@core/component/Properties/component/modal';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
-} from '@core/component/Properties/context/PropertiesContext';
-import type {
- Property,
- PropertyApiValues,
-} from '@core/component/Properties/types';
import { UserIcon } from '@core/component/UserIcon';
import { tryMacroId, useDisplayNameParts } from '@core/user';
import {
@@ -24,6 +15,12 @@ import {
} from '@entity/components/Badges';
import type { LayoutProps } from '@entity/composed/list-entity/shared';
import { soupPropertyToProperty } from '@entity/extractors-property';
+import { Modals } from '@property/component/modal';
+import {
+ PropertiesProvider,
+ type PropertySaveHandler,
+} from '@property/context/PropertiesContext';
+import type { Property, PropertyApiValues } from '@property/types';
import { useUserId } from '@queries/auth';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
import { EntityType } from '@service-properties/generated/schemas/entityType';
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts
index c365e79331..3f2e70b310 100644
--- a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts
@@ -1,4 +1,4 @@
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import { DataType } from '@service-storage/generated/schemas/dataType';
import { EntityType } from '@service-storage/generated/schemas/entityType';
diff --git a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
index d42cd4cddc..be4ef0faf5 100644
--- a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
+++ b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
@@ -1,16 +1,3 @@
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue';
-import { usePropertySelection } from '@core/component/Properties/hooks';
-import { usePropertyEntityDisplay } from '@core/component/Properties/hooks/usePropertyEntityDisplay';
-import type {
- Property,
- PropertyApiValues,
- PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
-import {
- macroEntityToPropertyEntityType,
- PropertyDataTypeIcon,
- toPropertyApiValue,
-} from '@core/component/Properties/utils';
import { toast } from '@core/component/Toast/Toast';
import { useDateSearch } from '@core/util/dateSearch/useDateSearch';
import { fuzzyFilter } from '@core/util/fuzzy';
@@ -21,6 +8,19 @@ import {
} from '@core/util/useListKeyBindings';
import { type EntityData, InlineEntity } from '@entity';
import { type CombinedEntity, getEntityName, getEntityType } from '@property';
+import { PropertyValueIcon } from '@property/component/propertyValue';
+import { usePropertySelection } from '@property/hooks';
+import { usePropertyEntityDisplay } from '@property/hooks/usePropertyEntityDisplay';
+import type {
+ Property,
+ PropertyApiValues,
+ PropertyDefinitionDomain,
+} from '@property/types';
+import {
+ macroEntityToPropertyEntityType,
+ PropertyDataTypeIcon,
+ toPropertyApiValue,
+} from '@property/utils';
import { useEntityPropertiesQuery } from '@queries/properties/entity';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import { mergeRefs } from '@solid-primitives/refs';
diff --git a/js/app/packages/app/component/property-edit-modal/hooks/useAllProperties.ts b/js/app/packages/app/component/property-edit-modal/hooks/useAllProperties.ts
index a065ffb1b0..92ccd349cd 100644
--- a/js/app/packages/app/component/property-edit-modal/hooks/useAllProperties.ts
+++ b/js/app/packages/app/component/property-edit-modal/hooks/useAllProperties.ts
@@ -1,5 +1,5 @@
-import type { PropertyDefinitionDomain } from '@core/component/Properties/types';
-import { toPropertyDefinitionDomain } from '@core/component/Properties/utils';
+import type { PropertyDefinitionDomain } from '@property/types';
+import { toPropertyDefinitionDomain } from '@property/utils';
import { useListPropertiesQuery } from '@queries/properties/definitions';
import { createMemo } from 'solid-js';
diff --git a/js/app/packages/app/component/property-edit-modal/hooks/useEntitiesForProperty.ts b/js/app/packages/app/component/property-edit-modal/hooks/useEntitiesForProperty.ts
index da9a2f8a21..d29b9497c3 100644
--- a/js/app/packages/app/component/property-edit-modal/hooks/useEntitiesForProperty.ts
+++ b/js/app/packages/app/component/property-edit-modal/hooks/useEntitiesForProperty.ts
@@ -1,7 +1,3 @@
-import type {
- Property,
- PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
import { useEmail, useUserId } from '@core/context/user';
import { useAugmentUserWithDmActivity } from '@core/user';
import { createFreshSearch } from '@core/util/freshSort';
@@ -20,6 +16,7 @@ import {
useQuickAccessEntities,
userToEntity,
} from '@property';
+import type { Property, PropertyDefinitionDomain } from '@property/types';
import { useSearchSoupQuery } from '@queries/soup/search';
import { debounce } from '@solid-primitives/scheduled';
import {
diff --git a/js/app/packages/app/component/property-edit-modal/hooks/useSaveProperties.ts b/js/app/packages/app/component/property-edit-modal/hooks/useSaveProperties.ts
index f4682d1811..1ed4876e5e 100644
--- a/js/app/packages/app/component/property-edit-modal/hooks/useSaveProperties.ts
+++ b/js/app/packages/app/component/property-edit-modal/hooks/useSaveProperties.ts
@@ -1,10 +1,10 @@
+import type { EntityData } from '@entity';
import type {
Property,
PropertyApiValues,
PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
-import { macroEntityToPropertyEntityType } from '@core/component/Properties/utils';
-import type { EntityData } from '@entity';
+} from '@property/types';
+import { macroEntityToPropertyEntityType } from '@property/utils';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
export function useSavePropertyForMultiEntitites() {
diff --git a/js/app/packages/app/component/property-edit-modal/state/propertyEditor.ts b/js/app/packages/app/component/property-edit-modal/state/propertyEditor.ts
index bd3ed991e3..a0adde51d6 100644
--- a/js/app/packages/app/component/property-edit-modal/state/propertyEditor.ts
+++ b/js/app/packages/app/component/property-edit-modal/state/propertyEditor.ts
@@ -1,9 +1,6 @@
-import type {
- Property,
- PropertyDefinitionDomain,
-} from '@core/component/Properties/types';
import { createControlledOpenSignal } from '@core/util/createControlledOpenSignal';
import type { EntityData } from '@entity';
+import type { Property, PropertyDefinitionDomain } from '@property/types';
import { createStore, reconcile } from 'solid-js/store';
type PropertyEditorMode = 'selector' | 'direct';
diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsx
index c0d514c392..91543f0945 100644
--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx
+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx
@@ -378,11 +378,6 @@ if (LOCAL_ONLY) {
)
);
- registerComponent(
- 'properties-debug',
- lazy(() => import('@core/component/Properties/debug/PropertiesDebug'))
- );
-
registerComponent(
'props-debug',
lazy(() => import('@property/debug/PropertyDebug'))
diff --git a/js/app/packages/block-canvas/component/ModalsProvider.tsx b/js/app/packages/block-canvas/component/ModalsProvider.tsx
index ff03fa9d86..600b59a1dc 100644
--- a/js/app/packages/block-canvas/component/ModalsProvider.tsx
+++ b/js/app/packages/block-canvas/component/ModalsProvider.tsx
@@ -1,6 +1,5 @@
import { useBlockId } from '@core/block';
import { DetailsDrawer } from '@core/component/DetailsDrawer';
-import { DocumentPropertiesDrawer } from '@core/component/DocumentPropertiesModal';
import { ReferencesDrawer } from '@core/component/ReferencesModal';
import {
ShareBlockModal,
@@ -23,7 +22,6 @@ export function ModalsProvider(props: ParentProps) {
>
{props.children}
<ReferencesDrawer documentId={documentId} documentName={fileName()} />
- <DocumentPropertiesDrawer blockType="canvas" />
<DetailsDrawer documentId={documentId} />
<ShareBlockModal name={fileName()} />
</ShareDialogContext.Provider>
diff --git a/js/app/packages/block-canvas/component/TopBar.tsx b/js/app/packages/block-canvas/component/TopBar.tsx
index 20e0c49f85..885292c7c2 100644
--- a/js/app/packages/block-canvas/component/TopBar.tsx
+++ b/js/app/packages/block-canvas/component/TopBar.tsx
@@ -14,10 +14,6 @@ import { BlockItemSplitLabel } from '@app/component/split-layout/components/Spli
import { useIsAuthenticated } from '@core/auth';
import { createBlockSignal, useBlockId } from '@core/block';
import { DETAILS_DRAWER_ID } from '@core/component/DetailsDrawer';
-import {
- DocumentPropertiesButton,
- PROPERTIES_DRAWER_ID,
-} from '@core/component/DocumentPropertiesModal';
import { BlockLiveIndicators } from '@core/component/LiveIndicators';
import {
REFERENCES_DRAWER_ID,
@@ -40,7 +36,6 @@ import IconShared from '@icon/wide-share.svg';
import DownloadSimple from '@phosphor/download-simple.svg';
import Info from '@phosphor/info.svg';
import Quotes from '@phosphor/quotes.svg';
-import TagIcon from '@phosphor/tag.svg';
import { createCallback } from '@solid-primitives/rootless';
import { toast } from 'core/component/Toast/Toast';
import { onMount } from 'solid-js';
@@ -65,7 +60,6 @@ export function TopBar() {
const canvasFile = blockFileSignal.get;
const referencesControl = useDrawerControl(REFERENCES_DRAWER_ID);
- const propertiesControl = useDrawerControl(PROPERTIES_DRAWER_ID);
const detailsControl = useDrawerControl(DETAILS_DRAWER_ID);
const shareCtx = useShareDialogContext();
@@ -137,20 +131,6 @@ export function TopBar() {
/>
),
},
- {
- label: 'Properties',
- icon: TagIcon,
- action: propertiesControl.toggle,
- buttonComponent: () => (
- <DocumentPropertiesButton
- buttonSize="sm"
- onOpenChange={(open) =>
- open &&
- analytics.track('properties_panel_open', { blockType: 'canvas' })
- }
- />
- ),
- },
{
label: 'Share',
icon: IconShared,
diff --git a/js/app/packages/block-code/component/ModalsProvider.tsx b/js/app/packages/block-code/component/ModalsProvider.tsx
index e238851be2..433b135a9a 100644
--- a/js/app/packages/block-code/component/ModalsProvider.tsx
+++ b/js/app/packages/block-code/component/ModalsProvider.tsx
@@ -1,6 +1,5 @@
import { useBlockId } from '@core/block';
import { DetailsDrawer } from '@core/component/DetailsDrawer';
-import { DocumentPropertiesDrawer } from '@core/component/DocumentPropertiesModal';
import { ReferencesDrawer } from '@core/component/ReferencesModal';
import {
ShareBlockModal,
@@ -23,7 +22,6 @@ export function ModalsProvider(props: ParentProps) {
>
{props.children}
<ReferencesDrawer documentId={blockId} documentName={name()} />
- <DocumentPropertiesDrawer blockType="code" />
<DetailsDrawer documentId={blockId} />
<ShareBlockModal />
</ShareDialogContext.Provider>
diff --git a/js/app/packages/block-code/component/TopBar.tsx b/js/app/packages/block-code/component/TopBar.tsx
index 3101320298..f189c7fc9f 100644
--- a/js/app/packages/block-code/component/TopBar.tsx
+++ b/js/app/packages/block-code/component/TopBar.tsx
@@ -12,10 +12,6 @@ import { SplitToolbarRight } from '@app/component/split-layout/components/SplitT
import { useIsAuthenticated } from '@core/auth';
import { useBlockId } from '@core/block';
import { DETAILS_DRAWER_ID } from '@core/component/DetailsDrawer';
-import {
- DocumentPropertiesButton,
- PROPERTIES_DRAWER_ID,
-} from '@core/component/DocumentPropertiesModal';
import {
REFERENCES_DRAWER_ID,
ReferencesButton,
@@ -37,7 +33,6 @@ import IconShared from '@icon/wide-share.svg';
import Download from '@phosphor/download-simple.svg';
import Info from '@phosphor/info.svg';
import Quotes from '@phosphor/quotes.svg';
-import TagIcon from '@phosphor/tag.svg';
import { createCallback } from '@solid-primitives/rootless';
import { TabbedControl } from '@ui';
import type { Component } from 'solid-js';
@@ -60,7 +55,6 @@ export const TopBar: Component<{
const downloadName = useBlockDocumentDownloadName();
const referencesControl = useDrawerControl(REFERENCES_DRAWER_ID);
- const propertiesControl = useDrawerControl(PROPERTIES_DRAWER_ID);
const detailsControl = useDrawerControl(DETAILS_DRAWER_ID);
const shareCtx = useShareDialogContext();
@@ -104,20 +98,6 @@ export const TopBar: Component<{
/>
),
},
- {
- label: 'Properties',
- icon: TagIcon,
- action: propertiesControl.toggle,
- buttonComponent: () => (
- <DocumentPropertiesButton
- buttonSize="sm"
- onOpenChange={(open) =>
- open &&
- analytics.track('properties_panel_open', { blockType: 'code' })
- }
- />
- ),
- },
{
label: 'Share',
icon: IconShared,
diff --git a/js/app/packages/block-email/component/EmailPropertiesModal.tsx b/js/app/packages/block-email/component/EmailPropertiesModal.tsx
deleted file mode 100644
index ca9e6a1c3c..0000000000
--- a/js/app/packages/block-email/component/EmailPropertiesModal.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { SplitDrawer } from '@app/component/split-layout/components/SplitDrawer';
-import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
-import { PropertiesView } from '@core/component/Properties/PropertiesView';
-import TagIcon from '@phosphor/tag.svg';
-import { EntityType } from '@service-properties/generated/schemas/entityType';
-import { Button } from '@ui';
-import { Suspense } from 'solid-js';
-
-export const PROPERTIES_DRAWER_ID = 'properties';
-const DRAWER_ID = PROPERTIES_DRAWER_ID;
-
-export function EmailPropertiesButton(props: { buttonSize?: 'sm' | 'base' }) {
- const drawerControl = useDrawerControl(DRAWER_ID);
- return (
- <Button
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'sm' ? 'icon-sm' : 'icon-md'}
- label="Properties"
- onClick={drawerControl.toggle}
- >
- <TagIcon />
- </Button>
- );
-}
-
-export function EmailPropertiesDrawer(props: {
- canEdit: boolean;
- subject?: string;
-}) {
- return (
- <SplitDrawer id={DRAWER_ID} side="right" size={550} title="Properties">
- <Suspense fallback={<LoadingFallback />}>
- <EmailPropertiesContent
- canEdit={props.canEdit}
- subject={props.subject}
- />
- </Suspense>
- </SplitDrawer>
- );
-}
-
-function EmailPropertiesContent(props: { canEdit: boolean; subject?: string }) {
- return (
- <PropertiesView
- blockType={'email'}
- canEdit={props.canEdit}
- entityType={EntityType.THREAD}
- documentName={props.subject}
- />
- );
-}
-
-function LoadingFallback() {
- return (
- <div class="flex justify-center items-center py-8">
- <div class="animate-spin rounded-full size-6 border-b-2 border-ink-muted"></div>
- </div>
- );
-}
diff --git a/js/app/packages/block-email/component/ModalsProvider.tsx b/js/app/packages/block-email/component/ModalsProvider.tsx
index 50937a79ff..ebb1ec8a6d 100644
--- a/js/app/packages/block-email/component/ModalsProvider.tsx
+++ b/js/app/packages/block-email/component/ModalsProvider.tsx
@@ -1,4 +1,3 @@
-import { hasPermissions, Permissions } from '@core/component/SharePermissions';
import {
ShareBlockModal,
ShareDialogContext,
@@ -6,12 +5,9 @@ import {
import { ENABLE_EMAIL_SHARING } from '@core/constant/featureFlags';
import { createSignal, type ParentProps, Show } from 'solid-js';
import { useEmailContext } from './EmailContext';
-import { EmailPropertiesDrawer } from './EmailPropertiesModal';
export function ModalsProvider(props: ParentProps<{ subject?: string }>) {
const email = useEmailContext();
- const canEdit = () =>
- hasPermissions(email.permissions().type, Permissions.CAN_EDIT);
const [shareOpen, setShareOpen] = createSignal(false);
return (
<ShareDialogContext.Provider
@@ -22,7 +18,6 @@ export function ModalsProvider(props: ParentProps<{ subject?: string }>) {
}}
>
{props.children}
- <EmailPropertiesDrawer canEdit={canEdit()} subject={props.subject} />
<Show when={ENABLE_EMAIL_SHARING}>
<ShareBlockModal
name={props.subject}
diff --git a/js/app/packages/block-email/component/TopBar.tsx b/js/app/packages/block-email/component/TopBar.tsx
index 785d652cbb..69d7f8d95f 100644
--- a/js/app/packages/block-email/component/TopBar.tsx
+++ b/js/app/packages/block-email/component/TopBar.tsx
@@ -10,7 +10,6 @@ import {
} from '@app/component/next-soup/utils';
import type { BlockTool } from '@app/component/ResponsiveBlockToolbar';
import { ResponsiveBlockToolbar } from '@app/component/ResponsiveBlockToolbar';
-import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
import {
SplitHeaderBadge,
@@ -32,24 +31,18 @@ import { AnimatedTaskIcon } from '@icon/wide-task';
import { buildMentionMarkdownString } from '@lexical-core';
import CheckIcon from '@phosphor/check.svg';
import ProhibitIcon from '@phosphor/prohibit.svg';
-import TagIcon from '@phosphor/tag.svg';
import TrashIcon from '@phosphor/trash.svg';
import ArrowCounterClockwise from '@phosphor-icons/core/regular/arrow-counter-clockwise.svg?component-solid';
import { useEmailLinksQuery } from '@queries/email/link';
import { Button } from '@ui';
import { createSignal } from 'solid-js';
import { useEmailContext } from './EmailContext';
-import {
- EmailPropertiesButton,
- PROPERTIES_DRAWER_ID,
-} from './EmailPropertiesModal';
export function TopBar(props: {
id: string;
title: string;
isDraft?: boolean;
}) {
- const propertiesControl = useDrawerControl(PROPERTIES_DRAWER_ID);
const { popoverSplit } = useSplitLayout();
const shareCtx = useShareDialogContext();
const emailCtx = useEmailContext();
@@ -156,12 +149,6 @@ export function TopBar(props: {
action: () => emailCtx.blockSender(),
condition: isOwnThread,
},
- {
- label: 'Properties',
- icon: TagIcon,
- action: propertiesControl.toggle,
- buttonComponent: () => <EmailPropertiesButton buttonSize="sm" />,
- },
{
label: 'Create Task',
icon: AnimatedTaskIcon,
diff --git a/js/app/packages/block-email/component/date-selector.tsx b/js/app/packages/block-email/component/date-selector.tsx
index 02cb200afe..7033ef7368 100644
--- a/js/app/packages/block-email/component/date-selector.tsx
+++ b/js/app/packages/block-email/component/date-selector.tsx
@@ -1,11 +1,11 @@
import { DatePickerUI } from '@core/component/DatePicker/DatePickerUI';
-import { useSearchInputFocus } from '@core/component/Properties/utils';
import { useDateSearch } from '@core/util/dateSearch/useDateSearch';
import {
Combobox,
type ComboboxRootItemComponentProps,
} from '@kobalte/core/combobox';
import SearchIcon from '@phosphor/magnifying-glass.svg';
+import { useSearchInputFocus } from '@property/utils';
import { cn, Layer } from '@ui';
import { format, setHours, setMinutes, startOfDay } from 'date-fns';
import {
diff --git a/js/app/packages/block-md/component/ComposeTask.tsx b/js/app/packages/block-md/component/ComposeTask.tsx
index fa4f91291c..2bef90701a 100644
--- a/js/app/packages/block-md/component/ComposeTask.tsx
+++ b/js/app/packages/block-md/component/ComposeTask.tsx
@@ -4,24 +4,6 @@ import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownCon
import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';
import { addMediaFromFile } from '@core/component/LexicalMarkdown/plugins/media';
import { initializeEditorEmpty } from '@core/component/LexicalMarkdown/utils';
-import {
- propertyApiValuesToNormalized,
- propertyValueToApi,
-} from '@core/component/Properties/api/converters';
-import { Modals } from '@core/component/Properties/component/modal';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
-} from '@core/component/Properties/context/PropertiesContext';
-import type {
- Property,
- PropertyApiValues,
- PropertyOption,
-} from '@core/component/Properties/types';
import { toast } from '@core/component/Toast/Toast';
import { useUserId } from '@core/context/user';
import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
@@ -33,6 +15,21 @@ import ArrowsOutIcon from '@phosphor/arrows-out.svg';
import PaperclipIcon from '@phosphor/paperclip.svg';
import SplitIcon from '@phosphor/square-half.svg';
import XIcon from '@phosphor/x.svg';
+import {
+ propertyApiValuesToNormalized,
+ propertyValueToApi,
+} from '@property/api/converters';
+import { Modals } from '@property/component/modal';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
+import {
+ PropertiesProvider,
+ type PropertySaveHandler,
+} from '@property/context/PropertiesContext';
+import type {
+ Property,
+ PropertyApiValues,
+ PropertyOption,
+} from '@property/types';
import { useUpsertToHistoryMutation } from '@queries/history/history';
import { refetchSoupEntity } from '@queries/soup/cache';
import { propertiesServiceClient } from '@service-properties/client';
diff --git a/js/app/packages/block-md/component/FrontMatterProperties.tsx b/js/app/packages/block-md/component/FrontMatterProperties.tsx
deleted file mode 100644
index 78ecea0953..0000000000
--- a/js/app/packages/block-md/component/FrontMatterProperties.tsx
+++ /dev/null
@@ -1,304 +0,0 @@
-import { useBlockAliasedName, useBlockId } from '@core/block';
-import {
- $getPinnedProperties,
- ADD_PINNED_PROPERTY_COMMAND,
- dispatchInternalLayoutShift,
- REMOVE_PINNED_PROPERTY_COMMAND,
-} from '@core/component/LexicalMarkdown/plugins';
-import { Modals } from '@core/component/Properties/component/modal';
-import { PanelContainer } from '@core/component/Properties/component/panel';
-import { getDefaultPinnedProperties } from '@core/component/Properties/constants';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
- usePropertiesContext,
-} from '@core/component/Properties/context/PropertiesContext';
-import { useEntityProperties } from '@core/component/Properties/hooks';
-import type {
- Property,
- PropertyApiValues,
-} from '@core/component/Properties/types';
-import { isMobile } from '@core/mobile/isMobile';
-import CaretDown from '@phosphor/caret-down.svg';
-import CaretRight from '@phosphor/caret-right.svg';
-import Plus from '@phosphor/plus.svg';
-import LoadingSpinner from '@phosphor/spinner.svg';
-import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
-import { useDocumentMetadataQuery } from '@queries/storage/document-metadata';
-import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import { createElementSize } from '@solid-primitives/resize-observer';
-import {
- createEffect,
- createMemo,
- createSignal,
- type JSX,
- on,
- onCleanup,
- Show,
- Suspense,
-} from 'solid-js';
-import {
- frontMatterPreference,
- setFrontMatterPreferenceForDoc,
-} from '../signal/frontMatter';
-import { mdStore } from '../signal/markdownBlockData';
-
-interface FrontMatterPropertiesProps {
- canEdit: boolean;
- documentName: string;
- fallback: JSX.Element;
-}
-
-export function FrontMatterProperties(props: FrontMatterPropertiesProps) {
- const blockId = useBlockId();
- const mdData = mdStore.get;
-
- const blockName = useBlockAliasedName();
- const entityType: EntityType = blockName === 'task' ? 'TASK' : 'DOCUMENT';
-
- const layoutShift = () => {
- if (mdData.editor) {
- dispatchInternalLayoutShift(mdData.editor);
- }
- };
-
- const { properties, isLoading, error, refetch } = useEntityProperties(
- blockId,
- entityType,
- false
- );
-
- // Track expanded/collapsed state from persisted preference
- // Tasks default to expanded on desktop; other documents default to collapsed
- const isExpanded = createMemo(() => {
- const preference = frontMatterPreference[blockId];
- if (preference !== undefined) return preference;
- return entityType === 'TASK' ? !isMobile() : false;
- });
-
- const toggleExpanded = () => {
- setFrontMatterPreferenceForDoc(blockId, !isExpanded());
- layoutShift();
- };
-
- // Track pinned property IDs from Lexical - reactively updates on editor state changes
- const [pinnedPropertyIds, setPinnedPropertyIds] = createSignal<string[]>([]);
-
- // Set up reactive listener for Lexical state changes
- createEffect(() => {
- const currentEditor = mdData.editor; // Use the block store reference
- if (!currentEditor) return;
- // Initial load - read from current editor state
- currentEditor.getEditorState().read(() => {
- const ids = $getPinnedProperties();
- setPinnedPropertyIds(ids);
- });
-
- // Register listener for state updates (including from other users)
- const unregister = currentEditor.registerUpdateListener(
- ({ editorState }) => {
- editorState.read(() => {
- const ids = $getPinnedProperties();
- setPinnedPropertyIds(ids);
- });
- }
- );
- onCleanup(unregister);
- });
-
- // Mock createdBy as a prop for display in tasks.
- const docMetadataQuery = useDocumentMetadataQuery(() => blockId);
- const createdByProperty = createMemo<Property | null>(() => {
- if (entityType !== 'TASK') return null;
- const ownerId = docMetadataQuery.data?.owner;
- if (!ownerId) return null;
- const now = new Date();
- return {
- propertyId: `${blockId}-created-by`,
- propertyDefinitionId: 'ffffffff-ffff-ffff-ffff-ffffffffffff',
- displayName: 'Created By',
- isMultiSelect: false,
- isMetadata: true,
- owner: { scope: 'system' },
- specificEntityType: 'USER',
- createdAt: now,
- updatedAt: now,
- valueType: 'ENTITY',
- value: [{ entity_id: ownerId, entity_type: 'USER' }],
- };
- });
-
- const filteredPinnedProperties = createMemo(() => {
- const allProps = properties();
- const pinnedIds = pinnedPropertyIds();
- const defaultPinnedIds = getDefaultPinnedProperties(blockName);
-
- const pinned = allProps.filter(
- (prop) =>
- !prop.isMetadata &&
- (defaultPinnedIds.includes(prop.propertyDefinitionId) ||
- pinnedIds.includes(prop.propertyId))
- );
-
- const createdBy = createdByProperty();
- return createdBy ? [createdBy, ...pinned] : pinned;
- });
-
- // Track properties added via the selector so we can pin them as soon as
- // the refetched property list includes them.
- const [pendingPinDefIds, setPendingPinDefIds] = createSignal<Set<string>>(
- new Set()
- );
-
- const handlePropertyAdded = async (addedDefinitionIds?: string[]) => {
- if (addedDefinitionIds && addedDefinitionIds.length > 0) {
- setPendingPinDefIds((prev) => {
- const next = new Set(prev);
- for (const id of addedDefinitionIds) next.add(id);
- return next;
- });
- }
- refetch();
- };
-
- const handlePropertyDeleted = async () => {
- refetch();
- };
-
- const handlePropertyPinned = (propertyId: string) => {
- const editor = mdData.editor;
- if (editor) {
- editor.dispatchCommand(ADD_PINNED_PROPERTY_COMMAND, propertyId);
- }
- };
-
- const handlePropertyUnpinned = (propertyId: string) => {
- const editor = mdData.editor;
- if (editor) {
- editor.dispatchCommand(REMOVE_PINNED_PROPERTY_COMMAND, propertyId);
- }
- };
-
- // Once a just-added property shows up in the refetched list, pin it and
- // drop it from the pending set.
- createEffect(() => {
- const pending = pendingPinDefIds();
- if (pending.size === 0) return;
- const current = properties();
- const remaining = new Set(pending);
- for (const defId of pending) {
- const instance = current.find((p) => p.propertyDefinitionId === defId);
- if (instance) {
- handlePropertyPinned(instance.propertyId);
- remaining.delete(defId);
- }
- }
- if (remaining.size !== pending.size) {
- setPendingPinDefIds(remaining);
- }
- });
-
- const [containerRef, setContainerRef] = createSignal<HTMLDivElement>();
- const containerSize = createElementSize(containerRef);
- const height = () => containerSize.height;
- createEffect(on(height, layoutShift));
-
- const saveMutation = useBulkSaveEntityPropertiesMutation();
-
- const saveOne = (property: Property, apiValues: PropertyApiValues) =>
- saveMutation.mutateAsync({
- properties: [{ entityId: blockId, entityType, property, apiValues }],
- });
-
- // Network-based save handler for FrontMatter properties
- const saveHandler: PropertySaveHandler = {
- saveProperty: (property, value) => saveOne(property, value),
- saveDate: (property, date) =>
- saveOne(property, { valueType: 'DATE', value: date }),
- };
-
- return (
- <Show when={!error()} fallback={props.fallback}>
- <Suspense>
- <div class="my-6 " ref={setContainerRef}>
- <PropertiesProvider
- entityType={entityType}
- canEdit={props.canEdit}
- documentName={props.documentName}
- properties={filteredPinnedProperties}
- onRefresh={refetch}
- onPropertyAdded={handlePropertyAdded}
- onPropertyDeleted={handlePropertyDeleted}
- onPropertyPinned={handlePropertyPinned}
- onPropertyUnpinned={handlePropertyUnpinned}
- pinnedPropertyIds={pinnedPropertyIds}
- saveHandler={saveHandler}
- >
- {/* Collapsible header with horizontal line */}
- <div class="flex items-center gap-2 pt-2">
- <div class="w-6 border-t border-edge-muted" />
- <button
- class="flex items-center gap-1 px-2 hover:opacity-70 transition-opacity"
- onClick={toggleExpanded}
- >
- {isExpanded() ? (
- <CaretDown class="size-3" />
- ) : (
- <CaretRight class="size-3" />
- )}
- <span class="text-xs">Properties</span>
- </button>
- <div class="flex-1 border-t border-edge-muted" />
- </div>
-
- {/* Collapsible content */}
- <Show when={isExpanded()}>
- <div class="py-2 text-xs">
- <Show when={isLoading()}>
- <div class="flex items-center justify-center py-8">
- <div class="size-5 animate-spin">
- <LoadingSpinner />
- </div>
- </div>
- </Show>
-
- <Show when={error()}>
- <div class="text-failure-ink text-center py-4">{error()}</div>
- </Show>
-
- <Show when={filteredPinnedProperties().length > 0}>
- <PanelContainer
- properties={filteredPinnedProperties}
- isLoading={isLoading}
- error={error}
- />
- </Show>
-
- <Show when={props.canEdit}>
- <div class="py-2">
- <AddPinnedPropertyButton />
- </div>
- </Show>
- <Modals />
- </div>
- <div class="border-t border-edge-muted pt-2" />
- </Show>
- </PropertiesProvider>
- </div>
- </Suspense>
- </Show>
- );
-}
-
-function AddPinnedPropertyButton() {
- const { openPropertySelector } = usePropertiesContext();
- return (
- <button
- class="flex items-center gap-1 opacity-75 hover:opacity-50 transition-opacity"
- onClick={openPropertySelector}
- >
- <Plus class="size-3 mr-2" />
- <span class="text-ink-muted">Add property</span>
- </button>
- );
-}
diff --git a/js/app/packages/block-md/component/InlinePropertyValue.tsx b/js/app/packages/block-md/component/InlinePropertyValue.tsx
index 9e04e86876..8e20e791ee 100644
--- a/js/app/packages/block-md/component/InlinePropertyValue.tsx
+++ b/js/app/packages/block-md/component/InlinePropertyValue.tsx
@@ -1,8 +1,8 @@
import { useMaybeBlockId } from '@core/block';
-import { usePropertiesContext } from '@core/component/Properties/context/PropertiesContext';
-import { getEntityValues, hasValue } from '@core/component/Properties/utils';
import { Property } from '@property';
+import { usePropertiesContext } from '@property/context/PropertiesContext';
import type { Property as PropertyT } from '@property/types';
+import { getEntityValues, hasValue } from '@property/utils';
import { Layer } from '@ui';
import { cn } from '@ui/utils/classname';
import { type Component, type JSX, Match, Switch } from 'solid-js';
diff --git a/js/app/packages/block-md/component/InlineTaskProperties.tsx b/js/app/packages/block-md/component/InlineTaskProperties.tsx
index 7897ef1dbc..3298ffd57d 100644
--- a/js/app/packages/block-md/component/InlineTaskProperties.tsx
+++ b/js/app/packages/block-md/component/InlineTaskProperties.tsx
@@ -4,19 +4,16 @@ import {
useBlockAliasedName,
useBlockId,
} from '@core/block';
-import { Modals } from '@core/component/Properties/component/modal';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import { useCanEdit } from '@core/signal/permissions';
+import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
+import { Modals } from '@property/component/modal';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import {
PropertiesProvider,
type PropertySaveHandler,
-} from '@core/component/Properties/context/PropertiesContext';
-import { useEntityProperties } from '@core/component/Properties/hooks';
-import type {
- Property,
- PropertyApiValues,
-} from '@core/component/Properties/types';
-import { useCanEdit } from '@core/signal/permissions';
-import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
+} from '@property/context/PropertiesContext';
+import { useEntityProperties } from '@property/hooks';
+import type { Property, PropertyApiValues } from '@property/types';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { createMemo, For, Show, Suspense } from 'solid-js';
diff --git a/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx b/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx
deleted file mode 100644
index 797e8fa018..0000000000
--- a/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-import { SplitDrawer } from '@app/component/split-layout/components/SplitDrawer';
-import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
-import { useBlockAliasedName } from '@core/block';
-import {
- $getPinnedProperties,
- ADD_PINNED_PROPERTY_COMMAND,
- REMOVE_PINNED_PROPERTY_COMMAND,
-} from '@core/component/LexicalMarkdown/plugins';
-import { PropertiesView } from '@core/component/Properties/PropertiesView';
-import { useCanEdit } from '@core/signal/permissions';
-import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
-import TagIcon from '@phosphor/tag.svg';
-import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import { Button } from '@ui';
-import { createEffect, createSignal, Suspense } from 'solid-js';
-import { mdStore } from '../signal/markdownBlockData';
-
-export const DRAWER_ID = 'properties';
-
-export function MarkdownPropertiesButton(props: {
- buttonSize?: 'sm' | 'base';
-}) {
- const drawerControl = useDrawerControl(DRAWER_ID);
- return (
- <Button
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'sm' ? 'icon-sm' : 'icon-md'}
- label="Properties"
- onClick={drawerControl.toggle}
- >
- <TagIcon />
- </Button>
- );
-}
-
-export function MarkdownPropertiesDrawer(props: { documentId: string }) {
- return (
- <SplitDrawer id={DRAWER_ID} side="right" size={550} title="Properties">
- <Suspense fallback={<LoadingFallback />}>
- <MarkdownPropertiesContent documentId={props.documentId} />
- </Suspense>
- </SplitDrawer>
- );
-}
-
-export function MarkdownPropertiesModal(props: {
- documentId: string;
- buttonSize?: 'sm' | 'base';
-}) {
- const drawerControl = useDrawerControl(DRAWER_ID);
-
- return (
- <>
- <Button
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'sm' ? 'icon-sm' : 'icon-md'}
- label="Properties"
- onClick={drawerControl.toggle}
- >
- <TagIcon />
- </Button>
- <SplitDrawer id={DRAWER_ID} side="right" size={550} title="Properties">
- <Suspense fallback={<LoadingFallback />}>
- <MarkdownPropertiesContent documentId={props.documentId} />
- </Suspense>
- </SplitDrawer>
- </>
- );
-}
-
-function MarkdownPropertiesContent(_props: { documentId: string }) {
- const canEdit = useCanEdit();
- const documentName = useBlockDocumentName();
- const mdData = mdStore.get; // Access block store at component level
-
- const blockName = useBlockAliasedName();
- const entityType: EntityType = blockName === 'task' ? 'TASK' : 'DOCUMENT';
-
- // Track pinned property IDs from Lexical - reactively updates on editor state changes
- const [pinnedPropertyIds, setPinnedPropertyIds] = createSignal<string[]>([]);
-
- // Set up reactive listener for Lexical state changes
- createEffect(() => {
- const currentEditor = mdData.editor; // Use the block store reference
- if (!currentEditor) return;
-
- // Initial load - read from current editor state
- currentEditor.getEditorState().read(() => {
- const ids = $getPinnedProperties();
- setPinnedPropertyIds(ids);
- });
-
- // Register listener for state updates (including from other users)
- const unregister = currentEditor.registerUpdateListener(
- ({ editorState }) => {
- editorState.read(() => {
- const ids = $getPinnedProperties();
- setPinnedPropertyIds(ids);
- });
- }
- );
-
- return () => {
- unregister();
- };
- });
-
- const handlePropertyPinned = (propertyId: string) => {
- const editor = mdData.editor;
- if (editor) {
- editor.dispatchCommand(ADD_PINNED_PROPERTY_COMMAND, propertyId);
- }
- };
-
- const handlePropertyUnpinned = (propertyId: string) => {
- const editor = mdData.editor;
- if (editor) {
- editor.dispatchCommand(REMOVE_PINNED_PROPERTY_COMMAND, propertyId);
- }
- };
-
- return (
- <div class="flex flex-col h-full text-sm">
- {/* Future: Add markdown-specific sections here */}
- {/* e.g., word count, reading time, headings outline, etc. */}
-
- <PropertiesView
- blockType="md"
- canEdit={canEdit()}
- entityType={entityType}
- documentName={documentName()}
- onPropertyPinned={handlePropertyPinned}
- onPropertyUnpinned={handlePropertyUnpinned}
- pinnedPropertyIds={pinnedPropertyIds}
- />
- </div>
- );
-}
-
-function LoadingFallback() {
- return (
- <div class="flex justify-center items-center py-8">
- <div class="animate-spin rounded-full size-6 border-b-2 border-ink-muted"></div>
- </div>
- );
-}
diff --git a/js/app/packages/block-md/component/ModalsProvider.tsx b/js/app/packages/block-md/component/ModalsProvider.tsx
index 0157e7130c..467069120f 100644
--- a/js/app/packages/block-md/component/ModalsProvider.tsx
+++ b/js/app/packages/block-md/component/ModalsProvider.tsx
@@ -12,7 +12,6 @@ import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
import { blockNameToItemType } from '@service-storage/client';
import { createSignal, type ParentProps } from 'solid-js';
import { HistoryDrawer } from './History';
-import { MarkdownPropertiesDrawer } from './MarkdownPropertiesModal';
export function ModalsProvider(props: ParentProps) {
const blockId = useBlockId();
@@ -40,7 +39,6 @@ export function ModalsProvider(props: ParentProps) {
/>
<ReferencesDrawer documentId={blockId} documentName={name()} />
<HistoryDrawer documentId={blockId} />
- <MarkdownPropertiesDrawer documentId={blockId} />
<DetailsDrawer documentId={blockId} />
<ShareBlockModal />
</ShareDialogContext.Provider>
diff --git a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
index ce2ec59a00..472cecaa8d 100644
--- a/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
+++ b/js/app/packages/block-md/component/sidepanel/MarkdownSidePanelSections.tsx
@@ -10,23 +10,6 @@ import {
REMOVE_PINNED_PROPERTY_COMMAND,
} from '@core/component/LexicalMarkdown/plugins';
import { Notifications } from '@core/component/Notifications';
-import { Modals } from '@core/component/Properties/component/modal';
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
-import {
- getDefaultPinnedProperties,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
- usePropertiesContext,
-} from '@core/component/Properties/context/PropertiesContext';
-import { useEntityProperties } from '@core/component/Properties/hooks';
-import type {
- Property,
- PropertyApiValues,
-} from '@core/component/Properties/types';
-import { hasValue } from '@core/component/Properties/utils';
import { References } from '@core/component/References';
import { UserIcon } from '@core/component/UserIcon';
import type { Entity, EntityType } from '@core/types';
@@ -39,6 +22,20 @@ import ClockIcon from '@phosphor/clock.svg';
import Plus from '@phosphor/plus.svg';
import LoadingSpinner from '@phosphor/spinner.svg';
import { Property as PropertyNS } from '@property';
+import { Modals } from '@property/component/modal';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
+import {
+ getDefaultPinnedProperties,
+ SYSTEM_PROPERTY_IDS,
+} from '@property/constants';
+import {
+ PropertiesProvider,
+ type PropertySaveHandler,
+ usePropertiesContext,
+} from '@property/context/PropertiesContext';
+import { useEntityProperties } from '@property/hooks';
+import type { Property, PropertyApiValues } from '@property/types';
+import { hasValue } from '@property/utils';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
import { useDocumentMetadataQuery } from '@queries/storage/document-metadata';
import { commsServiceClient } from '@service-comms/client';
@@ -414,7 +411,7 @@ function AddPinnedPropertyButton() {
<button
onClick={openPropertySelector}
class={cn(
- 'inline-flex items-center gap-1.5 ring ring-edge-muted bg-surface',
+ 'inline-flex items-center gap-1.5 m-px ring ring-edge-muted bg-surface',
'px-2 py-1 leading-tight rounded-full text-ink-muted',
'hover:bg-hover hover:text-ink transition-colors'
)}
diff --git a/js/app/packages/block-md/util/taskComposerStorage.ts b/js/app/packages/block-md/util/taskComposerStorage.ts
index c09f791648..2aeb2c34c5 100644
--- a/js/app/packages/block-md/util/taskComposerStorage.ts
+++ b/js/app/packages/block-md/util/taskComposerStorage.ts
@@ -1,4 +1,4 @@
-import type { PropertyApiValues } from '@core/component/Properties/types';
+import type { PropertyApiValues } from '@property/types';
import type { SerializedEditorState } from 'lexical';
const STORAGE_KEY = 'task-composer-draft';
diff --git a/js/app/packages/block-pdf/component/ModalsProvider.tsx b/js/app/packages/block-pdf/component/ModalsProvider.tsx
index a734b357ec..600b59a1dc 100644
--- a/js/app/packages/block-pdf/component/ModalsProvider.tsx
+++ b/js/app/packages/block-pdf/component/ModalsProvider.tsx
@@ -1,6 +1,5 @@
import { useBlockId } from '@core/block';
import { DetailsDrawer } from '@core/component/DetailsDrawer';
-import { DocumentPropertiesDrawer } from '@core/component/DocumentPropertiesModal';
import { ReferencesDrawer } from '@core/component/ReferencesModal';
import {
ShareBlockModal,
@@ -23,7 +22,6 @@ export function ModalsProvider(props: ParentProps) {
>
{props.children}
<ReferencesDrawer documentId={documentId} documentName={fileName()} />
- <DocumentPropertiesDrawer blockType="pdf" />
<DetailsDrawer documentId={documentId} />
<ShareBlockModal name={fileName()} />
</ShareDialogContext.Provider>
diff --git a/js/app/packages/block-pdf/component/TopBar.tsx b/js/app/packages/block-pdf/component/TopBar.tsx
index d0d088c9f7..0b0da90adc 100644
--- a/js/app/packages/block-pdf/component/TopBar.tsx
+++ b/js/app/packages/block-pdf/component/TopBar.tsx
@@ -1,4 +1,3 @@
-import { useAnalytics } from '@app/component/analytics-context';
import {
ChatWithAgentButton,
ChatWithAgentIcon,
@@ -24,10 +23,6 @@ import { exportPdf } from '@block-pdf/websocket/export';
import { useIsAuthenticated } from '@core/auth';
import { useBlockId, useBlockName } from '@core/block';
import { DETAILS_DRAWER_ID } from '@core/component/DetailsDrawer';
-import {
- DocumentPropertiesButton,
- PROPERTIES_DRAWER_ID,
-} from '@core/component/DocumentPropertiesModal';
import { BlockLiveIndicators } from '@core/component/LiveIndicators';
import {
REFERENCES_DRAWER_ID,
@@ -52,7 +47,6 @@ import DownloadIcon from '@phosphor/download-simple.svg';
import Info from '@phosphor/info.svg';
import Printer from '@phosphor/printer.svg';
import Quotes from '@phosphor/quotes.svg';
-import TagIcon from '@phosphor/tag.svg';
import {
blockNameToItemType,
storageServiceClient,
@@ -67,7 +61,6 @@ import { MarkupToolbar } from './MarkupToolbar';
import { PageNumberInput } from './PageNumberInput';
export function TopBar() {
- const analytics = useAnalytics();
const isAuth = useIsAuthenticated();
const documentId = useBlockId();
const blockName = useBlockName();
@@ -76,7 +69,6 @@ export function TopBar() {
const fileName = useBlockDocumentName('Unknown Filename');
const referencesControl = useDrawerControl(REFERENCES_DRAWER_ID);
- const propertiesControl = useDrawerControl(PROPERTIES_DRAWER_ID);
const detailsControl = useDrawerControl(DETAILS_DRAWER_ID);
const shareCtx = useShareDialogContext();
@@ -216,20 +208,6 @@ export function TopBar() {
/>
),
},
- {
- label: 'Properties',
- icon: TagIcon,
- action: propertiesControl.toggle,
- buttonComponent: () => (
- <DocumentPropertiesButton
- buttonSize="sm"
- onOpenChange={(open) =>
- open &&
- analytics.track('properties_panel_open', { blockType: 'pdf' })
- }
- />
- ),
- },
{
label: 'Chat',
icon: ChatWithAgentIcon,
diff --git a/js/app/packages/block-project/component/ModalsProvider.tsx b/js/app/packages/block-project/component/ModalsProvider.tsx
index d08ffade2b..f6fff30f71 100644
--- a/js/app/packages/block-project/component/ModalsProvider.tsx
+++ b/js/app/packages/block-project/component/ModalsProvider.tsx
@@ -8,7 +8,6 @@ import {
import { ENABLE_PROJECT_SHARING } from '@core/constant/featureFlags';
import { createSignal, type ParentProps, Show } from 'solid-js';
import { projectBlockDataSignal } from '../signal/projectBlockData';
-import { ProjectPropertiesDrawer } from './ProjectPropertiesModal';
export function ModalsProvider(props: ParentProps) {
const id = useBlockId();
@@ -25,7 +24,6 @@ export function ModalsProvider(props: ParentProps) {
}}
>
{props.children}
- <ProjectPropertiesDrawer name={name()} />
<DetailsDrawer projectId={id} />
<Show when={ENABLE_PROJECT_SHARING && !isSpecialProject}>
<ShareBlockModal name={name()} owner={owner()} />
diff --git a/js/app/packages/block-project/component/ProjectCreateMenu.tsx b/js/app/packages/block-project/component/ProjectCreateMenu.tsx
index 142ed387d1..da21f23e0b 100644
--- a/js/app/packages/block-project/component/ProjectCreateMenu.tsx
+++ b/js/app/packages/block-project/component/ProjectCreateMenu.tsx
@@ -2,10 +2,6 @@ import type { BlockTool } from '@app/component/ResponsiveBlockToolbar';
import { useSplitLayout } from '@app/component/split-layout/layout';
import type { BlockAlias, BlockName } from '@core/block';
import { EntityIcon } from '@core/component/EntityIcon';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
import { toast } from '@core/component/Toast/Toast';
import { pressedKeys } from '@core/hotkey/state';
import { type HotkeyToken, TOKENS } from '@core/hotkey/tokens';
@@ -18,6 +14,7 @@ import {
import CaretDown from '@phosphor/caret-down.svg';
import PlusIcon from '@phosphor/plus.svg';
import CirclePlus from '@phosphor/plus-circle.svg';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import { createProject } from '@queries/storage/projects';
import { Dialog, Dropdown, Surface } from '@ui';
import { type Component, createSignal, For } from 'solid-js';
diff --git a/js/app/packages/block-project/component/ProjectPropertiesModal.tsx b/js/app/packages/block-project/component/ProjectPropertiesModal.tsx
deleted file mode 100644
index 41dda1654b..0000000000
--- a/js/app/packages/block-project/component/ProjectPropertiesModal.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { SplitDrawer } from '@app/component/split-layout/components/SplitDrawer';
-import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
-import { PropertiesView } from '@core/component/Properties/PropertiesView';
-import { useCanEdit } from '@core/signal/permissions';
-import TagIcon from '@phosphor/tag.svg';
-import { EntityType } from '@service-properties/generated/schemas/entityType';
-import { Button } from '@ui';
-import { Suspense } from 'solid-js';
-
-export const PROPERTIES_DRAWER_ID = 'properties';
-const DRAWER_ID = PROPERTIES_DRAWER_ID;
-
-export function ProjectPropertiesButton(props: { buttonSize?: 'sm' | 'base' }) {
- const drawerControl = useDrawerControl(DRAWER_ID);
- return (
- <Button
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'sm' ? 'icon-sm' : 'icon-md'}
- label="Properties"
- onClick={drawerControl.toggle}
- >
- <TagIcon />
- </Button>
- );
-}
-
-export function ProjectPropertiesDrawer(props: { name?: string }) {
- const canEdit = useCanEdit();
- return (
- <SplitDrawer id={DRAWER_ID} side="right" size={550} title="Properties">
- <Suspense fallback={<LoadingFallback />}>
- <ProjectPropertiesContent canEdit={canEdit()} name={props.name} />
- </Suspense>
- </SplitDrawer>
- );
-}
-
-function ProjectPropertiesContent(props: { canEdit: boolean; name?: string }) {
- return (
- <PropertiesView
- blockType={'project'}
- canEdit={props.canEdit}
- entityType={EntityType.PROJECT}
- documentName={props.name}
- />
- );
-}
-
-function LoadingFallback() {
- return (
- <div class="flex justify-center items-center py-8">
- <div class="animate-spin rounded-full size-6 border-b-2 border-ink-muted"></div>
- </div>
- );
-}
diff --git a/js/app/packages/block-project/component/TopBar.tsx b/js/app/packages/block-project/component/TopBar.tsx
index 316c2b5338..91b757b8a8 100644
--- a/js/app/packages/block-project/component/TopBar.tsx
+++ b/js/app/packages/block-project/component/TopBar.tsx
@@ -41,14 +41,9 @@ import { useCanEdit, useIsDocumentOwner } from '@core/signal/permissions';
import { buildSimpleEntityUrl } from '@core/util/url';
import IconShared from '@icon/wide-share.svg';
import Info from '@phosphor/info.svg';
-import TagIcon from '@phosphor/tag.svg';
import { toast } from 'core/component/Toast/Toast';
import { createMemo, For, Show } from 'solid-js';
import { ProjectCreateMenu, useProjectCreateTools } from './ProjectCreateMenu';
-import {
- PROPERTIES_DRAWER_ID,
- ProjectPropertiesButton,
-} from './ProjectPropertiesModal';
// TODO (SEAMUS) : Revisit this file when we figure out what we wanna do
// with folder block.
@@ -64,7 +59,6 @@ export function TopBar() {
() => projectBlockDataSignal()?.projectMetadata.name ?? ''
);
- const propertiesControl = useDrawerControl(PROPERTIES_DRAWER_ID);
const detailsControl = useDrawerControl(DETAILS_DRAWER_ID);
const shareCtx = useShareDialogContext();
@@ -109,13 +103,6 @@ export function TopBar() {
);
const tools: BlockTool[] = [
- {
- label: 'Properties',
- icon: TagIcon,
- action: propertiesControl.toggle,
- condition: () => !isSpecialProject,
- buttonComponent: () => <ProjectPropertiesButton buttonSize="sm" />,
- },
{
label: 'Chat',
icon: ChatWithAgentIcon,
diff --git a/js/app/packages/core/component/DocumentPreview.tsx b/js/app/packages/core/component/DocumentPreview.tsx
index ea213c0756..2eae999cea 100644
--- a/js/app/packages/core/component/DocumentPreview.tsx
+++ b/js/app/packages/core/component/DocumentPreview.tsx
@@ -13,9 +13,6 @@ import { EntityIcon } from '@core/component/EntityIcon';
import { isBlockNameWithLocation } from '@core/component/LexicalMarkdown/component/core/BlockLink';
import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { channelTheme } from '@core/component/LexicalMarkdown/theme';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
-import { useEntityProperties } from '@core/component/Properties/hooks';
-import { getEntityValues, hasValue } from '@core/component/Properties/utils';
import { toast } from '@core/component/Toast/Toast';
import { UserIcon as UserIconComponent } from '@core/component/UserIcon';
import { itemToBlockName, resolveBlockAlias } from '@core/constant/allBlocks';
@@ -38,6 +35,9 @@ import SparkleIcon from '@phosphor/sparkle.svg';
import LoadingSpinner from '@phosphor/spinner.svg';
import TrashSimple from '@phosphor/trash-simple.svg';
import { Property } from '@property';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
+import { useEntityProperties } from '@property/hooks';
+import { getEntityValues, hasValue } from '@property/utils';
import {
isAccessiblePreviewItem,
isChannelPreviewItem,
@@ -410,7 +410,7 @@ export function TaskPropertiesPreview(props: { taskId: string }) {
* Visually matches the side-panel Properties pills.
*/
function PreviewPropertyPill(props: {
- property: import('@core/component/Properties/types').Property;
+ property: import('@property/types').Property;
}) {
const isMultiUser = () =>
props.property.valueType === 'ENTITY' &&
diff --git a/js/app/packages/core/component/DocumentPropertiesModal.tsx b/js/app/packages/core/component/DocumentPropertiesModal.tsx
deleted file mode 100644
index 9113f6ee04..0000000000
--- a/js/app/packages/core/component/DocumentPropertiesModal.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { SplitDrawer } from '@app/component/split-layout/components/SplitDrawer';
-import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
-import type { BlockName } from '@core/block';
-import { PropertiesView } from '@core/component/Properties/PropertiesView';
-
-import { useCanEdit } from '@core/signal/permissions';
-import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
-import TagIcon from '@phosphor/tag.svg';
-import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import { Button } from '@ui';
-import { Suspense } from 'solid-js';
-
-export const PROPERTIES_DRAWER_ID = 'properties';
-const DRAWER_ID = PROPERTIES_DRAWER_ID;
-
-function DocumentPropertiesContent(props: {
- blockType: BlockName;
- canEdit: boolean;
-}) {
- const documentName = useBlockDocumentName();
-
- return (
- <PropertiesView
- blockType={props.blockType}
- canEdit={props.canEdit}
- entityType={'DOCUMENT' as EntityType}
- documentName={documentName()}
- />
- );
-}
-
-export function DocumentPropertiesButton(props: {
- buttonSize?: 'sm' | 'base';
- onOpenChange?: (open: boolean) => void;
-}) {
- const drawerControl = useDrawerControl(DRAWER_ID);
- return (
- <Button
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'sm' ? 'icon-sm' : 'icon-md'}
- label="Properties"
- onClick={() => {
- props.onOpenChange?.(!drawerControl.isOpen());
- drawerControl.toggle();
- }}
- >
- <TagIcon />
- </Button>
- );
-}
-
-export function DocumentPropertiesDrawer(props: { blockType: BlockName }) {
- const canEdit = useCanEdit();
- return (
- <SplitDrawer id={DRAWER_ID} side="right" size={550} title="Properties">
- <Suspense fallback={<LoadingFallback />}>
- <DocumentPropertiesContent
- blockType={props.blockType}
- canEdit={canEdit()}
- />
- </Suspense>
- </SplitDrawer>
- );
-}
-
-function LoadingFallback() {
- return (
- <div class="flex justify-center items-center py-8">
- <div class="animate-spin rounded-full size-6 border-b-2 border-ink-muted"></div>
- </div>
- );
-}
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx b/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
index 4bb4c2ac70..b1c35c6c76 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
@@ -13,9 +13,6 @@ import {
import { EntityIcon } from '@core/component/EntityIcon';
import { HoverCard } from '@core/component/HoverCard';
import { useItemPreviewData } from '@core/component/ItemPreview';
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
-import { useEntityProperties } from '@core/component/Properties/hooks';
import { UserIcon } from '@core/component/UserIcon';
import {
itemToBlockName,
@@ -36,6 +33,9 @@ import {
} from '@lexical-core';
import EyeSlashDuo from '@phosphor/eye-slash.svg';
import TrashSimple from '@phosphor/trash-simple.svg';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
+import { useEntityProperties } from '@property/hooks';
import {
type ItemEntity,
isAccessiblePreviewItem,
diff --git a/js/app/packages/core/component/Properties/PropertiesView.tsx b/js/app/packages/core/component/Properties/PropertiesView.tsx
deleted file mode 100644
index 9a5342a0ab..0000000000
--- a/js/app/packages/core/component/Properties/PropertiesView.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import { useBlockId } from '@core/block';
-import LoadingSpinner from '@phosphor/spinner.svg';
-import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
-import { type Accessor, Show } from 'solid-js';
-import { Modals } from './component/modal/Modals';
-import { AddPropertyButton } from './component/panel/AddPropertyButton';
-import { PanelContainer } from './component/panel/PanelContainer';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
- usePropertiesContext,
-} from './context/PropertiesContext';
-import { useEntityProperties } from './hooks';
-import type {
- PropertiesPanelProps,
- Property,
- PropertyApiValues,
-} from './types';
-
-const CONTAINER_CLASSES = 'h-full overflow-hidden relative flex flex-col';
-const LOADING_CONTAINER_CLASSES = 'flex items-center justify-center py-8';
-const SPINNER_CLASSES = 'w-5 h-5 animate-spin';
-
-export function PropertiesView(props: PropertiesPanelProps) {
- const blockId = useBlockId();
-
- const { properties, isLoading, error, refetch } = useEntityProperties(
- blockId,
- props.entityType,
- false
- );
-
- const saveMutation = useBulkSaveEntityPropertiesMutation();
-
- const handleRefresh = () => {
- refetch();
- props.onRefresh?.();
- };
-
- const handlePropertyAdded = async () => {
- // This is called by context when properties are added via PropertySelector
- // The PropertySelector already handles UI feedback via apiUtils
- handleRefresh();
- };
-
- const handlePropertyDeleted = async () => {
- // This is called by context when properties are deleted
- // The deletion already handles UI feedback via apiUtils
- handleRefresh();
- };
-
- const saveOne = (property: Property, apiValues: PropertyApiValues) =>
- saveMutation.mutateAsync({
- properties: [
- {
- entityId: blockId,
- entityType: props.entityType,
- property,
- apiValues,
- },
- ],
- });
-
- const saveHandler: PropertySaveHandler = {
- saveProperty: (property, value) => saveOne(property, value),
- saveDate: (property, date) =>
- saveOne(property, { valueType: 'DATE', value: date }),
- };
-
- return (
- <PropertiesProvider
- entityType={props.entityType}
- canEdit={props.canEdit}
- documentName={props.documentName}
- properties={properties}
- onRefresh={handleRefresh}
- onPropertyAdded={handlePropertyAdded}
- onPropertyDeleted={handlePropertyDeleted}
- onPropertyPinned={props.onPropertyPinned}
- onPropertyUnpinned={props.onPropertyUnpinned}
- pinnedPropertyIds={props.pinnedPropertyIds}
- saveHandler={saveHandler}
- >
- <PropertiesViewContent
- properties={properties}
- isLoading={isLoading}
- error={error}
- canEdit={props.canEdit}
- />
- </PropertiesProvider>
- );
-}
-
-// Separated to allow context access while keeping PropertiesView clean
-function PropertiesViewContent(props: {
- properties: Accessor<Property[]>;
- isLoading: Accessor<boolean>;
- error: Accessor<string | null>;
- canEdit: boolean;
-}) {
- const { openPropertySelector } = usePropertiesContext();
-
- return (
- <div class={CONTAINER_CLASSES}>
- <Show when={props.isLoading()}>
- <div class={LOADING_CONTAINER_CLASSES}>
- <div class={SPINNER_CLASSES}>
- <LoadingSpinner />
- </div>
- </div>
- </Show>
-
- <Show when={props.error()}>
- <div class="text-failure-ink text-center py-4">{props.error()}</div>
- </Show>
-
- <PanelContainer
- properties={props.properties}
- isLoading={props.isLoading}
- error={props.error}
- />
-
- <Show when={props.canEdit}>
- <div class="shrink-0 p-4">
- <AddPropertyButton onClick={openPropertySelector} />
- </div>
- </Show>
-
- <Modals />
- </div>
- );
-}
diff --git a/js/app/packages/core/component/Properties/component/panel/AddPropertyButton.tsx b/js/app/packages/core/component/Properties/component/panel/AddPropertyButton.tsx
deleted file mode 100644
index 8ce15f95d5..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/AddPropertyButton.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Button } from '@ui';
-import type { Component } from 'solid-js';
-
-interface AddPropertyButtonProps {
- onClick: () => void;
-}
-
-export const AddPropertyButton: Component<AddPropertyButtonProps> = (props) => {
- return (
- <Button variant="base" class="w-full" onClick={props.onClick}>
- + Add Property
- </Button>
- );
-};
diff --git a/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx b/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx
deleted file mode 100644
index 9ae942cd02..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { Accessor, Component } from 'solid-js';
-import { createMemo, Show } from 'solid-js';
-import type { Property } from '../../types';
-import { PropertyGrid } from './PropertyGrid';
-
-interface PropertiesContentProps {
- properties: Accessor<Property[]>;
- isLoading: Accessor<boolean>;
- error: Accessor<string | null>;
- emptyMessage?: string;
-}
-
-export const PanelContainer: Component<PropertiesContentProps> = (props) => {
- const hasProperties = createMemo(() => props.properties().length > 0);
- const showContent = createMemo(
- () => hasProperties() || (!props.isLoading() && !props.error())
- );
-
- return (
- <Show when={showContent()}>
- <Show when={!hasProperties()}>
- <div class="text-center py-8 text-ink-muted">
- <p>{props.emptyMessage ?? 'No properties added yet'}</p>
- </div>
- </Show>
-
- <Show when={hasProperties()}>
- <div class="flex-1 overflow-auto pb-2">
- <PropertyGrid properties={props.properties()} />
- </div>
- </Show>
- </Show>
- );
-};
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx
deleted file mode 100644
index 4539f1ee70..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import { useMaybeBlockAliasedName } from '@core/block';
-import { type Component, createMemo, For, Show } from 'solid-js';
-import { getBuiltinPropertyIds } from '../../constants';
-import type { Property } from '../../types';
-import { PropertyRow } from './PropertyRow';
-
-interface PropertiesListProps {
- properties: Property[];
- columns?: number;
- withDelete?: boolean;
- withPin?: boolean;
-}
-
-export const PropertyGrid: Component<PropertiesListProps> = (props) => {
- const blockName = useMaybeBlockAliasedName();
- const builtinPropertyIds = blockName ? getBuiltinPropertyIds(blockName) : [];
-
- // Single pass through properties array to split into metadata, builtin, and user properties
- const propertyGroups = createMemo(() => {
- const metadata: Property[] = [];
- const builtinProperties: Property[] = [];
- const userProperties: Property[] = [];
-
- for (const prop of props.properties) {
- if (prop.isMetadata) {
- // Hide "Project" property if value is null
- if (prop.value != null || !['Project'].includes(prop.displayName)) {
- metadata.push(prop);
- }
- } else if (builtinPropertyIds.includes(prop.propertyDefinitionId)) {
- builtinProperties.push(prop);
- } else {
- userProperties.push(prop);
- }
- }
-
- // Sort builtin properties by the order defined in constants
- builtinProperties.sort((a, b) => {
- const indexA = builtinPropertyIds.indexOf(a.propertyDefinitionId);
- const indexB = builtinPropertyIds.indexOf(b.propertyDefinitionId);
- return indexA - indexB;
- });
-
- return { metadata, builtinProperties, userProperties };
- });
-
- const showSeparatorAboveUser = createMemo(
- () =>
- (propertyGroups().metadata.length > 0 ||
- propertyGroups().builtinProperties.length > 0) &&
- propertyGroups().userProperties.length > 0
- );
-
- return (
- <Show
- when={props.properties.length > 0}
- fallback={
- <div class="text-center">
- <div class="text-ink-muted">No properties found</div>
- </div>
- }
- >
- <div
- class="grid gap-x-2 gap-y-2 pt-2 min-w-fit"
- style={{
- 'grid-template-columns': `repeat(${props.columns ?? 1}, auto minmax(8rem, 1fr))`,
- }}
- >
- {/* Metadata properties */}
- <Show when={propertyGroups().metadata.length > 0}>
- <For each={propertyGroups().metadata}>
- {(property) => <PropertyRow property={property} withPin />}
- </For>
- </Show>
-
- {/* Builtin properties (block-specific, non-removable) */}
- <Show when={propertyGroups().builtinProperties.length > 0}>
- <For each={propertyGroups().builtinProperties}>
- {(property) => <PropertyRow property={property} withPin />}
- </For>
- </Show>
-
- {/* User properties */}
- <Show when={propertyGroups().userProperties.length > 0}>
- {/* Separator between above user */}
- <Show when={showSeparatorAboveUser()}>
- <div class="col-span-2 border-t border-edge-muted my-4" />
- </Show>
-
- <For each={propertyGroups().userProperties}>
- {(property) => (
- <PropertyRow
- property={property}
- withDelete={props.withDelete}
- withPin={props.withPin}
- />
- )}
- </For>
- </Show>
- </div>
- </Show>
- );
-};
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
deleted file mode 100644
index 4087ea2c5a..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
+++ /dev/null
@@ -1,202 +0,0 @@
-import { useMaybeBlockAliasedName, useMaybeBlockId } from '@core/block';
-import PinIcon from '@phosphor/push-pin.svg';
-import UnpinIcon from '@phosphor/push-pin-slash.svg';
-import DeleteIcon from '@phosphor/x.svg';
-import XIcon from '@phosphor/x.svg';
-import { useDeleteEntityPropertyMutation } from '@queries/properties/entity';
-import { Button, cn, Dialog, Surface } from '@ui';
-import { type Component, createMemo, createSignal, Show } from 'solid-js';
-import {
- getBuiltinPropertyIds,
- getDefaultPinnedProperties,
-} from '../../constants';
-import { usePropertiesContext } from '../../context/PropertiesContext';
-import type { Property } from '../../types';
-import { PropertyDataTypeIcon } from '../../utils';
-
-type PropertyLabelProps = {
- property: Property;
- withPin?: boolean;
- withDelete?: boolean;
-};
-
-export const PropertyLabel: Component<PropertyLabelProps> = (props) => {
- const {
- canEdit,
- documentName,
- entityType,
- onPropertyDeleted,
- onPropertyPinned,
- onPropertyUnpinned,
- pinnedPropertyIds,
- } = usePropertiesContext();
- const maybeBlockId = useMaybeBlockId();
- const blockName = useMaybeBlockAliasedName();
- const isBuiltin =
- blockName &&
- getBuiltinPropertyIds(blockName).includes(
- props.property.propertyDefinitionId
- );
- const isDefaultPinned =
- blockName &&
- getDefaultPinnedProperties(blockName).includes(
- props.property.propertyDefinitionId
- );
-
- const deleteMutation = useDeleteEntityPropertyMutation();
-
- const isPinned = createMemo(
- () => pinnedPropertyIds?.()?.includes(props.property.propertyId) ?? false
- );
- const [isHovered, setIsHovered] = createSignal(false);
- const [deleteConfirmVisible, setDeleteConfirmVisible] = createSignal(false);
-
- const handlePinClick = () => {
- if (isPinned()) {
- onPropertyUnpinned?.(props.property.propertyId);
- } else {
- onPropertyPinned?.(props.property.propertyId);
- }
- };
-
- const handleDeleteClick = () => {
- setDeleteConfirmVisible(true);
- };
-
- const handleDeleteConfirm = async () => {
- if (!maybeBlockId) return;
- try {
- await deleteMutation.mutateAsync({
- entityPropertyId: props.property.propertyId,
- entityType,
- entityId: maybeBlockId,
- });
- setDeleteConfirmVisible(false);
- onPropertyDeleted();
- } catch {
- // Error toast is shown by the mutation's onError callback
- }
- };
-
- const handleDeleteCancel = () => {
- setDeleteConfirmVisible(false);
- };
-
- return (
- <>
- <div
- class="flex items-center gap-1.5 min-w-0 py-0.5"
- onMouseEnter={() => setIsHovered(true)}
- onMouseLeave={() => setIsHovered(false)}
- >
- <PropertyDataTypeIcon
- property={props.property}
- class="size-4 shrink-0 opacity-40"
- />
- <span class="truncate shrink min-w-0">
- {props.property.displayName}
- </span>
- {/* Always reserve space for delete button to prevent layout shift */}
- <Show
- when={canEdit && !props.property.isMetadata}
- fallback={<div class="size-3 shrink-0" />}
- >
- <Show
- when={
- onPropertyPinned &&
- onPropertyUnpinned &&
- !isDefaultPinned &&
- props.withPin
- }
- >
- <div
- class={cn(
- 'shrink-0 transition-opacity',
- isHovered() ? 'opacity-100' : 'opacity-0'
- )}
- >
- <Button
- variant="ghost"
- class="p-1"
- tooltip={isPinned() ? 'Unpin property' : 'Pin property'}
- onClick={handlePinClick}
- >
- {isPinned() ? (
- <UnpinIcon class="size-3" />
- ) : (
- <PinIcon class="size-3" />
- )}
- </Button>
- </div>
- </Show>
-
- <Show when={!isBuiltin && props.withDelete}>
- <div
- class={cn(
- 'shrink-0 transition-opacity',
- isHovered() ? 'opacity-100' : 'opacity-0'
- )}
- >
- <Button
- variant="ghost"
- class="p-1 text-failure! hover:bg-failure/15!"
- tooltip="Remove property"
- onClick={handleDeleteClick}
- >
- <DeleteIcon class="size-3" />
- </Button>
- </div>
- </Show>
- </Show>
- </div>
-
- <Dialog
- open={deleteConfirmVisible()}
- onOpenChange={setDeleteConfirmVisible}
- >
- <Surface depth={2} active class="rounded-xl">
- <div class="*:max-h-[75vh]">
- <div class="flex flex-col overflow-hidden text-sm">
- <div class="flex items-center justify-between gap-2 bg-surface px-2 h-10 border-b border-edge-muted shrink-0">
- <Dialog.Title class="pl-2 text-sm font-medium">
- Delete Property
- </Dialog.Title>
- <Button
- variant="ghost"
- size="icon-sm"
- onClick={handleDeleteCancel}
- disabled={deleteMutation.isPending}
- >
- <XIcon />
- </Button>
- </div>
- <div class="p-4">
- <Dialog.Description class="text-sm text-ink-muted">
- Are you sure you want to remove property "
- {props.property.displayName}"
- {documentName ? ` from "${documentName}"` : ''}?
- </Dialog.Description>
- </div>
- <div class="flex items-center justify-end gap-2 px-2 py-1.5 border-t border-edge-muted shrink-0">
- <Button
- variant="ghost"
- onClick={handleDeleteCancel}
- disabled={deleteMutation.isPending}
- >
- Cancel
- </Button>
- <Button
- variant="danger"
- onClick={handleDeleteConfirm}
- disabled={deleteMutation.isPending}
- >
- {deleteMutation.isPending ? 'Deleting...' : 'Delete'}
- </Button>
- </div>
- </div>
- </div>
- </Surface>
- </Dialog>
- </>
- );
-};
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyRow.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyRow.tsx
deleted file mode 100644
index e4cd0b495b..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/PropertyRow.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { useMaybeBlockId } from '@core/block';
-import { Property } from '@property';
-import type { Component } from 'solid-js';
-import { usePropertiesContext } from '../../context/PropertiesContext';
-import type { Property as PropertyT } from '../../types';
-import { PropertyLabel } from './PropertyLabel';
-
-interface PropertyRowProps {
- property: PropertyT;
- withDelete?: boolean;
- withPin?: boolean;
-}
-
-/**
- * Panel row: label + value. Value uses Property.Display, which composes
- * display + inline/popover editing entirely from primitives — the legacy
- * PropertiesContext modal stack is bypassed here. Saves still route through
- * the panel's saveHandler (bulk-save mutation).
- */
-export const PropertyRow: Component<PropertyRowProps> = (props) => {
- const { saveHandler, entityType, onRefresh } = usePropertiesContext();
- const blockId = useMaybeBlockId();
-
- return (
- <>
- <div class="flex items-start min-w-0">
- <PropertyLabel
- property={props.property}
- withDelete={props.withDelete}
- withPin={props.withPin}
- />
- </div>
- <div class="ph-no-capture flex items-start min-w-0">
- <Property.Root
- property={props.property}
- canEdit
- onSave={(p, v) => saveHandler.saveProperty(p, v)}
- onRefresh={onRefresh}
- >
- <Property.Display entitySelfFilter={{ entityType, blockId }} />
- </Property.Root>
- </div>
- </>
- );
-};
diff --git a/js/app/packages/core/component/Properties/component/panel/index.ts b/js/app/packages/core/component/Properties/component/panel/index.ts
deleted file mode 100644
index 9993f693e3..0000000000
--- a/js/app/packages/core/component/Properties/component/panel/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { PanelContainer } from './PanelContainer';
-export { PropertyGrid } from './PropertyGrid';
diff --git a/js/app/packages/core/component/Properties/constants.ts b/js/app/packages/core/component/Properties/constants.ts
deleted file mode 100644
index 8c4d8c2721..0000000000
--- a/js/app/packages/core/component/Properties/constants.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Business logic constants for Properties components
- * For styling constants, see styles/styles.ts (PROPERTY_STYLES)
- */
-
-import type { BlockAlias, BlockName } from '@core/block';
-
-export const NUMBER_DECIMAL_PLACES = 4; // Matches backend precision
-
-/**
- * System property definition IDs (from backend seed migration).
- * These are stable UUIDs that match the database.
- */
-export const SYSTEM_PROPERTY_IDS = {
- // Task properties
- ASSIGNEES: '00000001-0000-0000-0000-000000000001',
- STATUS: '00000001-0000-0000-0000-000000000002',
- PRIORITY: '00000001-0000-0000-0000-000000000003',
- DUE_DATE: '00000001-0000-0000-0000-000000000004',
- PARENT_TASK: '00000001-0000-0000-0000-000000000005',
- SUBTASKS: '00000001-0000-0000-0000-000000000006',
- DEPENDS_ON: '00000001-0000-0000-0000-000000000007',
- EFFORT: '00000001-0000-0000-0000-000000000008',
- STORY_POINTS: '00000001-0000-0000-0000-000000000009',
- RELEVANT_DOCUMENTS: '00000001-0000-0000-0000-00000000000a',
- // Email attachment properties
- SOURCE: '00000001-0000-0000-0000-00000000000b',
- COMPANIES: '00000001-0000-0000-0000-00000000000c',
- SENDER: '00000001-0000-0000-0000-00000000000d',
- RECIPIENTS: '00000001-0000-0000-0000-00000000000e',
- SUBJECT: '00000001-0000-0000-0000-00000000000f',
-} as const;
-
-/**
- * Builtin property definition IDs by block type.
- * These properties are automatically attached to entities of this block type
- * and cannot be removed. Order matches backend (display order).
- */
-const BUILTIN_PROPERTIES_BY_BLOCK: Partial<
- Record<BlockName | BlockAlias, readonly string[]>
-> = {
- task: [
- SYSTEM_PROPERTY_IDS.ASSIGNEES,
- SYSTEM_PROPERTY_IDS.STATUS,
- SYSTEM_PROPERTY_IDS.PRIORITY,
- SYSTEM_PROPERTY_IDS.DUE_DATE,
- SYSTEM_PROPERTY_IDS.PARENT_TASK,
- SYSTEM_PROPERTY_IDS.SUBTASKS,
- SYSTEM_PROPERTY_IDS.DEPENDS_ON,
- SYSTEM_PROPERTY_IDS.EFFORT,
- SYSTEM_PROPERTY_IDS.STORY_POINTS,
- SYSTEM_PROPERTY_IDS.RELEVANT_DOCUMENTS,
- ],
-} as const;
-
-/**
- * Default pinned properties by block type.
- * These are automatically pinned when a new entity of this block type is created.
- */
-const DEFAULT_PINNED_PROPERTIES_BY_BLOCK: Partial<
- Record<BlockName | BlockAlias, readonly string[]>
-> = {
- task: [
- SYSTEM_PROPERTY_IDS.STATUS,
- SYSTEM_PROPERTY_IDS.PRIORITY,
- SYSTEM_PROPERTY_IDS.ASSIGNEES,
- ],
-} as const;
-
-/**
- * Get the default pinned property definition IDs for a block type.
- * Returns empty array if block has no default pinned properties.
- */
-export function getDefaultPinnedProperties(
- blockType: BlockName | BlockAlias
-): readonly string[] {
- return DEFAULT_PINNED_PROPERTIES_BY_BLOCK[blockType] ?? [];
-}
-
-/**
- * Get the builtin property definition IDs for a block type.
- * Returns empty array if block has no builtin properties.
- */
-export function getBuiltinPropertyIds(
- blockType: BlockName | BlockAlias
-): readonly string[] {
- return BUILTIN_PROPERTIES_BY_BLOCK[blockType] ?? [];
-}
-
-export const FOCUS_CONFIG = {
- DELAY: 100, // Delay before focusing element after it's connected to DOM
-} as const;
-
-const _MODAL_DIMENSIONS = {
- DEFAULT_WIDTH: 448, // 28rem
- DEFAULT_HEIGHT: 384, // 24rem
- PROPERTY_EDITOR_HEIGHT: 384,
-} as const;
-
-// Common option ids for mapping to custom icons.
-export const PROPERTY_OPTION_IDS = {
- PRIORITY: {
- LOW: '00000001-0000-0000-0003-000000000001',
- MEDIUM: '00000001-0000-0000-0003-000000000002',
- HIGH: '00000001-0000-0000-0003-000000000003',
- URGENT: '00000001-0000-0000-0003-000000000004',
- },
- STATUS: {
- NOT_STARTED: '00000001-0000-0000-0002-000000000001',
- IN_PROGRESS: '00000001-0000-0000-0002-000000000002',
- IN_REVIEW: '00000001-0000-0000-0002-000000000003',
- COMPLETED: '00000001-0000-0000-0002-000000000004',
- CANCELED: '00000001-0000-0000-0002-000000000005',
- },
-} as const;
diff --git a/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx b/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
deleted file mode 100644
index eb9c249487..0000000000
--- a/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
+++ /dev/null
@@ -1,307 +0,0 @@
-import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
-import { StaticSplitLabel } from '@app/component/split-layout/components/SplitLabel';
-import { filterMap } from '@core/util/list';
-
-import { propertiesServiceClient } from '@service-properties/client';
-import type { PropertyDefinition } from '@service-properties/generated/schemas/propertyDefinition';
-import { useQuery } from '@tanstack/solid-query';
-import { type Component, createSignal, Show, Suspense } from 'solid-js';
-import { createStore, type Store } from 'solid-js/store';
-import { propertyApiValuesToNormalized } from '../api/converters';
-import { Modals } from '../component/modal';
-import { PropertyGrid } from '../component/panel/PropertyGrid';
-import { SYSTEM_PROPERTY_IDS } from '../constants';
-import {
- PropertiesProvider,
- type PropertySaveHandler,
-} from '../context/PropertiesContext';
-import type { Property, PropertyApiValues, PropertyOption } from '../types';
-
-const DEBUG_SYSTEM_PROPERTIES = Object.values(SYSTEM_PROPERTY_IDS);
-
-/**
- * Helper to get display value of local property (copied from ComposeTask)
- */
-function extractPropertyValue(
- definition: PropertyDefinition,
- savedValues: Store<Record<string, PropertyApiValues>>,
- options: Map<string, PropertyOption[]>
-) {
- const { type, value } = propertyApiValuesToNormalized(
- savedValues[definition.id]
- );
- if (type === 'EMPTY') return null;
- if (
- definition.data_type === 'SELECT_NUMBER' ||
- definition.data_type === 'SELECT_STRING'
- ) {
- const opts = options.get(definition.id);
- if (!opts) return null;
- if (Array.isArray(value)) {
- return filterMap(value as string[], (id) => {
- const opt = opts.find((opt) => opt.id === id);
- return opt ? opt.id : undefined;
- });
- }
- } else {
- return value;
- }
-}
-
-const PropertiesDebug: Component = () => {
- const [refreshKey] = createSignal(0);
-
- // Local property state (like ComposeTask)
- const [propertyValues, setPropertyValues] = createStore<
- Record<string, PropertyApiValues>
- >({});
-
- // Fetch system properties (copied from ComposeTask)
- const systemPropertiesQuery = useQuery(() => ({
- queryKey: ['properties-debug', 'system-properties', refreshKey()],
- queryFn: async () => {
- const result = await propertiesServiceClient.listProperties({
- scope: 'system',
- include_options: true,
- });
- if (result.isErr()) {
- throw new Error('Failed to fetch system properties');
- }
- const data = result.value;
- return data;
- },
- staleTime: 1000 * 60 * 10,
- retry: 1,
- refetchOnWindowFocus: false,
- refetchOnMount: false,
- refetchOnReconnect: false,
- placeholderData: (prev) => prev,
- }));
-
- // Build property definitions map (copied from ComposeTask)
- const definitions = () => {
- if (!systemPropertiesQuery.isSuccess) return new Map();
- const data = systemPropertiesQuery.data;
- return new Map(
- data.map((p) => {
- const definition = 'definition' in p ? p.definition : p;
- return [definition.id, definition];
- })
- );
- };
-
- // Build options map (copied from ComposeTask)
- const options = () => {
- if (!systemPropertiesQuery.isSuccess) return new Map();
- const data = systemPropertiesQuery.data;
- return new Map(
- data.map((p) => {
- const definition = 'definition' in p ? p.definition : p;
- const options = 'property_options' in p ? p.property_options : [];
- return [definition.id, options];
- })
- );
- };
-
- // Build properties list (copied from ComposeTask)
- const properties = (): Property[] => {
- return filterMap(DEBUG_SYSTEM_PROPERTIES, (id) => {
- const definition = definitions().get(id);
- if (!definition) return;
- return {
- propertyId: `debug-${definition.display_name}`,
- propertyDefinitionId: definition.id,
- displayName: definition.display_name,
- isMultiSelect: definition.is_multi_select,
- owner: definition.owner,
- specificEntityType: definition.specific_entity_type ?? null,
- updatedAt: new Date(),
- createdAt: new Date(),
- valueType: definition.data_type,
- value: extractPropertyValue(definition, propertyValues, options()),
- options: options().get(definition.id),
- } as Property;
- });
- };
-
- // Spoof properties for testing string, boolean, and link types
- const spoofProperties = (): Property[] => {
- return [
- {
- propertyId: 'spoof-string-input',
- propertyDefinitionId: 'spoof-string-input',
- displayName: 'Test String Input',
- isMultiSelect: false,
- owner: { scope: 'system' },
- specificEntityType: null,
- updatedAt: new Date(),
- createdAt: new Date(),
- valueType: 'STRING',
- value: (propertyValues['spoof-string-input'] as any)?.value || null,
- options: [],
- isMetadata: false,
- },
- {
- propertyId: 'spoof-boolean-checkbox',
- propertyDefinitionId: 'spoof-boolean-checkbox',
- displayName: 'Test Boolean Checkbox',
- isMultiSelect: false,
- owner: { scope: 'system' },
- specificEntityType: null,
- updatedAt: new Date(),
- createdAt: new Date(),
- valueType: 'BOOLEAN',
- value:
- (propertyValues['spoof-boolean-checkbox'] as any)?.value || false,
- options: [],
- isMetadata: false,
- },
- {
- propertyId: 'spoof-link-url',
- propertyDefinitionId: 'spoof-link-url',
- displayName: 'Test Link URL',
- isMultiSelect: false,
- owner: { scope: 'system' },
- specificEntityType: null,
- updatedAt: new Date(),
- createdAt: new Date(),
- valueType: 'LINK',
- value: (propertyValues['spoof-link-url'] as any)?.value || null,
- options: [],
- isMetadata: false,
- },
- ];
- };
-
- const saveHandler: PropertySaveHandler = {
- saveProperty: async (property: Property, value: PropertyApiValues) => {
- console.log('Properties Debug - Saving property:', {
- propertyName: property.displayName,
- propertyId: property.propertyDefinitionId,
- valueType: value.valueType,
- value: value,
- });
-
- setPropertyValues(property.propertyDefinitionId, value);
- },
- saveDate: async (property: Property, date: Date) => {
- console.log('Properties Debug - Saving date:', {
- propertyName: property.displayName,
- propertyId: property.propertyDefinitionId,
- date: date.toISOString(),
- });
-
- setPropertyValues(property.propertyDefinitionId, {
- valueType: 'DATE',
- value: date,
- });
- },
- };
-
- return (
- <>
- <SplitHeaderLeft>
- <StaticSplitLabel label="Properties Playground" />
- </SplitHeaderLeft>
- <div class="flex flex-col size-full">
- <div class="flex flex-col gap-4 p-4">
- <Suspense
- fallback={<div class="text-center py-4">Loading Properties...</div>}
- >
- <Show
- when={systemPropertiesQuery.isSuccess && properties().length > 0}
- >
- <div class="border border-edge-muted p-2 text-sm">
- <div class="bg-surface-secondary rounded-lg">
- <PropertiesProvider
- entityType="DOCUMENT"
- canEdit={true}
- documentName="Playground"
- properties={() => properties()}
- onRefresh={() => console.log('On refresh callback')}
- onPropertyAdded={() =>
- console.log('Property added callback')
- }
- onPropertyDeleted={() =>
- console.log('Property deleted callback')
- }
- saveHandler={saveHandler}
- >
- <PropertyGrid properties={properties()} />
- <Modals />
- </PropertiesProvider>
- </div>
- </div>
-
- <div class="border border-edge-muted p-2 text-sm">
- <div class="bg-surface-secondary rounded-lg">
- <PropertiesProvider
- entityType="DOCUMENT"
- canEdit={true}
- documentName="Playground"
- properties={() => properties()}
- onRefresh={() => console.log('On refresh callback')}
- onPropertyAdded={() =>
- console.log('Property added callback')
- }
- onPropertyDeleted={() =>
- console.log('Property deleted callback')
- }
- saveHandler={saveHandler}
- >
- <PropertyGrid properties={properties()} columns={2} />
- <Modals />
- </PropertiesProvider>
- </div>
- </div>
- </Show>
-
- {/* Spoof Properties Section */}
- <div class="border border-edge-muted p-2 text-sm">
- <h3 class="text-text-primary font-medium mb-2">
- Spoof Properties (String, Boolean & Link)
- </h3>
- <div class="bg-surface-secondary rounded-lg">
- <PropertiesProvider
- entityType="DOCUMENT"
- canEdit={true}
- documentName="Spoof Playground"
- properties={() => spoofProperties()}
- onRefresh={() =>
- console.log('Spoof properties refresh callback')
- }
- onPropertyAdded={() =>
- console.log('Spoof property added callback')
- }
- onPropertyDeleted={() =>
- console.log('Spoof property deleted callback')
- }
- saveHandler={saveHandler}
- >
- <PropertyGrid properties={spoofProperties()} />
- <Modals />
- </PropertiesProvider>
- </div>
- </div>
-
- <Show
- when={
- systemPropertiesQuery.isSuccess && properties().length === 0
- }
- >
- <div class="border border-edge rounded-lg p-2 text-center">
- <div class="text-text-secondary">
- No system properties found for the debug property IDs.
- <br />
- Available property definitions: {definitions().size}
- </div>
- </div>
- </Show>
- </Suspense>
- </div>
- </div>
- </>
- );
-};
-
-export default PropertiesDebug;
diff --git a/js/app/packages/core/component/Properties/hooks/index.ts b/js/app/packages/core/component/Properties/hooks/index.ts
deleted file mode 100644
index 0d9382270b..0000000000
--- a/js/app/packages/core/component/Properties/hooks/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { useEntityProperties } from './useEntityProperties';
-
-export { usePropertyEntityDisplay } from './usePropertyEntityDisplay';
-export { usePropertySelection } from './usePropertySelection';
diff --git a/js/app/packages/core/component/Properties/types.ts b/js/app/packages/core/component/Properties/types.ts
deleted file mode 100644
index ac8959d6d7..0000000000
--- a/js/app/packages/core/component/Properties/types.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * Properties Component Type Definitions
- *
- * Type Hierarchy:
- * 1. Generated types (from OpenAPI) - Source of truth from backend
- * - EntityPropertyWithDefinition, PropertyValue, SetPropertyValue, etc.
- * 2. Domain types (this file) - Convenience types for frontend business logic
- * - Property (flattened for UI), PropertyApiValues (for value collection)
- * 3. UI Component Props - React/SolidJS component interfaces
- *
- * Prefer using generated types where possible. Domain types exist for:
- * - UI convenience (flattened Property structure)
- * - Intermediate transformations (PropertyApiValues)
- * - Legacy compatibility during migration
- */
-import type { BlockName } from '@core/block';
-import type { DateValue } from '@core/util/date';
-import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
-import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import type { PropertyOption } from '@service-properties/generated/schemas/propertyOption';
-import type { PropertyOwner } from '@service-properties/generated/schemas/propertyOwner';
-
-/**
- * Frontend value type discriminator aligned with backend DataType
- * Uses UPPERCASE to match backend enum values exactly
- */
-export type ValueType =
- | 'STRING'
- | 'NUMBER'
- | 'DATE'
- | 'BOOLEAN'
- | 'SELECT_STRING'
- | 'SELECT_NUMBER'
- | 'ENTITY'
- | 'LINK';
-
-/**
- * UI layer property with discriminated union for type-safe values
- *
- * Note: All value types use `value: T | null` or `value: T[] | null` (not optional properties)
- * This reflects that unset values are explicitly `null` rather than `undefined`.
- *
- * @see EntityPropertyWithDefinition - Backend structured type
- * @see PropertyValue - Backend discriminated union for values
- */
-export type Property = {
- propertyId: string;
- propertyDefinitionId: string;
- displayName: string;
- isMultiSelect: boolean;
- isMetadata?: boolean;
- isSystemProperty?: boolean;
- /** Property must always have a value — disables the "No <name>" clear
- * affordance in single-select editors. */
- isRequired?: boolean;
- options?: PropertyOption[];
- owner: PropertyOwner;
- specificEntityType?: EntityType | null;
- createdAt: DateValue;
- updatedAt: DateValue;
-} & ( // Single-value types
- | { valueType: 'STRING'; value: string | null }
- | { valueType: 'NUMBER'; value: number | null }
- | { valueType: 'BOOLEAN'; value: boolean | null }
- | { valueType: 'DATE'; value: Date | null }
- // Multi-value types (select values are option IDs, not display values)
- | { valueType: 'SELECT_STRING'; value: string[] | null }
- | { valueType: 'SELECT_NUMBER'; value: string[] | null }
- | { valueType: 'ENTITY'; value: EntityReference[] | null }
- | { valueType: 'LINK'; value: string[] | null }
-);
-
-type PropertyOfType<T extends ValueType> = Extract<Property, { valueType: T }>;
-
-export type StringProperty = PropertyOfType<'STRING'>;
-export type NumberProperty = PropertyOfType<'NUMBER'>;
-export type BooleanProperty = PropertyOfType<'BOOLEAN'>;
-export type DateProperty = PropertyOfType<'DATE'>;
-export type SelectStringProperty = PropertyOfType<'SELECT_STRING'>;
-export type SelectNumberProperty = PropertyOfType<'SELECT_NUMBER'>;
-export type EntityProperty = PropertyOfType<'ENTITY'>;
-export type LinkProperty = PropertyOfType<'LINK'>;
-
-/** Properties that hold a single primitive value */
-export type SingleValueProperty =
- | StringProperty
- | NumberProperty
- | BooleanProperty
- | DateProperty;
-
-/** Properties that hold multiple values (arrays) */
-export type MultiValueProperty =
- | SelectStringProperty
- | SelectNumberProperty
- | EntityProperty
- | LinkProperty;
-
-export type SelectProperty = SelectStringProperty | SelectNumberProperty;
-
-/**
- * Domain type for property definitions (camelCase, frontend-friendly)
- *
- * This is the UI layer representation of a property definition.
- * Use `toPropertyDefinitionDomain` to transform from API types.
- *
- * Note: Uses `valueType` to match the `Property` type, enabling shared
- * components like `PropertyDataTypeIcon` to work with both types.
- *
- * @see PropertyDefinition - Generated API type (snake_case)
- * @see Property - Domain type for property instances with values
- */
-export type PropertyDefinitionDomain = {
- id: string;
- displayName: string;
- valueType: ValueType;
- isMultiSelect: boolean;
- isMetadata: boolean;
- isSystem: boolean;
- owner: PropertyOwner;
- specificEntityType?: EntityType | null;
- options?: PropertyOption[];
- createdAt: DateValue;
- updatedAt: DateValue;
-};
-
-export type PropertiesPanelProps = {
- blockType: BlockName;
- closePropertiesView?: () => void;
- blockElement?: HTMLElement;
- canEdit: boolean;
- entityType: EntityType;
- documentName?: string;
- pinnedPropertyIds?: () => string[];
- onPropertyPinned?: (propertyId: string) => void;
- onPropertyUnpinned?: (propertyId: string) => void;
- onRefresh?: () => void;
-};
-
-export type PropertySelectorProps = {
- isOpen: boolean;
- onClose: () => void;
- existingPropertyIds: () => string[];
-};
-
-// Re-export generated API types from service-properties
-// Note: EntityType is NOT re-exported to avoid type conflicts with @service-connection
-// Files that need EntityType should import it directly from @service-properties/generated/schemas/entityType
-
-export type { EntityPropertyWithDefinition } from '@service-properties/generated/schemas/entityPropertyWithDefinition';
-export type { EntityReference } from '@service-properties/generated/schemas/entityReference';
-
-export type { PropertyOption } from '@service-properties/generated/schemas/propertyOption';
-export type { PropertyOptionValue } from '@service-properties/generated/schemas/propertyOptionValue';
-
-export type { SetPropertyValue } from '@service-properties/generated/schemas/setPropertyValue';
-
-/**
- * Domain layer type for property value updates
- * Maps to SetPropertyValue for API submission
- *
- * Discriminated union ensures only one value type can exist at a time
- */
-export type PropertyApiValues =
- | { valueType: 'STRING'; value: string | null }
- | { valueType: 'NUMBER'; value: number | null }
- | { valueType: 'DATE'; value: Date | null }
- | { valueType: 'BOOLEAN'; value: boolean | null }
- | { valueType: 'SELECT_STRING'; values: string[] | null }
- | { valueType: 'SELECT_NUMBER'; values: string[] | null }
- | { valueType: 'ENTITY'; refs: EntityReference[] | null }
- | { valueType: 'LINK'; values: string[] | null };
-
-// Result type for API responses
-type ApiError = {
- code: string;
- message: string;
-};
-
-export type Result<T, E = ApiError> =
- | { ok: true; value: T }
- | { ok: false; error: E };
diff --git a/js/app/packages/core/component/Properties/utils/index.ts b/js/app/packages/core/component/Properties/utils/index.ts
deleted file mode 100644
index 551b9c9614..0000000000
--- a/js/app/packages/core/component/Properties/utils/index.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-// Export all utility functions for consistent imports
-
-// Re-export from focused utility modules
-export * from './display';
-export * from './entityConversion';
-export * from './errorHandling';
-export * from './focus';
-export * from './formatting';
-// Export icon component
-export { PropertyDataTypeIcon } from './PropertyDataTypeIcon';
-export * from './position';
-export * from './suggestedProperties';
-export * from './transforms';
-export * from './typeGuards';
-export * from './validation';
diff --git a/js/app/packages/core/util/create.ts b/js/app/packages/core/util/create.ts
index 518a2c9388..bcb9cd431a 100644
--- a/js/app/packages/core/util/create.ts
+++ b/js/app/packages/core/util/create.ts
@@ -1,11 +1,8 @@
import { DEFAULT_CHAT_NAME } from '@block-chat/definition';
import type { CodeFileExtension } from '@block-code/util/languageSupport';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
import { PaywallKey, usePaywallState } from '@core/constant/PaywallState';
import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import {
authKeys,
invalidateUserQuota,
diff --git a/js/app/packages/core/util/linearImport.test.ts b/js/app/packages/core/util/linearImport.test.ts
index 5b7deb97d6..72523b077e 100644
--- a/js/app/packages/core/util/linearImport.test.ts
+++ b/js/app/packages/core/util/linearImport.test.ts
@@ -1,8 +1,5 @@
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import { describe, expect, test } from 'vitest';
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '../component/Properties/constants';
import { linearCsvRecordToMacroTaskDraft } from './linearImport';
describe('linearCsvRecordToMacroTaskDraft', () => {
diff --git a/js/app/packages/core/util/linearImport.ts b/js/app/packages/core/util/linearImport.ts
index ba84950824..d3728cd46f 100644
--- a/js/app/packages/core/util/linearImport.ts
+++ b/js/app/packages/core/util/linearImport.ts
@@ -1,7 +1,4 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import { EntityType } from '@service-storage/generated/schemas/entityType';
import type { PropertyInput } from '@service-storage/generated/schemas/propertyInput';
diff --git a/js/app/packages/core/util/taskCreation.ts b/js/app/packages/core/util/taskCreation.ts
index 78ce9837d7..5d7dff21b9 100644
--- a/js/app/packages/core/util/taskCreation.ts
+++ b/js/app/packages/core/util/taskCreation.ts
@@ -1,7 +1,4 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import type { PropertyInput } from '@service-storage/generated/schemas/propertyInput';
import { createTask } from './create';
diff --git a/js/app/packages/entity/mocks/mockEntityData.ts b/js/app/packages/entity/mocks/mockEntityData.ts
index 66aa433470..8702203b14 100644
--- a/js/app/packages/entity/mocks/mockEntityData.ts
+++ b/js/app/packages/entity/mocks/mockEntityData.ts
@@ -1,5 +1,5 @@
-import type { Property } from '@core/component/Properties/types';
import { applyDurationToDate } from '@core/util/dateSearch/dateParser';
+import type { Property } from '@property/types';
import type {
ChannelEntity,
ChatEntity,
diff --git a/js/app/packages/entity/src/composed/list-entity/call.tsx b/js/app/packages/entity/src/composed/list-entity/call.tsx
index 9d6688d94e..1dd516d319 100644
--- a/js/app/packages/entity/src/composed/list-entity/call.tsx
+++ b/js/app/packages/entity/src/composed/list-entity/call.tsx
@@ -1,10 +1,10 @@
import { formatCallDuration } from '@block-call/utils';
-import { UserGroup } from '@core/component/Properties/component/propertyValue/UserGroup';
-import { usePropertyEntityDisplay } from '@core/component/Properties/hooks';
-import type { EntityReference } from '@core/component/Properties/types';
import { UserIcon } from '@core/component/UserIcon';
import { matches } from '@core/util/match';
import UserCircleIcon from '@phosphor/user-circle.svg';
+import { UserGroup } from '@property/component/propertyValue/UserGroup';
+import { usePropertyEntityDisplay } from '@property/hooks';
+import type { EntityReference } from '@property/types';
import { EntityType } from '@service-properties/generated/schemas/entityType';
import { HoverCard } from '@ui';
import { For, Show } from 'solid-js';
diff --git a/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx b/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
index 015fc65d52..15ea0dd788 100644
--- a/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
+++ b/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
@@ -1,16 +1,13 @@
import { useMaybeBlockId } from '@core/block';
-import { Modals } from '@core/component/Properties/component/modal';
+import { ScopedPortal } from '@core/component/ScopedPortal';
+import { Property } from '@property';
+import { Modals } from '@property/component/modal';
import {
PropertiesProvider,
type PropertySaveHandler,
usePropertiesContext,
-} from '@core/component/Properties/context/PropertiesContext';
-import type {
- PropertyApiValues,
- Property as PropertyT,
-} from '@core/component/Properties/types';
-import { ScopedPortal } from '@core/component/ScopedPortal';
-import { Property } from '@property';
+} from '@property/context/PropertiesContext';
+import type { PropertyApiValues, Property as PropertyT } from '@property/types';
import { getEntityValues, hasValue } from '@property/utils';
import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
import { EntityType } from '@service-properties/generated/schemas/entityType';
diff --git a/js/app/packages/entity/src/extractors-property/property-helpers.ts b/js/app/packages/entity/src/extractors-property/property-helpers.ts
index 370acd56be..e33ca2dbc3 100644
--- a/js/app/packages/entity/src/extractors-property/property-helpers.ts
+++ b/js/app/packages/entity/src/extractors-property/property-helpers.ts
@@ -2,12 +2,8 @@ import {
NUMBER_DECIMAL_PLACES,
PROPERTY_OPTION_IDS,
SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
-import type {
- Property,
- PropertyOption,
- ValueType,
-} from '@core/component/Properties/types';
+} from '@property/constants';
+import type { Property, PropertyOption, ValueType } from '@property/types';
import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';
import { nanoid } from 'nanoid';
import { TASK_STATUS_OPTIONS } from '../utils/task-properties';
diff --git a/js/app/packages/entity/src/utils/task-properties.ts b/js/app/packages/entity/src/utils/task-properties.ts
index cf1e3d84da..2cf2657a00 100644
--- a/js/app/packages/entity/src/utils/task-properties.ts
+++ b/js/app/packages/entity/src/utils/task-properties.ts
@@ -1,7 +1,4 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import type { TaskEntityWithProperties } from '../types/entity';
export const TASK_STATUS_OPTIONS = [
diff --git a/js/app/packages/entity/tests/task-properties.test.ts b/js/app/packages/entity/tests/task-properties.test.ts
index 94dc8b262a..2ec7e27d1c 100644
--- a/js/app/packages/entity/tests/task-properties.test.ts
+++ b/js/app/packages/entity/tests/task-properties.test.ts
@@ -1,7 +1,4 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
import type { SoupProperty } from '@service-storage/generated/schemas';
import { describe, expect, it } from 'vitest';
import type { TaskEntityWithProperties } from '../src/types/entity';
diff --git a/js/app/packages/property/mocks/mockProperties.ts b/js/app/packages/property/mocks/mockProperties.ts
index 5f545d4cab..44ad6cc92e 100644
--- a/js/app/packages/property/mocks/mockProperties.ts
+++ b/js/app/packages/property/mocks/mockProperties.ts
@@ -1,11 +1,5 @@
-import {
- PROPERTY_OPTION_IDS,
- SYSTEM_PROPERTY_IDS,
-} from '@core/component/Properties/constants';
-import type {
- Property,
- PropertyOption,
-} from '@core/component/Properties/types';
+import { PROPERTY_OPTION_IDS, SYSTEM_PROPERTY_IDS } from '@property/constants';
+import type { Property, PropertyOption } from '@property/types';
const EPOCH = new Date(0).toISOString();
const now = new Date();
diff --git a/js/app/packages/core/component/Properties/api/converters.ts b/js/app/packages/property/src/api/converters.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/api/converters.ts
rename to js/app/packages/property/src/api/converters.ts
diff --git a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx b/js/app/packages/property/src/component/modal/CreatePropertyModal.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx
rename to js/app/packages/property/src/component/modal/CreatePropertyModal.tsx
diff --git a/js/app/packages/core/component/Properties/component/modal/Modals.tsx b/js/app/packages/property/src/component/modal/Modals.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/modal/Modals.tsx
rename to js/app/packages/property/src/component/modal/Modals.tsx
diff --git a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx b/js/app/packages/property/src/component/modal/SelectPropertyModal.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
rename to js/app/packages/property/src/component/modal/SelectPropertyModal.tsx
diff --git a/js/app/packages/core/component/Properties/component/modal/index.ts b/js/app/packages/property/src/component/modal/index.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/component/modal/index.ts
rename to js/app/packages/property/src/component/modal/index.ts
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx b/js/app/packages/property/src/component/propertyValue/EntityIcon.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
rename to js/app/packages/property/src/component/propertyValue/EntityIcon.tsx
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx b/js/app/packages/property/src/component/propertyValue/PropertyTooltip.tsx
similarity index 98%
rename from js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx
rename to js/app/packages/property/src/component/propertyValue/PropertyTooltip.tsx
index bc9f9e37fb..33abff5f53 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx
+++ b/js/app/packages/property/src/component/propertyValue/PropertyTooltip.tsx
@@ -1,5 +1,8 @@
-import { usePropertyEntityDisplay } from '@core/component/Properties/hooks';
-import type { Property } from '@core/component/Properties/types';
+import { UserIcon } from '@core/component/UserIcon';
+import { useUnfurl } from '@core/signal/unfurl';
+import LinkIcon from '@phosphor/link.svg';
+import { usePropertyEntityDisplay } from '@property/hooks';
+import type { Property } from '@property/types';
import {
extractDomain,
formatPropertyValue,
@@ -12,10 +15,7 @@ import {
isStringProperty,
PropertyDataTypeIcon,
hasValue as propertyHasValue,
-} from '@core/component/Properties/utils';
-import { UserIcon } from '@core/component/UserIcon';
-import { useUnfurl } from '@core/signal/unfurl';
-import LinkIcon from '@phosphor/link.svg';
+} from '@property/utils';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { proxyResource } from '@service-unfurl/client';
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/PropertyValueIcon.tsx b/js/app/packages/property/src/component/propertyValue/PropertyValueIcon.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/propertyValue/PropertyValueIcon.tsx
rename to js/app/packages/property/src/component/propertyValue/PropertyValueIcon.tsx
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/UserGroup.tsx b/js/app/packages/property/src/component/propertyValue/UserGroup.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/component/propertyValue/UserGroup.tsx
rename to js/app/packages/property/src/component/propertyValue/UserGroup.tsx
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/index.ts b/js/app/packages/property/src/component/propertyValue/index.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/component/propertyValue/index.ts
rename to js/app/packages/property/src/component/propertyValue/index.ts
diff --git a/js/app/packages/property/src/composed/PropertyDisplay.tsx b/js/app/packages/property/src/composed/PropertyDisplay.tsx
index cc7eee2360..30827a797d 100644
--- a/js/app/packages/property/src/composed/PropertyDisplay.tsx
+++ b/js/app/packages/property/src/composed/PropertyDisplay.tsx
@@ -1,5 +1,5 @@
-import { EntityIcon } from '@core/component/Properties/component/propertyValue/EntityIcon';
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
+import { EntityIcon } from '@property/component/propertyValue/EntityIcon';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { cn } from '@ui';
import { For, Match, Show, Switch } from 'solid-js';
diff --git a/js/app/packages/property/src/constants.ts b/js/app/packages/property/src/constants.ts
index 8633e093b8..ebb33ca866 100644
--- a/js/app/packages/property/src/constants.ts
+++ b/js/app/packages/property/src/constants.ts
@@ -1,3 +1,109 @@
-// Re-export business-logic constants from @core/component/Properties.
+/**
+ * Business logic constants for Properties components
+ * For styling constants, see styles/styles.ts (PROPERTY_STYLES)
+ */
-export { NUMBER_DECIMAL_PLACES } from '@core/component/Properties/constants';
+import type { BlockAlias, BlockName } from '@core/block';
+
+export const NUMBER_DECIMAL_PLACES = 4;
+
+/**
+ * System property definition IDs (from backend seed migration).
+ * These are stable UUIDs that match the database.
+ */
+export const SYSTEM_PROPERTY_IDS = {
+ // Task properties
+ ASSIGNEES: '00000001-0000-0000-0000-000000000001',
+ STATUS: '00000001-0000-0000-0000-000000000002',
+ PRIORITY: '00000001-0000-0000-0000-000000000003',
+ DUE_DATE: '00000001-0000-0000-0000-000000000004',
+ PARENT_TASK: '00000001-0000-0000-0000-000000000005',
+ SUBTASKS: '00000001-0000-0000-0000-000000000006',
+ DEPENDS_ON: '00000001-0000-0000-0000-000000000007',
+ EFFORT: '00000001-0000-0000-0000-000000000008',
+ STORY_POINTS: '00000001-0000-0000-0000-000000000009',
+ RELEVANT_DOCUMENTS: '00000001-0000-0000-0000-00000000000a',
+ // Email attachment properties
+ SOURCE: '00000001-0000-0000-0000-00000000000b',
+ COMPANIES: '00000001-0000-0000-0000-00000000000c',
+ SENDER: '00000001-0000-0000-0000-00000000000d',
+ RECIPIENTS: '00000001-0000-0000-0000-00000000000e',
+ SUBJECT: '00000001-0000-0000-0000-00000000000f',
+} as const;
+
+/**
+ * Builtin property definition IDs by block type.
+ * These properties are automatically attached to entities of this block type
+ * and cannot be removed. Order matches backend (display order).
+ */
+const BUILTIN_PROPERTIES_BY_BLOCK: Partial<
+ Record<BlockName | BlockAlias, readonly string[]>
+> = {
+ task: [
+ SYSTEM_PROPERTY_IDS.ASSIGNEES,
+ SYSTEM_PROPERTY_IDS.STATUS,
+ SYSTEM_PROPERTY_IDS.PRIORITY,
+ SYSTEM_PROPERTY_IDS.DUE_DATE,
+ SYSTEM_PROPERTY_IDS.PARENT_TASK,
+ SYSTEM_PROPERTY_IDS.SUBTASKS,
+ SYSTEM_PROPERTY_IDS.DEPENDS_ON,
+ SYSTEM_PROPERTY_IDS.EFFORT,
+ SYSTEM_PROPERTY_IDS.STORY_POINTS,
+ SYSTEM_PROPERTY_IDS.RELEVANT_DOCUMENTS,
+ ],
+} as const;
+
+/**
+ * Default pinned properties by block type.
+ * These are automatically pinned when a new entity of this block type is created.
+ */
+const DEFAULT_PINNED_PROPERTIES_BY_BLOCK: Partial<
+ Record<BlockName | BlockAlias, readonly string[]>
+> = {
+ task: [
+ SYSTEM_PROPERTY_IDS.STATUS,
+ SYSTEM_PROPERTY_IDS.PRIORITY,
+ SYSTEM_PROPERTY_IDS.ASSIGNEES,
+ ],
+} as const;
+
+/**
+ * Get the default pinned property definition IDs for a block type.
+ * Returns empty array if block has no default pinned properties.
+ */
+export function getDefaultPinnedProperties(
+ blockType: BlockName | BlockAlias
+): readonly string[] {
+ return DEFAULT_PINNED_PROPERTIES_BY_BLOCK[blockType] ?? [];
+}
+
+/**
+ * Get the builtin property definition IDs for a block type.
+ * Returns empty array if block has no builtin properties.
+ */
+export function getBuiltinPropertyIds(
+ blockType: BlockName | BlockAlias
+): readonly string[] {
+ return BUILTIN_PROPERTIES_BY_BLOCK[blockType] ?? [];
+}
+
+export const FOCUS_CONFIG = {
+ DELAY: 100,
+} as const;
+
+// Common option ids for mapping to custom icons.
+export const PROPERTY_OPTION_IDS = {
+ PRIORITY: {
+ LOW: '00000001-0000-0000-0003-000000000001',
+ MEDIUM: '00000001-0000-0000-0003-000000000002',
+ HIGH: '00000001-0000-0000-0003-000000000003',
+ URGENT: '00000001-0000-0000-0003-000000000004',
+ },
+ STATUS: {
+ NOT_STARTED: '00000001-0000-0000-0002-000000000001',
+ IN_PROGRESS: '00000001-0000-0000-0002-000000000002',
+ IN_REVIEW: '00000001-0000-0000-0002-000000000003',
+ COMPLETED: '00000001-0000-0000-0002-000000000004',
+ CANCELED: '00000001-0000-0000-0002-000000000005',
+ },
+} as const;
diff --git a/js/app/packages/core/component/Properties/context/PropertiesContext.tsx b/js/app/packages/property/src/context/PropertiesContext.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/context/PropertiesContext.tsx
rename to js/app/packages/property/src/context/PropertiesContext.tsx
diff --git a/js/app/packages/property/src/editors/popover/EditorPopover.tsx b/js/app/packages/property/src/editors/popover/EditorPopover.tsx
index 2ab621c93e..ee5d21a58e 100644
--- a/js/app/packages/property/src/editors/popover/EditorPopover.tsx
+++ b/js/app/packages/property/src/editors/popover/EditorPopover.tsx
@@ -10,6 +10,13 @@ type EditorPopoverProps = {
* Override to save-on-close.
*/
onClose?: () => void;
+ /**
+ * Kobalte dropdowns do not swallow the click event that closes the drop down.
+ * Which is an incorrect behavior in soup for us. If true, make the drop down
+ * behave more like a modal. IE. first click outside is fully inert. Default
+ * is true.
+ */
+ withClickBlock?: boolean;
};
/**
@@ -27,20 +34,46 @@ export function EditorPopover(props: EditorPopoverProps) {
else ctx.closeEditor();
};
+ const handleInteractOutside = () => {
+ if (props.withClickBlock === false) {
+ close();
+ return;
+ }
+ // Swallow the next global click. Or reset on next pointer down.
+ const swallow = (clickEvent: PointerEvent) => {
+ clickEvent.stopPropagation();
+ clickEvent.preventDefault();
+ };
+ window.addEventListener('click', swallow, {
+ capture: true,
+ once: true,
+ });
+ window.addEventListener(
+ 'pointerdown',
+ () => {
+ window.removeEventListener('click', swallow, {
+ capture: true,
+ });
+ },
+ { capture: true, once: true }
+ );
+ close();
+ };
+
return (
<Dropdown.Content
class={cn(
'max-h-96 overflow-hidden flex flex-col w-full max-w-70 p-0 text-xs',
props.class
)}
- onInteractOutside={close}
+ onInteractOutside={handleInteractOutside}
onEscapeKeyDown={close}
mount={ctx.portalMount()}
depth={3}
>
<Dropdown.Group
class="p-0 gap-0 flex-1 min-h-0"
- onClick={(e: MouseEvent) => e.stopPropagation()}
+ onClick={(e: PointerEvent) => e.stopPropagation()}
>
{props.children}
</Dropdown.Group>
diff --git a/js/app/packages/property/src/editors/popover/EntityEditor.tsx b/js/app/packages/property/src/editors/popover/EntityEditor.tsx
index d14f8ed750..e7a5043bf6 100644
--- a/js/app/packages/property/src/editors/popover/EntityEditor.tsx
+++ b/js/app/packages/property/src/editors/popover/EntityEditor.tsx
@@ -1,7 +1,7 @@
import {
entityReferencesToIdSet,
updateEntityReferences,
-} from '@core/component/Properties/utils/entityConversion';
+} from '@property/utils/entityConversion';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { createSignal, Show } from 'solid-js';
diff --git a/js/app/packages/property/src/editors/popover/SelectEditor.tsx b/js/app/packages/property/src/editors/popover/SelectEditor.tsx
index 6a7ec7da6c..9e85e4ed51 100644
--- a/js/app/packages/property/src/editors/popover/SelectEditor.tsx
+++ b/js/app/packages/property/src/editors/popover/SelectEditor.tsx
@@ -1,4 +1,4 @@
-import { usePropertyEditor } from '@core/component/Properties/hooks/usePropertyEditor';
+import { usePropertyEditor } from '@property/hooks/usePropertyEditor';
import {
useAddPropertyOptionMutation,
usePropertyOptionsQuery,
diff --git a/js/app/packages/property/src/editors/selectors/PropertyDateSelector.tsx b/js/app/packages/property/src/editors/selectors/PropertyDateSelector.tsx
index add8015eff..dc727e83fa 100644
--- a/js/app/packages/property/src/editors/selectors/PropertyDateSelector.tsx
+++ b/js/app/packages/property/src/editors/selectors/PropertyDateSelector.tsx
@@ -1,9 +1,9 @@
import { DatePickerUI } from '@core/component/DatePicker/DatePickerUI';
-import type { DateProperty } from '@core/component/Properties/types';
-import { useSearchInputFocus } from '@core/component/Properties/utils';
import { useDateSearch } from '@core/util/dateSearch/useDateSearch';
import { useKeyPressed } from '@core/util/useKeyPressed';
import SearchIcon from '@phosphor/magnifying-glass.svg';
+import type { DateProperty } from '@property/types';
+import { useSearchInputFocus } from '@property/utils';
import { cn } from '@ui';
import {
createEffect,
diff --git a/js/app/packages/property/src/editors/selectors/PropertyEntitySelector.tsx b/js/app/packages/property/src/editors/selectors/PropertyEntitySelector.tsx
index be9e2a35df..af63f9f714 100644
--- a/js/app/packages/property/src/editors/selectors/PropertyEntitySelector.tsx
+++ b/js/app/packages/property/src/editors/selectors/PropertyEntitySelector.tsx
@@ -1,4 +1,3 @@
-import { useSearchInputFocus } from '@core/component/Properties/utils';
import { UserIcon } from '@core/component/UserIcon';
import { useEmail, useUserId } from '@core/context/user';
import { useAugmentUserWithDmActivity } from '@core/user';
@@ -9,6 +8,7 @@ import type { EmailEntity } from '@entity';
import { Entity, type EntityData } from '@entity';
import { createEmailsInfiniteQuery } from '@macro-entity';
import SearchIcon from '@phosphor/magnifying-glass.svg';
+import { useSearchInputFocus } from '@property/utils';
import { useSearchSoupQuery } from '@queries/soup/search';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { debounce } from '@solid-primitives/scheduled';
diff --git a/js/app/packages/property/src/editors/selectors/PropertyOptionSelector.tsx b/js/app/packages/property/src/editors/selectors/PropertyOptionSelector.tsx
index 1d499137e2..0016708ade 100644
--- a/js/app/packages/property/src/editors/selectors/PropertyOptionSelector.tsx
+++ b/js/app/packages/property/src/editors/selectors/PropertyOptionSelector.tsx
@@ -1,11 +1,11 @@
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue';
-import { useSearchInputFocus } from '@core/component/Properties/utils';
-import { ERROR_MESSAGES } from '@core/component/Properties/utils/errorHandling';
import { useKeyPressed } from '@core/util/useKeyPressed';
import CircleDashedEmpty from '@phosphor/circle-dashed.svg';
import SearchIcon from '@phosphor/magnifying-glass.svg';
import PlusIcon from '@phosphor/plus.svg';
import LoadingSpinner from '@phosphor/spinner.svg';
+import { PropertyValueIcon } from '@property/component/propertyValue';
+import { useSearchInputFocus } from '@property/utils';
+import { ERROR_MESSAGES } from '@property/utils/errorHandling';
import { Hotkey } from '@ui';
import { cn } from '@ui/utils/classname';
import type { JSX, ParentComponent } from 'solid-js';
diff --git a/js/app/packages/property/src/extractors/PropertyIcon.tsx b/js/app/packages/property/src/extractors/PropertyIcon.tsx
index 6f913d576c..b1bac5a02e 100644
--- a/js/app/packages/property/src/extractors/PropertyIcon.tsx
+++ b/js/app/packages/property/src/extractors/PropertyIcon.tsx
@@ -1,5 +1,5 @@
-import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
import { UserIcon } from '@core/component/UserIcon';
+import { PropertyValueIcon } from '@property/component/propertyValue/PropertyValueIcon';
import { cn } from '@ui';
import { type JSX, Show } from 'solid-js';
import type { Property } from '../types';
diff --git a/js/app/packages/property/src/extractors/PropertyTooltip.tsx b/js/app/packages/property/src/extractors/PropertyTooltip.tsx
index 57c56df308..9b9ec0f3d6 100644
--- a/js/app/packages/property/src/extractors/PropertyTooltip.tsx
+++ b/js/app/packages/property/src/extractors/PropertyTooltip.tsx
@@ -1,4 +1,4 @@
-import { PropertyTooltip as CorePropertyTooltip } from '@core/component/Properties/component/propertyValue/PropertyTooltip';
+import { PropertyTooltip as CorePropertyTooltip } from '@property/component/propertyValue/PropertyTooltip';
import { HoverCard } from '@ui';
import type { JSX } from 'solid-js';
import type { Property } from '../types';
diff --git a/js/app/packages/property/src/hooks/index.ts b/js/app/packages/property/src/hooks/index.ts
index cb0ff5c3b5..0d9382270b 100644
--- a/js/app/packages/property/src/hooks/index.ts
+++ b/js/app/packages/property/src/hooks/index.ts
@@ -1 +1,4 @@
-export {};
+export { useEntityProperties } from './useEntityProperties';
+
+export { usePropertyEntityDisplay } from './usePropertyEntityDisplay';
+export { usePropertySelection } from './usePropertySelection';
diff --git a/js/app/packages/core/component/Properties/hooks/useEntityProperties.ts b/js/app/packages/property/src/hooks/useEntityProperties.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/hooks/useEntityProperties.ts
rename to js/app/packages/property/src/hooks/useEntityProperties.ts
diff --git a/js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts b/js/app/packages/property/src/hooks/usePropertyEditor.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts
rename to js/app/packages/property/src/hooks/usePropertyEditor.ts
diff --git a/js/app/packages/core/component/Properties/hooks/usePropertyEntityDisplay.tsx b/js/app/packages/property/src/hooks/usePropertyEntityDisplay.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/hooks/usePropertyEntityDisplay.tsx
rename to js/app/packages/property/src/hooks/usePropertyEntityDisplay.tsx
diff --git a/js/app/packages/core/component/Properties/hooks/usePropertySelection.ts b/js/app/packages/property/src/hooks/usePropertySelection.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/hooks/usePropertySelection.ts
rename to js/app/packages/property/src/hooks/usePropertySelection.ts
diff --git a/js/app/packages/property/src/types.ts b/js/app/packages/property/src/types.ts
index 17534a007f..ac8959d6d7 100644
--- a/js/app/packages/property/src/types.ts
+++ b/js/app/packages/property/src/types.ts
@@ -1,10 +1,181 @@
-// Re-export domain types from the existing @core/component/Properties package.
-// Source of truth lives there for now; a future PR will flip ownership to @property.
-
-export type {
- DateProperty,
- EntityProperty,
- Property,
- PropertyApiValues,
- SelectProperty,
-} from '@core/component/Properties/types';
+/**
+ * Properties Component Type Definitions
+ *
+ * Type Hierarchy:
+ * 1. Generated types (from OpenAPI) - Source of truth from backend
+ * - EntityPropertyWithDefinition, PropertyValue, SetPropertyValue, etc.
+ * 2. Domain types (this file) - Convenience types for frontend business logic
+ * - Property (flattened for UI), PropertyApiValues (for value collection)
+ * 3. UI Component Props - React/SolidJS component interfaces
+ *
+ * Prefer using generated types where possible. Domain types exist for:
+ * - UI convenience (flattened Property structure)
+ * - Intermediate transformations (PropertyApiValues)
+ * - Legacy compatibility during migration
+ */
+import type { BlockName } from '@core/block';
+import type { DateValue } from '@core/util/date';
+import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
+import type { EntityType } from '@service-properties/generated/schemas/entityType';
+import type { PropertyOption } from '@service-properties/generated/schemas/propertyOption';
+import type { PropertyOwner } from '@service-properties/generated/schemas/propertyOwner';
+
+/**
+ * Frontend value type discriminator aligned with backend DataType
+ * Uses UPPERCASE to match backend enum values exactly
+ */
+export type ValueType =
+ | 'STRING'
+ | 'NUMBER'
+ | 'DATE'
+ | 'BOOLEAN'
+ | 'SELECT_STRING'
+ | 'SELECT_NUMBER'
+ | 'ENTITY'
+ | 'LINK';
+
+/**
+ * UI layer property with discriminated union for type-safe values
+ *
+ * Note: All value types use `value: T | null` or `value: T[] | null` (not optional properties)
+ * This reflects that unset values are explicitly `null` rather than `undefined`.
+ *
+ * @see EntityPropertyWithDefinition - Backend structured type
+ * @see PropertyValue - Backend discriminated union for values
+ */
+export type Property = {
+ propertyId: string;
+ propertyDefinitionId: string;
+ displayName: string;
+ isMultiSelect: boolean;
+ isMetadata?: boolean;
+ isSystemProperty?: boolean;
+ /** Property must always have a value — disables the "No <name>" clear
+ * affordance in single-select editors. */
+ isRequired?: boolean;
+ options?: PropertyOption[];
+ owner: PropertyOwner;
+ specificEntityType?: EntityType | null;
+ createdAt: DateValue;
+ updatedAt: DateValue;
+} & ( // Single-value types
+ | { valueType: 'STRING'; value: string | null }
+ | { valueType: 'NUMBER'; value: number | null }
+ | { valueType: 'BOOLEAN'; value: boolean | null }
+ | { valueType: 'DATE'; value: Date | null }
+ // Multi-value types (select values are option IDs, not display values)
+ | { valueType: 'SELECT_STRING'; value: string[] | null }
+ | { valueType: 'SELECT_NUMBER'; value: string[] | null }
+ | { valueType: 'ENTITY'; value: EntityReference[] | null }
+ | { valueType: 'LINK'; value: string[] | null }
+);
+
+type PropertyOfType<T extends ValueType> = Extract<Property, { valueType: T }>;
+
+export type StringProperty = PropertyOfType<'STRING'>;
+export type NumberProperty = PropertyOfType<'NUMBER'>;
+export type BooleanProperty = PropertyOfType<'BOOLEAN'>;
+export type DateProperty = PropertyOfType<'DATE'>;
+export type SelectStringProperty = PropertyOfType<'SELECT_STRING'>;
+export type SelectNumberProperty = PropertyOfType<'SELECT_NUMBER'>;
+export type EntityProperty = PropertyOfType<'ENTITY'>;
+export type LinkProperty = PropertyOfType<'LINK'>;
+
+/** Properties that hold a single primitive value */
+export type SingleValueProperty =
+ | StringProperty
+ | NumberProperty
+ | BooleanProperty
+ | DateProperty;
+
+/** Properties that hold multiple values (arrays) */
+export type MultiValueProperty =
+ | SelectStringProperty
+ | SelectNumberProperty
+ | EntityProperty
+ | LinkProperty;
+
+export type SelectProperty = SelectStringProperty | SelectNumberProperty;
+
+/**
+ * Domain type for property definitions (camelCase, frontend-friendly)
+ *
+ * This is the UI layer representation of a property definition.
+ * Use `toPropertyDefinitionDomain` to transform from API types.
+ *
+ * Note: Uses `valueType` to match the `Property` type, enabling shared
+ * components like `PropertyDataTypeIcon` to work with both types.
+ *
+ * @see PropertyDefinition - Generated API type (snake_case)
+ * @see Property - Domain type for property instances with values
+ */
+export type PropertyDefinitionDomain = {
+ id: string;
+ displayName: string;
+ valueType: ValueType;
+ isMultiSelect: boolean;
+ isMetadata: boolean;
+ isSystem: boolean;
+ owner: PropertyOwner;
+ specificEntityType?: EntityType | null;
+ options?: PropertyOption[];
+ createdAt: DateValue;
+ updatedAt: DateValue;
+};
+
+export type PropertiesPanelProps = {
+ blockType: BlockName;
+ closePropertiesView?: () => void;
+ blockElement?: HTMLElement;
+ canEdit: boolean;
+ entityType: EntityType;
+ documentName?: string;
+ pinnedPropertyIds?: () => string[];
+ onPropertyPinned?: (propertyId: string) => void;
+ onPropertyUnpinned?: (propertyId: string) => void;
+ onRefresh?: () => void;
+};
+
+export type PropertySelectorProps = {
+ isOpen: boolean;
+ onClose: () => void;
+ existingPropertyIds: () => string[];
+};
+
+// Re-export generated API types from service-properties
+// Note: EntityType is NOT re-exported to avoid type conflicts with @service-connection
+// Files that need EntityType should import it directly from @service-properties/generated/schemas/entityType
+
+export type { EntityPropertyWithDefinition } from '@service-properties/generated/schemas/entityPropertyWithDefinition';
+export type { EntityReference } from '@service-properties/generated/schemas/entityReference';
+
+export type { PropertyOption } from '@service-properties/generated/schemas/propertyOption';
+export type { PropertyOptionValue } from '@service-properties/generated/schemas/propertyOptionValue';
+
+export type { SetPropertyValue } from '@service-properties/generated/schemas/setPropertyValue';
+
+/**
+ * Domain layer type for property value updates
+ * Maps to SetPropertyValue for API submission
+ *
+ * Discriminated union ensures only one value type can exist at a time
+ */
+export type PropertyApiValues =
+ | { valueType: 'STRING'; value: string | null }
+ | { valueType: 'NUMBER'; value: number | null }
+ | { valueType: 'DATE'; value: Date | null }
+ | { valueType: 'BOOLEAN'; value: boolean | null }
+ | { valueType: 'SELECT_STRING'; values: string[] | null }
+ | { valueType: 'SELECT_NUMBER'; values: string[] | null }
+ | { valueType: 'ENTITY'; refs: EntityReference[] | null }
+ | { valueType: 'LINK'; values: string[] | null };
+
+// Result type for API responses
+type ApiError = {
+ code: string;
+ message: string;
+};
+
+export type Result<T, E = ApiError> =
+ | { ok: true; value: T }
+ | { ok: false; error: E };
diff --git a/js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx b/js/app/packages/property/src/utils/PropertyDataTypeIcon.tsx
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/PropertyDataTypeIcon.tsx
rename to js/app/packages/property/src/utils/PropertyDataTypeIcon.tsx
diff --git a/js/app/packages/core/component/Properties/utils/display.ts b/js/app/packages/property/src/utils/display.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/display.ts
rename to js/app/packages/property/src/utils/display.ts
diff --git a/js/app/packages/core/component/Properties/utils/entityConversion.ts b/js/app/packages/property/src/utils/entityConversion.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/entityConversion.ts
rename to js/app/packages/property/src/utils/entityConversion.ts
diff --git a/js/app/packages/core/component/Properties/utils/errorHandling.ts b/js/app/packages/property/src/utils/errorHandling.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/errorHandling.ts
rename to js/app/packages/property/src/utils/errorHandling.ts
diff --git a/js/app/packages/core/component/Properties/utils/focus.ts b/js/app/packages/property/src/utils/focus.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/focus.ts
rename to js/app/packages/property/src/utils/focus.ts
diff --git a/js/app/packages/core/component/Properties/utils/formatting.ts b/js/app/packages/property/src/utils/formatting.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/formatting.ts
rename to js/app/packages/property/src/utils/formatting.ts
diff --git a/js/app/packages/property/src/utils/index.ts b/js/app/packages/property/src/utils/index.ts
index 260bdaad0d..551b9c9614 100644
--- a/js/app/packages/property/src/utils/index.ts
+++ b/js/app/packages/property/src/utils/index.ts
@@ -1,27 +1,15 @@
-// Re-export the utilities the @property primitives consume.
-// Source of truth still lives under @core/component/Properties/utils;
-// a future consolidation PR will move ownership here.
+// Export all utility functions for consistent imports
-export {
- extractDomain,
- formatBoolean,
- formatDate,
- formatNumber,
- formatOptionValue,
- formatPropertyValue,
-} from '@core/component/Properties/utils/formatting';
-
-export {
- getEntityValues,
- getLinkValues,
- getSelectValues,
- hasValue,
- isBooleanProperty,
- isDateProperty,
- isEntityProperty,
- isLinkProperty,
- isNumberProperty,
- isSelectProperty,
- isStringProperty,
- toPropertyApiValue,
-} from '@core/component/Properties/utils/typeGuards';
+// Re-export from focused utility modules
+export * from './display';
+export * from './entityConversion';
+export * from './errorHandling';
+export * from './focus';
+export * from './formatting';
+// Export icon component
+export { PropertyDataTypeIcon } from './PropertyDataTypeIcon';
+export * from './position';
+export * from './suggestedProperties';
+export * from './transforms';
+export * from './typeGuards';
+export * from './validation';
diff --git a/js/app/packages/core/component/Properties/utils/position.ts b/js/app/packages/property/src/utils/position.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/position.ts
rename to js/app/packages/property/src/utils/position.ts
diff --git a/js/app/packages/core/component/Properties/utils/suggestedProperties.ts b/js/app/packages/property/src/utils/suggestedProperties.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/suggestedProperties.ts
rename to js/app/packages/property/src/utils/suggestedProperties.ts
diff --git a/js/app/packages/core/component/Properties/utils/transforms.ts b/js/app/packages/property/src/utils/transforms.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/transforms.ts
rename to js/app/packages/property/src/utils/transforms.ts
diff --git a/js/app/packages/core/component/Properties/utils/typeGuards.ts b/js/app/packages/property/src/utils/typeGuards.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/typeGuards.ts
rename to js/app/packages/property/src/utils/typeGuards.ts
diff --git a/js/app/packages/core/component/Properties/utils/validation.ts b/js/app/packages/property/src/utils/validation.ts
similarity index 100%
rename from js/app/packages/core/component/Properties/utils/validation.ts
rename to js/app/packages/property/src/utils/validation.ts
diff --git a/js/app/packages/queries/properties/entity.ts b/js/app/packages/queries/properties/entity.ts
index be999801ef..e2e418bdcb 100644
--- a/js/app/packages/queries/properties/entity.ts
+++ b/js/app/packages/queries/properties/entity.ts
@@ -1,17 +1,17 @@
import { toast } from '@core/component/Toast/Toast';
import { throwOnErr } from '@core/util/result';
-import { useMutation, useQuery } from '@tanstack/solid-query';
-import { type Accessor, batch } from 'solid-js';
import {
entityPropertyFromApi,
propertyValueToApi,
-} from '../../core/component/Properties/api/converters';
+} from '@property/api/converters';
import type {
Property,
PropertyApiValues,
PropertyDefinitionDomain,
-} from '../../core/component/Properties/types';
-import { isInstantiatedProperty } from '../../core/component/Properties/utils';
+} from '@property/types';
+import { isInstantiatedProperty } from '@property/utils';
+import { useMutation, useQuery } from '@tanstack/solid-query';
+import { type Accessor, batch } from 'solid-js';
import { propertiesServiceClient } from '../../service-clients/service-properties/client';
import type { EntityType } from '../../service-clients/service-properties/generated/schemas/entityType';
import type { SoupProperty } from '../../service-clients/service-storage/generated/schemas/soupProperty';
diff --git a/js/app/packages/queries/soup/items.ts b/js/app/packages/queries/soup/items.ts
index 917a990883..17e41fc0d0 100644
--- a/js/app/packages/queries/soup/items.ts
+++ b/js/app/packages/queries/soup/items.ts
@@ -1,7 +1,7 @@
import { filterSoupItemByRequestBody } from '@app/component/next-soup/filters/query-filters';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
import { throwOnErr } from '@core/util/result';
import type { EntityData } from '@entity';
+import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import {
parseGroupMeta,
serializeGroupByField,
diff --git a/js/bun.lock b/js/bun.lock
index 34867994c4..ac5170a339 100644
--- a/js/bun.lock
+++ b/js/bun.lock
@@ -824,7 +824,7 @@
"@img/sharp-win32-x64": ["@img/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw=="],
- "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:macro-inc/tauri-plugins#6152009", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "macro-inc-tauri-plugins-6152009", "sha512-XLN+niDA9BkzrxiZqBjYf+DL4TLoMIcI80ypCowacVfrfAjWt0qLwLkzWVUXjD7k3v0DB/G+BP4OLJNkGygHIw=="],
+ "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:macro-inc/tauri-plugins#6152009", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "macro-inc-tauri-plugins-6152009"],
"@inquirer/external-editor": ["@inquirer/[email protected]", "", { "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.0" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA=="],
@@ -2544,7 +2544,7 @@
"pathval": ["[email protected]", "", {}, "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ=="],
- "pdfjs-dist": ["pdfjs-dist@github:macro-inc/pdf.js#f9b2ce6", { "dependencies": { "dommatrix": "^1.0.3", "web-streams-polyfill": "^3.2.1" }, "peerDependencies": { "worker-loader": "^3.0.8" }, "optionalPeers": ["worker-loader"] }, "macro-inc-pdf.js-f9b2ce6", "sha512-HDFaPbCxLG2GHpf1smUG97nku5aPGBGaCcIbK05dGdp07TBLUlDcXsM4WcE82mO5W4RBPIBVYobX5N/6M6NFrA=="],
+ "pdfjs-dist": ["pdfjs-dist@github:macro-inc/pdf.js#f9b2ce6", { "dependencies": { "dommatrix": "^1.0.3", "web-streams-polyfill": "^3.2.1" }, "peerDependencies": { "worker-loader": "^3.0.8" }, "optionalPeers": ["worker-loader"] }, "macro-inc-pdf.js-f9b2ce6"],
"performance-now": ["[email protected]", "", {}, "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="],