@shopify/ui-extensions 1.0.2 → 2.0.0-alpha.0
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/README.md +57 -1
- package/admin.d.ts +2 -0
- package/admin.esnext +2 -0
- package/admin.js +1 -0
- package/admin.mjs +2 -0
- package/build/cjs/{types/Banner.js → api.js} +0 -0
- package/build/cjs/components/BlockStack/BlockStack.js +11 -0
- package/build/cjs/components/BlockStack/README.md +1 -0
- package/build/cjs/components/Button/Button.js +11 -0
- package/build/cjs/components/Button/README.md +1 -0
- package/build/cjs/components/Text/README.md +1 -0
- package/build/cjs/components/Text/Text.js +11 -0
- package/build/cjs/components/TextField/README.md +1 -0
- package/build/cjs/components/TextField/TextField.js +11 -0
- package/build/cjs/components/View/README.md +1 -0
- package/build/cjs/components/View/View.js +11 -0
- package/build/cjs/components/index.js +45 -0
- package/build/cjs/components.js +45 -0
- package/build/cjs/{types/BlockStack.js → extension.js} +0 -0
- package/build/cjs/index.js +44 -1
- package/build/cjs/surfaces/admin/api/checkout-editor/README.md +1 -0
- package/build/cjs/{types/Heading.js → surfaces/admin/api/checkout-editor/render-settings.js} +0 -0
- package/build/cjs/surfaces/admin/api/standard/README.md +1 -0
- package/build/cjs/{types/InlineStack.js → surfaces/admin/api/standard/standard.js} +0 -0
- package/build/cjs/{types/Button.js → surfaces/admin/api.js} +0 -0
- package/build/cjs/{types/shared/index.js → surfaces/admin/components.js} +4 -4
- package/build/cjs/{types/index.js → surfaces/admin/extension-points.js} +0 -0
- package/build/cjs/surfaces/admin/extension.js +27 -0
- package/build/cjs/surfaces/admin/index.js +70 -0
- package/build/cjs/{types/shared/Spacing.js → surfaces/admin/shared.js} +0 -0
- package/build/cjs/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/build/{node/types/BlockStack.js → cjs/surfaces/checkout/api/cart-line-details/render-after.js} +0 -0
- package/build/{node/types/Button.js → cjs/surfaces/checkout/api/shared.js} +0 -0
- package/build/cjs/surfaces/checkout/api/standard/README.md +1 -0
- package/build/{node/types/Heading.js → cjs/surfaces/checkout/api/standard/standard.js} +0 -0
- package/build/{node/types/Banner.js → cjs/surfaces/checkout/api.js} +0 -0
- package/build/cjs/surfaces/checkout/components.js +18 -0
- package/build/{node/types/InlineStack.js → cjs/surfaces/checkout/extension-points.js} +0 -0
- package/build/cjs/surfaces/checkout/extension.js +27 -0
- package/build/cjs/surfaces/checkout/index.js +70 -0
- package/build/{node/types/index.js → cjs/surfaces/checkout/shared.js} +0 -0
- package/build/cjs/utilities/registration.js +110 -0
- package/build/esm/{types/Banner.mjs → api.mjs} +0 -0
- package/build/esm/components/BlockStack/BlockStack.mjs +2 -0
- package/build/esm/components/BlockStack/README.md +1 -0
- package/build/esm/components/Button/Button.mjs +2 -0
- package/build/esm/components/Button/README.md +1 -0
- package/build/esm/components/Text/README.md +1 -0
- package/build/esm/components/Text/Text.mjs +2 -0
- package/build/esm/components/TextField/README.md +1 -0
- package/build/esm/components/TextField/TextField.mjs +2 -0
- package/build/esm/components/View/README.md +1 -0
- package/build/esm/components/View/View.mjs +2 -0
- package/build/esm/components/index.mjs +5 -0
- package/build/esm/components.mjs +5 -0
- package/build/esm/{types/BlockStack.mjs → extension.mjs} +0 -0
- package/build/esm/index.mjs +3 -0
- package/build/esm/surfaces/admin/api/checkout-editor/README.md +1 -0
- package/build/esm/{types/Heading.mjs → surfaces/admin/api/checkout-editor/render-settings.mjs} +0 -0
- package/build/esm/surfaces/admin/api/standard/README.md +1 -0
- package/build/esm/{types/InlineStack.mjs → surfaces/admin/api/standard/standard.mjs} +0 -0
- package/build/esm/{types/Button.mjs → surfaces/admin/api.mjs} +0 -0
- package/build/esm/surfaces/admin/components.mjs +1 -0
- package/build/esm/{types/index.mjs → surfaces/admin/extension-points.mjs} +0 -0
- package/build/esm/surfaces/admin/extension.mjs +3 -0
- package/build/esm/surfaces/admin/index.mjs +5 -0
- package/build/esm/{types/shared/Spacing.mjs → surfaces/admin/shared.mjs} +0 -0
- package/build/esm/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/build/{esnext/types/BlockStack.esnext → esm/surfaces/checkout/api/cart-line-details/render-after.mjs} +0 -0
- package/build/{esnext/types/Button.esnext → esm/surfaces/checkout/api/shared.mjs} +0 -0
- package/build/esm/surfaces/checkout/api/standard/README.md +1 -0
- package/build/{esnext/types/Heading.esnext → esm/surfaces/checkout/api/standard/standard.mjs} +0 -0
- package/build/{esnext/types/Banner.esnext → esm/surfaces/checkout/api.mjs} +0 -0
- package/build/esm/surfaces/checkout/components.mjs +1 -0
- package/build/{esnext/types/InlineStack.esnext → esm/surfaces/checkout/extension-points.mjs} +0 -0
- package/build/esm/surfaces/checkout/extension.mjs +3 -0
- package/build/esm/surfaces/checkout/index.mjs +5 -0
- package/build/{esnext/types/index.esnext → esm/surfaces/checkout/shared.mjs} +0 -0
- package/build/esm/utilities/registration.mjs +101 -0
- package/build/esnext/{types/shared/Spacing.esnext → api.esnext} +0 -0
- package/build/esnext/components/BlockStack/BlockStack.esnext +2 -0
- package/build/esnext/components/BlockStack/README.md +1 -0
- package/build/esnext/components/Button/Button.esnext +2 -0
- package/build/esnext/components/Button/README.md +1 -0
- package/build/esnext/components/Text/README.md +1 -0
- package/build/esnext/components/Text/Text.esnext +2 -0
- package/build/esnext/components/TextField/README.md +1 -0
- package/build/esnext/components/TextField/TextField.esnext +2 -0
- package/build/esnext/components/View/README.md +1 -0
- package/build/esnext/components/View/View.esnext +2 -0
- package/build/esnext/components/index.esnext +5 -0
- package/build/esnext/components.esnext +5 -0
- package/build/esnext/extension.esnext +0 -0
- package/build/esnext/index.esnext +3 -0
- package/build/esnext/surfaces/admin/api/checkout-editor/README.md +1 -0
- package/build/esnext/surfaces/admin/api/checkout-editor/render-settings.esnext +0 -0
- package/build/esnext/surfaces/admin/api/standard/README.md +1 -0
- package/build/esnext/surfaces/admin/api/standard/standard.esnext +0 -0
- package/build/esnext/surfaces/admin/api.esnext +0 -0
- package/build/esnext/surfaces/admin/components.esnext +1 -0
- package/build/esnext/surfaces/admin/extension-points.esnext +0 -0
- package/build/esnext/surfaces/admin/extension.esnext +3 -0
- package/build/esnext/surfaces/admin/index.esnext +5 -0
- package/build/esnext/surfaces/admin/shared.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/build/esnext/surfaces/checkout/api/cart-line-details/render-after.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/shared.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/standard/README.md +1 -0
- package/build/esnext/surfaces/checkout/api/standard/standard.esnext +0 -0
- package/build/esnext/surfaces/checkout/api.esnext +0 -0
- package/build/esnext/surfaces/checkout/components.esnext +1 -0
- package/build/esnext/surfaces/checkout/extension-points.esnext +0 -0
- package/build/esnext/surfaces/checkout/extension.esnext +3 -0
- package/build/esnext/surfaces/checkout/index.esnext +5 -0
- package/build/esnext/surfaces/checkout/shared.esnext +0 -0
- package/build/esnext/utilities/registration.esnext +37 -0
- package/build/node/{types/shared/Spacing.js → api.js} +0 -0
- package/build/node/components/BlockStack/BlockStack.js +11 -0
- package/build/node/components/BlockStack/README.md +1 -0
- package/build/node/components/Button/Button.js +11 -0
- package/build/node/components/Button/README.md +1 -0
- package/build/node/components/Text/README.md +1 -0
- package/build/node/components/Text/Text.js +11 -0
- package/build/node/components/TextField/README.md +1 -0
- package/build/node/components/TextField/TextField.js +11 -0
- package/build/node/components/View/README.md +1 -0
- package/build/node/components/View/View.js +11 -0
- package/build/node/components/index.js +45 -0
- package/build/node/components.js +45 -0
- package/build/node/extension.js +1 -0
- package/build/node/index.js +44 -1
- package/build/node/surfaces/admin/api/checkout-editor/README.md +1 -0
- package/build/node/surfaces/admin/api/checkout-editor/render-settings.js +1 -0
- package/build/node/surfaces/admin/api/standard/README.md +1 -0
- package/build/node/surfaces/admin/api/standard/standard.js +1 -0
- package/build/node/surfaces/admin/api.js +1 -0
- package/build/node/{types/shared/index.js → surfaces/admin/components.js} +4 -4
- package/build/node/surfaces/admin/extension-points.js +1 -0
- package/build/node/surfaces/admin/extension.js +27 -0
- package/build/node/surfaces/admin/index.js +70 -0
- package/build/node/surfaces/admin/shared.js +1 -0
- package/build/node/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/build/node/surfaces/checkout/api/cart-line-details/render-after.js +1 -0
- package/build/node/surfaces/checkout/api/shared.js +1 -0
- package/build/node/surfaces/checkout/api/standard/README.md +1 -0
- package/build/node/surfaces/checkout/api/standard/standard.js +1 -0
- package/build/node/surfaces/checkout/api.js +1 -0
- package/build/node/surfaces/checkout/components.js +18 -0
- package/build/node/surfaces/checkout/extension-points.js +1 -0
- package/build/node/surfaces/checkout/extension.js +27 -0
- package/build/node/surfaces/checkout/index.js +70 -0
- package/build/node/surfaces/checkout/shared.js +1 -0
- package/build/node/utilities/registration.js +44 -0
- package/build/ts/api.d.ts +8 -0
- package/build/ts/api.d.ts.map +1 -0
- package/build/ts/{types/Banner.js → api.js} +0 -0
- package/build/ts/components/BlockStack/BlockStack.d.ts +8 -0
- package/build/ts/components/BlockStack/BlockStack.d.ts.map +1 -0
- package/build/ts/components/BlockStack/BlockStack.js +5 -0
- package/build/ts/components/Button/Button.d.ts +12 -0
- package/build/ts/components/Button/Button.d.ts.map +1 -0
- package/build/ts/components/Button/Button.js +5 -0
- package/build/ts/components/Text/Text.d.ts +8 -0
- package/build/ts/components/Text/Text.d.ts.map +1 -0
- package/build/ts/components/Text/Text.js +5 -0
- package/build/ts/components/TextField/TextField.d.ts +43 -0
- package/build/ts/components/TextField/TextField.d.ts.map +1 -0
- package/build/ts/components/TextField/TextField.js +5 -0
- package/build/ts/components/View/View.d.ts +8 -0
- package/build/ts/components/View/View.d.ts.map +1 -0
- package/build/ts/components/View/View.js +5 -0
- package/build/ts/components/index.d.ts +11 -0
- package/build/ts/components/index.d.ts.map +1 -0
- package/build/ts/components/index.js +13 -0
- package/build/ts/components.d.ts +11 -0
- package/build/ts/components.d.ts.map +1 -0
- package/build/ts/components.js +13 -0
- package/build/ts/extension.d.ts +15 -0
- package/build/ts/extension.d.ts.map +1 -0
- package/build/ts/{types/BlockStack.js → extension.js} +0 -0
- package/build/ts/index.d.ts +3 -1
- package/build/ts/index.d.ts.map +1 -1
- package/build/ts/index.js +17 -0
- package/build/ts/index.ts.d.ts +0 -0
- package/build/ts/surfaces/admin/api/checkout-editor/render-settings.d.ts +19 -0
- package/build/ts/surfaces/admin/api/checkout-editor/render-settings.d.ts.map +1 -0
- package/build/ts/{types/Heading.js → surfaces/admin/api/checkout-editor/render-settings.js} +0 -0
- package/build/ts/surfaces/admin/api/standard/standard.d.ts +7 -0
- package/build/ts/surfaces/admin/api/standard/standard.d.ts.map +1 -0
- package/build/ts/{types/InlineStack.js → surfaces/admin/api/standard/standard.js} +0 -0
- package/build/ts/surfaces/admin/api.d.ts +3 -0
- package/build/ts/surfaces/admin/api.d.ts.map +1 -0
- package/build/ts/{types/Button.js → surfaces/admin/api.js} +0 -0
- package/build/ts/surfaces/admin/components.d.ts +2 -0
- package/build/ts/surfaces/admin/components.d.ts.map +1 -0
- package/build/ts/{types/shared/index.js → surfaces/admin/components.js} +1 -1
- package/build/ts/surfaces/admin/extension-points.d.ts +9 -0
- package/build/ts/surfaces/admin/extension-points.d.ts.map +1 -0
- package/build/ts/{types/index.js → surfaces/admin/extension-points.js} +0 -0
- package/build/ts/surfaces/admin/extension.d.ts +4 -0
- package/build/ts/surfaces/admin/extension.d.ts.map +1 -0
- package/build/ts/surfaces/admin/extension.js +20 -0
- package/build/ts/surfaces/admin/index.d.ts +6 -0
- package/build/ts/surfaces/admin/index.d.ts.map +1 -0
- package/build/ts/surfaces/admin/index.js +21 -0
- package/build/ts/surfaces/admin/index.ts.d.ts +0 -0
- package/build/ts/surfaces/admin/shared.d.ts +8 -0
- package/build/ts/surfaces/admin/shared.d.ts.map +1 -0
- package/build/ts/{types/shared/Spacing.js → surfaces/admin/shared.js} +0 -0
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts +6 -0
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.js +2 -0
- package/build/ts/surfaces/checkout/api/shared.d.ts +4 -0
- package/build/ts/surfaces/checkout/api/shared.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/shared.js +2 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +7 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/standard/standard.js +2 -0
- package/build/ts/surfaces/checkout/api.d.ts +3 -0
- package/build/ts/surfaces/checkout/api.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api.js +2 -0
- package/build/ts/surfaces/checkout/components.d.ts +2 -0
- package/build/ts/surfaces/checkout/components.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components.js +17 -0
- package/build/ts/surfaces/checkout/extension-points.d.ts +10 -0
- package/build/ts/surfaces/checkout/extension-points.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/extension-points.js +2 -0
- package/build/ts/surfaces/checkout/extension.d.ts +4 -0
- package/build/ts/surfaces/checkout/extension.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/extension.js +20 -0
- package/build/ts/surfaces/checkout/index.d.ts +6 -0
- package/build/ts/surfaces/checkout/index.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/index.js +21 -0
- package/build/ts/surfaces/checkout/index.ts.d.ts +0 -0
- package/build/ts/surfaces/checkout/shared.d.ts +8 -0
- package/build/ts/surfaces/checkout/shared.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/shared.js +2 -0
- package/build/ts/utilities/registration.d.ts +13 -0
- package/build/ts/utilities/registration.d.ts.map +1 -0
- package/build/ts/utilities/registration.js +111 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/checkout.d.ts +2 -0
- package/checkout.esnext +2 -0
- package/checkout.js +1 -0
- package/checkout.mjs +2 -0
- package/index.d.ts +2 -1
- package/index.esnext +2 -1
- package/index.js +1 -1
- package/index.mjs +2 -1
- package/package.json +26 -4
- package/sewing-kit.config.ts +3 -1
- package/src/api.ts +8 -0
- package/src/components/BlockStack/BlockStack.ts +7 -0
- package/src/components/BlockStack/README.md +1 -0
- package/src/components/Button/Button.ts +10 -0
- package/src/components/Button/README.md +1 -0
- package/src/components/Text/README.md +1 -0
- package/src/components/Text/Text.ts +5 -0
- package/src/components/TextField/README.md +1 -0
- package/src/components/TextField/TextField.ts +45 -0
- package/src/components/View/README.md +1 -0
- package/src/components/View/View.ts +5 -0
- package/src/components/index.ts +14 -0
- package/src/components.ts +14 -0
- package/src/extension.ts +45 -0
- package/src/index.ts +3 -7
- package/src/surfaces/admin/api/checkout-editor/README.md +1 -0
- package/src/surfaces/admin/api/checkout-editor/render-settings.ts +26 -0
- package/src/surfaces/admin/api/standard/README.md +1 -0
- package/src/surfaces/admin/api/standard/standard.ts +8 -0
- package/src/surfaces/admin/api.ts +2 -0
- package/src/surfaces/admin/components.ts +1 -0
- package/src/surfaces/admin/extension-points.ts +17 -0
- package/src/surfaces/admin/extension.ts +7 -0
- package/src/surfaces/admin/index.ts +5 -0
- package/src/surfaces/admin/shared.ts +14 -0
- package/src/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/src/surfaces/checkout/api/cart-line-details/render-after.ts +7 -0
- package/src/surfaces/checkout/api/shared.ts +3 -0
- package/src/surfaces/checkout/api/standard/README.md +1 -0
- package/src/surfaces/checkout/api/standard/standard.ts +8 -0
- package/src/surfaces/checkout/api.ts +2 -0
- package/src/surfaces/checkout/components.ts +1 -0
- package/src/surfaces/checkout/extension-points.ts +21 -0
- package/src/surfaces/checkout/extension.ts +7 -0
- package/src/surfaces/checkout/index.ts +5 -0
- package/src/surfaces/checkout/shared.ts +14 -0
- package/src/utilities/registration.ts +60 -0
- package/build/esm/types/shared/index.mjs +0 -1
- package/build/esnext/types/shared/index.esnext +0 -1
- package/build/ts/types/Banner.d.ts +0 -10
- package/build/ts/types/Banner.d.ts.map +0 -1
- package/build/ts/types/BlockStack.d.ts +0 -14
- package/build/ts/types/BlockStack.d.ts.map +0 -1
- package/build/ts/types/Button.d.ts +0 -46
- package/build/ts/types/Button.d.ts.map +0 -1
- package/build/ts/types/Heading.d.ts +0 -14
- package/build/ts/types/Heading.d.ts.map +0 -1
- package/build/ts/types/InlineStack.d.ts +0 -19
- package/build/ts/types/InlineStack.d.ts.map +0 -1
- package/build/ts/types/index.d.ts +0 -6
- package/build/ts/types/index.d.ts.map +0 -1
- package/build/ts/types/shared/Spacing.d.ts +0 -2
- package/build/ts/types/shared/Spacing.d.ts.map +0 -1
- package/build/ts/types/shared/index.d.ts +0 -2
- package/build/ts/types/shared/index.d.ts.map +0 -1
- package/src/types/Banner.ts +0 -12
- package/src/types/BlockStack.ts +0 -14
- package/src/types/Button.ts +0 -45
- package/src/types/Heading.ts +0 -14
- package/src/types/InlineStack.ts +0 -19
- package/src/types/index.ts +0 -5
- package/src/types/shared/Spacing.ts +0 -7
- package/src/types/shared/index.ts +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {RenderExtension} from '../../extension';
|
|
2
|
+
|
|
3
|
+
import type {AnyComponent} from './shared';
|
|
4
|
+
import type {StandardApi, CartLineDetailsRenderAfterApi} from './api';
|
|
5
|
+
|
|
6
|
+
export interface ExtensionPoints {
|
|
7
|
+
'Checkout::Dynamic::Render': RenderExtension<
|
|
8
|
+
StandardApi<'Checkout::Dynamic::Render'>,
|
|
9
|
+
AnyComponent
|
|
10
|
+
>;
|
|
11
|
+
'Checkout::CartLineDetails::RenderAfter': RenderExtension<
|
|
12
|
+
CartLineDetailsRenderAfterApi,
|
|
13
|
+
AnyComponent
|
|
14
|
+
>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type ExtensionPoint = keyof ExtensionPoints;
|
|
18
|
+
|
|
19
|
+
export type ExtensionForExtensionPoint<
|
|
20
|
+
T extends ExtensionPoint
|
|
21
|
+
> = ExtensionPoints[T];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {RemoteComponentType} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
type ComponentTypes = typeof import('./components');
|
|
4
|
+
|
|
5
|
+
export type Components = {
|
|
6
|
+
[K in keyof ComponentTypes]: ComponentTypes[K] extends RemoteComponentType<
|
|
7
|
+
any,
|
|
8
|
+
any
|
|
9
|
+
>
|
|
10
|
+
? ComponentTypes[K]
|
|
11
|
+
: never;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type AnyComponent = Components[keyof Components];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {createRemoteRoot} from '@remote-ui/core';
|
|
2
|
+
import type {
|
|
3
|
+
RenderExtension,
|
|
4
|
+
RenderExtensionWithRemoteRoot,
|
|
5
|
+
} from '../extension';
|
|
6
|
+
|
|
7
|
+
export interface ExtensionRegistrationFunction<ExtensionPoints> {
|
|
8
|
+
<Point extends keyof ExtensionPoints>(
|
|
9
|
+
_extensionPoint: Point,
|
|
10
|
+
extensionWithRemoteRoot: ExtensionPoints[Point] extends RenderExtension<
|
|
11
|
+
infer Api,
|
|
12
|
+
infer AllowedComponents
|
|
13
|
+
>
|
|
14
|
+
? RenderExtensionWithRemoteRoot<Api, AllowedComponents>
|
|
15
|
+
: ExtensionPoints[Point],
|
|
16
|
+
): ExtensionPoints[Point];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This function takes an extension function that is expecting a `RemoteRoot` as its
|
|
21
|
+
* first argument, and returns a new function that accepts a `RemoteChannel` instead.
|
|
22
|
+
* This is a convenience that allows the raw UI extension API to only expose the simpler
|
|
23
|
+
* `RemoteChannel` type, while allowing the extension to use the more powerful `RemoteRoot`,
|
|
24
|
+
* provided by a version of `@remote-ui/core` that the extension controls.
|
|
25
|
+
*/
|
|
26
|
+
export function createExtensionRegistrationFunction<
|
|
27
|
+
ExtensionPoints
|
|
28
|
+
>(): ExtensionRegistrationFunction<ExtensionPoints> {
|
|
29
|
+
const extensionWrapper: ExtensionRegistrationFunction<ExtensionPoints> = (
|
|
30
|
+
_extensionPoint,
|
|
31
|
+
extensionWithRemoteRoot,
|
|
32
|
+
) => {
|
|
33
|
+
async function extension(...args: any[]) {
|
|
34
|
+
// This handles extensions that do not take a `RemoteChannel` as their first argument.
|
|
35
|
+
// This is true for ”non-rendering” extension points, like `Checkout::PostPurchase::ShouldRender`.
|
|
36
|
+
if (
|
|
37
|
+
args.length === 1 ||
|
|
38
|
+
typeof args[0] !== 'object' ||
|
|
39
|
+
args[0] == null ||
|
|
40
|
+
!('channel' in args[0])
|
|
41
|
+
) {
|
|
42
|
+
const result = await (extensionWithRemoteRoot as any)(...args);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const [{channel, components}, ...rest] = args;
|
|
47
|
+
|
|
48
|
+
const root = createRemoteRoot(channel, {components, strict: true});
|
|
49
|
+
|
|
50
|
+
const result = await (extensionWithRemoteRoot as any)(root, ...rest);
|
|
51
|
+
await root.mount();
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return extension as any;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return extensionWrapper;
|
|
60
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Spacing';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Spacing';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare type Status = 'critical' | 'info' | 'success' | 'warning';
|
|
2
|
-
export interface BaseBannerProps {
|
|
3
|
-
/** Callback fired when banner is dismissed. */
|
|
4
|
-
onDismiss?: () => void;
|
|
5
|
-
/** Visual treatment of the banner based on message purpose. */
|
|
6
|
-
status?: Status;
|
|
7
|
-
/** Title of the banner. */
|
|
8
|
-
title?: string;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=Banner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/types/Banner.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Spacing } from './shared';
|
|
2
|
-
export interface BaseBlockStackProps {
|
|
3
|
-
/**
|
|
4
|
-
* Specifies the inline alignment. This affects the horizontal flow of elements.
|
|
5
|
-
* @defaultValue `leading`
|
|
6
|
-
*/
|
|
7
|
-
inlineAlignment?: 'leading' | 'center' | 'trailing';
|
|
8
|
-
/**
|
|
9
|
-
* Adjusts spacing between children.
|
|
10
|
-
* @defaultValue 'base'
|
|
11
|
-
**/
|
|
12
|
-
spacing?: Spacing;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=BlockStack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockStack.d.ts","sourceRoot":"","sources":["../../../src/types/BlockStack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IACpD;;;QAGI;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export interface BaseButtonProps {
|
|
2
|
-
/**
|
|
3
|
-
* The type of button that will be rendered.
|
|
4
|
-
*
|
|
5
|
-
* `primary`: button used for main actions or green-path. Ex: Continue to next step, Discount field
|
|
6
|
-
* `secondary`: button used for secondary actions not blocking user progress. Ex: Download Shop app
|
|
7
|
-
* `plain`: Renders a button that visually looks like a Link
|
|
8
|
-
* @default 'secondary'
|
|
9
|
-
*/
|
|
10
|
-
kind?: 'primary' | 'secondary' | 'plain';
|
|
11
|
-
/**
|
|
12
|
-
* Specifies the color of the Button. The button will keep the style of the chosen `kind`,
|
|
13
|
-
* but replace its color according to the appearance.
|
|
14
|
-
*
|
|
15
|
-
* `monochrome`: button will inherit the color of its parent
|
|
16
|
-
* `critical`: button will take inherit the color of the Critical color group (in Checkout)
|
|
17
|
-
* and map to 'destructive' (in Admin/Polaris). Typically used for destructive actions.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
appearance?: 'critical';
|
|
21
|
-
/** Changes the size of the button
|
|
22
|
-
* @default 'base'
|
|
23
|
-
*/
|
|
24
|
-
size?: 'base' | 'large';
|
|
25
|
-
/**
|
|
26
|
-
* Whether the button should fill all available inline space.
|
|
27
|
-
* */
|
|
28
|
-
inlineSize?: 'fill';
|
|
29
|
-
/**
|
|
30
|
-
* Replaces content with a loading indicator
|
|
31
|
-
*/
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* A label that will be announced to buyers using assistive technologies
|
|
35
|
-
*/
|
|
36
|
-
accessibilityLabel?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Disables the button, disallowing any interaction
|
|
39
|
-
*/
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Callback when pressed
|
|
43
|
-
*/
|
|
44
|
-
onPress?(): void;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/types/Button.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACzC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB;;SAEK;IACL,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;CAClB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare type Level = 1 | 2 | 3;
|
|
2
|
-
export interface BaseHeadingProps {
|
|
3
|
-
/**
|
|
4
|
-
* Unique identifier. Typically used to make the heading a target
|
|
5
|
-
* that another component can refer to in order to provide an alternative
|
|
6
|
-
* accessibility label.
|
|
7
|
-
*/
|
|
8
|
-
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The visual level of the heading.
|
|
11
|
-
*/
|
|
12
|
-
level?: Level;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/types/Heading.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9B,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Spacing } from './shared';
|
|
2
|
-
export interface BaseInlineStackProps {
|
|
3
|
-
/**
|
|
4
|
-
* Specifies the block alignment. This affects the vertical flow of elements.
|
|
5
|
-
* @defaultValue `leading`
|
|
6
|
-
*/
|
|
7
|
-
blockAlignment?: 'leading' | 'center' | 'trailing' | 'baseline';
|
|
8
|
-
/**
|
|
9
|
-
* Specifies the inline alignment. This affects the horizontal flow of elements.
|
|
10
|
-
* @defaultValue `leading`
|
|
11
|
-
*/
|
|
12
|
-
inlineAlignment?: 'leading' | 'center' | 'trailing';
|
|
13
|
-
/**
|
|
14
|
-
* Adjust spacing between children.
|
|
15
|
-
* @defaultValue 'base'
|
|
16
|
-
**/
|
|
17
|
-
spacing?: Spacing;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=InlineStack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineStack.d.ts","sourceRoot":"","sources":["../../../src/types/InlineStack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;IAChE;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IACpD;;;QAGI;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { BaseBannerProps } from './Banner';
|
|
2
|
-
export type { BaseBlockStackProps } from './BlockStack';
|
|
3
|
-
export type { BaseButtonProps } from './Button';
|
|
4
|
-
export type { BaseHeadingProps } from './Heading';
|
|
5
|
-
export type { BaseInlineStackProps } from './InlineStack';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACtD,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAChD,YAAY,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spacing.d.ts","sourceRoot":"","sources":["../../../../src/types/shared/Spacing.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO,GACf,MAAM,GACN,YAAY,GACZ,OAAO,GACP,MAAM,GACN,OAAO,GACP,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/src/types/Banner.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type Status = 'critical' | 'info' | 'success' | 'warning';
|
|
2
|
-
|
|
3
|
-
export interface BaseBannerProps {
|
|
4
|
-
/** Callback fired when banner is dismissed. */
|
|
5
|
-
onDismiss?: () => void;
|
|
6
|
-
|
|
7
|
-
/** Visual treatment of the banner based on message purpose. */
|
|
8
|
-
status?: Status;
|
|
9
|
-
|
|
10
|
-
/** Title of the banner. */
|
|
11
|
-
title?: string;
|
|
12
|
-
}
|
package/src/types/BlockStack.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type {Spacing} from './shared';
|
|
2
|
-
|
|
3
|
-
export interface BaseBlockStackProps {
|
|
4
|
-
/**
|
|
5
|
-
* Specifies the inline alignment. This affects the horizontal flow of elements.
|
|
6
|
-
* @defaultValue `leading`
|
|
7
|
-
*/
|
|
8
|
-
inlineAlignment?: 'leading' | 'center' | 'trailing';
|
|
9
|
-
/**
|
|
10
|
-
* Adjusts spacing between children.
|
|
11
|
-
* @defaultValue 'base'
|
|
12
|
-
**/
|
|
13
|
-
spacing?: Spacing;
|
|
14
|
-
}
|
package/src/types/Button.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface BaseButtonProps {
|
|
2
|
-
/**
|
|
3
|
-
* The type of button that will be rendered.
|
|
4
|
-
*
|
|
5
|
-
* `primary`: button used for main actions or green-path. Ex: Continue to next step, Discount field
|
|
6
|
-
* `secondary`: button used for secondary actions not blocking user progress. Ex: Download Shop app
|
|
7
|
-
* `plain`: Renders a button that visually looks like a Link
|
|
8
|
-
* @default 'secondary'
|
|
9
|
-
*/
|
|
10
|
-
kind?: 'primary' | 'secondary' | 'plain';
|
|
11
|
-
/**
|
|
12
|
-
* Specifies the color of the Button. The button will keep the style of the chosen `kind`,
|
|
13
|
-
* but replace its color according to the appearance.
|
|
14
|
-
*
|
|
15
|
-
* `monochrome`: button will inherit the color of its parent
|
|
16
|
-
* `critical`: button will take inherit the color of the Critical color group (in Checkout)
|
|
17
|
-
* and map to 'destructive' (in Admin/Polaris). Typically used for destructive actions.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
appearance?: 'critical';
|
|
21
|
-
/** Changes the size of the button
|
|
22
|
-
* @default 'base'
|
|
23
|
-
*/
|
|
24
|
-
size?: 'base' | 'large';
|
|
25
|
-
/**
|
|
26
|
-
* Whether the button should fill all available inline space.
|
|
27
|
-
* */
|
|
28
|
-
inlineSize?: 'fill';
|
|
29
|
-
/**
|
|
30
|
-
* Replaces content with a loading indicator
|
|
31
|
-
*/
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* A label that will be announced to buyers using assistive technologies
|
|
35
|
-
*/
|
|
36
|
-
accessibilityLabel?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Disables the button, disallowing any interaction
|
|
39
|
-
*/
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Callback when pressed
|
|
43
|
-
*/
|
|
44
|
-
onPress?(): void;
|
|
45
|
-
}
|
package/src/types/Heading.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type Level = 1 | 2 | 3;
|
|
2
|
-
|
|
3
|
-
export interface BaseHeadingProps {
|
|
4
|
-
/**
|
|
5
|
-
* Unique identifier. Typically used to make the heading a target
|
|
6
|
-
* that another component can refer to in order to provide an alternative
|
|
7
|
-
* accessibility label.
|
|
8
|
-
*/
|
|
9
|
-
id?: string;
|
|
10
|
-
/**
|
|
11
|
-
* The visual level of the heading.
|
|
12
|
-
*/
|
|
13
|
-
level?: Level;
|
|
14
|
-
}
|
package/src/types/InlineStack.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type {Spacing} from './shared';
|
|
2
|
-
|
|
3
|
-
export interface BaseInlineStackProps {
|
|
4
|
-
/**
|
|
5
|
-
* Specifies the block alignment. This affects the vertical flow of elements.
|
|
6
|
-
* @defaultValue `leading`
|
|
7
|
-
*/
|
|
8
|
-
blockAlignment?: 'leading' | 'center' | 'trailing' | 'baseline';
|
|
9
|
-
/**
|
|
10
|
-
* Specifies the inline alignment. This affects the horizontal flow of elements.
|
|
11
|
-
* @defaultValue `leading`
|
|
12
|
-
*/
|
|
13
|
-
inlineAlignment?: 'leading' | 'center' | 'trailing';
|
|
14
|
-
/**
|
|
15
|
-
* Adjust spacing between children.
|
|
16
|
-
* @defaultValue 'base'
|
|
17
|
-
**/
|
|
18
|
-
spacing?: Spacing;
|
|
19
|
-
}
|
package/src/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Spacing';
|