strapi-plugin-oidc 1.7.3 → 1.7.4

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.
@@ -165,7 +165,7 @@ const index = {
165
165
  defaultMessage: "Configuration"
166
166
  },
167
167
  Component: async () => {
168
- return await import("./index-XU0Tj5JN.mjs");
168
+ return await import("./index-BO4eHxAw.mjs");
169
169
  },
170
170
  permissions: [{ action: "plugin::strapi-plugin-oidc.read", subject: null }]
171
171
  }
@@ -5,7 +5,7 @@ import { useState, useRef, useId, useEffect, useCallback, useReducer, useMemo, m
5
5
  import { Typography, Flex, Box, MultiSelect, MultiSelectOption, Dialog, Button, Table, Pagination, PreviousLink, NextLink, PageLink, Field, Divider, Thead, Tr, Th, Tbody, Td, IconButton, Tooltip, Alert } from "@strapi/design-system";
6
6
  import { Cross, WarningCircle, Plus, Download, Upload, Trash, Calendar, Mail, Information } from "@strapi/icons";
7
7
  import { useIntl } from "react-intl";
8
- import { g as getTrad } from "./index-Bvgdj4LK.mjs";
8
+ import { g as getTrad } from "./index-5ifX6lA1.mjs";
9
9
  import styled from "styled-components";
10
10
  import { Filter, ClipboardList, Server } from "lucide-react";
11
11
  function Role({ oidcRoles, roles, onChangeRole }) {
@@ -80,7 +80,7 @@ const TagInputWrapper = styled(Box)`
80
80
  box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primary100};
81
81
  }
82
82
  `;
83
- const TagStyledInput = styled.input.attrs({ autocomplete: "off" })`
83
+ const TagStyledInput = styled.input`
84
84
  border: none;
85
85
  background: transparent;
86
86
  outline: none;
@@ -148,7 +148,6 @@ function TagInputShell({
148
148
  {
149
149
  ref: inputRef,
150
150
  type: "text",
151
- autoComplete: "off",
152
151
  placeholder: value.length === 0 ? placeholder : "",
153
152
  "aria-label": placeholder,
154
153
  ...inputProps
@@ -353,7 +352,8 @@ function ComboboxTagInput({ value, onChange, placeholder, startIcon, options })
353
352
  "aria-autocomplete": "list",
354
353
  "aria-expanded": dropdownOpen,
355
354
  "aria-controls": listboxId,
356
- "aria-activedescendant": activeDescendant
355
+ "aria-activedescendant": activeDescendant,
356
+ autoComplete: "off"
357
357
  },
358
358
  children: dropdownOpen && /* @__PURE__ */ jsx(Dropdown, { id: listboxId, role: "listbox", children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
359
359
  DropdownItem,
@@ -515,6 +515,19 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
515
515
  month: "short",
516
516
  day: "numeric"
517
517
  });
518
+ function formatRange(start, end) {
519
+ const sameYear = start.getFullYear() === end.getFullYear();
520
+ const sameMonth = sameYear && start.getMonth() === end.getMonth();
521
+ const startStr = DATE_FORMATTER.format(start);
522
+ const endStr = DATE_FORMATTER.format(end);
523
+ if (sameMonth) {
524
+ return `${start.getDate()} – ${endStr}`;
525
+ }
526
+ if (sameYear) {
527
+ return `${startStr.split(" ").slice(0, 2).join(" ")} – ${endStr}`;
528
+ }
529
+ return `${startStr} – ${endStr}`;
530
+ }
518
531
  function toUtcMidnightIso(date) {
519
532
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
520
533
  }
@@ -562,7 +575,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
562
575
  const handleConfirm = () => {
563
576
  if (pendingDates.length === 0) return;
564
577
  const sortedPending = [...pendingDates].sort((a, b) => a.getTime() - b.getTime());
565
- const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : `${DATE_FORMATTER.format(sortedPending[0])} – ${DATE_FORMATTER.format(sortedPending[sortedPending.length - 1])}`;
578
+ const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : formatRange(sortedPending[0], sortedPending[sortedPending.length - 1]);
566
579
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
567
580
  const selection = { dates: datesStr, display };
568
581
  onChange([...value, selection]);
@@ -982,7 +995,7 @@ function Whitelist({
982
995
  /* @__PURE__ */ jsx(Tbody, { children: users.length === 0 ? /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: 4, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", children: formatMessage(getTrad("whitelist.table.empty")) }) }) }) }) : paginatedUsers.map((user, index) => /* @__PURE__ */ jsxs(Tr, { children: [
983
996
  /* @__PURE__ */ jsx(Td, { children: index + 1 + (page - 1) * PAGE_SIZE$1 }),
984
997
  /* @__PURE__ */ jsx(Td, { children: user.email }),
985
- /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(LocalizedDate, { date: user.createdAt, options: { month: "long" } }) }),
998
+ /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(LocalizedDate, { date: user.createdAt, options: { second: "2-digit" } }) }),
986
999
  /* @__PURE__ */ jsx(Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsx(
987
1000
  Flex,
988
1001
  {
@@ -7,7 +7,7 @@ const react = require("react");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const reactIntl = require("react-intl");
10
- const index = require("./index-DKHHaEkG.js");
10
+ const index = require("./index-BxbFHOUO.js");
11
11
  const styled = require("styled-components");
12
12
  const lucideReact = require("lucide-react");
13
13
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
@@ -84,7 +84,7 @@ const TagInputWrapper = styled__default.default(designSystem.Box)`
84
84
  box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primary100};
85
85
  }
86
86
  `;
87
- const TagStyledInput = styled__default.default.input.attrs({ autocomplete: "off" })`
87
+ const TagStyledInput = styled__default.default.input`
88
88
  border: none;
89
89
  background: transparent;
90
90
  outline: none;
@@ -152,7 +152,6 @@ function TagInputShell({
152
152
  {
153
153
  ref: inputRef,
154
154
  type: "text",
155
- autoComplete: "off",
156
155
  placeholder: value.length === 0 ? placeholder : "",
157
156
  "aria-label": placeholder,
158
157
  ...inputProps
@@ -357,7 +356,8 @@ function ComboboxTagInput({ value, onChange, placeholder, startIcon, options })
357
356
  "aria-autocomplete": "list",
358
357
  "aria-expanded": dropdownOpen,
359
358
  "aria-controls": listboxId,
360
- "aria-activedescendant": activeDescendant
359
+ "aria-activedescendant": activeDescendant,
360
+ autoComplete: "off"
361
361
  },
362
362
  children: dropdownOpen && /* @__PURE__ */ jsxRuntime.jsx(Dropdown, { id: listboxId, role: "listbox", children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsxRuntime.jsx(
363
363
  DropdownItem,
@@ -519,6 +519,19 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
519
519
  month: "short",
520
520
  day: "numeric"
521
521
  });
522
+ function formatRange(start, end) {
523
+ const sameYear = start.getFullYear() === end.getFullYear();
524
+ const sameMonth = sameYear && start.getMonth() === end.getMonth();
525
+ const startStr = DATE_FORMATTER.format(start);
526
+ const endStr = DATE_FORMATTER.format(end);
527
+ if (sameMonth) {
528
+ return `${start.getDate()} – ${endStr}`;
529
+ }
530
+ if (sameYear) {
531
+ return `${startStr.split(" ").slice(0, 2).join(" ")} – ${endStr}`;
532
+ }
533
+ return `${startStr} – ${endStr}`;
534
+ }
522
535
  function toUtcMidnightIso(date) {
523
536
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
524
537
  }
@@ -566,7 +579,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
566
579
  const handleConfirm = () => {
567
580
  if (pendingDates.length === 0) return;
568
581
  const sortedPending = [...pendingDates].sort((a, b) => a.getTime() - b.getTime());
569
- const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : `${DATE_FORMATTER.format(sortedPending[0])} – ${DATE_FORMATTER.format(sortedPending[sortedPending.length - 1])}`;
582
+ const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : formatRange(sortedPending[0], sortedPending[sortedPending.length - 1]);
570
583
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
571
584
  const selection = { dates: datesStr, display };
572
585
  onChange([...value, selection]);
@@ -986,7 +999,7 @@ function Whitelist({
986
999
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: users.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tr, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { colSpan: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", children: formatMessage(index.getTrad("whitelist.table.empty")) }) }) }) }) : paginatedUsers.map((user, index$1) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
987
1000
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: index$1 + 1 + (page - 1) * PAGE_SIZE$1 }),
988
1001
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: user.email }),
989
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(LocalizedDate, { date: user.createdAt, options: { month: "long" } }) }),
1002
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(LocalizedDate, { date: user.createdAt, options: { second: "2-digit" } }) }),
990
1003
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
991
1004
  designSystem.Flex,
992
1005
  {
@@ -166,7 +166,7 @@ const index = {
166
166
  defaultMessage: "Configuration"
167
167
  },
168
168
  Component: async () => {
169
- return await Promise.resolve().then(() => require("./index-CLNsX-aa.js"));
169
+ return await Promise.resolve().then(() => require("./index-Bkm_yRhZ.js"));
170
170
  },
171
171
  permissions: [{ action: "plugin::strapi-plugin-oidc.read", subject: null }]
172
172
  }
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const index = require("./index-DKHHaEkG.js");
3
+ const index = require("./index-BxbFHOUO.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "./index-Bvgdj4LK.mjs";
1
+ import { i } from "./index-5ifX6lA1.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-oidc",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "A Strapi plugin that provides OpenID Connect (OIDC) authentication functionality for the Strapi Admin Panel.",
5
5
  "strapi": {
6
6
  "displayName": "OIDC Plugin",