Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…es-wp into feat/13440--amp-story-audio-sticker
  • Loading branch information
Swanand01 committed Mar 29, 2024
2 parents 6e6f9d7 + ef233cf commit 829577f
Show file tree
Hide file tree
Showing 104 changed files with 3,839 additions and 1,432 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"",
{
"pattern": " \\* Copyright \\d{4} Google LLC",
"template": " * Copyright 2023 Google LLC"
"template": " * Copyright 2024 Google LLC"
},
" *",
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ jobs:
wp: 'latest'
snapshots: true
shard: '2/2'
- browser: 'chrome'
wp: '6.5-RC3'
snapshots: false
shard: '1/2'
experimental: true
- browser: 'chrome'
wp: '6.5-RC3'
snapshots: false
shard: '2/2'
experimental: true

steps:
- name: Harden Runner
Expand Down
343 changes: 176 additions & 167 deletions composer.lock

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions docs/third-party-integration/story-editor/integration-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,65 @@ const Editor = () => {
};
```

## Enabling Shopping Tab

The shopping tab allows inserting a product attachment with a draggable drawer that links to the product URL. To enable the shopping tab, you need to make a couple of changes.

In the `StoryEditor` config, add `isShoppingEnabled: true` and `shoppingProvider: 'None'`. If you have a shopping provider like WooCommerce or Shopify you can add 'Woocommerce' or 'Shopify' instead of 'None'.

```jsx
<StoryEditor
config={{
apiCallbacks,
autoSaveInterval: 10,
capabilities: { hasUploadMediaAction:true,
canManageSettings: true, },
MediaUpload,
isShoppingEnabled: true,
shoppingProvider: 'None'
}}
initialEdits={{ story }}>
<InterfaceSkeleton header={<StoryEditorHeader />}
sidebarTabs={{
document: {
title: 'Document',
Pane: DocumentPane,
},
}}
/>
</StoryEditor>
```

Next, provide `getProducts` in `apiCallbacks`:

```jsx
const getProducts = () => {
const products = [
{
productId: "1",
productBrand: "Nike",
productDetails: "Random Nike sneaker",
productImages: [
{
alt: "Image",
url: "https://static.nike.com/a/images/c_limit,w_592,f_auto/t_product_v1/4f37fca8-6bce-43e7-ad07-f57ae3c13142/air-force-1-07-shoes-WrLlWX.png",
},
],
productPrice: 1000,
productPriceCurrency: "INR",
productTitle: "Nike Sneaker",
productUrl:
"https://www.nike.com/in/t/air-force-1-07-shoes-WrLlWX/315122-111",
},
];
return Promise.resolve({ products });
};

export default getProducts;
```

After configuring these, you will see a shopping bag icon which will hold products you return from the `getProducts` function. Clicking on the product will insert an attachment.

## Sidebar Tabs

### Document Pane
Expand Down
1 change: 1 addition & 0 deletions includes/Media/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function get_allowed_mime_types(): array {
'image/jpeg',
'image/jpg',
'image/gif',
'image/avif',
],
'audio' => [
'audio/mpeg',
Expand Down
169 changes: 164 additions & 5 deletions includes/data/fonts/fonts.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 829577f

Please sign in to comment.