Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into feature/sizes-customizing-update
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/package.json
#	changelog.md
#	draft-rte/package.json
#	epam-assets/package.json
#	epam-electric/package.json
#	epam-promo/package.json
#	extra/package.json
#	lerna.json
#	loveship/package.json
#	templates/uui-cra-template/package.json
#	test-utils/package.json
#	uui-build/package.json
#	uui-components/package.json
#	uui-core/package.json
#	uui-db/package.json
#	uui-docs/package.json
#	uui-e2e-tests/package.json
#	uui-editor/package.json
#	uui-timeline/package.json
#	uui/package.json
  • Loading branch information
siarhei-epam committed Jul 22, 2024
2 parents 79d5076 + f9e0822 commit c72e5a4
Show file tree
Hide file tree
Showing 53 changed files with 9,622 additions and 2,650 deletions.
26 changes: 13 additions & 13 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/app",
"version": "5.9.0-beta.0",
"version": "5.8.2",
"description": "EPAM Unified UI landing",
"author": "EPAM",
"license": "MIT",
Expand All @@ -17,19 +17,19 @@
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@elastic/apm-rum": "^5.14.0",
"@epam/assets": "5.9.0-beta.0",
"@epam/draft-rte": "5.9.0-beta.0",
"@epam/electric": "5.9.0-beta.0",
"@epam/assets": "5.8.2",
"@epam/draft-rte": "5.8.2",
"@epam/electric": "5.8.2",
"@epam/internal": "0.0.2",
"@epam/loveship": "5.9.0-beta.0",
"@epam/promo": "5.9.0-beta.0",
"@epam/uui": "5.9.0-beta.0",
"@epam/uui-components": "5.9.0-beta.0",
"@epam/uui-core": "5.9.0-beta.0",
"@epam/uui-db": "5.9.0-beta.0",
"@epam/uui-docs": "5.9.0-beta.0",
"@epam/uui-editor": "5.9.0-beta.0",
"@epam/uui-timeline": "5.9.0-beta.0",
"@epam/loveship": "5.8.2",
"@epam/promo": "5.8.2",
"@epam/uui": "5.8.2",
"@epam/uui-components": "5.8.2",
"@epam/uui-core": "5.8.2",
"@epam/uui-db": "5.8.2",
"@epam/uui-docs": "5.8.2",
"@epam/uui-editor": "5.8.2",
"@epam/uui-timeline": "5.8.2",
"@tanstack/react-query": "^5.17.19",
"@udecode/plate-common": "31.3.2",
"amplitude-js": "8.9.1",
Expand Down
63 changes: 38 additions & 25 deletions app/src/data/apiDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getDemoApi } from '@epam/uui-docs';
import type {
IProcessRequest, CommonContexts, UuiContexts, ITablePreset,
CommonContexts, UuiContexts, ITablePreset, IProcessRequest,
} from '@epam/uui-core';
import { TType, TTypeRef } from '@epam/uui-docs';
import { TDocsGenTypeSummary } from '../common/apiReference/types';
Expand All @@ -22,46 +22,59 @@ export interface GetCodeResponse {
highlighted: string;
}

