@24i/bigscreen-sdk 1.0.0-alpha.2054 → 1.0.1-alpha.2074

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/package.json +11 -11
  2. package/packages/grid/src/Base/Base.tsx +25 -6
  3. package/packages/grid/src/Base/MouseNavigation/MouseNavigation.tsx +58 -0
  4. package/packages/grid/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -0
  5. package/packages/grid/src/Base/MouseNavigation/index.tizen.tv.ts +1 -0
  6. package/packages/grid/src/Base/MouseNavigation/index.ts +1 -0
  7. package/packages/grid/src/Base/MouseNavigation/index.webos.tv.ts +1 -0
  8. package/packages/grid/src/Base/MouseNavigation/index.webtv.ts +1 -0
  9. package/packages/grid/src/Base/interface.ts +47 -0
  10. package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +4 -1
  11. package/packages/list/src/Base/Base.tsx +16 -5
  12. package/packages/list/src/Base/MouseNavigation/MouseNavigation.tsx +58 -0
  13. package/packages/list/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -0
  14. package/packages/list/src/Base/MouseNavigation/index.tizen.tv.ts +1 -0
  15. package/packages/list/src/Base/MouseNavigation/index.ts +1 -0
  16. package/packages/list/src/Base/MouseNavigation/index.webos.tv.ts +1 -0
  17. package/packages/list/src/Base/MouseNavigation/index.webtv.ts +1 -0
  18. package/packages/list/src/Base/interface.ts +39 -0
  19. package/packages/list/src/interface.ts +2 -0
  20. package/packages/menu/src/MenuAndContentContainer/MenuAndContentContainer.tsx +3 -1
  21. package/packages/menu/src/MenuAndContentContainer/interface.ts +1 -1
  22. package/packages/mouse-navigation/src/MouseNavigation.tsx +2 -2
  23. package/utils/create-export-maps/src/__tests__/createExportMaps.spec.ts +2 -2
  24. package/utils/create-export-maps/src/createExportMaps.ts +1 -1
  25. package/packages/create-package/dist/createPackage.js +0 -66
  26. package/packages/create-package/dist/createPackage.js.map +0 -1
  27. package/packages/create-package/dist/index.js +0 -5
  28. package/packages/create-package/dist/index.js.map +0 -1
  29. package/packages/create-package/dist/questionnaire/questions.js +0 -35
  30. package/packages/create-package/dist/questionnaire/questions.js.map +0 -1
  31. package/packages/create-package/dist/settings/Settings.js +0 -10
  32. package/packages/create-package/dist/settings/Settings.js.map +0 -1
  33. package/packages/create-package/dist/types.js +0 -3
  34. package/packages/create-package/dist/types.js.map +0 -1
  35. package/packages/grid/src/Base/Base.mouse.tsx +0 -24
  36. package/packages/grid/src/Base/index.tizen.tv.ts +0 -1
  37. package/packages/grid/src/Base/index.webos.tv.ts +0 -1
  38. package/packages/grid/src/Base/index.webtv.ts +0 -1
  39. package/packages/list/src/Base/Base.mouse.tsx +0 -28
  40. package/packages/list/src/Base/index.tizen.tv.ts +0 -1
  41. package/packages/list/src/Base/index.webos.tv.ts +0 -1
  42. package/packages/list/src/Base/index.webtv.ts +0 -1
  43. package/packages/rnv-build-engine/dist/src/constants/buildSchemes.js +0 -14
  44. package/packages/rnv-build-engine/dist/src/constants/index.js +0 -7
  45. package/packages/rnv-build-engine/dist/src/constants/platforms.js +0 -14
  46. package/packages/rnv-build-engine/dist/src/engine.js +0 -94
  47. package/packages/rnv-build-engine/dist/src/index.js +0 -26
  48. package/packages/rnv-build-engine/dist/src/resolvers/index.js +0 -29
  49. package/packages/rnv-build-engine/dist/src/resolvers/resolveBaseUrl.js +0 -31
  50. package/packages/rnv-build-engine/dist/src/resolvers/resolveBuildFileExtension.js +0 -12
  51. package/packages/rnv-build-engine/dist/src/resolvers/resolveBuildFileName.js +0 -36
  52. package/packages/rnv-build-engine/dist/src/resolvers/resolveBuildVersion.js +0 -42
  53. package/packages/rnv-build-engine/dist/src/resolvers/resolveBuildVersionOffset.js +0 -34
  54. package/packages/rnv-build-engine/dist/src/resolvers/resolveDeployLocations.js +0 -79
  55. package/packages/rnv-build-engine/dist/src/resolvers/resolveGenericRnvConfig.js +0 -47
  56. package/packages/rnv-build-engine/dist/src/resolvers/resolveHbbtvDeployConfig.js +0 -13
  57. package/packages/rnv-build-engine/dist/src/resolvers/resolveHbbtvDeployUrl.js +0 -11
  58. package/packages/rnv-build-engine/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +0 -24
  59. package/packages/rnv-build-engine/dist/src/resolvers/resolveSupportedPlatforms.js +0 -5
  60. package/packages/rnv-build-engine/dist/src/resolvers/resolveUsedFlavours.js +0 -23
  61. package/packages/rnv-build-engine/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +0 -14
  62. package/packages/rnv-build-engine/dist/src/scripts/buildAllWithScheme.js +0 -25
  63. package/packages/rnv-build-engine/dist/src/scripts/generateDeployUrls/formatTableDataSpaces.js +0 -30
  64. package/packages/rnv-build-engine/dist/src/scripts/generateDeployUrls/generateDeployUrls.js +0 -90
  65. package/packages/rnv-build-engine/dist/src/scripts/generateDeployUrls/index.js +0 -4
  66. package/packages/rnv-build-engine/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +0 -63
  67. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/afterVersionBump.js +0 -18
  68. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/beforeVersionBump.js +0 -12
  69. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/checkReleaseNotes.js +0 -16
  70. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/pushRelease.js +0 -31
  71. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +0 -6
  72. package/packages/rnv-build-engine/dist/src/scripts/gitReleaser/pushReleaseNotes.js +0 -37
  73. package/packages/rnv-build-engine/dist/src/scripts/release/deleteSourceMaps.js +0 -11
  74. package/packages/rnv-build-engine/dist/src/scripts/release/deployToAppCenter.js +0 -83
  75. package/packages/rnv-build-engine/dist/src/scripts/release/githubRelease.js +0 -128
  76. package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/generateWebhoook.js +0 -65
  77. package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/makePayload.js +0 -85
  78. package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/notifySlack.js +0 -44
  79. package/packages/rnv-build-engine/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +0 -39
  80. package/packages/rnv-build-engine/dist/src/scripts/release/sentryRelease.js +0 -85
  81. package/packages/rnv-build-engine/dist/src/scripts/release/urlsMarkdown.js +0 -62
  82. package/packages/rnv-build-engine/dist/src/scripts/releaseAllWithScheme.js +0 -79
  83. package/packages/rnv-build-engine/dist/src/scripts/utils/cmdUtils.js +0 -12
  84. package/packages/rnv-build-engine/dist/src/scripts/utils/fsUtils.js +0 -33
  85. package/packages/rnv-build-engine/dist/src/scripts/utils/generateIcons.js +0 -29
  86. package/packages/rnv-build-engine/dist/src/scripts/utils/gitUtils.js +0 -78
  87. package/packages/rnv-build-engine/dist/src/scripts/utils/index.js +0 -27
  88. package/packages/rnv-build-engine/dist/src/scripts/utils/stringUtils.js +0 -5
  89. package/packages/rnv-build-engine/dist/src/sdks/index.js +0 -42
  90. package/packages/rnv-build-engine/dist/src/sdks/sdk-tizen/index.js +0 -13
  91. package/packages/rnv-build-engine/dist/src/sdks/sdk-tizen/sdkTizen.js +0 -168
  92. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/index.js +0 -14
  93. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/registerSdkPath.js +0 -14
  94. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/index.js +0 -5
  95. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/sdkInstaller.js +0 -37
  96. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/clean.js +0 -11
  97. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/download.js +0 -76
  98. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/index.js +0 -11
  99. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/install.js +0 -23
  100. package/packages/rnv-build-engine/dist/src/sdks/sdk-utils/sdk-installer/services/unzip.js +0 -12
  101. package/packages/rnv-build-engine/dist/src/sdks/sdk-webos/index.js +0 -13
  102. package/packages/rnv-build-engine/dist/src/sdks/sdk-webos/sdkWebos.js +0 -80
  103. package/packages/rnv-build-engine/dist/src/sdks/sdk-webpack/index.js +0 -13
  104. package/packages/rnv-build-engine/dist/src/sdks/sdk-webpack/sdkWebpack.js +0 -6
  105. package/packages/rnv-build-engine/dist/src/sdks/sdk-xbox/index.js +0 -13
  106. package/packages/rnv-build-engine/dist/src/sdks/sdk-xbox/sdkXbox.js +0 -221
  107. package/packages/rnv-build-engine/dist/src/tasks/deploy/aswS3/aws.js +0 -22
  108. package/packages/rnv-build-engine/dist/src/tasks/deploy/aswS3/deployS3.js +0 -71
  109. package/packages/rnv-build-engine/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +0 -94
  110. package/packages/rnv-build-engine/dist/src/tasks/engineTasks.js +0 -24
  111. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.build.js +0 -91
  112. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.configure.js +0 -42
  113. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.configureSoft.js +0 -30
  114. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.deploy.js +0 -40
  115. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.hooks.run.js +0 -70
  116. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.package.js +0 -18
  117. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.platform.configure.js +0 -37
  118. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.project.configure.js +0 -116
  119. package/packages/rnv-build-engine/dist/src/tasks/task.rnv.start.js +0 -73
  120. package/packages/rnv-build-engine/dist/src/types/c.js +0 -2
  121. package/packages/rnv-build-engine/dist/src/types/constants.js +0 -2
  122. package/packages/rnv-build-engine/dist/src/types/index.js +0 -2
  123. package/packages/rnv-build-engine/dist/src/utils/forEachSupportedPlatformFlavour.js +0 -24
  124. package/packages/rnv-build-engine/dist/src/utils/generatePngSpriteMap.js +0 -78
  125. package/packages/rnv-build-engine/dist/src/utils/generateSvgSpriteMap.js +0 -113
  126. package/packages/rnv-build-engine/dist/src/utils/mergeSvgAndPngIcons.js +0 -65
  127. package/packages/rnv-build-engine/dist/src/utils/replaceRelevantStringsInConfig/index.js +0 -5
  128. package/packages/rnv-build-engine/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +0 -31
  129. package/packages/rnv-build-engine/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +0 -40
  130. package/packages/rnv-build-engine/dist/src/utils/zipBuildsByPlatforms.js +0 -61
  131. package/packages/rnv-build-engine/dist/templates/platforms/_shared/template.js +0 -87
  132. package/packages/rnv-build-engine/dist/templates/platforms/_shared/utils/extendSass.js +0 -29
  133. package/packages/rnv-build-engine/dist/templates/platforms/_shared/utils/joinStrings.js +0 -5
  134. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.base.js +0 -234
  135. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.config.dev.js +0 -6
  136. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.config.prod.js +0 -6
  137. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpack.extend.js +0 -8
  138. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpackConfigAdapter.js +0 -100
  139. package/packages/rnv-build-engine/dist/templates/platforms/_shared/webpackPlatformProps.js +0 -8
  140. package/packages/rnv-build-engine/dist/templates/platforms/hbbtv/webpackPlatformProps.js +0 -24
  141. package/packages/rnv-build-engine/dist/templates/platforms/tizen/project/.project +0 -24
  142. package/packages/rnv-build-engine/dist/templates/platforms/tizen/project/.tproject +0 -12
  143. package/packages/rnv-build-engine/dist/templates/platforms/tizen/project/config.xml +0 -17
  144. package/packages/rnv-build-engine/dist/templates/platforms/webos/project/.project +0 -35
  145. package/packages/rnv-build-engine/dist/templates/platforms/webos/project/appinfo.json +0 -19
  146. package/packages/rnv-build-engine/dist/templates/platforms/webos/webpackPlatformProps.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/bigscreen-sdk",
