Skip to content

Commit

Permalink
WRQ-30274: Merge feature/enact_v5 to develop branch (#3263)
Browse files Browse the repository at this point in the history
* WRQ-22937: Updated storybook to version 8 (#3224)

* Updated storybook to version 8

* upgraded storybook to 8.1.5

* minor fix for changelog

* merged with enact_v5

* Update CHANGELOG.md

* code review fixes

* revert of commented properties

* code review fix

* eslint fixes

* eslint fixes

* removed unneeded storybook ui properties

* updated storybook to 8.1.6 and storybook-utils branch to enact_v5

* removed docs configuration in preview.js
removed docs information in About story

* removed @storybook/addon-docs

* added back storybook/addon-docs

* WRQ-25915: Added custom site icon for sampler app (#3246)

* added custom site icon for storybook

* Update packages/sampler/.storybook/manager-head.html

* removed manager-head

* WRQ-17541: Changed `ui/Marquee.MarqueeDecorator` to use `@enact/i18n` utils for `marqueeDirection` (#3237)

* update marqueeDirection to use @enact/i18n API

* update CHANGELOG.md

* Update MarqueeDecorator.js

* update CHANGELOG.md

* update packages/ui/CHANGELOG.md

* remove unused module and sort modules alphabetically

* fix changelog

* WRQ-10629: Removed deprecated APIs (#3244)

* Removed deprecated APIs from core/platform

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Removed deprecated APIs from webos/platform

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* WRQ-228: Removed Moonstone related modules (#3207)

* Removed deprecated components from enact/ui:
IconButton, RadioDecorator, Scroller.ScrollerBase, SlotItem, ToggleItem, VirtualList.UiVirtualListBase, VirtualList.VirtualListBase

* Removed reference to ui/SlotItem from ui/Slottable.

* Updated changelog

* Update CHANGELOG.md

---------

Co-authored-by: Daniel Stoian <63335068+daniel-stoian-lgp@users.noreply.github.com>
Co-authored-by: Seungcheon Baek <5037955+SeungcheonBaek@users.noreply.github.com>

* Removed ui/Marquee.MarqueeDecorator config className

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Refined CHANGELOG files

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Fixed Sampler not to use a removed component

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Updated changelogs and missing changes

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Updated docs

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Fix changelogs broken by merging

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Refined warning message and removed code for unsupported legacy webOS

Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)

* Update deprecation message

Enact-DCO-1.0-Signed-off-by: Seungho Park <seunghoh.park@lge.com>

---------

Co-authored-by: Seungcheon Baek <5037955+SeungcheonBaek@users.noreply.github.com>
Co-authored-by: alexandru-morariu-lgp <84004128+alexandrumorariu@users.noreply.github.com>
Co-authored-by: Daniel Stoian <63335068+daniel-stoian-lgp@users.noreply.github.com>
Co-authored-by: Seungho Park <seunghoh.park@lge.com>

* Update change logs for 5.0.0-rc.1

* unpinning ilib peerDependencies

* applying storybook-utils 6.0.0-rc.1

* applying storybook-utils 6.0.0-rc.1 in lockfile

* Update release version & date

* Version value updating

* WRQ-29126: Updated storybook to 8.2 and fixed enact/ui interlink script (#3256)

* fixed missing depedency, updated storybook to 8.2 and changed package.json dependencies to patch version

* updated storybook dependencies to use latest minor version

* fixed merge conflicts

* fixed interlink script and added ilib dependency for enact/ui

* WRQ-28801: Fix `marqueeController` to marquee properly when `marqueeOnFocus` is true and content is changed  (#3255)

* WRQ-28801: Rollback handleComplete function in useMarqueeController to not decide whether to start by checking contentFits

Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com)

* Add changelog

Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com)

* Fix typo

Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com)

* WRQ-30274: Merge `feature/enact_v5` to `develop` branch (#3261)

* change travis dist from focal to jammy
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)

* modify npm-shrinkwrap.json

* add changelog
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)

* add changelog
Enact-DCO-1.0-Signed-off-by: Jiye Kim (jiye.kim@lge.com)

---------

Co-authored-by: Daniel Stoian <63335068+daniel-stoian-lgp@users.noreply.github.com>
Co-authored-by: Juwon Jeong <juwon.jeong@lge.com>
Co-authored-by: taeyoung.hong <taeyoung.hong@lge.com>
Co-authored-by: taeyoung.hong <35059065+hong6316@users.noreply.github.com>
Co-authored-by: Seungcheon Baek <5037955+0x64@users.noreply.github.com>
Co-authored-by: Seungcheon Baek <5037955+SeungcheonBaek@users.noreply.github.com>
Co-authored-by: alexandru-morariu-lgp <84004128+alexandrumorariu@users.noreply.github.com>
Co-authored-by: Seungho Park <seunghoh.park@lge.com>
Co-authored-by: Jenkins <accounts@enactjs.com>
Co-authored-by: Jiye Kim <128779942+vJIYEv@users.noreply.github.com>
  • Loading branch information
11 people authored Jul 25, 2024
1 parent ef8be8e commit c8490da
Show file tree
Hide file tree
Showing 66 changed files with 29,408 additions and 116,576 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: focal
dist: jammy
language: node_js
node_js:
- lts/*
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,36 @@ The following is a curated list of changes in the Enact project, newest changes
- `ui/Placeholder.PlaceholderControllerDecorator` to not remount its children when it rerenders
- `webos/speech.VoiceControlDecorator` to not remount its children when it rerenders

## [5.0.0-alpha.1] - 2024-07-11

### Added

- `spotlight/SpotlightRootDecorator` config `rootId` to specify React DOM tree root for global event handlers

### Changed

- `ui/Marquee.MarqueeDecorator` to use `@enact/i18n/utils.isRtlText` API to determine the text directionality
- `sampler` look and feel by updating to Storybook 8

### Fixed

- `ui/Marquee.MarqueeDecorator` to start animation properly when synchronized by `ui/Marquee.MarqueeController` and text changed

### Removed

- `core/platform` member `windowsPhone`, `edge`, `androidChrome`, `android`, `ie`, `ios`, `webos`, `androidFirefox`, `firefoxOS`, `blackberry`, and `tizen`
- `core/platform` member `gesture`, `node`, `platformName`, and `unknown`
- `core/platform` member `touch` and `touchscreen`
- `ui/GridListImageItem`
- `ui/IconButton`
- `ui/Marquee.MarqueeDecorator` config `className`
- `ui/RadioDecorator`
- `ui/Scroller.ScrollerBase`
- `ui/SlotItem`
- `ui/ToggleItem`
- `ui/VirtualList.VirtualListBase`
- `webos/platform` member `watch` and `legacy`

## [4.9.0-beta.1] - 2024-06-17

No significant changes.
Expand Down
5 changes: 0 additions & 5 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,5 @@ ignore:
- "packages/webos/deviceinfo"
- "packages/webos/application"
- "packages/webos/LS2Request"
- "packages/ui/Scrollable"
- "packages/ui/Scroller/UiScrollerBase.js"
- "packages/ui/GridListImageItem"
- "packages/ui/Touchable/Pinch.js"
- "packages/ui/VirtualList/VirtualListBase.js"
- "packages/ui/VirtualList/UiVirtualListBase.js"

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.9.0",
"version": "5.0.0-alpha.1",
"packages": [
"packages/*"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enact",
"version": "4.9.0",
"version": "5.0.0-alpha.1",
"description": "Monorepo for all Enact front end libraries.",
"private": true,
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The following is a curated list of changes in the Enact core module, newest chan

No significant changes.

## [5.0.0-alpha.1] - 2024-07-11

### Removed

- `core/platform` member `windowsPhone`, `edge`, `androidChrome`, `android`, `ie`, `ios`, `webos`, `androidFirefox`, `firefoxOS`, `blackberry`, and `tizen`
- `core/platform` member `gesture`, `node`, `platformName`, and `unknown`
- `core/platform` member `touch` and `touchscreen`

## [4.9.0-beta.1] - 2024-06-17

No significant changes.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enact/core",
"version": "4.9.0",
"version": "5.0.0-alpha.1",
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.",
"repository": {
"type": "git",
Expand Down
197 changes: 6 additions & 191 deletions packages/core/platform/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,152 +24,6 @@ const deviceTouchScreen = () => browserEnvironment() && (
globalThis.matchMedia?.("(any-pointer: coarse)")?.matches
);

/*
* Legacy Code to be removed in the next major release
*/
const hasGesture = () => {
return Boolean(
('ongesturestart' in window) || // non-standard and no major browser supports gesture events
('onmsgesturestart' in window && ( // Internet Explorer 10 only
window.navigator.msMaxTouchPoints > 1 || // Internet Explorer 10 only
window.navigator.maxTouchPoints > 1
))
);
};

const hasTouch = () => {
return Boolean(
featureTouchEvent() ||
('ontouchstart' in window) || // featureTouchEvent covers recent Firefox and Safari also, so no need when we deprecate old browsers
window.navigator.msMaxTouchPoints || // Internet Explorer 10 only
(window.navigator.msManipulationViewsEnabled && window.navigator.maxTouchPoints) // Internet Explorer only
);
};

const webOSVersion = {
38: 3,
53: 4,
68: 5,
79: 6
};

const platforms = [
// Windows Phone 7 - 10
{platform: 'windowsPhone', regex: /Windows Phone (?:OS )?(\d+)[.\d]+/},
// Edge
{platform: 'edge', regex: /Chrome\/(\d+)[.\d]+.*Edg(?:e|A|iOS)?\/(\d+)[.\d]+/},
{platform: 'edge', regex: /Edg(?:e|A|iOS)?\/(\d+)[.\d]+/},
// Android 4+ using Chrome
{platform: 'androidChrome', regex: /Android .* Chrome\/(\d+)[.\d]+/},
// Android 2 - 4
{platform: 'android', regex: /Android(?:\s|\/)(\d+)/},
// Kindle Fire
// Force version to 2, (desktop mode does not list android version)
{platform: 'android', regex: /Silk\/1./, forceVersion: 2, extra: {silk: 1}},
// Kindle Fire HD (Silk versions 2 or 3)
// Force version to 4
{platform: 'android', regex: /Silk\/2./, forceVersion: 4, extra: {silk: 2}},
{platform: 'android', regex: /Silk\/3./, forceVersion: 4, extra: {silk: 3}},
// IE 8 - 10
{platform: 'ie', regex: /MSIE (\d+)/},
// IE 11
{platform: 'ie', regex: /Trident\/.*; rv:(\d+)/},
// iOS 3 - 5
// Apple likes to make this complicated
{platform: 'ios', regex: /iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/},
// LG webOS
{platform: 'webos', regex: /Web0S;.*Safari\/537.41/, forceVersion: 1},
{platform: 'webos', regex: /Web0S;.*Safari\/538.2/, forceVersion: 2},
{platform: 'webos', regex: /Web0S;.*Chrome\/(\d+)/},
// LG webOS indeterminate versions
{platform: 'webos', regex: /Web0S;/, forceVersion: -1},
// LuneOS
{platform: 'webos', regex: /LuneOS/, forceVersion: -1, extra: {luneos: 1}},
// Palm/HP/Open webOS
{platform: 'webos', regex: /WebAppManager|Isis|webOS\./, forceVersion: -1, extra: {legacy: 4}},
{platform: 'webos', regex: /(?:web|hpw)OS\/1/, forceVersion: -1, extra: {legacy: 1}},
{platform: 'webos', regex: /(?:web|hpw)OS\/2/, forceVersion: -1, extra: {legacy: 2}},
{platform: 'webos', regex: /(?:web|hpw)OS\/3/, forceVersion: -1, extra: {legacy: 3}},
// desktop Safari
{platform: 'safari', regex: /Version\/(\d+)[.\d]+\s+Safari/},
// desktop Chrome
{platform: 'chrome', regex: /Chrome\/(\d+)[.\d]+/},
// Firefox on Android
{platform: 'androidFirefox', regex: /Android;.*Firefox\/(\d+)/},
// FirefoxOS
{platform: 'firefoxOS', regex: /Mobile;.*Firefox\/(\d+)/},
// desktop Firefox
{platform: 'firefox', regex: /Firefox\/(\d+)/},
// Blackberry Playbook
{platform: 'blackberry', regex: /PlayBook/i, forceVersion: 2},
// Blackberry 10+
{platform: 'blackberry', regex: /BB1\d;.*Version\/(\d+\.\d+)/},
// Tizen
{platform: 'tizen', regex: /Tizen (\d+)/}
];

const parseUserAgentLegacy = (userAgent) => {
let plat = {
gesture: hasGesture(),
node: false,
touch: hasTouch(),
touchscreen: deviceTouchScreen(),
unknown: true
};

for (let i = 0, p, m, v; (p = platforms[i]); i++) {
m = p.regex.exec(userAgent);

if (m) {
plat.unknown = false;

if ('forceVersion' in p) {
v = p.forceVersion;
} else if (p.platform === 'webos') {
v = webOSVersion[m[1]] || -1;

if (v >= 7 || v === -1) {
plat.chrome = Number(m[1]);
}
} else if (p.platform === 'edge' && m[2]) {
plat.chrome = Number(m[1]);
v = Number(m[2]);
} else {
v = Number(m[1]);
}
plat[p.platform] = v;
if (p.extra) {
plat = {
...plat,
...p.extra
};
}
plat.platformName = p.platform;

break;
}
}

if ('webos' === plat.platformName) {
deprecate({
name: plat.platformName,
message: 'Refer `@enact/webos`\'s `platform` for webOS specific information.',
until: '5.0.0'
});
} else if (!['chrome', 'safari', 'firefox'].includes(plat.platformName)) {
deprecate({
name: plat.platformName,
until: '5.0.0'
});
}

return plat;
};

/*
* The end of Legacy Code to be removed in the next major release
*/

// Refer https://www.whatismybrowser.com/guides/the-latest-user-agent/ for latest user agents of major browsers
const userAgentPatterns = [
// Normal cases except iOS
Expand Down Expand Up @@ -217,30 +71,22 @@ const parseUserAgent = (userAgent) => {

// deprecation warning for browser versions older than our support policy
if (supportedVersions[detectedInfo.browserName] > detectedInfo.browserVersion) {
deprecate({name: `supporting ${detectedInfo.browserName} version before ${supportedVersions[detectedInfo.browserName]}`, until: '5.0.0'});
deprecate({name: `supporting ${detectedInfo.browserName} version older than ${supportedVersions[detectedInfo.browserName]}`, until: '5.0.0'});
}

// Merge legacy platform info
return {...parseUserAgentLegacy(userAgent), ...detectedInfo};
return detectedInfo;
};

/**
* @typedef {Object} PlatformDescription
* @property {String} browserName - The name of the detected browser
* @property {Number} browserVersion - The version of the detected browser
* @property {Number} chrome - The version of the detected browser, if chrome browser is detected
* @property {Object} [extra] - Additional information about the detected platform. Deprecated: will be removed in 5.0.0.
* @property {Number} firefox - The version of the detected browser, if firefox browser is detected
* @property {Boolean} gesture - `true` if the platform has native double-finger events. Deprecated: will be removed in 5.0.0.
* @property {Boolean} node - `true` only if `window` is `undefined`. Deprecated: will be removed in 5.0.0. Use `type` instead.
* @property {String} [platformName] - The name of the platform, if detected. Deprecated: will be removed in 5.0.0. Use `browserName` instead for browser names.
* @property {Number} safari - The version of the detected browser, if safari browser is detected
* @property {Boolean} touch - `true` if the platform has native single-finger events. Deprecated: will be removed in 5.0.0. Use `touchEvent` instead.
* @property {Boolean} touchEvent - `true` if the browser has native touch events
* @property {Boolean} touchscreen - `true` if the platform has a touch screen. Deprecated: will be removed in 5.0.0. Use `touchScreen` instead.
* @property {Boolean} touchScreen - `true` if the platform has a touch screen
* @property {String} type - The type of the detected platform. One of 'desktop', 'mobile', 'webos', 'node', or 'unknown'
* @property {Boolean} unknown - `true` for any unknown system. Deprecated: will be removed in 5.0.0. Use `type` instead.
*
* @memberof core/platform
* @public
Expand All @@ -267,12 +113,6 @@ const detect = () => {
} else {
// node or compatible environment (e.g. prerendering or snapshot runs)
detectedPlatform = {
// the following properties are deprecated and will be removed in the next major release
gesture: false,
node: true,
touch: false,
unknown: true,
// the following properties are new and will be available in the next major release
type: 'node',
browserName: 'unknown',
browserVersion: 0 /* magic number for unknown */
Expand All @@ -298,43 +138,18 @@ const detect = () => {
const platform = {};

[
// the following properties are deprecated and will be removed in the next major release
'gesture',
'node',
'platformName',
'touch',
'touchscreen',
'unknown',
// the following properties are new and will be available in the next major release
'browserName',
'browserVersion',
'chrome',
'firefox',
'safari',
'touchEvent',
'touchScreen',
'type',
...(new Set(platforms.map(p => p.platform)))
'type'
].forEach(name => {
Object.defineProperty(platform, name, {
enumerable: true,
get: () => {
if (name === 'gesture' || name === 'unknown') {
deprecate({
name,
until: '5.0.0'
});
}
if (name === 'node') {
deprecate({name, until: '5.0.0', replacedBy: 'type'});
}
if (name === 'platformName') {
deprecate({name, until: '5.0.0', replacedBy: 'browserName'});
}
if (name === 'touch') {
deprecate({name, until: '5.0.0', replacedBy: 'touchEvent'});
}
if (name === 'touchscreen') {
deprecate({name, until: '5.0.0', replacedBy: 'touchScreen'});
}

const p = detect();
return p[name];
}
Expand Down
Loading

0 comments on commit c8490da

Please sign in to comment.