@ory/elements-react 1.0.0-next.45 → 1.0.0-next.46

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 CHANGED
@@ -1,3 +1,14 @@
1
+ ## 1.0.0-next.46 (2025-04-16)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - missing hidden field regression ([#439](https://github.com/ory/elements/pull/439))
6
+ - use correct testid ([#438](https://github.com/ory/elements/pull/438))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - hackerman @aeneasr
11
+
1
12
  ## 1.0.0-next.45 (2025-04-15)
2
13
 
3
14
  ### 🩹 Fixes
package/dist/index.js CHANGED
@@ -192,20 +192,28 @@ function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
192
192
  function useNodesGroups(nodes, { omit } = {}) {
193
193
  const groupSorter = useGroupSorter();
194
194
  const groups = react.useMemo(() => {
195
- var _a;
195
+ var _a, _b;
196
196
  const groups2 = {};
197
+ const groupRetained = {};
197
198
  for (const node of nodes) {
199
+ const groupNodes = (_a = groups2[node.group]) != null ? _a : [];
200
+ groupNodes.push(node);
201
+ groups2[node.group] = groupNodes;
198
202
  if ((omit == null ? void 0 : omit.includes("script")) && clientFetch.isUiNodeScriptAttributes(node.attributes)) {
199
203
  continue;
200
204
  }
201
205
  if ((omit == null ? void 0 : omit.includes("input_hidden")) && clientFetch.isUiNodeInputAttributes(node.attributes) && node.attributes.type === "hidden") {
202
206
  continue;
203
207
  }
204
- const groupNodes = (_a = groups2[node.group]) != null ? _a : [];
205
- groupNodes.push(node);
206
- groups2[node.group] = groupNodes;
208
+ groupRetained[node.group] = ((_b = groupRetained[node.group]) != null ? _b : 0) + 1;
209
+ }
210
+ const finalGroups = {};
211
+ for (const [group, count] of Object.entries(groupRetained)) {
212
+ if (count > 0) {
213
+ finalGroups[group] = groups2[group];
214
+ }
207
215
  }
208
- return groups2;
216
+ return finalGroups;
209
217
  }, [nodes, omit]);
210
218
  const entries = react.useMemo(
211
219
  () => Object.entries(groups).sort(([a], [b]) => groupSorter(a, b)),
@@ -1215,14 +1223,14 @@ function OryTwoStepCard() {
1215
1223
  (node) => node.group === clientFetch.UiNodeGroupEnum.Oidc || node.group === clientFetch.UiNodeGroupEnum.Saml
1216
1224
  );
1217
1225
  const showSso = !(formState.current === "method_active" && !(formState.method === clientFetch.UiNodeGroupEnum.Oidc || formState.method === clientFetch.UiNodeGroupEnum.Saml));
1218
- const showSsoDivider = hasSso && nonSsoNodes.filter((n) => {
1226
+ const showSsoDivider = hasSso && nonSsoNodes.some((n) => {
1219
1227
  if (clientFetch.isUiNodeInputAttributes(n.attributes)) {
1220
1228
  return n.attributes.type !== clientFetch.UiNodeInputAttributesTypeEnum.Hidden;
1221
1229
  } else if (clientFetch.isUiNodeScriptAttributes(n.attributes)) {
1222
1230
  return false;
1223
1231
  }
1224
1232
  return true;
1225
- }).length > 0;
1233
+ });
1226
1234
  return /* @__PURE__ */ jsxRuntime.jsxs(OryCard, { children: [
1227
1235
  /* @__PURE__ */ jsxRuntime.jsx(OryCardHeader, {}),
1228
1236
  /* @__PURE__ */ jsxRuntime.jsxs(OryCardContent, { children: [
@@ -1239,22 +1247,24 @@ function OryTwoStepCard() {
1239
1247
  nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1240
1248
  ] }),
1241
1249
  formState.current === "select_method" && /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1242
- Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1243
- Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1244
- AuthMethodList,
1245
- {
1246
- options: authMethodBlocks,
1247
- setSelectedGroup: (group) => dispatchFormState({
1248
- type: "action_select_method",
1249
- method: group
1250
- })
1251
- }
1252
- ),
1250
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1251
+ /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1252
+ /* @__PURE__ */ jsxRuntime.jsx(
1253
+ AuthMethodList,
1254
+ {
1255
+ options: authMethodBlocks,
1256
+ setSelectedGroup: (group) => dispatchFormState({
1257
+ type: "action_select_method",
1258
+ method: group
1259
+ })
1260
+ }
1261
+ )
1262
+ ] }),
1253
1263
  authMethodAdditionalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1254
1264
  ] }),
1255
1265
  formState.current === "method_active" && /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1256
1266
  ui.nodes.filter(
1257
- (n) => clientFetch.isUiNodeScriptAttributes(n.attributes) || n.group === clientFetch.UiNodeGroupEnum.Captcha
1267
+ (n) => clientFetch.isUiNodeScriptAttributes(n.attributes) || n.group === clientFetch.UiNodeGroupEnum.Captcha || n.group === clientFetch.UiNodeGroupEnum.Default || n.group === clientFetch.UiNodeGroupEnum.Profile
1258
1268
  ).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)),
1259
1269
  finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1260
1270
  ] }),