-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release-notes-locale
- Loading branch information
Showing
2 changed files
with
328 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,239 @@ | ||
{ "name": "wix-mobile", | ||
"mixes": [], | ||
"labels": [], | ||
"location": | ||
{ "lineno": 1, | ||
"filename": "mobile.js" }, | ||
"docs": | ||
{ "summary": "The Wix Mobile API contains functionality for working with your mobile app.", | ||
"description": | ||
[ "<blockquote class=\"important\">", | ||
"", | ||
"__Important:__", | ||
"+ This API is only relevant for custom widgets in [Branded Apps](https://www.wix.com/app-builder).", | ||
"+ Custom widgets are not yet available to all users. ", | ||
"+ This API is in [Developer Preview](https://www.wix.com/velo/reference/api-overview/developer-preview) and is subject to change. ", | ||
"", | ||
"</blockquote>", | ||
"", | ||
"", | ||
" The Wix Mobile API contains functionality for working with your mobile app.", | ||
"", | ||
" To use the Wix Mobile API, import `wixMobile` from `wix-mobile` module:", | ||
"", | ||
" ```javascript", | ||
" import wixMobile from 'wix-mobile';", | ||
" ```" ], | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"properties": [], | ||
"operations": | ||
[ { "name": "showAlert", | ||
"labels": [], | ||
"nameParams": [], | ||
"params": | ||
[ { "name": "title", | ||
"type": "string", | ||
"doc": "Alert title." }, | ||
{ "name": "message", | ||
"type": "string", | ||
"doc": "Alert message." }, | ||
{ "name": "actions", | ||
"type": "wix-mobile.Actions", | ||
"doc": "Alert actions." } ], | ||
"ret": | ||
{ "type": | ||
{ "name": "Promise", | ||
"typeParams": | ||
[ "wix-mobile.AlertResult" ] }, | ||
"doc": "Fulfilled - AlertResult." }, | ||
"locations": | ||
[ { "lineno": 28, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Creates and opens an alert modal on your mobile app.", | ||
"description": | ||
[ "![developer preview tag](https://user-images.githubusercontent.com/89579857/213133550-2b4fa3e8-e8fc-4513-a733-00abcc70925c.png) ", | ||
"", | ||
" When an app user selects an action button in the alert modal, the `showAlert()` function returns a Promise that resolves to the alert's result. ", | ||
"", | ||
" Customize the alert modal's title and message, and choose which actions an app user can take when the modal appears." ], | ||
"links": [], | ||
"examples": | ||
[ { "title": "Create and open an alert modal", | ||
"body": | ||
[ "import wixMobile from 'wix-mobile';", | ||
"", | ||
"/* Sample title value: 'Save changes?'", | ||
" *", | ||
" * Sample message value: 'Your message has not been saved'", | ||
" *", | ||
" * Sample actions value:", | ||
" * {", | ||
" * positive: {", | ||
" * \"label\": \"Save Now\",", | ||
" * \"key\": \"save\"", | ||
" * },", | ||
" * negative: {", | ||
" * \"label\": \"Discard\",", | ||
" * \"key\": \"discard\",", | ||
" * \"destructive\": true", | ||
" * },", | ||
" * neutral: {", | ||
" * \"label\": \"Remind Me Later\",", | ||
" * \"key\": \"remind\"", | ||
" * }", | ||
" * }", | ||
" */", | ||
"", | ||
"wixMobile.showAlert(title, message, actions)", | ||
" .then((alertResult) => {", | ||
" const actionKey = alertResult.key;", | ||
"", | ||
" if (actionKey === 'remind') {", | ||
" console.log('REMIND ME LATER')", | ||
" }", | ||
"", | ||
" if (actionKey === 'discard') {", | ||
" console.log('DISCARD')", | ||
" }", | ||
"", | ||
" return alertResult;", | ||
" })", | ||
" .catch((error) => {", | ||
" console.error(error);", | ||
" // Handle the error", | ||
" });", | ||
"", | ||
"/* Promise resolves to:", | ||
" * {", | ||
" * \"key\" : \"remind\"", | ||
" * }", | ||
" */" ], | ||
"extra": | ||
{ } } ], | ||
"extra": | ||
{ } }, | ||
"extra": | ||
{ } } ], | ||
"callbacks": [], | ||
"messages": | ||
[ { "name": "Actions", | ||
"locations": | ||
[ { "lineno": 47, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Alert actions.", | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"members": | ||
[ { "name": "positive", | ||
"type": "wix-mobile.PositiveAction", | ||
"doc": "Positive alert action." }, | ||
{ "name": "negative", | ||
"type": "wix-mobile.NegativeAction", | ||
"doc": "Negative alert action.", | ||
"optional": true }, | ||
{ "name": "neutral", | ||
"type": "wix-mobile.NeutralAction", | ||
"doc": "Neutral alert action. </br> **Note:** This parameter only works if you use it in conjunction with both the `positive` and `negative` parameters.", | ||
"optional": true } ], | ||
"extra": | ||
{ }, | ||
"labels": [] }, | ||
{ "name": "AlertResult", | ||
"locations": | ||
[ { "lineno": 79, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Alert's result based on the app user's selected action.", | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"members": | ||
[ { "name": "key", | ||
"type": "string", | ||
"doc": "Unique key for identifying the selected action." } ], | ||
"extra": | ||
{ }, | ||
"labels": [] }, | ||
{ "name": "NegativeAction", | ||
"locations": | ||
[ { "lineno": 63, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Negative alert action.", | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"members": | ||
[ { "name": "label", | ||
"type": "string", | ||
"doc": "The negative action button's label. For example, 'Delete'." }, | ||
{ "name": "key", | ||
"type": "string", | ||
"doc": "Unique key for identifying a negative action. For example, 'delete'." }, | ||
{ "name": "destructive", | ||
"type": "boolean", | ||
"doc": "**For iOs only.** Whether the action is classified as destructive. If `true`, the app user should carefully consider whether to press the action button.", | ||
"optional": true } ], | ||
"extra": | ||
{ }, | ||
"labels": [] }, | ||
{ "name": "NeutralAction", | ||
"locations": | ||
[ { "lineno": 71, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Neutral alert action. >**Note:** This parameter only works if you use it in conjunction with both the `positive` and `negative` parameters.", | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"members": | ||
[ { "name": "label", | ||
"type": "string", | ||
"doc": "The neutral action button's label. For example, 'Remind Me Later'." }, | ||
{ "name": "key", | ||
"type": "string", | ||
"doc": "Unique key for identifying a neutral action. For example, 'later'." }, | ||
{ "name": "destructive", | ||
"type": "boolean", | ||
"doc": "**For iOs only.** Whether the action is classified as destructive. If `true`, the app user should carefully consider whether to press the action button.", | ||
"optional": true } ], | ||
"extra": | ||
{ }, | ||
"labels": [] }, | ||
{ "name": "PositiveAction", | ||
"locations": | ||
[ { "lineno": 55, | ||
"filename": "mobile.js" } ], | ||
"docs": | ||
{ "summary": "Positive alert action.", | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"members": | ||
[ { "name": "label", | ||
"type": "string", | ||
"doc": "The positive action button's label. For example, 'Save Now'." }, | ||
{ "name": "key", | ||
"type": "string", | ||
"doc": "Unique key for identifying a positive action. For example, 'save'." }, | ||
{ "name": "destructive", | ||
"type": "boolean", | ||
"doc": "**For iOs only.** Whether the action is classified as destructive. If `true`, the app user should carefully consider whether to press the action button.", | ||
"optional": true } ], | ||
"extra": | ||
{ }, | ||
"labels": [] } ], | ||
"extra": | ||
{ "scopes": | ||
[ "frontend" ] } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ "name": "wix-navigate-mobile", | ||
"mixes": [], | ||
"labels": | ||
[ "new" ], | ||
"location": | ||
{ "lineno": 1, | ||
"filename": "navigate.js" }, | ||
"docs": | ||
{ "summary": "The `wix-navigate-mobile` module contains functionality for navigating in your mobile app.", | ||
"description": | ||
[ "<blockquote class=\"important\">", | ||
"", | ||
"__Important:__", | ||
"+ This API is only relevant for custom widgets in [Branded Apps](https://www.wix.com/app-builder).", | ||
"+ Custom widgets are not yet available to all users. ", | ||
"+ This API is in [Developer Preview](https://www.wix.com/velo/reference/api-overview/developer-preview) and is subject to change. ", | ||
"", | ||
"</blockquote>", | ||
"", | ||
"", | ||
" The Wix Navigate Mobile API contains functionality for navigating through your mobile app.", | ||
"", | ||
" To use the Wix Navigate Mobile API, import `wixNavigateMobile` from `wix-navigate-mobile` module:", | ||
"", | ||
" ```javascript", | ||
" import wixNavigateMobile from 'wix-navigate-mobile';", | ||
" ```" ], | ||
"links": [], | ||
"examples": [], | ||
"extra": | ||
{ } }, | ||
"properties": [], | ||
"operations": | ||
[ { "name": "openUrl", | ||
"labels": [], | ||
"nameParams": [], | ||
"params": | ||
[ { "name": "url", | ||
"type": "string", | ||
"doc": "The URL to open." } ], | ||
"ret": | ||
{ "type": | ||
{ "name": "Promise", | ||
"typeParams": | ||
[ "void" ] }, | ||
"doc": "Fulfilled - When the navaigation is successful." }, | ||
"locations": | ||
[ { "lineno": 28, | ||
"filename": "navigate.js" } ], | ||
"docs": | ||
{ "summary": "Directs the mobile app to open the specified URL in the device's browser.", | ||
"description": | ||
[ "![developer preview tag](https://user-images.githubusercontent.com/89579857/213133550-2b4fa3e8-e8fc-4513-a733-00abcc70925c.png)", | ||
"", | ||
" The `openUrl()` function returns a Promise that resolves when the navigation is successful. ", | ||
"", | ||
" Supported URL formats:", | ||
" + An external web address. For example, `http(s)://<my-website>`.", | ||
" + A URI such as a phone number, geographic coordinates, social media link, or email. For example, `mailto:<address>@<someplace.com>?subject=<subject>`." ], | ||
"links": [], | ||
"examples": | ||
[ { "title": "Open a URL in the device's browser", | ||
"body": | ||
[ "import wixNavigateMobile from 'wix-navigate-mobile';", | ||
"", | ||
"/* Sample url value: 'https://wa.me/15551234567?text=I%27m%20interested%20in%20your%20car%20for%20sale'*/", | ||
"", | ||
"wixNavigateMobile.openURL(url)", | ||
" .then(() => {", | ||
" console.log('URL opened successfully!');", | ||
" return;", | ||
" })", | ||
" .catch((error) => {", | ||
" console.error(error);", | ||
" // Handle the error ", | ||
"});", | ||
"", | ||
"/* Promise resolves to void */" ], | ||
"extra": | ||
{ } } ], | ||
"extra": | ||
{ } }, | ||
"extra": | ||
{ } } ], | ||
"callbacks": [], | ||
"messages": [], | ||
"extra": | ||
{ "scopes": | ||
[ "frontend" ] } } |