3
- "version": "1.0.0-alpha.2054",
3
+ "version": "1.0.1-alpha.2074",
4
4
  "description": "SmartApps BIGscreen SDK monorepo",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,8 +38,8 @@
38
38
  "homepage": "https://github.com/24i/smartapps-bigscreen-sdk#readme",
39
39
  "dependencies": {
40
40
  "@24i/player-base": "6.10.0",
41
- "@24i/smartapps-datalayer": "2.3.0-beta.1",
42
- "@sentry/browser": "^7.6.0",
41
+ "@24i/smartapps-datalayer": "2.3.2",
42
+ "@sentry/browser": "^7.8.0",
43
43
  "@types/prop-types": "^15.7.5",
44
44
  "@types/scheduler": "^0.16.1",
45
45
  "csstype": "^3.1.0",
@@ -50,13 +50,13 @@
50
50
  "@24i/bigscreen-sdk": "file:.",
51
51
  "@24i/eslint-config-smartapps-bigscreen-linters": "file:./libs/linters",
52
52
  "@24i/smartapps-bigscreen-changelog-generator": "0.17.0",
53
- "@babel/core": "^7.18.6",
54
- "@babel/preset-env": "^7.18.6",
53
+ "@babel/core": "^7.18.9",
54
+ "@babel/preset-env": "^7.18.9",
55
55
  "@types/fs-extra": "^9.0.13",
56
56
  "@types/inquirer": "^8.2.1",
57
- "@types/jest": "^28.1.5",
57
+ "@types/jest": "^28.1.6",
58
58
  "@types/minimist": "^1.2.2",
59
- "@types/node": "^17.0.43",
59
+ "@types/node": "^18.6.3",
60
60
  "@types/react": "^18.0.15",
61
61
  "babel-jest": "^28.1.2",
62
62
  "chalk": "^4.1.2",
@@ -65,15 +65,15 @@
65
65
  "fs-extra": "^10.1.0",
66
66
  "full-icu": "^1.4.0",
67
67
  "identity-obj-proxy": "^3.0.0",
68
- "inquirer": "^9.0.0",
68
+ "inquirer": "^9.0.2",
69
69
  "jest": "^28.1.2",
70
70
  "jest-canvas-mock": "^2.4.0",
71
71
  "jest-environment-jsdom": "^28.1.2",
72
72
  "minimist": "^1.2.6",
73
73
  "patch-package": "^6.2.1",
74
- "sass": "^1.53.0",
74
+ "sass": "^1.54.0",
75
75
  "sass-true": "^6.1.0",
76
- "ts-jest": "^28.0.4",
76
+ "ts-jest": "^28.0.7",
77
77
  "ts-node": "^10.8.2",
78
78
  "tsconfig-paths-jest": "0.0.1",
79
79
  "typescript": "^4.7.2"
@@ -271,4 +271,4 @@
271
271
  "./zapping/interface": "./packages/zapping/src/interface.ts",
272
272
  "./zapping": "./packages/zapping/src/index.ts"
273
273
  }
