Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"js-md5": "^0.7.3",
"jszip": "^3.10.1",
"lodash-es": "4.17.21",
"marked": "^17.0.3",
"mitt": "^3.0.1",
"monaco-editor": "0.52.2",
"page-flip": "^2.0.7",
Expand Down
6 changes: 0 additions & 6 deletions apps/app/public/cdn/extend/marked.min.js

This file was deleted.

14 changes: 7 additions & 7 deletions apps/app/public/lib/sdk/hooks.bundled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7508,14 +7508,14 @@ declare const ftiframeOptionSchema: z.ZodObject<{
type FtiframeOption = z.infer<typeof ftiframeOptionSchema>;

import { z } from 'zod';
declare const ftimgDataSchema: z.ZodArray<z.ZodObject<{
declare const swimgDataSchema: z.ZodArray<z.ZodObject<{
value: z.ZodString;
}, z.core.$strip>>;
type FtimgData = z.infer<typeof ftimgDataSchema>;
type SwimgData = z.infer<typeof swimgDataSchema>;
/**
* 图片配置选项 Schema
*/
declare const ftimgOptionSchema: z.ZodObject<{
declare const swimgOptionSchema: z.ZodObject<{
cover: z.ZodString;
url: z.ZodString;
duration: z.ZodString;
Expand Down Expand Up @@ -7576,7 +7576,7 @@ declare const ftimgOptionSchema: z.ZodObject<{
backdropFilterBlur: z.ZodNumber;
backdropFilterSaturate: z.ZodNumber;
}, z.core.$strip>;
type FtimgOption = z.infer<typeof ftimgOptionSchema>;
type SwimgOption = z.infer<typeof swimgOptionSchema>;

import { z } from 'zod';
/**
Expand Down Expand Up @@ -19322,7 +19322,7 @@ declare enum MediaEnum {
/** iframe */
FtIframe = "swiframe",
/** 图片 */
FtImg = "swimg",
SwImg = "swimg",
/** 视频播放器 */
FtOpenVideo = "sw-open-video",
/** 图片边框 */
Expand Down Expand Up @@ -19401,13 +19401,13 @@ declare enum TextEnum {
/** 自定义折叠面板 */
CustomCollapse = "customCollapse",
/** 富文本 */
FtRichtext = "swRichtext",
SwRichtext = "swRichtext",
/** 集合组件 */
FtCollection = "swcollection",
/** 自定义表格列表 */
CustomTableList = "customTableList",
/** 文本词云 */
FtTextWordCloud = "swTextWordCloud",
SwTextWordCloud = "swTextWordCloud",
/** 多行文本 */
FtMultiLine = "swmultiLine",
/** 基础文本 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("自动属性组推导功能", () => {
afterEach(() => {
testUtils.cleanupTestEnvironment();
});
it("应该为 FtImg 组件推导出正确的属性组", () => {
it("应该为 SwImg 组件推导出正确的属性组", () => {
const groups = getComponentPropertyGroups(mediaEnum.SwImg);

// 验证包含所有预期的属性组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const useFigmaToBI = createGlobalState(() => {

/**
* 将组件的 Figma 图片 URL 上传到 MinIO,返回上传后的新 URL。
* 仅处理 FtImg 类型组件且 URL 为内网地址的情况,其他情况返回 null。
* 仅处理 SwImg 类型组件且 URL 为内网地址的情况,其他情况返回 null。
*
* @param component - 需要上传图片的 BI 组件
* @returns 上传成功后的 MinIO URL,失败或不需要上传时返回 null
Expand Down
1 change: 1 addition & 0 deletions packages/material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@screenwright/composables": "workspace:*",
"@screenwright/core": "workspace:*",
"@screenwright/types": "workspace:*",
"@tiptap/core": "3.31.3",
"@tiptap/extension-color": "3.31.3",
"@tiptap/extension-font-family": "3.31.3",
"@tiptap/extension-text-align": "3.31.3",
Expand Down
14 changes: 7 additions & 7 deletions packages/types/src/schemas/components/media/swimg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";

/**
* 图片 (ftimg)
* 图片 (swimg)
* 媒体
*
* ## 数据结构
Expand All @@ -11,28 +11,28 @@ import { z } from "zod";
*
* @example
* ```typescript
* const data: FtimgData = [
* const data: SwimgData = [
* { value: "image.png" }
* ];
* ```
*/

// Single data item Schema
const ftimgDataItemSchema = z.object({
const swimgDataItemSchema = z.object({
value: z.string().describe("图片地址")
});

// Data array Schema
export const ftimgDataSchema = z.array(ftimgDataItemSchema);
export const swimgDataSchema = z.array(swimgDataItemSchema);

export type FtimgData = z.infer<typeof ftimgDataSchema>;
export type SwimgData = z.infer<typeof swimgDataSchema>;

// ==================== Option Schema ====================

/**
* 图片配置选项 Schema
*/
export const ftimgOptionSchema = z.object({
export const swimgOptionSchema = z.object({
// ============ 基础配置 ============
cover: z.string().describe("图片封面地址"),
url: z.string().describe("图片地址"),
Expand Down Expand Up @@ -107,4 +107,4 @@ export const ftimgOptionSchema = z.object({
backdropFilterSaturate: z.number().describe("背景饱和度")
});

export type FtimgOption = z.infer<typeof ftimgOptionSchema>;
export type SwimgOption = z.infer<typeof swimgOptionSchema>;
4 changes: 2 additions & 2 deletions packages/types/src/schemas/components/propSchemaMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import { ctVideoPanelDataSchema, ctVideoPanelOptionSchema } from "./media/ctVide
import { swEmbedAudioDataSchema, swEmbedAudioOptionSchema } from "./media/sw-embed-audio";
import { swOpenVideoDataSchema, swOpenVideoOptionSchema } from "./media/sw-open-video";
import { ftiframeDataSchema, ftiframeOptionSchema } from "./media/swiframe";
import { ftimgDataSchema, ftimgOptionSchema } from "./media/swimg";
import { swimgDataSchema, swimgOptionSchema } from "./media/swimg";
import { ftswiperDataSchema, ftswiperOptionSchema } from "./media/swswiper";
import { swSwiperCardDataSchema, swSwiperCardOptionSchema } from "./media/swSwiperCard";
import { ftvideoDataSchema, ftvideoOptionSchema } from "./media/swvideo";
Expand Down Expand Up @@ -156,7 +156,7 @@ export const componentPropSchemaMap = {
rasterProgressBar: { data: rasterProgressBarDataSchema, option: rasterProgressBarOptionSchema },
"sw-embed-audio": { data: swEmbedAudioDataSchema, option: swEmbedAudioOptionSchema },
swiframe: { data: ftiframeDataSchema, option: ftiframeOptionSchema },
swimg: { data: ftimgDataSchema, option: ftimgOptionSchema },
swimg: { data: swimgDataSchema, option: swimgOptionSchema },
"sw-open-video": { data: swOpenVideoDataSchema, option: swOpenVideoOptionSchema },
swSwiperCard: { data: swSwiperCardDataSchema, option: swSwiperCardOptionSchema },
swswiper: { data: ftswiperDataSchema, option: ftswiperOptionSchema },
Expand Down
8 changes: 4 additions & 4 deletions packages/types/src/schemas/components/text/swRichtext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";

/**
* 富文本 (ftRichtext)
* 富文本 (swRichtext)
* 文字
*
* ## 数据结构
Expand All @@ -11,7 +11,7 @@ import { z } from "zod";
*
* @example
* ```typescript
* const data: FtRichtextData = [
* const data: SwRichtextData = [
* { value: "<p>这是<strong>富文本</strong>内容</p>" }
* ];
* ```
Expand All @@ -25,7 +25,7 @@ const swRichtextDataItemSchema = z.object({
// 数据数组 Schema
export const swRichtextDataSchema = z.array(swRichtextDataItemSchema);

export type FtRichtextData = z.infer<typeof swRichtextDataSchema>;
export type SwRichtextData = z.infer<typeof swRichtextDataSchema>;

// ==================== Option Schema ====================

Expand All @@ -47,4 +47,4 @@ export const swRichtextOptionSchema = z.object({
scrollInterval: z.number().describe("滚动间隔")
});

export type FtRichtextOption = z.infer<typeof swRichtextOptionSchema>;
export type SwRichtextOption = z.infer<typeof swRichtextOptionSchema>;
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions servers/server/agent-workspace/types/hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ declare const ComponentFlatSchema: z.ZodObject<{
swSwiperCard: import("..").MediaEnum.FtSwiperCard;
"sw-embed-audio": import("..").MediaEnum.FtEmbedAudio;
swiframe: import("..").MediaEnum.FtIframe;
swimg: import("..").MediaEnum.FtImg;
swimg: import("..").MediaEnum.SwImg;
"sw-open-video": import("..").MediaEnum.FtOpenVideo;
swimgBorder: import("..").MediaEnum.FtImgBorder;
swimgBorder: import("..").MediaEnum.SwImgBorder;
swswiper: import("..").MediaEnum.FtSwiper;
swSwiperV3: import("..").MediaEnum.FtSwiperV3;
swvideo: import("..").MediaEnum.FtVideo;
Expand Down Expand Up @@ -179,10 +179,10 @@ declare const ComponentFlatSchema: z.ZodObject<{
videoProgress: import("..").InteractiveEnum.videoProgress;
}>, z.ZodEnum<{
customCollapse: import("..").TextEnum.CustomCollapse;
swRichtext: import("..").TextEnum.FtRichtext;
swRichtext: import("..").TextEnum.SwRichtext;
swcollection: import("..").TextEnum.FtCollection;
customTableList: import("..").TextEnum.CustomTableList;
swTextWordCloud: import("..").TextEnum.FtTextWordCloud;
swTextWordCloud: import("..").TextEnum.SwTextWordCloud;
swmultiLine: import("..").TextEnum.FtMultiLine;
swtext: import("..").TextEnum.FtText;
swProgress: import("..").TextEnum.FtProgress;
Expand Down Expand Up @@ -7511,14 +7511,14 @@ declare const ftiframeOptionSchema: z.ZodObject<{
type FtiframeOption = z.infer<typeof ftiframeOptionSchema>;

import { z } from 'zod';
declare const ftimgDataSchema: z.ZodArray<z.ZodObject<{
declare const swimgDataSchema: z.ZodArray<z.ZodObject<{
value: z.ZodString;
}, z.core.$strip>>;
type FtimgData = z.infer<typeof ftimgDataSchema>;
type SwimgData = z.infer<typeof swimgDataSchema>;
/**
* 图片配置选项 Schema
*/
declare const ftimgOptionSchema: z.ZodObject<{
declare const swimgOptionSchema: z.ZodObject<{
cover: z.ZodString;
url: z.ZodString;
duration: z.ZodString;
Expand Down Expand Up @@ -7579,7 +7579,7 @@ declare const ftimgOptionSchema: z.ZodObject<{
backdropFilterBlur: z.ZodNumber;
backdropFilterSaturate: z.ZodNumber;
}, z.core.$strip>;
type FtimgOption = z.infer<typeof ftimgOptionSchema>;
type SwimgOption = z.infer<typeof swimgOptionSchema>;

import { z } from 'zod';
/**
Expand Down Expand Up @@ -16589,9 +16589,9 @@ declare const mediaEnumSchema: z.ZodEnum<{
swSwiperCard: import("..").MediaEnum.FtSwiperCard;
"sw-embed-audio": import("..").MediaEnum.FtEmbedAudio;
swiframe: import("..").MediaEnum.FtIframe;
swimg: import("..").MediaEnum.FtImg;
swimg: import("..").MediaEnum.SwImg;
"sw-open-video": import("..").MediaEnum.FtOpenVideo;
swimgBorder: import("..").MediaEnum.FtImgBorder;
swimgBorder: import("..").MediaEnum.SwImgBorder;
swswiper: import("..").MediaEnum.FtSwiper;
swSwiperV3: import("..").MediaEnum.FtSwiperV3;
swvideo: import("..").MediaEnum.FtVideo;
Expand Down Expand Up @@ -16649,10 +16649,10 @@ declare const interactiveEnumSchema: z.ZodEnum<{
/** 文本类型枚举 Schema */
declare const textEnumSchema: z.ZodEnum<{
customCollapse: import("..").TextEnum.CustomCollapse;
swRichtext: import("..").TextEnum.FtRichtext;
swRichtext: import("..").TextEnum.SwRichtext;
swcollection: import("..").TextEnum.FtCollection;
customTableList: import("..").TextEnum.CustomTableList;
swTextWordCloud: import("..").TextEnum.FtTextWordCloud;
swTextWordCloud: import("..").TextEnum.SwTextWordCloud;
swmultiLine: import("..").TextEnum.FtMultiLine;
swtext: import("..").TextEnum.FtText;
swProgress: import("..").TextEnum.FtProgress;
Expand Down Expand Up @@ -16752,9 +16752,9 @@ declare const allComponentTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
swSwiperCard: import("..").MediaEnum.FtSwiperCard;
"sw-embed-audio": import("..").MediaEnum.FtEmbedAudio;
swiframe: import("..").MediaEnum.FtIframe;
swimg: import("..").MediaEnum.FtImg;
swimg: import("..").MediaEnum.SwImg;
"sw-open-video": import("..").MediaEnum.FtOpenVideo;
swimgBorder: import("..").MediaEnum.FtImgBorder;
swimgBorder: import("..").MediaEnum.SwImgBorder;
swswiper: import("..").MediaEnum.FtSwiper;
swSwiperV3: import("..").MediaEnum.FtSwiperV3;
swvideo: import("..").MediaEnum.FtVideo;
Expand Down Expand Up @@ -16816,10 +16816,10 @@ declare const allComponentTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
videoProgress: import("..").InteractiveEnum.videoProgress;
}>, z.ZodEnum<{
customCollapse: import("..").TextEnum.CustomCollapse;
swRichtext: import("..").TextEnum.FtRichtext;
swRichtext: import("..").TextEnum.SwRichtext;
swcollection: import("..").TextEnum.FtCollection;
customTableList: import("..").TextEnum.CustomTableList;
swTextWordCloud: import("..").TextEnum.FtTextWordCloud;
swTextWordCloud: import("..").TextEnum.SwTextWordCloud;
swmultiLine: import("..").TextEnum.FtMultiLine;
swtext: import("..").TextEnum.FtText;
swProgress: import("..").TextEnum.FtProgress;
Expand Down Expand Up @@ -18476,7 +18476,7 @@ interface FtProgressEvents {
};
}
interface FtTextWordCloudEvents {
[key: `${TextEnum.FtTextWordCloud}-${string}`]: {
[key: `${TextEnum.SwTextWordCloud}-${string}`]: {
/**
* @description 点击事件
*/
Expand Down Expand Up @@ -19384,7 +19384,7 @@ declare enum MediaEnum {
/** iframe */
FtIframe = "swiframe",
/** 图片 */
FtImg = "swimg",
SwImg = "swimg",
/** 视频播放器 */
FtOpenVideo = "sw-open-video",
/** 图片边框 */
Expand Down Expand Up @@ -19463,13 +19463,13 @@ declare enum TextEnum {
/** 自定义折叠面板 */
CustomCollapse = "customCollapse",
/** 富文本 */
FtRichtext = "swRichtext",
SwRichtext = "swRichtext",
/** 集合组件 */
FtCollection = "swcollection",
/** 自定义表格列表 */
CustomTableList = "customTableList",
/** 文本词云 */
FtTextWordCloud = "swTextWordCloud",
SwTextWordCloud = "swTextWordCloud",
/** 多行文本 */
FtMultiLine = "swmultiLine",
/** 基础文本 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const a1CreateComponent: EvalCase = {

assert: (ctx): Assertion[] => {
const created = newComponents(ctx.before, ctx.screen);
const wordClouds = hasProp(created, TextEnum.FtTextWordCloud);
const wordClouds = hasProp(created, TextEnum.SwTextWordCloud);

return [
{
Expand All @@ -48,7 +48,7 @@ export const a1CreateComponent: EvalCase = {
detail:
wordClouds.length > 0
? `id=${wordClouds.map((c) => c.id).join(",")}`
: `新增组件的类型是 ${created.map((c) => c.component.prop).join(", ") || "(无)"},期望含 ${TextEnum.FtTextWordCloud}`
: `新增组件的类型是 ${created.map((c) => c.component.prop).join(", ") || "(无)"},期望含 ${TextEnum.SwTextWordCloud}`
},
// 位置不较真「是不是在左边」——那是审美判断,agent 每次给的值都不一样。
// 真正会坏事的是把组件放到画布外面,那是能精确判定的。
Expand Down
6 changes: 3 additions & 3 deletions servers/server/src/mastra/state/componentConversionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { ComponentType } from "@screenwright/types";
import { FolderEnum, PanelEnum } from "@screenwright/types";
import { z } from "zod";

import type { FtImg } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/FtImgStrategy";
import type { SwImg } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/SwImgStrategy";
import {
createPanelState,
type FtPanel
} from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/FtPanelStrategy";
import type { FtRichtext } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/FtRichtextStrategy";
import type { SwRichtext } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/SwRichtextStrategy";
import type { FtSubtabs } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/FtSubtabStrategy";
import type { Group } from "@/mastra/workflows/figma-to-bi/steps/node-convert/strategies/GroupStrategy";

Expand All @@ -17,7 +17,7 @@ import type { IValueStore } from "./stateManager";
/**
* 支持的组件类型联合
*/
export type ConvertedComponent = FtRichtext | FtImg | Group | FtPanel | FtSubtabs;
export type ConvertedComponent = SwRichtext | SwImg | Group | FtPanel | FtSubtabs;

/**
* 组件转换条目
Expand Down
4 changes: 2 additions & 2 deletions servers/server/src/mastra/state/nodeClassificationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const nodeClassificationSchema = z.object({
.enum([
PanelEnum.dynamicPanel,
FolderEnum.group,
MediaEnum.FtImg,
TextEnum.FtRichtext,
MediaEnum.SwImg,
TextEnum.SwRichtext,
InteractiveEnum.Subtabs,
"merge",
"root"
Expand Down
Loading
Loading