Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/ui-extensions

Package Overview
Dependencies
Maintainers
27
Versions
678
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/ui-extensions - npm Package Compare versions

Comparing version 0.0.0-unstable-20230307212523 to 0.0.0-unstable-20230321144342

3

build/ts/surfaces/admin/api/customer-segmentation-template/customer-segmentation-template.d.ts

@@ -5,8 +5,5 @@ import type { StandardApi } from '../standard/standard';

type CustomerSegmentationFeature = 'productsPurchasedByTags' | 'aggregateFilters';
type TemplateCategory = 'all' | 'firstTimeBuyers' | 'highValueCustomers' | 'reEngageCustomers' | 'abandonedCheckout' | 'purchaseBehaviour' | 'location';
export interface CustomerSegmentationTemplateApi<ExtensionPoint extends AnyExtensionPoint> extends StandardApi<ExtensionPoint> {
i18n: I18n;
/** @private */
__category: TemplateCategory;
/** @private */
__enabledFeatures: CustomerSegmentationFeature[];

@@ -13,0 +10,0 @@ }

2

build/ts/surfaces/admin/components/CustomerSegmentationTemplate/CustomerSegmentationTemplate.d.ts
type Source = 'categoriesMajor' | 'firstVisitMajor' | 'heartMajor' | 'marketingMajor' | 'checkoutMajor' | 'ordersMajor' | 'locationMajor' | 'emailNewsletterMajor' | 'firstOrderMajor' | 'billingStatementDollarMajor' | 'diamondAlertMajor' | 'abandonedCartMajor' | 'calendarMajor' | 'productsMajor' | 'globeMajor' | 'flagMajor' | 'uploadMajor' | 'buyButtonMajor' | 'followUpEmailMajor';
type TemplateCategory = 'firstTimeBuyers' | 'highValueCustomers' | 'reEngageCustomers' | 'abandonedCheckout' | 'purchaseBehaviour' | 'location';
/**

@@ -15,2 +16,3 @@ * Reserved namespace and key for the customer standard metafield used in the template's query.

dateAdded?: Date;
category?: TemplateCategory;
}

@@ -17,0 +19,0 @@ /**

{
"name": "@shopify/ui-extensions",
"version": "0.0.0-unstable-20230307212523",
"version": "0.0.0-unstable-20230321144342",
"main": "index.js",

@@ -5,0 +5,0 @@ "module": "index.mjs",

@@ -12,11 +12,2 @@ import type {StandardApi} from '../standard/standard';

type TemplateCategory =
| 'all'
| 'firstTimeBuyers'
| 'highValueCustomers'
| 'reEngageCustomers'
| 'abandonedCheckout'
| 'purchaseBehaviour'
| 'location';
export interface CustomerSegmentationTemplateApi<

@@ -28,5 +19,3 @@ ExtensionPoint extends AnyExtensionPoint,

/** @private */
__category: TemplateCategory;
/** @private */
__enabledFeatures: CustomerSegmentationFeature[];
}

@@ -24,2 +24,10 @@ import {createRemoteComponent} from '@remote-ui/core';

type TemplateCategory =
| 'firstTimeBuyers'
| 'highValueCustomers'
| 'reEngageCustomers'
| 'abandonedCheckout'
| 'purchaseBehaviour'
| 'location';
/**

@@ -46,2 +54,6 @@ * Reserved namespace and key for the customer standard metafield used in the template's query.

dateAdded?: Date;
/* The category in which the template will be visible.
When provided, the template will show in its respective category and aggregate sections.
When missing, the template will show in the aggregate sections only */
category?: TemplateCategory;
}

@@ -48,0 +60,0 @@

@@ -8,34 +8,31 @@ import {

'admin.customers.segmentation-templates.render',
(root, {i18n, __category, __enabledFeatures}) => {
if (__category === 'reEngageCustomers') {
const productsPurchasedOnTagsEnabled = __enabledFeatures.includes('productsPurchasedByTags');
const productTemplate = root.createComponent(CustomerSegmentationTemplate, {
title: i18n.translate('product.title'),
description: i18n.translate('product.description'),
icon: 'productsMajor',
templateQuery: productsPurchasedOnTagsEnabled
? 'products_purchased(tag: (product_tag)) = true'
: 'products_purchased(id: (product_id)) = true',
templateQueryToInsert: productsPurchasedOnTagsEnabled
? 'products_purchased(tag:'
: 'products_purchased(id:',
dateAdded: new Date('2023-01-15')
});
(root, {i18n, __enabledFeatures}) => {
const productsPurchasedOnTagsEnabled = __enabledFeatures.includes('productsPurchasedByTags');
const productTemplate = root.createComponent(CustomerSegmentationTemplate, {
title: i18n.translate('product.title'),
description: i18n.translate('product.description'),
icon: 'productsMajor',
templateQuery: productsPurchasedOnTagsEnabled
? 'products_purchased(tag: (product_tag)) = true'
: 'products_purchased(id: (product_id)) = true',
templateQueryToInsert: productsPurchasedOnTagsEnabled
? 'products_purchased(tag:'
: 'products_purchased(id:',
dateAdded: new Date('2023-01-15'),
category: 'reEngageCustomers'
});
root.appendChild(productTemplate);
}
const locationTemplate = root.createComponent(CustomerSegmentationTemplate, {
title: i18n.translate('location.title'),
description: [i18n.translate('location.firstParagraph'), i18n.translate('location.secondParagraph')],
icon: 'locationMajor',
templateQuery: "customer_cities CONTAINS 'US-NY-NewYorkCity'",
category: 'location'
});
if (__category === 'location') {
const locationTemplate = root.createComponent(CustomerSegmentationTemplate, {
title: i18n.translate('location.title'),
description: [i18n.translate('location.firstParagraph'), i18n.translate('location.secondParagraph')],
icon: 'locationMajor',
templateQuery: "customer_cities CONTAINS 'US-NY-NewYorkCity'",
});
root.appendChild(productTemplate);
root.appendChild(locationTemplate);
root.appendChild(locationTemplate);
}
root.mount();
},
);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc