strapi-plugin-oidc 1.7.3 → 1.7.5

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-BjmTHbr9.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-BfX_taLq.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;
@@ -139,6 +139,7 @@ function TagInputShell({
139
139
  inputProps,
140
140
  children
141
141
  }) {
142
+ const inputId = useId();
142
143
  return /* @__PURE__ */ jsxs(TagInputWrapper, { ref: wrapperRef, onClick: () => inputRef.current?.focus(), children: [
143
144
  /* @__PURE__ */ jsxs(Flex, { gap: 2, wrap: "wrap", alignItems: "center", style: { flex: 1, minWidth: 0 }, children: [
144
145
  startIcon && /* @__PURE__ */ jsx(StartIconSlot, { children: startIcon }),
@@ -148,9 +149,16 @@ function TagInputShell({
148
149
  {
149
150
  ref: inputRef,
150
151
  type: "text",
151
- autoComplete: "off",
152
152
  placeholder: value.length === 0 ? placeholder : "",
153
153
  "aria-label": placeholder,
154
+ autoComplete: "off",
155
+ autoCorrect: "off",
156
+ autoCapitalize: "off",
157
+ spellCheck: false,
158
+ name: `tag-input-${inputId}`,
159
+ "data-form-type": "other",
160
+ "data-lpignore": "true",
161
+ "data-1p-ignore": "true",
154
162
  ...inputProps
155
163
  }
156
164
  )
@@ -515,6 +523,19 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
515
523
  month: "short",
516
524
  day: "numeric"
517
525
  });
526
+ function formatRange(start, end) {
527
+ const sameYear = start.getFullYear() === end.getFullYear();
528
+ const sameMonth = sameYear && start.getMonth() === end.getMonth();
529
+ const startStr = DATE_FORMATTER.format(start);
530
+ const endStr = DATE_FORMATTER.format(end);
531
+ if (sameMonth) {
532
+ return `${start.getDate()} – ${endStr}`;
533
+ }
534
+ if (sameYear) {
535
+ return `${startStr.split(" ").slice(0, 2).join(" ")} – ${endStr}`;
536
+ }
537
+ return `${startStr} – ${endStr}`;
538
+ }
518
539
  function toUtcMidnightIso(date) {
519
540
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
520
541
  }
@@ -562,7 +583,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
562
583
  const handleConfirm = () => {
563
584
  if (pendingDates.length === 0) return;
564
585
  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])}`;
586
+ const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : formatRange(sortedPending[0], sortedPending[sortedPending.length - 1]);
566
587
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
567
588
  const selection = { dates: datesStr, display };
568
589
  onChange([...value, selection]);
@@ -982,7 +1003,7 @@ function Whitelist({
982
1003
  /* @__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
1004
  /* @__PURE__ */ jsx(Td, { children: index + 1 + (page - 1) * PAGE_SIZE$1 }),
984
1005
  /* @__PURE__ */ jsx(Td, { children: user.email }),
985
- /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(LocalizedDate, { date: user.createdAt, options: { month: "long" } }) }),
1006
+ /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(LocalizedDate, { date: user.createdAt, options: { second: "2-digit" } }) }),
986
1007
  /* @__PURE__ */ jsx(Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsx(
987
1008
  Flex,
988
1009
  {
@@ -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-CacQfQ3a.js"));
170
170
  },
171
171
  permissions: [{ action: "plugin::strapi-plugin-oidc.read", subject: null }]
172
172
  }
@@ -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-CLUIKIK3.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;
@@ -143,6 +143,7 @@ function TagInputShell({
143
143
  inputProps,
144
144
  children
145
145
  }) {
146
+ const inputId = react.useId();
146
147
  return /* @__PURE__ */ jsxRuntime.jsxs(TagInputWrapper, { ref: wrapperRef, onClick: () => inputRef.current?.focus(), children: [
147
148
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", alignItems: "center", style: { flex: 1, minWidth: 0 }, children: [
148
149
  startIcon && /* @__PURE__ */ jsxRuntime.jsx(StartIconSlot, { children: startIcon }),
@@ -152,9 +153,16 @@ function TagInputShell({
152
153
  {
153
154
  ref: inputRef,
154
155
  type: "text",
155
- autoComplete: "off",
156
156
  placeholder: value.length === 0 ? placeholder : "",
157
157
  "aria-label": placeholder,
158
+ autoComplete: "off",
159
+ autoCorrect: "off",
160
+ autoCapitalize: "off",
161
+ spellCheck: false,
162
+ name: `tag-input-${inputId}`,
163
+ "data-form-type": "other",
164
+ "data-lpignore": "true",
165
+ "data-1p-ignore": "true",
158
166
  ...inputProps
159
167
  }
160
168
  )
@@ -519,6 +527,19 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(userLocale, {
519
527
  month: "short",
520
528
  day: "numeric"
521
529
  });
530
+ function formatRange(start, end) {
531
+ const sameYear = start.getFullYear() === end.getFullYear();
532
+ const sameMonth = sameYear && start.getMonth() === end.getMonth();
533
+ const startStr = DATE_FORMATTER.format(start);
534
+ const endStr = DATE_FORMATTER.format(end);
535
+ if (sameMonth) {
536
+ return `${start.getDate()} – ${endStr}`;
537
+ }
538
+ if (sameYear) {
539
+ return `${startStr.split(" ").slice(0, 2).join(" ")} – ${endStr}`;
540
+ }
541
+ return `${startStr} – ${endStr}`;
542
+ }
522
543
  function toUtcMidnightIso(date) {
523
544
  return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString();
524
545
  }
@@ -566,7 +587,7 @@ function TagDateInput({ value = [], onChange, placeholder, startIcon }) {
566
587
  const handleConfirm = () => {
567
588
  if (pendingDates.length === 0) return;
568
589
  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])}`;
590
+ const display = sortedPending.length === 1 ? DATE_FORMATTER.format(sortedPending[0]) : formatRange(sortedPending[0], sortedPending[sortedPending.length - 1]);
570
591
  const datesStr = sortedPending.length === 1 ? [toUtcMidnightIso(sortedPending[0])] : getDatesBetween(sortedPending[0], sortedPending[sortedPending.length - 1]);
571
592
  const selection = { dates: datesStr, display };
572
593
  onChange([...value, selection]);
@@ -986,7 +1007,7 @@ function Whitelist({
986
1007
  /* @__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
1008
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: index$1 + 1 + (page - 1) * PAGE_SIZE$1 }),
988
1009
  /* @__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" } }) }),
1010
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(LocalizedDate, { date: user.createdAt, options: { second: "2-digit" } }) }),
990
1011
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: { paddingRight: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
991
1012
  designSystem.Flex,
992
1013
  {
@@ -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-CLUIKIK3.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "./index-Bvgdj4LK.mjs";
1
+ import { i } from "./index-BfX_taLq.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.5",
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",