@hankchen/canvas-editor-vue 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +22 -2
- package/dist/canvas/AlignFloatBar.d.ts +6 -0
- package/dist/canvas/CanvasSurface.d.ts +131 -0
- package/dist/canvas/ContentTypePill.d.ts +14 -0
- package/dist/canvas/ContextMenu.d.ts +14 -0
- package/dist/canvas/FindBar.d.ts +13 -0
- package/dist/canvas/GuidesOverlay.d.ts +18 -0
- package/dist/canvas/Ruler.d.ts +24 -0
- package/dist/canvas/TextEditingOverlay.d.ts +70 -0
- package/dist/canvas/createBand.d.ts +6 -0
- package/dist/canvas/findHighlight.d.ts +12 -0
- package/dist/canvas/gizmo.d.ts +24 -0
- package/dist/canvas/guideSnap.d.ts +3 -0
- package/dist/canvas/index.d.ts +20 -0
- package/dist/canvas/resizeHandles.d.ts +3 -0
- package/dist/canvas/scheduler.d.ts +2 -0
- package/dist/canvas/useDpr.d.ts +10 -0
- package/dist/canvas/useFindSession.d.ts +13 -0
- package/dist/canvas/useTextEditing.d.ts +53 -0
- package/dist/canvas-CS4SmrIO.js +1649 -0
- package/dist/canvas.js +2 -0
- package/dist/completionAnchor-4lhR2kJz.js +273 -0
- package/dist/createLucideIcon-CMq8ZKo2.js +96 -0
- package/dist/dist-DuXLYZZ9.js +341 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +16 -0
- package/dist/layer-panel/LayerPanel.d.ts +32 -0
- package/dist/layer-panel/addMenu.d.ts +18 -0
- package/dist/layer-panel/index.d.ts +7 -0
- package/dist/layer-panel/useLayerPanel.d.ts +12 -0
- package/dist/layer-panel-ArP66_vZ.js +652 -0
- package/dist/layer-panel.js +2 -0
- package/dist/layerPath-BRZK9ka1.js +2160 -0
- package/dist/panel-theme.css +254 -0
- package/dist/property-panel/PropertyField.d.ts +65 -0
- package/dist/property-panel/PropertyPanel.d.ts +6 -0
- package/dist/property-panel/controlStyles.d.ts +17 -0
- package/dist/property-panel/controls.d.ts +3 -0
- package/dist/property-panel/fieldSchema.d.ts +116 -0
- package/dist/property-panel/fields/AlignField.d.ts +11 -0
- package/dist/property-panel/fields/AnchorDisclosureField.d.ts +16 -0
- package/dist/property-panel/fields/BooleanField.d.ts +13 -0
- package/dist/property-panel/fields/BorderField.d.ts +14 -0
- package/dist/property-panel/fields/BorderWidthInput.d.ts +14 -0
- package/dist/property-panel/fields/ColorField.d.ts +13 -0
- package/dist/property-panel/fields/FontField.d.ts +15 -0
- package/dist/property-panel/fields/ImageSrcField.d.ts +20 -0
- package/dist/property-panel/fields/NumberField.d.ts +13 -0
- package/dist/property-panel/fields/PaddingField.d.ts +14 -0
- package/dist/property-panel/fields/PairField.d.ts +19 -0
- package/dist/property-panel/fields/SelectField.d.ts +11 -0
- package/dist/property-panel/fields/ShorthandModeButton.d.ts +13 -0
- package/dist/property-panel/fields/TextField.d.ts +13 -0
- package/dist/property-panel/fields/TextareaField.d.ts +13 -0
- package/dist/property-panel/fields/ValueTypeSegmented.d.ts +10 -0
- package/dist/property-panel/fields/index.d.ts +16 -0
- package/dist/property-panel/fontPicker.d.ts +13 -0
- package/dist/property-panel/imageUpload.d.ts +11 -0
- package/dist/property-panel/index.d.ts +13 -0
- package/dist/property-panel/shorthand.d.ts +28 -0
- package/dist/property-panel/usePropertyPanel.d.ts +51 -0
- package/dist/property-panel/useShorthandMode.d.ts +18 -0
- package/dist/property-panel-jt_rsTVW.js +1719 -0
- package/dist/property-panel.js +2 -0
- package/dist/shared/DropdownMenu.d.ts +47 -0
- package/dist/shared/ExpressionCompletionPopup.d.ts +14 -0
- package/dist/shared/HelpDialog.d.ts +12 -0
- package/dist/shared/PanelIcon.d.ts +14 -0
- package/dist/shared/completion.d.ts +49 -0
- package/dist/shared/completionAnchor.d.ts +28 -0
- package/dist/shared/editableTarget.d.ts +5 -0
- package/dist/shared/expressionContext.d.ts +22 -0
- package/dist/shared/index.d.ts +37 -0
- package/dist/shared/rowsPathCompletionSource.d.ts +3 -0
- package/dist/shared/shortcutsHelp.d.ts +30 -0
- package/dist/shared/uploadFile.d.ts +2 -0
- package/dist/shared/useDataSourceSchema.d.ts +3 -0
- package/dist/shared/useDropdownMenu.d.ts +51 -0
- package/dist/shared/useExpressionCompletion.d.ts +45 -0
- package/dist/shared/useHistory.d.ts +7 -0
- package/dist/shared/usePathCompletion.d.ts +18 -0
- package/dist/shared/useSelection.d.ts +3 -0
- package/dist/shared/useShortcuts.d.ts +2 -0
- package/dist/shared/useShortcutsHelp.d.ts +9 -0
- package/dist/shared/useTransientFeedback.d.ts +10 -0
- package/dist/shared/useViewport.d.ts +3 -0
- package/dist/shared-D9zYUQaw.js +123 -0
- package/dist/shared.js +9 -0
- package/dist/status-bar/StatusBar.d.ts +17 -0
- package/dist/status-bar/index.d.ts +9 -0
- package/dist/status-bar/layerGeometryLabel.d.ts +13 -0
- package/dist/status-bar/layerPathLabel.d.ts +2 -0
- package/dist/status-bar/useDoc.d.ts +3 -0
- package/dist/status-bar-BhhrVoBZ.js +194 -0
- package/dist/status-bar.js +2 -0
- package/dist/style.css +2 -0
- package/dist/uploadFile-CutE_xI-.js +330 -0
- package/dist/useDataSourceSchema-C924m8fc.js +237 -0
- package/dist/usePathCompletion-DkHoGla4.js +228 -0
- package/dist/useShortcutsHelp-DTC3yRil.js +19 -0
- package/dist/useTransientFeedback-gS9Xa9GY.js +477 -0
- package/dist/useViewport-BLe2ise1.js +18 -0
- package/package.json +77 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./property-panel-jt_rsTVW.js";
|
|
2
|
+
export { a as CANVAS_FIELD_SECTIONS, p as FIELD_SECTIONS_BY_TYPE, d as FONT_PICKER_KEY, e as IMAGE_UPLOAD_KEY, s as PropertyField, f as PropertyPanel, i as controlRegistry, n as fieldSectionsForPath, r as fieldSectionsForType, t as injectFontPicker, c as injectImageUpload, l as layerRoleAt, o as readField, u as usePropertyPanel };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DropdownMenuEntry, DropdownMenuSlotProps } from './useDropdownMenu';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 触发钮文案(▾ 收合指示组件自带)+ 菜单 aria-label */
|
|
4
|
+
label: string;
|
|
5
|
+
items: readonly DropdownMenuEntry[];
|
|
6
|
+
/** 触发钮悬停说明;缺省回落 label */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** 弹层方向:down = 触发钮下缘向下(工具栏缺省);up = 上缘向上(状态栏贴视口底缘) */
|
|
9
|
+
direction?: 'up' | 'down';
|
|
10
|
+
};
|
|
11
|
+
declare function __VLS_template(): {
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
slots: Readonly<{
|
|
14
|
+
/** 自定义触发钮(受控 props 见 DropdownMenuSlotProps);缺省渲染内建 ghost 钮 */
|
|
15
|
+
trigger?(slotProps: DropdownMenuSlotProps): unknown;
|
|
16
|
+
/** 菜单体附加内容(渲染在菜单项之后):容器包含判定覆盖——内含点击不收 */
|
|
17
|
+
body?(slotProps: DropdownMenuSlotProps): unknown;
|
|
18
|
+
}> & {
|
|
19
|
+
/** 自定义触发钮(受控 props 见 DropdownMenuSlotProps);缺省渲染内建 ghost 钮 */
|
|
20
|
+
trigger?(slotProps: DropdownMenuSlotProps): unknown;
|
|
21
|
+
/** 菜单体附加内容(渲染在菜单项之后):容器包含判定覆盖——内含点击不收 */
|
|
22
|
+
body?(slotProps: DropdownMenuSlotProps): unknown;
|
|
23
|
+
};
|
|
24
|
+
refs: {
|
|
25
|
+
container: HTMLDivElement;
|
|
26
|
+
menuEl: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
rootEl: HTMLDivElement;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
32
|
+
closed: () => any;
|
|
33
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
+
onClosed?: (() => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
direction: "up" | "down";
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
38
|
+
container: HTMLDivElement;
|
|
39
|
+
menuEl: HTMLDivElement;
|
|
40
|
+
}, HTMLDivElement>;
|
|
41
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExpressionCompletionState } from './useExpressionCompletion';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
state: ExpressionCompletionState;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
6
|
+
rootEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
7
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
select: (index: number) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onSelect?: ((index: number) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
rootRef: HTMLDivElement;
|
|
13
|
+
}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorShortcutBinding } from '@hankchen/canvas-editor';
|
|
2
|
+
import { ShortcutPlatform } from './shortcutsHelp';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 注册表注入缝:缺省内核缺省集;宿主扩展键位后传定制集即自动入面板 */
|
|
5
|
+
bindings?: readonly EditorShortcutBinding[];
|
|
6
|
+
/** 平台注入缝(键位符号形态);缺省按 navigator 侦测 */
|
|
7
|
+
platform?: ShortcutPlatform;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
bindings: readonly EditorShortcutBinding[];
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** lucide 图标组件(消费方按名 import,不用字符串名——摇树按引用走) */
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
/** 显示边长 px(默认 14:面板 11.5px 字号尺度) */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** 描边宽(viewBox 24 尺度,默认 2 = lucide 设计比例) */
|
|
8
|
+
strokeWidth?: number;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
size: number;
|
|
12
|
+
strokeWidth: number;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ExpressionScanFragment, ExpressionScanOpen } from '@hankchen/canvas-editor';
|
|
2
|
+
/** 一条补全候选:接受段 + 展示元信息(path 为补全后的完整点路径) */
|
|
3
|
+
export interface CompletionItem {
|
|
4
|
+
/** 补全后的完整点路径(头部候选即段名);展示/悬停用,源未给可省 */
|
|
5
|
+
path?: string;
|
|
6
|
+
/** 接受时替换 partial 的段文本 */
|
|
7
|
+
segment: string;
|
|
8
|
+
/** schema description(未声明为 undefined) */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** schema title(D8 形状树两字段分离透传,未声明为 undefined)——浮层展示回落 description ?? title */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** 类型徽标数据(未声明为 undefined) */
|
|
13
|
+
type?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 候选源一次求值结果(工单 02 partial/candidates 契约 + 工单 10 open 信号扩展):
|
|
17
|
+
* 浮层据此开合与渲染,候选空与否和 open 信号无关(D10 语义)。
|
|
18
|
+
*/
|
|
19
|
+
export interface CompletionResult {
|
|
20
|
+
/** 正在输入的未完整段(恒为 expr 的后缀,尾点态 = 空后缀) */
|
|
21
|
+
partial: string;
|
|
22
|
+
/** 全量合法候选(不按 partial 预过滤——前缀过滤归浮层) */
|
|
23
|
+
candidates: readonly CompletionItem[];
|
|
24
|
+
/**
|
|
25
|
+
* 开放映射信号(D10):候选来源节点标 open(additionalProperties: true)时为
|
|
26
|
+
* true,非 open 恒缺省——浮层渲染「动态字段,键由模板定义」占位提示行(不可
|
|
27
|
+
* 接受、不进导航序,仅解释无候选的原因),信号在场时候选空也不关浮层。
|
|
28
|
+
*/
|
|
29
|
+
open?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 候选源契约(纯函数注入缝):入参 = 光标所在片段表达式(trim 后,可能带单个
|
|
33
|
+
* 补全尾点),出参 = 正在输入的 partial(恒为 expr 后缀,工单 02 契约)+ 全量
|
|
34
|
+
* 合法候选(不按 partial 预过滤——前缀过滤归浮层)+ open 信号(工单 10);
|
|
35
|
+
* null = 无补全态(语法错误/无候选),浮层不开。
|
|
36
|
+
*/
|
|
37
|
+
export type CompletionSource = (expr: string) => CompletionResult | null;
|
|
38
|
+
/** PHP trim() 默认字符集——内核 expressionScan 导出(单一事实源,勿按值复刻) */
|
|
39
|
+
/**
|
|
40
|
+
* 接受手术:把片段表达式末尾的 partial 换成候选 segment(工单 02 钉定的替换
|
|
41
|
+
* 面——非整段重插、不包 `{{}}` 外壳)。part 是扫描产物(start/end 为码元索引,
|
|
42
|
+
* end 独占),expr 物理终点 = 片段内容区终点回退 PHP trim 尾空白,partial 恒
|
|
43
|
+
* 为其后缀;值与浮层状态漂移(partial 对不上)时拒绝手术返回 null,由调用方
|
|
44
|
+
* 安全收口。
|
|
45
|
+
*/
|
|
46
|
+
export declare function applyCompletion(value: string, part: ExpressionScanFragment | ExpressionScanOpen, partial: string, segment: string): {
|
|
47
|
+
value: string;
|
|
48
|
+
cursor: number;
|
|
49
|
+
} | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 光标视口锚点测量(content-completion 工单 04,spec §3「mirror div 测量,
|
|
3
|
+
* textarea/input 两套」)。
|
|
4
|
+
*
|
|
5
|
+
* 返回光标处的视口坐标盒(left/top/bottom),浮层锚在 bottom 下方。量法:
|
|
6
|
+
* - textarea(多行换行流,white-space 按宿主 computed):mirror div 复刻排版
|
|
7
|
+
* (宽度 = 内容盒宽、同 padding/字族/行高),塞入光标前文本 + 零宽标记 span,
|
|
8
|
+
* 读标记的 offsetLeft/offsetTop 得内容原点偏移,减去宿主滚动量;
|
|
9
|
+
* - input(单行):mirror 量光标前文本宽度,纵向锚在字段盒上下缘。
|
|
10
|
+
*
|
|
11
|
+
* 样式复刻按 getComputedStyle 逐项拷贝,读不到(jsdom/降级)一律按 0 兜底
|
|
12
|
+
* (parseFloat || 0)——测量只影响弹层落点,不阻断补全。镜像节点即建即删。
|
|
13
|
+
*/
|
|
14
|
+
/** 光标处的视口坐标盒(css 像素;bottom 供浮层上缘锚定) */
|
|
15
|
+
export interface CompletionAnchor {
|
|
16
|
+
left: number;
|
|
17
|
+
top: number;
|
|
18
|
+
bottom: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 测量宿主光标的视口锚点(textarea 换行流 / input 单行两套量法)。
|
|
22
|
+
*
|
|
23
|
+
* scale = 宿主的 CSS transform 缩放系数(缺省 1):画布 textarea 整体在
|
|
24
|
+
* `transform: scale(zoom)` 系(表达式就地编辑 spec 决策 6)——getBoundingClientRect()
|
|
25
|
+
* 已含变换而 mirror 布局偏移未含,zoom ≠ 1 不折算则浮层按偏移量线性漂移;
|
|
26
|
+
* mirror 偏移与行高 × scale 后再叠加 rect 项。面板侧缺省 1,行为不变。
|
|
27
|
+
*/
|
|
28
|
+
export declare function measureCursorAnchor(el: HTMLTextAreaElement | HTMLInputElement, scale?: number): CompletionAnchor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Canvas, ExpressionContextKind, ExpressionSchemaNode, LayerPath } from '@hankchen/canvas-editor';
|
|
2
|
+
import { CompletionSource } from './completion';
|
|
3
|
+
/** 数据字段所在位置的补全上下文(kind = 候选分表面;rowSchema 仅行上下文在场) */
|
|
4
|
+
export interface ExpressionFieldContext {
|
|
5
|
+
readonly kind: ExpressionContextKind;
|
|
6
|
+
/** 行键树 schema(rowsPath 数组 items);根上下文/解析不出为 null */
|
|
7
|
+
readonly rowSchema: ExpressionSchemaNode | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 选中路径处数据字段的补全上下文:模板格内容层 = 行上下文(rowNamespace 注入
|
|
11
|
+
* 面),其余可达位置(根层/V1 格内容)= 根上下文。doc/path/schema 任一缺席
|
|
12
|
+
* 一律根上下文(画布级目标无数据字段,判定兜底一致)。
|
|
13
|
+
*/
|
|
14
|
+
export declare function expressionFieldContext(schema: ExpressionSchemaNode | null, doc: Canvas | null, path: LayerPath | null): ExpressionFieldContext;
|
|
15
|
+
/**
|
|
16
|
+
* 候选源适配(工单 04 注入缝):schema null(未注入/声明被拒降级)= null 源,
|
|
17
|
+
* 浮层恒闭;否则包裹内核枚举器——ok:false(语法错误/无补全态)映射 null,
|
|
18
|
+
* ok:true 原样透传(ExpressionCandidate 结构兼容 CompletionItem——description/
|
|
19
|
+
* title D8 分离透传、展示回落归浮层;open 信号随结果面透出供工单 10 占位提示,
|
|
20
|
+
* partial/candidates 契约见 ./completion)。
|
|
21
|
+
*/
|
|
22
|
+
export declare function expressionCompletionSource(schema: ExpressionSchemaNode | null, context: ExpressionFieldContext): CompletionSource | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 跨域切片桥出口:选择/视口/历史/快捷键切片桥、快捷键帮助面板(开合单例态 +
|
|
3
|
+
* 展示件)、快捷键展示侧纯函数与常量(键位符号/平台侦测/武装提示句——包内
|
|
4
|
+
* 散落组件与宿主工具栏共用,editor-top-toolbar 工单 03 起入出口)、可编辑目标
|
|
5
|
+
* 谓词、面板图标统一封装、DOM File 上传组装、状态栏瞬时反馈单例、下拉菜单底座
|
|
6
|
+
* (呈现件 + 开合逻辑 composable;工具栏三下拉内建触发钮直用,状态栏缩放菜单/
|
|
7
|
+
* 面板+经 #trigger/#body 受控插槽迁移消费——issues/05)与表达式补全五件(数据
|
|
8
|
+
* 契约/锚点测量/浮层控件/呈现件/上下文判定与候选源适配——属性面板与画布文本
|
|
9
|
+
* 编辑两域共用)及裸路径补全控件 usePathCompletion(rows-path-completion 工单
|
|
10
|
+
* 02:复用同门 Popup/Anchor/applyCompletion,触发语义分轨——裸路径输入即弹)、
|
|
11
|
+
* rowsPath 候选源组装 rowsPathCompletionSource(工单 03/04:「行数组」文案置入
|
|
12
|
+
* 的公共合流点)与 schema 声明切片桥 useDataSourceSchema(工单 04 自 status-bar
|
|
13
|
+
* 收口——状态栏读数段与建表表单两域共用)。
|
|
14
|
+
* 这是唯一允许被各域引用的层——域间横向 import 被依赖红线
|
|
15
|
+
* (editor-vue-*-isolation)禁止,跨域消费一律收口到这里。
|
|
16
|
+
*/
|
|
17
|
+
export { default as HelpDialog } from './HelpDialog';
|
|
18
|
+
export { default as DropdownMenu } from './DropdownMenu';
|
|
19
|
+
export { useDropdownMenu, type DropdownMenuController, type DropdownMenuEntry, type DropdownMenuItem, type DropdownMenuSlotProps, } from './useDropdownMenu';
|
|
20
|
+
export { ARM_LAYER_CREATE_HINT, detectShortcutPlatform, shortcutActionLabel, } from './shortcutsHelp';
|
|
21
|
+
export { isEditableEventTarget } from './editableTarget';
|
|
22
|
+
export { default as ExpressionCompletionPopup } from './ExpressionCompletionPopup';
|
|
23
|
+
export { applyCompletion, type CompletionItem, type CompletionResult, type CompletionSource } from './completion';
|
|
24
|
+
export { measureCursorAnchor, type CompletionAnchor } from './completionAnchor';
|
|
25
|
+
export { expressionCompletionSource, expressionFieldContext, type ExpressionFieldContext, } from './expressionContext';
|
|
26
|
+
export { useExpressionCompletion, type ExpressionCompletionState } from './useExpressionCompletion';
|
|
27
|
+
export { usePathCompletion } from './usePathCompletion';
|
|
28
|
+
export { rowsPathCompletionSource } from './rowsPathCompletionSource';
|
|
29
|
+
export { useHistory, type HistoryAvailability } from './useHistory';
|
|
30
|
+
export { useSelection } from './useSelection';
|
|
31
|
+
export { useDataSourceSchema } from './useDataSourceSchema';
|
|
32
|
+
export { useShortcuts } from './useShortcuts';
|
|
33
|
+
export { useShortcutsHelp, type ShortcutsHelp } from './useShortcutsHelp';
|
|
34
|
+
export { useTransientFeedback, type TransientFeedback } from './useTransientFeedback';
|
|
35
|
+
export { uploadFileFromDom } from './uploadFile';
|
|
36
|
+
export { useViewport } from './useViewport';
|
|
37
|
+
export { default as PanelIcon } from './PanelIcon';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EditorShortcutAction, EditorShortcutGroup, ShortcutCombo } from '@hankchen/canvas-editor';
|
|
2
|
+
export type ShortcutPlatform = 'mac' | 'win';
|
|
3
|
+
/** 分节渲染顺序(条目在节内的顺序 = 注册表声明序) */
|
|
4
|
+
export declare const SHORTCUT_GROUP_ORDER: readonly EditorShortcutGroup[];
|
|
5
|
+
/** 分组中文展示名(归本包,帮助面板分节标题) */
|
|
6
|
+
export declare const SHORTCUT_GROUP_LABELS: Record<EditorShortcutGroup, string>;
|
|
7
|
+
/**
|
|
8
|
+
* 键位组合 → 平台键位符号:mac ⌥⇧⌘ + 键帽(⇧⌘L);win Ctrl+Shift+Alt + 键帽
|
|
9
|
+
* (Ctrl+Shift+L)。字母键帽大写(⌘Z / Ctrl+Z),其余走映射表或缺省原样。
|
|
10
|
+
*/
|
|
11
|
+
export declare function shortcutKeyLabel(combo: ShortcutCombo, platform: ShortcutPlatform): string;
|
|
12
|
+
/**
|
|
13
|
+
* 注册表动作 → 平台键位符号(如 ⌘/ 与 Ctrl+/):直查内核缺省注册表——注册表是
|
|
14
|
+
* 键位唯一事实源,提示文案不另抄键位,改键位自动跟随。同动作多注册条目时取
|
|
15
|
+
* 声明首条(多通道动作如 delete 的展示歧义归帮助面板,本口供无歧义提示用)。
|
|
16
|
+
*/
|
|
17
|
+
export declare function shortcutActionLabel(action: EditorShortcutAction, platform: ShortcutPlatform): string;
|
|
18
|
+
/**
|
|
19
|
+
* 武装建层的状态栏瞬时提示(canvas-web-drag-create 工单 03):面板新增项与
|
|
20
|
+
* T/G/Q/I 层型快捷键两入口共用同一句(LayerPanel 与 useShortcuts 直引此常量,
|
|
21
|
+
* 文案单点维护)。瞬时语义 = show 后数秒自动清空(useTransientFeedback TTL),
|
|
22
|
+
* 武装本身是待命态,不随解除主动撤提示。
|
|
23
|
+
*/
|
|
24
|
+
export declare const ARM_LAYER_CREATE_HINT = "\u753B\u62C9\u6216\u70B9\u51FB\u843D\u5C42\uFF0CEsc \u53D6\u6D88";
|
|
25
|
+
/**
|
|
26
|
+
* 平台侦测:userAgentData.platform(Client Hints 新 API,Safari 尚无——三源拼串
|
|
27
|
+
* 一次匹配)与 platform/userAgent 含 mac 形态 → mac;未知/其余 → win 文本系。
|
|
28
|
+
* userAgentData 未进全量 TS DOM lib,结构化局部读取免随 lib 版本漂移。
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectShortcutPlatform(): ShortcutPlatform;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
/** 菜单项:shortcut 为纯展示键位后缀(右侧灰字,字符串由调用方传入,底座不做
|
|
3
|
+
* 平台检测);title 承载置灰原因(壳内「置灰 + title」统一先例,ContextMenu.vue);
|
|
4
|
+
* keepsOpen 项分发后菜单留场(面板+模板表表单交换特例,issues/05 拍板推翻
|
|
5
|
+
* spec Q12 的「勿加」——迁移需要,且仅此一形态);dataAttrs 透传 data-* 目验/
|
|
6
|
+
* 测试钩子(状态栏 data-zoom-*、面板 data-add-layer 同缝) */
|
|
7
|
+
export interface DropdownMenuItem {
|
|
8
|
+
label: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
shortcut?: string;
|
|
12
|
+
keepsOpen?: boolean;
|
|
13
|
+
dataAttrs?: Readonly<Record<string, string>>;
|
|
14
|
+
run: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** 菜单条目 = 菜单项 | 分隔符(成员间可插,排列▾/视图▾ 各需一段) */
|
|
17
|
+
export type DropdownMenuEntry = DropdownMenuItem | 'separator';
|
|
18
|
+
export interface DropdownMenuController {
|
|
19
|
+
/** 菜单开合态(触发钮 aria-expanded 与菜单 v-if 同源) */
|
|
20
|
+
open: Ref<boolean>;
|
|
21
|
+
toggle(): void;
|
|
22
|
+
openMenu(): void;
|
|
23
|
+
closeMenu(): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* #trigger / #body 两插槽的受控 props(issues/05):自绘触发钮消费 open(驱动
|
|
27
|
+
* aria-expanded)/toggle(点击开合,内含定位与焦点编排)/triggerRef(元素记录,
|
|
28
|
+
* 定位与回焦的前提)/onKeydown(↓ 开菜单);菜单体消费 closeMenu(表单创建/
|
|
29
|
+
* 取消自管收起)。a11y 两属性 aria-haspopup="menu"/:aria-expanded 由消费方写在
|
|
30
|
+
* 自绘钮上——底座保留 role="menu"/role="menuitem" 与菜单 aria-label。
|
|
31
|
+
*/
|
|
32
|
+
export interface DropdownMenuSlotProps {
|
|
33
|
+
open: boolean;
|
|
34
|
+
toggle(): void;
|
|
35
|
+
closeMenu(): void;
|
|
36
|
+
triggerRef(el: Element | ComponentPublicInstance | null): void;
|
|
37
|
+
onKeydown(event: KeyboardEvent): void;
|
|
38
|
+
}
|
|
39
|
+
export declare function useDropdownMenu(options: {
|
|
40
|
+
container: Ref<HTMLElement | null>;
|
|
41
|
+
}): DropdownMenuController;
|
|
42
|
+
/** 菜单内导航键(issues/04):↑↓ 循环 + Home/End 首尾;左右键与 typeahead 不做 */
|
|
43
|
+
export type MenuFocusKey = 'ArrowDown' | 'ArrowUp' | 'Home' | 'End';
|
|
44
|
+
/**
|
|
45
|
+
* 菜单键盘导航落点(纯函数,issues/04):enabled 与菜单项 DOM 序对齐的启用位
|
|
46
|
+
* 标志,current 为现焦点项下标(焦点不在项上——菜单根本兜——传 -1),返回落点
|
|
47
|
+
* 下标。置灰项跳过(原生 disabled 不可聚焦,「可达」需改 aria-disabled 契约,
|
|
48
|
+
* 拍板记 issues/04 Comments);↑↓ 循环(末项 ↓ 绕首、首项 ↑ 绕尾),current=-1
|
|
49
|
+
* 时 ↓ 落首个启用项、↑ 落末个;全置灰返回 -1,调用方回焦菜单根。
|
|
50
|
+
*/
|
|
51
|
+
export declare function nextEnabledItemIndex(enabled: readonly boolean[], current: number, key: MenuFocusKey): number;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { CompletionItem, CompletionSource } from './completion';
|
|
3
|
+
/** 浮层呈现态(传给 ExpressionCompletionPopup 的 state prop) */
|
|
4
|
+
export interface ExpressionCompletionState {
|
|
5
|
+
open: boolean;
|
|
6
|
+
items: readonly CompletionItem[];
|
|
7
|
+
activeIndex: number;
|
|
8
|
+
/** 视口坐标(fixed 定位;光标下缘 + 间隙) */
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
/**
|
|
12
|
+
* 开放映射占位提示(D10,工单 10):候选来源节点标 open 时为 true——浮层渲染
|
|
13
|
+
* 「动态字段,键由模板定义」占位提示行(不可接受、不进导航序,仅解释无候选的
|
|
14
|
+
* 原因)。信号与候选空否无关(宿主合入 properties 的键照常枚举),true 时提示
|
|
15
|
+
* 行恒在场;items 导航/接受只认候选条目,提示行不在其中。
|
|
16
|
+
*/
|
|
17
|
+
openMapping: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useExpressionCompletion(options: {
|
|
20
|
+
/** 宿主输入元素(textarea/input),模板 ref 传入 */
|
|
21
|
+
target: Ref<HTMLTextAreaElement | HTMLInputElement | null>;
|
|
22
|
+
/** 表达式态开关(静态态恒闭);响应式 getter/ ref 均可 */
|
|
23
|
+
enabled: MaybeRefOrGetter<boolean>;
|
|
24
|
+
/** 候选源(纯函数注入缝,见 completion.ts) */
|
|
25
|
+
resolve: CompletionSource;
|
|
26
|
+
/** 浮层根元素(可选;在场时按其量宽做视口右缘收口) */
|
|
27
|
+
popupEl?: MaybeRefOrGetter<HTMLElement | null>;
|
|
28
|
+
/**
|
|
29
|
+
* `{{` 自动配对门(工单 07,可选):与 enabled 分离——表达式态未注入
|
|
30
|
+
* schema 也配对(配对防的是未闭合静默错,不依赖候选声明);缺省回落
|
|
31
|
+
* enabled,调用方未分门时跟随浮层开关。
|
|
32
|
+
*/
|
|
33
|
+
pairing?: MaybeRefOrGetter<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* 锚点测量缩放(表达式就地编辑工单 03,可选):宿主整体在 CSS transform
|
|
36
|
+
* scale 系时传呈现缩放(画布 textarea = zoom),mirror 布局偏移按其折算;
|
|
37
|
+
* 缺省 1(面板侧宿主无变换,行为不变)。
|
|
38
|
+
*/
|
|
39
|
+
scale?: MaybeRefOrGetter<number>;
|
|
40
|
+
}): {
|
|
41
|
+
/** 呈现态(reactive),传给浮层组件 */
|
|
42
|
+
popup: ExpressionCompletionState;
|
|
43
|
+
/** 接受高亮项(或指定项);浮层点选经此回接 */
|
|
44
|
+
accept: (index?: number) => void;
|
|
45
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { EditorSession } from '@hankchen/canvas-editor';
|
|
3
|
+
export interface HistoryAvailability {
|
|
4
|
+
canUndo: ComputedRef<boolean>;
|
|
5
|
+
canRedo: ComputedRef<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useHistory(editor: EditorSession): HistoryAvailability;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { CompletionSource } from './completion';
|
|
3
|
+
import { ExpressionCompletionState } from './useExpressionCompletion';
|
|
4
|
+
export declare function usePathCompletion(options: {
|
|
5
|
+
/** 宿主输入元素(textarea/input),模板 ref 传入 */
|
|
6
|
+
target: Ref<HTMLTextAreaElement | HTMLInputElement | null>;
|
|
7
|
+
/** 补全门(无 schema/非标记字段恒闭);响应式 getter/ ref 均可 */
|
|
8
|
+
enabled: MaybeRefOrGetter<boolean>;
|
|
9
|
+
/** 候选源(纯函数注入缝,见 completion.ts;入参 = 光标前输入串) */
|
|
10
|
+
resolve: CompletionSource;
|
|
11
|
+
/** 浮层根元素(可选;在场时按其量宽做视口右缘收口) */
|
|
12
|
+
popupEl?: MaybeRefOrGetter<HTMLElement | null>;
|
|
13
|
+
}): {
|
|
14
|
+
/** 呈现态(reactive),传给浮层组件 */
|
|
15
|
+
popup: ExpressionCompletionState;
|
|
16
|
+
/** 接受高亮项(或指定项);浮层点选经此回接 */
|
|
17
|
+
accept: (index?: number) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface TransientFeedback {
|
|
3
|
+
/** 当前瞬时文案(空串 = 无) */
|
|
4
|
+
readonly message: Ref<string>;
|
|
5
|
+
/** 显示一条瞬时反馈(替换前一条并重置驻留计时) */
|
|
6
|
+
show(text: string): void;
|
|
7
|
+
/** 立即清除当前文案(取消驻留计时) */
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useTransientFeedback(): TransientFeedback;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { B as e, D as t, G as n, H as r, L as i, M as a, T as o, _ as s, b as c, d as l, f as u, g as d, h as f, k as p, m, p as h, u as g } from "./layerPath-BRZK9ka1.js";
|
|
2
|
+
import { a as _, c as v, d as y, f as b, i as x, l as S, n as C, o as w, r as T, t as E, u as D } from "./useTransientFeedback-gS9Xa9GY.js";
|
|
3
|
+
import { t as O } from "./useShortcutsHelp-DTC3yRil.js";
|
|
4
|
+
//#region src/shared/HelpDialog.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var k = {
|
|
6
|
+
class: "cn-help__panel",
|
|
7
|
+
role: "dialog",
|
|
8
|
+
"aria-modal": "true",
|
|
9
|
+
"aria-label": "快捷键帮助",
|
|
10
|
+
"data-help-dialog": ""
|
|
11
|
+
}, A = { class: "cn-help__header" }, j = { class: "cn-help__body" }, M = ["data-help-group"], N = { class: "cn-help__section-title" }, P = { class: "cn-help__list" }, F = { class: "cn-help__label" }, I = { class: "cn-help__keys" }, L = {
|
|
12
|
+
class: "cn-help__section",
|
|
13
|
+
"data-help-interactions": ""
|
|
14
|
+
}, R = { class: "cn-help__list" }, z = { class: "cn-help__label" }, B = { class: "cn-help__keys" }, V = /*#__PURE__*/ S(/* @__PURE__ */ c({
|
|
15
|
+
__name: "HelpDialog",
|
|
16
|
+
props: {
|
|
17
|
+
bindings: { default: () => y },
|
|
18
|
+
platform: {}
|
|
19
|
+
},
|
|
20
|
+
setup(e) {
|
|
21
|
+
let i = e, { open: c, close: y } = O(), b = h(() => i.platform ?? w()), S = h(() => _.map((e) => ({
|
|
22
|
+
group: e,
|
|
23
|
+
label: x[e],
|
|
24
|
+
bindings: i.bindings.filter((t) => t.group === e)
|
|
25
|
+
})).filter((e) => e.bindings.length > 0)), C = [
|
|
26
|
+
{
|
|
27
|
+
gesture: "Ctrl/⌘ + 滚轮",
|
|
28
|
+
text: "缩放画布(以指针为中心,5%–800%)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
gesture: "空格拖动",
|
|
32
|
+
text: "平移画布(中键拖拽、左键拖空白同效)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
gesture: "面板菜单 / T·G·Q·I",
|
|
36
|
+
text: "画拉建层:点层型或按键武装 → 画布拖拽定落位与尺寸(位移小于死区 = 点击兜底缺省尺寸)→ 自动选中、文本直打;Esc 取消"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
gesture: "双击",
|
|
40
|
+
text: "就地编辑文本"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
gesture: "Esc",
|
|
44
|
+
text: "退出编辑 / 解除武装 / 关闭弹层 / 选择逐级升级(格→行→表)"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
gesture: "方向键",
|
|
48
|
+
text: "微调选中图层 1px(按住 Shift 大步 10px)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
gesture: "Tab / ⇧Tab",
|
|
52
|
+
text: "在根图层间循环选层(跳过隐藏与锁定)"
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
function T(e) {
|
|
56
|
+
e.key === "Escape" && y();
|
|
57
|
+
}
|
|
58
|
+
return a(c, (e) => {
|
|
59
|
+
e ? window.addEventListener("keydown", T) : window.removeEventListener("keydown", T);
|
|
60
|
+
}), o(() => window.removeEventListener("keydown", T)), (e, i) => (t(), f(u, { to: "body" }, [r(c) ? (t(), s("div", {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: "cn-help",
|
|
63
|
+
"data-help-overlay": "",
|
|
64
|
+
onPointerdown: i[1] ||= g((...e) => r(y) && r(y)(...e), ["self"])
|
|
65
|
+
}, [m("div", k, [m("header", A, [i[2] ||= m("h2", { class: "cn-help__title" }, "快捷键", -1), m("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
class: "cn-help__close",
|
|
68
|
+
"data-help-close": "",
|
|
69
|
+
"aria-label": "关闭快捷键帮助",
|
|
70
|
+
onClick: i[0] ||= (...e) => r(y) && r(y)(...e)
|
|
71
|
+
}, " ✕ ")]), m("div", j, [(t(!0), s(l, null, p(S.value, (e) => (t(), s("section", {
|
|
72
|
+
key: e.group,
|
|
73
|
+
class: "cn-help__section",
|
|
74
|
+
"data-help-group": e.group
|
|
75
|
+
}, [m("h3", N, n(e.label), 1), m("ul", P, [(t(!0), s(l, null, p(e.bindings, (e) => (t(), s("li", {
|
|
76
|
+
key: `${e.action}:${e.combo.key}`,
|
|
77
|
+
class: "cn-help__row",
|
|
78
|
+
"data-help-shortcut": ""
|
|
79
|
+
}, [m("span", F, n(e.label), 1), m("kbd", I, n(r(v)(e.combo, b.value)), 1)]))), 128))])], 8, M))), 128)), m("section", L, [i[3] ||= m("h3", { class: "cn-help__section-title" }, "内置交互", -1), m("ul", R, [(t(), s(l, null, p(C, (e) => m("li", {
|
|
80
|
+
key: e.gesture,
|
|
81
|
+
class: "cn-help__row",
|
|
82
|
+
"data-help-interaction": ""
|
|
83
|
+
}, [m("span", z, n(e.text), 1), m("kbd", B, n(e.gesture), 1)])), 64))])])])])], 32)) : d("", !0)]));
|
|
84
|
+
}
|
|
85
|
+
}), [["__scopeId", "data-v-486e5be3"]]);
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/shared/useHistory.ts
|
|
88
|
+
function H(t) {
|
|
89
|
+
let n = e(t.store.canUndo), r = e(t.store.canRedo), a = t.subscribe((e) => {
|
|
90
|
+
e.scope === "doc" && (n.value = t.store.canUndo, r.value = t.store.canRedo);
|
|
91
|
+
});
|
|
92
|
+
return i(a, !0), {
|
|
93
|
+
canUndo: h(() => n.value),
|
|
94
|
+
canRedo: h(() => r.value)
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/shared/useShortcuts.ts
|
|
99
|
+
var U = new Set(Object.keys(D));
|
|
100
|
+
function W(e) {
|
|
101
|
+
let t = O(), n = E(), r = (r) => {
|
|
102
|
+
let i = b({
|
|
103
|
+
key: r.key,
|
|
104
|
+
mod: r.ctrlKey || r.metaKey,
|
|
105
|
+
shift: r.shiftKey,
|
|
106
|
+
alt: r.altKey,
|
|
107
|
+
code: r.code,
|
|
108
|
+
composing: r.isComposing || r.keyCode === 229,
|
|
109
|
+
editing: e.store.ui.editing !== null,
|
|
110
|
+
editableTarget: C(r.target)
|
|
111
|
+
});
|
|
112
|
+
if (i !== null) {
|
|
113
|
+
if (r.preventDefault(), i === "helpShortcuts") {
|
|
114
|
+
t.toggle();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
e.executeShortcut(i), U.has(i) && n.show(T);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
window.addEventListener("keydown", r), i(() => window.removeEventListener("keydown", r), !0);
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { H as n, V as r, W as t };
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./completionAnchor-4lhR2kJz.js";
|
|
2
|
+
import { n as i, o as a, r as o, s, t as c } from "./useTransientFeedback-gS9Xa9GY.js";
|
|
3
|
+
import { i as l, n as u, r as d, t as f } from "./uploadFile-CutE_xI-.js";
|
|
4
|
+
import { n as p, t as m } from "./usePathCompletion-DkHoGla4.js";
|
|
5
|
+
import { n as h, t as g } from "./useViewport-BLe2ise1.js";
|
|
6
|
+
import { n as _, r as v, t as y } from "./useDataSourceSchema-C924m8fc.js";
|
|
7
|
+
import { t as b } from "./useShortcutsHelp-DTC3yRil.js";
|
|
8
|
+
import { n as x, r as S, t as C } from "./shared-D9zYUQaw.js";
|
|
9
|
+
export { o as ARM_LAYER_CREATE_HINT, _ as DropdownMenu, n as ExpressionCompletionPopup, S as HelpDialog, e as PanelIcon, t as applyCompletion, a as detectShortcutPlatform, d as expressionCompletionSource, l as expressionFieldContext, i as isEditableEventTarget, r as measureCursorAnchor, p as rowsPathCompletionSource, s as shortcutActionLabel, f as uploadFileFromDom, y as useDataSourceSchema, v as useDropdownMenu, u as useExpressionCompletion, x as useHistory, m as usePathCompletion, h as useSelection, C as useShortcuts, b as useShortcutsHelp, c as useTransientFeedback, g as useViewport };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EditorSession } from '@hankchen/canvas-editor';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: EditorSession;
|
|
4
|
+
pendingCount?: number;
|
|
5
|
+
/** 宿主注入的资源状态文案(资源就绪/物化中 N/失败 N 项);空串隐藏 */
|
|
6
|
+
resourceNote?: string;
|
|
7
|
+
/** 宿主注入的保存态;未接线(undefined)隐藏 */
|
|
8
|
+
saveState?: 'dirty' | 'clean';
|
|
9
|
+
/** 宿主注入的瞬时反馈文案(保存/打开/导出/上传/schema 动作结果与错误);空串隐藏 */
|
|
10
|
+
feedback?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
pendingCount: number;
|
|
14
|
+
resourceNote: string;
|
|
15
|
+
feedback: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 状态栏域出口:全壳读数归口(playground-canvas-first 工单 01)——缩放/选中路径/
|
|
3
|
+
* 坐标尺寸/物化进行数/schema 声明态/保存态/瞬时反馈。物化计数与资源/保存/反馈
|
|
4
|
+
* 文案经宿主注入(红线禁直连 browser-renderer),坐标与 schema 段组件内部直读
|
|
5
|
+
* 内核切片。图层路径/坐标展示格式化随段导出。
|
|
6
|
+
*/
|
|
7
|
+
export { formatLayerPath } from './layerPathLabel';
|
|
8
|
+
export { formatLayerGeometry } from './layerGeometryLabel';
|
|
9
|
+
export { default as StatusBar } from './StatusBar';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Anchor } from '@hankchen/canvas-editor';
|
|
2
|
+
/** 坐标段入参的最小结构:文档 position(LayerPosition 的 position 字段子集) */
|
|
3
|
+
export interface GeometryPosition {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly anchor: Anchor;
|
|
7
|
+
}
|
|
8
|
+
/** 坐标段入参的最小结构:解析盒(LayerBox 子集,只消费宽高) */
|
|
9
|
+
export interface GeometryBox {
|
|
10
|
+
readonly width: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatLayerGeometry(position: GeometryPosition, box: GeometryBox): string;
|