@amboras-dev/plugin-types 0.2.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/dist/index.d.mts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +40 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +31 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @amboras-dev/plugin-types
|
|
3
|
+
*
|
|
4
|
+
* Shared slot names and base types for the Amboras plugin slot system.
|
|
5
|
+
* Imported by both the storefront (amboras-starter-template) and the
|
|
6
|
+
* orchestrator backend (amboras-dev-orchestrator).
|
|
7
|
+
*
|
|
8
|
+
* No React dependency — this package is environment-agnostic.
|
|
9
|
+
* React-specific types (ProviderEntry, ComponentEntry, PluginRegistry)
|
|
10
|
+
* live in the storefront's types/plugins.ts and extend from here.
|
|
11
|
+
*/
|
|
12
|
+
declare const SLOT_NAMES: readonly ["head", "bodyEnd", "rootProviders", "homeHero", "homeBelowFeatured", "pdpAfterTitle", "pdpBeforePrice", "pdpBelowAddToCart", "pdpTrustSignals", "pdpAfterDescription", "pdpTab", "pdpAnalytics", "collectionAboveGrid", "collectionCard", "collectionBelowGrid", "cartDrawerFooter", "cartUpdate", "checkoutOrderSummary", "checkoutStart", "checkoutComplete", "searchAboveResults", "accountOverview", "account", "authSignup"];
|
|
13
|
+
type SlotName = (typeof SLOT_NAMES)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Shape of a head / bodyEnd script injection entry.
|
|
16
|
+
* No React dependency — strategy values are Next.js Script strategies.
|
|
17
|
+
*/
|
|
18
|
+
interface ScriptEntry {
|
|
19
|
+
id: string;
|
|
20
|
+
src: string;
|
|
21
|
+
/** Controls when Next.js loads the script relative to React hydration. */
|
|
22
|
+
strategy: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive';
|
|
23
|
+
/**
|
|
24
|
+
* Dot-path condition, e.g. "config.publicKey".
|
|
25
|
+
* Only inject the script if this config key is truthy.
|
|
26
|
+
*/
|
|
27
|
+
when?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime plugin configuration from /store/integrations/active.
|
|
31
|
+
* { [pluginId]: { enabled: boolean, ...pluginSpecificConfig } }
|
|
32
|
+
*/
|
|
33
|
+
type PluginConfigs = Record<string, {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
} & Record<string, unknown>>;
|
|
36
|
+
|
|
37
|
+
export { type PluginConfigs, SLOT_NAMES, type ScriptEntry, type SlotName };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @amboras-dev/plugin-types
|
|
3
|
+
*
|
|
4
|
+
* Shared slot names and base types for the Amboras plugin slot system.
|
|
5
|
+
* Imported by both the storefront (amboras-starter-template) and the
|
|
6
|
+
* orchestrator backend (amboras-dev-orchestrator).
|
|
7
|
+
*
|
|
8
|
+
* No React dependency — this package is environment-agnostic.
|
|
9
|
+
* React-specific types (ProviderEntry, ComponentEntry, PluginRegistry)
|
|
10
|
+
* live in the storefront's types/plugins.ts and extend from here.
|
|
11
|
+
*/
|
|
12
|
+
declare const SLOT_NAMES: readonly ["head", "bodyEnd", "rootProviders", "homeHero", "homeBelowFeatured", "pdpAfterTitle", "pdpBeforePrice", "pdpBelowAddToCart", "pdpTrustSignals", "pdpAfterDescription", "pdpTab", "pdpAnalytics", "collectionAboveGrid", "collectionCard", "collectionBelowGrid", "cartDrawerFooter", "cartUpdate", "checkoutOrderSummary", "checkoutStart", "checkoutComplete", "searchAboveResults", "accountOverview", "account", "authSignup"];
|
|
13
|
+
type SlotName = (typeof SLOT_NAMES)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Shape of a head / bodyEnd script injection entry.
|
|
16
|
+
* No React dependency — strategy values are Next.js Script strategies.
|
|
17
|
+
*/
|
|
18
|
+
interface ScriptEntry {
|
|
19
|
+
id: string;
|
|
20
|
+
src: string;
|
|
21
|
+
/** Controls when Next.js loads the script relative to React hydration. */
|
|
22
|
+
strategy: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive';
|
|
23
|
+
/**
|
|
24
|
+
* Dot-path condition, e.g. "config.publicKey".
|
|
25
|
+
* Only inject the script if this config key is truthy.
|
|
26
|
+
*/
|
|
27
|
+
when?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime plugin configuration from /store/integrations/active.
|
|
31
|
+
* { [pluginId]: { enabled: boolean, ...pluginSpecificConfig } }
|
|
32
|
+
*/
|
|
33
|
+
type PluginConfigs = Record<string, {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
} & Record<string, unknown>>;
|
|
36
|
+
|
|
37
|
+
export { type PluginConfigs, SLOT_NAMES, type ScriptEntry, type SlotName };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
SLOT_NAMES: () => SLOT_NAMES
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var SLOT_NAMES = [
|
|
27
|
+
// layout / global
|
|
28
|
+
"head",
|
|
29
|
+
"bodyEnd",
|
|
30
|
+
"rootProviders",
|
|
31
|
+
// homepage
|
|
32
|
+
"homeHero",
|
|
33
|
+
"homeBelowFeatured",
|
|
34
|
+
// product detail page
|
|
35
|
+
"pdpAfterTitle",
|
|
36
|
+
"pdpBeforePrice",
|
|
37
|
+
"pdpBelowAddToCart",
|
|
38
|
+
"pdpTrustSignals",
|
|
39
|
+
"pdpAfterDescription",
|
|
40
|
+
"pdpTab",
|
|
41
|
+
"pdpAnalytics",
|
|
42
|
+
// collection / category
|
|
43
|
+
"collectionAboveGrid",
|
|
44
|
+
"collectionCard",
|
|
45
|
+
"collectionBelowGrid",
|
|
46
|
+
// cart
|
|
47
|
+
"cartDrawerFooter",
|
|
48
|
+
"cartUpdate",
|
|
49
|
+
// checkout
|
|
50
|
+
"checkoutOrderSummary",
|
|
51
|
+
"checkoutStart",
|
|
52
|
+
"checkoutComplete",
|
|
53
|
+
// search
|
|
54
|
+
"searchAboveResults",
|
|
55
|
+
// account
|
|
56
|
+
"accountOverview",
|
|
57
|
+
"account",
|
|
58
|
+
// auth
|
|
59
|
+
"authSignup"
|
|
60
|
+
];
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
SLOT_NAMES
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @amboras-dev/plugin-types\n *\n * Shared slot names and base types for the Amboras plugin slot system.\n * Imported by both the storefront (amboras-starter-template) and the\n * orchestrator backend (amboras-dev-orchestrator).\n *\n * No React dependency — this package is environment-agnostic.\n * React-specific types (ProviderEntry, ComponentEntry, PluginRegistry)\n * live in the storefront's types/plugins.ts and extend from here.\n */\n\nexport const SLOT_NAMES = [\n // layout / global\n 'head',\n 'bodyEnd',\n 'rootProviders',\n // homepage\n 'homeHero',\n 'homeBelowFeatured',\n // product detail page\n 'pdpAfterTitle',\n 'pdpBeforePrice',\n 'pdpBelowAddToCart',\n 'pdpTrustSignals',\n 'pdpAfterDescription',\n 'pdpTab',\n 'pdpAnalytics',\n // collection / category\n 'collectionAboveGrid',\n 'collectionCard',\n 'collectionBelowGrid',\n // cart\n 'cartDrawerFooter',\n 'cartUpdate',\n // checkout\n 'checkoutOrderSummary',\n 'checkoutStart',\n 'checkoutComplete',\n // search\n 'searchAboveResults',\n // account\n 'accountOverview',\n 'account',\n // auth\n 'authSignup',\n] as const\n\nexport type SlotName = (typeof SLOT_NAMES)[number]\n\n/**\n * Shape of a head / bodyEnd script injection entry.\n * No React dependency — strategy values are Next.js Script strategies.\n */\nexport interface ScriptEntry {\n id: string\n src: string\n /** Controls when Next.js loads the script relative to React hydration. */\n strategy: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive'\n /**\n * Dot-path condition, e.g. \"config.publicKey\".\n * Only inject the script if this config key is truthy.\n */\n when?: string\n}\n\n/**\n * Runtime plugin configuration from /store/integrations/active.\n * { [pluginId]: { enabled: boolean, ...pluginSpecificConfig } }\n */\nexport type PluginConfigs = Record<string, { enabled: boolean } & Record<string, unknown>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,IAAM,aAAa;AAAA;AAAA,EAExB;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AACF;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var SLOT_NAMES = [
|
|
3
|
+
// layout / global
|
|
4
|
+
"head",
|
|
5
|
+
"bodyEnd",
|
|
6
|
+
"rootProviders",
|
|
7
|
+
// homepage
|
|
8
|
+
"homeHero",
|
|
9
|
+
"homeBelowFeatured",
|
|
10
|
+
// product detail page
|
|
11
|
+
"pdpAfterTitle",
|
|
12
|
+
"pdpBeforePrice",
|
|
13
|
+
"pdpBelowAddToCart",
|
|
14
|
+
"pdpTrustSignals",
|
|
15
|
+
"pdpAfterDescription",
|
|
16
|
+
"pdpTab",
|
|
17
|
+
"pdpAnalytics",
|
|
18
|
+
// collection / category
|
|
19
|
+
"collectionAboveGrid",
|
|
20
|
+
"collectionCard",
|
|
21
|
+
"collectionBelowGrid",
|
|
22
|
+
// cart
|
|
23
|
+
"cartDrawerFooter",
|
|
24
|
+
"cartUpdate",
|
|
25
|
+
// checkout
|
|
26
|
+
"checkoutOrderSummary",
|
|
27
|
+
"checkoutStart",
|
|
28
|
+
"checkoutComplete",
|
|
29
|
+
// search
|
|
30
|
+
"searchAboveResults",
|
|
31
|
+
// account
|
|
32
|
+
"accountOverview",
|
|
33
|
+
"account",
|
|
34
|
+
// auth
|
|
35
|
+
"authSignup"
|
|
36
|
+
];
|
|
37
|
+
export {
|
|
38
|
+
SLOT_NAMES
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @amboras-dev/plugin-types\n *\n * Shared slot names and base types for the Amboras plugin slot system.\n * Imported by both the storefront (amboras-starter-template) and the\n * orchestrator backend (amboras-dev-orchestrator).\n *\n * No React dependency — this package is environment-agnostic.\n * React-specific types (ProviderEntry, ComponentEntry, PluginRegistry)\n * live in the storefront's types/plugins.ts and extend from here.\n */\n\nexport const SLOT_NAMES = [\n // layout / global\n 'head',\n 'bodyEnd',\n 'rootProviders',\n // homepage\n 'homeHero',\n 'homeBelowFeatured',\n // product detail page\n 'pdpAfterTitle',\n 'pdpBeforePrice',\n 'pdpBelowAddToCart',\n 'pdpTrustSignals',\n 'pdpAfterDescription',\n 'pdpTab',\n 'pdpAnalytics',\n // collection / category\n 'collectionAboveGrid',\n 'collectionCard',\n 'collectionBelowGrid',\n // cart\n 'cartDrawerFooter',\n 'cartUpdate',\n // checkout\n 'checkoutOrderSummary',\n 'checkoutStart',\n 'checkoutComplete',\n // search\n 'searchAboveResults',\n // account\n 'accountOverview',\n 'account',\n // auth\n 'authSignup',\n] as const\n\nexport type SlotName = (typeof SLOT_NAMES)[number]\n\n/**\n * Shape of a head / bodyEnd script injection entry.\n * No React dependency — strategy values are Next.js Script strategies.\n */\nexport interface ScriptEntry {\n id: string\n src: string\n /** Controls when Next.js loads the script relative to React hydration. */\n strategy: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive'\n /**\n * Dot-path condition, e.g. \"config.publicKey\".\n * Only inject the script if this config key is truthy.\n */\n when?: string\n}\n\n/**\n * Runtime plugin configuration from /store/integrations/active.\n * { [pluginId]: { enabled: boolean, ...pluginSpecificConfig } }\n */\nexport type PluginConfigs = Record<string, { enabled: boolean } & Record<string, unknown>>\n"],"mappings":";AAYO,IAAM,aAAa;AAAA;AAAA,EAExB;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amboras-dev/plugin-types",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Shared slot names and base types for the Amboras plugin slot system",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsup": "^8.0.0",
|
|
21
|
+
"typescript": "^5.0.0",
|
|
22
|
+
"@types/node": "^20.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
}
|
|
31
|
+
}
|