export function getApi(params: { processRequest: IProcessRequest, origin?: string, fetchOptions?: RequestInit }) {
const { origin = '', fetchOptions } = params;
interface GetApiParams {
processRequest: IProcessRequest;
origin?: string;
fetchOptions?: RequestInit;
}

const processRequest: IProcessRequest = (url, method, data, options) => {
export function getApi({
processRequest,
origin = '',
fetchOptions,
} : GetApiParams) {
const processRequestLocal: IProcessRequest = (url, method, data, options) => {
const opts = fetchOptions ? { fetchOptions, ...options } : options;
return params.processRequest(url, method, data, opts);
return processRequest(url, method, data, opts);
};

return {
demo: getDemoApi(processRequest, origin),
demo: getDemoApi(processRequestLocal, origin),
form: {
validateForm: <T>(formState: T) => processRequest(origin.concat('api/form/validate-form'), 'POST', formState),
validateForm: <FormState>(formState: FormState) =>
processRequestLocal(
origin.concat('api/form/validate-form'),
'POST',
formState,
),
},
errors: {
status: (status: number) => processRequest(origin.concat(`api/error/status/${status}`), 'POST'),
setServerStatus: (status: number) => processRequest(origin.concat(`api//error/set-server-status/${status}`), "'POST'"),
mock: () => processRequest(origin.concat('api/error/mock'), 'GET'),
authLost: () => processRequest(origin.concat('api/error/auth-lost'), 'POST'),
status: (status: number) => processRequestLocal(origin.concat(`api/error/status/${status}`), 'POST'),
setServerStatus: (status: number) => processRequestLocal(origin.concat(`api//error/set-server-status/${status}`), "'POST'"),
mock: () => processRequestLocal(origin.concat('api/error/mock'), 'GET'),
authLost: () => processRequestLocal(origin.concat('api/error/auth-lost'), 'POST'),
},
getChangelog(): Promise<any> {
return processRequest(origin.concat('/api/get-changelog'), 'GET');
getChangelog() {
return processRequestLocal(origin.concat('/api/get-changelog'), 'GET');
},
getCode(rq: GetCodeParams): Promise<GetCodeResponse> {
return processRequest(origin.concat('/api/get-code'), 'POST', rq);
getCode(rq: GetCodeParams) {
return processRequestLocal<GetCodeResponse>(origin.concat('/api/get-code'), 'POST', rq);
},
getProps(): Promise<any> {
return processRequest(origin.concat('/api/get-props/'), 'GET');
getProps() {
return processRequestLocal(origin.concat('/api/get-props/'), 'GET');
},
getDocsGenType(shortRef: TTypeRef): Promise<{ content: TType }> {
getDocsGenType(shortRef: TTypeRef) {
const refEncoded = encodeURIComponent(shortRef);
return processRequest(origin.concat(`/api/docs-gen/details/${refEncoded}`), 'GET');
return processRequestLocal<{ content: TType }>(origin.concat(`/api/docs-gen/details/${refEncoded}`), 'GET');
},
getDocsGenSummaries(): Promise<{ content: TDocsGenTypeSummary }> {
return processRequest(origin.concat('/api/docs-gen/summaries'), 'GET');
getDocsGenSummaries() {
return processRequestLocal<{ content: TDocsGenTypeSummary }>(origin.concat('/api/docs-gen/summaries'), 'GET');
},
getDocsGenExports(): Promise<{ content: Record<string, string[]> }> {
return processRequest(origin.concat('/api/docs-gen/exports'), 'GET');
getDocsGenExports() {
return processRequestLocal<{ content: Record<string, string[]> }>(origin.concat('/api/docs-gen/exports'), 'GET');
},
getThemeTokens(): Promise<{ content: IUuiTokensCollection['exposedTokens'] }> {
return processRequest(origin.concat('/api/theme-tokens'), 'GET');
getThemeTokens() {
return processRequestLocal<{ content: IUuiTokensCollection['exposedTokens'] }>(origin.concat('/api/theme-tokens'), 'GET');
},
presets: {
async getPresets(): Promise<ITablePreset[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const router = new HistoryAdaptedRouter(history);
type TApi = ReturnType<typeof apiDefinition>;
function apiDefinition(processRequest: IProcessRequest) {
return {
loadDataExample(): Promise<any> {
loadDataExample() {
return processRequest('url goes here', 'GET');
},
loadAppContextData(): Promise<any> {
loadAppContextData() {
return processRequest('url goes here', 'GET');
},
// ... other api are defined here
Expand Down
2 changes: 1 addition & 1 deletion app/src/docs/_examples/form/ServerValidation.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function ServerValidationExample() {
const svc = useUuiContext<TApi, UuiContexts>();

async function onSave(formState: Login): Promise<FormSaveResponse<Login>> {
const response: ServerResponseExample<Login> = await svc.api.form.validateForm(formState);
const response: ServerResponseExample<Login> = await svc.api.form.validateForm<Login>(formState);
if (!response.error) return response;

// Prefer to return the ICanBeInvalid structure from the server directly, and pass it to the Form as is. Here, we demonstrate how to handle the case when it's not possible. In such cases, you can convert your server-specific errors to the ICanBeInvalid interface on client.
Expand Down
35 changes: 23 additions & 12 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# 5.9.0 - xx.xx.2024
# 5.x.x - xx.xx.2024

**What's New**
* [Pickers]: add current selection into renderFooter callback params.
* [ApiContext] Add `ResponseType` generic type for `processRequest` function, which defines the returned type of the function. It also takes into account the return type of the `parseResponse` function
* [ApiContext] Add suggestions for `method` parameter in `processRequest` function (to avoid typos), while allowing to pass any string value. For more details, check out `ProcessRequestMethod` type

**What's Fixed**
* [Checkbox]:
* fixed icon size according design
* [Breaking change]: removed centered alignment of items to ensure proper alignment of checkboxes with multi-line caption
* [FiltersPanel]: set `undefined` value instead of `null` on clear action in numeric filter.
* [ApiContext] Combine user's headers with internal ones instead of replacing them when calling `processRequest` function
* [PickerList]: Fixed updating predefined checked values in PickerList.
* [LazyDataSource]: Fixed requesting already loaded data on scroll.
* [Pickers]: fixed infinite updating if onValueChange is called in useEffect (React components are rendered with render from 'react-dom').

# 5.8.2 - 11.07.2024

**What's New**
* [Pickers]: added current selection into `renderFooter` callback params.
* [RTE]: added possibility to customize set of available options for Header, Color and Note plugins

**What's Fixed**
* Fixed invalid mode for inline inputs
* [AnalyticContext]: fixed GA connection
* [Checkbox]: fixed icon size according design
* [RadioInput]: fixed caption line-height according design
* [Switch]: fixed caption size & line-height according design
* [PickerToggler]: changed padding for left icon, remove transparent for left/right icon in cell mode
* [uui-editor]: header, notes and color plugins now available for customizations
* [TextArea]:
* removed maxLength prop override in cell mode
* fixed left position with Arabic text in placeholder with attr dir="auto" (browser issue)
* [TextInput]: fixed left position with Arabic text in placeholder with attr dir="auto" (browser issue)
* [PickerInput]: fixed left position with Arabic text in placeholder with attr dir="auto" (browser issue)
* [TextArea]: removed maxLength prop override in cell mode
* [TabButton]: fixed counter color according to the design
* [DropdownSubMenu]: fixed `offset` value for `left-start` placement option
* [RTE]: remove loader after failed file upload
* [RTE]: removed loader after failed file upload


# 5.8.1 - 21.06.2024

Expand Down
10 changes: 5 additions & 5 deletions draft-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/draft-rte",
"version": "5.9.0-beta.0",
"version": "5.8.2",
"author": "EPAM",
"license": "MIT",
"main": "index.js",
Expand All @@ -11,10 +11,10 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/assets": "5.9.0-beta.0",
"@epam/loveship": "5.9.0-beta.0",
"@epam/uui-components": "5.9.0-beta.0",
"@epam/uui-core": "5.9.0-beta.0",
"@epam/assets": "5.8.2",
"@epam/loveship": "5.8.2",
"@epam/uui-components": "5.8.2",
"@epam/uui-core": "5.8.2",
"@types/draft-js": "0.10.23",
"classnames": "^2.2.6",
"draft-convert": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion epam-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/assets",
"version": "5.9.0-beta.0",
"version": "5.8.2",
"description": "EPAM Assets Library",
"author": "EPAM",
"license": "MIT",
Expand Down
68 changes: 2 additions & 66 deletions epam-assets/theme/theme_electric.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
--gradient-4: linear-gradient(315deg, #1294E2 0%, #92B4FF 46.64%, #C3A6FF 100%);
--gradient-5: linear-gradient(90deg, #1294E2 0%, #92B4FF 46.64%, #C3A6FF 100%);

/* contrast colors */
--uui-primary-contrast: var(--white);

--uui-accent-contrast: var(--white);

--uui-secondary-contrast: var(--white);

--uui-critical-contrast: var(--white);

--uui-info-contrast: var(--white);

--uui-success-contrast: var(--white);

--uui-warning-contrast: var(--uui-neutral-80);

--uui-error-contrast: var(--white);

/* shadows */
--uui-shadow-level-1: 0 0 3px rgba(29, 30, 38, 0.15), 0 3px 6px rgba(29, 30, 38, 0.1);
--uui-shadow-level-2: 0 6px 12px rgba(29, 30, 38, 0.1), 0 3px 12px rgba(29, 30, 38, 0.1), 0 0 6px rgba(29, 30, 38, 0.05);
Expand All @@ -50,31 +33,7 @@
/* override variables */

/* begin color classes */

.uui-color-primary,
.uui-color-info {
--uui-color-5: var(--uui-primary-5);
--uui-color-10: var(--uui-primary-10);
--uui-color-20: var(--uui-primary-20);
--uui-color-50: var(--uui-primary-50);
--uui-color-60: var(--uui-primary-60);
--uui-color-70: var(--uui-primary-70);
--uui-color-contrast: var(--white);
}

.uui-color-accent {
--uui-color-5: var(--uui-accent-5);
--uui-color-10: var(--uui-accent-10);
--uui-color-20: var(--uui-accent-20);
--uui-color-50: var(--uui-accent-50);
--uui-color-60: var(--uui-accent-60);
--uui-color-70: var(--uui-accent-70);
--uui-color-contrast: var(--white);
}

.uui-color-fire,
.uui-color-critical,
.uui-color-error {
.uui-color-fire {
--uui-color-5: var(--uui-critical-5);
--uui-color-10: var(--uui-critical-10);
--uui-color-20: var(--uui-critical-20);
Expand All @@ -84,16 +43,6 @@
--uui-color-contrast: var(--white);
}

.uui-color-white {
--uui-color-5: color-mix(in srgb, #FFFFFF 15%, transparent);
--uui-color-10: color-mix(in srgb, #FFFFFF 22%, transparent);
--uui-color-20: color-mix(in srgb, #FFFFFF 29%, transparent);
--uui-color-50: var(--uui-neutral-0);
--uui-color-60: var(--uui-neutral-10);
--uui-color-70: var(--uui-neutral-20);
--uui-color-contrast: var(--uui-neutral-70);
}

.uui-color-night100 {
--uui-color-5: var(--white);
--uui-color-10: var(--white);
Expand All @@ -114,8 +63,6 @@
--uui-color-contrast: var(--uui-neutral-80);
}

.uui-color-neutral,
.uui-color-secondary,
.uui-color-night600 {
--uui-color-5: var(--uui-secondary-5);
--uui-color-10: var(--uui-secondary-10);
Expand All @@ -136,18 +83,7 @@
--uui-color-contrast: var(--white);
}

.uui-color-success {
--uui-color-5: var(--uui-success-5);
--uui-color-10: var(--uui-success-10);
--uui-color-20: var(--uui-success-20);
--uui-color-50: var(--uui-success-50);
--uui-color-60: var(--uui-success-60);
--uui-color-70: var(--uui-success-70);
--uui-color-contrast: var(--white);
}

.uui-color-sun,
.uui-color-warning {
.uui-color-sun {
--uui-color-5: var(--sun-5);
--uui-color-10: var(--sun-10);
--uui-color-20: var(--sun-20);
Expand Down
Loading

0 comments on commit c72e5a4

Please sign in to comment.