dana-cli 0.0.0-stage → 0.0.26
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.
- package/.github/dependabot.yml +43 -0
- package/.github/labeler.yml +30 -0
- package/.github/workflows/bump.yml +51 -0
- package/.github/workflows/ci-cd.yml +110 -0
- package/.github/workflows/dependabot-automerge-call.yml +13 -0
- package/.nvmrc +1 -0
- package/.prettierignore +4 -0
- package/.prettierrc +4 -0
- package/CODEOWNERS +5 -0
- package/README.md +50 -2
- package/bin/bump.js +48 -0
- package/eslint.config.mjs +12 -0
- package/images/vodScreen1.png +0 -0
- package/package.json +53 -5
- package/sonar-project.properties +20 -0
- package/tools/cli/README.md +51 -0
- package/tools/cli/__mocks__/fs/promises.cjs +4 -0
- package/tools/cli/bin/dana.js +3 -0
- package/tools/cli/dana_completion.sh +156 -0
- package/tools/cli/eslint.config.mjs +14 -0
- package/tools/cli/package.json +67 -0
- package/tools/cli/rollup.config.mjs +26 -0
- package/tools/cli/src/commands/addComponent/addMenu/add-menu.ts +65 -0
- package/tools/cli/src/commands/addComponent/addMenu/addMenuDefinition.ts +21 -0
- package/tools/cli/src/commands/addComponent/addRail/add-rail.ts +59 -0
- package/tools/cli/src/commands/addComponent/addRail/addRailDefinition.ts +34 -0
- package/tools/cli/src/commands/addComponent/addScreen/add-screen.ts +42 -0
- package/tools/cli/src/commands/addComponent/addScreen/addScreenDefinition.ts +17 -0
- package/tools/cli/src/commands/addComponent/addScrollView/add-scrollView.ts +48 -0
- package/tools/cli/src/commands/addComponent/addScrollView/addScrollViewDefinition.ts +16 -0
- package/tools/cli/src/commands/addComponent/config/ComponentConfig.ts +169 -0
- package/tools/cli/src/commands/addComponent/config/componentTypes.ts +38 -0
- package/tools/cli/src/commands/addComponent/const/componentConst.ts +20 -0
- package/tools/cli/src/commands/addComponent/const/defaultConfig.ts +28 -0
- package/tools/cli/src/commands/addComponent/const/navigationConst.ts +36 -0
- package/tools/cli/src/commands/addComponent/createComponent.ts +45 -0
- package/tools/cli/src/commands/addComponent/helper/ComponentHelper.ts +98 -0
- package/tools/cli/src/commands/addDevice/add-device.ts +106 -0
- package/tools/cli/src/commands/addDevice/addDeviceDefinition.ts +13 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/androidtvConfig.ts +142 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/configTypes.ts +44 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/deviceConfig.ts +38 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/titanosConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tizenConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tvosConfig.ts +50 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/vidaaConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/webosConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/helper/addDeviceHelper.ts +121 -0
- package/tools/cli/src/commands/addDianaSkills/add-dianaSkills.ts +55 -0
- package/tools/cli/src/commands/addDianaSkills/addDianaSkillsDefinition.ts +13 -0
- package/tools/cli/src/commands/addDianaSkills/dianaDependencies.ts +15 -0
- package/tools/cli/src/commands/addModule/add-module.ts +46 -0
- package/tools/cli/src/commands/addModule/addModuleDefinition.ts +17 -0
- package/tools/cli/src/commands/addModule/moduleConst.ts +18 -0
- package/tools/cli/src/commands/authentication/AuthenticationManager.ts +255 -0
- package/tools/cli/src/commands/authentication/authDefinition.ts +51 -0
- package/tools/cli/src/commands/authentication/authHook.ts +50 -0
- package/tools/cli/src/commands/authentication/authentConst.ts +6 -0
- package/tools/cli/src/commands/authentication/commands/get-packages-token.ts +40 -0
- package/tools/cli/src/commands/authentication/commands/login.ts +63 -0
- package/tools/cli/src/commands/authentication/commands/logout.ts +26 -0
- package/tools/cli/src/commands/authentication/commands/status.ts +47 -0
- package/tools/cli/src/commands/authentication/helper/CodeArtifactHelper.ts +66 -0
- package/tools/cli/src/commands/authentication/helper/CommandHelper.ts +9 -0
- package/tools/cli/src/commands/authentication/helper/CredentialsHelper.ts +176 -0
- package/tools/cli/src/commands/authentication/helper/SPM.ts +95 -0
- package/tools/cli/src/commands/authentication/tokenHook.ts +30 -0
- package/tools/cli/src/commands/commandHelp/customHelp.ts +31 -0
- package/tools/cli/src/commands/completion/completion.ts +53 -0
- package/tools/cli/src/commands/completion/completionDefinition.ts +16 -0
- package/tools/cli/src/commands/createApp/const/createAppTasks.ts +133 -0
- package/tools/cli/src/commands/createApp/const/setupConst.ts +16 -0
- package/tools/cli/src/commands/createApp/const/templateConst.ts +10 -0
- package/tools/cli/src/commands/createApp/createApp.ts +60 -0
- package/tools/cli/src/commands/createApp/createAppDefinition.ts +26 -0
- package/tools/cli/src/commands/createApp/helpers/CreateAppHelper.ts +167 -0
- package/tools/cli/src/commands/createApp/helpers/SetupChecker.ts +98 -0
- package/tools/cli/src/commands/hooks/checkDanaProjectHook.ts +30 -0
- package/tools/cli/src/commands/zip/zip.ts +26 -0
- package/tools/cli/src/commands/zip/zipDefinition.ts +13 -0
- package/tools/cli/src/common/commonConst.ts +1 -0
- package/tools/cli/src/common/const/deviceConst.ts +110 -0
- package/tools/cli/src/common/const/exitCodeConst.ts +12 -0
- package/tools/cli/src/common/helpers/CreateArchiveHelper.ts +55 -0
- package/tools/cli/src/common/helpers/CreateFileHelper.ts +199 -0
- package/tools/cli/src/common/helpers/InputValidator.ts +58 -0
- package/tools/cli/src/common/helpers/InstallHelper.ts +202 -0
- package/tools/cli/src/common/helpers/UpdateFileHelper.ts +239 -0
- package/tools/cli/src/common/helpers/UserInputGetter.ts +145 -0
- package/tools/cli/src/common/helpers/handlebarsHelper.ts +31 -0
- package/tools/cli/src/common/helpers/stringHelper.ts +25 -0
- package/tools/cli/src/common/translation/en.json +87 -0
- package/tools/cli/src/common/translation/translation.ts +6 -0
- package/tools/cli/src/common/types/helperTypes.ts +79 -0
- package/tools/cli/src/index.ts +16 -0
- package/tools/cli/src/program.ts +59 -0
- package/tools/cli/tests/commands/addComponent/addMenu/add-menu.test.ts +96 -0
- package/tools/cli/tests/commands/addComponent/addRail/add-rail.test.ts +57 -0
- package/tools/cli/tests/commands/addComponent/addScreen/add-screen.test.ts +55 -0
- package/tools/cli/tests/commands/addComponent/addScrollView/add-scrollView.test.ts +89 -0
- package/tools/cli/tests/commands/addComponent/config/ComponentConfig.test.ts +261 -0
- package/tools/cli/tests/commands/addComponent/createComponent.test.ts +87 -0
- package/tools/cli/tests/commands/addComponent/helper/ComponentHelper.test.ts +110 -0
- package/tools/cli/tests/commands/addDevice/add-device.test.ts +117 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/androidtvConfig.test.ts +184 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/deviceConfig.test.ts +30 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/titanosConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tizenConfig.test.ts +63 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tvosConfig.test.ts +47 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/vidaaConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/webosConfig.test.ts +74 -0
- package/tools/cli/tests/commands/addDevice/helper/addDeviceHelper.test.ts +144 -0
- package/tools/cli/tests/commands/addDianaSkills/add-dianaSkills.test.ts +72 -0
- package/tools/cli/tests/commands/addModule/add-module.test.ts +108 -0
- package/tools/cli/tests/commands/authentication/AuthenticationManager.test.ts +756 -0
- package/tools/cli/tests/commands/authentication/commands/authDefinition.test.ts +53 -0
- package/tools/cli/tests/commands/authentication/commands/authHook.test.ts +94 -0
- package/tools/cli/tests/commands/authentication/commands/get-packages-token.test.ts +69 -0
- package/tools/cli/tests/commands/authentication/commands/login.test.ts +170 -0
- package/tools/cli/tests/commands/authentication/commands/logout.test.ts +77 -0
- package/tools/cli/tests/commands/authentication/commands/status.test.ts +73 -0
- package/tools/cli/tests/commands/authentication/helper/CredentialsHelper.test.ts +352 -0
- package/tools/cli/tests/commands/authentication/helper/SPM.test.ts +229 -0
- package/tools/cli/tests/commands/cliHelp/customHelp.test.ts +24 -0
- package/tools/cli/tests/commands/completion/completion.test.ts +76 -0
- package/tools/cli/tests/commands/createApp/const/createAppTasks.test.ts +70 -0
- package/tools/cli/tests/commands/createApp/createApp.test.ts +116 -0
- package/tools/cli/tests/commands/createApp/helpers/CreateAppHelper.test.ts +197 -0
- package/tools/cli/tests/commands/createApp/helpers/SetupChecker.test.ts +152 -0
- package/tools/cli/tests/commands/createApp/helpers/fixtures/myApp/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/cli/tests/commands/hooks/checkDanaProjectHook.test.ts +55 -0
- package/tools/cli/tests/commands/zip/zip.test.ts +51 -0
- package/tools/cli/tests/common/helpers/CreateArchiveHelper.test.ts +69 -0
- package/tools/cli/tests/common/helpers/CreateFileHelper.test.ts +359 -0
- package/tools/cli/tests/common/helpers/InputValidator.test.ts +93 -0
- package/tools/cli/tests/common/helpers/InstallHelper.test.ts +262 -0
- package/tools/cli/tests/common/helpers/UpdateFileHelper.test.ts +288 -0
- package/tools/cli/tests/common/helpers/UserInputGetter.test.ts +182 -0
- package/tools/cli/tests/common/helpers/handlebarsHelper.test.ts +87 -0
- package/tools/cli/tests/common/helpers/stringHelper.test.ts +35 -0
- package/tools/cli/tests/program.test.ts +215 -0
- package/tools/cli/tsconfig.json +19 -0
- package/tools/cli/tsconfig.test.json +4 -0
- package/tools/cli/vitest.config.ts +4 -0
- package/tools/templates/app-template/.dana/.gitkeep +0 -0
- package/tools/templates/app-template/Gruntfile.js +31 -0
- package/tools/templates/app-template/README.md +17 -0
- package/tools/templates/app-template/app.config.json +56 -0
- package/tools/templates/app-template/editorconfigTemplate.hbs +18 -0
- package/tools/templates/app-template/eslintrc.jsonTemplate.hbs +5 -0
- package/tools/templates/app-template/gitignoreTemplate.hbs +27 -0
- package/tools/templates/app-template/i18n/LocaleStringEnUS.json +7 -0
- package/tools/templates/app-template/i18n/README.md +32 -0
- package/tools/templates/app-template/images/dana.png +0 -0
- package/tools/templates/app-template/images/dana_logo.png +0 -0
- package/tools/templates/app-template/images/dana_logo_light.png +0 -0
- package/tools/templates/app-template/images/loading.png +0 -0
- package/tools/templates/app-template/nvmrcTemplate.hbs +1 -0
- package/tools/templates/app-template/package.json +33 -0
- package/tools/templates/app-template/profiles/app.config.browser-css.json +16 -0
- package/tools/templates/app-template/profiles/app.config.browser-lightning.json +16 -0
- package/tools/templates/app-template/scripts/app/README.md +6 -0
- package/tools/templates/app-template/scripts/app/TemplateAppRoutes.js.hbs +18 -0
- package/tools/templates/app-template/scripts/app/app.js.hbs +17 -0
- package/tools/templates/app-template/scripts/app/theme/AppTheme.js +57 -0
- package/tools/templates/app-template/scripts/app/ui/screens/AppScreen.js +106 -0
- package/tools/templates/app-template/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/templates/app-template/scripts/app/ui/views/LoaderView.js +31 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Bold.ttf +0 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Regular.ttf +0 -0
- package/tools/templates/app-template/tests/README.md +70 -0
- package/tools/templates/app-template/tests/automation/features/splash.feature +5 -0
- package/tools/templates/app-template/tests/automation/init.js +20 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/dictionary.js +31 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/helpers.js +9 -0
- package/tools/templates/app-template/tests/unit/README.md +7 -0
- package/tools/templates/app-template/tests/unit/app/TemplateAppRoutes.js.hbs +24 -0
- package/tools/templates/assets/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/components/ButtonItemView.js.hbs +69 -0
- package/tools/templates/components/ButtonView.js.hbs +65 -0
- package/tools/templates/components/ScrollItemView.js.hbs +53 -0
- package/tools/templates/components/ScrollView.js.hbs +43 -0
- package/tools/templates/components/TileView.js.hbs +55 -0
- package/tools/templates/components/screen.js.hbs +74 -0
- package/tools/templates/components/settings.js.hbs +74 -0
- package/tools/templates/components/vod.js.hbs +104 -0
- package/tools/templates/components/wtvMenuListView.js.hbs +38 -0
- package/tools/templates/components/wtvRailListView.js.hbs +44 -0
- package/tools/templates/index.ts +3 -0
- package/tools/templates/mocks/menuMock.json +29 -0
- package/tools/templates/mocks/railMock.json +101 -0
- package/tools/templates/mocks/scrollViewMock.json +165 -0
- package/tools/templates/modules/fip/images/12.png +0 -0
- package/tools/templates/modules/fip/images/audioD.png +0 -0
- package/tools/templates/modules/fip/package.json +5 -0
- package/tools/templates/modules/fip/scripts/FipModule.js +19 -0
- package/tools/templates/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/modules/fip/scripts/services/mock/fipMock.json +12 -0
- package/tools/templates/modules/fip/scripts/ui/screens/FipScreen.js +169 -0
- package/tools/templates/modules/fip/scripts/ui/views/FipContentInfoView.js +77 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailImageView.js +35 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailTextView.js +39 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoListView.js +57 -0
- package/tools/templates/modules/fip/scripts/ui/views/PlayButtonView.js +63 -0
- package/tools/templates/modules/home/package.json +5 -0
- package/tools/templates/modules/home/scripts/HomeModule.js +19 -0
- package/tools/templates/modules/home/scripts/HomeRoutes.js +19 -0
- package/tools/templates/modules/home/scripts/services/mock/highlightMock.json +40 -0
- package/tools/templates/modules/home/scripts/services/mock/homeScrollViewMock.json +170 -0
- package/tools/templates/modules/home/scripts/ui/screens/HomeScreen.js +258 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListItemView.js +37 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListView.js +22 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightContentDescriptionView.js +99 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightPlayButtonView.js +63 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightRailItemView.js +186 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeMockTileView.js +67 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeRailScrollView.js +53 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeScrollView.js +22 -0
- package/tools/templates/modules/menu/images/profile.png +0 -0
- package/tools/templates/modules/menu/package.json +5 -0
- package/tools/templates/modules/menu/scripts/MenuModule.js +18 -0
- package/tools/templates/modules/menu/scripts/MenuRoutes.js +14 -0
- package/tools/templates/modules/menu/scripts/services/menuMock.json +24 -0
- package/tools/templates/modules/menu/scripts/ui/const/MenuIcons.js +16 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuButtonView.js +101 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuListView.js +60 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuView.js +87 -0
- package/tools/templates/modules/menu/scripts/ui/views/ProfileImageView.js +30 -0
- package/tools/templates/modules/player/package.json +5 -0
- package/tools/templates/modules/player/scripts/PlayerModule.js +19 -0
- package/tools/templates/modules/player/scripts/PlayerRoutes.js +19 -0
- package/tools/templates/modules/player/scripts/ui/const/PlayerIcons.js +19 -0
- package/tools/templates/modules/player/scripts/ui/screens/PlayerScreen.js +361 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlButtonView.js +69 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlsView.js +173 -0
- package/tools/templates/modules/player/scripts/ui/views/ProgressBarView.js +53 -0
- package/tools/templates/modules/search/package.json +5 -0
- package/tools/templates/modules/search/scripts/SearchModule.js +18 -0
- package/tools/templates/modules/search/scripts/SearchRoutes.js +16 -0
- package/tools/templates/modules/search/scripts/ui/const/EnglishKeyboardData.js +31 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchIcons.js +14 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchKeyboardLayout.js +19 -0
- package/tools/templates/modules/search/scripts/ui/primitives/SearchTextPrimitive.js +36 -0
- package/tools/templates/modules/search/scripts/ui/screens/SearchScreen.js +234 -0
- package/tools/templates/modules/search/scripts/ui/services/MockSearchService.js +39 -0
- package/tools/templates/modules/search/scripts/ui/services/SearchVirtualKeyboardService.js +33 -0
- package/tools/templates/modules/search/scripts/ui/services/mock/searchMock.json +172 -0
- package/tools/templates/modules/search/scripts/ui/views/SearchView.js +62 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowItemView.js +92 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowListView.js +33 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardView.js +63 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollRailView.js +53 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollView.js +22 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchTileView.js +68 -0
- package/tools/templates/modules/search/styles/styles/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/modules/settings/package.json +5 -0
- package/tools/templates/modules/settings/scripts/SettingsModule.js +19 -0
- package/tools/templates/modules/settings/scripts/SettingsRoutes.js +19 -0
- package/tools/templates/modules/settings/scripts/ui/screens/SettingsScreen.js +200 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListItemView.js +85 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListView.js +56 -0
- package/tools/templates/modules/vod/package.json +5 -0
- package/tools/templates/modules/vod/scripts/VodModule.js +19 -0
- package/tools/templates/modules/vod/scripts/VodRoutes.js +19 -0
- package/tools/templates/modules/vod/scripts/services/mock/scrollViewMock.json +172 -0
- package/tools/templates/modules/vod/scripts/ui/screens/VodScreen.js +204 -0
- package/tools/templates/modules/vod/scripts/ui/views/MockTileView.js +69 -0
- package/tools/templates/modules/vod/scripts/ui/views/RailScrollItemView.js +53 -0
- package/tools/templates/modules/vod/scripts/ui/views/VodScrollView.js +22 -0
- package/tools/templates/package.json +14 -0
- package/tools/templates/profiles/app.config.androidtv.json +17 -0
- package/tools/templates/profiles/app.config.titanos.json +24 -0
- package/tools/templates/profiles/app.config.tizen.json +52 -0
- package/tools/templates/profiles/app.config.tvos.json +18 -0
- package/tools/templates/profiles/app.config.vidaa.json +24 -0
- package/tools/templates/profiles/app.config.webos.json +21 -0
- package/tools/templates/tutorial/modules/fip/package.json +4 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipModule.js +18 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/screens/FipContentScreen.js +146 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/ElevatorView.js +66 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/FipContentInfoView.js +90 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/PlayButtonView.js +58 -0
- package/tools/templates/tutorial/vendors/customBE/package.json +5 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/datas/contents.json +749 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/services/CustomBEVodService.js +70 -0
- package/tsconfig.json +8 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import $Routes from "@Routes";
|
|
2
|
+
import $SearchScreen from "@SearchScreen";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @name SearchRoutes
|
|
7
|
+
* @class
|
|
8
|
+
* @extends Routes
|
|
9
|
+
*/
|
|
10
|
+
export default $Routes.declare("SearchRoutes", {
|
|
11
|
+
methods: /** @lends SearchRoutes.prototype */ {
|
|
12
|
+
search: function (data) {
|
|
13
|
+
return $SearchScreen.display(data);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import $SearchIcons from "@SearchIcons";
|
|
2
|
+
|
|
3
|
+
const EnglishKeyboardData = function () {};
|
|
4
|
+
|
|
5
|
+
const statics = /** @lends EnglishKeyboardData */ {
|
|
6
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
7
|
+
// LETTERS
|
|
8
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
9
|
+
LETTERS_QWERTY_LINE_1: ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s"].map((x) => ({char: x})),
|
|
10
|
+
LETTERS_QWERTY_LINE_2: ["d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b"].map((x) => ({char: x})),
|
|
11
|
+
LETTERS_QWERTY_LINE_3: ["n", "m", "@", ".", ",", "*", "!", "?"].map((x) => ({char: x})),
|
|
12
|
+
|
|
13
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
14
|
+
// SPECIAL
|
|
15
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
16
|
+
BACKSPACE: {
|
|
17
|
+
icon: $SearchIcons.BACKSPACE,
|
|
18
|
+
action: "backspace",
|
|
19
|
+
ratio: 2
|
|
20
|
+
},
|
|
21
|
+
SPACE: {
|
|
22
|
+
icon: $SearchIcons.SPACE,
|
|
23
|
+
char: " ",
|
|
24
|
+
action: "space",
|
|
25
|
+
ratio: 2
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Object.assign(EnglishKeyboardData, statics);
|
|
30
|
+
|
|
31
|
+
export default EnglishKeyboardData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import $Const from "@Const";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* List Unicode characters defined in styles/fonts/fa-solid-900.ttf
|
|
5
|
+
* @name SearchIcons
|
|
6
|
+
* @class
|
|
7
|
+
* @extends Const
|
|
8
|
+
*/
|
|
9
|
+
export default $Const.declare("SearchIcons", {
|
|
10
|
+
statics: /** @lends SearchIcons */ {
|
|
11
|
+
BACKSPACE: "\u232B",
|
|
12
|
+
SPACE: "\uE4BA"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import $EnglishKeyboardData from "@EnglishKeyboardData";
|
|
2
|
+
|
|
3
|
+
const SearchKeyboardLayout = function () {};
|
|
4
|
+
const statics = /** @lends KeyboardLayout */ {
|
|
5
|
+
EN: {
|
|
6
|
+
DEFAULT: [
|
|
7
|
+
$EnglishKeyboardData.LETTERS_QWERTY_LINE_1,
|
|
8
|
+
$EnglishKeyboardData.LETTERS_QWERTY_LINE_2,
|
|
9
|
+
$EnglishKeyboardData.LETTERS_QWERTY_LINE_3.concat([
|
|
10
|
+
$EnglishKeyboardData.SPACE,
|
|
11
|
+
$EnglishKeyboardData.BACKSPACE
|
|
12
|
+
])
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
Object.assign(SearchKeyboardLayout, statics);
|
|
18
|
+
|
|
19
|
+
export default SearchKeyboardLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2014-2023 Wiztivi - contact@wiztivi.com
|
|
3
|
+
* All Rights Reserved
|
|
4
|
+
*
|
|
5
|
+
* All information contained herein is proprietary and confidential.
|
|
6
|
+
* Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
|
|
7
|
+
* prior written permission is obtained from Wiztivi.
|
|
8
|
+
* No warranty, explicit or implicit, provided.
|
|
9
|
+
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
13
|
+
import $Theme from "@Theme";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name SearchTextPrimitive
|
|
17
|
+
* @class
|
|
18
|
+
* @extends TextPrimitive
|
|
19
|
+
*
|
|
20
|
+
* @property {number} size
|
|
21
|
+
* @property {string} color
|
|
22
|
+
* @property {boolean} maxLines
|
|
23
|
+
* @property {boolean} ellipsis
|
|
24
|
+
* @property {string} align
|
|
25
|
+
* @property {number} height
|
|
26
|
+
*/
|
|
27
|
+
export default $TextPrimitive.declare("SearchTextPrimitive", {
|
|
28
|
+
properties: /** @lends SearchTextPrimitive.prototype */ {
|
|
29
|
+
size: 30,
|
|
30
|
+
color: $Theme.COLOR_BACKGROUND,
|
|
31
|
+
maxLines: 1,
|
|
32
|
+
ellipsis: true,
|
|
33
|
+
align: "left",
|
|
34
|
+
height: 42
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
|
|
2
|
+
import $AppScreen from "@AppScreen";
|
|
3
|
+
|
|
4
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
5
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
6
|
+
// VIEWS
|
|
7
|
+
import $SearchView from "@SearchView";
|
|
8
|
+
import $SearchKeyboardView from "@SearchKeyboardView";
|
|
9
|
+
import $SearchScrollView from "@SearchScrollView";
|
|
10
|
+
// SERVICE
|
|
11
|
+
import $VirtualKeyboardService from "@VirtualKeyboardService";
|
|
12
|
+
import $MockSearchService from "@MockSearchService";
|
|
13
|
+
// CONST
|
|
14
|
+
import $Theme from "@Theme";
|
|
15
|
+
// MANAGER
|
|
16
|
+
import $TimerManager from "@TimerManager";
|
|
17
|
+
import $NativeKeyboardConst from "@NativeKeyboardConst";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @name SearchScreen
|
|
22
|
+
* @class
|
|
23
|
+
* @extends AppScreen
|
|
24
|
+
*
|
|
25
|
+
* @screen
|
|
26
|
+
* @property {manager} timerManager
|
|
27
|
+
* @property {service} keyboardService - instance of keyboard service
|
|
28
|
+
* @property {service} searchService - searchService
|
|
29
|
+
*/
|
|
30
|
+
export default $AppScreen.declare("SearchScreen", {
|
|
31
|
+
properties: /** @lends SearchScreen.prototype */ {
|
|
32
|
+
searchService: {class: $MockSearchService},
|
|
33
|
+
keyboardService: {class: $VirtualKeyboardService},
|
|
34
|
+
timerManager: {class: $TimerManager}
|
|
35
|
+
},
|
|
36
|
+
statics: {
|
|
37
|
+
LAUNCH_SEARCH_ID: "searchInput",
|
|
38
|
+
SEARCH_DELAY: 1000,
|
|
39
|
+
X_MARGIN: 50,
|
|
40
|
+
VERTICAL_MARGIN: 50,
|
|
41
|
+
NO_RESULT_TEXT: "Sorry, no results found.",
|
|
42
|
+
DEFAULT_TEXT_FONT_SIZE: 20
|
|
43
|
+
},
|
|
44
|
+
children: /** @lends SearchScreen.prototype */ {
|
|
45
|
+
background: {class: $RectanglePrimitive},
|
|
46
|
+
scrollView: {class: $SearchScrollView},
|
|
47
|
+
cacheScroll: {class: $RectanglePrimitive},
|
|
48
|
+
inputView: {class: $SearchView},
|
|
49
|
+
keyboardView: {class: $SearchKeyboardView},
|
|
50
|
+
noResultText: {class: $TextPrimitive}
|
|
51
|
+
},
|
|
52
|
+
listen: [$NativeKeyboardConst.BUFFER_CHANGE],
|
|
53
|
+
|
|
54
|
+
methods: /** @lends SearchScreen.prototype */ {
|
|
55
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
56
|
+
// EXTENSION POINTS
|
|
57
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Prepare screen data: get the business data to feed the views
|
|
61
|
+
* View should always be fulfilled with business model(s).
|
|
62
|
+
*
|
|
63
|
+
* It must return an Object.
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
66
|
+
* @returns {Promise<Object,Error>} returns a promise resolved with the data
|
|
67
|
+
* @override
|
|
68
|
+
*/
|
|
69
|
+
prepareData: function (context) {
|
|
70
|
+
if (context.isBack) {
|
|
71
|
+
return this.data;
|
|
72
|
+
}
|
|
73
|
+
return this.keyboardService._getKeyboard().then((keyboard) => {
|
|
74
|
+
this.data.keyboard = keyboard;
|
|
75
|
+
this.data.searchData = [];
|
|
76
|
+
return this.data;
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Connect the data prepared by {@link prepareData} to the views.
|
|
82
|
+
* Use the data property, which is the return value of {@link prepareData}.
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
85
|
+
* @override
|
|
86
|
+
*/
|
|
87
|
+
connectData: function (context) {
|
|
88
|
+
if (!context.isBack) {
|
|
89
|
+
this.keyboardView.setData(this.data.keyboard);
|
|
90
|
+
this.keyboardView.buffer = "";
|
|
91
|
+
this.scrollView.setData(this.data.searchData);
|
|
92
|
+
this.updateInput("");
|
|
93
|
+
this.noResultText.text = "";
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
beforeHide: function () {
|
|
98
|
+
this.timerManager.clearTimeout(this.statics.LAUNCH_SEARCH_ID);
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
_getChildToFocus: function (options) {
|
|
102
|
+
if (options.isBack) {
|
|
103
|
+
return this.scrollView;
|
|
104
|
+
}
|
|
105
|
+
return this.keyboardView;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
109
|
+
// EVENT CALLBACKS
|
|
110
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @override
|
|
114
|
+
*/
|
|
115
|
+
down: function (key) {
|
|
116
|
+
if (this.keyboardView.isFocused === true) {
|
|
117
|
+
const nav = this.keyboardView.down();
|
|
118
|
+
|
|
119
|
+
if (!nav && this.data.searchData.length > 0) {
|
|
120
|
+
this.scrollView.focus();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return this.scrollView.down();
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @override
|
|
130
|
+
*/
|
|
131
|
+
up: function (key) {
|
|
132
|
+
if (this.scrollView.isFocused === true) {
|
|
133
|
+
const nav = this.scrollView.up();
|
|
134
|
+
|
|
135
|
+
if (!nav) {
|
|
136
|
+
this.keyboardView.focus();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
return this.keyboardView.up();
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @override
|
|
146
|
+
*/
|
|
147
|
+
ok: function (target) {
|
|
148
|
+
if (this.keyboardView.isFocused === true) {
|
|
149
|
+
return this.keyboardView.ok(target);
|
|
150
|
+
}
|
|
151
|
+
return this.route("fip", {data: this.scrollView.dataItem});
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
155
|
+
// EVENTS
|
|
156
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
157
|
+
|
|
158
|
+
onKeyboardBufferChange: function (buffer) {
|
|
159
|
+
const bufferText = buffer.text;
|
|
160
|
+
|
|
161
|
+
this.updateInput(bufferText);
|
|
162
|
+
if (bufferText === "") {
|
|
163
|
+
this.timerManager.stop(this.statics.LAUNCH_SEARCH_ID);
|
|
164
|
+
this.updateRail([]);
|
|
165
|
+
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (bufferText.length === 1) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.timerManager.setTimeout(
|
|
173
|
+
() => this.handleSearchResult(bufferText),
|
|
174
|
+
this.statics.SEARCH_DELAY,
|
|
175
|
+
this.statics.LAUNCH_SEARCH_ID
|
|
176
|
+
);
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
handleSearchResult: function (buffer) {
|
|
180
|
+
return this.searchService.getSearchResult(buffer).then((result) => {
|
|
181
|
+
this.updateRail(result);
|
|
182
|
+
this.noResultText.text = result.length ? "" : this.statics.NO_RESULT_TEXT;
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
updateInput: function (bufferText) {
|
|
187
|
+
if (!bufferText) {
|
|
188
|
+
this.inputView.searchLabel.text = "Search for movies...";
|
|
189
|
+
this.inputView.searchInput.text = "";
|
|
190
|
+
} else {
|
|
191
|
+
this.inputView.searchLabel.text = "";
|
|
192
|
+
this.inputView.searchInput.text = bufferText;
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
updateRail: function (searchData) {
|
|
197
|
+
this.data.searchData = searchData;
|
|
198
|
+
this.scrollView.setData(this.data.searchData);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
style: {
|
|
203
|
+
background: {
|
|
204
|
+
width: $Theme.FULL_SCREEN_WIDTH,
|
|
205
|
+
height: $Theme.FULL_SCREEN_HEIGHT,
|
|
206
|
+
fillColor: $Theme.COLOR_BACKGROUND
|
|
207
|
+
},
|
|
208
|
+
inputView: {
|
|
209
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
210
|
+
y: $Theme.SCREEN_TOP_MARGIN
|
|
211
|
+
},
|
|
212
|
+
keyboardView: {
|
|
213
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
214
|
+
y: ({parent}) => parent.inputView.y + parent.inputView.height + parent.statics.VERTICAL_MARGIN
|
|
215
|
+
},
|
|
216
|
+
scrollView: {
|
|
217
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
218
|
+
y: ({parent}) => parent.keyboardView.y + parent.keyboardView.height + parent.statics.VERTICAL_MARGIN
|
|
219
|
+
},
|
|
220
|
+
cacheScroll: {
|
|
221
|
+
width: $Theme.FULL_SCREEN_WIDTH,
|
|
222
|
+
height: ({parent}) => parent.keyboardView.x + parent.keyboardView.height + parent.statics.VERTICAL_MARGIN * 2,
|
|
223
|
+
fillColor: $Theme.COLOR_BACKGROUND
|
|
224
|
+
},
|
|
225
|
+
noResultText: {
|
|
226
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
227
|
+
y: ({parent}) => parent.scrollView.y,
|
|
228
|
+
width: $Theme.FULL_SCREEN_WIDTH,
|
|
229
|
+
size: ({parent}) => parent.statics.DEFAULT_TEXT_FONT_SIZE,
|
|
230
|
+
height: ({parent}) => parent.statics.DEFAULT_TEXT_FONT_SIZE + 3,
|
|
231
|
+
color: $Theme.COLOR_TEXT
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import $Class from "@Class";
|
|
2
|
+
import $ListModel from "@ListModel";
|
|
3
|
+
import searchMock from "searchMock.json!";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @name MockSearchService
|
|
8
|
+
* @class
|
|
9
|
+
* @extends Class
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default $Class.declare("MockSearchService", {
|
|
13
|
+
methods: /** @lends MockSearchService.prototype */ {
|
|
14
|
+
getSearchResult: function (input) {
|
|
15
|
+
// TODO get data from service
|
|
16
|
+
const searchData = searchMock.data.reduce((acc, el) => {
|
|
17
|
+
const movies = el.movies.filter((item) => item.original_title.toLowerCase().includes(input))
|
|
18
|
+
.map((item) => ({title: item.original_title, imageUrl: item.imageUrl, fipImage: item.fallbackUrl}));
|
|
19
|
+
|
|
20
|
+
if (movies.length) {
|
|
21
|
+
const listModel = new $ListModel({
|
|
22
|
+
data: [
|
|
23
|
+
{
|
|
24
|
+
title: el.title,
|
|
25
|
+
movies: movies
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
acc.push(listModel);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return acc;
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return Promise.resolve(searchData);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import $AbstractVirtualKeyboardService from "@AbstractVirtualKeyboardService";
|
|
2
|
+
|
|
3
|
+
import $ListModel from "@ListModel";
|
|
4
|
+
import $SearchKeyboardLayout from "@SearchKeyboardLayout";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Service to get the keyboard layout
|
|
8
|
+
*
|
|
9
|
+
* @name SearchVirtualKeyboardService
|
|
10
|
+
* @class
|
|
11
|
+
* @service
|
|
12
|
+
* @extends AbstractVirtualKeyboardService
|
|
13
|
+
* @implementation
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export default $AbstractVirtualKeyboardService.declare("SearchVirtualKeyboardService", {
|
|
17
|
+
methods: /** @lends SearchVirtualKeyboardService.prototype */ {
|
|
18
|
+
/**
|
|
19
|
+
* Get keyboard data according to options
|
|
20
|
+
* @param {String} inputType type of keyboard requested
|
|
21
|
+
* @return {Promise<ListModel<ListModel<String>>>} List of List of keyboard's char
|
|
22
|
+
*/
|
|
23
|
+
_getKeyboard: function (inputType) {
|
|
24
|
+
const layout = $SearchKeyboardLayout.EN.DEFAULT;
|
|
25
|
+
// A keyboard is a list containing one or multiple line(s) of symbol
|
|
26
|
+
const keyboard = new $ListModel({
|
|
27
|
+
data: layout.map((line) => new $ListModel({data: line}))
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return Promise.resolve(keyboard);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"title": "For You",
|
|
5
|
+
"movies": [
|
|
6
|
+
{
|
|
7
|
+
"id": "fb2991c1-a807-40c7-924d-d053b4a2c379",
|
|
8
|
+
"original_title": "Boy Erased",
|
|
9
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/oZbhTdi0ZQY7iiSQ0L7h3ya6NDF.jpg",
|
|
10
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/3m4XJ9EBKRb9HtA0AbaecBFWjz7.jpg"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "ad13892c-033e-4c13-b691-b31937a4d6cb",
|
|
14
|
+
"original_title": "Da 5 Bloods",
|
|
15
|
+
"overview": "Four African-American Vietnam veterans return to Vietnam. They are in search of the remains of their fallen squad leader and the promise of buried treasure. These heroes battle forces of humanity and nature while confronted by the lasting ravages of the immorality of the Vietnam War.",
|
|
16
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/yx4cp1ljJMDSFeEex0Zjv45b55E.jpg",
|
|
17
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/Aq5Zhj9iaTF6BEKNk05dlUxeHKa.jpg"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "aa0d7c64-87a8-4cd5-8e12-9d8432755130",
|
|
21
|
+
"original_title": "Sniper: Rogue Mission",
|
|
22
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/jSL5TqroJsDAIgBdELBwby1uhf1.jpg",
|
|
23
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/eiBMu2noc6r1QZLfQlFhfVtbXeM.jpg"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "13c1c5c4-d37b-4b14-be23-a134dadcb852",
|
|
27
|
+
"original_title": "Suite Française",
|
|
28
|
+
"overview": "France, 1940. In the first days of occupation, beautiful Lucile Angellier is trapped in a stifled existence with her controlling mother-in-law as they both await news of her husband: a prisoner of war. Parisian refugees start to pour into their small town, soon followed by a regiment of German soldiers who take up residence in the villagers' own homes. Lucile initially tries to ignore Bruno von Falk, the handsome and refined German officer staying with them. But soon, a powerful love draws them together and leads them into the tragedy of war.",
|
|
29
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/w5dV1p5yZfNMuBOgVleLi5VgOG6.jpg",
|
|
30
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/j82SfPOqas5rvHbAHAPq7OgaSir.jpg"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "e27b38c1-ad1b-4636-a738-ff8dcfdb109d",
|
|
34
|
+
"original_title": "Superman: Doomsday",
|
|
35
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/itvuWm7DFWWzWgW0xgiaKzzWszP.jpg",
|
|
36
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/oTPSjQyETTFYDehdbiG8yi2oDmL.jpg"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "875c0a94-2735-4bf3-9e8c-76d426871ded",
|
|
40
|
+
"original_title": "White Heat",
|
|
41
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/4ekAK25fz1FDzRUHuJs171uiVaI.jpg",
|
|
42
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/cap8458wFeRCJSKxL758dI82TRK.jpg"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"title": "Action",
|
|
48
|
+
"movies": [
|
|
49
|
+
{
|
|
50
|
+
"id": "1dae003c-74ed-418e-b674-cf6373d2bfb2",
|
|
51
|
+
"original_title": "Pocahontas",
|
|
52
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/kZ1ft0QZ4e3zDUPMBftEkwI9ftd.jpg",
|
|
53
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/9YAVIwBcBrLXeukg2dgMGfYB1uu.jpg"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "432084d3-773e-41ad-8a21-c30f13a54f41",
|
|
57
|
+
"original_title": "The Song of Bernadette",
|
|
58
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/kRZItSgFaSDnHePwxX5PfZvu5M8.jpg",
|
|
59
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/5gxdMOVSzWNVNSjDPzQGwP6xAed.jpg"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "77b1af4b-e9c2-4925-bed8-1ad4d8c20b42",
|
|
63
|
+
"original_title": "The Farewell",
|
|
64
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/7UrIarxfjxZC9YGj8H1ATKZMXVy.jpg",
|
|
65
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/5INPBiKVRsyp9kgHfsC0cTfvKFH.jpg"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "fd82d7eb-3028-4206-891b-8132130f37ba",
|
|
69
|
+
"original_title": "Greed",
|
|
70
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mZPmDFlVp1BSGQD4QCKHOwbXLfv.jpg",
|
|
71
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/cgmGPmyeShz9zM9GQM5EEgMutnd.jpg"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "23dafbcc-5cc6-43ba-977a-32100e1e6e53",
|
|
75
|
+
"original_title": "Hello, Dolly!",
|
|
76
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/aPZOt9BR3gnk1RyX924ySq81S4P.jpg",
|
|
77
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/rvsPkUYhWZkAKMb2fnWHw5pNAjZ.jpg"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "9fb75c7e-3dc4-4e7a-a048-29eb4b2ab734",
|
|
81
|
+
"original_title": "Wrong Place",
|
|
82
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mlEtOQAQVy6eW65sHz3UduvzRK.jpg",
|
|
83
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/zSre0UHWLSnDoNrM9F2Go9OXq5G.jpg"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"title": "Drama",
|
|
89
|
+
"movies": [
|
|
90
|
+
{
|
|
91
|
+
"id": "a17da688-fa3e-4da5-8554-7995472ee1b5",
|
|
92
|
+
"original_title": "Wendell & Wild",
|
|
93
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/s7XxXJ7ponaLAkxiySRxox2Ssc4.jpg",
|
|
94
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/apBUC70udhxoLzXo7DqclQ6gcXo.jpg"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "a3491afa-4d32-491a-8a4a-ce09ace64b7f",
|
|
98
|
+
"original_title": "V/H/S",
|
|
99
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/xVGfCaTwVdZt3lFqtOVhTDqmG58.jpg",
|
|
100
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/xAC9kXLxUHpdCkISgYcLzYrxIQR.jpg"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "214b1e0e-d364-4a64-a937-b5020bb244af",
|
|
104
|
+
"original_title": "The Rocky Horror Picture Show: Let's Do the Time Warp Again",
|
|
105
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/56KEpnJWe5KvpiPu5XmK14L7Wyr.jpg",
|
|
106
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/6IZqrGf06xdaHCt3FmROZcJ7aeu.jpg"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "fd82d7eb-3028-4206-891b-8132130f37ba",
|
|
110
|
+
"original_title": "Greed",
|
|
111
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mZPmDFlVp1BSGQD4QCKHOwbXLfv.jpg",
|
|
112
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/cgmGPmyeShz9zM9GQM5EEgMutnd.jpg"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "23dafbcc-5cc6-43ba-977a-32100e1e6e53",
|
|
116
|
+
"original_title": "Hello, Dolly!",
|
|
117
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/aPZOt9BR3gnk1RyX924ySq81S4P.jpg",
|
|
118
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/rvsPkUYhWZkAKMb2fnWHw5pNAjZ.jpg"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "9fb75c7e-3dc4-4e7a-a048-29eb4b2ab734",
|
|
122
|
+
"original_title": "Wrong Place",
|
|
123
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mlEtOQAQVy6eW65sHz3UduvzRK.jpg",
|
|
124
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/zSre0UHWLSnDoNrM9F2Go9OXq5G.jpg"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"title": "Romance",
|
|
130
|
+
|
|
131
|
+
"movies": [
|
|
132
|
+
{
|
|
133
|
+
"id": "df2bf24f-587c-4d28-8514-d6077d2d3a42",
|
|
134
|
+
"original_title": "Halloween III: Season of the Witch",
|
|
135
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/WABfdeaThFYXCySGIOvRNv2sSW.jpg",
|
|
136
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/eyOKqtgNeEEIp7zYMHnpISpsaS3.jpg"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "e27b38c1-ad1b-4636-a738-ff8dcfdb109d",
|
|
140
|
+
"original_title": "Superman: Doomsday",
|
|
141
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/itvuWm7DFWWzWgW0xgiaKzzWszP.jpg",
|
|
142
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/oTPSjQyETTFYDehdbiG8yi2oDmL.jpg"
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
{
|
|
146
|
+
"id": "875c0a94-2735-4bf3-9e8c-76d426871ded",
|
|
147
|
+
"original_title": "White Heat",
|
|
148
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/4ekAK25fz1FDzRUHuJs171uiVaI.jpg",
|
|
149
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/cap8458wFeRCJSKxL758dI82TRK.jpg"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "fd82d7eb-3028-4206-891b-8132130f37ba",
|
|
153
|
+
"original_title": "Greed",
|
|
154
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mZPmDFlVp1BSGQD4QCKHOwbXLfv.jpg",
|
|
155
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/cgmGPmyeShz9zM9GQM5EEgMutnd.jpg"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"id": "23dafbcc-5cc6-43ba-977a-32100e1e6e53",
|
|
159
|
+
"original_title": "Hello, Dolly!",
|
|
160
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/aPZOt9BR3gnk1RyX924ySq81S4P.jpg",
|
|
161
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/rvsPkUYhWZkAKMb2fnWHw5pNAjZ.jpg"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "9fb75c7e-3dc4-4e7a-a048-29eb4b2ab734",
|
|
165
|
+
"original_title": "Wrong Place",
|
|
166
|
+
"imageUrl": "https://image.tmdb.org/t/p/original/mlEtOQAQVy6eW65sHz3UduvzRK.jpg",
|
|
167
|
+
"fallbackUrl": "https://image.tmdb.org/t/p/original/zSre0UHWLSnDoNrM9F2Go9OXq5G.jpg"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import $View from "@View";
|
|
2
|
+
|
|
3
|
+
// PRIMITIVES
|
|
4
|
+
import $SearchTextPrimitive from "@SearchTextPrimitive";
|
|
5
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
6
|
+
// CONSTANTS
|
|
7
|
+
import $Theme from "@Theme";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* view to show rectanglePrimitive and play with it
|
|
11
|
+
*
|
|
12
|
+
* @name SearchView
|
|
13
|
+
* @class
|
|
14
|
+
* @extends View
|
|
15
|
+
*/
|
|
16
|
+
export default $View.declare("SearchView", {
|
|
17
|
+
statics: {
|
|
18
|
+
TEXT_X_MARGIN: 95,
|
|
19
|
+
SEARCH_BOX_WIDTH: 890,
|
|
20
|
+
TEXT_WIDTH: 890,
|
|
21
|
+
SEARCH_BOX_HEIGHT: 60,
|
|
22
|
+
TEXT_Y_MARGIN: 7
|
|
23
|
+
},
|
|
24
|
+
children: {
|
|
25
|
+
searchBox: {
|
|
26
|
+
class: $RectanglePrimitive
|
|
27
|
+
},
|
|
28
|
+
searchLabel: {
|
|
29
|
+
class: $SearchTextPrimitive,
|
|
30
|
+
text: "Search for movies..."
|
|
31
|
+
},
|
|
32
|
+
searchInput: {
|
|
33
|
+
class: $SearchTextPrimitive,
|
|
34
|
+
text: ""
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
style: {
|
|
39
|
+
width: ({statics}) => statics.SEARCH_BOX_WIDTH,
|
|
40
|
+
height: ({statics}) => statics.SEARCH_BOX_HEIGHT,
|
|
41
|
+
searchBox: {
|
|
42
|
+
borderRadius: 20,
|
|
43
|
+
width: ({parent}) => parent.statics.SEARCH_BOX_WIDTH,
|
|
44
|
+
height: ({parent}) => parent.statics.SEARCH_BOX_HEIGHT,
|
|
45
|
+
borderColor: $Theme.COLOR_ACCENT,
|
|
46
|
+
fillColor: $Theme.COLOR_TEXT,
|
|
47
|
+
borderWidth: 2
|
|
48
|
+
},
|
|
49
|
+
searchLabel: {
|
|
50
|
+
y: ({parent}) => parent.statics.TEXT_Y_MARGIN,
|
|
51
|
+
x: ({parent}) => (parent.statics.SEARCH_BOX_WIDTH - parent.statics.TEXT_WIDTH) / 2 + 10,
|
|
52
|
+
width: ({parent}) => parent.statics.TEXT_WIDTH,
|
|
53
|
+
opacity: 0.4
|
|
54
|
+
},
|
|
55
|
+
searchInput: {
|
|
56
|
+
y: ({parent}) => parent.statics.TEXT_Y_MARGIN,
|
|
57
|
+
x: ({parent}) => (parent.statics.SEARCH_BOX_WIDTH - parent.statics.TEXT_WIDTH) / 2 + 10,
|
|
58
|
+
width: ({parent}) => parent.statics.TEXT_WIDTH,
|
|
59
|
+
opacity: 1
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|