@pisell/materials 6.11.44 → 6.11.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +1 -1
  6. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +1 -1
  7. package/package.json +1 -1
  8. package/es/components/filter/components/FilterItem/index.d.ts +0 -5
  9. package/es/components/filter/components/QuickFilter/index.d.ts +0 -12
  10. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
  11. package/es/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +0 -39
  12. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -11
  13. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -60
  14. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -35
  15. package/es/components/pisellFloorMapLayout/components/HistoryIcons.d.ts +0 -39
  16. package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +0 -53
  17. package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +0 -55
  18. package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +0 -25
  19. package/es/components/pisellFloorMapLayout/floorMapLayoutConstants.d.ts +0 -4
  20. package/es/components/pisellFloorMapLayout/hooks/floorMapViewportPersistence.d.ts +0 -25
  21. package/es/components/pisellFloorMapLayout/hooks/useDraftConfigHistory.d.ts +0 -18
  22. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -71
  23. package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +0 -89
  24. package/es/components/pisellFloorMapLayout/index.d.ts +0 -26
  25. package/es/components/pisellFloorMapLayout/locales-ja.d.ts +0 -133
  26. package/es/components/pisellFloorMapLayout/locales-pt.d.ts +0 -133
  27. package/es/components/pisellFloorMapLayout/locales.d.ts +0 -651
  28. package/es/components/pisellFloorMapLayout/types.d.ts +0 -641
  29. package/es/components/pisellFloorMapLayout/utils/floorMapElementNameAsTitle.d.ts +0 -50
  30. package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolBarConstants.d.ts +0 -8
  31. package/es/components/pisellShellFrame/PisellShellFrame.d.ts +0 -13
  32. package/es/components/pisellShellFrame/types.d.ts +0 -62
  33. package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +0 -10
  34. package/es/components/pisellTimeNavigator/components/CursorLayer.d.ts +0 -27
  35. package/es/components/pisellTimeNavigator/components/GestureLayer.d.ts +0 -41
  36. package/es/components/pisellTimeNavigator/timeNavigatorConstants.d.ts +0 -20
  37. package/es/locales/en-US.d.ts +0 -557
  38. package/es/locales/ja.d.ts +0 -526
  39. package/es/locales/pt.d.ts +0 -526
  40. package/es/locales/zh-CN.d.ts +0 -552
  41. package/es/locales/zh-TW.d.ts +0 -552
  42. package/lib/components/filter/components/FilterItem/index.d.ts +0 -5
  43. package/lib/components/filter/components/QuickFilter/index.d.ts +0 -12
  44. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
  45. package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +0 -39
  46. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -11
  47. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -60
  48. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -35
  49. package/lib/components/pisellFloorMapLayout/components/HistoryIcons.d.ts +0 -39
  50. package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +0 -53
  51. package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +0 -55
  52. package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +0 -25
  53. package/lib/components/pisellFloorMapLayout/floorMapLayoutConstants.d.ts +0 -4
  54. package/lib/components/pisellFloorMapLayout/hooks/floorMapViewportPersistence.d.ts +0 -25
  55. package/lib/components/pisellFloorMapLayout/hooks/useDraftConfigHistory.d.ts +0 -18
  56. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -71
  57. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +0 -89
  58. package/lib/components/pisellFloorMapLayout/index.d.ts +0 -26
  59. package/lib/components/pisellFloorMapLayout/locales-ja.d.ts +0 -133
  60. package/lib/components/pisellFloorMapLayout/locales-pt.d.ts +0 -133
  61. package/lib/components/pisellFloorMapLayout/locales.d.ts +0 -651
  62. package/lib/components/pisellFloorMapLayout/types.d.ts +0 -641
  63. package/lib/components/pisellFloorMapLayout/utils/floorMapElementNameAsTitle.d.ts +0 -50
  64. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolBarConstants.d.ts +0 -8
  65. package/lib/components/pisellShellFrame/PisellShellFrame.d.ts +0 -13
  66. package/lib/components/pisellShellFrame/types.d.ts +0 -62
  67. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +0 -10
  68. package/lib/components/pisellTimeNavigator/components/CursorLayer.d.ts +0 -27
  69. package/lib/components/pisellTimeNavigator/components/GestureLayer.d.ts +0 -41
  70. package/lib/components/pisellTimeNavigator/timeNavigatorConstants.d.ts +0 -20
  71. package/lib/locales/en-US.d.ts +0 -557
  72. package/lib/locales/ja.d.ts +0 -526
  73. package/lib/locales/pt.d.ts +0 -526
  74. package/lib/locales/zh-CN.d.ts +0 -552
  75. package/lib/locales/zh-TW.d.ts +0 -552
@@ -42,7 +42,7 @@ export declare function parseRecordBoardToolbarSortParam(sort: unknown): {
42
42
  dir: 'asc' | 'desc';
43
43
  } | null;
44
44
  /** 当 Sort 字段名匹配这些 key(忽略大小写)时,资源墙按占用态重排卡片 */
45
- export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: readonly ["status"];
45
+ export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: string[];
46
46
  export declare function matchesResourceWallStatusSortField(sortField: string, keys: readonly string[]): boolean;
