refactor: 将 system-action 与 system-ui 合并至 system

This commit is contained in:
unanmed 2026-03-08 17:01:05 +08:00
parent 744a21e042
commit 03cf6a8917
64 changed files with 82 additions and 174 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@user/client-base",
"dependencies": {
"@motajs/render-assets": "workspace:*",
"@motajs/render": "workspace:*",
"@motajs/client-base": "workspace:*"
}
}

View File

@ -8,8 +8,7 @@
"@motajs/legacy-common": "workspace:*",
"@motajs/legacy-ui": "workspace:*",
"@motajs/types": "workspace:*",
"@motajs/system-action": "workspace:*",
"@motajs/system-ui": "workspace:*",
"@motajs/system": "workspace:*",
"@user/data-base": "workspace:*",
"@user/data-state": "workspace:*",
"@user/legacy-plugin-data": "workspace:*"

View File

@ -1,5 +1,5 @@
import { KeyCode } from '@motajs/client-base';
import { gameKey, HotkeyJSON } from '@motajs/system-action';
import { gameKey, HotkeyJSON } from '@motajs/system';
import { GameStorage } from '@motajs/legacy-system';
export const mainScope = Symbol.for('@key_main');

View File

@ -1,5 +1,5 @@
import { KeyCode } from '@motajs/client-base';
import { Hotkey, HotkeyData } from '@motajs/system-action';
import { Hotkey, HotkeyData } from '@motajs/system';
import { HeroMover, IMoveController } from '@user/data-state';
import { Ticker } from 'mutate-animate';
import { mainScope } from './hotkey';

View File

