@adobe/aio-commerce-lib-admin-ui 1.0.0 → 1.0.1-alpha-20260819113253
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/CHANGELOG.md +10 -0
- package/dist/cjs/{acl-resource-id-D_hCU1Qg.cjs → acl-resource-id-R52pR3gG.cjs} +0 -1
- package/dist/cjs/api/index.cjs +5 -4
- package/dist/cjs/grid-columns/index.cjs +4 -4
- package/dist/cjs/mass-actions/index.cjs +4 -4
- package/dist/cjs/menu/index.cjs +1 -1
- package/dist/cjs/order-view-buttons/index.cjs +4 -4
- package/dist/cjs/{rolldown-runtime-Cx6hovH8.cjs → rolldown-runtime-Bf2WWRga.cjs} +1 -2
- package/dist/cjs/{schemas-Ce10uBzN.cjs → schemas-DRhCF0TF.cjs} +1 -1
- package/dist/cjs/{utils-B59fjd_w.cjs → utils-CiBhSMw4.cjs} +1 -1
- package/dist/cjs/web/index.cjs +27 -15
- package/dist/cjs/web/index.d.cts +5 -3
- package/dist/es/api/index.mjs +2 -1
- package/dist/es/web/index.d.mts +5 -3
- package/dist/es/web/index.mjs +26 -14
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-admin-ui
|
|
2
2
|
|
|
3
|
+
## 1.0.1-alpha-20260819113253
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#635](https://github.com/adobe/aio-commerce-sdk/pull/635) [`8a51d9b`](https://github.com/adobe/aio-commerce-sdk/commit/8a51d9b9269c4af5e8ebb400ff975b86ec1b75f2) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - StrictMode is now applied only in development builds.
|
|
9
|
+
|
|
10
|
+
- Updated dependencies []:
|
|
11
|
+
- @adobe/aio-commerce-lib-api@1.3.1-alpha-20260819113253
|
|
12
|
+
|
|
3
13
|
## 1.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
package/dist/cjs/api/index.cjs
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require('../rolldown-runtime-
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
18
|
-
const require_utils = require('../utils-
|
|
16
|
+
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-R52pR3gG.cjs');
|
|
18
|
+
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
19
19
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
20
20
|
let _adobe_aio_commerce_lib_api = require("@adobe/aio-commerce-lib-api");
|
|
21
21
|
let valibot = require("valibot");
|
|
@@ -139,7 +139,8 @@ const permissionCheckResponseSchema = valibot.object({ allowed: valibot.boolean(
|
|
|
139
139
|
* @throws {@link HTTPError} if the response status is not in the 2xx range.
|
|
140
140
|
*/
|
|
141
141
|
async function checkPermission(httpClient, params) {
|
|
142
|
-
|
|
142
|
+
const raw = await httpClient.post("adminuisdk/permission/check", { json: { resource: params.resource } }).json();
|
|
143
|
+
return require_utils.parseOrThrow(permissionCheckResponseSchema, raw);
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
//#endregion
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require('../rolldown-runtime-
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
const require_utils = require('../utils-
|
|
16
|
+
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-R52pR3gG.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
|
+
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
21
21
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
22
22
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require('../rolldown-runtime-
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
const require_utils = require('../utils-
|
|
16
|
+
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-R52pR3gG.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
|
+
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
21
21
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
22
22
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
package/dist/cjs/menu/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
16
|
+
const require_acl_resource_id = require('../acl-resource-id-R52pR3gG.cjs');
|
|
17
17
|
|
|
18
18
|
//#region source/menu/acl-resource-id.ts
|
|
19
19
|
/**
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require('../rolldown-runtime-
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
const require_utils = require('../utils-
|
|
16
|
+
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-R52pR3gG.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
|
+
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
21
21
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
22
22
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
@@ -46,13 +46,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
46
46
|
}
|
|
47
47
|
return to;
|
|
48
48
|
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
50
50
|
value: mod,
|
|
51
51
|
enumerable: true
|
|
52
52
|
}) : target, mod));
|
|
53
53
|
|
|
54
54
|
//#endregion
|
|
55
|
-
|
|
56
55
|
Object.defineProperty(exports, '__exportAll', {
|
|
57
56
|
enumerable: true,
|
|
58
57
|
get: function () {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const require_rolldown_runtime = require('./rolldown-runtime-
|
|
15
|
+
const require_rolldown_runtime = require('./rolldown-runtime-Bf2WWRga.cjs');
|
|
16
16
|
let valibot = require("valibot");
|
|
17
17
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const require_rolldown_runtime = require('./rolldown-runtime-
|
|
15
|
+
const require_rolldown_runtime = require('./rolldown-runtime-Bf2WWRga.cjs');
|
|
16
16
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
17
17
|
let valibot = require("valibot");
|
|
18
18
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
package/dist/cjs/web/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require('../rolldown-runtime-
|
|
16
|
+
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
17
|
let react = require("react");
|
|
18
18
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
19
19
|
let _adobe_exc_app = require("@adobe/exc-app");
|
|
@@ -163,10 +163,11 @@ function useSharedContext() {
|
|
|
163
163
|
* @param guestConnection - The established guest connection.
|
|
164
164
|
*/
|
|
165
165
|
function useLiveSharedContext(guestConnection) {
|
|
166
|
-
|
|
166
|
+
const subscribe = (0, react.useCallback)((onContextChange) => {
|
|
167
167
|
if (!guestConnection) return () => void 0;
|
|
168
168
|
return guestConnection.addEventListener("contextchange", onContextChange);
|
|
169
|
-
}, [guestConnection])
|
|
169
|
+
}, [guestConnection]);
|
|
170
|
+
return (0, react.useSyncExternalStore)(subscribe, () => guestConnection?.sharedContext ?? null);
|
|
170
171
|
}
|
|
171
172
|
/**
|
|
172
173
|
* Provides the Commerce shared context for a mounted Admin UI iframe app.
|
|
@@ -237,7 +238,8 @@ function getCommerceHostPromise(extensionId, connection) {
|
|
|
237
238
|
const { integration } = connection.host;
|
|
238
239
|
if (!integration) return error("The host does not provide the integration API needed to resolve the Commerce host.");
|
|
239
240
|
try {
|
|
240
|
-
|
|
241
|
+
const commerceHost = await integration.getCommerceHost();
|
|
242
|
+
return ok({ commerceHost });
|
|
241
243
|
} catch (cause) {
|
|
242
244
|
return error("Failed to resolve the Commerce host.", { cause });
|
|
243
245
|
}
|
|
@@ -656,9 +658,10 @@ function ControlFrameRegistration(props) {
|
|
|
656
658
|
*/
|
|
657
659
|
function CommerceGuestConnection(props) {
|
|
658
660
|
const { extensionId } = props;
|
|
661
|
+
const guestConnection = useGuestConnection(extensionId);
|
|
659
662
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SharedContextProvider, {
|
|
660
663
|
extensionId,
|
|
661
|
-
guestConnection
|
|
664
|
+
guestConnection,
|
|
662
665
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommerceExtensionContent, {})
|
|
663
666
|
});
|
|
664
667
|
}
|
|
@@ -666,8 +669,9 @@ function CommerceGuestConnection(props) {
|
|
|
666
669
|
function CommerceExtensionContent() {
|
|
667
670
|
const { data, error } = useSharedContext();
|
|
668
671
|
if (error) throw error;
|
|
672
|
+
const credentials = resolveCommerceImsCredentials(data.sharedContext);
|
|
669
673
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImsContextProvider, {
|
|
670
|
-
credentials
|
|
674
|
+
credentials,
|
|
671
675
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_router.Outlet, {})
|
|
672
676
|
});
|
|
673
677
|
}
|
|
@@ -756,13 +760,16 @@ function ExperienceShellExtensionApp(props) {
|
|
|
756
760
|
*/
|
|
757
761
|
function ShellExtensionContent(props) {
|
|
758
762
|
const { initialConfigurationPromise, runtime } = props;
|
|
759
|
-
const
|
|
763
|
+
const initialConfiguration = (0, react.use)(initialConfigurationPromise);
|
|
764
|
+
const shellConfiguration = useShellConfiguration(runtime, initialConfiguration);
|
|
760
765
|
const spectrumRouter = useSpectrumRouter();
|
|
766
|
+
const colorScheme = useExtensionColorScheme(shellConfiguration);
|
|
767
|
+
const credentials = resolveShellImsCredentials(shellConfiguration);
|
|
761
768
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_spectrum_s2_Provider.Provider, {
|
|
762
|
-
colorScheme
|
|
769
|
+
colorScheme,
|
|
763
770
|
router: spectrumRouter,
|
|
764
771
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExtensionErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImsContextProvider, {
|
|
765
|
-
credentials
|
|
772
|
+
credentials,
|
|
766
773
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_router.Outlet, {})
|
|
767
774
|
}) })
|
|
768
775
|
});
|
|
@@ -810,9 +817,11 @@ function Entrypoint(props) {
|
|
|
810
817
|
* Mounts a Commerce Admin UI iframe app and handles Experience Cloud Shell, UIX
|
|
811
818
|
* registration, shared-context attachment, routing, and Spectrum setup.
|
|
812
819
|
*
|
|
813
|
-
* The app is wrapped in React's `<StrictMode
|
|
814
|
-
*
|
|
815
|
-
* an extra setup + cleanup cycle on mount. Production builds
|
|
820
|
+
* The app is wrapped in React's `<StrictMode>` only in development builds
|
|
821
|
+
* (`process.env.NODE_ENV !== "production"`), so components render twice and effects
|
|
822
|
+
* run an extra setup + cleanup cycle on mount. Production builds
|
|
823
|
+
* (`process.env.NODE_ENV === "production"`) render without `<StrictMode>`, so it is
|
|
824
|
+
* stripped from the production bundle.
|
|
816
825
|
*
|
|
817
826
|
* @param options - App bootstrap options.
|
|
818
827
|
*
|
|
@@ -833,15 +842,18 @@ function createExtensionApp({ menu, metadata, routes = [], root: customRoot }) {
|
|
|
833
842
|
if (!rootElement) throw new Error("Could not find an element with id \"root\".");
|
|
834
843
|
const root = (0, react_dom_client.createRoot)(rootElement);
|
|
835
844
|
const render = (runtime, initialConfigurationPromise) => {
|
|
836
|
-
const
|
|
845
|
+
const entrypointProps = {
|
|
837
846
|
extensionId: metadata.extensionId,
|
|
838
847
|
initialConfigurationPromise,
|
|
839
848
|
runtime
|
|
840
|
-
}
|
|
849
|
+
};
|
|
850
|
+
const entrypoint = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Entrypoint, { ...entrypointProps });
|
|
851
|
+
const router = createExtensionRouter(entrypoint, menu === void 0 ? routes : [{
|
|
841
852
|
element: menu,
|
|
842
853
|
path: "/"
|
|
843
854
|
}, ...routes]);
|
|
844
|
-
|
|
855
|
+
const tree = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_router.RouterProvider, { router });
|
|
856
|
+
root.render(process.env.NODE_ENV === "production" ? tree : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.StrictMode, { children: tree }));
|
|
845
857
|
};
|
|
846
858
|
try {
|
|
847
859
|
loadExperienceCloudRuntime();
|
package/dist/cjs/web/index.d.cts
CHANGED
|
@@ -189,9 +189,11 @@ type CreateExtensionAppOptions = {
|
|
|
189
189
|
* Mounts a Commerce Admin UI iframe app and handles Experience Cloud Shell, UIX
|
|
190
190
|
* registration, shared-context attachment, routing, and Spectrum setup.
|
|
191
191
|
*
|
|
192
|
-
* The app is wrapped in React's `<StrictMode
|
|
193
|
-
*
|
|
194
|
-
* an extra setup + cleanup cycle on mount. Production builds
|
|
192
|
+
* The app is wrapped in React's `<StrictMode>` only in development builds
|
|
193
|
+
* (`process.env.NODE_ENV !== "production"`), so components render twice and effects
|
|
194
|
+
* run an extra setup + cleanup cycle on mount. Production builds
|
|
195
|
+
* (`process.env.NODE_ENV === "production"`) render without `<StrictMode>`, so it is
|
|
196
|
+
* stripped from the production bundle.
|
|
195
197
|
*
|
|
196
198
|
* @param options - App bootstrap options.
|
|
197
199
|
*
|
package/dist/es/api/index.mjs
CHANGED
|
@@ -153,7 +153,8 @@ const permissionCheckResponseSchema = v.object({ allowed: v.boolean() });
|
|
|
153
153
|
* @throws {@link HTTPError} if the response status is not in the 2xx range.
|
|
154
154
|
*/
|
|
155
155
|
async function checkPermission(httpClient, params) {
|
|
156
|
-
|
|
156
|
+
const raw = await httpClient.post("adminuisdk/permission/check", { json: { resource: params.resource } }).json();
|
|
157
|
+
return parseOrThrow(permissionCheckResponseSchema, raw);
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
//#endregion
|
package/dist/es/web/index.d.mts
CHANGED
|
@@ -189,9 +189,11 @@ type CreateExtensionAppOptions = {
|
|
|
189
189
|
* Mounts a Commerce Admin UI iframe app and handles Experience Cloud Shell, UIX
|
|
190
190
|
* registration, shared-context attachment, routing, and Spectrum setup.
|
|
191
191
|
*
|
|
192
|
-
* The app is wrapped in React's `<StrictMode
|
|
193
|
-
*
|
|
194
|
-
* an extra setup + cleanup cycle on mount. Production builds
|
|
192
|
+
* The app is wrapped in React's `<StrictMode>` only in development builds
|
|
193
|
+
* (`process.env.NODE_ENV !== "production"`), so components render twice and effects
|
|
194
|
+
* run an extra setup + cleanup cycle on mount. Production builds
|
|
195
|
+
* (`process.env.NODE_ENV === "production"`) render without `<StrictMode>`, so it is
|
|
196
|
+
* stripped from the production bundle.
|
|
195
197
|
*
|
|
196
198
|
* @param options - App bootstrap options.
|
|
197
199
|
*
|
package/dist/es/web/index.mjs
CHANGED
|
@@ -158,10 +158,11 @@ function useSharedContext() {
|
|
|
158
158
|
* @param guestConnection - The established guest connection.
|
|
159
159
|
*/
|
|
160
160
|
function useLiveSharedContext(guestConnection) {
|
|
161
|
-
|
|
161
|
+
const subscribe = useCallback((onContextChange) => {
|
|
162
162
|
if (!guestConnection) return () => void 0;
|
|
163
163
|
return guestConnection.addEventListener("contextchange", onContextChange);
|
|
164
|
-
}, [guestConnection])
|
|
164
|
+
}, [guestConnection]);
|
|
165
|
+
return useSyncExternalStore(subscribe, () => guestConnection?.sharedContext ?? null);
|
|
165
166
|
}
|
|
166
167
|
/**
|
|
167
168
|
* Provides the Commerce shared context for a mounted Admin UI iframe app.
|
|
@@ -232,7 +233,8 @@ function getCommerceHostPromise(extensionId, connection) {
|
|
|
232
233
|
const { integration } = connection.host;
|
|
233
234
|
if (!integration) return error("The host does not provide the integration API needed to resolve the Commerce host.");
|
|
234
235
|
try {
|
|
235
|
-
|
|
236
|
+
const commerceHost = await integration.getCommerceHost();
|
|
237
|
+
return ok({ commerceHost });
|
|
236
238
|
} catch (cause) {
|
|
237
239
|
return error("Failed to resolve the Commerce host.", { cause });
|
|
238
240
|
}
|
|
@@ -651,9 +653,10 @@ function ControlFrameRegistration(props) {
|
|
|
651
653
|
*/
|
|
652
654
|
function CommerceGuestConnection(props) {
|
|
653
655
|
const { extensionId } = props;
|
|
656
|
+
const guestConnection = useGuestConnection(extensionId);
|
|
654
657
|
return /* @__PURE__ */ jsx(SharedContextProvider, {
|
|
655
658
|
extensionId,
|
|
656
|
-
guestConnection
|
|
659
|
+
guestConnection,
|
|
657
660
|
children: /* @__PURE__ */ jsx(CommerceExtensionContent, {})
|
|
658
661
|
});
|
|
659
662
|
}
|
|
@@ -661,8 +664,9 @@ function CommerceGuestConnection(props) {
|
|
|
661
664
|
function CommerceExtensionContent() {
|
|
662
665
|
const { data, error } = useSharedContext();
|
|
663
666
|
if (error) throw error;
|
|
667
|
+
const credentials = resolveCommerceImsCredentials(data.sharedContext);
|
|
664
668
|
return /* @__PURE__ */ jsx(ImsContextProvider, {
|
|
665
|
-
credentials
|
|
669
|
+
credentials,
|
|
666
670
|
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
667
671
|
});
|
|
668
672
|
}
|
|
@@ -751,13 +755,16 @@ function ExperienceShellExtensionApp(props) {
|
|
|
751
755
|
*/
|
|
752
756
|
function ShellExtensionContent(props) {
|
|
753
757
|
const { initialConfigurationPromise, runtime } = props;
|
|
754
|
-
const
|
|
758
|
+
const initialConfiguration = use(initialConfigurationPromise);
|
|
759
|
+
const shellConfiguration = useShellConfiguration(runtime, initialConfiguration);
|
|
755
760
|
const spectrumRouter = useSpectrumRouter();
|
|
761
|
+
const colorScheme = useExtensionColorScheme(shellConfiguration);
|
|
762
|
+
const credentials = resolveShellImsCredentials(shellConfiguration);
|
|
756
763
|
return /* @__PURE__ */ jsx(Provider, {
|
|
757
|
-
colorScheme
|
|
764
|
+
colorScheme,
|
|
758
765
|
router: spectrumRouter,
|
|
759
766
|
children: /* @__PURE__ */ jsx(ExtensionErrorBoundary, { children: /* @__PURE__ */ jsx(ImsContextProvider, {
|
|
760
|
-
credentials
|
|
767
|
+
credentials,
|
|
761
768
|
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
762
769
|
}) })
|
|
763
770
|
});
|
|
@@ -805,9 +812,11 @@ function Entrypoint(props) {
|
|
|
805
812
|
* Mounts a Commerce Admin UI iframe app and handles Experience Cloud Shell, UIX
|
|
806
813
|
* registration, shared-context attachment, routing, and Spectrum setup.
|
|
807
814
|
*
|
|
808
|
-
* The app is wrapped in React's `<StrictMode
|
|
809
|
-
*
|
|
810
|
-
* an extra setup + cleanup cycle on mount. Production builds
|
|
815
|
+
* The app is wrapped in React's `<StrictMode>` only in development builds
|
|
816
|
+
* (`process.env.NODE_ENV !== "production"`), so components render twice and effects
|
|
817
|
+
* run an extra setup + cleanup cycle on mount. Production builds
|
|
818
|
+
* (`process.env.NODE_ENV === "production"`) render without `<StrictMode>`, so it is
|
|
819
|
+
* stripped from the production bundle.
|
|
811
820
|
*
|
|
812
821
|
* @param options - App bootstrap options.
|
|
813
822
|
*
|
|
@@ -828,15 +837,18 @@ function createExtensionApp({ menu, metadata, routes = [], root: customRoot }) {
|
|
|
828
837
|
if (!rootElement) throw new Error("Could not find an element with id \"root\".");
|
|
829
838
|
const root = createRoot(rootElement);
|
|
830
839
|
const render = (runtime, initialConfigurationPromise) => {
|
|
831
|
-
const
|
|
840
|
+
const entrypointProps = {
|
|
832
841
|
extensionId: metadata.extensionId,
|
|
833
842
|
initialConfigurationPromise,
|
|
834
843
|
runtime
|
|
835
|
-
}
|
|
844
|
+
};
|
|
845
|
+
const entrypoint = /* @__PURE__ */ jsx(Entrypoint, { ...entrypointProps });
|
|
846
|
+
const router = createExtensionRouter(entrypoint, menu === void 0 ? routes : [{
|
|
836
847
|
element: menu,
|
|
837
848
|
path: "/"
|
|
838
849
|
}, ...routes]);
|
|
839
|
-
|
|
850
|
+
const tree = /* @__PURE__ */ jsx(RouterProvider, { router });
|
|
851
|
+
root.render(process.env.NODE_ENV === "production" ? tree : /* @__PURE__ */ jsx(StrictMode, { children: tree }));
|
|
840
852
|
};
|
|
841
853
|
try {
|
|
842
854
|
loadExperienceCloudRuntime();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-admin-ui",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Adobe Inc.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.1-alpha-20260819113253",
|
|
6
6
|
"private": false,
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22 <=24"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"ky": "^1.9.0",
|
|
114
114
|
"react-error-boundary": "^6.1.2",
|
|
115
115
|
"valibot": "^1.1.0",
|
|
116
|
-
"@adobe/aio-commerce-lib-api": "1.3.
|
|
116
|
+
"@adobe/aio-commerce-lib-api": "1.3.1-alpha-20260819113253",
|
|
117
117
|
"@adobe/aio-commerce-lib-core": "1.2.0"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
@@ -142,10 +142,10 @@
|
|
|
142
142
|
"@aio-commerce-sdk/common-utils": "0.2.6",
|
|
143
143
|
"@aio-commerce-sdk/config-tsdown": "1.0.1",
|
|
144
144
|
"@aio-commerce-sdk/config-typedoc": "1.0.0",
|
|
145
|
+
"@aio-commerce-sdk/config-typescript": "1.0.0",
|
|
145
146
|
"@aio-commerce-sdk/config-vitest": "1.0.0",
|
|
146
|
-
"@aio-commerce-sdk/scripting-utils": "0.3.
|
|
147
|
-
"@aio-commerce-sdk/scripts": "0.1.
|
|
148
|
-
"@aio-commerce-sdk/config-typescript": "1.0.0"
|
|
147
|
+
"@aio-commerce-sdk/scripting-utils": "0.3.5-alpha-20260819113253",
|
|
148
|
+
"@aio-commerce-sdk/scripts": "0.1.1"
|
|
149
149
|
},
|
|
150
150
|
"sideEffects": false,
|
|
151
151
|
"scripts": {
|