@inf-monkeys-tech/monkeys-design 0.4.50 → 0.4.52
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 -21
- package/README.md +335 -335
- package/dist/components/base/index.js +1 -1
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +1 -1
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/layout/index.js +5 -5
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +5 -5
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/login/index.js.map +1 -1
- package/dist/components/login/index.mjs.map +1 -1
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/toast/index.mjs.map +1 -1
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/toolbar/index.mjs.map +1 -1
- package/dist/components/workbench/index.js +1 -1
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +1 -1
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/icons/oauth/index.js.map +1 -1
- package/dist/icons/oauth/index.mjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/palette/index.js.map +1 -1
- package/dist/palette/index.mjs.map +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/index.mjs.map +1 -1
- package/dist/styles/global.scss +21 -21
- package/dist/styles/login-page.scss +518 -518
- package/dist/styles/workflow-board.scss +440 -440
- package/dist/styles/workflow-nodes.css +340 -340
- package/dist/theme-system/index.js +1 -1
- package/dist/theme-system/index.js.map +1 -1
- package/dist/theme-system/index.mjs +1 -1
- package/dist/theme-system/index.mjs.map +1 -1
- package/dist/themes/artist/index.js.map +1 -1
- package/dist/themes/artist/index.mjs.map +1 -1
- package/dist/themes/bsd/index.js.map +1 -1
- package/dist/themes/bsd/index.mjs.map +1 -1
- package/dist/themes/concept/index.js.map +1 -1
- package/dist/themes/concept/index.mjs.map +1 -1
- package/dist/themes/default/index.js.map +1 -1
- package/dist/themes/default/index.mjs.map +1 -1
- package/package.json +151 -151
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/registry/index.ts"],"names":[],"mappings":";;;AAIA,IAAM,aAAgD,EAAC;AAGvD,IAAM,eAA4C,EAAC;AAQ5C,SAAS,aAAA,CACd,OAAA,EACA,UAAA,EACA,MAAA,EACM;AACN,EAAA,UAAA,CAAW,OAAO,IAAI,EAAE,GAAG,WAAW,OAAO,CAAA,EAAG,GAAG,UAAA,EAAW;AAE9D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,YAAA,CAAa,OAAO,CAAA,GAAI,EAAE,EAAA,EAAI,OAAA,EAAS,GAAG,MAAA,EAAO;AAAA,EACnD;AACF;AAQO,SAAS,iBAAA,CACd,OAAA,EACA,aAAA,EACA,SAAA,EACM;AACN,EAAA,IAAI,CAAC,UAAA,CAAW,OAAO,CAAA,EAAG;AACxB,IAAA,UAAA,CAAW,OAAO,IAAI,EAAC;AAAA,EACzB;AACA,EAAA,UAAA,CAAW,OAAO,CAAA,CAAE,aAAa,CAAA,GAAI,SAAA;AACvC;AAQO,SAAS,gBAAA,CACd,SACA,aAAA,EACyB;AAEzB,EAAA,MAAM,cAAA,GAAiB,UAAA,CAAW,OAAO,CAAA,GAAI,aAAa,CAAA;AAC1D,EAAA,IAAI,cAAA,EAAgB;AAClB,IAAA,OAAO,cAAA;AAAA,EACT;AAGA,EAAA,MAAM,gBAAA,GAAmB,UAAA,CAAW,SAAS,CAAA,GAAI,aAAa,CAAA;AAC9D,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,OAAO,gBAAA;AAAA,EACT;AAGA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,kBAAA,CAAmB,SAAiB,aAAA,EAAgC;AAClF,EAAA,OAAO,CAAC,CAAC,UAAA,CAAW,OAAO,IAAI,aAAa,CAAA;AAC9C;AAMO,SAAS,wBAAwB,OAAA,EAA2B;AACjE,EAAA,OAAO,OAAO,IAAA,CAAK,UAAA,CAAW,OAAO,CAAA,IAAK,EAAE,CAAA;AAC9C;AAKO,SAAS,mBAAA,GAAgC;AAC9C,EAAA,OAAO,MAAA,CAAO,KAAK,UAAU,CAAA;AAC/B;AAMO,SAAS,eAAe,OAAA,EAAqC;AAClE,EAAA,OAAO,YAAA,CAAa,OAAO,CAAA,IAAK,IAAA;AAClC;AAKO,SAAS,aAAA,GAAsB;AACpC,EAAA,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAC/D,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,YAAA,CAAa,GAAG,CAAC,CAAA;AACrE","file":"index.js","sourcesContent":["import type { ComponentType } from 'react';\nimport type { ComponentRegistry, ThemeConfig } from '../types';\n\n// 存储所有主题的组件注册表\nconst registries: Record<string, ComponentRegistry> = {};\n\n// 存储主题配置\nconst themeConfigs: Record<string, ThemeConfig> = {};\n\n/**\n * 注册主题组件\n * @param themeId 主题 ID (如 'bsd', 'artist', 'concept')\n * @param components 组件注册表\n * @param config 主题配置(可选)\n */\nexport function registerTheme(\n themeId: string,\n components: ComponentRegistry,\n config?: Omit<ThemeConfig, 'id'>\n): void {\n registries[themeId] = { ...registries[themeId], ...components };\n\n if (config) {\n themeConfigs[themeId] = { id: themeId, ...config };\n }\n}\n\n/**\n * 注册单个组件到指定主题\n * @param themeId 主题 ID\n * @param componentName 组件名称\n * @param component 组件\n */\nexport function registerComponent(\n themeId: string,\n componentName: string,\n component: ComponentType<any>\n): void {\n if (!registries[themeId]) {\n registries[themeId] = {};\n }\n registries[themeId][componentName] = component;\n}\n\n/**\n * 解析组件 - 优先使用主题特定组件,fallback 到 default\n * @param themeId 主题 ID\n * @param componentName 组件名称\n * @returns 组件或 null\n */\nexport function resolveComponent<P = any>(\n themeId: string,\n componentName: string\n): ComponentType<P> | null {\n // 1. 先尝试获取主题特定组件\n const themeComponent = registries[themeId]?.[componentName];\n if (themeComponent) {\n return themeComponent as ComponentType<P>;\n }\n\n // 2. Fallback 到 default 主题\n const defaultComponent = registries['default']?.[componentName];\n if (defaultComponent) {\n return defaultComponent as ComponentType<P>;\n }\n\n // 3. 未找到\n return null;\n}\n\n/**\n * 检查主题是否有特定组件的定制版本\n * @param themeId 主题 ID\n * @param componentName 组件名称\n */\nexport function hasCustomComponent(themeId: string, componentName: string): boolean {\n return !!registries[themeId]?.[componentName];\n}\n\n/**\n * 获取主题的所有已注册组件名称\n * @param themeId 主题 ID\n */\nexport function getRegisteredComponents(themeId: string): string[] {\n return Object.keys(registries[themeId] || {});\n}\n\n/**\n * 获取所有已注册的主题 ID\n */\nexport function getRegisteredThemes(): string[] {\n return Object.keys(registries);\n}\n\n/**\n * 获取主题配置\n * @param themeId 主题 ID\n */\nexport function getThemeConfig(themeId: string): ThemeConfig | null {\n return themeConfigs[themeId] || null;\n}\n\n/**\n * 清除所有注册(主要用于测试)\n */\nexport function clearRegistry(): void {\n Object.keys(registries).forEach((key) => delete registries[key]);\n Object.keys(themeConfigs).forEach((key) => delete themeConfigs[key]);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/registry/index.ts"],"names":[],"mappings":";;;AAIA,IAAM,aAAgD,EAAC;AAGvD,IAAM,eAA4C,EAAC;AAQ5C,SAAS,aAAA,CACd,OAAA,EACA,UAAA,EACA,MAAA,EACM;AACN,EAAA,UAAA,CAAW,OAAO,IAAI,EAAE,GAAG,WAAW,OAAO,CAAA,EAAG,GAAG,UAAA,EAAW;AAE9D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,YAAA,CAAa,OAAO,CAAA,GAAI,EAAE,EAAA,EAAI,OAAA,EAAS,GAAG,MAAA,EAAO;AAAA,EACnD;AACF;AAQO,SAAS,iBAAA,CACd,OAAA,EACA,aAAA,EACA,SAAA,EACM;AACN,EAAA,IAAI,CAAC,UAAA,CAAW,OAAO,CAAA,EAAG;AACxB,IAAA,UAAA,CAAW,OAAO,IAAI,EAAC;AAAA,EACzB;AACA,EAAA,UAAA,CAAW,OAAO,CAAA,CAAE,aAAa,CAAA,GAAI,SAAA;AACvC;AAQO,SAAS,gBAAA,CACd,SACA,aAAA,EACyB;AAEzB,EAAA,MAAM,cAAA,GAAiB,UAAA,CAAW,OAAO,CAAA,GAAI,aAAa,CAAA;AAC1D,EAAA,IAAI,cAAA,EAAgB;AAClB,IAAA,OAAO,cAAA;AAAA,EACT;AAGA,EAAA,MAAM,gBAAA,GAAmB,UAAA,CAAW,SAAS,CAAA,GAAI,aAAa,CAAA;AAC9D,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,OAAO,gBAAA;AAAA,EACT;AAGA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,kBAAA,CAAmB,SAAiB,aAAA,EAAgC;AAClF,EAAA,OAAO,CAAC,CAAC,UAAA,CAAW,OAAO,IAAI,aAAa,CAAA;AAC9C;AAMO,SAAS,wBAAwB,OAAA,EAA2B;AACjE,EAAA,OAAO,OAAO,IAAA,CAAK,UAAA,CAAW,OAAO,CAAA,IAAK,EAAE,CAAA;AAC9C;AAKO,SAAS,mBAAA,GAAgC;AAC9C,EAAA,OAAO,MAAA,CAAO,KAAK,UAAU,CAAA;AAC/B;AAMO,SAAS,eAAe,OAAA,EAAqC;AAClE,EAAA,OAAO,YAAA,CAAa,OAAO,CAAA,IAAK,IAAA;AAClC;AAKO,SAAS,aAAA,GAAsB;AACpC,EAAA,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAC/D,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,YAAA,CAAa,GAAG,CAAC,CAAA;AACrE","file":"index.js","sourcesContent":["import type { ComponentType } from 'react';\r\nimport type { ComponentRegistry, ThemeConfig } from '../types';\r\n\r\n// 存储所有主题的组件注册表\r\nconst registries: Record<string, ComponentRegistry> = {};\r\n\r\n// 存储主题配置\r\nconst themeConfigs: Record<string, ThemeConfig> = {};\r\n\r\n/**\r\n * 注册主题组件\r\n * @param themeId 主题 ID (如 'bsd', 'artist', 'concept')\r\n * @param components 组件注册表\r\n * @param config 主题配置(可选)\r\n */\r\nexport function registerTheme(\r\n themeId: string,\r\n components: ComponentRegistry,\r\n config?: Omit<ThemeConfig, 'id'>\r\n): void {\r\n registries[themeId] = { ...registries[themeId], ...components };\r\n\r\n if (config) {\r\n themeConfigs[themeId] = { id: themeId, ...config };\r\n }\r\n}\r\n\r\n/**\r\n * 注册单个组件到指定主题\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n * @param component 组件\r\n */\r\nexport function registerComponent(\r\n themeId: string,\r\n componentName: string,\r\n component: ComponentType<any>\r\n): void {\r\n if (!registries[themeId]) {\r\n registries[themeId] = {};\r\n }\r\n registries[themeId][componentName] = component;\r\n}\r\n\r\n/**\r\n * 解析组件 - 优先使用主题特定组件,fallback 到 default\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n * @returns 组件或 null\r\n */\r\nexport function resolveComponent<P = any>(\r\n themeId: string,\r\n componentName: string\r\n): ComponentType<P> | null {\r\n // 1. 先尝试获取主题特定组件\r\n const themeComponent = registries[themeId]?.[componentName];\r\n if (themeComponent) {\r\n return themeComponent as ComponentType<P>;\r\n }\r\n\r\n // 2. Fallback 到 default 主题\r\n const defaultComponent = registries['default']?.[componentName];\r\n if (defaultComponent) {\r\n return defaultComponent as ComponentType<P>;\r\n }\r\n\r\n // 3. 未找到\r\n return null;\r\n}\r\n\r\n/**\r\n * 检查主题是否有特定组件的定制版本\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n */\r\nexport function hasCustomComponent(themeId: string, componentName: string): boolean {\r\n return !!registries[themeId]?.[componentName];\r\n}\r\n\r\n/**\r\n * 获取主题的所有已注册组件名称\r\n * @param themeId 主题 ID\r\n */\r\nexport function getRegisteredComponents(themeId: string): string[] {\r\n return Object.keys(registries[themeId] || {});\r\n}\r\n\r\n/**\r\n * 获取所有已注册的主题 ID\r\n */\r\nexport function getRegisteredThemes(): string[] {\r\n return Object.keys(registries);\r\n}\r\n\r\n/**\r\n * 获取主题配置\r\n * @param themeId 主题 ID\r\n */\r\nexport function getThemeConfig(themeId: string): ThemeConfig | null {\r\n return themeConfigs[themeId] || null;\r\n}\r\n\r\n/**\r\n * 清除所有注册(主要用于测试)\r\n */\r\nexport function clearRegistry(): void {\r\n Object.keys(registries).forEach((key) => delete registries[key]);\r\n Object.keys(themeConfigs).forEach((key) => delete themeConfigs[key]);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/registry/index.ts"],"names":[],"mappings":";AAIA,IAAM,aAAgD,EAAC;AAGvD,IAAM,eAA4C,EAAC;AAQ5C,SAAS,aAAA,CACd,OAAA,EACA,UAAA,EACA,MAAA,EACM;AACN,EAAA,UAAA,CAAW,OAAO,IAAI,EAAE,GAAG,WAAW,OAAO,CAAA,EAAG,GAAG,UAAA,EAAW;AAE9D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,YAAA,CAAa,OAAO,CAAA,GAAI,EAAE,EAAA,EAAI,OAAA,EAAS,GAAG,MAAA,EAAO;AAAA,EACnD;AACF;AAQO,SAAS,iBAAA,CACd,OAAA,EACA,aAAA,EACA,SAAA,EACM;AACN,EAAA,IAAI,CAAC,UAAA,CAAW,OAAO,CAAA,EAAG;AACxB,IAAA,UAAA,CAAW,OAAO,IAAI,EAAC;AAAA,EACzB;AACA,EAAA,UAAA,CAAW,OAAO,CAAA,CAAE,aAAa,CAAA,GAAI,SAAA;AACvC;AAQO,SAAS,gBAAA,CACd,SACA,aAAA,EACyB;AAEzB,EAAA,MAAM,cAAA,GAAiB,UAAA,CAAW,OAAO,CAAA,GAAI,aAAa,CAAA;AAC1D,EAAA,IAAI,cAAA,EAAgB;AAClB,IAAA,OAAO,cAAA;AAAA,EACT;AAGA,EAAA,MAAM,gBAAA,GAAmB,UAAA,CAAW,SAAS,CAAA,GAAI,aAAa,CAAA;AAC9D,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,OAAO,gBAAA;AAAA,EACT;AAGA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,kBAAA,CAAmB,SAAiB,aAAA,EAAgC;AAClF,EAAA,OAAO,CAAC,CAAC,UAAA,CAAW,OAAO,IAAI,aAAa,CAAA;AAC9C;AAMO,SAAS,wBAAwB,OAAA,EAA2B;AACjE,EAAA,OAAO,OAAO,IAAA,CAAK,UAAA,CAAW,OAAO,CAAA,IAAK,EAAE,CAAA;AAC9C;AAKO,SAAS,mBAAA,GAAgC;AAC9C,EAAA,OAAO,MAAA,CAAO,KAAK,UAAU,CAAA;AAC/B;AAMO,SAAS,eAAe,OAAA,EAAqC;AAClE,EAAA,OAAO,YAAA,CAAa,OAAO,CAAA,IAAK,IAAA;AAClC;AAKO,SAAS,aAAA,GAAsB;AACpC,EAAA,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAC/D,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,YAAA,CAAa,GAAG,CAAC,CAAA;AACrE","file":"index.mjs","sourcesContent":["import type { ComponentType } from 'react';\nimport type { ComponentRegistry, ThemeConfig } from '../types';\n\n// 存储所有主题的组件注册表\nconst registries: Record<string, ComponentRegistry> = {};\n\n// 存储主题配置\nconst themeConfigs: Record<string, ThemeConfig> = {};\n\n/**\n * 注册主题组件\n * @param themeId 主题 ID (如 'bsd', 'artist', 'concept')\n * @param components 组件注册表\n * @param config 主题配置(可选)\n */\nexport function registerTheme(\n themeId: string,\n components: ComponentRegistry,\n config?: Omit<ThemeConfig, 'id'>\n): void {\n registries[themeId] = { ...registries[themeId], ...components };\n\n if (config) {\n themeConfigs[themeId] = { id: themeId, ...config };\n }\n}\n\n/**\n * 注册单个组件到指定主题\n * @param themeId 主题 ID\n * @param componentName 组件名称\n * @param component 组件\n */\nexport function registerComponent(\n themeId: string,\n componentName: string,\n component: ComponentType<any>\n): void {\n if (!registries[themeId]) {\n registries[themeId] = {};\n }\n registries[themeId][componentName] = component;\n}\n\n/**\n * 解析组件 - 优先使用主题特定组件,fallback 到 default\n * @param themeId 主题 ID\n * @param componentName 组件名称\n * @returns 组件或 null\n */\nexport function resolveComponent<P = any>(\n themeId: string,\n componentName: string\n): ComponentType<P> | null {\n // 1. 先尝试获取主题特定组件\n const themeComponent = registries[themeId]?.[componentName];\n if (themeComponent) {\n return themeComponent as ComponentType<P>;\n }\n\n // 2. Fallback 到 default 主题\n const defaultComponent = registries['default']?.[componentName];\n if (defaultComponent) {\n return defaultComponent as ComponentType<P>;\n }\n\n // 3. 未找到\n return null;\n}\n\n/**\n * 检查主题是否有特定组件的定制版本\n * @param themeId 主题 ID\n * @param componentName 组件名称\n */\nexport function hasCustomComponent(themeId: string, componentName: string): boolean {\n return !!registries[themeId]?.[componentName];\n}\n\n/**\n * 获取主题的所有已注册组件名称\n * @param themeId 主题 ID\n */\nexport function getRegisteredComponents(themeId: string): string[] {\n return Object.keys(registries[themeId] || {});\n}\n\n/**\n * 获取所有已注册的主题 ID\n */\nexport function getRegisteredThemes(): string[] {\n return Object.keys(registries);\n}\n\n/**\n * 获取主题配置\n * @param themeId 主题 ID\n */\nexport function getThemeConfig(themeId: string): ThemeConfig | null {\n return themeConfigs[themeId] || null;\n}\n\n/**\n * 清除所有注册(主要用于测试)\n */\nexport function clearRegistry(): void {\n Object.keys(registries).forEach((key) => delete registries[key]);\n Object.keys(themeConfigs).forEach((key) => delete themeConfigs[key]);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/registry/index.ts"],"names":[],"mappings":";AAIA,IAAM,aAAgD,EAAC;AAGvD,IAAM,eAA4C,EAAC;AAQ5C,SAAS,aAAA,CACd,OAAA,EACA,UAAA,EACA,MAAA,EACM;AACN,EAAA,UAAA,CAAW,OAAO,IAAI,EAAE,GAAG,WAAW,OAAO,CAAA,EAAG,GAAG,UAAA,EAAW;AAE9D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,YAAA,CAAa,OAAO,CAAA,GAAI,EAAE,EAAA,EAAI,OAAA,EAAS,GAAG,MAAA,EAAO;AAAA,EACnD;AACF;AAQO,SAAS,iBAAA,CACd,OAAA,EACA,aAAA,EACA,SAAA,EACM;AACN,EAAA,IAAI,CAAC,UAAA,CAAW,OAAO,CAAA,EAAG;AACxB,IAAA,UAAA,CAAW,OAAO,IAAI,EAAC;AAAA,EACzB;AACA,EAAA,UAAA,CAAW,OAAO,CAAA,CAAE,aAAa,CAAA,GAAI,SAAA;AACvC;AAQO,SAAS,gBAAA,CACd,SACA,aAAA,EACyB;AAEzB,EAAA,MAAM,cAAA,GAAiB,UAAA,CAAW,OAAO,CAAA,GAAI,aAAa,CAAA;AAC1D,EAAA,IAAI,cAAA,EAAgB;AAClB,IAAA,OAAO,cAAA;AAAA,EACT;AAGA,EAAA,MAAM,gBAAA,GAAmB,UAAA,CAAW,SAAS,CAAA,GAAI,aAAa,CAAA;AAC9D,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,OAAO,gBAAA;AAAA,EACT;AAGA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,kBAAA,CAAmB,SAAiB,aAAA,EAAgC;AAClF,EAAA,OAAO,CAAC,CAAC,UAAA,CAAW,OAAO,IAAI,aAAa,CAAA;AAC9C;AAMO,SAAS,wBAAwB,OAAA,EAA2B;AACjE,EAAA,OAAO,OAAO,IAAA,CAAK,UAAA,CAAW,OAAO,CAAA,IAAK,EAAE,CAAA;AAC9C;AAKO,SAAS,mBAAA,GAAgC;AAC9C,EAAA,OAAO,MAAA,CAAO,KAAK,UAAU,CAAA;AAC/B;AAMO,SAAS,eAAe,OAAA,EAAqC;AAClE,EAAA,OAAO,YAAA,CAAa,OAAO,CAAA,IAAK,IAAA;AAClC;AAKO,SAAS,aAAA,GAAsB;AACpC,EAAA,MAAA,CAAO,IAAA,CAAK,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAC/D,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,OAAA,CAAQ,CAAC,GAAA,KAAQ,OAAO,YAAA,CAAa,GAAG,CAAC,CAAA;AACrE","file":"index.mjs","sourcesContent":["import type { ComponentType } from 'react';\r\nimport type { ComponentRegistry, ThemeConfig } from '../types';\r\n\r\n// 存储所有主题的组件注册表\r\nconst registries: Record<string, ComponentRegistry> = {};\r\n\r\n// 存储主题配置\r\nconst themeConfigs: Record<string, ThemeConfig> = {};\r\n\r\n/**\r\n * 注册主题组件\r\n * @param themeId 主题 ID (如 'bsd', 'artist', 'concept')\r\n * @param components 组件注册表\r\n * @param config 主题配置(可选)\r\n */\r\nexport function registerTheme(\r\n themeId: string,\r\n components: ComponentRegistry,\r\n config?: Omit<ThemeConfig, 'id'>\r\n): void {\r\n registries[themeId] = { ...registries[themeId], ...components };\r\n\r\n if (config) {\r\n themeConfigs[themeId] = { id: themeId, ...config };\r\n }\r\n}\r\n\r\n/**\r\n * 注册单个组件到指定主题\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n * @param component 组件\r\n */\r\nexport function registerComponent(\r\n themeId: string,\r\n componentName: string,\r\n component: ComponentType<any>\r\n): void {\r\n if (!registries[themeId]) {\r\n registries[themeId] = {};\r\n }\r\n registries[themeId][componentName] = component;\r\n}\r\n\r\n/**\r\n * 解析组件 - 优先使用主题特定组件,fallback 到 default\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n * @returns 组件或 null\r\n */\r\nexport function resolveComponent<P = any>(\r\n themeId: string,\r\n componentName: string\r\n): ComponentType<P> | null {\r\n // 1. 先尝试获取主题特定组件\r\n const themeComponent = registries[themeId]?.[componentName];\r\n if (themeComponent) {\r\n return themeComponent as ComponentType<P>;\r\n }\r\n\r\n // 2. Fallback 到 default 主题\r\n const defaultComponent = registries['default']?.[componentName];\r\n if (defaultComponent) {\r\n return defaultComponent as ComponentType<P>;\r\n }\r\n\r\n // 3. 未找到\r\n return null;\r\n}\r\n\r\n/**\r\n * 检查主题是否有特定组件的定制版本\r\n * @param themeId 主题 ID\r\n * @param componentName 组件名称\r\n */\r\nexport function hasCustomComponent(themeId: string, componentName: string): boolean {\r\n return !!registries[themeId]?.[componentName];\r\n}\r\n\r\n/**\r\n * 获取主题的所有已注册组件名称\r\n * @param themeId 主题 ID\r\n */\r\nexport function getRegisteredComponents(themeId: string): string[] {\r\n return Object.keys(registries[themeId] || {});\r\n}\r\n\r\n/**\r\n * 获取所有已注册的主题 ID\r\n */\r\nexport function getRegisteredThemes(): string[] {\r\n return Object.keys(registries);\r\n}\r\n\r\n/**\r\n * 获取主题配置\r\n * @param themeId 主题 ID\r\n */\r\nexport function getThemeConfig(themeId: string): ThemeConfig | null {\r\n return themeConfigs[themeId] || null;\r\n}\r\n\r\n/**\r\n * 清除所有注册(主要用于测试)\r\n */\r\nexport function clearRegistry(): void {\r\n Object.keys(registries).forEach((key) => delete registries[key]);\r\n Object.keys(themeConfigs).forEach((key) => delete themeConfigs[key]);\r\n}\r\n"]}
|
package/dist/styles/global.scss
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Monkeys UI global body background styles.
|
|
3
|
-
*
|
|
4
|
-
* The gradient is derived from the primary theme color (--monkeys-100, generated by the
|
|
5
|
-
* palette system from theme.colors.primaryColor) and the base gray background (--gray1
|
|
6
|
-
* from windy-radix-palette).
|
|
7
|
-
*
|
|
8
|
-
* Requirements for the consuming app:
|
|
9
|
-
* - The monkeys color scale (--monkeys-* CSS vars set by setTailwindTheme from the palette module)
|
|
10
|
-
* - windy-radix-palette Tailwind plugin (for gray color vars)
|
|
11
|
-
* - Tailwind CSS (for theme() and @apply resolution at build time)
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
body {
|
|
15
|
-
background: linear-gradient(theme('colors.monkeys.100/0.35') 0%, theme('colors.gray.1') 50%);
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
html.dark body {
|
|
20
|
-
@apply bg-gray-2;
|
|
21
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Monkeys UI global body background styles.
|
|
3
|
+
*
|
|
4
|
+
* The gradient is derived from the primary theme color (--monkeys-100, generated by the
|
|
5
|
+
* palette system from theme.colors.primaryColor) and the base gray background (--gray1
|
|
6
|
+
* from windy-radix-palette).
|
|
7
|
+
*
|
|
8
|
+
* Requirements for the consuming app:
|
|
9
|
+
* - The monkeys color scale (--monkeys-* CSS vars set by setTailwindTheme from the palette module)
|
|
10
|
+
* - windy-radix-palette Tailwind plugin (for gray color vars)
|
|
11
|
+
* - Tailwind CSS (for theme() and @apply resolution at build time)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
background: linear-gradient(theme('colors.monkeys.100/0.35') 0%, theme('colors.gray.1') 50%);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html.dark body {
|
|
20
|
+
@apply bg-gray-2;
|
|
21
|
+
}
|