mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-12 21:50:23 +08:00
commit
f08e2e93bb
@ -1,11 +1,11 @@
|
||||
# `@meta-ui/core`
|
||||
# `@sunmao-ui/core`
|
||||
|
||||
> TODO: description
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
const core = require('@meta-ui/core');
|
||||
const core = require('@sunmao-ui/core');
|
||||
|
||||
// TODO: DEMONSTRATE API
|
||||
```
|
||||
|
@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@meta-ui/core",
|
||||
"name": "@sunmao-ui/core",
|
||||
"version": "0.2.2",
|
||||
"description": "meta-ui core",
|
||||
"author": "meta-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"description": "sunmao-ui core",
|
||||
"author": "sunmao-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/sunmao-ui#readme",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/webzard-io/meta-ui.git"
|
||||
"url": "git+https://github.com/webzard-io/sunmao-ui.git"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@ -29,7 +29,7 @@
|
||||
"prepublish": "npm run build && npm run typings"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webzard-io/meta-ui/issues"
|
||||
"url": "https://github.com/webzard-io/sunmao-ui/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.23",
|
||||
@ -41,7 +41,7 @@
|
||||
"jest": "^27.0.6",
|
||||
"prettier": "^2.3.2",
|
||||
"tsup": "^5.5.0",
|
||||
"typescript": "^4.3.5"
|
||||
"typescript": "^4.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.7",
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>meta-ui runtime example: basic grid layout</title>
|
||||
<title>runtime example: basic grid layout</title>
|
||||
<style>
|
||||
#root {
|
||||
width: 100vw;
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "@meta-ui/editor",
|
||||
"name": "@sunmao-ui/editor",
|
||||
"version": "0.2.13",
|
||||
"description": "meta-ui editor",
|
||||
"author": "meta-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"description": "sunmao-ui editor",
|
||||
"author": "sunmao-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/sunmao-ui#readme",
|
||||
"license": "MIT",
|
||||
"main": "dist/main.js",
|
||||
"module": "dist/esm/main.js",
|
||||
@ -25,18 +25,18 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/webzard-io/meta-ui.git"
|
||||
"url": "git+https://github.com/webzard-io/sunmao-ui.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webzard-io/meta-ui/issues"
|
||||
"url": "https://github.com/webzard-io/sunmao-ui/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/icons": "^1.0.15",
|
||||
"@chakra-ui/react": "^1.7.1",
|
||||
"@emotion/react": "^11",
|
||||
"@emotion/styled": "^11",
|
||||
"@meta-ui/core": "^0.2.2",
|
||||
"@meta-ui/runtime": "^0.2.10",
|
||||
"@sunmao-ui/core": "^0.2.2",
|
||||
"@sunmao-ui/runtime": "^0.2.10",
|
||||
"codemirror": "^5.63.3",
|
||||
"formik": "^2.2.9",
|
||||
"framer-motion": "^4",
|
||||
@ -47,7 +47,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-react": "^7.14.5",
|
||||
"@meta-ui/vite-plugins": "^1.0.1",
|
||||
"@sunmao-ui/vite-plugins": "^1.0.1",
|
||||
"@types/codemirror": "^5.60.5",
|
||||
"@types/lodash-es": "^4.17.5",
|
||||
"@vitejs/plugin-react": "^1.0.1",
|
||||
@ -55,7 +55,7 @@
|
||||
"babel-jest": "^27.2.1",
|
||||
"jest": "^27.2.1",
|
||||
"tsup": "^5.6.0",
|
||||
"typescript": "^4.4.3",
|
||||
"typescript": "^4.5.0",
|
||||
"vite": "^2.6.13"
|
||||
},
|
||||
"husky": {
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>meta-ui playground</title>
|
||||
<title>sunmao-ui playground</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
@ -3,8 +3,8 @@ import { flatten } from 'lodash-es';
|
||||
import { FormControl, FormLabel, Input, Textarea, VStack } from '@chakra-ui/react';
|
||||
import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { parseType, parseTypeBox } from '@meta-ui/runtime';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { parseType, parseTypeBox } from '@sunmao-ui/runtime';
|
||||
import { eventBus } from '../../eventBus';
|
||||
import {
|
||||
ModifyComponentIdOperation,
|
||||
@ -15,7 +15,7 @@ import {
|
||||
import { EventTraitForm } from './EventTraitForm';
|
||||
import { GeneralTraitFormList } from './GeneralTraitFormList';
|
||||
import { FetchTraitForm } from './FetchTraitForm';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
import SchemaField from './JsonSchemaForm/SchemaField';
|
||||
|
||||
type Props = {
|
||||
|
@ -12,11 +12,11 @@ import {
|
||||
import { Static } from '@sinclair/typebox';
|
||||
import { CloseIcon } from '@chakra-ui/icons';
|
||||
import { useFormik } from 'formik';
|
||||
import { EventHandlerSchema } from '@meta-ui/runtime';
|
||||
import { EventHandlerSchema } from '@sunmao-ui/runtime';
|
||||
import { useAppModel } from '../../../operations/useAppModel';
|
||||
import { formWrapperCSS } from '../style';
|
||||
import { KeyValueEditor } from '../../KeyValueEditor';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type Props = {
|
||||
registry: Registry;
|
||||
|
@ -3,15 +3,15 @@ import { AddIcon } from '@chakra-ui/icons';
|
||||
import { HStack, IconButton, VStack } from '@chakra-ui/react';
|
||||
import { Static } from '@sinclair/typebox';
|
||||
import produce from 'immer';
|
||||
import { ApplicationComponent } from '@meta-ui/core';
|
||||
import { EventHandlerSchema } from '@meta-ui/runtime';
|
||||
import { ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { EventHandlerSchema } from '@sunmao-ui/runtime';
|
||||
import { eventBus } from '../../../eventBus';
|
||||
import {
|
||||
AddTraitOperation,
|
||||
ModifyTraitPropertyOperation,
|
||||
} from '../../../operations/Operations';
|
||||
import { EventHandlerForm } from './EventHandlerForm';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type EventHandler = Static<typeof EventHandlerSchema>;
|
||||
|
||||
|
@ -12,8 +12,8 @@ import { Static } from '@sinclair/typebox';
|
||||
import { AddIcon, CloseIcon } from '@chakra-ui/icons';
|
||||
import { useFormik } from 'formik';
|
||||
import produce from 'immer';
|
||||
import { ApplicationComponent } from '@meta-ui/core';
|
||||
import { EventHandlerSchema, FetchTraitPropertiesSchema } from '@meta-ui/runtime';
|
||||
import { ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { EventHandlerSchema, FetchTraitPropertiesSchema } from '@sunmao-ui/runtime';
|
||||
import { formWrapperCSS } from '../style';
|
||||
import { KeyValueEditor } from '../../KeyValueEditor';
|
||||
import { EventHandlerForm } from '../EventTraitForm/EventHandlerForm';
|
||||
@ -22,7 +22,7 @@ import {
|
||||
RemoveTraitOperation,
|
||||
} from '../../../operations/Operations';
|
||||
import { eventBus } from '../../../eventBus';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type EventHandler = Static<typeof EventHandlerSchema>;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AddIcon, ChevronDownIcon } from '@chakra-ui/icons';
|
||||
import { IconButton, Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
type Props = {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { ApplicationComponent, ComponentTrait } from '@meta-ui/core';
|
||||
import { ApplicationComponent, ComponentTrait } from '@sunmao-ui/core';
|
||||
import { HStack, IconButton, VStack } from '@chakra-ui/react';
|
||||
import { parseTypeBox } from '@meta-ui/runtime';
|
||||
import { parseTypeBox } from '@sunmao-ui/runtime';
|
||||
import { CloseIcon } from '@chakra-ui/icons';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
import { renderField } from '../ComponentForm';
|
||||
import { formWrapperCSS } from '../style';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type Props = {
|
||||
registry: Registry;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ApplicationComponent } from '@meta-ui/core';
|
||||
import { parseTypeBox } from '@meta-ui/runtime';
|
||||
import { ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { parseTypeBox } from '@sunmao-ui/runtime';
|
||||
import { HStack, VStack } from '@chakra-ui/react';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
import { AddTraitButton } from './AddTraitButton';
|
||||
@ -7,7 +7,7 @@ import { GeneralTraitForm } from './GeneralTraitForm';
|
||||
import { eventBus } from '../../../eventBus';
|
||||
import { AddTraitOperation, RemoveTraitOperation } from '../../../operations/Operations';
|
||||
import { ignoreTraitsList } from '../../../constants';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type Props = {
|
||||
registry: Registry;
|
||||
|
@ -3,7 +3,7 @@ import SchemaField from './SchemaField';
|
||||
import { FieldProps } from './fields';
|
||||
import { Box, ButtonGroup, IconButton, Flex } from '@chakra-ui/react';
|
||||
import { ArrowDownIcon, ArrowUpIcon, DeleteIcon, AddIcon } from '@chakra-ui/icons';
|
||||
import { parseTypeBox } from '@meta-ui/runtime';
|
||||
import { parseTypeBox } from '@sunmao-ui/runtime';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
|
||||
type Props = FieldProps;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component } from '@meta-ui/core';
|
||||
import { Component } from '@sunmao-ui/core';
|
||||
|
||||
type Schema = Component['spec']['properties'];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { css } from '@emotion/react';
|
||||
import { ComponentWrapperType } from '@meta-ui/runtime';
|
||||
import { ComponentWrapperType } from '@sunmao-ui/runtime';
|
||||
import { eventBus, HoverComponentEvent, SelectComponentEvent } from '../eventBus';
|
||||
|
||||
// children of components in this list should render height as 100%
|
||||
|
@ -9,8 +9,8 @@ import {
|
||||
Flex,
|
||||
Box,
|
||||
} from '@chakra-ui/react';
|
||||
import { encodeDragDataTransfer, DROP_EXAMPLE_SIZE_PREFIX } from '@meta-ui/runtime';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { encodeDragDataTransfer, DROP_EXAMPLE_SIZE_PREFIX } from '@sunmao-ui/runtime';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
type Props = {
|
||||
registry: Registry;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { GridCallbacks, DIALOG_CONTAINER_ID, initMetaUI } from '@meta-ui/runtime';
|
||||
import { GridCallbacks, DIALOG_CONTAINER_ID, initSunmaoUI } from '@sunmao-ui/runtime';
|
||||
import produce from 'immer';
|
||||
import { Box, Tabs, TabList, Tab, TabPanels, TabPanel, Flex } from '@chakra-ui/react';
|
||||
import { StructureTree } from './StructureTree';
|
||||
@ -19,7 +19,7 @@ import { ComponentWrapper } from './ComponentWrapper';
|
||||
import { StateEditor, SchemaEditor } from './CodeEditor';
|
||||
import { AppModelManager } from '../operations/AppModelManager';
|
||||
|
||||
type ReturnOfInit = ReturnType<typeof initMetaUI>;
|
||||
type ReturnOfInit = ReturnType<typeof initSunmaoUI>;
|
||||
|
||||
type Props = {
|
||||
App: ReturnOfInit['App'];
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Box, Text, VStack } from '@chakra-ui/react';
|
||||
import { ApplicationComponent } from '@meta-ui/core';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { eventBus } from '../../eventBus';
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Application, ApplicationComponent } from '@meta-ui/core';
|
||||
import { Application, ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { Box, Text, VStack } from '@chakra-ui/react';
|
||||
import { eventBus } from '../../eventBus';
|
||||
import {
|
||||
@ -9,7 +9,7 @@ import {
|
||||
import { ComponentItemView } from './ComponentItemView';
|
||||
import { ComponentTree } from './ComponentTree';
|
||||
import { DropComponentWrapper } from './DropComponentWrapper';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
export type ChildrenMap = Map<string, SlotsMap>;
|
||||
type SlotsMap = Map<string, ApplicationComponent[]>;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
|
||||
export const ignoreTraitsList = ['core/v1/slot', 'core/v1/event', 'core/v1/fetch'];
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import mitt from 'mitt';
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { Operations } from './operations/Operations';
|
||||
|
||||
export const SelectComponentEvent = 'selectComponent';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ChakraProvider } from '@chakra-ui/react';
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { initMetaUI } from '@meta-ui/runtime';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { initSunmaoUI } from '@sunmao-ui/runtime';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
import { StrictMode } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import 'react-grid-layout/css/styles.css';
|
||||
@ -21,12 +21,12 @@ export default function renderApp(
|
||||
app: Application = DefaultAppSchema,
|
||||
options: Options = {}
|
||||
) {
|
||||
const metaUI = initMetaUI();
|
||||
const ui = initSunmaoUI();
|
||||
|
||||
const App = metaUI.App;
|
||||
const registry = metaUI.registry;
|
||||
const apiService = metaUI.apiService;
|
||||
const stateStore = metaUI.stateManager.store;
|
||||
const App = ui.App;
|
||||
const registry = ui.registry;
|
||||
const apiService = ui.apiService;
|
||||
const stateStore = ui.stateManager.store;
|
||||
const appModelManager = new AppModelManager(app, registry);
|
||||
|
||||
const { components = [], traits = [], modules = [] } = options;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Application, ComponentTrait, ApplicationComponent } from '@meta-ui/core';
|
||||
import { parseType } from '@meta-ui/runtime';
|
||||
import { Application, ComponentTrait, ApplicationComponent } from '@sunmao-ui/core';
|
||||
import { parseType } from '@sunmao-ui/runtime';
|
||||
import {
|
||||
Operations,
|
||||
CreateComponentOperation,
|
||||
@ -17,7 +17,7 @@ import {
|
||||
import { produce } from 'immer';
|
||||
import { eventBus } from '../eventBus';
|
||||
import { set, isEqual } from 'lodash-es';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
|
||||
function genSlotTrait(parentId: string, slot: string): ComponentTrait {
|
||||
return {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
|
||||
export type Operations =
|
||||
| CreateComponentOperation
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { DefaultAppSchema } from '../constants';
|
||||
import { eventBus } from '../eventBus';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Flex, Box, ChakraProvider, Button } from '@chakra-ui/react';
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { initMetaUI } from '@meta-ui/runtime';
|
||||
import { Registry } from '@meta-ui/runtime/lib/services/registry';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { initSunmaoUI } from '@sunmao-ui/runtime';
|
||||
import { Registry } from '@sunmao-ui/runtime/lib/services/registry';
|
||||
import { StrictMode, useMemo, useState } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import 'react-grid-layout/css/styles.css';
|
||||
@ -25,11 +25,11 @@ const Playground: React.FC<{ examples: Example[] }> = ({ examples }) => {
|
||||
if (!example) {
|
||||
return {};
|
||||
}
|
||||
const metaUI = initMetaUI();
|
||||
const App = metaUI.App;
|
||||
const registry = metaUI.registry;
|
||||
const apiService = metaUI.apiService;
|
||||
const stateStore = metaUI.stateManager.store;
|
||||
const ui = initSunmaoUI();
|
||||
const App = ui.App;
|
||||
const registry = ui.registry;
|
||||
const apiService = ui.apiService;
|
||||
const stateStore = ui.stateManager.store;
|
||||
|
||||
const { app, modules = [] } = example.value;
|
||||
modules.forEach(m => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { virtualExamplePlugin } from '@meta-ui/vite-plugins';
|
||||
import { virtualExamplePlugin } from '@sunmao-ui/vite-plugins';
|
||||
import { resolve } from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>meta-ui runtime examples</title>
|
||||
<title>sunmao-ui runtime examples</title>
|
||||
</head>
|
||||
<body>
|
||||
<select></select>
|
||||
@ -11,7 +11,7 @@
|
||||
<script type="module">
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { initMetaUI } from './src';
|
||||
import { initSunmaoUI } from './src';
|
||||
import { ChakraProvider } from '@chakra-ui/react';
|
||||
import examples from '@example.json';
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
const rootEl = document.querySelector('#root');
|
||||
const render = example => {
|
||||
ReactDOM.unmountComponentAtNode(rootEl);
|
||||
const { App, registry } = initMetaUI();
|
||||
const { App, registry } = initSunmaoUI();
|
||||
const { app, modules = [] } = example.value;
|
||||
modules.forEach(m => {
|
||||
registry.registerModule(m);
|
||||
|
@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@meta-ui/runtime",
|
||||
"name": "@sunmao-ui/runtime",
|
||||
"version": "0.2.10",
|
||||
"description": "meta-ui runtime",
|
||||
"author": "meta-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"description": "sunmao-ui runtime",
|
||||
"author": "sunmao-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/sunmao-ui#readme",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/webzard-io/meta-ui.git"
|
||||
"url": "git+https://github.com/webzard-io/sunmao-ui.git"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@ -33,8 +33,8 @@
|
||||
"@chakra-ui/react": "^1.7.1",
|
||||
"@emotion/react": "^11",
|
||||
"@emotion/styled": "^11",
|
||||
"@meta-ui/core": "^0.2.2",
|
||||
"@sinclair/typebox": "^0.20.5",
|
||||
"@sunmao-ui/core": "^0.2.2",
|
||||
"@sinclair/typebox": "^0.21.2",
|
||||
"@vue/reactivity": "^3.1.5",
|
||||
"@vue/shared": "^3.2.20",
|
||||
"antd": "^4.16.13",
|
||||
@ -61,7 +61,7 @@
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@babel/preset-react": "^7.14.5",
|
||||
"@babel/preset-typescript": "^7.15.0",
|
||||
"@meta-ui/vite-plugins": "^1.0.1",
|
||||
"@sunmao-ui/vite-plugins": "^1.0.1",
|
||||
"@testing-library/react": "^12.1.0",
|
||||
"@types/lodash": "^4.14.170",
|
||||
"@types/lodash-es": "^4.17.5",
|
||||
@ -72,7 +72,7 @@
|
||||
"babel-jest": "^27.1.0",
|
||||
"jest": "^27.1.0",
|
||||
"tsup": "^5.5.0",
|
||||
"typescript": "^4.3.2",
|
||||
"typescript": "^4.5.0",
|
||||
"vite": "^2.6.13"
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { createApplication } from '@meta-ui/core';
|
||||
import { createApplication } from '@sunmao-ui/core';
|
||||
import { initStateAndMethod } from './utils/initStateAndMethod';
|
||||
import { ImplWrapper } from './services/ImplWrapper';
|
||||
import { resolveAppComponents } from './services/resolveAppComponents';
|
||||
import { AppProps, MetaUIServices } from './types/RuntimeSchema';
|
||||
import { AppProps, UIServices } from './types/RuntimeSchema';
|
||||
import { DebugEvent, DebugStore } from './services/DebugComponents';
|
||||
|
||||
// inject modules to App
|
||||
export function genApp(services: MetaUIServices) {
|
||||
export function genApp(services: UIServices) {
|
||||
return (props: Omit<AppProps, 'services'>) => {
|
||||
return <App {...props} services={services} />;
|
||||
};
|
||||
|
@ -2,8 +2,8 @@ import { Static } from '@sinclair/typebox';
|
||||
import React, { useEffect, useMemo } from 'react';
|
||||
import { get } from 'lodash-es';
|
||||
import { useDeepCompareMemo } from 'use-deep-compare';
|
||||
import { RuntimeApplication } from '@meta-ui/core';
|
||||
import { MetaUIServices, RuntimeModuleSchema } from '../../types/RuntimeSchema';
|
||||
import { RuntimeApplication } from '@sunmao-ui/core';
|
||||
import { UIServices, RuntimeModuleSchema } from '../../types/RuntimeSchema';
|
||||
import { EventHandlerSchema } from '../../types/TraitPropertiesSchema';
|
||||
import { resolveAppComponents } from '../../services/resolveAppComponents';
|
||||
import { ImplWrapper } from '../../services/ImplWrapper';
|
||||
@ -12,7 +12,7 @@ import { parseTypeComponents } from '../../utils/parseType';
|
||||
|
||||
type Props = Static<typeof RuntimeModuleSchema> & {
|
||||
evalScope?: Record<string, any>;
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
app?: RuntimeApplication;
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { uniq } from 'lodash-es';
|
||||
import { TreeSelect } from 'antd';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Box as BaseBox } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { css } from '@emotion/react';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Button as BaseButton } from '@chakra-ui/react';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Checkbox as BaseCheckbox, useCheckboxGroupContext } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { CheckboxGroup as BaseCheckboxGroup } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import {
|
||||
AlertDialog,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Divider } from '@chakra-ui/react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
||||
const DividerImpl: ComponentImplementation = () => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { css } from '@emotion/react';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Button, VStack } from '@chakra-ui/react';
|
||||
import { watch } from '../../../utils/watchReactivity';
|
||||
import { ComponentImplementation } from '../../../services/registry';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { first } from 'lodash-es';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import {
|
||||
FormControl,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { css } from '@emotion/react';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { HStack as BaseHStack } from '@chakra-ui/react';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Image as BaseImage } from '@chakra-ui/react';
|
||||
import { css } from '@emotion/react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
InputRightAddon,
|
||||
InputRightElement,
|
||||
} from '@chakra-ui/react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { Kbd as BaseKbd } from '@chakra-ui/react';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import Text, { TextPropertySchema } from '../_internal/Text';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Link } from '@chakra-ui/react';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import Text, { TextPropertySchema } from '../_internal/Text';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { List as BaseList, ListItem as BaseListItem } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Select as BaseMultiSelect } from 'chakra-react-select';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
NumberIncrementStepper,
|
||||
NumberDecrementStepper,
|
||||
} from '@chakra-ui/react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Radio as BaseRadio } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { RadioGroup as BaseRadioGroup } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ChakraProvider, extendTheme } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import Slot from '../_internal/Slot';
|
||||
|
||||
const Root: ComponentImplementation<Record<string, unknown>> = ({ slotsMap }) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Select as BaseSelect } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Stack as BaseStack } from '@chakra-ui/react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { RuntimeApplication } from '@meta-ui/core';
|
||||
import { RuntimeApplication } from '@sunmao-ui/core';
|
||||
import { Static } from '@sinclair/typebox';
|
||||
import { ColumnSchema } from './TableTypes';
|
||||
import { Button, Link, Td, Text } from '@chakra-ui/react';
|
||||
import { LIST_ITEM_EXP, LIST_ITEM_INDEX_EXP } from '../../../constants';
|
||||
import { MetaUIServices } from 'src/types/RuntimeSchema';
|
||||
import { UIServices } from 'src/types/RuntimeSchema';
|
||||
import { ModuleRenderer } from '../../_internal/ModuleRenderer';
|
||||
|
||||
export const TableTd: React.FC<{
|
||||
@ -11,7 +11,7 @@ export const TableTd: React.FC<{
|
||||
item: any;
|
||||
column: Static<typeof ColumnSchema>;
|
||||
onClickItem: () => void;
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
app?: RuntimeApplication;
|
||||
}> = props => {
|
||||
const { item, index, column, onClickItem, services, app } = props;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
import { TableImpl } from './Table';
|
||||
import {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { css } from '@emotion/react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Tabs as BaseTabs, TabList, Tab, TabPanels, TabPanel } from '@chakra-ui/react';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { Tooltip } from '@chakra-ui/react';
|
||||
import { TextPropertySchema } from '../_internal/Text';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { css } from '@emotion/react';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { VStack as BaseVStack } from '@chakra-ui/react';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { useEffect } from 'react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { Suspense } from 'react';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { getSlots } from '../_internal/Slot';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { partial } from 'lodash-es';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Static } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import { RuntimeModuleSchema } from '../../types/RuntimeSchema';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { ComponentImplementation } from '../../../services/registry';
|
||||
import { Switch } from './component';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
import _Text, { TextPropertySchema } from '../_internal/Text';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { createComponent } from '@meta-ui/core';
|
||||
import { createComponent } from '@sunmao-ui/core';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
import Text, { TextPropertySchema } from '../_internal/Text';
|
||||
import { ComponentImplementation } from '../../services/registry';
|
||||
|
@ -1,5 +1,5 @@
|
||||
export const LIST_ITEM_EXP = '$listItem';
|
||||
export const LIST_ITEM_INDEX_EXP = '$i';
|
||||
export const GRID_HEIGHT = 40;
|
||||
export const DIALOG_CONTAINER_ID = 'meta-ui-dialog-container';
|
||||
export const DIALOG_CONTAINER_ID = 'sunmao-ui-dialog-container';
|
||||
export const DROP_EXAMPLE_SIZE_PREFIX = 'exampleSize: ';
|
||||
|
@ -5,7 +5,7 @@ import { initApiService } from './services/apiService';
|
||||
import { mountUtilMethods } from './services/util-methods';
|
||||
import { initGlobalHandlerMap } from './services/handler';
|
||||
|
||||
export function initMetaUI() {
|
||||
export function initSunmaoUI() {
|
||||
const registry = initRegistry();
|
||||
const stateManager = initStateManager();
|
||||
const globalHandlerMap = initGlobalHandlerMap();
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { initMetaUI } from './index';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { initSunmaoUI } from './index';
|
||||
import { ChakraProvider } from '@chakra-ui/react';
|
||||
|
||||
const { App, registry: _registry } = initMetaUI();
|
||||
const { App, registry: _registry } = initSunmaoUI();
|
||||
|
||||
export default function renderApp(options: Application) {
|
||||
ReactDOM.render(
|
||||
|
@ -199,7 +199,7 @@ export const ImplWrapper = React.forwardRef<HTMLDivElement, ImplWrapperProps>(
|
||||
} = props;
|
||||
/* eslint-enable */
|
||||
result = (
|
||||
<div key={c.id} data-meta-ui-id={c.id} ref={ref} {...restProps}>
|
||||
<div key={c.id} data-sunmao-ui-id={c.id} ref={ref} {...restProps}>
|
||||
{result}
|
||||
</div>
|
||||
);
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
RuntimeTraitSpec,
|
||||
RuntimeModuleSpec,
|
||||
ApplicationComponent,
|
||||
} from '@meta-ui/core';
|
||||
} from '@sunmao-ui/core';
|
||||
// components
|
||||
/* --- plain --- */
|
||||
import PlainButton from '../components/plain/Button';
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { RuntimeApplication } from '@meta-ui/core';
|
||||
import { RuntimeApplication } from '@sunmao-ui/core';
|
||||
import { ContainerPropertySchema } from '../traits/core/slot';
|
||||
import { Static } from '@sinclair/typebox';
|
||||
import {
|
||||
ComponentParamsFromApp,
|
||||
MetaUIServices,
|
||||
UIServices,
|
||||
SlotComponentMap,
|
||||
} from 'src/types/RuntimeSchema';
|
||||
import { ImplWrapper } from './ImplWrapper';
|
||||
@ -12,7 +12,7 @@ import { ImplWrapper } from './ImplWrapper';
|
||||
export function resolveAppComponents(
|
||||
components: RuntimeApplication['spec']['components'],
|
||||
params: {
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
app?: RuntimeApplication;
|
||||
} & ComponentParamsFromApp
|
||||
): {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { debounce, throttle, delay } from 'lodash-es';
|
||||
import { CallbackMap, TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
import { FetchTraitPropertiesSchema } from '../../types/TraitPropertiesSchema';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export const ContainerPropertySchema = Type.Object({
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { createTrait } from '@meta-ui/core';
|
||||
import { createTrait } from '@sunmao-ui/core';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { TraitImplementation } from 'src/types/RuntimeSchema';
|
||||
|
@ -3,13 +3,13 @@ import { ApiService } from 'src/services/apiService';
|
||||
import { GlobalHandlerMap } from 'src/services/handler';
|
||||
import { Registry } from 'src/services/registry';
|
||||
import { StateManager } from 'src/services/stateStore';
|
||||
import { Application, RuntimeApplication } from '@meta-ui/core';
|
||||
import { Application, RuntimeApplication } from '@sunmao-ui/core';
|
||||
import { EventHandlerSchema } from './TraitPropertiesSchema';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export type RuntimeApplicationComponent = RuntimeApplication['spec']['components'][0];
|
||||
|
||||
export type MetaUIServices = {
|
||||
export type UIServices = {
|
||||
registry: Registry;
|
||||
stateManager: StateManager;
|
||||
globalHandlerMap: GlobalHandlerMap;
|
||||
@ -35,7 +35,7 @@ export type ComponentParamsFromApp = {
|
||||
|
||||
export type AppProps = {
|
||||
options: Application;
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
debugStore?: boolean;
|
||||
debugEvent?: boolean;
|
||||
} & ComponentParamsFromApp;
|
||||
@ -44,7 +44,7 @@ export type ImplWrapperProps = {
|
||||
component: RuntimeApplicationComponent;
|
||||
slotsMap: SlotsMap | undefined;
|
||||
targetSlot: { id: string; slot: string } | null;
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
app?: RuntimeApplication;
|
||||
} & ComponentParamsFromApp;
|
||||
|
||||
@ -86,7 +86,7 @@ export type TraitImplementation<T = any> = (
|
||||
props: T &
|
||||
RuntimeFunctions & {
|
||||
componentId: string;
|
||||
services: MetaUIServices;
|
||||
services: UIServices;
|
||||
}
|
||||
) => TraitResult;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RuntimeApplication } from '@meta-ui/core';
|
||||
import { RuntimeApplication } from '@sunmao-ui/core';
|
||||
import { Static, TSchema } from '@sinclair/typebox';
|
||||
import { Registry } from 'src/services/registry';
|
||||
import { StateManager } from 'src/services/stateStore';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Application } from '@meta-ui/core';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { RuntimeApplicationComponent } from '../types/RuntimeSchema';
|
||||
|
||||
// parse component Type
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Static, TObject, TProperties } from '@sinclair/typebox';
|
||||
|
||||
export const pickProperty = <T extends TProperties, U extends TProperties>(
|
||||
export const pickProperty = <T, U extends TProperties>(
|
||||
schema: TObject<T>,
|
||||
object: U
|
||||
): Partial<Static<TObject<T>>> => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { virtualExamplePlugin } from '@meta-ui/vite-plugins';
|
||||
import { virtualExamplePlugin } from '@sunmao-ui/vite-plugins';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
|
@ -1,11 +1,11 @@
|
||||
# `@meta-ui/vite-plugins`
|
||||
# `@sunmao-ui/vite-plugins`
|
||||
|
||||
> TODO: description
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
const vitePlugins = require('@meta-ui/vite-plugins');
|
||||
const vitePlugins = require('@sunmao-ui/vite-plugins');
|
||||
|
||||
// TODO: DEMONSTRATE API
|
||||
```
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "@meta-ui/vite-plugins",
|
||||
"name": "@sunmao-ui/vite-plugins",
|
||||
"version": "1.0.1",
|
||||
"description": "vite plugins for meta-ui",
|
||||
"author": "meta-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"description": "vite plugins for sunmao-ui",
|
||||
"author": "sunmao-ui developers",
|
||||
"homepage": "https://github.com/webzard-io/sunmao-ui#readme",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@ -14,7 +14,7 @@
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/webzard-io/meta-ui.git"
|
||||
"url": "git+https://github.com/webzard-io/sunmao-ui.git"
|
||||
},
|
||||
"scripts": {}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
# Meta UI
|
||||
# Sunmao UI
|
||||
|
||||
## 版本
|
||||
|
||||
当前 Meta UI **规范**版本为 **v0.1.0**。
|
||||
当前 Sunmao UI **规范**版本为 **v0.1.0**。
|
||||
|
||||
## 目标
|
||||
|
||||
Meta UI 的目标是通过提供一种元数据格式用于描述 UI,将开发过程抽象为一个通用平台,从而以更高效的方式开发更高质量的 UI。
|
||||
Sunmao UI 的目标是通过提供一种元数据格式用于描述 UI,将开发过程抽象为一个通用平台,从而以更高效的方式开发更高质量的 UI。
|
||||
|
||||
为此衍生出两种角色:
|
||||
|
||||
@ -15,7 +15,7 @@ Meta UI 的目标是通过提供一种元数据格式用于描述 UI,将开发
|
||||
|
||||
平台搭建者为平台增添更多的能力,因此他们关心平台的**扩展性**;平台使用者基于平台提供的能力开发 UI,因此他们关心平台的**易用性**。
|
||||
|
||||
Meta UI 的规范则是平台搭建者与使用者之间沟通的桥梁。
|
||||
Sunmao UI 的规范则是平台搭建者与使用者之间沟通的桥梁。
|
||||
|
||||
## 概述与术语
|
||||
|
||||
@ -110,7 +110,7 @@ Component 的模型定义了自身对外提供的配置项与可接受的 trait
|
||||
}
|
||||
```
|
||||
|
||||
将上述 Component 模型载入 meta-ui 平台后,平台使用者就可以定义以下的 Application 使用该 Component。
|
||||
将上述 Component 模型载入 sunmao-ui 平台后,平台使用者就可以定义以下的 Application 使用该 Component。
|
||||
|
||||
```json
|
||||
{
|
||||
@ -190,7 +190,7 @@ Trait 定义了自身提供的 runtime 能力以及与 Component 交互的方式
|
||||
}
|
||||
```
|
||||
|
||||
将上述 Trait 定义载入 meta-ui 平台后,平台使用者就可以定义以下的 Application 使用该 Trait。
|
||||
将上述 Trait 定义载入 sunmao-ui 平台后,平台使用者就可以定义以下的 Application 使用该 Trait。
|
||||
|
||||
```json
|
||||
{
|
||||
|
16
yarn.lock
16
yarn.lock
@ -2857,10 +2857,10 @@
|
||||
estree-walker "^2.0.1"
|
||||
picomatch "^2.2.2"
|
||||
|
||||
"@sinclair/typebox@^0.20.5":
|
||||
version "0.20.5"
|
||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.20.5.tgz#d5828bbb8237876d7937dd229e3dac71d1220771"
|
||||
integrity sha512-WNiVFcS1rdz5KyEutpl3Wmp/AwSQHBUFTyJz7KqMLkpLhOXCj1dnvMytBM6uMS5OTwhwwq877T7EC4vDGrX5Eg==
|
||||
"@sinclair/typebox@^0.21.2":
|
||||
version "0.21.2"
|
||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.21.2.tgz#d23a42adafc482f4893994e22916b0b54e18c23d"
|
||||
integrity sha512-YeGOsWyjmGS26VxfvxbDgO7In4em8riCI5hEe/NnjM72ifoLQNUeHxwFNufXVIcaaPEK4fCV+fYoLKgmpPKjsA==
|
||||
|
||||
"@sinonjs/commons@^1.7.0":
|
||||
version "1.8.3"
|
||||
@ -9980,10 +9980,10 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@^4.3.2, typescript@^4.3.5, typescript@^4.4.3:
|
||||
version "4.4.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c"
|
||||
integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==
|
||||
typescript@^4.5.0:
|
||||
version "4.5.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"
|
||||
integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==
|
||||
|
||||
uglify-js@^3.1.4:
|
||||
version "3.14.2"
|
||||
|
Loading…
x
Reference in New Issue
Block a user