274
- }
274
+ }
@@ -1,13 +1,14 @@
1
1
  import { createRef, Component, Reference, DeclareProps } from '@24i/bigscreen-sdk/jsx';
2
2
  import { device } from '@24i/bigscreen-sdk/device';
3
- import { MouseNavigation } from '@24i/bigscreen-sdk/mouse-navigation';
4
3
  import { Scroller } from '@24i/bigscreen-sdk/scroller';
5
4
  import { stopEvent } from '@24i/bigscreen-sdk/utils/stopEvent';
6
5
  import { noop } from '@24i/bigscreen-sdk/utils/noop';
7
6
  import { forEach } from '@24i/bigscreen-sdk/perf-utils/array';
8
7
  import { createTimeout, createCounter, ICounter } from '@24i/bigscreen-sdk/utils';
8
+ import { MouseNavigation } from './MouseNavigation';
9
9
  import { FastFocusingOptimizer } from '../FastFocusingOptimizer/FastFocusingOptimizer';
10
10
  import { SharedProps, Item } from '../types';
11
+ import { MouseNavigation as IMouseNavigation } from './interface';
11
12
 
12
13
  export type Props<T extends Item<U>, U> = Omit<SharedProps<T, U>, 'scrollStep'> & {
13
14
  forward: () => boolean,
@@ -21,7 +22,6 @@ export type Props<T extends Item<U>, U> = Omit<SharedProps<T, U>, 'scrollStep'>
21
22
  adjustFocusFromTarget?: (itemRefIndex: number, groupRefIndex: number) => void,
22
23
  horizontal?: boolean,
23
24
  limit?: number,
24
- mrcuRef?: Reference<MouseNavigation>;
25
25
  shouldApplySlowdown?: () => boolean,
26
26
  };