47
47
  /**
48
48
  * 用于资源墙排序:占用/将结/已结束为 1,其余为 0(与 {@link deriveVenueWallStatus} 一致)。
@@ -42,7 +42,7 @@ export declare function parseRecordBoardToolbarSortParam(sort: unknown): {
42
42
  dir: 'asc' | 'desc';
43
43
  } | null;
44
44
  /** 当 Sort 字段名匹配这些 key(忽略大小写)时,资源墙按占用态重排卡片 */
45
- export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: readonly ["status"];
45
+ export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: string[];
46
46
  export declare function matchesResourceWallStatusSortField(sortField: string, keys: readonly string[]): boolean;
47
47
  /**
48
48
  * 用于资源墙排序:占用/将结/已结束为 1,其余为 0(与 {@link deriveVenueWallStatus} 一致)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.11.44",
3
+ "version": "6.11.45",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { FilterItemProps } from '../../types';
3
- import './index.less';
4
- declare const FilterItem: React.FC<FilterItemProps>;
5
- export default FilterItem;
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { FilterItemProps } from "../../types";
3
- interface QuickFilterProps {
4
- children?: React.ReactNode;
5
- formFiltersPrefix: string;
6
- value?: {
7
- quickFilter?: FilterItemProps[];
8
- notSortFilter?: FilterItemProps[];
9
- };
10
- }
11
- declare const QuickFilter: React.FC<QuickFilterProps>;
12
- export default QuickFilter;
@@ -1,13 +0,0 @@
1
- /**
2
- * PisellFloorMapLayout - 空间布局视图
3
- * 支持两种用法:1) 仅传入 items + renderItem(原有用法);2) 传入 floorMapConfig + dataSources + mode 使用平面图视图(含多画布/编辑态)
4
- */
5
- import React from 'react';
6
- import type { FloorMapItemBase, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from './types';
7
- import './PisellFloorMapLayout.less';
8
- /** 空间布局根组件:阅读/编辑、列表与平面图双模式,ref 见 {@link PisellFloorMapLayoutRef} */
9
- declare const PisellFloorMapLayout: <T extends FloorMapItemBase = FloorMapItemBase>(props: PisellFloorMapLayoutProps<T> & {
10
- ref?: React.Ref<PisellFloorMapLayoutRef | null> | undefined;
11
- }) => React.ReactElement;
12
- export { PisellFloorMapLayout };
13
- export default PisellFloorMapLayout;
@@ -1,39 +0,0 @@
1
- /// <reference types="react" />
2
- import type { FloorMapMergedItem, FloorMapDataSources } from '../types';
3
- export declare type FigmaTableStatus = 'available' | 'reserved' | 'waiting' | 'dining' | 'billed' | 'availableSoon';
4
- /** 方桌/圆桌卡片展示用数据结构(与 Figma 设计一致,支持桌号/状态/人数/区域等) */
5
- export interface FigmaTableCardItem {
6
- id: string;
7
- /**
8
- * 无绑定或无可展示数据行时与蘸料摆台占位一致:浅灰底 + 虚线框 + 提示文案
9
- * @see getRenderItemByKindCondimentStation(RecordBoard Story)
10
- */
11
- isNoDataPlaceholder?: boolean;
12
- placeholderBorderColor?: string;
13
- placeholderHint?: string;
14
- /** 占位主标题:优先图元名称,否则「餐桌」/「圆桌」 */
15
- placeholderTitle?: string;
16
- /** 桌号/名称,空闲态居中显示 */
17
- displayName?: string;
18
- status?: FigmaTableStatus;
19
- customerName?: string;
20
- reserveTime?: string;
21
- /** 当前用餐人数(与 Figma 设计一致) */
22
- guests?: number;
23
- /** 可坐人数(与表格列「可坐人数」绑定) */
24
- capacity?: number;
25
- dishes?: string;
26
- duration?: string;
27
- /** 区域(与表格列「区域」绑定,如大厅/包厢A) */
28
- area?: string;
29
- }
30
- /** 从 merged item + dataSources 得到卡片数据 */
31
- export declare function getFigmaTableCardFromMerged(item: FloorMapMergedItem, dataSources: FloorMapDataSources): FigmaTableCardItem;
32
- /** 渲染 Figma 样式的方桌卡片(上下小条 + 资源信息标题栏 + 白底卡片 + 状态色边框) */
33
- export declare function renderFigmaStyleTableCard(cardItem: FigmaTableCardItem): JSX.Element;
34
- /** 渲染 Figma 样式的圆桌卡片(顶部资源信息 chip + 圆形主体,圆形主体只展示状态相关内容) */
35
- export declare function renderFigmaStyleRoundTableCard(cardItem: FigmaTableCardItem): JSX.Element;
36
- /** 返回用于 renderItemByKind.table 的渲染函数(方桌) */
37
- export declare function getRenderItemByKindTable(dataSources: FloorMapDataSources): (item: unknown) => JSX.Element;
38
- /** 返回用于 renderItemByKind.roundTable 的渲染函数(圆桌) */
39
- export declare function getRenderItemByKindRoundTable(dataSources: FloorMapDataSources): (item: unknown) => JSX.Element;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import type { FloorMapEditPanelParams, FloorMapViewConfig, FloorMapDataSources } from '../types';
3
- import './FloorMapEditPanel.less';
4
- export interface FloorMapEditPanelProps extends FloorMapEditPanelParams {
5
- config: FloorMapViewConfig;
6
- dataSources: FloorMapDataSources;
7
- savingRecord?: boolean;
8
- className?: string;
9
- }
10
- export declare function FloorMapEditPanel(props: FloorMapEditPanelProps): JSX.Element;
11
- export default FloorMapEditPanel;
@@ -1,60 +0,0 @@
1
- /**
2
- * FloorMapEditTopBar - 编辑态顶栏
3
- * - `mode="compact"`:画布 Tab + 可选 `canvasTabsBarTrailing`(全屏入口在左下 Dock)
4
- * - `mode="full"`:画布 Tab + `canvasTabsBarTrailing` + 保存(仅非浏览器全屏时)+ 扩展操作
5
- */
6
- import React from 'react';
7
- import type { CanvasTabsProps } from './CanvasTabs';
8
- import type { FloorMapControlsConfig, FloorMapViewConfig } from '../types';
9
- import './FloorMapEditTopBar.less';
10
- export declare type FloorMapEditTopBarMode = 'full' | 'compact';
11
- export interface FloorMapEditTopBarProps {
12
- /** full:全屏时的完整顶栏;compact:非全屏时 Tab + 扩展区 */
13
- mode?: FloorMapEditTopBarMode;
14
- config: FloorMapViewConfig;
15
- canvases: CanvasTabsProps['canvases'];
16
- currentCanvasId: CanvasTabsProps['currentCanvasId'];
17
- onTabChange: CanvasTabsProps['onTabChange'];
18
- canEditTabs?: CanvasTabsProps['canEdit'];
19
- onAddCanvas?: CanvasTabsProps['onAddCanvas'];
20
- onRemoveCanvas?: CanvasTabsProps['onRemoveCanvas'];
21
- onRenameCanvas?: CanvasTabsProps['onRenameCanvas'];
22
- onSave?: () => void;
23
- saving?: boolean;
24
- saveError?: Error | string;
25
- layoutDirty?: boolean;
26
- /** full 模式:浏览器全屏时为 true,顶栏不展示保存(改由侧栏) */
27
- isFullscreen?: boolean;
28
- controls?: FloorMapControlsConfig;
29
- /** 顶栏右侧扩展(如「区域定位」等),仅 full 模式 */
30
- extraActions?: React.ReactNode;
31
- /** 画布 Tab 同排最右侧业务区 */
32
- canvasTabsBarTrailing?: React.ReactNode;
33
- /** 启用画布仅 1 个时隐藏 Tab 行,仅保留右侧操作区(全屏顶栏保存等) */
34
- hideCanvasTabs?: boolean;
35
- /** 撤销当前编辑步骤(不传则不显示按钮) */
36
- onUndo?: () => void;
37
- /** 重做最近一次撤销(不传则不显示按钮) */
38
- onRedo?: () => void;
39
- /** 是否还有可撤销步骤 */
40
- canUndo?: boolean;
41
- /** 是否还有可重做步骤 */
42
- canRedo?: boolean;
43
- /**
44
- * 退出编辑模式回调(不保存)。
45
- * 传入后顶栏右侧会渲染「取消编辑」+「完成」两个按钮,替代原独立「保存」按钮:
46
- * - 取消编辑 → `onCancelEdit?.() ?? onExitEdit()`
47
- * - 完成 → `onSave?.()` + `onExitEdit()`
48
- * 不传则维持旧版「保存」按钮(保存但不退出)。
49
- */
50
- onExitEdit?: () => void;
51
- /**
52
- * 「取消编辑」专用回调(可选)。传入时取消按钮优先调它,业务层可以在这里
53
- * 完成「丢弃草稿 + 退出编辑」组合,从而保证回到阅读态不会看到未保存的脏数据。
54
- * 不传时取消按钮回退到 `onExitEdit`。完成按钮链路不受此 prop 影响。
55
- */
56
- onCancelEdit?: () => void;
57
- className?: string;
58
- }
59
- export declare function FloorMapEditTopBar(props: FloorMapEditTopBarProps): JSX.Element | null;
60
- export default FloorMapEditTopBar;
@@ -1,35 +0,0 @@
1
- /**
2
- * FloorMapToolbar - 编辑态左侧侧边栏:按分类添加图元、绑定数据源与行;保存可选(默认用顶栏)
3
- */
4
- import React from 'react';
5
- import type { FloorMapViewConfig, FloorMapDataSources, FloorMapMergedItem, FloorMapSceneElement, FloorMapPlaceMode } from '../types';
6
- import { type FloorMapPaletteDragPayload } from '../utils/floorMapDropUtils';
7
- import './FloorMapToolbar.less';
8
- export type { FloorMapPlaceMode as PlaceMode };
9
- export interface FloorMapToolbarProps {
10
- config: FloorMapViewConfig;
11
- dataSources: FloorMapDataSources;
12
- dataSourceLabels?: Record<string, string>;
13
- canCreate: boolean;
14
- placeMode: FloorMapPlaceMode;
15
- onPlaceModeChange: (mode: FloorMapPlaceMode) => void;
16
- renderPreviewItem?: (item: FloorMapMergedItem) => React.ReactNode;
17
- placementPreviewSize?: {
18
- width: number;
19
- height: number;
20
- };
21
- decorationPreviewSize?: number;
22
- sceneElements?: FloorMapSceneElement[];
23
- onSave?: () => void;
24
- saving?: boolean;
25
- saveError?: Error | string;
26
- /** 布局草稿已相对持久化配置变更,提示用户点击本栏「保存」 */
27
- layoutDirty?: boolean;
28
- className?: string;
29
- /** 触摸/笔:Pointer 拖拽落点(mouse 仍用 HTML5 DnD) */
30
- onPaletteCardPointerDown?: (payload: FloorMapPaletteDragPayload, e: React.PointerEvent<HTMLButtonElement>) => void;
31
- /** 触摸拖放结束后吞掉按钮 click,避免误触切换落点模式 */
32
- consumeToolbarClickIfTouchDrag?: () => boolean;
33
- }
34
- export declare function FloorMapToolbar(props: FloorMapToolbarProps): JSX.Element;
35
- export default FloorMapToolbar;
@@ -1,39 +0,0 @@
1
- /**
2
- * 编辑顶栏 Undo / Redo 自定义 SVG icon。
3
- *
4
- * 设计来源:业务方提供的「圆勾箭头」风格 —— 整圈 ~270° 回环 + 末端三角箭头。
5
- * 替换 antd 的 `UndoOutlined` / `RedoOutlined`:原版箭头偏方、回勾过短,
6
- * 在 24/16px 的小尺寸下与界面其它细线 icon 不齐,且 Undo/Redo 镜像不够直观。
7
- *
8
- * 实现要点:
9
- * - `stroke="currentColor"`、无填充:颜色完全跟随父级 `color`,与 Ant Button text 模式一致;
10
- * - viewBox 14×14,配合 `font-size: 14px` 自动得到 14px icon;调用方可通过 fontSize/CSS 调整;
11
- * - `stroke-linecap=round` + `stroke-linejoin=round`:在 1.5px 细线下保持圆润、抗锯齿友好;
12
- * - 箭头用同色 `path` 三角,避免 marker-end 在不同浏览器下的尺寸漂移;
13
- * - 接受 `className` / `style` / 其它 SVG 属性透传(与 antd icon 体感一致)。
14
- */
15
- import React from 'react';
16
- declare type HistoryIconProps = React.SVGProps<SVGSVGElement> & {
17
- /** 与 antd icon 类似:用于覆盖默认 1em 尺寸 */
18
- size?: number | string;
19
- };
20
- /**
21
- * Undo 图标:「↰」L 形带小圆角 —— 箭头在左侧水平指向左,主干由箭头水平向右、
22
- * 经一个 1.5 半径的圆角折下、再竖直向下。
23
- *
24
- * 关于"看起来偏上":antd `.anticon { vertical-align: -0.125em }` 已经把整个 svg
25
- * 相对文字基线下移 ~0.125em,但我们的形状在 viewBox 内是几何居中的(y ∈ [3,11]),
26
- * 与 antd 自家 outline icon(路径几乎铺满 viewBox)在视觉密度上不同 ——
27
- * 留白对称会让人眼判断"图形在 viewBox 上半"。
28
- *
29
- * 解决:把形状整体下移 1 单位到 y ∈ [4, 12],上侧留 4 / 下侧留 2,
30
- * 让 icon 视觉中心匹配文字 x-height 中心,与 "Undo" 文本视觉齐平。
31
- * x 仍保持 [3, 11] 居中。
32
- */
33
- export declare function UndoHistoryIcon(props: HistoryIconProps): JSX.Element;
34
- /**
35
- * Redo 图标:与 Undo 水平镜像,箭头在右侧指向右,干线右→左→下。
36
- * 几何范围与 Undo 完全对称:x ∈ [3, 11]、y ∈ [4, 12]。
37
- */
38
- export declare function RedoHistoryIcon(props: HistoryIconProps): JSX.Element;
39
- export {};
@@ -1,53 +0,0 @@
1
- /**
2
- * ItemLayer - 楼层图展示层
3
- * 按 items 的 (x, y) 与 cellSize 定位,用 renderItem 渲染每项内容
4
- */
5
- import React from 'react';
6
- import type { FloorMapItemBase, FloorMapItemUnit } from '../types';
7
- import type { CSSProperties } from 'react';
8
- import './ItemLayer.less';
9
- export interface ItemLayerProps<T extends FloorMapItemBase> {
10
- /** 资源列表 */
11
- items: T[];
12
- /** 每项渲染函数 */
13
- renderItem: (item: T, index: number) => React.ReactNode;
14
- /** 每项 key */
15
- rowKey?: string | ((item: T, index: number) => string);
16
- /** 每格像素尺寸(cell 单位时用;pixel 单位时作为缺省宽高) */
17
- cellSize: number;
18
- /** item 坐标与尺寸单位:cell 格子数,pixel 像素 */
19
- itemUnit?: FloorMapItemUnit;
20
- /** item 之间的间距(像素),仅 cell 单位时生效 */
21
- itemGap?: number;
22
- /** 内容区总宽度(像素),由 items 推导或外部传入 */
23
- contentWidth: number;
24
- /** 内容区总高度(像素) */
25
- contentHeight: number;
26
- /** 内容区 X 偏移(画布包围盒向左/上扩展时,图元层整体平移) */
27
- contentOffsetX?: number;
28
- /** 内容区 Y 偏移 */
29
- contentOffsetY?: number;
30
- /** 是否启用 hover 事件 */
31
- enableHover?: boolean;
32
- /**
33
- * 是否在 hover 时显示外沿描边(选中感高亮)。默认 true。
34
- * 平面图只读态可由布局关闭,仅去掉描边,不影响 onItemHover。
35
- */
36
- itemHoverOutline?: boolean;
37
- /** 点击回调 */
38
- onItemClick?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
39
- /** hover 进入 */
40
- onItemHover?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
41
- /** hover 离开 */
42
- onItemLeave?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
43
- /** 每项外层容器额外样式(与定位样式合并) */
44
- getMergedItemWrapperStyle?: (item: T, index: number) => CSSProperties | undefined;
45
- /**
46
- * 与编辑态一致:在含 `data-pisell-floor-room-scroll-surface` 的区域内按下时置 true,
47
- * 用于禁用 Transform 画布平移,避免图元内纵向滑动拖动画布。
48
- */
49
- onInteractionChange?: (active: boolean) => void;
50
- className?: string;
51
- }
52
- export declare function ItemLayer<T extends FloorMapItemBase>(props: ItemLayerProps<T>): JSX.Element;
53
- export default ItemLayer;
@@ -1,55 +0,0 @@
1
- /**
2
- * ViewControls - 内置视图控制:默认仅缩放;可选复位、区域定位、全屏等
3
- * 平面图(dockChrome):Dock 折叠入口 + 展开条(含业务插槽、空闲自动收起)
4
- * 非平面图:单条横栏,缩放与工具始终同排(无 Menu 折叠)
5
- */
6
- import React from 'react';
7
- import type { FloorMapControlsConfig } from '../types';
8
- import './ViewControls.less';
9
- /** 从 react-zoom-pan-pinch 拿到的控制 API(由主组件传入) */
10
- export interface ViewControlsApi {
11
- zoomIn: () => void;
12
- zoomOut: () => void;
13
- resetTransform: () => void;
14
- /** 区域定位,可能由主组件基于 items 计算后封装 */
15
- fitBounds?: () => void;
16
- /** 切换全屏(requestFullscreen / exitFullscreen) */
17
- toggleFullscreen?: () => void;
18
- }
19
- export interface ViewControlsProps {
20
- /** 控制 API */
21
- api: ViewControlsApi;
22
- /** 显隐配置 */
23
- config?: FloorMapControlsConfig;
24
- /** 当前缩放比例(1 = 100%),用于 Stepper 展示 */
25
- scale?: number;
26
- /** 当前是否处于全屏 */
27
- isFullscreen?: boolean;
28
- /** 当前 transform 是否处于「适配视口」结果(用于按钮激活态) */
29
- fitBoundsActive?: boolean;
30
- className?: string;
31
- /** 与 config.showGridToggle 联用:当前画布是否显示网格 */
32
- mapGridVisible?: boolean;
33
- /** 切换当前画布 draft 的 mapLayer.showGrid */
34
- onToggleMapGrid?: () => void;
35
- /**
36
- * 视口锁定态:true 时显示「已锁定」图标,并禁用所有改变视角的按钮
37
- * (zoom +/- / reset / fitBounds)。pan / wheel / pinch 由调用方在 TransformWrapper 上同步关闭。
38
- */
39
- viewportLocked?: boolean;
40
- /** 切换视口锁定;未传时不展示锁定按钮 */
41
- onToggleViewportLock?: () => void;
42
- /**
43
- * 平面图 Dock:圆角浅底样式,默认折叠为单入口;展开后含缩放、工具、全屏与 dockExpandedTrailing
44
- */
45
- dockChrome?: boolean;
46
- /** Dock 展开区最右侧业务插槽(如「编辑画布」) */
47
- dockExpandedTrailing?: React.ReactNode;
48
- /**
49
- * Dock 展开后无操作自动收起(毫秒);0 表示不自动收起
50
- * @default 10000
51
- */
52
- autoCollapseDockMs?: number;
53
- }
54
- export declare function ViewControls(props: ViewControlsProps): JSX.Element | null;
55
- export default ViewControls;
@@ -1,25 +0,0 @@
1
- /**
2
- * 在 TransformWrapper 内用 useControls 拿到 zoom 控制并渲染 ViewControls,确保点击加减能缩放
3
- */
4
- import React from 'react';
5
- import type { FloorMapControlsConfig } from '../types';
6
- export interface ViewControlsWithZoomProps {
7
- config?: FloorMapControlsConfig;
8
- scale?: number;
9
- isFullscreen?: boolean;
10
- /** 当前 transform 是否吻合「适配视口」结果,用于按钮激活态 */
11
- fitBoundsActive?: boolean;
12
- fitBounds: () => void;
13
- /** 未传时不展示全屏按钮(如编辑态 floorMapFullscreenMode 为 disabled) */
14
- toggleFullscreen?: () => void;
15
- mapGridVisible?: boolean;
16
- onToggleMapGrid?: () => void;
17
- /** 视口锁定态(true 时所有视角写入入口被禁用) */
18
- viewportLocked?: boolean;
19
- /** 切换视口锁定;未传时不展示锁定按钮 */
20
- onToggleViewportLock?: () => void;
21
- dockChrome?: boolean;
22
- dockExpandedTrailing?: React.ReactNode;
23
- autoCollapseDockMs?: number;
24
- }
25
- export declare function ViewControlsWithZoom(props: ViewControlsWithZoomProps): JSX.Element;
@@ -1,4 +0,0 @@
1
- /**
2
- * 平面图布局根节点 BEM 前缀,与 `PisellFloorMapLayout.less` 中主 class 一致。
3
- */
4
- export declare const FLOOR_MAP_LAYOUT_CLASS_PREFIX = "pisell-floor-map-layout";
@@ -1,25 +0,0 @@
1
- /**
2
- * 平面图视口缓存:localStorage 读写、锁定态;供 useFloorMapTransformMetrics 使用。
3
- */
4
- /** 平面图包围盒单侧默认外扩(像素);过大会导致首屏大量空白 */
5
- export declare const DEFAULT_BOUNDING_PADDING = 56;
6
- /** 视口内与首屏对齐时,图元束左上与容器边缘的留白 */
7
- export declare const VIEWPORT_TOP_LEFT_MARGIN = 16;
8
- /** 平面图视口(缩放 + 平移)持久化到 localStorage 的 key 前缀 */
9
- export declare const VIEWPORT_STORAGE_PREFIX = "pisell-floor-map-layout.viewport:";
10
- /** 视口锁定态持久化前缀(与视口位置分开存储) */
11
- export declare const VIEWPORT_LOCK_STORAGE_PREFIX = "pisell-floor-map-layout.viewport-lock:";
12
- /** 视口持久化写入节流(避免拖动 / 缩放过程中高频写 localStorage) */
13
- export declare const VIEWPORT_PERSIST_DEBOUNCE_MS = 300;
14
- /** 判定当前 transform 是否处于「适配视口」结果时的容差 */
15
- export declare const FIT_BOUNDS_MATCH_POS_EPSILON = 0.5;
16
- export declare const FIT_BOUNDS_MATCH_SCALE_EPSILON = 0.005;
17
- export interface ViewportSnapshot {
18
- x: number;
19
- y: number;
20
- scale: number;
21
- }
22
- export declare function readPersistedViewport(key: string): ViewportSnapshot | null;
23
- export declare function writePersistedViewport(key: string, snapshot: ViewportSnapshot): void;
24
- export declare function readPersistedViewportLock(key: string): boolean;
25
- export declare function writePersistedViewportLock(key: string, locked: boolean): void;
@@ -1,18 +0,0 @@
1
- export interface DraftHistoryCommitOptions {
2
- /** 同一 groupId 在合并窗口内连续提交将合并为一条历史 */
3
- groupId?: string;
4
- /** 合并窗口(毫秒),默认 600 */
5
- mergeWindowMs?: number;
6
- }
7
- export interface DraftHistory<T> {
8
- present: T | null;
9
- /** 写入并入栈(按 group/time 自动合并) */
10
- commit: (next: T | null | ((prev: T | null) => T | null), options?: DraftHistoryCommitOptions) => void;
11
- /** 重置(不入栈),清空历史;用于上游 props 同步 */
12
- replace: (next: T | null) => void;
13
- undo: () => void;
14
- redo: () => void;
15
- canUndo: boolean;
16
- canRedo: boolean;
17
- }
18
- export declare function useDraftConfigHistory<T>(): DraftHistory<T>;
@@ -1,71 +0,0 @@
1
- import type { MouseEvent, MutableRefObject } from 'react';
2
- import type { DataSourceFormColumn, FloorMapCanvasNameI18n, FloorMapDataSourceRecordFormContent, FloorMapDataSources, FloorMapItemBase, FloorMapMergedItem, FloorMapPlaceMode, FloorMapSceneElement, FloorMapViewConfig } from '../types';
3
- export interface UseFloorMapEditStateParams<T extends FloorMapItemBase> {
4
- floorMapConfigProp: FloorMapViewConfig | undefined;
5
- isFloorMapView: boolean;
6
- itemsProp: T[];
7
- cellSizeProp?: number;
8
- dataSources: FloorMapDataSources | undefined;
9
- onSave: ((config: FloorMapViewConfig) => void) | undefined;
10
- onDataSourceRecordSave: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
11
- dataSourceFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
12
- dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
13
- dataSourceLabels?: Record<string, string>;
14
- layoutPrefix: string;
15
- contentOffsetRef: MutableRefObject<{
16
- x: number;
17
- y: number;
18
- }>;
19
- showDataSourceRecordFormBlock?: boolean;
20
- }
21
- export declare function useFloorMapEditState<T extends FloorMapItemBase>(params: UseFloorMapEditStateParams<T>): {
22
- config: FloorMapViewConfig | null;
23
- currentCanvasId: string | null;
24
- setCurrentCanvasId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
25
- selectedId: string | null;
26
- setSelectedId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
27
- placeMode: FloorMapPlaceMode;
28
- setPlaceMode: import("react").Dispatch<import("react").SetStateAction<FloorMapPlaceMode>>;
29
- mergedItems: FloorMapMergedItem[];
30
- items: T[];
31
- saving: boolean;
32
- savingRecord: boolean;
33
- handleAddCanvas: () => void;
34
- handleRemoveCanvas: (canvasId: string) => void;
35
- handleRenameCanvas: (canvasId: string, name: string | FloorMapCanvasNameI18n) => void;
36
- handleUpdateItem: (itemId: string, patch: Partial<{
37
- x: number;
38
- y: number;
39
- width: number;
40
- height: number;
41
- }>) => void;
42
- handleCanvasPlaceClick: (e: MouseEvent<HTMLDivElement>) => void;
43
- handleSave: () => void;
44
- discardDraft: () => void;
45
- placeSceneElementFromPaletteDrop: (contentX: number, contentY: number, scene: Extract<FloorMapPlaceMode, {
46
- type: 'scene';
47
- }>) => void;
48
- editPanelParams: {
49
- itemId: string;
50
- sceneElement: FloorMapSceneElement;
51
- onUpdate: (patch: Partial<FloorMapSceneElement>) => void;
52
- onSaveRecord: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
53
- onClose: () => void;
54
- onDelete: (() => void) | undefined;
55
- recordFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
56
- dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
57
- dataSourceLabels: Record<string, string> | undefined;
58
- layoutDraftDirty: boolean;
59
- showDataSourceRecordFormBlock: boolean | undefined;
60
- } | null;
61
- placeOverlayClass: string;
62
- isLayoutDirty: boolean;
63
- toggleDraftCanvasShowGrid: () => void;
64
- toggleSelectedLayoutLock: () => void;
65
- duplicateSelectedElement: () => void;
66
- deleteSelectedElement: () => void;
67
- undoDraft: () => void;
68
- redoDraft: () => void;
69
- canUndo: boolean;
70
- canRedo: boolean;
71
- };
@@ -1,89 +0,0 @@
1
- import type { MutableRefObject } from 'react';
2
- import type { FloorMapItemBase, FloorMapItemUnit, FloorMapZoomConfig } from '../types';
3
- /** react-zoom-pan-pinch TransformWrapper render 注入的上下文 */
4
- export declare type FloorMapTransformContext = {
5
- zoomIn: () => void;
6
- zoomOut: () => void;
7
- resetTransform: () => void;
8
- /**
9
- * react-zoom-pan-pinch v3 实际签名:(x, y, scale, animationTime?, animationType?)
10
- * 默认 animationTime≈200ms;传 0 立即落点,避免被前一次动画吃掉或与之冲突
11
- * (restore / 缓存恢复路径应使用 0 立即覆盖已在缓动中的 fit 动画)。
12
- * 这里只暴露我们用到的前 4 参;库 animationType 是 `keyof typeof animations` 联合,
13
- * 暴露过来反而限制传入对象的兼容性,我们也确实不传它。
14
- */
15
- setTransform: (x: number, y: number, scale: number, animationTime?: number) => void;
16
- } | null;
17
- export interface UseFloorMapTransformMetricsParams<T extends FloorMapItemBase> {
18
- items: T[];
19
- cellSize: number;
20
- itemGap: number;
21
- effectiveItemUnit: FloorMapItemUnit;
22
- isFloorMapView: boolean;
23
- mode: 'read' | 'edit';
24
- zoom: FloorMapZoomConfig;
25
- transformRef: MutableRefObject<FloorMapTransformContext>;
26
- /** 由父组件创建并传入 useFloorMapEditState,本 hook 每帧写入内容区偏移 */
27
- contentOffsetRef: MutableRefObject<{
28
- x: number;
29
- y: number;
30
- }>;
31
- /** 与 mapLayer.boundingPadding 一致;未传用 DEFAULT_BOUNDING_PADDING */
32
- boundingPadding?: number;
33
- /**
34
- * 平面图:当前画布 id(或其它在切换画布时应重置平移/对齐会话的 key)。
35
- * 不传则不跑「异步加载图元后的首次左上对齐」逻辑。
36
- */
37
- frameResetKey?: string;
38
- /**
39
- * 视口持久化标识(通常拼自 canvasId)。传入后:
40
- * - 切换 / 挂载时若 localStorage 中有缓存,自动恢复 transform 并跳过本帧 autoFit;
41
- * - 用户拖动 / 缩放时(节流 300ms)写回缓存;
42
- * - 主动 fitBounds / 进入伪全屏后由 fitBounds 触发的写入也会同步保存。
43
- * 不传则完全不读不写 localStorage。
44
- */
45
- viewportPersistKey?: string;
46
- }
47
- export declare function useFloorMapTransformMetrics<T extends FloorMapItemBase>(params: UseFloorMapTransformMetricsParams<T>): {
48
- containerRef: import("react").RefObject<HTMLDivElement>;
49
- mapAreaRef: import("react").RefObject<HTMLDivElement>;
50
- viewportSize: {
51
- width: number;
52
- height: number;
53
- };
54
- mapAreaSize: {
55
- width: number;
56
- height: number;
57
- };
58
- contentWidth: number;
59
- contentHeight: number;
60
- contentOffsetX: number;
61
- contentOffsetY: number;
62
- initialPositionX: number;
63
- initialPositionY: number;
64
- zoomConfig: {
65
- initialScale: number;
66
- minScale: number;
67
- maxScale: number;
68
- step: number;
69
- };
70
- scale: number;
71
- setScale: import("react").Dispatch<import("react").SetStateAction<number>>;
72
- isFullscreen: boolean;
73
- toggleFullscreen: () => void;
74
- fitBounds: () => boolean;
75
- isAtFitBounds: boolean;
76
- notifyTransformed: (x: number, y: number, nextScale: number) => void;
77
- persistCurrentViewport: () => void;
78
- attachTransformContext: (ctx: NonNullable<FloorMapTransformContext>) => void;
79
- lastTransformRef: MutableRefObject<{
80
- x: number;
81
- y: number;
82
- scale: number;
83
- }>;
84
- isInteractingWithElement: boolean;
85
- setIsInteractingWithElement: import("react").Dispatch<import("react").SetStateAction<boolean>>;
86
- viewportLocked: boolean;
87
- setViewportLocked: (next: boolean) => void;
88
- toggleViewportLocked: () => void;
89
- };
@@ -1,26 +0,0 @@
1
- /**
2
- * PisellFloorMapLayout 组件入口
3
- * 空间布局视图:在二维平面按坐标渲染资源,支持缩放/平移/复位;支持 floorMapConfig + mode 平面图视图
4
- */
5
- export { PisellFloorMapLayout } from './PisellFloorMapLayout';
6
- export type { PisellFloorMapLayoutProps, PisellFloorMapLayoutRef, FloorMapItemBase, FloorMapItemUnit, FloorMapLayerConfig, FloorMapZoomConfig, FloorMapPanConfig, FloorMapControlsConfig, FloorMapItemShape, FloorMapBackgroundType, FloorMapPanBoundary, FloorMapLayoutMode, FloorMapGridLayoutConfig, FloorMapCanvas, FloorMapCanvasNameI18n, FloorMapElement, FloorMapData, FloorMapViewConfig, FloorMapCanvasUiConfig, FloorMapSceneElement, FloorMapSceneElementDataBinding, FloorMapPlaceMode, FloorMapElementKindCategory, FloorMapElementDataBindingPolicy, FloorMapElementDefaultPresentation, FloorMapEdge, FloorMapElementKindConfig, FloorMapElementType, FloorMapTextSlot, FloorMapDataSources, FloorMapRenderOptions, FloorMapEditPanelParams, DataSourceFormColumn, FloorMapMergedItem, FloorMapRecordFormRenderContext, FloorMapDataSourceRecordFormContent, FloorMapFullscreenMode, FloorMapLayoutContextValue, FloorMapViewportOverlayRenderArgs, } from './types';
7
- export { FLOOR_MAP_STAGE_ELEMENT_KIND, FLOOR_MAP_IMAGE_ELEMENT_KIND, } from './types';
8
- export { renderFloorMapFallbackPlaceholder } from './utils/floorMapFallbackRender';
9
- export { isFloorMapImageElementKind } from './utils/floorMapElementKindUtils';
10
- export { NAME_AS_TITLE_EXT_KEY, isElementNameAsTitleEnabled, buildNameAsTitleExtensionsPatch, resolveSceneElementDisplayTitle, } from './utils/floorMapElementNameAsTitle';
11
- export { findFloorMapRowByDataBinding, getFloorMapBindingPlaceholderReason, } from './utils/floorMapDataBindingUtils';
12
- export type { FloorMapDataSourceRow, FloorMapBindingPlaceholderReason, } from './utils/floorMapDataBindingUtils';
13
- export { createShopFloorPlanClient, SHOP_FLOOR_PLAN_DUPLICATE_CODE, } from './shopFloorPlan/shopFloorPlanClient';
14
- export type { ShopFloorPlanDetail, ShopFloorPlanLayoutItem, PostShopFloorPlanBody, PutShopFloorPlanBody, ShopFloorPlanByCodeRequestOptions, ShopFloorPlanHttpAdapter, CreateShopFloorPlanClientOptions, EnsureShopFloorPlanByCodeOptions, } from './shopFloorPlan/shopFloorPlanTypes';
15
- export type { UseShopFloorPlanSubscriptionParams } from './hooks/useShopFloorPlanSubscription';
16
- export { pickFloorPlanDetail, parseLayoutFieldToViewConfigPatch, mergeFloorPlanViewRemote, floorMapSavedConfigToRemotePatch, viewConfigToLayoutPayload, inferCanvasSizeFromScene, buildFloorPlanPutBody, isShopFloorPlanNotFoundResponse, isHttpNotFoundError, isFloorPlanDuplicateCodeError, } from './shopFloorPlan/shopFloorPlanPure';
17
- export { sceneElementsToShopLayout, shopLayoutToSceneElements, } from './shopFloorPlan/shopFloorPlanMapping';
18
- export { useShopFloorPlanSubscription } from './hooks/useShopFloorPlanSubscription';
19
- export { wrapFloorMapOnSaveWithRemotePersist, } from './utils/floorMapRemotePersist';
20
- export type { WrapFloorMapOnSaveWithRemotePersistParams } from './utils/floorMapRemotePersist';
21
- export { FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, } from './context/FloorMapLayoutContext';
22
- export type { FloorMapLayoutProviderProps } from './context/FloorMapLayoutContext';
23
- export { mergeFloorMapLayoutPropsFromContext } from './context/mergeFloorMapLayoutContext';
24
- export { FloorMapImageElement } from './components/FloorMapImageElement';
25
- export { getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable, } from './components/FigmaTableCard';
26
- export type { FigmaTableCardItem, FigmaTableStatus, } from './components/FigmaTableCard';