strapi-plugin-oidc 1.7.2 → 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-BJqQjQee.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-BkJB6R7y.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 }) {
@@ -71,7 +71,7 @@ const TagInputWrapper = styled(Box)`
71
71
  border: 1px solid ${({ theme }) => theme.colors.neutral200};
72
72
  background-color: ${({ theme }) => theme.colors.neutral0};
73
73
  cursor: text;
74
- min-width: 180px;
74
+ min-width: 220px;
75
75
  min-height: 4rem;
76
76
  flex: 0 0 auto;
77
77
 
@@ -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,
@@ -510,7 +510,24 @@ function getDaysInMonth(year, month) {
510
510
  const userLocale = typeof navigator !== "undefined" && navigator.language || "en-US";
511
511
  const MONTH_FORMATTER = new Intl.DateTimeFormat(userLocale, { month: "long" });
512
512
  const WEEKDAY_FORMATTER = new Intl.DateTimeFormat(userLocale, { weekday: "short" });
513
- const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, { dateStyle: "full" });
513
+ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
514
+ year: "numeric",
515
+ month: "short",
516
+ day: "numeric"
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
+ }
514
531
  function toUtcMidnightIso(date) {
515
532
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
516
533
  }
@@ -558,7 +575,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
558
575
  const handleConfirm = () => {
559
576
  if (pendingDates.length === 0) return;
560
577
  const sortedPending = [...pendingDates].sort((a, b) => a.getTime() - b.getTime());
561
- 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]);
562
579
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
563
580
  const selection = { dates: datesStr, display };
564
581
  onChange([...value, selection]);
@@ -978,7 +995,7 @@ function Whitelist({
978
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: [
979
996
  /* @__PURE__ */ jsx(Td, { children: index + 1 + (page - 1) * PAGE_SIZE$1 }),
980
997
  /* @__PURE__ */ jsx(Td, { children: user.email }),
981
- /* @__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" } }) }),
982
999
  /* @__PURE__ */ jsx(Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsx(
983
1000
  Flex,
984
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-B0piQv3P.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 };
@@ -75,7 +75,7 @@ const TagInputWrapper = styled__default.default(designSystem.Box)`
75
75
  border: 1px solid ${({ theme }) => theme.colors.neutral200};
76
76
  background-color: ${({ theme }) => theme.colors.neutral0};
77
77
  cursor: text;
78
- min-width: 180px;
78
+ min-width: 220px;
79
79
  min-height: 4rem;
80
80
  flex: 0 0 auto;
81
81
 
@@ -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,
@@ -514,7 +514,24 @@ function getDaysInMonth(year, month) {
514
514
  const userLocale = typeof navigator !== "undefined" && navigator.language || "en-US";
515
515
  const MONTH_FORMATTER = new Intl.DateTimeFormat(userLocale, { month: "long" });
516
516
  const WEEKDAY_FORMATTER = new Intl.DateTimeFormat(userLocale, { weekday: "short" });
517
- const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, { dateStyle: "full" });
517
+ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
518
+ year: "numeric",
519
+ month: "short",
520
+ day: "numeric"
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
+ }
518
535
  function toUtcMidnightIso(date) {
519
536
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
520
537
  }
@@ -562,7 +579,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
562
579
  const handleConfirm = () => {
563
580
  if (pendingDates.length === 0) return;
564
581
  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])}`;
582
+ const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : formatRange(sortedPending[0], sortedPending[sortedPending.length - 1]);
566
583
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
567
584
  const selection = { dates: datesStr, display };
568
585
  onChange([...value, selection]);
@@ -982,7 +999,7 @@ function Whitelist({
982
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: [
983
1000
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: index$1 + 1 + (page - 1) * PAGE_SIZE$1 }),
984
1001
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: user.email }),
985
- /* @__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" } }) }),
986
1003
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
987
1004
  designSystem.Flex,
988
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-hjzLEp0H.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-B0piQv3P.js");
3
+ const index = require("./index-BxbFHOUO.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "./index-BkJB6R7y.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.2",
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",