@ -1,4 +1,4 @@
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { POP_BOX_WIDTH, CENTER_LOC, FULL_LOC } from './shared';
import {
saveSave,

View File

@ -4,7 +4,7 @@ import { Background, Selection } from './misc';
import { TextContent, TextContentProps } from './textbox';
import { TextAlign } from './textboxTyper';
import { Page, PageExpose } from './page';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system-ui';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system';
import { useKey } from '../use';
import { sleep } from 'mutate-animate';
import { DefaultProps } from '@motajs/render-vue';

View File

@ -1,5 +1,5 @@
import { DefaultProps } from '@motajs/render-vue';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { clamp, isNil } from 'lodash-es';
import { computed, defineComponent, onMounted, ref, watch } from 'vue';
import { Scroll, ScrollExpose } from './scroll';

View File

@ -1,6 +1,6 @@
import { ElementLocator } from '@motajs/render';
import { DefaultProps, GraphicPropsBase } from '@motajs/render-vue';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import {
computed,
defineComponent,

View File

@ -13,7 +13,7 @@ import {
import { transitionedColor, useKey } from '../use';
import { linear } from 'mutate-animate';
import { Background, Selection } from './misc';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system-ui';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system';
import { KeyCode } from '@motajs/client-base';
export interface InputProps extends DefaultProps, Partial<TextContentProps> {

View File

@ -2,7 +2,7 @@ import { DefaultProps } from '@motajs/render-vue';
import { computed, defineComponent, ref, SlotsType, VNode } from 'vue';
import { Selection } from './misc';
import { ElementLocator, Font } from '@motajs/render';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { Scroll } from './scroll';
export interface ListProps extends DefaultProps {

View File

@ -6,7 +6,7 @@ import { Scroll, ScrollExpose, ScrollProps } from './scroll';
import { transitioned } from '../use';
import { hyper } from 'mutate-animate';
import { logger } from '@motajs/common';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system-ui';
import { GameUI, IUIMountable, SetupComponentOptions } from '@motajs/system';
import { clamp } from 'lodash-es';
interface ProgressProps extends DefaultProps {

View File

@ -10,7 +10,7 @@ import {
} from 'vue';
import { clamp, isNil } from 'lodash-es';
import { ElementLocator, Font } from '@motajs/render';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { DefaultProps } from '@motajs/render-vue';
/** 圆角矩形页码距离容器的边框大小,与 pageSize 相乘 */

View File

@ -29,7 +29,7 @@ import {
import { hyper, linear, Transition } from 'mutate-animate';
import { clamp } from 'lodash-es';
import { transitioned } from '../use';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { DefaultProps } from '@motajs/render-vue';
export const enum ScrollDirection {

View File

@ -29,7 +29,7 @@ import {
WordBreak,
TextAlign
} from './textboxTyper';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { texture } from '../elements';
import { DefaultProps } from '@motajs/render-vue';

View File

@ -1,7 +1,7 @@
import { ElementLocator, MotaOffscreenCanvas2D, Sprite } from '@motajs/render';
import { SpriteProps } from '@motajs/render-vue';
import { defineComponent, ref, watch } from 'vue';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
export interface ThumbnailProps extends SpriteProps {
/** 缩略图的位置 */

View File

@ -5,7 +5,7 @@ import { transitioned } from '../use';
import { hyper } from 'mutate-animate';
import { debounce } from 'lodash-es';
import { texture } from '../elements';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { DefaultProps } from '@motajs/render-vue';
export interface TipProps extends DefaultProps {

View File

@ -1,3 +1,3 @@
import { UIController } from '@motajs/system-ui';
import { UIController } from '@motajs/system';
export const sceneController = new UIController('main-scene');

View File

@ -4,7 +4,7 @@ import {
SetupComponentOptions,
UIComponentProps,
UIController
} from '@motajs/system-ui';
} from '@motajs/system';
import { defineComponent } from 'vue';
import { MAIN_HEIGHT, MAIN_WIDTH } from '../shared';

View File

@ -8,7 +8,7 @@ import {
// import { WeatherController } from '../weather';
import { defineComponent, onUnmounted, reactive, ref } from 'vue';
import { Textbox, Tip } from '../components';
import { GameUI } from '@motajs/system-ui';
import { GameUI } from '@motajs/system';
import {
ENABLE_RIGHT_STATUS_BAR,
MAIN_HEIGHT,

View File

@ -5,7 +5,7 @@ import {
IUIMountable,
SetupComponentOptions,
UIComponentProps
} from '@motajs/system-ui';
} from '@motajs/system';
import {
defineComponent,
ref,

View File

@ -4,7 +4,7 @@ import {
IUIMountable,
SetupComponentOptions,
UIComponentProps
} from '@motajs/system-ui';
} from '@motajs/system';
import { defineComponent } from 'vue';
import {
ChoiceItem,
@ -15,8 +15,7 @@ import {
waitbox
} from '../components';
import { mainUi } from '@motajs/legacy-ui';
import { gameKey } from '@motajs/system-action';
import { generateKeyboardEvent } from '@motajs/system-action';
import { gameKey, generateKeyboardEvent } from '@motajs/system';
import { getVitualKeyOnce } from '@motajs/legacy-ui';
import { getAllSavesData, getSaveData, syncFromServer } from '../utils';
import { getInput } from '../components';

View File

@ -3,7 +3,7 @@ import {
IUIMountable,
SetupComponentOptions,
UIComponentProps
} from '@motajs/system-ui';
} from '@motajs/system';
import { defineComponent } from 'vue';
import { waitbox, ListPage, TextContent } from '../components';
import { DefaultProps } from '@motajs/render-vue';

View File

@ -1,4 +1,4 @@
import { GameUI, SetupComponentOptions } from '@motajs/system-ui';
import { GameUI, SetupComponentOptions } from '@motajs/system';
import { computed, ComputedRef, defineComponent, shallowReactive } from 'vue';
import { TextContent } from '../components';
import { ElementLocator, Font, SizedCanvasImageSource } from '@motajs/render';

View File

@ -3,7 +3,7 @@ import {
GameUI,
SetupComponentOptions,
UIComponentProps
} from '@motajs/system-ui';
} from '@motajs/system';
import { defineComponent, nextTick, onMounted, ref } from 'vue';
import {
BUTTONS_HEIGHT,

View File

@ -12,14 +12,13 @@ import {
ViewMapIcon
} from '../components/icons';
import { getVitualKeyOnce } from '@motajs/legacy-ui';
import { gameKey } from '@motajs/system-action';
import { generateKeyboardEvent } from '@motajs/system-action';
import { gameKey, generateKeyboardEvent } from '@motajs/system';
import { transitioned } from '../use';
import { linear } from 'mutate-animate';
import { KeyCode } from '@motajs/client-base';
import { Progress } from '../components/misc';
import { generateBinary } from '@motajs/legacy-common';
import { SetupComponentOptions } from '@motajs/system-ui';
import { SetupComponentOptions } from '@motajs/system';
import { saveSave, saveLoad } from './save';
import { mainUIController } from './controller';
import { MAIN_HEIGHT, FULL_LOC, POP_BOX_WIDTH, CENTER_LOC } from '../shared';

View File

@ -12,7 +12,7 @@ import {
IUIMountable,
SetupComponentOptions,
UIComponentProps
} from '@motajs/system-ui';
} from '@motajs/system';
import {
computed,
defineComponent,

View File

@ -1,4 +1,4 @@
import { Hotkey, gameKey } from '@motajs/system-action';
import { Hotkey, gameKey } from '@motajs/system';
import { loading } from '@user/data-base';
import { TimingFn, Transition } from 'mutate-animate';
import {

View File

@ -1,6 +1,6 @@
import { compressToBase64, decompressFromBase64 } from 'lz-string';
import { getConfirm, waitbox } from '../components';
import { IUIMountable } from '@motajs/system-ui';
import { IUIMountable } from '@motajs/system';
import { SyncSaveFromServerResponse } from '@motajs/client-base';
import { CENTER_LOC, POP_BOX_WIDTH } from '../shared';

View File

@ -701,7 +701,7 @@ loading.once('coreInit', () => {
// 注册按键操作
Mota.r(() => {
const { HeroKeyMover } = Mota.require('@user/client-modules');
const { gameKey } = Mota.require('@motajs/system-action');
const { gameKey } = Mota.require('@motajs/system');
const keyMover = new HeroKeyMover(gameKey, heroMover);
heroMoveCollection.keyMover = keyMover;
});

View File

@ -5,14 +5,8 @@
"@motajs/client-base": "workspace:*",
"@motajs/common": "workspace:*",
"@motajs/render": "workspace:*",
"@motajs/render-assets": "workspace:*",
"@motajs/render-core": "workspace:*",
"@motajs/render-elements": "workspace:*",
"@motajs/render-style": "workspace:*",
"@motajs/render-vue": "workspace:*",
"@motajs/system": "workspace:*",
"@motajs/system-ui": "workspace:*",
"@motajs/system-action": "workspace:*",
"@motajs/legacy-common": "workspace:*",
"@motajs/legacy-client": "workspace:*",
"@motajs/legacy-data": "workspace:*",

View File

@ -7,8 +7,6 @@ import * as LegacyUI from '@motajs/legacy-ui';
import * as Render from '@motajs/render';
import * as RenderVue from '@motajs/render-vue';
import * as System from '@motajs/system';
import * as SystemAction from '@motajs/system-action';
import * as SystemUI from '@motajs/system-ui';
import * as UserClientBase from '@user/client-base';
import * as ClientModules from '@user/client-modules';
import * as LegacyPluginClient from '@user/legacy-plugin-client';
@ -28,8 +26,6 @@ export function create() {
Mota.register('@motajs/render', Render);
Mota.register('@motajs/render-vue', RenderVue);
Mota.register('@motajs/system', System);
Mota.register('@motajs/system-action', SystemAction);
Mota.register('@motajs/system-ui', SystemUI);
Mota.register('@user/client-base', UserClientBase);
Mota.register('@user/client-modules', ClientModules);
Mota.register('@user/legacy-plugin-client', LegacyPluginClient);

View File

@ -8,8 +8,6 @@ import type * as LegacyUI from '@motajs/legacy-ui';
import type * as Render from '@motajs/render';
import type * as RenderVue from '@motajs/render-vue';
import type * as System from '@motajs/system';
import type * as SystemAction from '@motajs/system-action';
import type * as SystemUI from '@motajs/system-ui';
import type * as ClientModules from '@user/client-modules';
import type * as DataBase from '@user/data-base';
import type * as DataFallback from '@user/data-fallback';
@ -33,8 +31,6 @@ interface ModuleInterface {
'@motajs/render': typeof Render;
'@motajs/render-vue': typeof RenderVue;
'@motajs/system': typeof System;
'@motajs/system-action': typeof SystemAction;
'@motajs/system-ui': typeof SystemUI;
'@user/client-modules': typeof ClientModules;
'@user/data-base': typeof DataBase;
'@user/data-fallback': typeof DataFallback;

View File

@ -1,6 +1,6 @@
{
"name": "@motajs/legacy-system",
"dependencies": {
"@motajs/system-action": "workspace:*"
"@motajs/system": "workspace:*"
}
}

View File

@ -21,7 +21,7 @@
</template>
<script lang="ts" setup>
import { checkAssist, Keyboard, KeyboardEmits } from '@motajs/system-action';
import { checkAssist, Keyboard, KeyboardEmits } from '@motajs/system';
import { KeyCodeUtils } from '@motajs/client-base';
import { nextTick, onUnmounted, ref } from 'vue';

View File

@ -1,4 +1,4 @@
import { Keyboard } from '@motajs/system-action';
import { Keyboard } from '@motajs/system';
import KeyboardUI from './keyboard.vue';
interface VirtualKeyProps {

View File

@ -6,6 +6,6 @@
"@motajs/client": "workspace:*",
"@motajs/client-base": "workspace:*",
"@motajs/legacy-system": "workspace:*",
"@motajs/system-action": "workspace:*"
"@motajs/system": "workspace:*"
}
}

View File

@ -1,5 +1,5 @@
import { KeyCode } from '@motajs/client-base';
import { Keyboard } from '@motajs/system-action';
import { Keyboard } from '@motajs/system';
const qweKey = new Keyboard('qwe'); // 字母键盘A-Z
const numKey = new Keyboard('num'); // 数字键盘1-0

View File

@ -1,7 +1,7 @@
import type { SettingComponent, SettingComponentProps } from '../setting';
import { Button, InputNumber, Radio } from 'ant-design-vue';
import { mainUi } from './uiIns';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
interface Components {
Default: SettingComponent;

View File

@ -45,7 +45,7 @@ import BookDetail from './bookDetail.vue';
import { LeftOutlined } from '@ant-design/icons-vue';
import { ToShowEnemy, detailInfo } from '../tools/book';
import { getDetailedEnemy } from '../tools/fixed';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { mainSetting } from '../preset/settingIns';
import { isMobile } from '../use';
import { IMountedVBind } from '../interface';

View File

@ -77,7 +77,7 @@ import EnemySpecial from '../panel/enemySpecial.vue';
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
import EnemyCritical from '../panel/enemyCritical.vue';
import { detailInfo } from '../tools/book';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { Divider } from 'ant-design-vue';
const props = defineProps<{

View File

@ -184,7 +184,7 @@ import BoxAnimate from '../components/boxAnimate.vue';
import { type, getStatusLabel } from '../utils';
import { cancelGlobalDrag, isMobile, tip, useDrag } from '../use';
import { hyper } from 'mutate-animate';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { IMountedVBind } from '../interface';
import { isNil } from 'lodash-es';
import { Divider, Select, SelectOption } from 'ant-design-vue';

View File

@ -99,7 +99,7 @@ import {
} from '@ant-design/icons-vue';
import { debounce } from 'lodash-es';
import { tip } from '../use';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { createChangable } from '../tools/common';
import { mainSetting } from '../preset/settingIns';
import { GameStorage } from '@motajs/legacy-system';

View File

@ -36,12 +36,11 @@
</template>
<script lang="ts" setup>
import { Hotkey } from '@motajs/system-action';
import { Hotkey, gameKey } from '@motajs/system';
import Column from '../components/colomn.vue';
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue';
import { KeyCode, KeyCodeUtils } from '@motajs/client-base';
import { cloneDeep } from 'lodash-es';
import { gameKey } from '@motajs/system-action';
import { generateBinary, keycode } from '@motajs/legacy-common';
import { IMountedVBind } from '../interface';

View File

@ -84,7 +84,7 @@ import { RightOutlined, LeftOutlined } from '@ant-design/icons-vue';
import { splitText } from '../utils';
import Scroll from '../components/scroll.vue';
import { isMobile } from '../use';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { IMountedVBind } from '../interface';
import { Divider } from 'ant-design-vue';

View File

@ -172,7 +172,7 @@ import {
import { splitText } from '../utils';
import Scroll from '../components/scroll.vue';
import BoxAnimate from '../components/boxAnimate.vue';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { IMountedVBind } from '../interface';
import { tip } from '../use';
import { Divider } from 'ant-design-vue';

View File

@ -116,7 +116,7 @@ import { isMobile } from '../use';
import { type } from '../utils';
import { hyper } from 'mutate-animate';
import { Divider, message } from 'ant-design-vue';
import { gameKey } from '@motajs/system-action';
import { gameKey } from '@motajs/system';
import { IMountedVBind } from '../interface';
import { isNil } from 'lodash-es';

View File

@ -1,5 +1,5 @@
import { KeyCode } from '@motajs/client-base';
import { KeyboardEmits, Keyboard, isAssist } from '@motajs/system-action';
import { KeyboardEmits, Keyboard, isAssist } from '@motajs/system';
import { mainUi } from './preset/uiIns';
/**

View File

@ -3,6 +3,6 @@
"dependencies": {
"@motajs/common": "workspace:*",
"@motajs/render": "workspace:*",
"@motajs/system-action": "workspace:*"
"@motajs/system": "workspace:*"
}
}

View File

@ -1,6 +0,0 @@
{
"name": "@motajs/system-action",
"dependencies": {
"@motajs/common": "workspace:*"
}
}

View File

@ -1,7 +0,0 @@
{
"name": "@motajs/system-ui",
"dependencies": {
"@motajs/common": "workspace:*",
"@motajs/render": "workspace:*"
}
}

View File

@ -1,7 +1,6 @@
{
"name": "@motajs/system",
"dependencies": {
"@motajs/system-ui": "workspace:*",
"@motajs/system-action": "workspace:*"
"@motajs/common": "workspace:*"
}
}

View File

@ -1,2 +1,2 @@
export * from '@motajs/system-action';
export * from '@motajs/system-ui';
export * from './action';
export * from './ui';

View File

@ -223,6 +223,15 @@ importers:
specifier: ^8.18.1
version: 8.18.3
packages-user/client-base:
dependencies:
'@motajs/client-base':
specifier: workspace:*
version: link:../../packages/client-base
'@motajs/render':
specifier: workspace:*
version: link:../../packages/render
packages-user/client-modules:
dependencies:
'@motajs/client-base':
@ -240,15 +249,12 @@ importers:
'@motajs/render':
specifier: workspace:*
version: link:../../packages/render
'@motajs/render-core':
'@motajs/render-vue':
specifier: workspace:*
version: link:../../packages/render-core
'@motajs/system-action':
version: link:../../packages/render-vue
'@motajs/system':
specifier: workspace:*
version: link:../../packages/system-action
'@motajs/system-ui':
specifier: workspace:*
version: link:../../packages/system-ui
version: link:../../packages/system
'@motajs/types':
specifier: workspace:*
version: link:../../packages/types
@ -333,27 +339,15 @@ importers:
'@motajs/render':
specifier: workspace:*
version: link:../../packages/render
'@motajs/render-core':
specifier: workspace:*
version: link:../../packages/render-core
'@motajs/render-elements':
specifier: workspace:*
version: link:../../packages/render-elements
'@motajs/render-style':
specifier: workspace:*
version: link:../../packages/render-style
'@motajs/render-vue':
specifier: workspace:*
version: link:../../packages/render-vue
'@motajs/system':
specifier: workspace:*
version: link:../../packages/system
'@motajs/system-action':
'@user/client-base':
specifier: workspace:*
version: link:../../packages/system-action
'@motajs/system-ui':
specifier: workspace:*
version: link:../../packages/system-ui
version: link:../client-base
'@user/client-modules':
specifier: workspace:*
version: link:../client-modules
@ -440,9 +434,9 @@ importers:
packages/legacy-system:
dependencies:
'@motajs/system-action':
'@motajs/system':
specifier: workspace:*
version: link:../system-action
version: link:../system
packages/legacy-ui:
dependencies:
@ -461,9 +455,9 @@ importers:
'@motajs/render':
specifier: workspace:*
version: link:../render
'@motajs/system-action':
'@motajs/system':
specifier: workspace:*
version: link:../system-action
version: link:../system
packages/render:
dependencies:
@ -483,70 +477,7 @@ importers:
specifier: ^3.5.13
version: 3.5.20(typescript@5.9.2)
packages/render-assets:
dependencies:
'@motajs/client-base':
specifier: workspace:*
version: link:../client-base
packages/render-core:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
packages/render-elements:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
'@motajs/render-core':
specifier: workspace:*
version: link:../render-core
'@motajs/render-style':
specifier: workspace:*
version: link:../render-style
packages/render-style:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
packages/render-vue:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
'@motajs/render-core':
specifier: workspace:*
version: link:../render-core
'@motajs/render-elements':
specifier: workspace:*
version: link:../render-elements
'@motajs/render-style':
specifier: workspace:*
version: link:../render-style
'@motajs/system-action':
specifier: workspace:*
version: link:../system-action
packages/system:
dependencies:
'@motajs/system-action':
specifier: workspace:*
version: link:../system-action
'@motajs/system-ui':
specifier: workspace:*
version: link:../system-ui
packages/system-action:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
packages/system-ui:
dependencies:
'@motajs/common':
specifier: workspace:*
@ -554,6 +485,15 @@ importers:
'@motajs/render':
specifier: workspace:*
version: link:../render
'@motajs/system':
specifier: workspace:*
version: link:../system
packages/system:
dependencies:
'@motajs/common':
specifier: workspace:*
version: link:../common
packages/types: {}

View File

@ -1657,7 +1657,7 @@ events.prototype._action_setText = function (data) {
const { textbox = 'main-textbox' } = data;
const Store = Mota.require('@user/client-modules').TextboxStore;
const { TextAlign, WordBreak } = Mota.require('@user/client-modules');
const Font = Mota.require('@motajs/render-style').Font;
const Font = Mota.require('@motajs/render').Font;
const store = Store.get(textbox);
if (!store) {
core.doAction();