Match-id-b4cee81c39335f723de7f60590cb946fdea05514

This commit is contained in:
* 2023-09-01 10:08:24 +08:00
parent 109db22ba4
commit 5643df97da
19 changed files with 29 additions and 28 deletions

View File

@ -1,2 +1,3 @@
# Horizon-Intl # Inula-Intl
Inula-intl 是 inula 提供的生态组件,主要提供了国际化功能,涵盖了基本的国际化组件和钩子函数,便于用户构建具备国际化能力的前端界面。在 Inula-intl 中使用国际化时,无论是组件或者 Hooks其目的就是获取当前应用程序的国际化实例该实例提供了处理多语言文本、日期、时间等功能。

View File

@ -19,7 +19,7 @@ module.exports = {
"@babel/preset-react", "@babel/preset-react",
{ {
"runtime": "automatic", "runtime": "automatic",
"importSource": "@cloudsop/horizon" "importSource": "inulajs"
} }
] ]
], ],

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon, { useState } from '@cloudsop/horizon'; import Inula, { useState } from 'inulajs';
import { IntlProvider } from "../index"; import { IntlProvider } from "../index";
import zh from "./locale/zh"; import zh from "./locale/zh";
import en from "./locale/en"; import en from "./locale/en";
@ -23,7 +23,7 @@ const App = () => {
return ( return (
<IntlProvider locale={locale} messages={locale === 'zh' ? zh : en}> <IntlProvider locale={locale} messages={locale === 'zh' ? zh : en}>
<header>Horizon-Intl API Test Demo</header> <header>Inula-Intl API Test Demo</header>
<div className='container'> <div className='container'>
<Example1/> <Example1/>

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon from "@cloudsop/horizon"; import Inula from "inulajs";
import { useIntl } from "../../index"; import { useIntl } from "../../index";
const Example1 = () => { const Example1 = () => {

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon from "@cloudsop/horizon"; import Inula from "inulajs";
import { FormattedMessage } from "../../index"; import { FormattedMessage } from "../../index";
const Example2= () => { const Example2= () => {

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon from '@cloudsop/horizon'; import Inula from 'inulajs';
import { FormattedMessage } from "../../index"; import { FormattedMessage } from "../../index";
const Example3 = (props) => { const Example3 = (props) => {

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon from "@cloudsop/horizon"; import Inula from "inulajs";
import { createIntl } from "../../index"; import { createIntl } from "../../index";
const Example4 = (props) => { const Example4 = (props) => {

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon, { Component } from '@cloudsop/horizon'; import Inula, { Component } from 'inulajs';
import { injectIntl } from '../../index'; import { injectIntl } from '../../index';
class Example5 extends Component<any, any, any> { class Example5 extends Component<any, any, any> {

View File

@ -2,7 +2,7 @@
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon from "@cloudsop/horizon"; import Inula from "inulajs";
import { createIntl, createIntlCache, RawIntlProvider } from "../../index"; import { createIntl, createIntlCache, RawIntlProvider } from "../../index";
import Example6Child from "./Example6Child"; import Example6Child from "./Example6Child";

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Horizon-Intl API Test</title> <title>Inula-Intl API Test</title>
<style> <style>
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;

View File

@ -1,11 +1,11 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import * as Horizon from '@cloudsop/horizon'; import * as Inula from 'inulajs';
import App from './App' import App from './App'
function render() { function render() {
Horizon.render( Inula.render(
<> <>
<App/> <App/>
</>, </>,

View File

@ -1,10 +1,10 @@
{ {
"name": "@cloudsop/horizon-intl", "name": "Inula-intl",
"version": "1.0.7", "version": "0.0.1",
"description": "", "description": "",
"main": "build/intl.umd.js", "main": "build/intl.umd.js",
"type": "commonjs", "type": "commonjs",
"types": "build/@types/index.d.ts", "types": "build/index.d.ts",
"scripts": { "scripts": {
"demo-serve": "webpack serve --mode=development", "demo-serve": "webpack serve --mode=development",
"rollup-build": "rollup --config rollup.config.js", "rollup-build": "rollup --config rollup.config.js",
@ -13,7 +13,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://szv-open.codehub.huawei.com/innersource/fenghuang/horizon/horizon-ecosystem.git" "url": "https://szv-open.codehub.huawei.com/innersource/fenghuang/horizon/horizon-core.git"
}, },
"files": [ "files": [
"build", "build",
@ -23,9 +23,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@cloudsop/horizon": "^0.0.46", "inulajs": "^0.0.11"
"react": "18.2.0",
"react-dom": "18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.21.3", "@babel/core": "7.21.3",
@ -58,6 +56,8 @@
"typescript": "4.9.3", "typescript": "4.9.3",
"webpack": "^5.81.0", "webpack": "^5.81.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.13.3" "webpack-dev-server": "^4.13.3",
"react": "18.2.0",
"react-dom": "18.2.0"
} }
} }

View File

@ -44,7 +44,7 @@ export default {
terser(), terser(),
], ],
external:[ external:[
"@cloudsop/horizon", "inulajs",
"react", "react",
"react-dom" "react-dom"
] ]

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon, { Children, Fragment } from '@cloudsop/horizon'; import Horizon, { Children, Fragment } from 'inulajs';
import { FormattedMessageProps } from '../../types/interfaces'; import { FormattedMessageProps } from '../../types/interfaces';
import useI18n from '../hook/useI18n'; import useI18n from '../hook/useI18n';

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon, {useRef, useState, useEffect, useMemo, Component} from '@cloudsop/horizon'; import Horizon, {useRef, useState, useEffect, useMemo, Component} from 'inulajs';
import utils from '../../utils/utils'; import utils from '../../utils/utils';
import { InjectProvider } from './InjectI18n'; import { InjectProvider } from './InjectI18n';
import { I18nProviderProps} from '../../types/interfaces'; import { I18nProviderProps} from '../../types/interfaces';

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon , { createContext, forwardRef } from '@cloudsop/horizon'; import Horizon , { createContext, forwardRef } from 'inulajs';
import { isVariantI18n } from '../../utils/utils'; import { isVariantI18n } from '../../utils/utils';
import copyStaticProps from '../../utils/copyStaticProps'; import copyStaticProps from '../../utils/copyStaticProps';
import { InjectOptions } from '../../types/interfaces'; import { InjectOptions } from '../../types/interfaces';

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import Horizon, { useContext } from '@cloudsop/horizon'; import Inula, { useContext } from 'inulajs';
import utils from '../../utils/utils'; import utils from '../../utils/utils';
import { I18nContext } from '../components/InjectI18n'; import { I18nContext } from '../components/InjectI18n';
import I18n from "../I18n"; import I18n from "../I18n";

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
*/ */
import { isMemo, ForwardRef } from '@cloudsop/horizon'; import { isMemo, ForwardRef } from 'inulajs';
import { import {
HORIZON_FORWARD_REF_STATICS, HORIZON_FORWARD_REF_STATICS,
HORIZON_MEMO_STATICS, HORIZON_MEMO_STATICS,

View File

@ -21,7 +21,7 @@ module.exports = {
"@babel/preset-react", "@babel/preset-react",
{ {
"runtime": "automatic", // 新增 "runtime": "automatic", // 新增
"importSource": "@cloudsop/horizon" // 新增 "importSource": "inulajs" // 新增
} }
], ],
'@babel/preset-typescript'], '@babel/preset-typescript'],