27
27
 
@@ -55,6 +55,8 @@ export class GridBase<T extends Item<U>, U>
55
55
 
56
56
  scrollerDom = createRef<HTMLDivElement>();
57
57
 
58
+ mrcuRef = createRef<IMouseNavigation>();
59
+
58
60
  itemRefs: Reference<T>[] = [];
59
61
 
60
62
  groupRefs: Reference<HTMLDivElement>[] = [];
@@ -151,14 +153,13 @@ export class GridBase<T extends Item<U>, U>
151
153
  onWheel = (event: WheelEvent) => {
152
154
  const {
153
155
  forwardGroup, backwardGroup, shouldApplySlowdown,
154
- mrcuRef,
155
156
  } = this.props;
156
157
  let processed;
157
158
  if (event.deltaY > 0) processed = shouldApplySlowdown() || forwardGroup();
158
159
  else if (event.deltaY < 0) processed = shouldApplySlowdown() || backwardGroup();
159
160
  if (processed) {
160
161
  stopEvent(event);
161
- mrcuRef?.current?.handleArrowState();
162
+ this.mrcuRef.current?.handleArrowState();
162
163
  if (this.fastScrollingCounter) {
163
164
  this.fastScrollingCounter.add();
164
165
  this.fakeWheelStop();
@@ -434,7 +435,15 @@ export class GridBase<T extends Item<U>, U>
434
435
  }
435
436
 
436
437
  render() {
437
- const { horizontal, className } = this.props;
438
+ const {
439
+ horizontal,
440
+ className,
441
+ forwardGroup,
442
+ backwardGroup,
443
+ shouldShowMrcuForward,
444
+ shouldShowMrcuBackward,
445
+ } = this.props;
446
+
438
447
  return (
439
448
  <Scroller
440
449
  className={className}
@@ -443,7 +452,17 @@ export class GridBase<T extends Item<U>, U>
443
452
  onKeyDown={this.onKeyDown}
444
453
  horizontal={horizontal}
445
454
  >
446
- {this.renderData()}
455
+ <>{this.renderData()}</>
456
+ <MouseNavigation
457
+ // @ts-ignore - needed to convert fallback (false) to interface
458
+ ref={this.mrcuRef}
459
+ getMountingPoint={() => this.scroller.current!.wrapRef}
460
+ horizontal={horizontal}
461
+ forward={forwardGroup}
462
+ backward={backwardGroup}
463
+ shouldShowMrcuForward={shouldShowMrcuForward}
464
+ shouldShowMrcuBackward={shouldShowMrcuBackward}
465
+ />
447
466
  </Scroller>
448
467
  );
449
468
  }
@@ -0,0 +1,58 @@
1
+ import { Component, createRef } from '@24i/bigscreen-sdk/jsx';
2
+ import { MouseNavigation as MouseNavigationBase } from '@24i/bigscreen-sdk/mouse-navigation';
3
+ import { device } from '@24i/bigscreen-sdk/device';
4
+ import {
5
+ MouseNavigationProps as Props,
6
+ MouseNavigation as IMouseNavigation,
7
+ } from '../interface';
8
+
9
+ export class MouseNavigation extends Component<Props> implements IMouseNavigation {
10
+ private readonly div = createRef<HTMLDivElement>();
11
+
12
+ private readonly base = createRef<MouseNavigationBase>();
13
+
14
+ componentDidMount() {
15
+ if (device.isMouseUsed()) {
16
+ this.renderArrows();
17
+ }
18
+ }
19
+
20
+ handleArrowState() {
21
+ this.base?.current?.handleArrowState();
22
+ }
23
+
24
+ renderArrows() {
25
+ const {
26
+ horizontal,
27
+ forward,
28
+ backward,
29
+ shouldShowMrcuForward,
30
+ shouldShowMrcuBackward,
31
+ getMountingPoint,
32
+ } = this.props;
33
+
34
+ const direction = horizontal ? 'horizontal' : 'vertical';
35
+
36
+ this.appendMount(
37
+ <div ref={this.div} className="mouse-navigation">
38
+ <MouseNavigationBase
39
+ // @ts-ignore - needed to convert fallback (false) to interface
40
+ ref={this.base}
41
+ getMountingPoint={() => this.div}
42
+ direction={direction}
43
+ forward={forward}
44
+ backward={backward}
45
+ shouldShowMrcuForward={shouldShowMrcuForward}
46
+ shouldShowMrcuBackward={shouldShowMrcuBackward}
47
+ >
48
+ {null as unknown as JSX.Element}
49
+ </MouseNavigationBase>
50
+ </div>,
51
+ getMountingPoint(),
52
+ );
53
+ }
54
+
55
+ render() {
56
+ return null;
57
+ }
58
+ }
@@ -0,0 +1,4 @@
1
+ import { MouseNavigationProps as Props } from '../interface';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
+ export const MouseNavigation = (props: Props) => false as unknown as JSX.Element;
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigationFallback';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1,47 @@
1
+ import { Reference, Component } from '@24i/bigscreen-sdk/jsx';
2
+
3
+ export type MouseNavigationProps = {
4
+ /**
5
+ * Function to call on the press of the right arrow.
6
+ */
7
+ forward(): boolean,
8
+ /**
9
+ * Function to call on the press of the left arrow.
10
+ */
11
+ backward(): boolean,
12
+ /**
13
+ * Function to call on the press of the down arrow.
14
+ */
15
+ forwardGroup?(): boolean,
16
+ /**
17
+ * Function to call on the press of the up arrow.
18
+ */
19
+ backwardGroup?(): boolean,
20
+ /**
21
+ * Function which determines whether to show the forward arrow.
22
+ */
23
+ shouldShowMrcuForward?(): boolean,
24
+ /**
25
+ * Function which determines whether to show the backward arrow.
26
+ */
27
+ shouldShowMrcuBackward?(): boolean,
28
+ /**
29
+ * Returns a reference to the element where your `children` should be rendered.
30
+ */
31
+ getMountingPoint(): Reference<HTMLElement>;
32
+ /**
33
+ * Property determines whether navigation is horizontal.
34
+ */
35
+ horizontal?: boolean,
36
+ };
37
+
38
+ export interface MouseNavigation extends Component<MouseNavigationProps> {
39
+ /**
40
+ * Function to disable showing an arrow in the given direction.
41
+ */
42
+ handleArrowState(): void,
43
+ }
44
+
45
+ export interface MouseNavigationComponent {
46
+ new (props: MouseNavigationProps): MouseNavigation,
47
+ }
@@ -295,6 +295,8 @@ export class UnifiedGridController<T> implements IUnifiedGridController<T> {
295
295
  }
296
296
 
297
297
  focusToIndex(dataIndex: number, animate = false) {
298
+ const { grid } = this;
299
+ const base = grid.base.current!;
298
300
  const targetScrollIndex = this.itemIndexToScrollIndex(dataIndex);
299
301
  if (targetScrollIndex > this.scrollIndex) {
300
302
  this.adjustGroupsOffsetsForward(targetScrollIndex);
@@ -304,8 +306,9 @@ export class UnifiedGridController<T> implements IUnifiedGridController<T> {
304
306
  if (targetScrollIndex !== this.scrollIndex) {
305
307
  this.scroll(targetScrollIndex, animate);
306
308
  }
307
- this.grid.base.current!.index = dataIndex;
309
+ base.index = dataIndex;
308
310
  this.focusCurrentItem();
311
+ base.mrcuRef.current?.handleArrowState();
309
312
  }
310
313
 
311
314
  protected focusScrollWrap() {
@@ -1,5 +1,4 @@
1
1
  import { createRef, Component, Reference, DeclareProps } from '@24i/bigscreen-sdk/jsx';
2
- import { MouseNavigation } from '@24i/bigscreen-sdk/mouse-navigation';
3
2
  import { device } from '@24i/bigscreen-sdk/device';
4
3
  import { Scroller } from '@24i/bigscreen-sdk/scroller';
5
4
  import { forEach } from '@24i/bigscreen-sdk/perf-utils/array';
@@ -10,8 +9,12 @@ import {
10
9
  ICounter,
11
10
  createTimeout,
12
11
  } from '@24i/bigscreen-sdk/utils';
12
+ import { MouseNavigation } from './MouseNavigation';
13
13
  import { FastFocusingOptimizer } from '../FastFocusingOptimizer/FastFocusingOptimizer';
14
14
  import { BasicProps, Item } from '../types';
15
+ import {
16
+ MouseNavigation as IMouseNavigation,
17
+ } from './interface';
15
18
 
16
19
  export type Props<T extends Item<U>, U> = BasicProps<T, U> & {
17
20
  forward: () => boolean,
@@ -21,7 +24,6 @@ export type Props<T extends Item<U>, U> = BasicProps<T, U> & {
21
24
  shouldShowMrcuForward?: () => boolean,
22
25
  shouldShowMrcuBackward?: () => boolean,
23
26
  adjustFocusFromTarget?: (itemRefIndex: number) => void,
24
- mrcuRef?: Reference<MouseNavigation>;
25
27
  limit?: number,
26
28
  shouldApplySlowdown?: () => boolean,
27
29
  };
@@ -45,6 +47,8 @@ export class ListBase<T extends Item<U>, U>
45
47
 
46
48
  scrollerDom = createRef<HTMLDivElement>();
47
49
 
50
+ mrcuRef = createRef<IMouseNavigation>();
51
+
48
52
  itemRefs: Reference<T>[] = [];
49
53
 
50
54
  index = 0;
@@ -123,15 +127,16 @@ export class ListBase<T extends Item<U>, U>
123
127
 
124
128
  onWheel = (event: WheelEvent) => {
125
129
  const {
126
- forward, backward, mrcuRef, shouldApplySlowdown,
130
+ horizontal, forward, backward, shouldApplySlowdown,
127
131
  } = this.props;
128
132
  let processed;
133
+ if (horizontal) return;
129
134
  if (event.deltaY > 0) processed = shouldApplySlowdown() || forward();
130
135
  else if (event.deltaY < 0) processed = shouldApplySlowdown() || backward();
131
136
  if (processed) {
132
137
  stopEvent(event);
133
138
  this.fastScrollingCounter?.add();
134
- mrcuRef?.current?.handleArrowState();
139
+ this.mrcuRef?.current?.handleArrowState();
135
140
  this.fakeWheelStop();
136
141
  } else if (processed === false) {
137
142
  this.fastFocusingOptimizer.stop();
@@ -348,7 +353,13 @@ export class ListBase<T extends Item<U>, U>
348
353
  onKeyDown={this.onKeyDown}
349
354
  horizontal={horizontal}
350
355
  >
351
- {this.renderData()}
356
+ <>{this.renderData()}</>
357
+ <MouseNavigation
358
+ // @ts-ignore - needed to convert fallback (false) to interface
359
+ ref={this.mrcuRef}
360
+ getMountingPoint={() => this.scroller.current!.wrapRef}
361
+ {...this.props}
362
+ />
352
363
  </Scroller>
353
364
  );
354
365
  }
@@ -0,0 +1,58 @@
1
+ import { Component, createRef } from '@24i/bigscreen-sdk/jsx';
2
+ import { MouseNavigation as MouseNavigationBase } from '@24i/bigscreen-sdk/mouse-navigation';
3
+ import { device } from '@24i/bigscreen-sdk/device';
4
+ import {
5
+ MouseNavigationProps as Props,
6
+ MouseNavigation as IMouseNavigation,
7
+ } from '../interface';
8
+
9
+ export class MouseNavigation extends Component<Props> implements IMouseNavigation {
10
+ private readonly div = createRef<HTMLDivElement>();
11
+
12
+ private readonly base = createRef<MouseNavigationBase>();
13
+
14
+ componentDidMount() {
15
+ if (device.isMouseUsed()) {
16
+ this.renderArrows();
17
+ }
18
+ }
19
+
20
+ handleArrowState() {
21
+ this.base?.current?.handleArrowState();
22
+ }
23
+
24
+ renderArrows() {
25
+ const {
26
+ horizontal,
27
+ forward,
28
+ backward,
29
+ shouldShowMrcuForward,
30
+ shouldShowMrcuBackward,
31
+ getMountingPoint,
32
+ } = this.props;
33
+
34
+ const direction = horizontal ? 'horizontal' : 'vertical';
35
+
36
+ this.appendMount(
37
+ <div ref={this.div} className="mouse-navigation">
38
+ <MouseNavigationBase
39
+ // @ts-ignore - needed to convert fallback (false) to interface
40
+ ref={this.base}
41
+ getMountingPoint={() => this.div}
42
+ direction={direction}
43
+ forward={forward}
44
+ backward={backward}
45
+ shouldShowMrcuForward={shouldShowMrcuForward}
46
+ shouldShowMrcuBackward={shouldShowMrcuBackward}
47
+ >
48
+ {null as unknown as JSX.Element}
49
+ </MouseNavigationBase>
50
+ </div>,
51
+ getMountingPoint(),
52
+ );
53
+ }
54
+
55
+ render() {
56
+ return null;
57
+ }
58
+ }
@@ -0,0 +1,4 @@
1
+ import { MouseNavigationProps as Props } from '../interface';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
+ export const MouseNavigation = (props: Props) => false as unknown as JSX.Element;
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigationFallback';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1 @@
1
+ export { MouseNavigation } from './MouseNavigation';
@@ -0,0 +1,39 @@
1
+ import { Reference, Component } from '@24i/bigscreen-sdk/jsx';
2
+
3
+ export type MouseNavigationProps = {
4
+ /**
5
+ * Function to call on the press of the right arrow.
6
+ */
7
+ forward(): boolean,
8
+ /**
9
+ * Function to call on the press of the left arrow.
10
+ */
11
+ backward(): boolean,
12
+ /**
13
+ * Function which determines whether to show the forward arrow.
14
+ */
15
+ shouldShowMrcuForward?(): boolean,
16
+ /**
17
+ * Function which determines whether to show the backward arrow.
18
+ */
19
+ shouldShowMrcuBackward?(): boolean,
20
+ /**
21
+ * Returns a reference to the element where your `children` should be rendered.
22
+ */
23
+ getMountingPoint(): Reference<HTMLElement>;
24
+ /**
25
+ * Property determines whether navigation is horizontal.
26
+ */
27
+ horizontal?: boolean,
28
+ };
29
+
30
+ export interface MouseNavigation extends Component<MouseNavigationProps> {
31
+ /**
32
+ * Function to disable showing an arrow in the given direction.
33
+ */
34
+ handleArrowState(): void,
35
+ }
36
+
37
+ export interface MouseNavigationComponent {
38
+ new (props: MouseNavigationProps): MouseNavigation,
39
+ }
@@ -1,10 +1,12 @@
1
1
  import { Component, Reference } from '@24i/bigscreen-sdk/jsx';
2
2
  import { IFocusable } from '@24i/bigscreen-sdk/focus';
3
3
  import { SharedProps, SharedVariedProps, Item } from './types';
4
+ import { ListBase } from './Base';
4
5
 
5
6
  export interface List<
6
7
  T extends Item<U>, U, V extends SharedProps<T, U> = SharedProps<T, U>,
7
8
  > extends IFocusable, Component<V> {
9
+ base: Reference<ListBase<T, U>>,
8
10
  appendData(data: U[]): void,
9
11
  prependData(data: U[]): void,
10
12
  scrollTo(index: number): void,
@@ -116,7 +116,9 @@ export class MenuAndContentContainer<T extends string = string>
116
116
  isMenuAvailable() {
117
117
  const { router: { current: router } } = this.props;
118
118
  const scene = router?.getActiveRoute()?.component.current as SceneWithMenuAvailability;
119
- return !!scene.constructor.isMenuEnabled;
119
+ const { isMenuEnabled } = scene.constructor;
120
+ if (typeof isMenuEnabled === 'function') return isMenuEnabled();
121
+ return !!isMenuEnabled;
120
122
  }
121
123
 
122
124
  /**
@@ -83,7 +83,7 @@ export type SceneWithMenuAvailability = IRoute & {
83
83
  /**
84
84
  * static flag - true for menu is enabled, undefined (missing) or false for disabled.
85
85
  */
86
- isMenuEnabled?: boolean,
86
+ isMenuEnabled?: boolean | (() => boolean),
87
87
  }
88
88
  };
89
89
 
@@ -8,8 +8,8 @@ type Props = {
8
8
  children: JSX.Element;
9
9
  getMountingPoint: () => Reference<HTMLElement>;
10
10
  direction: Direction;
11
- forward: () => void;
12
- backward: () => void;
11
+ forward: () => any;
12
+ backward: () => any;
13
13
  shouldShowMrcuForward?: () => boolean;
14
14
  shouldShowMrcuBackward?: () => boolean;
15
15
  };
@@ -37,14 +37,14 @@ describe('createExportMaps', () => {
37
37
  createExportMaps();
38
38
  expect(writeFileSync).toHaveBeenCalledWith(
39
39
  expect.stringContaining('package.json'),
40
- JSON.stringify({
40
+ `${JSON.stringify({
41
41
  name: 'mock-root-package',
42
42
  exports: {
43
43
  './adobe-heartbeat': './packages/adobe-heartbeat/src/index.ts',
44
44
  './animations/mock': './packages/animations/src/__mocks__/JSAnimations.ts',
45
45
  './animations': './packages/animations/src/index.ts',
46
46
  }
47
- }, null, 4),
47
+ }, null, 4)}\n`,
48
48
  );
49
49
  });
50
50
  });
@@ -52,7 +52,7 @@ const createPackageJsonMapping = () => {
52
52
  exports[`./${exportAlias}`] = `./packages/${exportPath}`;
53
53
  });
54
54
  (packageJson.exports as Record<string, string>) = exports;
55
- fs.writeFileSync(resolve('./package.json'), JSON.stringify(packageJson, null, 4));
55
+ fs.writeFileSync(resolve('./package.json'), `${JSON.stringify(packageJson, null, 4)}\n`);
56
56
  };
57
57
 
58
58
  export const createExportMaps = () => {
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.main = void 0;
5
- const path = require("path");
6
- const fs = require("fs");
7
- const fse = require("fs-extra");
8
- const chalk = require("chalk");
9
- const minimist = require("minimist");
10
- const questions_1 = require("./questionnaire/questions");
11
- const Settings_1 = require("./settings/Settings");
12
- async function isDirectoryEmpty(dirPath) {
13
- const files = await fs.promises.readdir(dirPath);
14
- return !files.length;
15
- }
16
- async function copyTemplateFiles(templateDir, targetDir) {
17
- return fse.copy(templateDir, targetDir);
18
- }
19
- function updatePackageJsonFile(filePath, options) {
20
- let data = fs.readFileSync(filePath, 'utf8');
21
- const keywords = options.keywords.map((word) => `"${word}"`).join(', ');
22
- data = data.replace(/("name": ")(.*)(")/, `$1${options.name}$3`);
23
- data = data.replace(/("version": ")(.*)(")/, `$1${options.version}$3`);
24
- data = data.replace(/("description": ")(.*)(")/, `$1${options.description}$3`);
25
- data = data.replace(/("keywords": \[)(.*)(\])/, `$1${keywords}$3`);
26
- data = data.replace(/("author": ")(.*)(")/, `$1${options.author}$3`);
27
- fs.writeFileSync(filePath, data);
28
- }
29
- function parseArguments(rawArgv) {
30
- const argv = minimist(rawArgv.slice(2));
31
- const dirName = argv._[0];
32
- if (!dirName) {
33
- console.error('Error: Missing package name');
34
- process.exit(1);
35
- }
36
- return {
37
- dirName,
38
- };
39
- }
40
- async function main() {
41
- const { dirName: destDirName } = parseArguments(process.argv);
42
- const destDir = path.join(process.cwd(), 'packages/', destDirName);
43
- if (fs.existsSync(destDir)) {
44
- console.error(`Error: Target directory "${destDir}" already exists`);
45
- process.exit(1);
46
- }
47
- fs.mkdirSync(destDir, { recursive: true });
48
- const isDirEmpty = await isDirectoryEmpty(destDir);
49
- if (!isDirEmpty) {
50
- console.error(`Error: Target directory "${destDir}" is not empty.`);
51
- process.exit(1);
52
- }
53
- const settings = Object.assign({}, Settings_1.Settings);
54
- settings.name = `${Settings_1.Settings.name}${destDirName}`.toLowerCase();
55
- const details = await (0, questions_1.promptPackageDetails)(settings);
56
- const templateDir = path.join(__dirname, '..', 'templates/typescript');
57
- await copyTemplateFiles(templateDir, destDir);
58
- const packageJsonFile = path.join(destDir, 'package.json');
59
- updatePackageJsonFile(packageJsonFile, details);
60
- const docsSymlinkTarget = path.join('../../../packages/', destDirName, '/README.md');
61
- const docsSymlinkPath = path.join(process.cwd(), 'docs/packages/', destDirName, '/README.md');
62
- await fse.ensureSymlink(docsSymlinkTarget, docsSymlinkPath);
63
- console.log(`${chalk.green('Success')}, package has been initialized!`);
64
- }
65
- exports.main = main;
66
- //# sourceMappingURL=createPackage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createPackage.js","sourceRoot":"","sources":["../src/createPackage.ts"],"names":[],"mappings":";;;;AAEA,6BAA6B;AAC7B,yBAAyB;AACzB,gCAAgC;AAChC,+BAA+B;AAC/B,qCAAqC;AACrC,yDAAiE;AACjE,kDAA+C;AAG/C,KAAK,UAA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AAI,EAAE,sBAAsB,CAAC,CAAC;IAEvE,MAAM,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC3D,qBAAqB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAGhD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IACrF,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAC9F,MAAM,GAAG,CAAC,aAAa,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IAE5D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;AAC5E,CAAC;AA/BD,oBA+BC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const createPackage_1 = require("./createPackage");
4
- (0, createPackage_1.main)();
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,mDAAuC;AAEvC,IAAA,oBAAI,GAAE,CAAC"}